From b11b40e1826e2089fcdf1cddf97a5dd0166ef917 Mon Sep 17 00:00:00 2001 From: zichun Date: Tue, 12 May 2026 18:04:09 +0800 Subject: [PATCH] docs: en wiki — narratives for all 1,864 stored procedures and functions --- en/docs/auto-catalog/functions/CALC_MATERIALS_SMAIL.md | 6 +++++- en/docs/auto-catalog/functions/FUN_DISTINCTJSON_REMOVE_BYNAME.md | 6 +++++- en/docs/auto-catalog/functions/FUN_GET_CALCPLAN_DATE_END.md | 6 +++++- en/docs/auto-catalog/functions/FUN_GET_CALC_DATE.md | 6 +++++- en/docs/auto-catalog/functions/FUN_GET_CALC_DATE_END.md | 6 +++++- en/docs/auto-catalog/functions/FUN_GET_DATE_BC.md | 6 +++++- en/docs/auto-catalog/functions/FUN_GET_DATE_BC_ADDTIME.md | 6 +++++- en/docs/auto-catalog/functions/FUN_GET_DATE_BC_STARTDATE.md | 6 +++++- en/docs/auto-catalog/functions/FUN_GET_DATE_BC_STARTDATE_NEW.md | 6 +++++- en/docs/auto-catalog/functions/FUN_GET_DATE_BC_STARTDATE_NEWTYPE.md | 6 +++++- en/docs/auto-catalog/functions/FUN_GET_DATE_BC_STARTDATE_NOW.md | 6 +++++- en/docs/auto-catalog/functions/FUN_GET_DATE_DIFF_MINUTE.md | 6 +++++- en/docs/auto-catalog/functions/FUN_GET_DATE_KT.md | 6 +++++- en/docs/auto-catalog/functions/FUN_GET_DATE_KT_ADD.md | 6 +++++- en/docs/auto-catalog/functions/FUN_GET_DATE_UKT.md | 6 +++++- en/docs/auto-catalog/functions/FUN_GET_DATE_UKT_ADD.md | 6 +++++- en/docs/auto-catalog/functions/FUN_GET_DATE_YX.md | 6 +++++- en/docs/auto-catalog/functions/FUN_GET_DECOMPOSECUSTOMIZE.md | 6 +++++- en/docs/auto-catalog/functions/FUN_GET_to_pinyin.md | 6 +++++- en/docs/auto-catalog/functions/FUN_JSON_CHAR.md | 6 +++++- en/docs/auto-catalog/functions/FUN_JSON_INT.md | 6 +++++- en/docs/auto-catalog/functions/FUN_MATERIALS_SMAIL.md | 6 +++++- en/docs/auto-catalog/functions/F_Gb2Big.md | 6 +++++- en/docs/auto-catalog/functions/Fn_ParseParams.md | 6 +++++- en/docs/auto-catalog/functions/Fn_find_pinyin.md | 6 +++++- en/docs/auto-catalog/functions/Fn_find_pinyin_copy1.md | 6 +++++- en/docs/auto-catalog/functions/Fn_fristPinyin.md | 6 +++++- en/docs/auto-catalog/functions/Fn_json_extract.md | 6 +++++- en/docs/auto-catalog/functions/Fn_spit_length.md | 6 +++++- en/docs/auto-catalog/functions/Fn_split_string.md | 6 +++++- en/docs/auto-catalog/functions/Fun_AnalysisListJson.md | 6 +++++- en/docs/auto-catalog/functions/Fun_AnalysisListJsonEnter.md | 6 +++++- en/docs/auto-catalog/functions/Fun_AnalysisListJsonOld.md | 6 +++++- en/docs/auto-catalog/functions/Fun_AnalysisListJsonTwo.md | 6 +++++- en/docs/auto-catalog/functions/Fun_AnalysisListJson_copy1.md | 6 +++++- en/docs/auto-catalog/functions/Fun_Cashier_GetMaterialsPrice.md | 6 +++++- en/docs/auto-catalog/functions/Fun_Cashier_GetMaterialsPrice_Quo.md | 6 +++++- en/docs/auto-catalog/functions/Fun_Cashier_GetMaterialsPrice_new.md | 6 +++++- en/docs/auto-catalog/functions/Fun_Cashier_GetProductPrice.md | 6 +++++- en/docs/auto-catalog/functions/Fun_Cashier_GetProductPrice_new.md | 6 +++++- en/docs/auto-catalog/functions/Fun_Exclusion_algorithm.md | 6 +++++- en/docs/auto-catalog/functions/Fun_FormulaReplace.md | 6 +++++- en/docs/auto-catalog/functions/Fun_Formula_Process.md | 6 +++++- en/docs/auto-catalog/functions/Fun_Gb2Big_ChineseToBig.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetAddBillNo.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetAddMapJson.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetAuxiliaryQtyUnit.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetBarId.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetBillStatus.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetBookStickQty.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetCalcMaterialsKs.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetCalcMaterialsKs1.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetCh.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetFatherProductId.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetGb.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetHumpDiff.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetJson_Length.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetLimitDate.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetListByJson_ByKey.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetListByJson_ByKey_split.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetListByJson_ByKey_wrap.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetListBy_BysCombineChild.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetListJson_ByKey.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetListJson_ByKey1.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetListJson_ByKey2.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetListJson_ByKey5.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetListJson_ByKey6.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetListJson_ByKeyNew.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetListJson_ByKey_copy1.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetListJson_ByName.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetListJson_ByNameAPS.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetLoginUser.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetLoginUserLanguage.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetLoginUserLanguage_copy1.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetLoginUserName.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetLoginUserType.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetLookCustomer.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetLookProcess.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetMachineLenWidth.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetMachineLenWidthAPS.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetMachineWorkEndDate.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetMachineWorkStartDate.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetMachineWorkWorkType.md | 8 +++++++- en/docs/auto-catalog/functions/Fun_GetMaterialsQtyUnit.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetMaterialsQtyUnitSupple.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetNum.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetNumFirst.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetPackQty.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetProcessAuxiliaryQty.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetReelAuxiliaryQtyUnit.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetReportId_byLogType.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetSystemSetting.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetTestCount.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetTestMaterialsCount.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetTrunkQty.md | 6 +++++- en/docs/auto-catalog/functions/Fun_Get_BracketContent.md | 6 +++++- en/docs/auto-catalog/functions/Fun_Get_BracketContentAll_JSON.md | 6 +++++- en/docs/auto-catalog/functions/Fun_Getcolorcount.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetcolorcountTest.md | 6 +++++- en/docs/auto-catalog/functions/Fun_Getcolorcount_CalcQty1.md | 6 +++++- en/docs/auto-catalog/functions/Fun_Getcolorcount_CalcQty2.md | 6 +++++- en/docs/auto-catalog/functions/Fun_Getcolorcount_new.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetknifeProcessQty.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetknifeReportQty.md | 6 +++++- en/docs/auto-catalog/functions/Fun_GetproductstockQty.md | 6 +++++- en/docs/auto-catalog/functions/Fun_HasJsonKey.md | 6 +++++- en/docs/auto-catalog/functions/Fun_JsonExistsColor_ByName.md | 6 +++++- en/docs/auto-catalog/functions/Fun_MoneyToCh.md | 6 +++++- en/docs/auto-catalog/functions/Fun_RemoveJsonEmptyKey.md | 6 +++++- en/docs/auto-catalog/functions/Fun_RemoveJsonKey.md | 6 +++++- en/docs/auto-catalog/functions/Fun_Sis_GetConst.md | 6 +++++- en/docs/auto-catalog/functions/Fun_Sis_GetConstNew.md | 6 +++++- en/docs/auto-catalog/functions/Fun_Subsequent_process.md | 6 +++++- en/docs/auto-catalog/functions/Fun_System_ReplaceField_JSON.md | 6 +++++- en/docs/auto-catalog/functions/Fun_bFilter_toWhere.md | 6 +++++- en/docs/auto-catalog/functions/Fun_box_pic.md | 6 +++++- en/docs/auto-catalog/functions/Fun_box_type.md | 6 +++++- en/docs/auto-catalog/functions/Fun_dReportQty.md | 6 +++++- en/docs/auto-catalog/functions/Fun_deleteManyChar.md | 6 +++++- en/docs/auto-catalog/functions/Fun_getDhouM.md | 6 +++++- en/docs/auto-catalog/functions/Fun_getInitColumnByProName.md | 6 +++++- en/docs/auto-catalog/functions/Fun_getMoneyFormart.md | 6 +++++- en/docs/auto-catalog/functions/Fun_getOneByKey.md | 6 +++++- en/docs/auto-catalog/functions/Fun_getPartNameStatus.md | 6 +++++- en/docs/auto-catalog/functions/Fun_getPlanDate.md | 6 +++++- en/docs/auto-catalog/functions/Fun_getProcessByControlName.md | 6 +++++- en/docs/auto-catalog/functions/Fun_getProcessByWorkOrderId.md | 6 +++++- en/docs/auto-catalog/functions/Fun_getProductMaxStyle.md | 6 +++++- en/docs/auto-catalog/functions/Fun_get_sProductId.md | 6 +++++- en/docs/auto-catalog/functions/Fun_get_sProductId_process.md | 6 +++++- en/docs/auto-catalog/functions/Fun_get_show_config.md | 6 +++++- en/docs/auto-catalog/functions/Fun_get_show_config_basic.md | 6 +++++- en/docs/auto-catalog/functions/Fun_get_show_config_hb.md | 6 +++++- en/docs/auto-catalog/functions/Fun_get_show_config_hbjz.md | 6 +++++- en/docs/auto-catalog/functions/Fun_get_show_config_hz.md | 6 +++++- en/docs/auto-catalog/functions/Fun_get_show_config_pup120.md | 6 +++++- en/docs/auto-catalog/functions/Fun_get_show_config_pup40.md | 6 +++++- en/docs/auto-catalog/functions/Fun_get_show_config_sear.md | 6 +++++- en/docs/auto-catalog/functions/Fun_get_show_config_witd40.md | 6 +++++- en/docs/auto-catalog/functions/Fun_get_show_config_ys.md | 6 +++++- en/docs/auto-catalog/functions/Fun_get_show_config_ys100.md | 6 +++++- en/docs/auto-catalog/functions/Fun_get_show_config_ys40.md | 6 +++++- en/docs/auto-catalog/functions/Fun_iCalcListJson.md | 6 +++++- en/docs/auto-catalog/functions/Fun_up_workOrderProcessId.md | 6 +++++- en/docs/auto-catalog/functions/GetChineseChar.md | 6 +++++- en/docs/auto-catalog/functions/GetDispatchUnit.md | 6 +++++- en/docs/auto-catalog/functions/GetMaterialsAuxiliaryQty.md | 6 +++++- en/docs/auto-catalog/functions/GetMaterialsPrice.md | 6 +++++- en/docs/auto-catalog/functions/GetNextMachine.md | 6 +++++- en/docs/auto-catalog/functions/GetPriorPlate.md | 6 +++++- en/docs/auto-catalog/functions/GetPriorProcess.md | 6 +++++- en/docs/auto-catalog/functions/GetPriorProcessPlan.md | 6 +++++- en/docs/auto-catalog/functions/IsNumeric.md | 6 +++++- en/docs/auto-catalog/functions/JSON_MERGE_REPLACE.md | 6 +++++- en/docs/auto-catalog/functions/NewId2.md | 6 +++++- en/docs/auto-catalog/functions/Sp_Sis_GetMertialsInventoryFormGuid.md | 6 +++++- en/docs/auto-catalog/functions/Stuff.md | 6 +++++- en/docs/auto-catalog/functions/fun_GetPreProcessQty.md | 6 +++++- en/docs/auto-catalog/functions/fun_getNextMonth_lasterWeekday.md | 6 +++++- en/docs/auto-catalog/functions/fun_getWorkProcess_NextId.md | 6 +++++- en/docs/auto-catalog/functions/fun_getWorkProcess_NextIdnew.md | 6 +++++- en/docs/auto-catalog/functions/fun_getWorkProcess_NextQty.md | 6 +++++- en/docs/auto-catalog/functions/fun_getWorkProcess_Next_WareHouseNo.md | 6 +++++- en/docs/auto-catalog/functions/fun_get_jurisdiction.md | 6 +++++- en/docs/auto-catalog/functions/fun_getaccordercostanalysiscost_diff.md | 6 +++++- en/docs/auto-catalog/functions/fun_getreportId_byArrMaterialsType.md | 6 +++++- en/docs/auto-catalog/functions/fun_getreportId_byMaterialsType.md | 6 +++++- en/docs/auto-catalog/functions/fun_getreportId_bycus.md | 6 +++++- en/docs/auto-catalog/functions/fun_gettzreportId_bycus.md | 6 +++++- en/docs/auto-catalog/functions/fun_workmaterials_used.md | 6 +++++- en/docs/auto-catalog/functions/fun_workprocess_used.md | 6 +++++- en/docs/auto-catalog/functions/fun_workproduct_used.md | 6 +++++- en/docs/auto-catalog/functions/get_config_data.md | 6 +++++- en/docs/auto-catalog/functions/get_config_data_JSON.md | 6 +++++- en/docs/auto-catalog/functions/newId.md | 6 +++++- en/docs/auto-catalog/functions/to_pinyin.md | 6 +++++- en/docs/auto-catalog/procedures/11.md | 6 +++++- en/docs/auto-catalog/procedures/Empty.md | 6 +++++- en/docs/auto-catalog/procedures/Fun_Gb2Big_ChineseToBig.md | 6 +++++- en/docs/auto-catalog/procedures/Fun_Get_Change_WorkOrderStatus.md | 6 +++++- en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELECUSTOMER.md | 6 +++++- en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEEMPLOYEE.md | 6 +++++- en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEMACHINE.md | 6 +++++- en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEMATERIALS.md | 6 +++++- en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEPROCESS.md | 6 +++++- en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEPRODUCT.md | 6 +++++- en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELETEAM.md | 6 +++++- en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEGDSMODULE.md | 6 +++++- en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEMFTWORKORDERCONTROL.md | 6 +++++- en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISCUSTOMERCLASSIFY.md | 6 +++++- en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISDELIVER.md | 6 +++++- en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISFORMULA.md | 6 +++++- en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISPAYMENT.md | 6 +++++- en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISPROCESSCLASSIFY.md | 6 +++++- en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISPRODUCTCLASSIFY.md | 6 +++++- en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISSALESMAN.md | 6 +++++- en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISTAX.md | 8 +++++++- en/docs/auto-catalog/procedures/PRO_ERPMERGEDELHISTORY.md | 6 +++++- en/docs/auto-catalog/procedures/PRO_ERPMERGEMFTWORKORDER.md | 8 +++++++- en/docs/auto-catalog/procedures/PRO_ERPMERGEPRODUCTIONREPORT.md | 8 +++++++- en/docs/auto-catalog/procedures/PRO_ERPMERGESALSALESORDER.md | 8 +++++++- en/docs/auto-catalog/procedures/PRO_MATERIALS_SMAIL.md | 6 +++++- en/docs/auto-catalog/procedures/SP_DeliverGoods_Warning.md | 6 +++++- en/docs/auto-catalog/procedures/SP_GetlogisticsPrice.md | 6 +++++- en/docs/auto-catalog/procedures/SP_Inventory_InOutWareHouseAll.md | 6 +++++- en/docs/auto-catalog/procedures/SP_Inventory_InOutWarehouse.md | 6 +++++- en/docs/auto-catalog/procedures/SP_Inventory_InOutWarehouseCost.md | 6 +++++- en/docs/auto-catalog/procedures/SP_Inventory_InOutWarehouse_220709.md | 6 +++++- en/docs/auto-catalog/procedures/SP_Inventory_InOutWarehouse_221111.md | 6 +++++- en/docs/auto-catalog/procedures/SP_Inventory_Materials_Inout_new.md | 6 +++++- en/docs/auto-catalog/procedures/SP_Inventory_ProductCalcQty.md | 6 +++++- en/docs/auto-catalog/procedures/SP_Inventory_ProductInOutWareHouse.md | 6 +++++- en/docs/auto-catalog/procedures/SP_Inventory_ProductInOutWarehouseCost.md | 6 +++++- en/docs/auto-catalog/procedures/SP_Inventory_ProductInOutWarehouseMoney.md | 6 +++++- en/docs/auto-catalog/procedures/SP_Inventory_Product_Inout_new.md | 6 +++++- en/docs/auto-catalog/procedures/SP_Inventory_SemgoodsInOutWareHouse.md | 6 +++++- en/docs/auto-catalog/procedures/SP_ProductStoreNowJN.md | 6 +++++- en/docs/auto-catalog/procedures/SP_Return_Flow.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_AL_SHDCheckSave.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Add_Flow.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_AdjustMoneyCl_BtnRepair.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_AdjustMoney_BtnRepair.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_AfterPost_sAcc.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_AfterPost_sQtt.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_AfterPost_sSod.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Ai_AddCommonAfter.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Ai_AddCommonAfterNew.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Ai_AddQuoQuoAfter.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Ai_AddSalsalOrder.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Ai_AddWorkOrder.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Ai_AiGlobalAgentQuestionThread.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Ai_AiSqlErrorHistoryThread.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Ai_AiUserAgentQuestionThread.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_CLReject.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_CPReject.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_Cahreceipt.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_Apply_Flow_Fksq.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_Fybx.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_MachineFix.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsApply.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsApplyLL.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsBack.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsBack_Proc1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsChange.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsPrice.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsReturn.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsTest.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsTest_Proc1.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsTest_Proc2.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsCheck.md | 16 +++++++++++----- en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsProcess.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsProduct.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsProductMore.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsProductMorebecome.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_Order.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_OrderChange.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_OrderChangeNew.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessChange.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessChange_Proc1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessChange_Proc2.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessTest.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessTest_Proc1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessTest_Proc2.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProductTest.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProductTest_Proc1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProductTest_Proc2.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProductVersion.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_PurCheck.md | 16 +++++++++++----- en/docs/auto-catalog/procedures/Sp_Apply_Flow_PurOrder.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_PurpurchaseOrder.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_Purpurchaseapply.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_Purpurchaseapplynew.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_Qualityaccident.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentCL.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentCustomer.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentMaterials.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentMaterials_Proc1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentNB.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentsSupply.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentsSupply_Proc1.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_ReturnWork.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_SalInvoice.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_Apply_Flow_SalSaleCheck.md | 16 +++++++++++----- en/docs/auto-catalog/procedures/Sp_Apply_Flow_SalSaleOrder.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_SalSalesNotify.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_StepPrice.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_Supply.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_Work.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_Ystz.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_Yzfy.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_materialspd.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_mftMaterialsReturn.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_productpd.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_sCustomer.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_sCustomerAccord.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_salDesign.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_salesmaterials.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_salesreturn.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Apply_Flow_salesreturnapply.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BatchGetSid.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop1.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop2.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop3.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop5.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop6.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_Bd_Root_Production.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus25.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus25_new.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus26.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_1.md | 12 ++++++++---- en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_1_new.md | 12 ++++++++---- en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_2.md | 12 ++++++++---- en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_2_new.md | 12 ++++++++---- en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_3.md | 12 ++++++++---- en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_3_new.md | 12 ++++++++---- en/docs/auto-catalog/procedures/Sp_Bd_bi16.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_Bd_bi17.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_Bd_bi18.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_Bd_bi18_nomes.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_Bd_bi19.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_Bd_bi20.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_Bd_bi20_1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Bd_bi20_1_new.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Bd_bi20_1_newZZT.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Bd_bi20_2.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Bd_bi20_2_nomes.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Bd_bi20_2new.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Bd_bi20_hh.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_Bd_bi20_ys.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_Bd_bi21.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_Bd_bi22.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_Bd_bi22_nomes.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_Bd_bi23.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_Bd_bi24.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_Bd_bi4.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_Bd_bi_Lostorder.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_hh.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_mt.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_pj.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_pm.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_sy.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_ys.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_ys_nomes.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_Bd_hy_workshop_oy.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_Bd_workefficiency.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Bd_workshop1.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BillOfApply.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BillOfApplyLine.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BillOfNoPicking.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BillOfNoPicking_Cljg.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BillOfNoPicking_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Bill_Force_Complete.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Bill_Force_Complete_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Bill_Used.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Bill_Used_Base.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnCalculation_Machine_time_byMachineType.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnCalculation_Machine_time_byMachineTypeEnd.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BtnEventCalculatewages.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnEventCalculatewages_bak.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnEventCalculatewages_financial.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnEventCopyGroupJurisdiction.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BtnEventCopyUserJurisdiction.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BtnEventDepartSure_New.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnEventMaterialsPost_New.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnEventMaterialsSure_New.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BtnEventProductInStoreSure_New.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BtnEventProductReportCancel.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnEventProductReportConfirm.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnEventProductSure_New.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BtnEventProductionmaterialSure_New.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BtnEventWorkPost_New.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnEvent_AccProductFrozen.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BtnEvent_AccProductUnFrozen.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BtnEvent_BillSlaveLastInstore.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnEvent_DeliverGoodsFinance.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnEvent_DeliverGoodsFinanceReset.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BtnEvent_DeliverGoodsFinanceSlave.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BtnEvent_KLLMaterialsItestFast.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnEvent_LogAheadComfirm.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnEvent_LogisticsComfirm.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BtnEvent_MaterialsItestFast.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnEvent_MaterialsItestType.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BtnEvent_NoPurchase.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BtnEvent_NotifyMerge.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BtnEvent_OpsInstoreComfirm.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BtnEvent_ProcessItestType.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnEvent_ProductItestType.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnEvent_PurInstoreComfirm.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnEvent_PurInstorePrintName.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnEvent_UpdateOpsAgainCar.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnEvent_UpdateOutProcessLogistics.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnEvent_WorkUnComplete.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BtnEvent_mitOutComfirm.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnEventworkcenterSure_New.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BtnRepairUpdateCheckMemo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnRepairUpdateJzMemo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateBackMemo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateBackStates.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateCustomer.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateGYSFKBackMemo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateGYSMaterialsMoney.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateLogSlavePrice.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateNotUsed.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdatePMC.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdatePlanMemo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateProcessMaster.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateSalesMaster.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateSalesSlave.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateWXFKBackMemo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateWXSMaterialsMoney.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateWorkOrderMaster.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdatesSupply.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnUpdate_InvoiceSubCheck.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_BtnUpdate_OnOpsConfirm.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BtnUpdate_OnOpsOrder.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BtnUpdate_OnPurOrder.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BtnUpdate_RevSupply.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_BtnUpdate_SalesMaterials.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_CTPPlanList_BtnEventFinished.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_CTPPlanList_BtnEventFinished_cut.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_CalcAttribDate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_CalcCost_BtnEventCalcCost.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_CalcCost_BtnEventReCalcCost.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_CalcCost_BtnEventReCalcCost_new.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_CalcPlan_dHour.md | 8 ++++++-- en/docs/auto-catalog/procedures/Sp_Calc_Change.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_Product.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_Scrap.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_about.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_borrow.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_clear.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_plateprocessing.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_pruOrderBgd.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sAcc.md | 15 ++++++++++++--- en/docs/auto-catalog/procedures/Sp_Calc_sAcc_YC.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sAcod.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sAsq.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sBBProcess.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sBac.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sBgd.md | 10 +++++++++- en/docs/auto-catalog/procedures/Sp_Calc_sBis.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sCcp.md | 10 +++++++++- en/docs/auto-catalog/procedures/Sp_Calc_sCio.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sCldApply.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sClfbx.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sCmt.md | 15 +++++++++++---- en/docs/auto-catalog/procedures/Sp_Calc_sCno.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sCoach.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sCps.md | 11 ++++++++++- en/docs/auto-catalog/procedures/Sp_Calc_sCut.md | 10 +++++++++- en/docs/auto-catalog/procedures/Sp_Calc_sCut333.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sDYDgd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sDesign.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sDevApply.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sDgd.md | 11 ++++++++++- en/docs/auto-catalog/procedures/Sp_Calc_sDgdCL.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sDgd_1226.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sDgd_20250612.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sDgn.md | 10 +++++++++- en/docs/auto-catalog/procedures/Sp_Calc_sEmmt.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sEmp.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sEmr.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sEmt.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sEtp.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sEtpCH.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sExp.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sFixe.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sFksq.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sFksq1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sFma.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sFtf.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sFybx.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sInded.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sLok.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sLos.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_Calc_sLos_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sMad.md | 10 +++++++++- en/docs/auto-catalog/procedures/Sp_Calc_sMat.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sMaterials.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sMaterialsBgd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sMcd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sMft.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sMit.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sMit1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sMma.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sMmm.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sMmm_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sModule.md | 12 ++++++++---- en/docs/auto-catalog/procedures/Sp_Calc_sMpa.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sMpd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sMpp.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sMpt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sMpz.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sMsc.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sMsy.md | 12 ++++++++---- en/docs/auto-catalog/procedures/Sp_Calc_sOdt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sOis.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sOiv.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sOpc.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_Calc_sOpi.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sOpi1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sOpkg.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sOpn.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_Calc_sOpn1.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_Calc_sOpp.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_Calc_sOppbecome.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sOrderBgd.md | 10 +++++++++- en/docs/auto-catalog/procedures/Sp_Calc_sOsa.md | 10 +++++++++- en/docs/auto-catalog/procedures/Sp_Calc_sOutProcess.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPaj.md | 10 +++++++++- en/docs/auto-catalog/procedures/Sp_Calc_sPca.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPca1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPck.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPct.md | 10 +++++++++- en/docs/auto-catalog/procedures/Sp_Calc_sPct1.md | 17 +++++++++++++---- en/docs/auto-catalog/procedures/Sp_Calc_sPct2.md | 16 ++++++++++++---- en/docs/auto-catalog/procedures/Sp_Calc_sPct3.md | 12 ++++++++---- en/docs/auto-catalog/procedures/Sp_Calc_sPctOEE.md | 12 ++++++++---- en/docs/auto-catalog/procedures/Sp_Calc_sPdt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPdtFJ.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPin.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPis.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPit.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPit1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPit2.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPiv.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPiv_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPkg.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPmd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPmd_old.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPmt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPmt_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPoc.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPod.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPpa.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPpa1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPpn.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPpr.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPqa.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sPrice.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPrj.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sProd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sProductChange.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sPrw.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sPsa.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPst.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPst_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sPtr.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sQtt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sQtt_hm.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sRbm.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sRct.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sRct_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sRcts.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sRetunWork.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sRev.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sRgd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sRgd1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sRgdApply.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sRgd_new.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sSample.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sScc.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sScd.md | 10 +++++++++- en/docs/auto-catalog/procedures/Sp_Calc_sSck.md | 10 +++++++++- en/docs/auto-catalog/procedures/Sp_Calc_sScr.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sScxl.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sSdfu.md | 10 +++++++++- en/docs/auto-catalog/procedures/Sp_Calc_sSdp.md | 11 ++++++++++- en/docs/auto-catalog/procedures/Sp_Calc_sSdv.md | 12 +++++++++++- en/docs/auto-catalog/procedures/Sp_Calc_sSfu.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sSgm.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sSiv.md | 10 +++++++++- en/docs/auto-catalog/procedures/Sp_Calc_sSmb.md | 10 +++++++++- en/docs/auto-catalog/procedures/Sp_Calc_sSmc.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sSmi.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sSmia.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sSmo.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sSmoa.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sSod.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sSodAfter.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sSodbecome.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sSpfu.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sSpp.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sStd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sStl.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sStl_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sSuBJ.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sSup.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sSupply.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sUdf.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sUdft.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sWod.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sYear.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sYsTb.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_sYzfy.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_scusded.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_sopsded.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_spurded.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Calc_tice.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Calc_tore.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Cashier_BankJournal.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Cashier_CashJournal.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Cashier_GetCostMaterialsPrice.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Cashier_GetMaterialsPrice.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Cashier_GetProductPrice.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Cashier_OrderMoneyWarning.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Cashier_SumJournal.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Cashier_SumJournalTodayMoney.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Change_WorkOrderStatus.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_CheckChild_sPdt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_CheckChild_sPst.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_CheckExceedReport.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_CheckSalSendCar_RepalceField.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_QlyMaterialRule.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_SaveOeeReport.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_SaveOeeReportAAA.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_SaveOeeReportCheck.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_dOraQtyTs.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_eleteststandardFeed.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_eleteststandardFirst.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_eleteststandardPatrol.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_eleteststandardProcess.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Check_eleteststandardProduct.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_mftProductionReportValue.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_mftProductionReportValueTest.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sAcc.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sCio.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sCmt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sCut.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sDgd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sDgd_bak.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sDgda.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sDgda_phone.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sDgn.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sFksq.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sFybx.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sLok.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sLos.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sLosTest.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sMad.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sMcd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sMpa.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sMpt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sOdt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sOis.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sOiv.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sOpc.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sOpi.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sOpkg.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sOpn.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sOpn1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sOpp.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sOsa.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sPaj.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sPca.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sPca1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sPct.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sPct1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sPdt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sPdtFJ.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sPis.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sPiv.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sPkg.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sPmd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sPmt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sPod.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sPpa.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sPpr.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sPrj.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sPsra.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sPst.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sPtr.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sQtt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sRct.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sRct_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sRcts.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sRgd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sScd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sSck.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sScr.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sSdp.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sSfu.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sSiv.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sSmi.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sSmia.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sSmo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sSmoa.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sSod.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sSodbecome.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sStl.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sUdf.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sWare.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sWod.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sYstb.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sYstz.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Check_sYzfy.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ChooseSupply.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_CombinedOrderList_BtnEventGetOrder.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_CombinedOrderList_BtnEventRestart.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_CombinedOrderList_BtnEventRetGetOrder.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ComematerialsInspection_BtnRepair.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_CommonList_BtnEventCheck.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_Con_FormsReset.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Con_Reset.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Confirm_Zg.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_CopyTableToTable.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_CostAccount_CostCarryForward.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_CostAccount_WorkCenterToOperation.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_CostAccount_WorkCenterToOperation_Event.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Cost_CheckBusinessData.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_Cost_OrderCostAnalysis.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTable.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableFive.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableFour.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableOne.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableThree.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableTwo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_CustomerComplaints_BtnRepair.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Customer_BtnEventCancelInvalid.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Customer_BtnEventInvalid.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Customerlist_BtnEventCheck1.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_Customerlist_BtnEventUnCheck1.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_DailyStatisticalReport.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_DailyStatisticalSalary.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_DaysaleSalesMan.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Daysalecustomer.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_DelMasterSlave_Pro.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_DelMasterSlave_Pro2.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Del_ACT_Flow_Data.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Del_AllTable_Data.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Del_BasicsTable_Data.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Del_BasicsTable_DataByCompany.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Del_BusinessTable_Data.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Del_BusinessTable_DataCompany.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Del_gdsconfigformuserslave.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_DieCut_BtnEventReceive.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_DieCut_BtnEventReturn.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Do_Flow_Update_Materials.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Do_ProcedurePageTree.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Do_UpdateByPageSizeBefore.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Element_ProduceReportSum.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_EquipmentOutput_Machine.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_EquipmentOutput_Machine_YH.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Excu_Pro_RetOut.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Exec_sOutProcess.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_GET_OeeFistOneDataByMachineId.md | 10 +++++++++- en/docs/auto-catalog/procedures/Sp_Gb2Big_ChineseToBig.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Generic_Procedure_Call.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_GetMachineByApsRule-luc.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_GetMachineByApsRule.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_GetMachineByApsRule_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_GetMachineByApsRule_排程直接下达_.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_GetMasterSlave.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_GetOrder_Process.md | 18 +++++++++++------- en/docs/auto-catalog/procedures/Sp_GetWorkorderChildProductData.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Graphic_Report_Analysis_Data.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_Customer.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_Product.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_ProductClassify.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_Supply.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_WareHouse.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_depart.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_materials.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_materialsclassify.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_InsertVoucher.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_InsertVoucher_Cahpayment.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_InsertVoucher_Cahreceipt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_InsertVoucher_Cahreceipt1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_InsertVoucher_PitProductReject.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universal.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universals.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universals_All.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universals_ByMounth.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universals_Pro.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_InsertVoucher_mitproductionmaterials.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_InsertVoucher_mitproductionmaterialsBF.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_InsertVoucher_opsoutsidechecking.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_InsertVoucher_opsoutsideinvoice.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_InsertVoucher_purpurchaseinvoice.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_InsertVoucher_salsaleschecking.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_InsertVoucher_salsalescheckingGW.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Insert_EstimateInstore.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Insert_fixedassetsprovision.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Invalid_backwriting.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Invalidation.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_InOutStore.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_InOutStoreCost.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_InOutStoreNew.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_InOutStoreNew1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_InOutStoreNewTotal.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_Machine_MaterialsInventory.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_Machine_MaterialsWarning.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInOutStoreDoing.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56.md | 11 ++++++++++- en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56Price.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56_Line.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56_Total.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56_bakup.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56_bf_12_26.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventory_Outdated.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsWarning.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStore.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStoreCost.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStoreDoing.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStoreMoney.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStoreStock.md | 12 ++++++++---- en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStore_new.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_ProductInventoryV56.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_ProductInventoryV56New.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_ProductInventoryV56_qc.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_ProductInventory_Outdated.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_ProductWarning.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Inventory_SemigoodsInOutStore.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_KPI_DetailByEmployee.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_KPI_SumByEmployee.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MacRepClaimCancel_BtnEventClaimCancel.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MacRepClaim_BtnEventClaim.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MacRepClaim_BtnEventClaimZP.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MacRepClaim_BtnEventGroupLaderZP.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MacRepClaim_BtnEventMaterialsZP.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MachinePlanList_BtnEventRestoreRow.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MachinePlanList_BtnEventRestoreRowBill.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MachinePoweranalysis.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MachinePoweranalysis_1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MachinePoweranalysis_2.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MachineSpeedanalysis.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MachineSpeedanalysis_1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MachineSpeedanalysis_2.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MachineSpeedanalysis_2_new.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Machine_ReportAll.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Machine_ReportNew.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Machine_ReportNewNo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Machine_TeamNew.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_BillComplete.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_Manufacture_BtnEventCopyPlanSlave.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_BtnRepairExplain.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_CapacityStatistics.md | 18 +++++++++++------- en/docs/auto-catalog/procedures/Sp_Manufacture_GetAPSState.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_Manufacture_GetAPSStateOee.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_Manufacture_GetPlanAPSstate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlan.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlanBook.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlanProcess.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlanSlave.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlanToErp.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_Manufacture_InsertWorkOrder.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_MftPlanPhase.md | 18 +++++++++++------- en/docs/auto-catalog/procedures/Sp_Manufacture_MftPlanPhase_BtnEventCalc.md | 12 ++++++++---- en/docs/auto-catalog/procedures/Sp_Manufacture_MftPlanPhase_product.md | 22 +++++++++++++++------- en/docs/auto-catalog/procedures/Sp_Manufacture_MftPlanPhase_productBtnEventCalc.md | 16 ++++++++++------ en/docs/auto-catalog/procedures/Sp_Manufacture_MftWorkOrderAround.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_PlanReport.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_PlanStatusSet.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProcessReport.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionArrange.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionArrange2.md | 16 ++++++++++------ en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionArrangePro.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo12.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoLock_detail.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoNew.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_Base.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_Base_TC.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_TC.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_YH.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_YS.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_ChangeMachine.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_OutSideWorkCenter.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_WorkCenter.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_WorkCenter1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_WorkCenter2.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_detail.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_gant.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionProcess.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionReport.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionWorkCenter.md | 12 +++++++++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ProducttionPlan_List.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_PurPurchaseChecking.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ReplaceContent.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_Manufacture_Report.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ReportProgress.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ReportProgress_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_ReportQty_BtnEventCalc.md | 18 +++++++++++------- en/docs/auto-catalog/procedures/Sp_Manufacture_SalSalesChecking.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_SalSalesOrderReport.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime.md | 12 ++++++++---- en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime2.md | 12 ++++++++---- en/docs/auto-catalog/procedures/Sp_Manufacture_SetTimeDivRow.md | 12 ++++++++---- en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime_BB.md | 12 ++++++++---- en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime_Employ.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime_process.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime_tDate.md | 12 ++++++++---- en/docs/auto-catalog/procedures/Sp_Manufacture_TeamEmployee.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_WorkOrderStatistics.md | 12 ++++++++---- en/docs/auto-catalog/procedures/Sp_Manufacture_sSodPurchareMaterials.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_sWodPurchareMaterials.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_sWodPurchareMaterials_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Manufacture_sWodPurchareMaterials_new.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MaterialAgingAnalysis.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MaterialAgingAnalysis_YM.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MaterialAgingAnalysis_detail.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MaterialCheck_BtnEventMaterialCheck.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_MaterialCheck_BtnEventMaterialCheckFail.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MaterialCheck_BtnEventMaterialCheckPass.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MaterialHistoricalComparison.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MaterialsCarryforward.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MaterialsPurchaseStoreVirtual.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MaterialsStoreVirtual.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MaterialsStoreVirtual_refresh.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Materials_BtnEventCancelInvalid.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Materials_BtnEventInvalid.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Mes_EventReport.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Mes_EventReportOld.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MftPlanPhaseProduct_BtnEventConvertPlanA.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MftPlanPhaseProduct_BtnEventConvertPlanB.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MftPlanPhaseProduct_BtnEventSave.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventConvertPlanA.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventConvertPlanB.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventLockAll.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventLockRow.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventSave.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MftPlan_MachineProcessLodading.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MobileAdjust_BtnEventFinished.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MobileStart_BtnEventFinished.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Mobile_PatrolInspection.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_MonthlyStatisticalReport.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_MonthlyStatisticalSalary.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Monthlysalecustomer.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Monthlysalesman.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Msg_SendMsg.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_NotPayAbles.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_NotPayAbles_HZ.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_NotPayAbles_HZ_new.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_NotPayAbles_expen.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_NotPayAbles_list.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_NotReceivables.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_NotReceivables_HZ_new.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_NotReceivables_hz.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_NotReceivables_list.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_OEE_ConvertThisMachine.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_OEE_MachineStatus_ChangeStatus.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_OEE_PlanByProcess.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_OEE_ProductionReport.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_OEE_ProductionReportAll.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_OEE_ScanInsertToERP.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_OEE_ScanInsertToERP2013.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_OEE_SearchProductionReport.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Oee_BtnEventFinished.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_OneDatePlan_Machine.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_OpsOutSideProcess_BtnEventFinished.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_OpsOutside_Customer.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_OpsOutsideprocess_CheckUpdate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_OpsOutsideprocess_CheckUpdate_ZF.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Opsoutsideprocess_BtnEventConfirm.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Order_Scrap_Confirm_Flow.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_OutSideProcess_ProgressOfImplementation.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_OutsideInspection_BtnRepair.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Outstanding_Query.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_OverdueNoCheck.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_OverdueNotReceivables.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_PC_FirstInspection.md | 16 +++++++++++----- en/docs/auto-catalog/procedures/Sp_PC_PatrolInspection.md | 18 +++++++++++++----- en/docs/auto-catalog/procedures/Sp_PLC_ScanInsertToERP.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_Payables_AP.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Payables_APAccount.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Payables_APDetail.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Payables_AP_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnEventFinished.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnEventFinished_Control.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnEventFinished_Qty.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnEventFinished_UseQty.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnRepair.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_PlanListCUT_BtnEventFinished.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_PlanListCUT_BtnEventFinishedFHQZ.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_PlanListMakeup_BtnEventFinished.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_PlanListMakeup_BtnEventFinishedfhpb.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_PlanListMasterials_BtnEventCheck.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_PlanListMasterials_BtnEventUnCheck.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_PlanListMemo_BtnRepair.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_PlanListQualificat_BtnEventCheck.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_PlanListQualificat_BtnEventUnCheck.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_PlanList_BtnEventInkingFinished.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_PlanList_BtnEventMouldFinished.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_PlanListtDeliverDate_BtnRepair.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_PlanListtDeliverDate_BtnRepair_memo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_PlanSlave_BtnEventCBReturn.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_Post_sModule.md | 12 ++++++++---- en/docs/auto-catalog/procedures/Sp_Procedure_Templet.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ProcessInspection_BtnRepair.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Process_BtnEventCancelInvalid.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Process_BtnEventInvalid.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Process_CommonGtChar.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ProductAgingAnalysis.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ProductAgingAnalysis_YM.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ProductAgingAnalysis_detail.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ProductAgingAnalysis_new.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ProductCardAddMaterials_calc.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ProductCarryforward.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ProductDelivergoods.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ProductInspection_BtnRepair.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ProductProcess.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ProductProcessPack.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ProductProcessPackAll.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ProductProcessWorkOrder.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ProductProcess_BtnEventProductProcess.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ProductReceipt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ProductStoreVirtual.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Product_BeforeUpdate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Product_BtnEventCheck.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_ProductionDepartmentsReports.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ProductionMaterials_BtnEventConfirm.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ProductionOrder_CancelRransmit.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_ProductionOrder_NoRransmit.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_ProductionOrder_NoRransmitReturn.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_ProductionOrder_OutSide.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_ProductionOrder_PrepareMaterials.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_ProductionOrder_ReturnOutSide.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_ProductionOrder_Rransmit.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ProductionReport_BtnEventComplete.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ProductionReport_BtnEventConfirm.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Productionplan_Pie_Char.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Productionplan_Pie_Char_V10.1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Productionplan_Pie_Char_old.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Productionplan_sColumnarStack_Char.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Productionplan_sColumnarStack_Char_V10.1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Productionplan_sColumnarStack_Char_old.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_PurchasePrice.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_PurchasePriceChar.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_PurchasePriceChart.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_PurpurchaseOrder_CheckUpdate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_QlyComeMaterialsJudge.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_QlyOutSideJudge.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_QlyProcessTestJudge.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_QlyProductJudge.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_QlyProduct_BtnCalculate.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_QlyTest.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_QlyTestWorkOrder.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_QualityAccident_Reason.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Quality_Materials.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Qualityaccident_CheckUpdate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Quantity_PatrolDailyPaper.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_QuoquotationOrderMonth.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_QuotationStatistics.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataBookStd.md | 10 +++++++++- en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataFlex.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataPack.md | 10 +++++++++- en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataPackProductStd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataPackStd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataSetStd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataStd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Quotation_CopyToQuotationData.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Quotation__CalcDataPackLastStd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Quotation__CalcDataPackLastStd_zr.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Quotation__CalcDataPackPartsStd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Quotion_CheckFlow_BH1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Reachingrate_Machine.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_Receivables_AR.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Receivables_ARAccount.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Receivables_ARDetail.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Receivables_AR_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Receivables_AR_new.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Receivables_AR_sd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Receivables_AR_yh.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Receivables_ARageDetail.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Receivables_Aging.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Receivables_AgingSmallai.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Receivables_Warning.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Relation_Call_Rep.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Repair_salsaleschance_Lost.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Repair_salsaleschance_sScrap.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ReplaceField_Calc.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ReplaceField_Calc_TXT.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Report_GetFlowPerson.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SalOrder_BillForceComplete.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SalOrder_BtnCancelOrderReview.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_SalOrder_BtnEventClaim.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SalOrder_BtnOrderReview.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_SalOrder_BtnReturnOrderReview.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_SalSalesCheck.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SalSalesCheck1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SalSalesCheckNEW.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SalSalesCheck_1227.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SalSalesCheck_All.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SalSalesCheck_YM.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SalSalesCheck_YanBao.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SalSalesCheckded.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SalSalesCheckded_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SalSalesOrder_CheckUpdate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SaleOrder_ProgressOfImplementation.md | 10 +++++++++- en/docs/auto-catalog/procedures/Sp_SaleOrder_ProgressOfImplementationNew.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SaleOrder_ProgressOfImplementation_copynew.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SaleOrder_ProocessImplementation.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SaleOrderlist_BtnEventCraftworkDo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SaleOrderlist_BtnEventCraftworkOk.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SaleOrderlist_BtnEventSaleDepartDo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sale_OrderCompleteApply.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sale_OrderCompleteDoing.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sale_ProductInventory_Outdated.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SalesInvoicing_CheckUpdate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SalesMaterials_Memo1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SalesMaterials_Memo2.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SalesMaterials_Memo3.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SalesOrder_Analysis.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SalesOrder_BtnOrderComplete.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_SalesOrder_BtnOrderCompleteApply.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SalesOrder_KpiObsoleteClose.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_SalesOrder_KpiObsoleteMemo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SalesOrder_KpiQuoClose.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_SalesOrder_KpiQuoMemo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_Lable_NotWorkOrderList.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodList.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodListNew.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodMaterialsList.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodMaterialsNotifyList.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodNotifyList.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_NotWorkOrderList.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_PerformanceCommission.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfMaterial.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfMaterialClass.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfSupply.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfSupplyCount.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfSupplyGroup.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfSupplyYear.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysise.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomer.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomer1old001.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomerClass.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomer_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomerproperty.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfDay.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfMakePerson.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfMonth.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfProduct.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfProductClass.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfProfit.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfProfit_Product.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfSalesdepart.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfSalesperson.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfSalesperson_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseProduct.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseProduct1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseProductOfMonth.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sales_SalesDelivergoodsAnalysiseOfCustomer.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Salesdevplan_CommonGtChar.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SampleStatistics.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Save_CheckSaveAfter.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Save_Check_Supply.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_ScanPicking.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SetUpSubjectAssociate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SingleReceipt_BtnEventAbnormal.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SingleReceipt_BtnEventFinished.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sis_CopeEventList.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sis_GetConst.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sis_GetEleProductNo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sis_GetMaxNo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sis_GetMaxNo_1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sis_GetMaxNo_New.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sis_GetMaxNo_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sis_GetMertialsInventoryFormGuid.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Sis_GetProductInventoryFormGuid.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SortReportProcess.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_SplicingTableSql.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Split_sMpt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Split_sWod.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Supply_BtnEventCancelInvalid.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Supply_BtnEventInvalid.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Supply_filecheck.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_Supply_reLevel.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_Supply_refilecheck.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Supply_setLevel.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Supply_submit.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_Sys_GetMenu.md | 8 ++++++-- en/docs/auto-catalog/procedures/Sp_System_AccountSquareCheck.md | 22 +++++++++++++--------- en/docs/auto-catalog/procedures/Sp_System_AccountSquareCheck_New.md | 22 +++++++++++++--------- en/docs/auto-catalog/procedures/Sp_System_AccountSquareCheck_material.md | 22 +++++++++++++--------- en/docs/auto-catalog/procedures/Sp_System_AutoMaterialsPriceSingle.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_AutoMaterialsPriceSingle_Old.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_AutoMaterialsPriceSingle_new.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_AutoProductPriceSingle.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_AutoSendCheckMsg.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_BatchNPriceMoney.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_System_BatchNPriceMoney_quo.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_System_BatchPriceMoney.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_System_BatchWorkListPriceMoney.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost_1115.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost_20221014.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost_20221109.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost_copy1.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_System_CalcMaterialsPrice.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_System_CalcMaterialsPrice_220709.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_System_CalcMaterialsPrice_221111.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_System_CalcProductPrice.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_System_CalcProductPrice_new.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_System_CheckFlow.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_CheckMaterialsInvalid.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_CheckMaterialsInvalidL.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_CheckSave.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_CheckSaveFlow.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_CheckSaveFlowCps.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_CheckSaveOee.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_Checkquoquo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_Checkquoquo_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_DelMsgCheckFlow.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_InitCurrentPeriodCost.md | 18 +++++++++++------- en/docs/auto-catalog/procedures/Sp_System_MaterialsAllReSure.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_MaterialsAllSure.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_MaterialsCost.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_System_MaterialsReCost.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_System_MonThendCheckOut.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_ProductCost.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_System_ProductCost_OutPrice.md | 18 +++++++++++------- en/docs/auto-catalog/procedures/Sp_System_ProductCost_copy1.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_System_ProductMoney.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_System_ProductMoneyAllReSure.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_ProductMoneyAllSure.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_ProductionCost.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_System_ProductionCost24222.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_System_ProductionCostAllReSure.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_ProductionCostAllSure.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_ProductionCostBak.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_System_ProductionCostTest.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_System_ProductionCost_new.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_ReCostStructure.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_System_ReCostStructure_new.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_System_ReProductMoney.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_ReplaceField.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_ReplaceFieldNew.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_ReplaceField_Detail.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_ReplaceField_NEW.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_ReplaceField_NEW_ACT.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_ReplyCheckMsg.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_SaveReport.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_UpdateWorkCl.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_System_UpdateWorkProcessMemo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Task_GrossProfitSmallai.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Task_NetProfitSmallai.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Task_PrintWorkshop1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Task_PrintWorkshop2.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Task_PrintWorkshop3.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Task_ProductStockKeepLongSmallai.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Task_Send_Elecustomer_Birthday.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Task_Send_Eleemployee_Birthday.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Task_StockKeepLongSmallai.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Task_TodayMoneySmallai.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Task_TodayWorkRateProgressSmallai.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Task_doAgingSmallai.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Task_doSalesPlanImplementationMsg.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Task_doTest.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Task_doTestMsg.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_UnConfirm_Zg.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_UndeliverIsRelated.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_UpdateAdd_Check.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_UpdateAdd_Check_NEW.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Waste_details_product.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkCostCarryforward.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkDayReport.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOpsOutProcess.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrderProcessDetail.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrder_BillForceComplete.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrder_BillForceCompleteSlave.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataBookStd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataBsLastStd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataBsPartsStd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataBsProductStd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataFlex.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackLastStd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackPartsStd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackPartsStd_child.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackProductStd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackStd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackStdQ.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataSetStd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStdBefore.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStdBeforeAfter.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStdCenterProcess.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStdCenterPrsAfter.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrder_CheckUpdate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrder_CheckUpdateNew.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrder_CopyToWorkOrderData.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrder_GtChar.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkOrder_TechnologicalProcess.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkProcess_BtnEventOutSide.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_WorkWeekReport.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Work_WorkOfDayRecord.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Yfworkorder_BtnEventCustomerFail.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_Zld_BtnEventClaim.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_addBtn_gdsmodle.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_addSysbrands.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_afterSave_sAcc.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sCio.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sCldApply.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sCmt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sDgd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sDgda.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_afterSave_sDgda_phone.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sDgn.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sGYKK.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sLok.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sLos.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sMad.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sMpa.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sMpt.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_afterSave_sOdt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sOis.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sOiv.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sOpc.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sOpi.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sOpkg.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sOpn.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sOpn1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sOpp.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sOsa.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sPaj.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sPca.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sPca1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sPct.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sPct1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sPdt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sPis.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sPiv.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sPkg.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sPmd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sPmt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sPod.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sPpa.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sPpr.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_afterSave_sPrj.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sPst.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sPtr.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sQtt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sRct.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sRct_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sRcts.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sRgd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sScd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sSck.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sScr.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sSdp.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sSfu.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sSiv.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sSmi.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sSmia.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sSmo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sSmoa.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sSod.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sStl.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sWXKK.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_sWod.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_tice.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_afterSave_tore.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_bd_EqAdjust.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_bd_EqAnalysis.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_bd_EqLoad.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_bd_EqSpeed.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_bd_EqStatus.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_bd_EqStatus_new.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_bd_EqTime.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_bd_Eqabnormal.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_bd_EquipmentLoad.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_bd_EquipmentLoad1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_bd_MachineOee.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_bd_MachinePlanDate.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_bd_MachinePlanStatus.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_1.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_2.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_3.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_3_new.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_4.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_5.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_5_new.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_new.md | 12 +++++++++--- en/docs/auto-catalog/procedures/Sp_bd_McPlanConter.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_bd_McPlanRate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_bd_OrderProgress.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_bd_TeamDayMonthCompare.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_bd_TeamDayMonthCompare1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_bd_TeamOee.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_bd_TmAnalysis.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_bd_TmComplianceRate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_bd_TmComplianceRate2.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_bd_TmComplianceRate3.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_bd_TmSpeed.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_bd_TmSpeed2.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_bd_TmSpeed3.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_bd_TmTime.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_bd_TmTime2.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_bd_TmTime3.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_bd_TmYield.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_bd_TmYield2.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_bd_TmYield3.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_bd_machine_TmAnalysis.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_bd_team_TmAnalysis.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSaveReturn_sPtr.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSaveReturn_sQtt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSaveReturn_sRct.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_beforeSaveReturn_sSck.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSaveReturn_sScr.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSaveReturn_sSfu.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSaveReturn_sSmi.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSaveReturn_sSmia.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSaveReturn_sSmo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSaveReturn_sSmoa.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSaveReturn_sSod.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSaveReturn_sTLPmd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSaveReturn_sWXKK.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSaveReturn_sWod.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSaveReturn_tice.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSaveReturn_tore.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sAcc.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sCio.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sCldApply.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sCmt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sDgd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sDgda.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sDgn.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sGYKK.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sLok.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sLos.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sMad.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sMpa.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sMpt.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sOdt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sOis.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sOiv.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sOpc.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sOpi.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sOpkg.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sOpn.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sOpn1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sOpp.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sOsa.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sPca.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sPca1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sPct.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sPct1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sPdt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sPis.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sPiv.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sPkg.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sPmd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sPmt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sPod.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sPpa.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sPpr.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sPrj.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sPst.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sPtr.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sQtt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sRct.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sRct_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sRcts.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sRgd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sScd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sSck.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sScr.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sSdp.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sSfu.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sSiv.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sSmi.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sSmia.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sSmo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sSmoa.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sSod.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sStl.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sTLPmd.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sWXKK.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sWod.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_beforeSave_sYzfy.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_beforeSave_tice.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_beforeSave_tore.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_bi_workshop_1.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_bi_workshop_2.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_bi_workshop_3.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_calc_addData_toTable.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_calc_materialsstoreLimit.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_calc_productstoreLimit.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_changeIndex.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_change_BtnEventbEnable.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_chart_Bottleneck.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_chart_EquipmentLast.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_chart_EquipmentLoad.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_chart_EquipmentLoad1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_chart_EquipmentLod1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_chart_MonthOrder.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_chart_MonthProfit.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_chart_MonthTeamQty.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_chart_OrderProcess.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_chart_ThisMonthQty.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_chart_TodayOrder.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_chart_TodayOrder_hm.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_chart_TodayProfit.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_chart_TodayReceivables.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_chart_TodayReceive.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_chart_WorkOrderProcess.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_chart_expenses.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_chart_home_11.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_chart_home_13.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_chart_sMachine_speed.md | 8 +++++++- en/docs/auto-catalog/procedures/Sp_check_MaterialsStockLimitNew.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_check_productstoreLimitNew.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_checkismakerson_updatedel.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_commonList_BtnEventBillReturn.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_commonList_BtnEventUpdatePrice.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_commonList_BtnEventUpdatedDoing.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_costFrame_BtnEventDepartInto.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_costFrame_BtnEventWorkCenterInto.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_cpjy_cpwgrk.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_customerclassify_BtnEventCancelInvalid.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_customerclassify_BtnEventInvalid.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_deleteModuleChildPro.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_delete_backwriting.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_deliverIsRelated.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_detail_purpurchaseordermaster.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_doFlow_opsProcess.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_elematerials_AfterUpdate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_elematerials_AfterUpdateCard.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_elematerials_AfterUpdateCard_Edit.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_elematerials_BeforeUpdate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_elematerials_CheckUpdate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_elematerials_UpdateStyle.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_eleproduct_CheckUpdate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_eleteststandardFeed_BeforeUpdate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_eleteststandardFirst_BeforeUpdate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_eleteststandardPatrol_BeforeUpdate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_eleteststandardProduct_BeforeUpdate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_eptmachinemaintenance_Lader.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_eptmachinemaintenance_OEE.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_financialClosing_BtnEventCalcCost_New.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_financialClosing_BtnEventCalcMaterialPrice.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_financialClosing_BtnEventCalcMaterialPrice_New.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_financialClosing_BtnEventCalcYM_New.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_financialClosing_BtnEventCheckout.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_financialClosing_BtnEventCheckoutCheckNew.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_financialClosing_BtnEventCheckout_Check.md | 40 ++++++++++++++++++++++------------------ en/docs/auto-catalog/procedures/Sp_financialClosing_BtnEventCheckout_CheckInstore.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_financialClosing_BtnEventCheckout_CheckInstoreOutSide.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_financialClosing_BtnEventCheckout_CheckInstore_Test.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_financialClosing_BtnEventEstimation.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_financialClosing_BtnEventExpense.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_financialClosing_BtnEventOutSideEstimation.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_financialClosing_BtnEventOutSideEstimation_new.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_financialClosing_BtnEventOutSideEstimation_test.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_financialClosing_BtnEventProductStock_New.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_financialClosing_BtnEventReCheckout.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_financial_CustomerGrossProfit.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_financial_EasyCost.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_financial_OrderGrossProfit.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_financial_OrderGrossProfit_Classify.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_financial_OrderGrossProfit_Customer.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_financial_OrderGrossProfit_Customernew.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_financial_OrderGrossProfit_bf2.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_financial_OrderGrossProfit_new.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_financial_OrderGrossProfit_new1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_financial_OrderGrossProfit_sSrCustomer.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_financial_SaleManGrossProfit.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_format_column.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_fstj_details.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_history_purpurchaseordermaster.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_history_purpurchaseordermaster_data.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_initReserveCloumn.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_init_groupConfig.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_interface_SLJobTrans_before.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_interface_additems_adv_after.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_interface_additems_adv_before.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_interface_del_udfvoucher_after.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_interface_del_udfvoucher_before.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_interface_insertsaleman.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_interface_login_before.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_interface_udfvoucher_after.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_interface_udfvoucher_before.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_mes_TeamQtyReported.md | 10 +++++++++- en/docs/auto-catalog/procedures/Sp_mes_TimeActivationMonth_Machine.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_mes_TimeActivationMonth_Team.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_mes_TimeActivation_Machine.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_mes_TimeActivation_Team.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_mes_TimeActivation_Work.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_mes_TimeanalyseMonth_Machine.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_mes_Timeanalyse_Machine.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_mftproduct_BtnEventbEnable.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_mftworkorder_BtnReturncustomerconfirm.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_mftworkorder_BtnServiceconfirm.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_mftworkorder_Btncustomerconfirm.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_mftworkordermaster_AccountSubmit.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_mftworkorderprocesslost.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_oee_getmachinedata.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_plan_mftproductionplanBak.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_plan_mftproductionplanBak_daily.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_plan_teamrate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_plc_implementation.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_plc_implementation1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_plc_implementation2.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_plc_implementation2_new.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_plc_machineaddrmap_import_Event.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_plc_machineaddrmap_machine_Event.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_plc_viw_plcmachinedataall1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_plc_viw_plcmachinedataall2.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionInStore_BtnEventComplete.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_BackupCurrPlaniOrder.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_BtnEventAutoOrder.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_BtnEventBlock.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_productionMainPlan_BtnEventBlockOne.md | 14 +++++++++----- en/docs/auto-catalog/procedures/Sp_productionMainPlan_BtnEventComplete.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_BtnEventDelPlan.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_BtnEventOrder.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_BtnEventPlanning.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_BtnEventReCovert.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_BtnEventReSet.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_BtnEventResumeOrder.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_BtnEventResumefirstOrder.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_BtnEventSetiOrder.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_BtnEventSingleOutgoing.md | 16 ++++++++++------ en/docs/auto-catalog/procedures/Sp_productionMainPlan_BtnEventSingleOutgoingFHCP.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_BtnEventSuspend.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_BtnEventSuspend_YH.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_BtnEventSuspend_ZY.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_BtnEventUnBlock.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_BtnEventUnBlockOne.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_BtnEventUnComplete.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_BtnEventUnOrder.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_BtnEventUnlock.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_BtnEventworkorder.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_BtnPost.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_Process_BtnEventCompletion.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_Process_BtnEventCompletionRelease.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_Process_BtnEventOutProcessing.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_Process_BtnEventUnOutProcessing.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_batchupdatememo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionMainPlan_upmemo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlanInfo_BtnEventCancelRelease.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlanInfo_BtnEventCancelZDDate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlanInfo_BtnEventCompletion.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlanInfo_BtnEventCompletionRelease.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlanInfo_BtnEventConfirm.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlanInfo_BtnEventExamineDate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlanInfo_BtnEventOutProcessing.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlanInfo_BtnEventRecommendMachine.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlanInfo_BtnEventRelease.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlanInfo_BtnEventRepairStartDate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlanInfo_BtnEventResume.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlanInfo_BtnEventReturn.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlanInfo_BtnEventSuspend.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlanInfo_BtnEventUnChange.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlanInfo_BtnEventUnUrgent.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlanInfo_BtnEventUrgent.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlanInfo_CopyPlan.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlan_BtnEventAutoOrder.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlan_BtnEventAutoOrder1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlan_BtnEventAutoOrder10.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlan_BtnEventAutoOrder2.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlan_BtnEventAutoOrder3.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlan_BtnEventAutoOrder4.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlan_BtnEventAutoOrder5.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlan_BtnEventAutoOrder6.md | 40 ++++++++++++++++++++++------------------ en/docs/auto-catalog/procedures/Sp_productionPlan_BtnEventAutoOrder8.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlan_BtnEventAutoOrder9.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlan_BtnEventAutoOrderSettime.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlan_BtnEventCnl.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlan_BtnEventLock24Hour.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlan_BtnEventLock24HourNotCalcTime.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlan_BtnEventLockSd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlan_BtnEventLockSd_cnl.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlan_BtnEventLockrow.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlan_BtnEventLockrowNotCalcTime.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlan_BtnEventLockrowNotCalcTime_copy1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlan_BtnEventunLockrow.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlan_BtnEventunLockrowNotCalcTime.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionPlan_BtnRepairdAjusthour.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionplan_ControlProcess.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionplan_ControlProcess1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_productionplan_ControlProcessNew.md | 18 +++++++++++------- en/docs/auto-catalog/procedures/Sp_productionplan_ControlProcessTrack.md | 18 +++++++++++------- en/docs/auto-catalog/procedures/Sp_pur_purpurchaseorderOfSupply.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_purchase_BtnEventReturn.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_purpurchasearrive_CheckUpdate.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_purpurchaseorder_ProgressOfImplementation.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_quoquotation_CustomerAgreeAgain.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_quoquotation_CustomerUnagree.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_quoquotation_Submit.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_quoquotation_SubmitUndo.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_quoquotation_customeragree.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_quoquotation_customeragreeWithdraw.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_report_test.md | 12 ++++++++---- en/docs/auto-catalog/procedures/Sp_reportdata_QlyTest.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_reportdata_QlyTest_OEE.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_reportdata_Quo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_reportdata_Quo_JT.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_reportdata_WorkOrder.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_reportdata_WorkOrder1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_reportdata_WorkOrder3.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_sTeamSpeedanalysis.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_sYzfy_JN.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saleschanceToSop_BtnEventDevelopBack.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saleschanceToSop_BtnEventDistribution.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saleschanceToSop_BtnEventTodevelop.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_salsaleschance_applyQuo.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_salsalesor_BtnEventPerson.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_salsalesor_BtnEventPersonReturn.md | 10 +++++++--- en/docs/auto-catalog/procedures/Sp_salsalesorderVirtual.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_salsalesorderVirtual_sDgd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_salsalesorderVirtual_test.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sAcc.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sCio.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sCldApply.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sCmt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sDgd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sDgn.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sGYKK.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sLok.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sLos.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sMad.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sMpa.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sOdt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sOis.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sOiv.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sOpc.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sOpi.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sOpkg.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sOpn.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sOpn1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sOpp.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sOsa.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sPaj.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sPca.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sPct.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sPct1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sPdt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sPis.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sPiv.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sPkg.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sPmd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sPmt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sPod.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sPpa.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sPpr.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sPrj.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sPst.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sPtr.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sQtt.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sRct.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sRcts.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sRgd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sScd.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sSck.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sScr.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sSdp.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sSfu.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sSiv.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sSmi.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sSod.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sStl.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sWXKK.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_sWod.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_tice.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_saveReturn_tore.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_sendEmail_before.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_share_sPay.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_share_sPay_One.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_share_sRcts.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_share_sRcts_One.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_share_salsalesinvoices_One.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_sysaccountperiod.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_thisworkcost.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_title_CommonModel1.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_tmp.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_unifiedPlanning_BtnCalculation.md | 18 +++++++++++------- en/docs/auto-catalog/procedures/Sp_unifiedPlanning_BtnCalculationSecond.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_unifiedPlanning_BtnCalculation_Machine.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_unifiedPlanning_BtnCalculation_Machine_time.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_unifiedPlanning_BtnCalculation_copy.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_unifiedPlanning_BtnCalculation_workorder.md | 8 ++++++-- en/docs/auto-catalog/procedures/Sp_unifiedPlanning_BtnCalculation_workorder_calc.md | 8 ++++++-- en/docs/auto-catalog/procedures/Sp_update_BusineesVoucherBillNo.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_urisdiction.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_viw_accordercostanalysis.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_work_mftworkorderprocessHour.md | 6 +++++- en/docs/auto-catalog/procedures/Sp_workorderSave.md | 6 +++++- en/docs/auto-catalog/procedures/TJ_SP_PoIQCInfoAfter.md | 6 +++++- en/docs/auto-catalog/procedures/TJ_TJMES_GRNLine.md | 6 +++++- en/docs/auto-catalog/procedures/addFieldScript.md | 6 +++++- en/docs/auto-catalog/procedures/callAllId.md | 6 +++++- en/docs/auto-catalog/procedures/callAllIdChid.md | 6 +++++- en/docs/auto-catalog/procedures/callAllIdChidVisible.md | 6 +++++- en/docs/auto-catalog/procedures/callAllIdbVisible.md | 6 +++++- en/docs/auto-catalog/procedures/call_SP_Inventory_ProductCalcQty.md | 6 +++++- en/docs/auto-catalog/procedures/del_quoworklog.md | 6 +++++- en/docs/auto-catalog/procedures/deleteBill.md | 6 +++++- en/docs/auto-catalog/procedures/deleteMesg.md | 6 +++++- en/docs/auto-catalog/procedures/getModuleChildrenPro.md | 6 +++++- en/docs/auto-catalog/procedures/getModuleKeyPro.md | 6 +++++- en/docs/auto-catalog/procedures/getModuleTreePro.md | 6 +++++- en/docs/auto-catalog/procedures/getSysjurisdictionChildrenPro.md | 6 +++++- en/docs/auto-catalog/procedures/getSysjurisdictionTreePro.md | 8 +++++++- en/docs/auto-catalog/procedures/init_plc_config.md | 6 +++++- en/docs/auto-catalog/procedures/phoneDeal.md | 6 +++++- en/docs/auto-catalog/procedures/planScriptTmp.md | 6 +++++- en/docs/auto-catalog/procedures/sendPlcData.md | 6 +++++- en/docs/auto-catalog/procedures/spKPImodule.md | 6 +++++- en/docs/auto-catalog/procedures/sp_CalcWagebyReport.md | 6 +++++- en/docs/auto-catalog/procedures/sp_GetMaterialsQtyUnit.md | 6 +++++- en/docs/auto-catalog/procedures/sp_OEE_Exit.md | 12 ++++++++---- en/docs/auto-catalog/procedures/sp_OEE_adjustmentend.md | 6 +++++- en/docs/auto-catalog/procedures/sp_OEE_billstartWorking.md | 14 +++++++++----- en/docs/auto-catalog/procedures/sp_OEE_endWorked.md | 6 +++++- en/docs/auto-catalog/procedures/sp_OEE_loading.md | 14 +++++++++----- en/docs/auto-catalog/procedures/sp_Qlyoutsideproducttest_calculate.md | 6 +++++- en/docs/auto-catalog/procedures/sp_addCustomer.md | 6 +++++- en/docs/auto-catalog/procedures/sp_add_elecustomer_to118.md | 6 +++++- en/docs/auto-catalog/procedures/sp_add_elecustomer_to118_after.md | 6 +++++- en/docs/auto-catalog/procedures/sp_alert_bit.md | 6 +++++- en/docs/auto-catalog/procedures/sp_alert_text.md | 6 +++++- en/docs/auto-catalog/procedures/sp_btn_action.md | 8 +++++++- en/docs/auto-catalog/procedures/sp_btn_action_updatequoquotationslave.md | 6 +++++- en/docs/auto-catalog/procedures/sp_cs1.md | 6 +++++- en/docs/auto-catalog/procedures/sp_cursor_CardEdit.md | 6 +++++- en/docs/auto-catalog/procedures/sp_cursor_CardEdit1.md | 6 +++++- en/docs/auto-catalog/procedures/sp_cursor_test.md | 6 +++++- en/docs/auto-catalog/procedures/sp_cursor_test1.md | 6 +++++- en/docs/auto-catalog/procedures/sp_doTestGgf.md | 6 +++++- en/docs/auto-catalog/procedures/sp_do_initsysjurisdiction.md | 6 +++++- en/docs/auto-catalog/procedures/sp_do_order_get.md | 6 +++++- en/docs/auto-catalog/procedures/sp_getAllPartsName.md | 6 +++++- en/docs/auto-catalog/procedures/sp_getErpPlanData_before.md | 6 +++++- en/docs/auto-catalog/procedures/sp_get_sOppositeColor_data.md | 6 +++++- en/docs/auto-catalog/procedures/sp_get_salsal_order.md | 6 +++++- en/docs/auto-catalog/procedures/sp_get_unTodo.md | 6 +++++- en/docs/auto-catalog/procedures/sp_get_unTodo_Apply.md | 6 +++++- en/docs/auto-catalog/procedures/sp_get_unTodo_history.md | 6 +++++- en/docs/auto-catalog/procedures/sp_getoutsideprocess.md | 6 +++++- en/docs/auto-catalog/procedures/sp_getsalesoutsideprocess.md | 6 +++++- en/docs/auto-catalog/procedures/sp_init_gdsjurisdiction.md | 6 +++++- en/docs/auto-catalog/procedures/sp_init_sVersionFlowId.md | 6 +++++- en/docs/auto-catalog/procedures/sp_int_dbSet.md | 10 +++++++--- en/docs/auto-catalog/procedures/sp_interface_delsaleman.md | 6 +++++- en/docs/auto-catalog/procedures/sp_manufacture_productionplaninfotrace.md | 6 +++++- en/docs/auto-catalog/procedures/sp_manufacture_productionplaninfotrace1.md | 6 +++++- en/docs/auto-catalog/procedures/sp_mftproductionreportdata_employee_WageMoney.md | 6 +++++- en/docs/auto-catalog/procedures/sp_mitproductionapply_calculate.md | 6 +++++- en/docs/auto-catalog/procedures/sp_pitProductstoredata.md | 6 +++++- en/docs/auto-catalog/procedures/sp_qlyproducttest_calculate.md | 6 +++++- en/docs/auto-catalog/procedures/sp_refreshJur.md | 6 +++++- en/docs/auto-catalog/procedures/sp_refreshJurBill.md | 6 +++++- en/docs/auto-catalog/procedures/sp_salsalesorderdata.md | 6 +++++- en/docs/auto-catalog/procedures/sp_updateEnglishBasic.md | 6 +++++- en/docs/auto-catalog/procedures/sp_updateEnglishBasic123.md | 6 +++++- en/docs/auto-catalog/procedures/sp_update_billmaterials_MoneyToPrice.md | 6 +++++- en/docs/auto-catalog/procedures/sp_update_billproduct_MoneyToPrice.md | 6 +++++- en/docs/auto-catalog/procedures/sp_update_pricecolumn.md | 6 +++++- en/docs/auto-catalog/procedures/ss.md | 6 +++++- en/docs/auto-catalog/procedures/test.md | 6 +++++- en/docs/auto-catalog/procedures/test_copy.md | 6 +++++- en/docs/auto-catalog/procedures/zAddField_Proc.md | 6 +++++- en/docs/auto-catalog/procedures/zModifyField_Proc.md | 6 +++++- en/docs/auto-catalog/procedures/待产量上报.md | 6 +++++- en/scripts/narrate_routines.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1862 files changed, 10439 insertions(+), 2448 deletions(-) diff --git a/en/docs/auto-catalog/functions/CALC_MATERIALS_SMAIL.md b/en/docs/auto-catalog/functions/CALC_MATERIALS_SMAIL.md index 5363ac7..da2726c 100644 --- a/en/docs/auto-catalog/functions/CALC_MATERIALS_SMAIL.md +++ b/en/docs/auto-catalog/functions/CALC_MATERIALS_SMAIL.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Material yield estimator for cuts taken from a stock board capped at 305 cm per side (board dimensions in cm). Header comment is `两变都小于305的材料(单位CM)` ("both sides under 305, unit CM"). Counts how many 305-cm stock boards a batch of `dQty` pieces of size `dWidth × dLength` will consume, including offcut reuse. + +**What it does:** sorts the long/short side, peels off any "whole-board" multiples when a side exceeds 305, then loops the remaining pieces along a 305-cm running cutline and uses a JSON list to track usable offcuts (`料头`). Returns the total board count. Does not read or write any table — pure arithmetic. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/FUN_DISTINCTJSON_REMOVE_BYNAME.md b/en/docs/auto-catalog/functions/FUN_DISTINCTJSON_REMOVE_BYNAME.md index a897514..efe2356 100644 --- a/en/docs/auto-catalog/functions/FUN_DISTINCTJSON_REMOVE_BYNAME.md +++ b/en/docs/auto-catalog/functions/FUN_DISTINCTJSON_REMOVE_BYNAME.md @@ -19,4 +19,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Generic JSON-array dedup helper — given a JSON array of objects and the name of one key, returns a new JSON array with rows whose value at that key has already been seen filtered out. Sits with the rest of the JSON-utility family used to clean up dropdown / pick-list data assembled inside form-master sSqlStr blocks. + +**What it does:** validates `sJson`, iterates `0..JSON_LENGTH-1`, extracts each element's `$.`, keeps a running comma-joined seen-list, and `JSON_MERGE`s only first-occurrence elements onto the output array. Returns a JSON array; invalid JSON falls through to an empty array. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/FUN_GET_CALCPLAN_DATE_END.md b/en/docs/auto-catalog/functions/FUN_GET_CALCPLAN_DATE_END.md index 11d92d1..ded3049 100644 --- a/en/docs/auto-catalog/functions/FUN_GET_CALCPLAN_DATE_END.md +++ b/en/docs/auto-catalog/functions/FUN_GET_CALCPLAN_DATE_END.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Production-planning shift-aware end-time calculator. Given the start datetime, total task minutes, and a machine id, returns the forecast end datetime taking into account the machine's shift schedule, weekend off-days (`sWkDayId` = 1 weekends, 3 Saturday only, 4 Sunday only), and the configured break windows (morning/lunch/afternoon/evening). Header comment is `几台Id,传入时间加时间,得出来结束时间` ("machine id + start + minutes → end"). + +**What it does:** loads the machine's `elemachine` shift configuration (`sOffWork`, `sWorkType`, `sShiftsWork`, six break-window pairs, `sWkDayId`, `dWeek`). Computes how many full shifts the workload spans (`p_dDayHour DIV (dWeek*60)`) and the leftover minutes. Walks one day at a time, skipping weekend days as configured, then forwards the date by the unsuspended-shift count and the remaining minutes via [`FUN_GET_DATE_BC_ADDTIME`](FUN_GET_DATE_BC_ADDTIME.md). For each scheduled break window (`FUN_GET_DATE_UKT_ADD` per window) it pushes the end-time forward by the break length if the job spans it. Finally normalizes back onto a shift boundary via [`FUN_GET_DATE_BC_STARTDATE`](FUN_GET_DATE_BC_STARTDATE.md). + +**Invocation:** referenced in the source file under `script/标版/30100101/schedule/settime算休息时间/`. Status: appears orphaned in the live DB — no other routine, form-master sSqlStr, gdsmodule hook, or Java caller references it. Body also references `p_tStartDate`, `sBrId`, `sSuId` which are not declared as parameters — verify before invoking. diff --git a/en/docs/auto-catalog/functions/FUN_GET_CALC_DATE.md b/en/docs/auto-catalog/functions/FUN_GET_CALC_DATE.md index 250c45d..ef8e9c7 100644 --- a/en/docs/auto-catalog/functions/FUN_GET_CALC_DATE.md +++ b/en/docs/auto-catalog/functions/FUN_GET_CALC_DATE.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Production-planning shift-rollover helper — when a job under day-shift mode overruns the shift's clock-out time, this function nudges the timestamp forward by one off-shift window so the next work segment starts on the following shift. Header comment is `时间后移动计算` ("forward time-shift calc"). Companion to [`FUN_GET_CALC_DATE_END`](FUN_GET_CALC_DATE_END.md). + +**What it does:** for day-shift (`sWorkType='1'`), if `p_date` is past the day's `sShiftsWork` boundary, returns `DATE_ADD(p_date, INTERVAL (1440 - p_dMinute) MINUTE)`. Otherwise returns `p_date` unchanged. Read-only. + +**Invocation:** referenced in the source file shipped with the unified-planning calc bundle (`script/标版/30100101/schedule/settime算休息时间/`). The corresponding callers (`Sp_unifiedPlanning_BtnCalculation_workorder`, `..._calc`) currently have the call commented out — see the surviving call to `FUN_GET_CALC_DATE_END` in the same blocks. Status: live in DB, paths to invoke it currently disabled — verify before relying on it. diff --git a/en/docs/auto-catalog/functions/FUN_GET_CALC_DATE_END.md b/en/docs/auto-catalog/functions/FUN_GET_CALC_DATE_END.md index 32c6c32..85ac361 100644 --- a/en/docs/auto-catalog/functions/FUN_GET_CALC_DATE_END.md +++ b/en/docs/auto-catalog/functions/FUN_GET_CALC_DATE_END.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Production-planning time-arithmetic helper — given a job's start date, its duration in minutes, and the machine's shift type, returns the calendar end timestamp. Used by the unified-planning recalc path to roll forecast end times forward when work is rescheduled. Header comment is `时间后移动计算(不考虑双休日之类的)` ("forward time-shift calc, ignores weekends etc."). + +**What it does:** coalesces defaults (`p_sWorkType=2`, `p_date=NOW()`, hour/minute=0), then `DATE_ADD(p_date, INTERVAL MINUTE)` where the minute count is `p_dHour` for two-shift mode (`sWorkType=2`) and `FLOOR(p_dHour/p_dMinute)*(1440-p_dMinute) + p_dHour` for day-shift mode (`sWorkType=1`) — the latter inflates by a full off-shift window each time the day-shift cap is crossed. + +**Invocation:** called by `Sp_unifiedPlanning_BtnCalculation_workorder` and `Sp_unifiedPlanning_BtnCalculation_workorder_calc` — the work-order recalc step of unified production planning (生产管理 → 生产运营报表 family). No form-master, gdsmodule-hook, or Java caller. diff --git a/en/docs/auto-catalog/functions/FUN_GET_DATE_BC.md b/en/docs/auto-catalog/functions/FUN_GET_DATE_BC.md index d849487..f596821 100644 --- a/en/docs/auto-catalog/functions/FUN_GET_DATE_BC.md +++ b/en/docs/auto-catalog/functions/FUN_GET_DATE_BC.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Returns the shift-label string (`YYYY-MM-DD 白班` / `YYYY-MM-DD 晚班`) that a given timestamp belongs to. This is the value stored in `mftproductionplanslave.sDivRow` and friends — production reports, BI rollups, and the schedule grid all bucket by this string. The two shift names are pulled from the const table (`dayShift` / `nightShift` via `Fun_Sis_GetConst`), so multi-tenant overrides keep their own labels. + +**What it does:** for `sWorkType='1'` (day-shift only), returns today's `dayShift` label. Otherwise, if `p_Date` is inside today's `sWorkOff` → `sShiftsWork` window returns today's `dayShift` label; if not, returns `nightShift`. When the time is before `sWorkOff` on the date (i.e. early-morning continuation of the prior night shift), the date is rolled back one day. + +**Invocation:** central helper for the production-scheduling and reporting chain. Called by ~25 procs spanning BI workshop rollups, equipment-output reports, manufacturing time-set / time-trace, production-plan lock/unlock buttons (`Sp_productionPlan_BtnEventLock*`, `Sp_productionPlan_BtnEventunLock*`), unified-planning calc, and `Sp_Manufacture_BtnEventCopyPlanSlave`. A private same-named method in `WorkOrderPlanServiceImpl` reimplements the same logic in Java but doesn't invoke the SQL function. diff --git a/en/docs/auto-catalog/functions/FUN_GET_DATE_BC_ADDTIME.md b/en/docs/auto-catalog/functions/FUN_GET_DATE_BC_ADDTIME.md index 0053db5..e40ed09 100644 --- a/en/docs/auto-catalog/functions/FUN_GET_DATE_BC_ADDTIME.md +++ b/en/docs/auto-catalog/functions/FUN_GET_DATE_BC_ADDTIME.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Production-planning time-addition helper. Adds `p_dMinute` to a base datetime, but for day-shift mode (`sWorkType='1'`) routes any overrun past the shift's end (`sShiftsWork`) to start counting again from the next day's clock-on (`sWorkOff`). Header comment is `根据传入时间获取时间` ("get date based on input date"). + +**What it does:** for `sWorkType=1`, computes `p_sDqbcsy = TIMESTAMPDIFF(MINUTE, p_Date, today_at_sShiftsWork)`. If the requested minute increment exceeds that remaining-in-shift window, returns `next_day_at_sWorkOff + (p_dMinute - p_sDqbcsy) MINUTE`. Otherwise (and for `sWorkType` ≠ 1) returns plain `DATE_ADD(p_Date, INTERVAL p_dMinute MINUTE)`. + +**Invocation:** called by [`FUN_GET_CALCPLAN_DATE_END`](FUN_GET_CALCPLAN_DATE_END.md) and `Sp_Manufacture_SetTime_BB` (manufacturing time-setter for production-plan rows). Production-scheduling subsystem, 生产管理. diff --git a/en/docs/auto-catalog/functions/FUN_GET_DATE_BC_STARTDATE.md b/en/docs/auto-catalog/functions/FUN_GET_DATE_BC_STARTDATE.md index ac760a3..1dd504e 100644 --- a/en/docs/auto-catalog/functions/FUN_GET_DATE_BC_STARTDATE.md +++ b/en/docs/auto-catalog/functions/FUN_GET_DATE_BC_STARTDATE.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Day-shift normalizer at the core of the production-scheduling time-math chain. For a day-shift machine, if the passed timestamp falls in the off-shift window, snaps it to the relevant clock-off boundary so all downstream interval math is shift-aligned. For two-shift mode (`sWorkType=2`) returns `p_Date` unchanged. + +**What it does:** for `sWorkType=1`, classifies whether `p_Date` is in the off-shift window (`sWorkOff` → `sShiftsWork`). If yes, returns `today_sWorkOff` when `p_Date < today_sWorkOff`, else `tomorrow_sWorkOff`. Otherwise (and for non-day-shift) returns `p_Date`. + +**Invocation:** core helper called by [`FUN_GET_CALCPLAN_DATE_END`](FUN_GET_CALCPLAN_DATE_END.md) and a wide span of production-scheduling and MES procs — BI workshop rollups (`Sp_bi_workshop_1/2/3`), board reports (`Sp_Bd_bi20_*`), machine-time calc (`Sp_BtnCalculation_Machine_time_byMachineType(End)`), `Sp_MachineSpeedanalysis_2_new`, `Sp_Manufacture_SetTime_BB`, `Sp_Manufacture_SetTimeDivRow`, MES event-report procs, and the unified-planning recalc family. diff --git a/en/docs/auto-catalog/functions/FUN_GET_DATE_BC_STARTDATE_NEW.md b/en/docs/auto-catalog/functions/FUN_GET_DATE_BC_STARTDATE_NEW.md index f7d7412..94fe4ca 100644 --- a/en/docs/auto-catalog/functions/FUN_GET_DATE_BC_STARTDATE_NEW.md +++ b/en/docs/auto-catalog/functions/FUN_GET_DATE_BC_STARTDATE_NEW.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Production-reporting shift-anchor helper — snaps an arbitrary timestamp onto the start of whichever shift it falls into so production reports and machine-utilization stats roll up by shift, not by raw minute. Used by the workshop / BI roll-up reports under 生产管理 → 生产运营报表 and the production-report analysis path. Header comment is `根据传入时间获取时间` ("get date based on input date"). + +**What it does:** if `HOUR(p_Date)` is between `p_sWorkStart` and `p_sWorkOff` (i.e. the work-day shift is active), returns today's `sWorkStart` timestamp. Otherwise, if `p_Date` is past midnight on the same day, returns today's `sWorkOff`; else returns the previous day's `sWorkOff` — i.e. the night-shift starts the prior day. + +**Invocation:** called by `Sp_Bd_bi20_1_newZZT`, `Sp_Bd_bi20_2new`, `Sp_Bd_bi20_hh`, `Sp_bi_workshop_1/2/3`, `Sp_BtnCalculation_Machine_time_byMachineType`, `Sp_MachineSpeedanalysis_2_new`, `Sp_Mes_EventReport(Old)`, and the production-report analysis proc (`Sp_Bd_mftproductionreport_analysis`). MES event-report and BI rollup chain. diff --git a/en/docs/auto-catalog/functions/FUN_GET_DATE_BC_STARTDATE_NEWTYPE.md b/en/docs/auto-catalog/functions/FUN_GET_DATE_BC_STARTDATE_NEWTYPE.md index 7385758..e99d107 100644 --- a/en/docs/auto-catalog/functions/FUN_GET_DATE_BC_STARTDATE_NEWTYPE.md +++ b/en/docs/auto-catalog/functions/FUN_GET_DATE_BC_STARTDATE_NEWTYPE.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Variant of [`FUN_GET_DATE_BC_STARTDATE_NEW`](FUN_GET_DATE_BC_STARTDATE_NEW.md) that branches on shift type. For two-shift mode (`sWorkType=2`), snaps the input to whichever shift it falls into. For day-shift mode (`sWorkType=1`), instead returns the next day's clock-on when the input is in the late-evening window (≥20:00). Used by manufacturing time-set and MES event-report procs that need shift-anchoring sensitive to whether the shop runs single or double shifts. + +**What it does:** `IF sWorkType=2`: returns today's `sWorkStart` when `HOUR(p_Date)` is in the active window; otherwise returns either today's `sWorkOff` (when past 20:00) or yesterday's `sWorkOff`. `ELSE` (day-shift): returns today's `sWorkStart` when in-window; otherwise tomorrow's `sWorkStart` when `HOUR ≥ 20`, else today's `sWorkStart`. + +**Invocation:** called by `Sp_BtnCalculation_Machine_time_byMachineType` (machine-time recalc on schedule button), `Sp_Mes_EventReport`, and `Sp_Mes_EventReportOld`. MES event-reporting and machine-time recalc chain. Body of [`FUN_GET_DATE_BC_STARTDATE_NEW`](FUN_GET_DATE_BC_STARTDATE_NEW.md) is referenced from the same source bundle. diff --git a/en/docs/auto-catalog/functions/FUN_GET_DATE_BC_STARTDATE_NOW.md b/en/docs/auto-catalog/functions/FUN_GET_DATE_BC_STARTDATE_NOW.md index c99ec2d..7c07abf 100644 --- a/en/docs/auto-catalog/functions/FUN_GET_DATE_BC_STARTDATE_NOW.md +++ b/en/docs/auto-catalog/functions/FUN_GET_DATE_BC_STARTDATE_NOW.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Day-shift overflow normalizer used to compute the planning end timestamp from a job's start time. For a day-shift machine (`sWorkType=1`), pushes the timestamp to the next clock-off boundary minus the off-shift window length, so a job that ends after the shift "wraps" to the equivalent point on the following shift. Companion to [`FUN_GET_DATE_BC_STARTDATE`](FUN_GET_DATE_BC_STARTDATE.md), with a leading-comment block preserving the older simpler version. + +**What it does:** for `sWorkType=1`, classifies whether `p_Date` falls inside the off-shift window (`sWorkOff` → `sShiftsWork` on the same day). If it does (`p_sWorkTypeValue=2`), computes a new candidate `p_DateRet` at the appropriate `sWorkOff` boundary (same day if `p_Date < today_sWorkOff`, else tomorrow's). Then subtracts the off-shift span (`24*60 - working span`) from the running diff and applies it. Returns the shifted timestamp. + +**Invocation:** called by `Sp_BtnCalculation_Machine_time_byMachineTypeEnd` (the end-time recalc twin of `Sp_BtnCalculation_Machine_time_byMachineType`). Production-scheduling chain. diff --git a/en/docs/auto-catalog/functions/FUN_GET_DATE_DIFF_MINUTE.md b/en/docs/auto-catalog/functions/FUN_GET_DATE_DIFF_MINUTE.md index 5125faa..2e9b192 100644 --- a/en/docs/auto-catalog/functions/FUN_GET_DATE_DIFF_MINUTE.md +++ b/en/docs/auto-catalog/functions/FUN_GET_DATE_DIFF_MINUTE.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Returns the minute-length of a clock-time window (`HH:MM:SS` strings), wrapping across midnight when the end is "earlier" than the start (i.e. a night-shift break window like `23:30 → 00:30`). Used to compute break-window durations (lunch, dinner, midnight) for the production-scheduling time-arithmetic chain. + +**What it does:** wraps both clock strings with today's date via `CONCAT(DATE_FORMAT(NOW(),'%Y-%m-%d'),' ', …)` and casts to datetime. If start ≤ end, returns `TIMESTAMPDIFF(MINUTE, start, end)`. Else returns the diff to `end + 1 DAY`. Coalesces NULL to 0. + +**Invocation:** called by [`FUN_GET_CALCPLAN_DATE_END`](FUN_GET_CALCPLAN_DATE_END.md) (to compute the six break-window lengths), `Sp_Manufacture_SetTimeDivRow`, `Sp_Manufacture_SetTime_BB`, `Sp_Manufacture_SetTime_process`. Production-scheduling time-math chain. diff --git a/en/docs/auto-catalog/functions/FUN_GET_DATE_KT.md b/en/docs/auto-catalog/functions/FUN_GET_DATE_KT.md index 1189220..b33cd75 100644 --- a/en/docs/auto-catalog/functions/FUN_GET_DATE_KT.md +++ b/en/docs/auto-catalog/functions/FUN_GET_DATE_KT.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产排程 → 生产计划管理 → 生产管理 — cross-midnight (跨天/夜班) rest-period shifter used by the workcenter-scheduling time engine. When `Sp_Manufacture_SetTime*` is walking a job along a machine's working calendar and the next free instant lands inside a night-shift's main rest window (default 23:30–00:30, but the window may span midnight), this function pushes the cursor to the end of that window. + +**What it does:** treats `p_sStartDate`/`p_sEndDate` as wall-clock times of a rest window that crosses midnight. It tests whether `p_tCStartTime` falls in the window either on the previous calendar day (start-1d … end-today) or on the current day (start-today … end-tomorrow), and if so returns the corresponding end boundary (today or tomorrow). Otherwise returns `p_tCStartTime` unchanged. + +**Invocation:** called from `Sp_Manufacture_SetTimeDivRow`, `Sp_Manufacture_SetTime_BB`, and `Sp_Manufacture_SetTime_process` — only on the `p_sWorkType = '2'` (night shift) branch, paired with the `p_sYxStartDate`/`p_sYxEndDate` (夜休) parameters. Ultimately reached via the Java `BtnCalculationService` "计算排程时间" button (Sp_unifiedPlanning_BtnCalculation / Sp_Manufacture_SetTime path). diff --git a/en/docs/auto-catalog/functions/FUN_GET_DATE_KT_ADD.md b/en/docs/auto-catalog/functions/FUN_GET_DATE_KT_ADD.md index f173407..6467f1a 100644 --- a/en/docs/auto-catalog/functions/FUN_GET_DATE_KT_ADD.md +++ b/en/docs/auto-catalog/functions/FUN_GET_DATE_KT_ADD.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Production-scheduling break-window push helper for a planning interval. If the planned interval crosses a configured break window (e.g. lunch 12:00–13:00) the running end-time gets pushed by the window length so the break doesn't count as production time. "KT" matches the `kt`/`ukt` naming on the sister functions ([`FUN_GET_DATE_UKT`](FUN_GET_DATE_UKT.md) family). Day-shift companion of [`FUN_GET_DATE_UKT_ADD`](FUN_GET_DATE_UKT_ADD.md), which covers the night-shift break window. + +**What it does:** defaults the window to `23:30:00 → 00:30:00` if unset. Computes `p_i = (p_tCStartTime ≤ today_at_sStartDate)` and `p_j = (p_tAddTime > today_at_sStartDate)`. If both are true (i.e. the interval straddles the break window's start), adds `p_addMinut` minutes to `p_tAddTime`. Returns the (possibly adjusted) `p_tAddTime`. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — only the source file `FUN_GET_DATE_KT_ADD.sql` itself was found. Sister `FUN_GET_DATE_UKT_ADD` is live in [`FUN_GET_CALCPLAN_DATE_END`](FUN_GET_CALCPLAN_DATE_END.md); this `KT_ADD` form looks like a leftover companion — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/FUN_GET_DATE_UKT.md b/en/docs/auto-catalog/functions/FUN_GET_DATE_UKT.md index 166c4ff..d2d9d2e 100644 --- a/en/docs/auto-catalog/functions/FUN_GET_DATE_UKT.md +++ b/en/docs/auto-catalog/functions/FUN_GET_DATE_UKT.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产排程 → 生产计划管理 → 生产管理 — within-day rest-period shifter used by the workcenter-scheduling time engine. Companion to `FUN_GET_DATE_KT` for rest windows that do NOT cross midnight (lunch 午休, afternoon tea 午茶, dinner 晚餐, etc.). Default window 11:30–12:30. + +**What it does:** checks whether `p_tCStartTime` sits between `start_today` and `end_today`; if yes, jumps it forward to `end_today`. Otherwise returns the input unchanged. NULL-safe via `IFNULL` defaults. + +**Invocation:** called from `Sp_Manufacture_SetTimeDivRow`, `Sp_Manufacture_SetTime_BB`, `Sp_Manufacture_SetTime_Employ`, `Sp_Manufacture_SetTime_process`, and the helper `FUN_GET_CALCPLAN_DATE_END`. Day-shift branch passes it the lunch/breakfast/dinner window pairs (`p_sWxStartDate`/`p_sWxEndDate`, etc.) one after another to skip whichever rest period the cursor falls in. Reached via `BtnCalculationService` "计算排程时间" button. diff --git a/en/docs/auto-catalog/functions/FUN_GET_DATE_UKT_ADD.md b/en/docs/auto-catalog/functions/FUN_GET_DATE_UKT_ADD.md index 6c7d09d..8c0f823 100644 --- a/en/docs/auto-catalog/functions/FUN_GET_DATE_UKT_ADD.md +++ b/en/docs/auto-catalog/functions/FUN_GET_DATE_UKT_ADD.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产排程 → 生产计划管理 → 生产管理 — duration-stretching variant used by the workcenter-scheduling engine. Called when a job's *task duration* straddles the start boundary of a within-day rest window: if work starts at or before the rest window begins but is scheduled to end after the window opens, push the projected end time forward by `p_addMinut` minutes (the length of that rest period) so the elapsed work time still equals the planned duration. + +**What it does:** with `p_tCStartTime` (task start) and `p_tAddTime` (current projected end), tests `start ≤ restWindowStart < end`; if true, adds `p_addMinut` minutes to the end time and returns it. Otherwise returns end time unchanged. + +**Invocation:** called from `Sp_Manufacture_SetTime`, `Sp_Manufacture_SetTime_Employ`, `Sp_Manufacture_SetTime_process`, and `FUN_GET_CALCPLAN_DATE_END`. Day-shift loop chains the call across each defined rest window (`p_sWxStartDate`/`p_sWfStartDate`/`p_sWyStartDate`/`p_sYxStartDate`/`p_sYfStartDate`/`p_sYyStartDate` etc.). Reached via `BtnCalculationService` "计算排程时间" button. diff --git a/en/docs/auto-catalog/functions/FUN_GET_DATE_YX.md b/en/docs/auto-catalog/functions/FUN_GET_DATE_YX.md index 23665a1..c7c716b 100644 --- a/en/docs/auto-catalog/functions/FUN_GET_DATE_YX.md +++ b/en/docs/auto-catalog/functions/FUN_GET_DATE_YX.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产排程 → 生产计划管理 → 生产管理 — orphaned variant of the cross-midnight rest-shifter. Body is structurally identical to `FUN_GET_DATE_KT` (same `p_sStartDate`/`p_sEndDate` default 23:30 → 00:30 cross-midnight window logic), differing only in the branch-2 fallback: where `FUN_GET_DATE_KT` rolls `p_tCStartTime` to *next day's `p_sEndDate`*, this one only assigns it on the cross-midnight branch and leaves the same-day branch untouched. + +**What it does:** if `p_tCStartTime` falls in the (prev-day-start … today-end) cross-midnight window, jump it to tomorrow's `p_sEndDate`; else if it falls in the (today-start … tomorrow-end) window, jump it to today's `p_sEndDate`; otherwise unchanged. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, exhaustive xly-src grep across all extensions) — only its own `.sql` def file exists. Likely superseded by `FUN_GET_DATE_KT`. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/FUN_GET_DECOMPOSECUSTOMIZE.md b/en/docs/auto-catalog/functions/FUN_GET_DECOMPOSECUSTOMIZE.md index ea4b7f9..3694e40 100644 --- a/en/docs/auto-catalog/functions/FUN_GET_DECOMPOSECUSTOMIZE.md +++ b/en/docs/auto-catalog/functions/FUN_GET_DECOMPOSECUSTOMIZE.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产排程 → 生产计划管理 → 生产管理 — when an MftPlan (生产工单 / production plan) row is being inserted and the work-order's "印面" (sheet face) is configured with a custom 分拆 (decomposition) scheme — by 贴数 (signature count) or 折页贴数 (folding signatures) — this function resolves the per-index face-name string the slave row should carry. + +**What it does:** if no control-face-name input is provided, returns the plain `p_sFaceName`. If `p_iArrangeSrcValue` is 3 (按贴) or 4 (按折页贴), reads `sControlFaceName_tmp.sControlFacesChar` for the supplied `iIndex` and concatenates with `p_titleEnd` (正/反 marker). Otherwise returns the original control-face-name unchanged. Other 分拆 modes (1 无需分拆, 2 按印版付数, 5 按装订贴数, 6 按书刊贴数, 7 按实际米数) take the no-op path. + +**Invocation:** called from `Sp_Manufacture_InsertMftPlanSlave` while it splits a slave plan row into per-signature instances. Sp_Manufacture_InsertMftPlan* chain is invoked by the production-plan generation flow (排程 module). No direct form-master or gdsmodule hook reference. diff --git a/en/docs/auto-catalog/functions/FUN_GET_to_pinyin.md b/en/docs/auto-catalog/functions/FUN_GET_to_pinyin.md index 12ea87a..d9c0e18 100644 --- a/en/docs/auto-catalog/functions/FUN_GET_to_pinyin.md +++ b/en/docs/auto-catalog/functions/FUN_GET_to_pinyin.md @@ -18,4 +18,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Converts a Chinese display string to its lowercase pinyin equivalent — a generic name-to-pinyin helper. Returns the original characters untouched if they are ASCII. + +**What it does:** hex-encodes the input, then walks two bytes at a time. For each high-byte > 128 (Chinese GBK character) it computes the GBK code point and looks up the pinyin prefix in `t_base_pinyin` (`CODE_ >= ABS(mycode) ORDER BY CODE_ ASC LIMIT 1`); ASCII bytes pass through. Returns the concatenated lowercase string. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. The companion `t_base_pinyin` table exists, suggesting this was wired up for a pinyin-search feature that never shipped. diff --git a/en/docs/auto-catalog/functions/FUN_JSON_CHAR.md b/en/docs/auto-catalog/functions/FUN_JSON_CHAR.md index a1f5bc0..5e8ff62 100644 --- a/en/docs/auto-catalog/functions/FUN_JSON_CHAR.md +++ b/en/docs/auto-catalog/functions/FUN_JSON_CHAR.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Tiny JSON-string accessor. Intended to support the `sp_btn_action` button-event dispatcher in reading textual fields out of `sButtonParam` / change-value JSON payloads. + +**What it does:** Validates `sParam` is JSON; returns `JSON_UNQUOTE(JSON_EXTRACT(sParam, sKey))` or `''` if missing/invalid. Two-line helper. + +**Invocation:** Orphan-via-dead-chain. Only two routine callers (`sp_btn_action`, `sp_btn_action_updatequoquotationslave`) — both themselves orphans (no form, no module hook, no Java reference). One customer override script in `xly-src/script/客户/万昌/计件工资/sp_btn_WorkOrderAssessmentPassRate.sql` references it, but that proc is not deployed in the live DB. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/FUN_JSON_INT.md b/en/docs/auto-catalog/functions/FUN_JSON_INT.md index e4213d3..acef883 100644 --- a/en/docs/auto-catalog/functions/FUN_JSON_INT.md +++ b/en/docs/auto-catalog/functions/FUN_JSON_INT.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Integer-typed sibling of `FUN_JSON_CHAR`. Reads a key out of a JSON payload and casts to signed int. Designed for the same `sp_btn_action` button-event dispatcher to evaluate flag fields (`bSubmit`, `bCheck`, `bTecnologe`, …). + +**What it does:** If `sParam` is valid JSON, extracts `sKey`, strips quotes, casts to signed integer; defaults to 0. + +**Invocation:** Orphan-via-dead-chain. Only callers are `sp_btn_action` + `sp_btn_action_updatequoquotationslave`, both themselves orphans (no form-master, module-hook, or Java reference anywhere). Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/FUN_MATERIALS_SMAIL.md b/en/docs/auto-catalog/functions/FUN_MATERIALS_SMAIL.md index 2e6700b..7086866 100644 --- a/en/docs/auto-catalog/functions/FUN_MATERIALS_SMAIL.md +++ b/en/docs/auto-catalog/functions/FUN_MATERIALS_SMAIL.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Material-cutting estimator for the printing/box-making workshop — computes how many full sheets ("整根") are needed to fulfill `dQty` pieces at `dLength × dWidth` (cm), assuming a 305 cm stock sheet and reusing offcuts. Header gloss: "两变都小于305的材料(单位CM)" (both dimensions under 305 cm). + +**What it does:** Swaps so length ≥ width, peels off whole stock-sheet multiples for any dimension > 305, then runs a greedy bin-packing loop tracking the running offcut (`clys`) and a JSON queue of reusable scraps (`jsonlist`) — each piece consumes length then width, replenishing `clys = 305 - dLength` when exhausted. Returns full-sheet count + scrap-sheet count. + +**Invocation:** Status: appears orphaned. No form-master, module-hook, other-routine, or xly-src caller. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/F_Gb2Big.md b/en/docs/auto-catalog/functions/F_Gb2Big.md index fb131d1..be682fa 100644 --- a/en/docs/auto-catalog/functions/F_Gb2Big.md +++ b/en/docs/auto-catalog/functions/F_Gb2Big.md @@ -19,4 +19,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Simplified ↔ Traditional Chinese character conversion utility. xly stores parallel `sChinese` / `sBig5` columns on most master tables so reports rendered for Taiwan/HK customers (or for printing plates targeting Big5 locales) can show the Traditional form. This function is the per-string mapper. + +**What it does:** walks each character of `str` and looks it up in the `codetable(gb, big)` table — direction chosen by `toBIG` (1 = GB→Big5, else Big5→GB). Falls back to the original character when no row matches. Pure read; one row lookup per character. + +**Invocation:** wrapped by `Fun_Gb2Big_ChineseToBig` and `Sp_Gb2Big_ChineseToBig`, which apply the conversion column-by-column (`sChinese → sBig5`, `sChineseDepart → sBig5Depart`, etc.) on master records during save flows. diff --git a/en/docs/auto-catalog/functions/Fn_ParseParams.md b/en/docs/auto-catalog/functions/Fn_ParseParams.md index 869ad32..9e0d066 100644 --- a/en/docs/auto-catalog/functions/Fn_ParseParams.md +++ b/en/docs/auto-catalog/functions/Fn_ParseParams.md @@ -18,4 +18,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Quotation reporting — renders a JSON parameter list as a human-readable string for display on the printed quotation. Each parameter row has a code (`sParamKey`), label (`sParamName`), and value (`sParamValue`); the output collapses them into `name:【value】;name:【value】;…` form. + +**What it does:** uses `JSON_TABLE` to fan the JSON array out into rows and `GROUP_CONCAT` to assemble the display string. Pure transformation; no schema dependencies. + +**Invocation:** called only by `Sp_reportdata_Quo_JT` — the data-prep proc behind the JT-flavoured quotation report template. diff --git a/en/docs/auto-catalog/functions/Fn_find_pinyin.md b/en/docs/auto-catalog/functions/Fn_find_pinyin.md index 06a2f7f..772fcf4 100644 --- a/en/docs/auto-catalog/functions/Fn_find_pinyin.md +++ b/en/docs/auto-catalog/functions/Fn_find_pinyin.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Pinyin-initials helper for auto-generated codes. The `Sp_Sis_GetMaxNo` family (which builds the next sequential business code for orders, materials, products, etc.) calls this when a code template embeds a pinyin abbreviation of a name field — e.g., turning customer `北京华佳` into `BJHJ` so it can be used as a code prefix. + +**What it does:** walks each character of `P_NAME` (after normalizing full-width parens to ASCII) and concatenates `Fn_fristPinyin(char)` for each. Falls back to the original `P_NAME` if every char yielded empty. Pure string transformation; no table reads. + +**Invocation:** called by `Sp_Sis_GetMaxNo`, `Sp_Sis_GetMaxNo_1`, `Sp_Sis_GetMaxNo_New`, and `Sp_Sis_GetMaxNo_copy1` — the next-code generator invoked by save flows across most master forms. diff --git a/en/docs/auto-catalog/functions/Fn_find_pinyin_copy1.md b/en/docs/auto-catalog/functions/Fn_find_pinyin_copy1.md index d77e202..d31452b 100644 --- a/en/docs/auto-catalog/functions/Fn_find_pinyin_copy1.md +++ b/en/docs/auto-catalog/functions/Fn_find_pinyin_copy1.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Fn_find_pinyin` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Fn_find_pinyin` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/functions/Fn_fristPinyin.md b/en/docs/auto-catalog/functions/Fn_fristPinyin.md index ce9238b..edc1a30 100644 --- a/en/docs/auto-catalog/functions/Fn_fristPinyin.md +++ b/en/docs/auto-catalog/functions/Fn_fristPinyin.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Returns the first pinyin letter of a single Chinese character. Building block of `Fn_find_pinyin`, which assembles full pinyin abbreviations used as code prefixes by the `Sp_Sis_GetMaxNo` family. + +**What it does:** if the input is single-byte ASCII it returns it unchanged. Otherwise converts the first byte of the GBK-encoded character to its hex value and bucket-matches it against the standard GBK pinyin-range boundary table to pick a letter A–Z. No `I`, `U`, `V` (Mandarin has no surname/initial in those ranges by convention). No table I/O. + +**Invocation:** called only by `Fn_find_pinyin` and indirectly by the `Sp_Sis_GetMaxNo*` next-code generators that wrap it. A `_copy1` backup of `Fn_find_pinyin` also references it. diff --git a/en/docs/auto-catalog/functions/Fn_json_extract.md b/en/docs/auto-catalog/functions/Fn_json_extract.md index 18989b0..b3f414b 100644 --- a/en/docs/auto-catalog/functions/Fn_json_extract.md +++ b/en/docs/auto-catalog/functions/Fn_json_extract.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Hand-rolled JSON value extractor — predates xly's adoption of MySQL's native `JSON_EXTRACT`. Used heavily in cost/quotation/work-order calculation procs that store inline JSON snippets on detail rows (config parameters, dynamic field bags) and need to pull a single scalar out without strict JSON validity. + +**What it does:** searches `p_jsonstr` for `"":"..."` and returns the substring up to the next `"`; if that fails it falls back to `"":...,` (unquoted value) and returns up to the next `,` or `}`. Pure regex/substring; tolerant of malformed JSON in a way `JSON_EXTRACT` is not. + +**Invocation:** called from ~20 production procs including the calc family (`Sp_Calc_sMpt`, `Sp_Calc_sScd`, `Sp_Calc_sSod`, `Sp_Calc_sWod`), the manufacturing planning info procs (`Sp_Manufacture_ProductionPlanInfo*`), MES OEE state probes (`Sp_Manufacture_GetAPSState*`), `Sp_Sis_GetMaxNo*`, and the graphic report engine (`Sp_Graphic_Report_Analysis_Data`). diff --git a/en/docs/auto-catalog/functions/Fn_spit_length.md b/en/docs/auto-catalog/functions/Fn_spit_length.md index 5621ae6..fae8be6 100644 --- a/en/docs/auto-catalog/functions/Fn_spit_length.md +++ b/en/docs/auto-catalog/functions/Fn_spit_length.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Counts how many tokens a delimited string would produce when split on `splitstr`. Building block used throughout the save-return / before-save-return validation procs (`Sp_saveReturn_*`, `Sp_beforeSaveReturn_*`) — those procs iterate over comma-joined id lists coming from the FROUNT save payload, and this gives them the loop bound. + +**What it does:** `length(str) - length(replace(str, splitstr, '')) + 1` — one-liner that subtracts the trimmed length from the original to count delimiters, then adds one. Returns 1 even when the input has no delimiter at all. + +**Invocation:** called from ~80 production procs, dominated by the `Sp_saveReturn_*` and `Sp_beforeSaveReturn_*` document save flows (sales order `_sSod`, work order `_sWod`, quotation `_sQtt`, packing `_sPkg`, etc.) and a handful of cost-calc / reporting procs. diff --git a/en/docs/auto-catalog/functions/Fn_split_string.md b/en/docs/auto-catalog/functions/Fn_split_string.md index a4f1ad0..2b194e9 100644 --- a/en/docs/auto-catalog/functions/Fn_split_string.md +++ b/en/docs/auto-catalog/functions/Fn_split_string.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Returns the Nth token from a delimited string — the indexed-access companion to `Fn_spit_length`'s count. The pair is the standard string-list iteration kit used across the save-return validation flows and many reports. + +**What it does:** `reverse(substring_index(reverse(substring_index(str, splitstr, strindex)), splitstr, 1))` — slices off the first `strindex` tokens, reverses, slices off the last one, reverses back. Returns the 1-based Nth token. + +**Invocation:** called from ~100 production procs, including all `Sp_saveReturn_*` / `Sp_beforeSaveReturn_*` document save flows, the work-order cost-calc data-pack procs (`Sp_WorkOrder_CalcDataPack*`), the AutoOrder production-plan procs (`Sp_productionPlan_BtnEventAutoOrder*`), and a handful of utility funcs (`Fun_bFilter_toWhere`, `Fun_getPartNameStatus`, `Fun_getPlanDate`). diff --git a/en/docs/auto-catalog/functions/Fun_AnalysisListJson.md b/en/docs/auto-catalog/functions/Fun_AnalysisListJson.md index a6a91ea..592b110 100644 --- a/en/docs/auto-catalog/functions/Fun_AnalysisListJson.md +++ b/en/docs/auto-catalog/functions/Fun_AnalysisListJson.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Flattens a JSON array of row objects into a delimited display string — the workhorse used by manufacturing-plan reports and work-order data-pack procs to render embedded detail lists (process steps, color sequences, parts lists) as a single column on a report row. + +**What it does:** loops the `p_json` array. For each row, loops the comma-separated `cloumnNames` and extracts `$[i].column` via `JSON_EXTRACT`, stripping the JSON quotes. Each value gets the per-column suffix from `splitNames` (e.g., `+,+,*`); rows are joined by `,` unless `splitNames` is supplied (in which case rows are concatenated directly). Returns the original `p_json` untouched if input is empty or invalid. + +**Invocation:** called from the MFT plan inserters (`Sp_Manufacture_InsertMftPlan`, `Sp_Manufacture_InsertMftPlanProcess`, `Sp_Manufacture_InsertMftPlanToErp`), the production-report check procs (`Sp_Check_mftProductionReportValue*`), the OEE reports (`Sp_OEE_ProductionReport*`), the work-order reports (`Sp_reportdata_WorkOrder*`), `Sp_WorkOrder_CalcDataPackProductStd`, and `Sp_WorkOpsOutProcess`. diff --git a/en/docs/auto-catalog/functions/Fun_AnalysisListJsonEnter.md b/en/docs/auto-catalog/functions/Fun_AnalysisListJsonEnter.md index 22ad78b..e395a5c 100644 --- a/en/docs/auto-catalog/functions/Fun_AnalysisListJsonEnter.md +++ b/en/docs/auto-catalog/functions/Fun_AnalysisListJsonEnter.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Variant of [`Fun_AnalysisListJson`](Fun_AnalysisListJson.md) tuned for work-order report rendering — on the last row of the JSON array it strips embedded newlines from the per-column suffix so the final display string doesn't end with a trailing line break. + +**What it does:** same loop as `Fun_AnalysisListJson` (walks the JSON array, extracts `$[i].col` per column, joins with `splitNames` suffixes). The only difference is the special-case at `p_handle = p_length`: applies `REPLACE(splitName, '\n', '')` to the suffix. + +**Invocation:** called only by the work-order data-prep reports `Sp_reportdata_WorkOrder`, `Sp_reportdata_WorkOrder1`, `Sp_reportdata_WorkOrder3`. diff --git a/en/docs/auto-catalog/functions/Fun_AnalysisListJsonOld.md b/en/docs/auto-catalog/functions/Fun_AnalysisListJsonOld.md index e4c6720..d0f0674 100644 --- a/en/docs/auto-catalog/functions/Fun_AnalysisListJsonOld.md +++ b/en/docs/auto-catalog/functions/Fun_AnalysisListJsonOld.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Predecessor of [`Fun_AnalysisListJson`](Fun_AnalysisListJson.md) — same JSON-array-to-delimited-string shape but missing the `JSON_VALID` / empty-input guards and always uses `,` as the row separator. Kept as the `_Old` snapshot, presumably from before the validation patch. + +**What it does:** walks the JSON array; per row, extracts each named column via `JSON_EXTRACT`, strips quotes, appends the per-column `splitName` suffix, and concatenates rows with a hard-coded `,` separator. Crashes if `p_json` isn't valid JSON (no guard). + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. The active version is `Fun_AnalysisListJson`. diff --git a/en/docs/auto-catalog/functions/Fun_AnalysisListJsonTwo.md b/en/docs/auto-catalog/functions/Fun_AnalysisListJsonTwo.md index efa4746..54557af 100644 --- a/en/docs/auto-catalog/functions/Fun_AnalysisListJsonTwo.md +++ b/en/docs/auto-catalog/functions/Fun_AnalysisListJsonTwo.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Color-count accumulator used during work-order product-standard cost calculation. Walks a JSON array of color rows, splitting them into "process colors" (CMYK + composite `C+M+Y+K`) versus "spot colors" depending on `iColorOrder`, and sums the matching quantity column. + +**What it does:** for each row, extracts a name from `cloumnNames` and a quantity from `cloumnNames1`. If `iColorOrder=1` adds the quantity when the name matches one of `C`, `M`, `Y`, `K`, `C+M+Y+K`; otherwise adds the quantity when it does not. Returns the integer total (signature returns `int` even though intermediate is decimal). Despite the shared name, this is *not* a string-list flattener like the sibling functions — only the loop shape is shared. + +**Invocation:** called only by `Sp_WorkOrder_CalcDataPackProductStd` — the data-pack cost calculator for packaging product standards. diff --git a/en/docs/auto-catalog/functions/Fun_AnalysisListJson_copy1.md b/en/docs/auto-catalog/functions/Fun_AnalysisListJson_copy1.md index c9a3356..13f4005 100644 --- a/en/docs/auto-catalog/functions/Fun_AnalysisListJson_copy1.md +++ b/en/docs/auto-catalog/functions/Fun_AnalysisListJson_copy1.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Fun_AnalysisListJson` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Fun_AnalysisListJson` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/functions/Fun_Cashier_GetMaterialsPrice.md b/en/docs/auto-catalog/functions/Fun_Cashier_GetMaterialsPrice.md index 1c95c8d..e234eff 100644 --- a/en/docs/auto-catalog/functions/Fun_Cashier_GetMaterialsPrice.md +++ b/en/docs/auto-catalog/functions/Fun_Cashier_GetMaterialsPrice.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Purchasing/quotation/work-order — "most recent purchase price" lookup for a material, optionally filtered by supplier. The cost-calculation procs use this to default a material line's unit cost when the user hasn't typed one in. Header comment is `获取最近采购价(物料)` ("get most-recent purchase price for material"). + +**What it does:** reads `elematerialssupply.dQuantityPrice` for the given material, tenant-scoped by `sBrId`/`sSuId`, only over `bCheck = 1` rows, taking the latest by `tCreateDate`. Tries narrowing filters in order: (supplier + style) → (supplier alone) → (style alone) → (material alone). Returns the price as a varchar; `'0'` when nothing matches. + +**Invocation:** referenced from form-master `sId 192116810113315263819752160` ("1/4 采购申请->采购订单") and `101251240115016347243410860` ("待入库客来料任务列表"). Called directly by the quotation calc family (`Sp_Quotation_CalcData*`), work-order calc family (`Sp_WorkOrder_CalcData*`), `Sp_Inventory_MaterialsInventoryV56Price`, `Sp_Manufacture_sWodPurchareMaterials_copy1`, the materials check proc `Sp_Check_sMcd`, and the `_Quo` quotation variant of itself. diff --git a/en/docs/auto-catalog/functions/Fun_Cashier_GetMaterialsPrice_Quo.md b/en/docs/auto-catalog/functions/Fun_Cashier_GetMaterialsPrice_Quo.md index 4b23283..a83a3d7 100644 --- a/en/docs/auto-catalog/functions/Fun_Cashier_GetMaterialsPrice_Quo.md +++ b/en/docs/auto-catalog/functions/Fun_Cashier_GetMaterialsPrice_Quo.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Quotation-side material-price lookup. Wraps [`Fun_Cashier_GetMaterialsPrice`](Fun_Cashier_GetMaterialsPrice.md) and applies the tenant-configured quotation markup so the quoted price differs from the underlying purchase price. Source columns are `SysSystemSettings.sValue` for `NetPrice` (rounding decimals) and `NetVeryHighPercentage` (markup %). + +**What it does:** first reads `NetPrice` and `NetVeryHighPercentage` for the tenant, then computes `ROUND(Fun_Cashier_GetMaterialsPrice(...), NetPrice) * (1 + NetVeryHighPercentage/100)`. If that comes back 0 (no historical purchase), falls back to the same ladder of direct `elematerialssupply` reads as the base function. Returns `'0'` as a final fallback. + +**Invocation:** Status: appears orphaned at the leaf level. No caller found in form-master, gdsmodule hooks, other routines, or xly-src grep — candidate for maintainer audit. The `_Quo` suffix and the markup wiring point to quotation flows, but the live quotation-calc family (`Sp_Quotation_CalcData*`) currently calls the plain `Fun_Cashier_GetMaterialsPrice`, not this variant. diff --git a/en/docs/auto-catalog/functions/Fun_Cashier_GetMaterialsPrice_new.md b/en/docs/auto-catalog/functions/Fun_Cashier_GetMaterialsPrice_new.md index 02c8d2d..dc5019b 100644 --- a/en/docs/auto-catalog/functions/Fun_Cashier_GetMaterialsPrice_new.md +++ b/en/docs/auto-catalog/functions/Fun_Cashier_GetMaterialsPrice_new.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Newer revision of [`Fun_Cashier_GetMaterialsPrice`](Fun_Cashier_GetMaterialsPrice.md) — same "most recent purchase price" lookup for a material under the same fallback ladder. The two versions are bodies-identical in the section seen here; the diff (if any) sits in trailing logic this lookup didn't pull out. + +**What it does:** reads `elematerialssupply.dQuantityPrice` filtered by material + (optional supplier, style), tenant-scoped, `bCheck = 1` only, latest by `tCreateDate`. Returns `'0'` if no match. + +**Invocation:** called only by `Sp_Check_sMcd` — the material-check proc invoked from material-card save flows. Not referenced by any form-master, gdsmodule hook, or xly-src file. The stable variant `Fun_Cashier_GetMaterialsPrice` is the one used by the cost-calc family. diff --git a/en/docs/auto-catalog/functions/Fun_Cashier_GetProductPrice.md b/en/docs/auto-catalog/functions/Fun_Cashier_GetProductPrice.md index 77f30e4..f1e52ba 100644 --- a/en/docs/auto-catalog/functions/Fun_Cashier_GetProductPrice.md +++ b/en/docs/auto-catalog/functions/Fun_Cashier_GetProductPrice.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Sales-side — "most recent sale price" for a finished product, used to default product-line prices on sales documents. Despite the header comment `获取最近采购价(产品)` ("most-recent purchase price for product"), the body reads sales views, not purchasing views; the comment is a copy-paste leftover from the materials sibling. + +**What it does:** reads `dProductPrice` from `Viw_SalSalesChecking` first (settled sales rows, `dLossMoney = 0`), then falls back through `Viw_SalDeliverGoods` and `Viw_SalSalesOrder`, all `bCheck = 1`, tenant-scoped, latest by `tCreateDate`. Returns `'0'` if nothing matches. + +**Invocation:** referenced from form-master `sId 101251240115016087911499840` ("选择材料(销售)" — material selector on sales forms) and called by `Sp_Save_CheckSaveAfter` for the after-save sales validations. diff --git a/en/docs/auto-catalog/functions/Fun_Cashier_GetProductPrice_new.md b/en/docs/auto-catalog/functions/Fun_Cashier_GetProductPrice_new.md index 93552e6..64c7371 100644 --- a/en/docs/auto-catalog/functions/Fun_Cashier_GetProductPrice_new.md +++ b/en/docs/auto-catalog/functions/Fun_Cashier_GetProductPrice_new.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Newer revision of [`Fun_Cashier_GetProductPrice`](Fun_Cashier_GetProductPrice.md). Drops the `Viw_SalSalesChecking` and `Viw_SalDeliverGoods` reads and adds a fallback into `viw_pitproductinit` (the product-init cost view) — i.e., when no recent sales-order price exists, defaults to the configured init cost rather than 0. + +**What it does:** queries `Viw_SalSalesOrder.dProductPrice` for the latest `bCheck = 1` tenant-scoped row; if 0, queries `viw_pitproductinit.dCostPrice` under the same filter. Returns `'0'` if both miss. + +**Invocation:** called by `Sp_Save_CheckSaveAfter` — specifically the after-save validation path that backfills `dProductPrice` and `dProfitLossMoney` on the sales detail when the user leaves them blank. Not referenced by form-master, gdsmodule hooks, or xly-src. diff --git a/en/docs/auto-catalog/functions/Fun_Exclusion_algorithm.md b/en/docs/auto-catalog/functions/Fun_Exclusion_algorithm.md index 46e4739..2be0e6b 100644 --- a/en/docs/auto-catalog/functions/Fun_Exclusion_algorithm.md +++ b/en/docs/auto-catalog/functions/Fun_Exclusion_algorithm.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Box-typesetting (拼版) layout configuration helper for the imposition / nesting (`sisboxtypesetting`) feature. For a given product-type id, returns the type's child layout rules as a JSON array — each rule packed as `{iIncrement, sId, sBrandsId, sSubsidiaryId, iOrder, sParentId, sName, sChinese, showName, sBig5, iFitWidth, sCode, sSettingMethod, iFAngle, sFLengthOffset/sFWidthOffset, iSAngle, sSLengthOffset/sSWidthOffset, sSGroupOffset, sSecondLongitudinalOffset/sSecondorizontalOffset}`. Header comment is `获取排除算法` ("get exclusion algorithm"). + +**What it does:** runs one `SELECT` against `sisboxtypesetting` filtered by `sParentId = sProductTypeId`, builds each row's JSON via `JSON_OBJECT`, joins them with `GROUP_CONCAT ORDER BY iOrder`, and wraps the result in `[...]`. Returns the empty string when no rows match. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/Fun_FormulaReplace.md b/en/docs/auto-catalog/functions/Fun_FormulaReplace.md index 471330a..49c8630 100644 --- a/en/docs/auto-catalog/functions/Fun_FormulaReplace.md +++ b/en/docs/auto-catalog/functions/Fun_FormulaReplace.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Token-substitution helper used by the formula-resolution family of procs (`Sp_System_ReplaceField*`) when expanding the variable placeholders inside a formula string (e.g. quote-price formulas, work-order calc formulas). One call replaces one `[name]` placeholder with its concrete value, plus a "concatenated trace" copy `[name]value` so downstream code can render the audit trail. Header comment is `公式计算解析函数` ("formula calc parsing function"). + +**What it does:** if `toReplaceValue` is purely numeric (regex `[^0-9.]=0`), it normalizes via `ROUND(CONVERT(...)+0,4)` to strip trailing zeros. Lowercases both keys. Returns `''` for empty input. Then `REPLACE`s the placeholder (in both `[name]` and full-width `【name】` forms) with `toReplaceValue` and with the concatenated `nametoReplaceValue` trace token. + +**Invocation:** called from `Sp_System_ReplaceFieldNew`, `Sp_System_ReplaceField_Detail`, `Sp_System_ReplaceField_NEW`, `Sp_System_ReplaceField_NEW_ACT` — the formula-substitution upgrades shipped under `script/标版/upgrade/20220111公式解析实际详情` and `20220321计算获取公式解析`. diff --git a/en/docs/auto-catalog/functions/Fun_Formula_Process.md b/en/docs/auto-catalog/functions/Fun_Formula_Process.md index a85c7f4..4879523 100644 --- a/en/docs/auto-catalog/functions/Fun_Formula_Process.md +++ b/en/docs/auto-catalog/functions/Fun_Formula_Process.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Per-process parameter-pack builder for the routing-step (`sisprocesssparam`) configuration. For a given process id, returns a JSON-object string describing every parameter that step exposes — its display name, default value, and dropdown options — so the work-order UI can render the right form fields when a worker chooses that process. Header comment is `公式计算解析函数` ("formula calc parsing function"). Example payload in the body comments shows hot-stamp ("烫金") params like `生产方式`, `做版要求`, `测试方法`. + +**What it does:** counts the rows in `sisprocesssparam` for `p_sProcessId`; if zero, returns `''`. Otherwise opens a cursor ordered by `iOrder` and, for each row, concatenates `"sParam":"","sParamDefault":""` plus an optional `"sParamDropDown":{"v1","v2",…}` block built from the up-to-13 `sParamValue1..13` columns. Joins entries with `,` and wraps the whole thing in `{…}`. Returns the result or `''`. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. Body design suggests it's invoked from form-master sSqlStr to populate process-param dropdowns, but no such row references it. diff --git a/en/docs/auto-catalog/functions/Fun_Gb2Big_ChineseToBig.md b/en/docs/auto-catalog/functions/Fun_Gb2Big_ChineseToBig.md index 0f9b89c..9283a64 100644 --- a/en/docs/auto-catalog/functions/Fun_Gb2Big_ChineseToBig.md +++ b/en/docs/auto-catalog/functions/Fun_Gb2Big_ChineseToBig.md @@ -17,4 +17,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Bulk simplified-Chinese → Traditional-Chinese (Big5) refresh for the metadata catalog. Every UI label across `gdsmodule`, `gdsconfigformmaster`, `gdsconfigcharmaster`, `gdsconfigformslave`, `gdsformconst`, `gdsjurisdiction` is shipped in `sChinese` (simplified); the `sBig5` columns next to them hold the traditional rendering shown to Big5 tenants. This function re-derives `sBig5` from `sChinese` in one pass by piping every label through the lower-level `F_Gb2Big` per-string converter. + +**What it does:** runs an unconditional `UPDATE … SET sBig5 = F_Gb2Big(sChinese, 1)` on each of those six tables (plus the related `sBig5Depart`, `sBig5UnMemo`, `sBig5WorkFruit` on `gdsmodule` and `sBig5DropDown` on the const slave rows). Returns the empty string. Note: a sibling **procedure** of the same name (~2.2K body) does this in 1000-row paginated batches via cursor — likely the safer alternative on large catalogs. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. Typically run manually after deploying a new metadata catalog. diff --git a/en/docs/auto-catalog/functions/Fun_GetAddBillNo.md b/en/docs/auto-catalog/functions/Fun_GetAddBillNo.md index 803cde4..0179b92 100644 --- a/en/docs/auto-catalog/functions/Fun_GetAddBillNo.md +++ b/en/docs/auto-catalog/functions/Fun_GetAddBillNo.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Bill-number arithmetic — `获取新增的单据号`. Takes a bill number with a numeric tail (e.g. `SO-2024-0001`) and produces the same prefix with the trailing counter incremented by `p_num`, preserving the original zero-padding width. + +**What it does:** splits the input by reusing `Fun_GetGb` (alpha-only prefix) and `Fun_GetNum` (digits-only tail). Casts the digits to int, adds `p_num`, then re-prefixes with the original prefix and re-pads with leading zeros so the total length matches the input. Returns the new bill number. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. Bill-number assignment in production flows through `SysBillNoSettings` / `Fun_GetBillNo`, not this helper. diff --git a/en/docs/auto-catalog/functions/Fun_GetAddMapJson.md b/en/docs/auto-catalog/functions/Fun_GetAddMapJson.md index 051bfe5..c096bd8 100644 --- a/en/docs/auto-catalog/functions/Fun_GetAddMapJson.md +++ b/en/docs/auto-catalog/functions/Fun_GetAddMapJson.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** JSON-object builder — `组装MapJSON`. Appends a single `"key":"value"` pair to an existing JSON object (or creates a new one if empty), returning the merged JSON string. + +**What it does:** strips `{` and `}` from `p_JSON` to gauge non-emptiness. If empty, returns `{"p_Cloumn":"p_value"}`. Otherwise, snips the trailing `}` off `p_JSON` and concatenates `,"p_Cloumn":"p_value"}`. Pure string manipulation — does not parse or validate JSON. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. MySQL's native `JSON_SET` / `JSON_OBJECT` are preferred elsewhere in the codebase. diff --git a/en/docs/auto-catalog/functions/Fun_GetAuxiliaryQtyUnit.md b/en/docs/auto-catalog/functions/Fun_GetAuxiliaryQtyUnit.md index e0bea80..15f85b4 100644 --- a/en/docs/auto-catalog/functions/Fun_GetAuxiliaryQtyUnit.md +++ b/en/docs/auto-catalog/functions/Fun_GetAuxiliaryQtyUnit.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Inverse of `Fun_GetMaterialsQtyUnit` — given an **auxiliary** quantity (the purchasing/storage unit, e.g. 张/PCS/m) plus a material spec, returns either the equivalent **stocking-unit** quantity (when `iType=0`) or the auxiliary-unit name (when `iType=1`). Used during reverse formula calculation: `sFormulaIdType = sReComputeId`. + +**What it does:** reads the material's `EleMaterials` row (`sMaterialsUnit`, `sAuxiliaryUnit`, `dGramWeight`, `sConversionUnit`, `bReel`, `dCoefficient`, `bInverse`) plus tenant system settings `CbxMaterialsUnit` (MM/CM/INCH), `NetSquareM` (m² rounding decimals), `NetConversionRate` (inch conversion). Branches by spec format (`W*L`, `W*L*H`, plain numeric, blank) × unit family (Ton/吨/噸, KG, M2, M3, m, reel) × MM/CM/INCH dimension base. Each branch derives `dMaterialsQty` from `dAuxiliaryQty` using gram-weight or sheet-area math, picks a default `sAuxiliaryUnit` (`张`/`張`/`PCS`/`m`), and finally rounds: 张/PCS → `CEILING`; m → `ROUND(qty, NetSquareM)` (or CEILING if NetSquareM=0). Returns the quantity (iType=0) or unit string (iType=1). + +**Invocation:** invoked by `ReplaceFieldServiceImpl.getReplaceFieldReslut()` when the formula type is `sReComputeId` — the Java service synthesizes `SELECT Fun_GetAuxiliaryQtyUnit(...)` from material + slave-row context and runs it through `businessBaseDao.getByMap`. Also referenced by the bill-check family (`Sp_Check_sCmt`, `sLok`, `sMpa`, `sOis`, `sOpc`, `sOpi`, `sOpkg`, `sOpn`, `sOpn1`, `sOpp`, `sPca`, `sPca1`, `sPis`, `sPkg`, `sPmd`, `sPod`, `sPpa`) and inventory in/out procs (`SP_Inventory_InOutWarehouse`, `_All`, `_220709`, `_221111`). diff --git a/en/docs/auto-catalog/functions/Fun_GetBarId.md b/en/docs/auto-catalog/functions/Fun_GetBarId.md index 20a88e5..177be39 100644 --- a/en/docs/auto-catalog/functions/Fun_GetBarId.md +++ b/en/docs/auto-catalog/functions/Fun_GetBarId.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Numeric ID generator — header comment `生成27位纯数字的ID 模仿后台Java代码生成` ("27-digit numeric ID, mimics the Java backend"). The xly Java code mints all-numeric IDs by stitching together a timestamp and a counter; this is the SQL equivalent for procs that need to allocate IDs without a round-trip. + +**What it does:** returns `DATE_FORMAT(NOW(),'%y%m%d%H%i%s')` (12 digits, yyMMddHHmmss) concatenated with `LPAD(iIndex,2,'0')`. Final length is 14 — not 27 as the comment claims. Caller is expected to supply a monotonically increasing `iIndex` per second to avoid collisions. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. Production ID minting happens Java-side via `IdWorker`/`SnowflakeId`, leaving this as a stale convenience. diff --git a/en/docs/auto-catalog/functions/Fun_GetBillStatus.md b/en/docs/auto-catalog/functions/Fun_GetBillStatus.md index 3280ef0..54162ef 100644 --- a/en/docs/auto-catalog/functions/Fun_GetBillStatus.md +++ b/en/docs/auto-catalog/functions/Fun_GetBillStatus.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Per-form bill-number print/status setting — header `获取系统设定中 单据号设定 打印状态`. The bill-number admin module (`SysBillNoSettings`) lets tenants configure, per form × brand × subsidiary, how the bill number behaves at print/save time (auto-generate, manual, audit-locked etc., encoded in `sStatusType`). This function pulls that flag. + +**What it does:** if `sFormGuid` is non-empty, selects `sStatusType` from `SysBillNoSettings` where `sFormId/sBrandsId/sSubsidiaryId` match. Returns the value, or 0 if no row or no form. + +**Invocation:** invoked by the material-shortage / pull-pending bill family — `Sp_BillOfApply` and `Sp_BillOfApplyLine` (material apply by work order, gdsmodule `根据工单领料申请`), `Sp_BillOfNoPicking`, `_Cljg`, `_copy1` (no-pull-yet pending lists) — to gate behavior on the tenant's bill-number policy for the calling form. diff --git a/en/docs/auto-catalog/functions/Fun_GetBookStickQty.md b/en/docs/auto-catalog/functions/Fun_GetBookStickQty.md index c118ade..a3a93ca 100644 --- a/en/docs/auto-catalog/functions/Fun_GetBookStickQty.md +++ b/en/docs/auto-catalog/functions/Fun_GetBookStickQty.md @@ -18,4 +18,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Book-binding glue-allocation rounding rule. In book manufacturing, glue/`贴` is dispensed in quarter-unit increments; the planning system rounds fractional sticker quantities to the discrete pour size before charging materials. + +**What it does:** lookup table on `dQty`: 0.125 → 0.125; 0.25 → 0.25; 0.375 → 0.25; 0.5/0.625/0.75/0.875 → 0.5; all other values pass through unchanged. Returns 0 if NULL. + +**Invocation:** called from `Sp_Manufacture_InsertMftPlanBook` (book-style manufacturing plan generator) and the formula-engine replace-field family `Sp_System_ReplaceField`, `Sp_System_ReplaceFieldNew`, `Sp_System_ReplaceField_Detail`, `Sp_System_ReplaceField_NEW`, `Sp_System_ReplaceField_NEW_ACT` — those procs in turn are driven by `BtnCalculationServiceImpl` (`doSetTimeCalcMachineHour`) via the cost-formula module `成本公式`. diff --git a/en/docs/auto-catalog/functions/Fun_GetCalcMaterialsKs.md b/en/docs/auto-catalog/functions/Fun_GetCalcMaterialsKs.md index fca510f..40d17da 100644 --- a/en/docs/auto-catalog/functions/Fun_GetCalcMaterialsKs.md +++ b/en/docs/auto-catalog/functions/Fun_GetCalcMaterialsKs.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Sheets-per-stock estimator (`Ks` = 开数, the printing trade's "ups count"): given a parent sheet `dMatLength × dMatWidth` and a finished piece `dLength × dWidth`, returns how many finished pieces can be cut from one parent sheet. Used by the quotation and work-order calculation procs to derive material consumption. + +**What it does:** simple axis-aligned packing — returns `(dMatLength div dLength) * (dMatWidth div dWidth)`. The full mixed-orientation packing logic (vertical + horizontal arrangements) is commented out in the body, leaving only the straight tile. `Fun_GetCalcMaterialsKs1` is the kept-alive richer variant that the commented branches would have called. + +**Invocation:** invoked by the quotation calc family (`Sp_Quotation_CalcDataBookStd`, `_CalcDataFlex`, `_CalcDataPackStd`, `_CalcDataSetStd`, `_CalcDataStd`, `_CalcDataPackLastStd`, `_CalcDataPackLastStd_zr`, `_CalcDataPackPartsStd`) and the work-order calc family (`Sp_WorkOrder_CalcDataBookStd`, `_CalcDataFlex`, `_CalcDataPackLastStd`, `_CalcDataPackPartsStd_child`, `_CalcDataPackStd`, `_CalcDataSetStd`, `_CalcDataStd`, `_CalcDataStdBeforeAfter`, `_CalcDataStdCenterProcess`, `_CalcDataStdCenterPrsAfter`) — all of which sit on the `报价&估计管理` quotation modules and the `轮转工单`/`合版工单` work-order modules. diff --git a/en/docs/auto-catalog/functions/Fun_GetCalcMaterialsKs1.md b/en/docs/auto-catalog/functions/Fun_GetCalcMaterialsKs1.md index 092a547..7135555 100644 --- a/en/docs/auto-catalog/functions/Fun_GetCalcMaterialsKs1.md +++ b/en/docs/auto-catalog/functions/Fun_GetCalcMaterialsKs1.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Mixed-orientation `Ks` (开数, ups count) variant of `Fun_GetCalcMaterialsKs`. Computes how many finished pieces can be cut from a parent sheet using a vertical-then-horizontal hybrid layout, with optional row/column deductions (`iMinusL`, `iMinusW`) to reserve gripper/trim margins. + +**What it does:** normalizes long/short sides of both parent and piece. Computes two candidate tile counts: vertical-row (`(L div pL - iMinusL) * (W div pW)`) and horizontal-row (`(L div pW) * (W div pL - iMinusW)`), each augmented with a "leftover strip" rotated-piece bonus when the residual width fits. Returns the larger of the two, clamped at 0. + +**Invocation:** referenced by `Fun_GetCalcMaterialsKs` — but only inside commented-out lines (variant comparison was disabled). With those branches dormant, this function has no live caller in any channel — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/Fun_GetCh.md b/en/docs/auto-catalog/functions/Fun_GetCh.md index 5a97972..5d25c43 100644 --- a/en/docs/auto-catalog/functions/Fun_GetCh.md +++ b/en/docs/auto-catalog/functions/Fun_GetCh.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** String filter — header says `获取字符串中数字` ("extract digits from a string") but the body actually returns characters that do **not** match the regex `[u0391-uFFE5]` (the literal `u`-prefixed pattern is invalid; MySQL falls back to matching only the letter `u` and the ASCII range `0391`-`FFE5`, so the filter is effectively a no-op character whitelist). After stripping `-` and `+`, it accumulates the remaining characters. + +**What it does:** strips `-` and `+`, then walks the string one char at a time appending each character whose REGEXP test against `'[u0391-uFFE5]'` is not 1. Effective behavior: returns the input with `-`/`+` removed. Header comment is inconsistent with the body. + +**Invocation:** called from `Sp_Create_sControlFaceNameTable` and `Sp_Create_sControlFaceNameTableFive` (control/process-name table builders). With the regex broken, the filter step is a no-op — flag as bug suspect for maintainer audit. diff --git a/en/docs/auto-catalog/functions/Fun_GetFatherProductId.md b/en/docs/auto-catalog/functions/Fun_GetFatherProductId.md index 8108a92..e0c8a77 100644 --- a/en/docs/auto-catalog/functions/Fun_GetFatherProductId.md +++ b/en/docs/auto-catalog/functions/Fun_GetFatherProductId.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Walks up the multi-level production BOM tree for a manufactured product (parts → semi-finished → finished). Returns either the top-level product sId (`iFlag=0`) or the matching sales-order line sId for that top-level product (`iFlag=1`). Used by work-order calc to resolve "what finished good does this sub-part belong to". + +**What it does:** queries `viw_mftproduct` (BOM view) for the row matching `sProductId`, then climbs through `sFatherSlaveId → sSlaveId` ancestors in a WHILE loop until `sFatherSlaveId` is empty (i.e. reached the root). For `iFlag=0` returns the root `sProductId`. For `iFlag=1`, if `sSrcId` (sales-order master sId) is supplied, looks up the matching `salsalesorderslave` line by `sParentId+sProductId` and returns its sId; otherwise returns the root product sId. + +**Invocation:** Status: appears orphaned in the live DB — the only references in xly-src are install scripts (`script/标版/30100101/Sp_Calc_sWod.sql` and `script/标版/optimize/Sp_Calc_sWod.sql`). The shipped `Sp_Calc_sWod` body in the live database does **not** reference this function, suggesting the call was removed from the 生产工单/轮转工单/合版工单 `Sp_Calc_sWod` calc proc after the install scripts were authored. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/Fun_GetGb.md b/en/docs/auto-catalog/functions/Fun_GetGb.md index fc12e31..1b107af 100644 --- a/en/docs/auto-catalog/functions/Fun_GetGb.md +++ b/en/docs/auto-catalog/functions/Fun_GetGb.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Prefix extractor — pulls the non-digit prefix of a bill-number-style string (the "header"/`国标` letters before the running counter). Header comment `获取字符串中数字` is misleading; the body keeps **non-digit** characters, not digits. Paired with `Fun_GetNum` (digits-only) it lets routines split `SO-2024-0001` style codes into prefix `SO-` and number `20240001`. + +**What it does:** walks the input one character at a time. For each char, tests `REGEXP '[0-9]'`; if it does **not** match (i.e. non-digit), appends to the result. Returns the assembled non-digit prefix. + +**Invocation:** called from `Fun_GetAddBillNo` (bill-number incrementer) and from the auto-scheduling family `Sp_OneDatePlan_Machine` (single-day machine-plan generator on form `1921168137117916508762815480` 机台计划达成日报), and `Sp_productionPlan_BtnEventAutoOrder3/4/5/6` (production-plan auto-order button events). Also referenced by `Sp_Create_sControlFaceNameTable`, `_TableFive/Four/One/Three/Two` (process-name builders). diff --git a/en/docs/auto-catalog/functions/Fun_GetHumpDiff.md b/en/docs/auto-catalog/functions/Fun_GetHumpDiff.md index 09c0f3c..c407468 100644 --- a/en/docs/auto-catalog/functions/Fun_GetHumpDiff.md +++ b/en/docs/auto-catalog/functions/Fun_GetHumpDiff.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** "Hump" (峰) difference — `获取驼峰之间的差值`. Takes a comma-separated integer time-series and sums the rise heights of every monotonically increasing run (peak − trough), then totals them. Used by the production-dashboard reports to derive output-counter deltas from monotonically-resetting machine counters. + +**What it does:** two-pass. Pass 1 normalizes the series — for each comma-token, if the value drops vs. previous, inserts a `0` between them; this re-anchors each rising run to start from 0. Pass 2 walks the normalized series tracking current `p_min` and `p_max`; on each descent or at end-of-series, adds `max-min` to `p_diff`. Returns `p_diff`. + +**Invocation:** widely used by the production-board (`bd_` = 报表板/business dashboard) family — `Sp_Bd_bi16…bi24`, `Sp_Bd_cq_workshop_*` (车间 workshop boards: hh/mt/pj/pm/sy/ys), `Sp_Bd_hy_workshop_oy`, `Sp_bd_MachinePlanTemplate*` (机台计划 templates), `Sp_bd_McPlanConter`, `Sp_bd_McPlanRate`, `Sp_bd_TmComplianceRate*`, `Sp_bd_TmSpeed*`, `Sp_bd_TmYield*`. Customer override exists at `script/客户/.../Sp_Bd_Cqzy_Report*` (前一天/今天 白班/晚班). diff --git a/en/docs/auto-catalog/functions/Fun_GetJson_Length.md b/en/docs/auto-catalog/functions/Fun_GetJson_Length.md index c519213..ce486fc 100644 --- a/en/docs/auto-catalog/functions/Fun_GetJson_Length.md +++ b/en/docs/auto-catalog/functions/Fun_GetJson_Length.md @@ -18,4 +18,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** JSON-array length helper. Trivially thin wrapper for callers that want a `"未解析到Key"` sentinel instead of an error when the input is malformed. + +**What it does:** if `JSON_VALID(sJson) = 1`, returns `JSON_LENGTH(sJson)`. Otherwise returns the string `"未解析到Key"`. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/Fun_GetLimitDate.md b/en/docs/auto-catalog/functions/Fun_GetLimitDate.md index 072e98b..4339295 100644 --- a/en/docs/auto-catalog/functions/Fun_GetLimitDate.md +++ b/en/docs/auto-catalog/functions/Fun_GetLimitDate.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** KPI/SLA deadline calculator (`获取任务截至时间`). Given a form id and a starting timestamp, projects a "must-finish-by" datetime using the per-form working-hour configuration stored in `kpimodule` — used pervasively by the overdue/未付/未收 warning reports (采购预警, 应付/应收, 销售未发货, etc.). + +**What it does:** reads `kpimodule.dLimitation`/`sLimitTime`/`sWorkDate` for the form (matched on `sBrandsId`, `sSubsidiaryId`, `sModelId = sFormId`). Snaps the start time inside the configured working window, then converts the limitation hours into working-minutes and walks forward whole work-days plus a partial day, returning the projected deadline. + +**Invocation:** called from `Sp_Cashier_OrderMoneyWarning`, `Sp_Manufacture_PurPurchaseChecking`, `Sp_Manufacture_SalSalesChecking`, `Sp_Manufacture_sSodPurchareMaterials`, `Sp_NotPayAbles*` family, `Sp_NotReceivables*` family, `Sp_OEE_PlanByProcess`, `Sp_OverdueNoCheck`, `Sp_OverdueNotReceivables`, `Sp_Sales_NotDeliverGoodMaterials*`, `Sp_SalSalesCheck_YanBao` — every overdue/limit-aware report runs each row through this. Java references in `KpiServiceImpl` and `CommonFromSqlServiceImpl` are commented out; current invocation path is proc-only. diff --git a/en/docs/auto-catalog/functions/Fun_GetListByJson_ByKey.md b/en/docs/auto-catalog/functions/Fun_GetListByJson_ByKey.md index 8fcafb3..09f74e6 100644 --- a/en/docs/auto-catalog/functions/Fun_GetListByJson_ByKey.md +++ b/en/docs/auto-catalog/functions/Fun_GetListByJson_ByKey.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Pretty-printer for an entire JSON array of key/value objects — renders every row of an embedded JSON parameter list as `name:【value】` joined by `;` for display in a single report cell. Sibling of `Fun_GetListJson_ByKey` (which fetches one keyed value) and the `_split`/`_wrap` variants (which add line breaks every N items). + +**What it does:** iterates `sJson`. For each element extracts `$.sKey` (becomes the name) and `$.sGetKey` (becomes the value), strips JSON quotes, and appends `name:【value】` to the running string with `;` between rows. Returns empty string when `sJson` is not valid JSON. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/Fun_GetListByJson_ByKey_split.md b/en/docs/auto-catalog/functions/Fun_GetListByJson_ByKey_split.md index 1032943..197f966 100644 --- a/en/docs/auto-catalog/functions/Fun_GetListByJson_ByKey_split.md +++ b/en/docs/auto-catalog/functions/Fun_GetListByJson_ByKey_split.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Pretty-printer for a JSON array of key/value objects with periodic line-break wrapping — same family as `Fun_GetListByJson_ByKey`, but inserts a `\n` every `iNum` items so long parameter lists wrap cleanly in a fixed-width report cell. + +**What it does:** iterates `sJson`, extracts `$.sKey` and `$.sGetKey` from each element, strips quotes, and appends `name:【value】` joined by `;`. When the row index modulo `iNum` is zero (and not the first row), inserts `\n` before the next `;`. Returns empty string for invalid JSON. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/Fun_GetListByJson_ByKey_wrap.md b/en/docs/auto-catalog/functions/Fun_GetListByJson_ByKey_wrap.md index 6d5bf35..aaffdfe 100644 --- a/en/docs/auto-catalog/functions/Fun_GetListByJson_ByKey_wrap.md +++ b/en/docs/auto-catalog/functions/Fun_GetListByJson_ByKey_wrap.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Pretty-printer variant of `Fun_GetListByJson_ByKey_split` with a slightly different wrap rule. The `\n` is placed after the `;` separator and the wrap-condition uses `p_i <> 1` instead of `<> 0`, which produces a different first-row behaviour. + +**What it does:** iterates `sJson`, extracts `$.sKey` and `$.sGetKey` per element, strips quotes, joins with `;`. Inserts `\n` between the separator and the next item once per `iNum` rows. Returns empty string for invalid JSON. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. Almost certainly a tweak experiment alongside `_split`. diff --git a/en/docs/auto-catalog/functions/Fun_GetListBy_BysCombineChild.md b/en/docs/auto-catalog/functions/Fun_GetListBy_BysCombineChild.md index cfa1863..8185285 100644 --- a/en/docs/auto-catalog/functions/Fun_GetListBy_BysCombineChild.md +++ b/en/docs/auto-catalog/functions/Fun_GetListBy_BysCombineChild.md @@ -18,4 +18,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Combined-parts label builder used by the work-order data-pack reports. When a work-order has a 拼版 / combine layout that ganged-up several child parts, this function renders the part-name list (joined by `+`) for the work-order report row. + +**What it does:** splits the comma-separated `sCombineChildControlId` via `Fn_split_string`, looks up `sPartsName` from `mftworkordercontrol` for each id, and concatenates with `+` separators. Returns empty string if no ids. + +**Invocation:** called by `Sp_reportdata_WorkOrder`, `Sp_reportdata_WorkOrder1`, `Sp_reportdata_WorkOrder3` against `A.sCombineChildControlId` and `B.sCombineChildControlId` when rendering work-order print-data packs. diff --git a/en/docs/auto-catalog/functions/Fun_GetListJson_ByKey.md b/en/docs/auto-catalog/functions/Fun_GetListJson_ByKey.md index 9e4ee5b..302bb71 100644 --- a/en/docs/auto-catalog/functions/Fun_GetListJson_ByKey.md +++ b/en/docs/auto-catalog/functions/Fun_GetListJson_ByKey.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Generic key-indexed lookup against a JSON array. Given an array `sJson` and a `(sKey, sKeyValue)` pair, finds the first element where `$.sKey = sKeyValue` and returns the value at `$.sGetKey`. Used by production-report check and OEE/work-order data-pack procs to pull a named field out of a JSON parameter list. + +**What it does:** iterates the array; for each element extracts `$.sKey`, compares against `sKeyValue`; on match returns `REPLACE(JSON_EXTRACT($.sGetKey), '"', '')`. Returns `"未解析到Key"` when no element matches or input is not valid JSON. + +**Invocation:** called from `Sp_Check_mftProductionReportValue`, `Sp_Check_mftProductionReportValueTest`, `Sp_OEE_ProductionReport`, `Sp_OEE_ProductionReportAll`, `Sp_WorkOrder_CalcDataPackProductStd`. diff --git a/en/docs/auto-catalog/functions/Fun_GetListJson_ByKey1.md b/en/docs/auto-catalog/functions/Fun_GetListJson_ByKey1.md index 8e1033b..50e0078 100644 --- a/en/docs/auto-catalog/functions/Fun_GetListJson_ByKey1.md +++ b/en/docs/auto-catalog/functions/Fun_GetListJson_ByKey1.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Variant of `Fun_GetListJson_ByKey` where the lookup key is hard-coded to `$.sParamKey`. Given an array of `{sParamKey: X, …}` objects, finds the element with `sParamKey = sKeyValue` and returns the value at `$.sKey`. Tailored to the JSON-encoded parameter pairs used in the MFT/work-order schema. + +**What it does:** iterates `sJson`, reads `$.sParamKey` per element, compares to `sKeyValue`; on match returns the stripped `$.sKey`. Returns `"未解析到Key"` on no match or invalid JSON. (The `Else RETURN p_sKeyValue` branch is commented out.) + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. The script file `Fun_GetListJson_ByKey1.sql` is the function definition itself, not a caller. diff --git a/en/docs/auto-catalog/functions/Fun_GetListJson_ByKey2.md b/en/docs/auto-catalog/functions/Fun_GetListJson_ByKey2.md index 2400143..c69326c 100644 --- a/en/docs/auto-catalog/functions/Fun_GetListJson_ByKey2.md +++ b/en/docs/auto-catalog/functions/Fun_GetListJson_ByKey2.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Near-duplicate of `Fun_GetListJson_ByKey1` — same hard-coded `$.sParamKey` lookup, same return-on-match logic. The only difference is the commented-out `Else` branch is removed in this version. Used in the same production-report and work-order data-pack procs that consume JSON parameter lists. + +**What it does:** iterates `sJson`, reads `$.sParamKey` per element, compares to `sKeyValue`; on match returns the stripped `$.sKey`. Returns `"未解析到Key"` on no match or invalid JSON. + +**Invocation:** called from `Sp_Check_mftProductionReportValue`, `Sp_Check_mftProductionReportValueTest`, `Sp_OEE_ProductionReportAll`, `Sp_WorkOrder_CalcDataPackProductStd`. diff --git a/en/docs/auto-catalog/functions/Fun_GetListJson_ByKey5.md b/en/docs/auto-catalog/functions/Fun_GetListJson_ByKey5.md index a1842ca..2bedab7 100644 --- a/en/docs/auto-catalog/functions/Fun_GetListJson_ByKey5.md +++ b/en/docs/auto-catalog/functions/Fun_GetListJson_ByKey5.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Identical-shape variant of `Fun_GetListJson_ByKey2` — same hard-coded `$.sParamKey` lookup over a JSON array — but returns the empty string `""` instead of `"未解析到Key"` when no element matches. Useful when the caller wants to fold the result into a `CONCAT` without sentinel pollution. + +**What it does:** iterates `sJson`, reads `$.sParamKey` per element, compares to `sKeyValue`; on match returns the stripped `$.sKey`. Returns `""` on no match or invalid JSON. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/Fun_GetListJson_ByKey6.md b/en/docs/auto-catalog/functions/Fun_GetListJson_ByKey6.md index f438884..54e61c1 100644 --- a/en/docs/auto-catalog/functions/Fun_GetListJson_ByKey6.md +++ b/en/docs/auto-catalog/functions/Fun_GetListJson_ByKey6.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Byte-for-byte the same shape as `Fun_GetListJson_ByKey5` — hard-coded `$.sParamKey` lookup returning `""` on miss. Differs only in name; presumably a copy made for a specific caller. + +**What it does:** iterates `sJson`, reads `$.sParamKey` per element, compares to `sKeyValue`; on match returns the stripped `$.sKey`. Returns `""` on no match or invalid JSON. + +**Invocation:** called from `Sp_OEE_ProductionReport`. diff --git a/en/docs/auto-catalog/functions/Fun_GetListJson_ByKeyNew.md b/en/docs/auto-catalog/functions/Fun_GetListJson_ByKeyNew.md index 0b605da..8feb1ed 100644 --- a/en/docs/auto-catalog/functions/Fun_GetListJson_ByKeyNew.md +++ b/en/docs/auto-catalog/functions/Fun_GetListJson_ByKeyNew.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** "New" variant of `Fun_GetListJson_ByKey` — accepts the lookup column as a parameter `sKey` (rather than hard-coding `$.sParamKey`) and on match returns the value at `$.sGetKey`. Effectively a duplicate of `Fun_GetListJson_ByKey`; likely created during a refactor and never adopted by callers. + +**What it does:** iterates `sJson`, extracts `$.sKey` per element, compares to `sKeyValue`; on match returns the stripped `$.sGetKey`. Returns `"未解析到Key"` on no match or invalid JSON. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/Fun_GetListJson_ByKey_copy1.md b/en/docs/auto-catalog/functions/Fun_GetListJson_ByKey_copy1.md index cd406a8..bfafbdf 100644 --- a/en/docs/auto-catalog/functions/Fun_GetListJson_ByKey_copy1.md +++ b/en/docs/auto-catalog/functions/Fun_GetListJson_ByKey_copy1.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Fun_GetListJson_ByKey` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Fun_GetListJson_ByKey` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/functions/Fun_GetListJson_ByName.md b/en/docs/auto-catalog/functions/Fun_GetListJson_ByName.md index 77bedd6..c85b4b6 100644 --- a/en/docs/auto-catalog/functions/Fun_GetListJson_ByName.md +++ b/en/docs/auto-catalog/functions/Fun_GetListJson_ByName.md @@ -19,4 +19,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Named-parameter extractor for the standard `{sParamName, sParamValue}` JSON shape used to pickle MFT/scheduling/report run-time settings (`喷头个数`, `码样`, `喷码类型`, `走纸方向`, `印刷类型正面`, …). Given a JSON array and a name, returns the matching value. + +**What it does:** iterates `sJson`, reads `$.sParamName` per element, compares to `sGetKey`; on match returns the stripped `$.sParamValue`. Returns `"未解析到Key"` on no match or invalid JSON. + +**Invocation:** called from `Sp_GetMachineByApsRule` (APS machine-selection rule engine) and `Sp_Manufacture_ProductionPlanInfoTree_Base_TC` (production-plan info-tree builder, where it decodes the per-row `sReportParams` to populate `sReportParams1..N` display columns). diff --git a/en/docs/auto-catalog/functions/Fun_GetListJson_ByNameAPS.md b/en/docs/auto-catalog/functions/Fun_GetListJson_ByNameAPS.md index 207cf93..f21b108 100644 --- a/en/docs/auto-catalog/functions/Fun_GetListJson_ByNameAPS.md +++ b/en/docs/auto-catalog/functions/Fun_GetListJson_ByNameAPS.md @@ -19,4 +19,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** APS-flavoured variant of `Fun_GetListJson_ByName` — same `{sParamName, sParamValue}` lookup, but returns the empty string on miss instead of `"未解析到Key"`. Used by the APS machine-selection rule engine to decode equipment-attribute parameters without polluting downstream `CONCAT`s. + +**What it does:** iterates `sJson`, reads `$.sParamName` per element, compares to `sGetKey`; on match returns the stripped `$.sParamValue`. Returns `""` on no match or invalid JSON. + +**Invocation:** called from `Sp_GetMachineByApsRule`. diff --git a/en/docs/auto-catalog/functions/Fun_GetLoginUser.md b/en/docs/auto-catalog/functions/Fun_GetLoginUser.md index cb45cf1..5a9f891 100644 --- a/en/docs/auto-catalog/functions/Fun_GetLoginUser.md +++ b/en/docs/auto-catalog/functions/Fun_GetLoginUser.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Login-id resolver. Looks up a user in `sftlogininfo` by either username or sId (`sUserName = sLogin_id OR sId = sLogin_id`) scoped to `(sBrandsId, sSubsidiaryId)`, and returns the canonical `sId`. Used both by the workflow/messaging Java layer to normalize todo-list user ids and by the embedded SQL of the 采购管理 / 生产管理 detail forms. + +**What it does:** `SELECT sId INTO p_sReturn FROM sftlogininfo WHERE sBrandsId = … AND sSubsidiaryId = … AND (sUserName = sLogin_id OR sId = sLogin_id) LIMIT 1`. Returns the value (or `NULL`). + +**Invocation:** invoked from `SysWebSocketOffLineMsgServiceImpl` (resolves `todo_user_id` and `copyto_user_id` to user sIds when assembling offline workflow messages); embedded in form-master sSqlStr for 采购申请明细, 采购订单明细, 生产补料明细, 生产领料明细, 生产退料明细 under 采购管理 / 生产管理. Also reused by the workflow `Sp_Apply_Flow_*` and `Sp_Add_Flow` family. diff --git a/en/docs/auto-catalog/functions/Fun_GetLoginUserLanguage.md b/en/docs/auto-catalog/functions/Fun_GetLoginUserLanguage.md index 1a902f4..cfcb7b0 100644 --- a/en/docs/auto-catalog/functions/Fun_GetLoginUserLanguage.md +++ b/en/docs/auto-catalog/functions/Fun_GetLoginUserLanguage.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Login-language resolver. Returns the per-user UI language code (`sLanguage`) for a username-or-id within a `(sBrandsId, sSubsidiaryId)` tenant. Used to localize numeric formatting and field labels in the 采购/生产明细 reports and in receivable/payable summary procs. + +**What it does:** `SELECT sLanguage INTO p_sReturn FROM sftlogininfo WHERE sBrandsId = … AND sSubsidiaryId = … AND (sUserName = sLogin_id OR sId = sLogin_id) LIMIT 1`. + +**Invocation:** embedded in form-master sSqlStr for the same five detail forms as `Fun_GetLoginUser` (采购申请明细, 采购订单明细, 生产补料明细, 生产领料明细, 生产退料明细). Also called from `Sp_Calc_sPmt`, `Sp_Calc_sRct`, `Sp_Manufacture_ProductionArrange2`, `Sp_NotReceivables_hz`. diff --git a/en/docs/auto-catalog/functions/Fun_GetLoginUserLanguage_copy1.md b/en/docs/auto-catalog/functions/Fun_GetLoginUserLanguage_copy1.md index e3ad0d4..4076c89 100644 --- a/en/docs/auto-catalog/functions/Fun_GetLoginUserLanguage_copy1.md +++ b/en/docs/auto-catalog/functions/Fun_GetLoginUserLanguage_copy1.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Fun_GetLoginUserLanguage` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Fun_GetLoginUserLanguage` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/functions/Fun_GetLoginUserName.md b/en/docs/auto-catalog/functions/Fun_GetLoginUserName.md index fd5e459..842fe7b 100644 --- a/en/docs/auto-catalog/functions/Fun_GetLoginUserName.md +++ b/en/docs/auto-catalog/functions/Fun_GetLoginUserName.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Login-display-name resolver — the inverse of `Fun_GetLoginUser`. Given a username or user sId, returns the human-readable `sUserName` from `sftlogininfo`, scoped to a `(sBrandsId, sSubsidiaryId)` tenant. Used by the workflow/check-flow procs to render reviewer names in approval-history strings and notification messages. + +**What it does:** `SELECT sUserName INTO p_sReturn FROM sftlogininfo WHERE sBrandsId = … AND sSubsidiaryId = … AND (sUserName = sLogin_id OR sId = sLogin_id) LIMIT 1`. + +**Invocation:** called from `Sp_Bill_Used`, `sp_get_unTodo`, `sp_get_unTodo_Apply`, `Sp_Quotion_CheckFlow_BH1`, `SP_Return_Flow`, `Sp_System_CheckFlow` — every place where an approver/reviewer id needs to be expanded to a display name for notification or audit text (e.g., `GROUP_CONCAT(Fun_GetLoginUserName(U.sUserId, …))`). diff --git a/en/docs/auto-catalog/functions/Fun_GetLoginUserType.md b/en/docs/auto-catalog/functions/Fun_GetLoginUserType.md index 4880a7b..47dcfdf 100644 --- a/en/docs/auto-catalog/functions/Fun_GetLoginUserType.md +++ b/en/docs/auto-catalog/functions/Fun_GetLoginUserType.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Login-permission helper — intended to flag whether the supplied login is the `sysadmin` super-user (returns `'1'`) so callers can skip data-scope filters. + +**What it does:** Selects `sType` from `sftlogininfo` for the given (brand, subsidiary, login). Returns `'1'` if `sType = 'sysadmin'`, else `'0'`. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep) — candidate for maintainer audit. Note the page header `获取客户查看权限` matches the role of the sibling pair `Fun_GetLookCustomer`/`Fun_GetLookProcess`, which embed the sysadmin check inline instead of delegating here. diff --git a/en/docs/auto-catalog/functions/Fun_GetLookCustomer.md b/en/docs/auto-catalog/functions/Fun_GetLookCustomer.md index 65d2427..0ccb997 100644 --- a/en/docs/auto-catalog/functions/Fun_GetLookCustomer.md +++ b/en/docs/auto-catalog/functions/Fun_GetLookCustomer.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Customer data-scope filter — when system setting `CkxLookCustomer = 1` and the caller is not `sysadmin`, returns the comma-separated `EleCustomer.sId` list this login is allowed to see (joined through `sftlogininfocustomergroup.sSalesManId`); otherwise returns `''` meaning "no restriction". + +**What it does:** Reads `SysSystemSettings.CkxLookCustomer`, checks `SftLoginInfo.sType`, then `GROUP_CONCAT`s the customer IDs assigned to the login's permission group. + +**Invocation:** Embedded as an `IN (Fun_GetLookCustomer(...))` filter clause in sales / receivables / manufacturing reports — called by `Sp_financial_CustomerGrossProfit`, `Sp_financial_OrderGrossProfit*` (multiple variants), `Sp_financial_SaleManGrossProfit`, `Sp_financial_EasyCost`, `Sp_Manufacture_MftPlanPhase*`, `Sp_Manufacture_ProcessReport`, `Sp_Manufacture_ProductionArrange`, `Sp_Inventory_ProductInOutStore_new`, `Sp_GetOrder_Process`, etc. diff --git a/en/docs/auto-catalog/functions/Fun_GetLookProcess.md b/en/docs/auto-catalog/functions/Fun_GetLookProcess.md index fffd1e8..fd01054 100644 --- a/en/docs/auto-catalog/functions/Fun_GetLookProcess.md +++ b/en/docs/auto-catalog/functions/Fun_GetLookProcess.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Process (工序) data-scope filter — when system setting `CkxProcessFilter = 1` and the caller is not `sysadmin`, returns the comma-separated `sProcessClassifyId` list this login may see (joined through `sftlogininfoprocessgroup`); otherwise returns `''`. + +**What it does:** Reads `SysSystemSettings.CkxProcessFilter`, looks up `SftLoginInfo.sType`, then `GROUP_CONCAT`s the process-classification IDs bound to the login's permission group. + +**Invocation:** Embedded in manufacturing / quality-inspection report SQL — called by `Sp_Manufacture_PlanReport`, `Sp_Manufacture_ProcessReport`, `Sp_Manufacture_ProductionPlanInfo_WorkCenter`, `Sp_Manufacture_ProductionReport`, `Sp_Manufacture_Report`, `Sp_OEE_PlanByProcess`, `Sp_OEE_ProductionReport`, `Sp_Mobile_PatrolInspection`, `Sp_PC_FirstInspection`, `Sp_PC_PatrolInspection`, `Sp_Productionplan_Pie_Char*`. Sibling of `Fun_GetLookCustomer`. diff --git a/en/docs/auto-catalog/functions/Fun_GetMachineLenWidth.md b/en/docs/auto-catalog/functions/Fun_GetMachineLenWidth.md index 8396e21..301d18a 100644 --- a/en/docs/auto-catalog/functions/Fun_GetMachineLenWidth.md +++ b/en/docs/auto-catalog/functions/Fun_GetMachineLenWidth.md @@ -19,4 +19,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Hard-coded machine-size matching helper — returns `1` if the long side exceeds 1020 or the short side exceeds 720 (probably the limits of a specific press size class), else `0`. The thresholds are literal magic numbers in the body. + +**What it does:** Sorts the two dimensions so length ≥ width, then flags when the sheet exceeds 1020×720. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep) — earlier substring matches against `Sp_GetMachineByApsRule` resolve to the sibling `Fun_GetMachineLenWidthAPS`, not this one. Candidate for maintainer audit; the parameterised APS variant has superseded it. diff --git a/en/docs/auto-catalog/functions/Fun_GetMachineLenWidthAPS.md b/en/docs/auto-catalog/functions/Fun_GetMachineLenWidthAPS.md index 782404b..7665b32 100644 --- a/en/docs/auto-catalog/functions/Fun_GetMachineLenWidthAPS.md +++ b/en/docs/auto-catalog/functions/Fun_GetMachineLenWidthAPS.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** APS (advanced planning) machine-eligibility check — given a sheet's `sMachineLength`/`sMachineWidth` and a candidate machine's `(dMin..dMax) × (dMin..dMax)` window, returns `1` when the sheet falls outside the window (i.e. the machine is unsuitable), else `0`. + +**What it does:** Sorts length ≥ width, then flags out-of-range against the four limits in either orientation. + +**Invocation:** Called by `Sp_GetMachineByApsRule` — the procedure that ranks/filters machines when auto-assigning a work order to a press, comparing the order's sheet size against each machine's configured min/max. Parameterised replacement for the now-orphan `Fun_GetMachineLenWidth`. diff --git a/en/docs/auto-catalog/functions/Fun_GetMachineWorkEndDate.md b/en/docs/auto-catalog/functions/Fun_GetMachineWorkEndDate.md index de6023a..efacc00 100644 --- a/en/docs/auto-catalog/functions/Fun_GetMachineWorkEndDate.md +++ b/en/docs/auto-catalog/functions/Fun_GetMachineWorkEndDate.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Machine shift-window helper — given a press (`iPlcNo`), returns the **end** of the current shift based on the machine's `elemachine.sOffWork` / `sShiftsWork` clock settings (default `8:00` / `17:30`). Counterpart to `Fun_GetMachineWorkStartDate` and `Fun_GetMachineWorkWorkType`. + +**What it does:** Reads the machine's day-shift boundaries from `elemachine`, classifies `NOW()` as day or night side, then returns the corresponding `'sOffWork'`/`'sShiftsWork'` datetime on today's date. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep beyond the routine's own deployment SQL) — candidate for maintainer audit. The sibling `Fun_GetMachineWorkStartDate` and `Fun_GetMachineWorkWorkType` are reachable via `Sp_bd_MachinePlanStatus`/`Sp_bd_McPlanConter`/`Sp_bd_McPlanRate`; the End variant has no current consumer. diff --git a/en/docs/auto-catalog/functions/Fun_GetMachineWorkStartDate.md b/en/docs/auto-catalog/functions/Fun_GetMachineWorkStartDate.md index 705d516..b8df3ff 100644 --- a/en/docs/auto-catalog/functions/Fun_GetMachineWorkStartDate.md +++ b/en/docs/auto-catalog/functions/Fun_GetMachineWorkStartDate.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Machine shift-window helper — given a press (`iPlcNo`), returns the **start** of the current shift, including the previous shift when `NOW()` falls in the night window (i.e. before `sOffWork`). Used to define "current shift" for machine OEE / 排产 dashboards. + +**What it does:** Reads `elemachine.sOffWork` / `sShiftsWork` (default `8:00` / `17:30`), classifies `NOW()` as day-side or night-side, then returns either today's `sOffWork` or yesterday's `sShiftsWork`/`sOffWork` accordingly. + +**Invocation:** Called by `Sp_bd_MachinePlanStatus`, `Sp_bd_McPlanConter`, `Sp_bd_McPlanRate` — the machine-board (机台看板) status / completion / rate procedures that surface real-time shift progress on the production-floor displays. diff --git a/en/docs/auto-catalog/functions/Fun_GetMachineWorkWorkType.md b/en/docs/auto-catalog/functions/Fun_GetMachineWorkWorkType.md index 24ea72b..bbe308e 100644 --- a/en/docs/auto-catalog/functions/Fun_GetMachineWorkWorkType.md +++ b/en/docs/auto-catalog/functions/Fun_GetMachineWorkWorkType.md @@ -22,4 +22,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Machine shift-window classifier — given a press (`iPlcNo`), returns the literal string `'sOffWork'` when `NOW()` is in the day-shift window or `'sShiftsWork'` when in the night/off-hours window. The catalog header `获取当前机台属于什么班` summarises the intent. + +**What it does:** Reads `elemachine.sOffWork` / `sShiftsWork` (default `8:00` / `17:30`); compares `NOW()` against today's `[sOffWork, sShiftsWork)` interval. + +**Invocation:** Called by `Sp_bd_McPlanConter` — the machine-board shift-completion counter that needs to know which shift to attribute current output to. Sibling of `Fun_GetMachineWorkStartDate` (full window) and the orphan `Fun_GetMachineWorkEndDate`. + +Note: declared return type is `datetime` but body returns a `varchar` literal — type mismatch is harmless but worth flagging. diff --git a/en/docs/auto-catalog/functions/Fun_GetMaterialsQtyUnit.md b/en/docs/auto-catalog/functions/Fun_GetMaterialsQtyUnit.md index a0b53c1..4db61ab 100644 --- a/en/docs/auto-catalog/functions/Fun_GetMaterialsQtyUnit.md +++ b/en/docs/auto-catalog/functions/Fun_GetMaterialsQtyUnit.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Material-quantity / unit conversion core — given an auxiliary qty in sheets (张/PCS), the material spec (size `WxH` or `WxHxThickness` and `EleMaterials` row), returns either the **converted material qty** in the storage unit (`iType=0`) or the **resolved auxiliary unit name** (`iType=1`). Drives every quotation, work-order, inventory, and check procedure that needs to translate between purchase units (吨/Ton/KG/M2/M3/M) and counting units (张/PCS). + +**What it does:** Reads `EleMaterials.dGramWeight`, `sMaterialsUnit`, `sAuxiliaryUnit`, `bReel`, `dCoefficient`, `bInverse`; parses the `*`-delimited style; branches on (dimension count, reel flag, material unit) and applies the appropriate area×gram-weight formula scaled by the global `CbxMaterialsUnit` system setting (`MM`/`CM`/`INCH`) — `INCH` uses `NetConversionRate` to convert to metric. + +**Invocation:** Called dynamically by Java service code — `CalculationStdServiceImpl` builds `Select Fun_GetMaterialsQtyUnit(...)` SQL during quotation/work-order standard-cost calculation, and `ReplaceFieldServiceImpl` substitutes the function name as `sFunName` when resolving derived columns. Also called from many `Sp_Calc_s*` / `Sp_Check_s*` / `Sp_Quotation_Calc*` / `Sp_WorkOrder_Calc*` / `SP_Inventory_InOutWarehouse*` procedures (52 stored-routine callers). Sibling: `Fun_GetMaterialsQtyUnitSupple` (board-with-thickness variant). diff --git a/en/docs/auto-catalog/functions/Fun_GetMaterialsQtyUnitSupple.md b/en/docs/auto-catalog/functions/Fun_GetMaterialsQtyUnitSupple.md index 362c1e0..1cf7773 100644 --- a/en/docs/auto-catalog/functions/Fun_GetMaterialsQtyUnitSupple.md +++ b/en/docs/auto-catalog/functions/Fun_GetMaterialsQtyUnitSupple.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Supplementary material-qty conversion — the board / 瓦楞 (corrugated) variant of `Fun_GetMaterialsQtyUnit`. Loads the same `EleMaterials` row but additionally pulls `dThickness`, then forces the carrier unit to `'M'` (length) and folds thickness into `dGramWeight`, so the same area×weight formulas yield linear-meter consumption for sheet/board stock. + +**What it does:** Same dispatch as `Fun_GetMaterialsQtyUnit` (parse style, branch on dimension count / unit / reel flag, apply `CbxMaterialsUnit`-scaled formula), but with `sMaterialsUnit ← sAuxiliaryUnit`, `sAuxiliaryUnit ← 'M'`, `dGramWeight *= IFNULL(NULLIF(dThickness,0),1)` applied up front. + +**Invocation:** Called by `Sp_Quotation_CalcDataFlex` and `Sp_WorkOrder_CalcDataFlex` — the soft-pack / 柔性 quotation and work-order cost-calculation procedures (the "Flex" branch in 报价 / 工单 standard-cost). Sibling of `Fun_GetMaterialsQtyUnit`. diff --git a/en/docs/auto-catalog/functions/Fun_GetNum.md b/en/docs/auto-catalog/functions/Fun_GetNum.md index d224178..2b1828d 100644 --- a/en/docs/auto-catalog/functions/Fun_GetNum.md +++ b/en/docs/auto-catalog/functions/Fun_GetNum.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Numeric-substring extractor — pulls the digits (and `.`) out of a free-form string while preserving the **first run** of contiguous digits/decimals, dropping leading zeros until a `1-9` appears. Used in 排产 / 控制面 编号 helpers where a bill number or table name embeds a number that needs to be peeled out. + +**What it does:** Walks `str` char by char; once a `1-9` is seen, appends subsequent digits and `.` to the output; non-numeric chars are skipped; returns the accumulated string. + +**Invocation:** Called by `Sp_Create_sControlFaceNameTable` / `*Two` / `*Three` / `*Four` (control-face table-name builders), `Sp_Manufacture_ProductionPlanInfo_detail` / `*Lock_detail`, `Sp_productionPlan_BtnEventAutoOrder3`–`9` (auto-排产 button handlers), and function `Fun_GetAddBillNo` (bill-number incrementor). diff --git a/en/docs/auto-catalog/functions/Fun_GetNumFirst.md b/en/docs/auto-catalog/functions/Fun_GetNumFirst.md index d5389be..fe6606c 100644 --- a/en/docs/auto-catalog/functions/Fun_GetNumFirst.md +++ b/en/docs/auto-catalog/functions/Fun_GetNumFirst.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** First-digit-position locator — returns the 1-indexed position of the first `0-9` in `str`, or `0` if none. Catalog header: `获取字符串中数字首次出现位置`. + +**What it does:** Walks `str` char by char, regex-tests `[0-9]`, returns the index on first hit. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep beyond the routine's own deployment SQL) — candidate for maintainer audit. Sibling `Fun_GetNum` is heavily used; this position-only variant has no current consumer. diff --git a/en/docs/auto-catalog/functions/Fun_GetPackQty.md b/en/docs/auto-catalog/functions/Fun_GetPackQty.md index 5071916..987762d 100644 --- a/en/docs/auto-catalog/functions/Fun_GetPackQty.md +++ b/en/docs/auto-catalog/functions/Fun_GetPackQty.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** OEE管理 → 打印成品标签(OEE) — when printing finished-product carton labels, decides how many pieces go into one pack based on the product's paper size (A5/A4/A3/A2/A1, 32开/16开/8开/4开/2开, or explicit `WxH` like `210*140`, `285*210`, `570*870`) so each carton stays under a per-size cap (5000, 2500, or 2000 pieces, scaled by `CEIL(qty/cap)`). + +**What it does:** A large `CASE` keyed on `LOCATE(, p_sProductStyle)`; for each size class, returns either the full qty when it fits in one carton, or `qty / CEIL(qty / cap)` (an even split into the minimum number of cartons). Unknown styles return `null`. + +**Invocation:** Embedded in form `gdsconfigformmaster.sId='16054917120005195223325896784000'` (parent module `打印成品标签(OEE)` → `OEE管理`), alongside the sibling `Fun_GetTrunkQty`, against `mftworkorderslave` + `eleproduct`. diff --git a/en/docs/auto-catalog/functions/Fun_GetProcessAuxiliaryQty.md b/en/docs/auto-catalog/functions/Fun_GetProcessAuxiliaryQty.md index 0849be8..cc97904 100644 --- a/en/docs/auto-catalog/functions/Fun_GetProcessAuxiliaryQty.md +++ b/en/docs/auto-catalog/functions/Fun_GetProcessAuxiliaryQty.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Process-step area conversion — when a process records its qty in 张 (sheets) but the material is stocked in `M2`, converts sheet-count to square-metres using the sheet size (`WxH` parsed from `sMaterialsStyle`) and the global `CbxMaterialsUnit` system setting (`MM`/`CM`/`INCH`, with `NetConversionRate` for inch→m). When the auxiliary unit already matches the material unit or the material unit isn't `M2`, returns `dAuxiliaryQty` unchanged. + +**What it does:** Loads `CbxMaterialsUnit` (and `NetConversionRate` for INCH) via `Fun_GetSystemSetting`; counts `*` in style; if exactly one `*` and the units differ and material is `M2`, splits dimensions, computes `qty * left * right` with the scale factor for `MM`/`CM`/`INCH`; else passes qty through. + +**Invocation:** Called by `Sp_Check_sOis`, `Sp_Check_sOpc`, `Sp_Check_sOpkg`, `Sp_Check_sOpn`, `Sp_Check_sOpn1` — the `Sp_Check_*` audit procedures that verify per-process auxiliary quantities against material-unit totals in inspection/check workflows. diff --git a/en/docs/auto-catalog/functions/Fun_GetReelAuxiliaryQtyUnit.md b/en/docs/auto-catalog/functions/Fun_GetReelAuxiliaryQtyUnit.md index c98dee8..76e8e73 100644 --- a/en/docs/auto-catalog/functions/Fun_GetReelAuxiliaryQtyUnit.md +++ b/en/docs/auto-catalog/functions/Fun_GetReelAuxiliaryQtyUnit.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Reel (卷筒) variant of [`Fun_GetAuxiliaryQtyUnit`](Fun_GetAuxiliaryQtyUnit.md) — performs the same auxiliary-unit ↔ purchase-unit conversion for materials but is keyed off `MftWorkOrderMaterials` instead of `MftPurchaseDetailMaterials`. The work-order context lets it consult both the materials master (`EleMaterials.dGramWeight`, `bReel`, `bInverse`, `dCoefficient`) and the per-line auxiliary unit (`MftWorkOrderMaterials.sAuxiliaryUnit`). + +**What it does:** reads `NetSquareM`, `CbxMaterialsUnit` and `NetConversionRate` from `SysSystemSettings` (via `Fun_GetSystemSetting`); reads gram-weight/reel-flag/coefficient/inverse-flag from `EleMaterials` and the auxiliary/main unit from `MftWorkOrderMaterials`. Branches on `sMaterialsStyle` (e.g. `787*1092`), the material's main unit (`吨/噸/Ton/KG/克/M/M2`), and `iReel`, returning the converted quantity in the requested target unit. `iType=0` returns the converted quantity, `iType=1` returns the unit string. + +**Invocation:** referenced only by `Sp_saveReturn_sPmd` (which itself has no discoverable caller). No form-master sSqlStr, gdsmodule hook, in-scope routine caller, or xly-src reference uses this function directly. Status: appears orphaned via dead-caller chain — candidate for maintainer audit. Compare with the production-active siblings `Fun_GetAuxiliaryQtyUnit` and `Fun_GetMaterialsQtyUnit`. diff --git a/en/docs/auto-catalog/functions/Fun_GetReportId_byLogType.md b/en/docs/auto-catalog/functions/Fun_GetReportId_byLogType.md index 845d414..e3f58b0 100644 --- a/en/docs/auto-catalog/functions/Fun_GetReportId_byLogType.md +++ b/en/docs/auto-catalog/functions/Fun_GetReportId_byLogType.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Logistics-type report-id dispatch — maps a logistics document type flag (`1` = 送货单 / delivery note, anything else = 其它单 / generic logistics doc) onto one of two hard-coded `report.sId` GUIDs so the print step can pick the right template. + +**What it does:** `IF p_iLogType='1' RETURN '17090989...'` (送货单 report) else `RETURN '17091030...'` (其它单 report). + +**Invocation:** no form-master sSqlStr, gdsmodule hook, other routine, or xly-src reference uses this function. Status: appears orphaned. No caller found in any channel — candidate for maintainer audit. Tenant-specific report `sId`s. diff --git a/en/docs/auto-catalog/functions/Fun_GetSystemSetting.md b/en/docs/auto-catalog/functions/Fun_GetSystemSetting.md index 3334901..1f6f5fa 100644 --- a/en/docs/auto-catalog/functions/Fun_GetSystemSetting.md +++ b/en/docs/auto-catalog/functions/Fun_GetSystemSetting.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Core key-value reader for `SysSystemSettings` — the per-tenant system-config table that holds switches and numeric coefficients used throughout 生产 / 库存 / 销售 calculations (e.g. `CbxMaterialsUnit` = MM/CM/INCH unit choice, `NetSquareM` square-meter rounding flag, `NetConversionRate` for INCH→metric, plus hundreds of other named scalars). Every "should this branch behave one way or another?" question routes through this function. + +**What it does:** `SELECT sValue FROM SysSystemSettings WHERE sName=str AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`, defaults to `'0'` when missing. Returns a `varchar(100)` — callers cast to numeric where they need to. + +**Invocation:** referenced by 37 stored routines and many xly-src `Sp_Calc_s*` / `Sp_Manufacture_*` SQL scripts. Heavy hitters include `Fun_GetAuxiliaryQtyUnit`, `Fun_GetMaterialsQtyUnit`, `Fun_GetMaterialsQtyUnitSupple`, `Fun_GetReelAuxiliaryQtyUnit`, `Fun_GetProcessAuxiliaryQty` and the entire `Sp_Calc_s*` family (s`Mma`, `Mmm`, `Mpa`, `Opi1`, `Paj`, `Pmd`, `Psa`, `Cut`, `Dgd`, `DYDgd`...) and `Sp_BillOf*` (`Apply`, `ApplyLine`, `NoPicking`, etc.). It is the canonical xly-side feature-flag/coefficient lookup. diff --git a/en/docs/auto-catalog/functions/Fun_GetTestCount.md b/en/docs/auto-catalog/functions/Fun_GetTestCount.md index 191cda7..9e311bd 100644 --- a/en/docs/auto-catalog/functions/Fun_GetTestCount.md +++ b/en/docs/auto-catalog/functions/Fun_GetTestCount.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Sample/打样 sales-order monthly counter — counts how many `salsalesorderslave` rows belong to orders of type `5` (打样 / sample order) created in the same calendar month as `tCreateDate`. `iType=1` adds an `iSucceed=1` filter to count only successful samples. Used for sample-volume KPI/打样次数 calculations. The header comment `获取字符串中数字` is wrong/copy-pasted from `Fun_GetNum` — body has nothing to do with digit extraction. + +**What it does:** branches on `iType`. Joins `salsalesorderslave` to `salsalesordermaster`, filters `sOrderType=5` and the month-window `[YYYY-MM-01, next-month-01)`, counts `sId`. Returns the count. + +**Invocation:** no form-master sSqlStr, gdsmodule hook, other routine, or xly-src reference uses this function. Status: appears orphaned. No caller found in any channel — candidate for maintainer audit (likely a KPI helper that was wired into a deprecated sample-order analysis form). diff --git a/en/docs/auto-catalog/functions/Fun_GetTestMaterialsCount.md b/en/docs/auto-catalog/functions/Fun_GetTestMaterialsCount.md index 257c199..c93c01a 100644 --- a/en/docs/auto-catalog/functions/Fun_GetTestMaterialsCount.md +++ b/en/docs/auto-catalog/functions/Fun_GetTestMaterialsCount.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Per-material sample-order monthly counter — sibling of [`Fun_GetTestCount`](Fun_GetTestCount.md). Counts how many sample-order (`sOrderType=5`) line rows reference a given material `sId` within the calendar month of `tCreateDate`. Used to gauge per-material 打样 frequency. The header comment `获取字符串中数字` is wrong/copy-pasted from `Fun_GetNum`. + +**What it does:** joins `salsalesorderslave` to `salsalesordermaster`, filters `sOrderType=5`, `sMaterialsId=sMaterialsId`, and the same `[YYYY-MM-01, next-month-01)` month window. Counts `sId`. + +**Invocation:** no form-master sSqlStr, gdsmodule hook, other routine, or xly-src reference uses this function. Status: appears orphaned. No caller found in any channel — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/Fun_GetTrunkQty.md b/en/docs/auto-catalog/functions/Fun_GetTrunkQty.md index f929c39..74e4783 100644 --- a/en/docs/auto-catalog/functions/Fun_GetTrunkQty.md +++ b/en/docs/auto-catalog/functions/Fun_GetTrunkQty.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Trunk/箱 count estimator for OEE finished-goods labelling (生产管理 → OEE → 打印成品标签(OEE), form sId `16054917120005195223325896784000`). Given a product style code (paper-size names like `A4`, `A3`, `8开`, or millimetre styles like `210*285`) and a piece count, returns how many shipping trunks the run will fill. + +**What it does:** big `CASE` over `LOCATE(, p_sProductStyle) > 0`: A5/210*140/32开/A4/210*285/16开 → `CEIL(qty/5000)`; A3/285*420/8开/A2/420*570/4开/A1/570*870/2开 → `CEIL(qty/2500)`; otherwise `NULL`. Returns the integer trunk count. + +**Invocation:** referenced by the OEE label-print form-master sSqlStr at sId `16054917120005195223325896784000` (生产管理 → OEE → 打印成品标签(OEE)). The xly-src copy lives under `script/标版/30000101/Fun_GetTrunkQty.sql` and the form-master upgrade script under `script/标版/20210323/gdsconfigformmaster.sql`. The conversion ratios are hard-coded paper-product values; non-paper businesses will see `NULL`. diff --git a/en/docs/auto-catalog/functions/Fun_Get_BracketContent.md b/en/docs/auto-catalog/functions/Fun_Get_BracketContent.md index cbde62b..5e85ca5 100644 --- a/en/docs/auto-catalog/functions/Fun_Get_BracketContent.md +++ b/en/docs/auto-catalog/functions/Fun_Get_BracketContent.md @@ -18,4 +18,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Tiny string-utility — returns the contents of the first `[…]` bracket pair in the input. Building-block for the formula-resolution path that needs to extract one placeholder name at a time. + +**What it does:** one line: `substring_index(substring_index(userstr,']',1),'[',-1)`. Splits at the first `]`, takes the part before it, then splits that at `[` and returns everything after the last `[`. No table access. + +**Invocation:** called by [`Fun_Get_BracketContentAll_JSON`](Fun_Get_BracketContentAll_JSON.md), which loops to extract every `[…]` token in a string. No other caller in any channel. diff --git a/en/docs/auto-catalog/functions/Fun_Get_BracketContentAll_JSON.md b/en/docs/auto-catalog/functions/Fun_Get_BracketContentAll_JSON.md index 92c981d..d1bad1f 100644 --- a/en/docs/auto-catalog/functions/Fun_Get_BracketContentAll_JSON.md +++ b/en/docs/auto-catalog/functions/Fun_Get_BracketContentAll_JSON.md @@ -18,4 +18,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Extracts every `[…]` placeholder out of a formula / template string and returns the names as a comma-joined, quoted list ready to splice into an `IN (...)` clause. Companion to [`Fun_Get_BracketContent`](Fun_Get_BracketContent.md), one level up in the same formula-resolution chain. + +**What it does:** counts the `[` characters in `userstr`, then in a loop pulls the first bracket pair via `Fun_Get_BracketContent`, appends `'',` to the accumulator, and removes `[]` from the source. Leaves when no more `[` remain. Returns the accumulator with the trailing comma trimmed (or empty string if no bracket was found). + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/Fun_Getcolorcount.md b/en/docs/auto-catalog/functions/Fun_Getcolorcount.md index 2881cd3..c8cf04c 100644 --- a/en/docs/auto-catalog/functions/Fun_Getcolorcount.md +++ b/en/docs/auto-catalog/functions/Fun_Getcolorcount.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Plate color/ink counter — header `根据 + 分隔符,确定颜色数`. Operates on a JSON color-list string with optional face-doubling and process/spot color filter. Used by the work-order/quotation calc procs for paperboard/box products to estimate ink-station usage per face. + +**What it does:** upper-cases the input; counts how many `"SNAME":"C"`, `"M"`, `"Y"`, `"K"` substrings appear (CMYK process colors) and the total number of `}` (one per color entry). Then branches: `iFace=2` doubles the result (two-sided print); `iColorOrder=1` returns CMYK process count, `iColorOrder=2` returns the spot-color complement `(total - CMYK)`. Returns 0 for any other combination. + +**Invocation:** invoked by `Sp_Manufacture_InsertMftPlanSlave` (轮转/合版 manufacturing-plan slave), `Sp_Quotation_CalcDataPackProductStd` (paperboard quotation calc), and `Sp_WorkOrder_CalcDataBsProductStd` (paperboard work-order calc) — together with the customer-override copies in `script/客户/{千彩,快马,金宣发,上海亚峰}` indicating site-specific tweaks against this same routine. diff --git a/en/docs/auto-catalog/functions/Fun_GetcolorcountTest.md b/en/docs/auto-catalog/functions/Fun_GetcolorcountTest.md index 4b86fff..d65aff2 100644 --- a/en/docs/auto-catalog/functions/Fun_GetcolorcountTest.md +++ b/en/docs/auto-catalog/functions/Fun_GetcolorcountTest.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Body is byte-identical to `Fun_Getcolorcount`. `Test` suffix per wiki convention marks a staging copy retained for development comparison. + +**What it does:** same as `Fun_Getcolorcount` — counts CMYK process colors vs. spot colors in a JSON color list with face-doubling, branching on `iColorOrder` (1 = CMYK count, 2 = spot count) and `iFace` (2 = double for two-sided printing). + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. Test-only artifact; safe to drop after confirming with `Fun_Getcolorcount`. diff --git a/en/docs/auto-catalog/functions/Fun_Getcolorcount_CalcQty1.md b/en/docs/auto-catalog/functions/Fun_Getcolorcount_CalcQty1.md index 7655da3..fda2e08 100644 --- a/en/docs/auto-catalog/functions/Fun_Getcolorcount_CalcQty1.md +++ b/en/docs/auto-catalog/functions/Fun_Getcolorcount_CalcQty1.md @@ -18,4 +18,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** CMYK ink-count summer for the printing planner. Each plate-color JSON entry carries `sName` (C/M/Y/K or a spot-color name) and `dColor` (ink-station count). This variant counts only the CMYK process colors (`sName ∈ {C, M, Y, K, "C+M+Y+K"}`). + +**What it does:** walks the JSON array; per entry, if `sName` is one of the CMYK process names, accumulates `dColor`; non-process (spot) colors contribute 0. Returns the running sum. `Fun_Getcolorcount_CalcQty2` is the inverse — it sums spot colors only. + +**Invocation:** called from `Sp_Manufacture_InsertMftPlanSlave` (轮转工单 / 合版工单 manufacturing-plan slave inserter), where it splits the color/ink JSON into process-ink stations vs. spot-ink stations for the per-plate quantity bookkeeping. diff --git a/en/docs/auto-catalog/functions/Fun_Getcolorcount_CalcQty2.md b/en/docs/auto-catalog/functions/Fun_Getcolorcount_CalcQty2.md index 26bbff4..2b265f0 100644 --- a/en/docs/auto-catalog/functions/Fun_Getcolorcount_CalcQty2.md +++ b/en/docs/auto-catalog/functions/Fun_Getcolorcount_CalcQty2.md @@ -18,4 +18,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Spot-ink station counter for the printing planner — companion to `Fun_Getcolorcount_CalcQty1`. Counts non-CMYK (spot) plate colors in the color JSON, treating each spot entry as at least 1 station even if `dColor` is missing/zero. + +**What it does:** walks the JSON array; for each entry where `sName` is **not** in `{C, M, Y, K, "C+M+Y+K"}`, accumulates `IF(dColor > 0, dColor, 1)`. Returns the running sum. + +**Invocation:** called from `Sp_Manufacture_InsertMftPlanSlave` (轮转工单 / 合版工单 manufacturing-plan slave inserter) alongside `_CalcQty1` — together they split a plate's ink stations into process vs. spot for per-plate quantity bookkeeping. diff --git a/en/docs/auto-catalog/functions/Fun_Getcolorcount_new.md b/en/docs/auto-catalog/functions/Fun_Getcolorcount_new.md index 86129db..38f9690 100644 --- a/en/docs/auto-catalog/functions/Fun_Getcolorcount_new.md +++ b/en/docs/auto-catalog/functions/Fun_Getcolorcount_new.md @@ -18,4 +18,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Unified ink-station count over a plate-color JSON list. Unlike the `_CalcQty1` / `_CalcQty2` splits, this variant treats every color entry as at least 1 station regardless of process/spot kind — useful when the planner needs a total station count. + +**What it does:** walks the JSON array; for each entry, accumulates `IF(dColor > 0, dColor, 1)` from `dColor`. Returns the total. Reads `sName` but doesn't gate on it (presumably future use). + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. The `_new` suffix suggests it was staged to replace `Fun_Getcolorcount` but never wired up. diff --git a/en/docs/auto-catalog/functions/Fun_GetknifeProcessQty.md b/en/docs/auto-catalog/functions/Fun_GetknifeProcessQty.md index 66696ad..9733a68 100644 --- a/en/docs/auto-catalog/functions/Fun_GetknifeProcessQty.md +++ b/en/docs/auto-catalog/functions/Fun_GetknifeProcessQty.md @@ -18,4 +18,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Knife-mould (刀模 / cutting-die) cumulative-usage estimator. For a given knife-mould id it sums the planned machine quantity (`dSumMachineAllQty`) across every active work-order control row that uses the die, so dies near their service-life ceiling can be flagged for replacement. + +**What it does:** joins `mftworkorderprocess A → mftworkordercontrol B → mftworkordermaster C` on `A.sKnifeMouldId = sKnifeMouldGuid` filtering `C.bInvalid = 0` and `C.bCheck = 1`. Groups by `B.sId` then sums `B.dSumMachineAllQty`; returns `0` if no rows match. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. Likely once embedded in a knife-mould lifetime report that has since been retired. diff --git a/en/docs/auto-catalog/functions/Fun_GetknifeReportQty.md b/en/docs/auto-catalog/functions/Fun_GetknifeReportQty.md index 659d262..ce4a431 100644 --- a/en/docs/auto-catalog/functions/Fun_GetknifeReportQty.md +++ b/en/docs/auto-catalog/functions/Fun_GetknifeReportQty.md @@ -18,4 +18,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Knife-mould (刀模) actual-output companion to `Fun_GetknifeProcessQty`. Where the sibling sums planned quantity, this one sums actually-reported production (`dProductionReportQty`) for a given die across active work-orders — used to judge real wear versus planned wear. + +**What it does:** scans `mftworkorderprocess A INNER JOIN mftworkordermaster C ON A.sParentId = C.sId` where `A.sKnifeMouldId = sKnifeMouldGuid`, `C.bInvalid = 0`, `C.bCheck = 1`, and returns `SUM(IFNULL(A.dProductionReportQty,0))` (defaulting to `0`). + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/Fun_GetproductstockQty.md b/en/docs/auto-catalog/functions/Fun_GetproductstockQty.md index cb3fbb8..ea559df 100644 --- a/en/docs/auto-catalog/functions/Fun_GetproductstockQty.md +++ b/en/docs/auto-catalog/functions/Fun_GetproductstockQty.md @@ -18,4 +18,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Product-stock total — sums all `dProductQty` rows in `eleproductstock` for one product `sId`. Trivial helper that would back an inventory snapshot column or a remaining-stock probe in sales/production forms. + +**What it does:** `SELECT SUM(dProductQty) FROM eleproductstock WHERE sProductId = sProductGuid`, returns `0` when no rows match. + +**Invocation:** no form-master sSqlStr, gdsmodule hook, other routine, or xly-src reference uses this function. Status: appears orphaned. No caller found in any channel — candidate for maintainer audit. Note that nearly identical roll-ups against `eleproductstock` exist inline inside many production-management routines; this helper appears never to have been adopted. diff --git a/en/docs/auto-catalog/functions/Fun_HasJsonKey.md b/en/docs/auto-catalog/functions/Fun_HasJsonKey.md index 9051edd..18976cc 100644 --- a/en/docs/auto-catalog/functions/Fun_HasJsonKey.md +++ b/en/docs/auto-catalog/functions/Fun_HasJsonKey.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** JSON-array contains-key/value probe used by the 生产计划 (production-plan) info-tree builders. Asks: "Does the JSON array `sJson` contain an object whose property `skey` equals `sValue`?". Lets the plan-tree procs gate logic on whether a given `sId`/flag is already present in an in-memory list. + +**What it does:** validates `sJson`, iterates `JSON_LENGTH` slots, for each slot `JSON_EXTRACT`s `$.skey`, strips surrounding quotes, compares to `sValue`. Returns `1` on first match, `0` otherwise (or `0` on invalid JSON). + +**Invocation:** referenced by `sp_manufacture_productionplaninfotrace`, `sp_manufacture_productionplaninfotrace1`, `Sp_Manufacture_ProductionPlanInfoTree_Base`, and `Sp_Manufacture_ProductionPlanInfoTree_Base_TC`. xly-src copies under `script/标版/30100101/schedule/`. Cluster sibling of `Fun_RemoveJsonKey`/`Fun_AddJsonKey`-style mutators. diff --git a/en/docs/auto-catalog/functions/Fun_JsonExistsColor_ByName.md b/en/docs/auto-catalog/functions/Fun_JsonExistsColor_ByName.md index 52bbea8..639ee7c 100644 --- a/en/docs/auto-catalog/functions/Fun_JsonExistsColor_ByName.md +++ b/en/docs/auto-catalog/functions/Fun_JsonExistsColor_ByName.md @@ -19,4 +19,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Color/ink lookup helper. Given a JSON array of objects (each carrying a `sName` field), returns 1 if any element's `sName` matches `sGetKey`, else 0. + +**What it does:** Iterates the array with `JSON_LENGTH`/`JSON_EXTRACT`, unquotes each element's `$.sName`, returns 1 on first match. + +**Invocation:** Status: appears orphaned. No caller found in any channel — no form-master, module-hook, other-routine, or xly-src reference. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/Fun_MoneyToCh.md b/en/docs/auto-catalog/functions/Fun_MoneyToCh.md index a3f7f8d..a7c2b16 100644 --- a/en/docs/auto-catalog/functions/Fun_MoneyToCh.md +++ b/en/docs/auto-catalog/functions/Fun_MoneyToCh.md @@ -18,4 +18,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Converts a numeric currency amount into its formal Chinese capitalized form (大写金额, e.g. `123.45` → `壹佰贰拾叁元肆角伍分`) — the format required on Chinese invoices, receipts, and finance bills. + +**What it does:** Splits the amount into integer and two decimal places, then walks up to twelve integer positions plus jiao/fen, mapping digits to `零壹贰叁肆伍陆柒捌玖` and place markers to `元/拾/佰/仟/万/亿/角/分`. Suppresses redundant zeros and emits `整` when there is no fractional part. + +**Invocation:** Status: appears orphaned. No form-master, gdsmodule, other-routine, or Java caller references this name (the matching `xly-src/script/标版/30000101/Fun_MoneyToCh.sql` is the definition itself). Candidate for maintainer audit — likely a leftover from an older finance-print template. diff --git a/en/docs/auto-catalog/functions/Fun_RemoveJsonEmptyKey.md b/en/docs/auto-catalog/functions/Fun_RemoveJsonEmptyKey.md index bf8d5fe..74a8924 100644 --- a/en/docs/auto-catalog/functions/Fun_RemoveJsonEmptyKey.md +++ b/en/docs/auto-catalog/functions/Fun_RemoveJsonEmptyKey.md @@ -18,4 +18,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Filter-JSON sanitizer used by the production-scheduling Gantt/tree builders — strips list entries whose `bFilterValue` is blank or the placeholder `null,null` before the JSON is passed to a tree-rendering proc. + +**What it does:** Iterates the JSON array; for each element extracts `$.bFilterValue` and removes that element when empty / `null,null`. Returns `''` if the array empties out, otherwise the trimmed JSON. + +**Invocation:** Called from `sp_manufacture_productionplaninfotrace`, `sp_manufacture_productionplaninfotrace1`, and `Sp_Manufacture_ProductionPlanInfoTree_Base_TC` — the production-plan info-tree builders (生产计划信息树 / 排产看板). These are themselves invoked dynamically from the scheduling front-end; no static Java caller exists. diff --git a/en/docs/auto-catalog/functions/Fun_RemoveJsonKey.md b/en/docs/auto-catalog/functions/Fun_RemoveJsonKey.md index cae0eae..defe4f6 100644 --- a/en/docs/auto-catalog/functions/Fun_RemoveJsonKey.md +++ b/en/docs/auto-catalog/functions/Fun_RemoveJsonKey.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Generic JSON-array element remover used by the production-scheduling tree/Gantt builders to drop a single record matching `skey = sValue`. + +**What it does:** Iterates the JSON array; the first element whose `$.` equals `sValue` is removed (`JSON_REMOVE`) and the modified array returned immediately. + +**Invocation:** Called from `sp_manufacture_productionplaninfotrace`, `sp_manufacture_productionplaninfotrace1`, `Sp_Manufacture_ProductionPlanInfoTree_Base`, and `Sp_Manufacture_ProductionPlanInfoTree_Base_TC` — the production-plan info-tree builders that power the scheduling-board UI. diff --git a/en/docs/auto-catalog/functions/Fun_Sis_GetConst.md b/en/docs/auto-catalog/functions/Fun_Sis_GetConst.md index 838ecad..9d6a2d0 100644 --- a/en/docs/auto-catalog/functions/Fun_Sis_GetConst.md +++ b/en/docs/auto-catalog/functions/Fun_Sis_GetConst.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Canonical i18n / form-constant resolver. Given a constant key (`sStr`) and an optional category GUID (`sGuid`), returns the localized label for the current tenant's `CbxLanguage` setting (sChinese / sEnglish / sBig5). Every business proc that needs to embed a translatable string (button labels, validation messages, header captions) reads through this. + +**What it does:** Looks up `SysSystemSettings.CbxLanguage` scoped to `sBrId`+`sSuId`, then selects the matching column (`sChinese`/`sEnglish`/`sBig5`) from `gdsformconst` filtered by `sParentId=sGuid` and `sName=sStr`; falls back to the raw key when no row matches. + +**Invocation:** Heavily used — 220 routine callers including the entire `Sp_Check_s*` bill-validation family (sOdt, sPmd, sPpr, sOpc, sOpn, …), the `Sp_BtnEvent*` button-action chain, `Sp_Calc_s*` calculation procs, and `Sp_System_ReplaceField*`. Form-master / module-hook entries embed this in dropdown captions and warning messages. diff --git a/en/docs/auto-catalog/functions/Fun_Sis_GetConstNew.md b/en/docs/auto-catalog/functions/Fun_Sis_GetConstNew.md index 91daf9e..956f2db 100644 --- a/en/docs/auto-catalog/functions/Fun_Sis_GetConstNew.md +++ b/en/docs/auto-catalog/functions/Fun_Sis_GetConstNew.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Per-user variant of `Fun_Sis_GetConst`. Resolves a localized constant from `gdsformconst`, but consults the calling user's `sftlogininfo.sLanguage` first before falling back to the tenant-wide `SysSystemSettings.CbxLanguage`. Lets individual operators see UI strings in their own preferred language even within a shared tenant. + +**What it does:** Reads `sLanguage` from `sftlogininfo` matching `sUserName`/`sId` = `sLoginId`; if blank, falls back to `SysSystemSettings.CbxLanguage` for the tenant; then selects the matching `sChinese`/`sEnglish`/`sBig5` column from `gdsformconst` filtered by `sParentId=sGuid` and `sName=sStr`. + +**Invocation:** 132 routine callers — the migration target for routines that need per-login translation (subset of the `Sp_BtnEvent*`, `Sp_Calc_s*`, `Sp_Check_s*`, and `Sp_calc_*storeLimit` chains). Coexists with the older `Fun_Sis_GetConst`; new code is expected to favor this variant. diff --git a/en/docs/auto-catalog/functions/Fun_Subsequent_process.md b/en/docs/auto-catalog/functions/Fun_Subsequent_process.md index 5e73e36..e35e50b 100644 --- a/en/docs/auto-catalog/functions/Fun_Subsequent_process.md +++ b/en/docs/auto-catalog/functions/Fun_Subsequent_process.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Quotation/工序选择 helper — for a given product-classify, returns the full nested JSON tree of process-classifies → processes → process-dynamic-parameters that the quotation editor uses to render the "select subsequent processes" picker. Header gloss: "获取后道工序" (get downstream processes). + +**What it does:** Joins `sisprocessclassify`, `sisproductclassifyProcessClassify`, and `eleprocess` filtered by `sProductClassifyId`, building a nested `JSON_OBJECT` array with each process-classify's metadata, its default process, and (inner subquery) all quotable `eleprocess` rows for that classify plus each row's `eleprocessdynamic` parameter list. Returns one big JSON string. + +**Invocation:** Status: appears orphaned. No form-master, gdsmodule, other-routine, or xly-src caller. Candidate for maintainer audit — the JSON output shape matches the quotation-template editor, so this was likely staged for that screen but never wired in. diff --git a/en/docs/auto-catalog/functions/Fun_System_ReplaceField_JSON.md b/en/docs/auto-catalog/functions/Fun_System_ReplaceField_JSON.md index 1adabce..c6f586a 100644 --- a/en/docs/auto-catalog/functions/Fun_System_ReplaceField_JSON.md +++ b/en/docs/auto-catalog/functions/Fun_System_ReplaceField_JSON.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Helper for the field-replacement (`Sp_System_ReplaceField*`) family — packages three parallel comma-separated lists (type-codes, source-table names, source-row sIds) into a nested JSON object keyed by type → table → sId. + +**What it does:** Walks the comma list count via `CHAR_LENGTH` arithmetic; for each index extracts the matching token from each of the three inputs (`SUBSTRING_INDEX`), builds a one-level `JSON_OBJECT(type, JSON_OBJECT(table, sId))`, and `JSON_MERGE`s it into the running result. + +**Invocation:** Status: appears orphaned. No caller in form-master, gdsmodule hooks, other routines, or xly-src. Naming sibling `Sp_System_ReplaceField*` procs exist but none reference this function. Candidate for maintainer audit — likely an abandoned refactor of the field-replacement pipeline. diff --git a/en/docs/auto-catalog/functions/Fun_bFilter_toWhere.md b/en/docs/auto-catalog/functions/Fun_bFilter_toWhere.md index e72fd17..7156056 100644 --- a/en/docs/auto-catalog/functions/Fun_bFilter_toWhere.md +++ b/en/docs/auto-catalog/functions/Fun_bFilter_toWhere.md @@ -19,4 +19,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Server-side filter-clause builder for the report engine. When a user applies column filters in a report grid, FROUNT serializes them as a JSON array of `{bFilterName, bFilterCondition, bFilterValue}` and passes the blob to the underlying report proc; that proc calls this function with the JSON plus a table alias to get back an `AND col op value AND …` fragment to splice into its dynamic SQL. + +**What it does:** parses the JSON array, and for each element formats one SQL predicate: `like` with a comma-separated value expands into `(col like '%a%' OR col like '%b%' …)`; `in`/`not in` produce quoted lists; `=`, `<>`, `>`, `<` produce direct comparisons; values are escaped (`'` → `''`) and `.` is replaced with `。` to dodge a SQL-injection class. Field names prefixed with `FUN_` are emitted unaliased (lets the caller filter on function results), all others are qualified with `sTableAlias`. Returns the original `bFilter` unchanged if it isn't valid JSON. + +**Invocation:** called from ~20 report procs (production-plan info, inventory in/out, financial gross-profit, sales analyses) and ~50 customer-override SQL files. Procs receive `bFilter` as a parameter from the report-execution path. diff --git a/en/docs/auto-catalog/functions/Fun_box_pic.md b/en/docs/auto-catalog/functions/Fun_box_pic.md index a8c3d5e..5f7ee97 100644 --- a/en/docs/auto-catalog/functions/Fun_box_pic.md +++ b/en/docs/auto-catalog/functions/Fun_box_pic.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Box-type (盒型) reference-image lookup for the packaging-quotation form. For a chosen product type, returns the gallery of box-shape thumbnails registered under `eleproductfile` so the FROUNT control can render them as a picker. + +**What it does:** builds a JSON array via `GROUP_CONCAT(JSON_OBJECT(...))` from `eleproductfile` rows where `sParentId = sProductTypeId`, projecting the file's id, name, picture path, and tenant ids, ordered by `iOrder`. The thumb shape duplicates `sFileName` into `sChinese`/`showName`/`sBig5` so existing dropdown components can consume it without a separate label column. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. Likely written for a planned packaging-form widget that never went into production, or for a customer-specific deployment whose SQL is not in this snapshot. diff --git a/en/docs/auto-catalog/functions/Fun_box_type.md b/en/docs/auto-catalog/functions/Fun_box_type.md index a15fc07..d5bd3a6 100644 --- a/en/docs/auto-catalog/functions/Fun_box_type.md +++ b/en/docs/auto-catalog/functions/Fun_box_type.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Box-type (盒型) parameter list for the packaging-quotation form. For a chosen product type, returns the box-shape definitions registered on `sisboxtypeparam` so FROUNT can render a dropdown wired to dimension/offset/quantity defaults. + +**What it does:** builds a JSON array via `GROUP_CONCAT(JSON_OBJECT(...))` from `sisboxtypeparam` rows where `sParentId = sProductTypeId`, projecting code/name plus the geometry fields (`iSLength`, `iSWidth`, `iSType`, `sSOffset`, `iSQuantity`, and the `iC*` counterparts), ordered by `iOrder`. Output shape mimics xly's standard dropdown JSON. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. Likely tied to a planned packaging-form widget that never went into production, or a customer-specific deployment whose SQL is not in this snapshot. diff --git a/en/docs/auto-catalog/functions/Fun_dReportQty.md b/en/docs/auto-catalog/functions/Fun_dReportQty.md index add3211..1d346a8 100644 --- a/en/docs/auto-catalog/functions/Fun_dReportQty.md +++ b/en/docs/auto-catalog/functions/Fun_dReportQty.md @@ -18,4 +18,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Remaining-to-report quantity helper for one work-order process row. For a given `mftworkorderprocess.sId`, returns `dProcessInQty - SUM(dProcessQty)` — how much of the dispatched in-quantity still hasn't been reported as completed via the production-report screen. + +**What it does:** joins `mftworkorderprocess` against an aggregate of `viw_mftproductionreport` (filtered to `bCheck=1 AND bInvalid=0`, grouped by `sWorkOrderProcessTbId`) and returns the difference, coalesced to 0 when no reports exist. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/Fun_deleteManyChar.md b/en/docs/auto-catalog/functions/Fun_deleteManyChar.md index fb5c862..2a93eb7 100644 --- a/en/docs/auto-catalog/functions/Fun_deleteManyChar.md +++ b/en/docs/auto-catalog/functions/Fun_deleteManyChar.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Generic string-dedup helper used by `Sp_Bill_Used` (bill / document linkage tracking — checks how many parents an id list has already been consumed by). Header comment is `根据in_splict切割字符串,去除重复元素` ("split the string by `in_splict`, remove duplicates"). When the caller has accumulated a comma-joined id list with possible repeats, it pipes it through this function before counting usage. + +**What it does:** strips all spaces, collapses doubled separators, appends one trailing separator so the loop has a stop token, then walks the string token-by-token (`SUBSTR` + `INSTR`) and concatenates each token onto `v_result` only if `INSTR(v_result, token) = 0`. Returns the result with the trailing separator trimmed off. Pure string mechanics — no table reads or writes. + +**Invocation:** called from `Sp_Bill_Used` (and its customer-override variants under `script/客户/千彩` and `script/客户/统兴`) to dedup id lists before counting parent-document usage. No form-master, gdsmodule-hook, or Java caller. diff --git a/en/docs/auto-catalog/functions/Fun_getDhouM.md b/en/docs/auto-catalog/functions/Fun_getDhouM.md index cd2f15d..5fd70ed 100644 --- a/en/docs/auto-catalog/functions/Fun_getDhouM.md +++ b/en/docs/auto-catalog/functions/Fun_getDhouM.md @@ -18,4 +18,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Hard-coded "post-print/finishing machine → default die count" lookup. Body comments enumerate the virtual-machine sIds with their fixed `iReturn` values: 模切机 (die-cutting, 4), 烫金机 (hot-stamping, 6), 折页机 (folding, 7), 锁线机 (book-thread sewing, 6), 冲孔机 (punching, 3), 裁切机 (trimming, 4), 吸塑机 (vacuum-forming, 3), 圆角机 (corner-rounding, 3); 深圳手工 = 1. + +**What it does:** walks the JSON filter array `sJson`; finds the entry whose `bFilterName = 'sMachineId'`; switches on `bFilterValue` (machine sId hard-coded constants) and sets `p_iReturn` to the corresponding default count. Returns 1 if no match. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep, dynamic-dispatch search) — candidate for maintainer audit. The hard-coded tenant-specific machine sIds (e.g. `16500802910009018024524290446000`) suggest this was a one-tenant patch that was never wired into the standard flow. diff --git a/en/docs/auto-catalog/functions/Fun_getInitColumnByProName.md b/en/docs/auto-catalog/functions/Fun_getInitColumnByProName.md index 17062e3..2d0cf36 100644 --- a/en/docs/auto-catalog/functions/Fun_getInitColumnByProName.md +++ b/en/docs/auto-catalog/functions/Fun_getInitColumnByProName.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Dispatcher that returns the canonical column list for a stored-procedure-backed report given its name. Wired into the metadata-config tooling under `gdsconfigtb*` — when an admin generates the SQL script for a report-style proc, the platform asks this function which columns to declare in the wrapper. + +**What it does:** a long chain of `IF lower(sProductName) = lower('Sp_…') THEN @sColumns := 'sId,…' ; RETURN @sColumns;` blocks. Each branch hard-codes the master+slave column union for one report proc — `Sp_Sales_NotDeliverGoodList`, `Sp_BillOfNoPicking`, `Sp_Receivables_AR*`, `Sp_Payables_AP*`, `Sp_NotPayables`, `Sp_NotReceivables`, `Sp_Inventory_InOutStore`, `Sp_Inventory_ProductInOutStore`, `Sp_Manufacture_Production*`, `Sp_Cashier_OrderMoneyWarning`, `Sp_Element_ProduceReportSum`, `SP_DeliverGoods_Warning`, etc. Pure string concatenation; no table access. + +**Invocation:** called by MyBatis mapper `GdsconfigtbMapper.getInitColumnByProName` (`select Fun_getInitColumnByProName(#{sTbName}) as sColumns…`) during gdsconfigtb script generation for the named report procedure. diff --git a/en/docs/auto-catalog/functions/Fun_getMoneyFormart.md b/en/docs/auto-catalog/functions/Fun_getMoneyFormart.md index 38601fe..499dc4b 100644 --- a/en/docs/auto-catalog/functions/Fun_getMoneyFormart.md +++ b/en/docs/auto-catalog/functions/Fun_getMoneyFormart.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Amount-in-words digit splitter for printed invoices / 收据 — pads `sMoney` to 9 integer digits + 2 decimal digits, then emits each position as a comma-separated cell value, substituting `null` for leading blanks. Lets a report template render the digit columns 亿/千万/百万/.../角/分 separately. + +**What it does:** Floors `sMoney` to integer, `LPAD`s to 9 chars with `*`, walks each char and appends either the digit or `'null'`; repeats for the 2-digit fractional part; returns the comma-joined string, or 11 commas of `null` when `sMoney <= 0`. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep beyond the routine's own deployment SQL) — candidate for maintainer audit. The catalog header `根据key值获取json字符串值` was copy-pasted from a JSON helper and is wrong. diff --git a/en/docs/auto-catalog/functions/Fun_getOneByKey.md b/en/docs/auto-catalog/functions/Fun_getOneByKey.md index 9daf21b..28bc9c5 100644 --- a/en/docs/auto-catalog/functions/Fun_getOneByKey.md +++ b/en/docs/auto-catalog/functions/Fun_getOneByKey.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** JSON-array lookup — given a JSON array `sJson` and a key/value pair (`skey`, `sValue`), returns the first array element whose `$.skey = sValue`, or `''` if no match. The companion to `Fun_HasJsonKey` / `Fun_RemoveJsonKey` for filter-payload parsing in scheduler procedures. + +**What it does:** Validates `sJson` is JSON, iterates each top-level element, `JSON_EXTRACT`s `$.skey`, strips quotes, compares against `sValue`; returns the matching element on first hit. + +**Invocation:** Called by `sp_manufacture_productionplaninfotrace` / `sp_manufacture_productionplaninfotrace1`, `Sp_Manufacture_ProductionPlanInfoTree_Base`, `Sp_Manufacture_ProductionPlanInfoTree_Base_TC` — the production-plan tree-loading procedures that pluck specific filter clauses (e.g. `bFilterName='tStartDate'`) out of the front-end's `bFilter` JSON before rebuilding the WHERE clause. diff --git a/en/docs/auto-catalog/functions/Fun_getPartNameStatus.md b/en/docs/auto-catalog/functions/Fun_getPartNameStatus.md index 95a13ce..ff935d0 100644 --- a/en/docs/auto-catalog/functions/Fun_getPartNameStatus.md +++ b/en/docs/auto-catalog/functions/Fun_getPartNameStatus.md @@ -18,4 +18,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Part-name path cleaner — given a `->`-joined hierarchy like `A#abc->B#xyz->C#qrs`, strips everything after `#` in each segment and re-joins with `->`, yielding `A->B->C`. Intended to drop status / suffix metadata from a part-name breadcrumb before display. + +**What it does:** Counts `->` separators, walks segment-by-segment with `SUBSTRING_INDEX`, applies `Fn_split_string(seg, '#', 1)` to each, and concatenates with `->`. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep beyond the routine's own deployment SQL) — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/Fun_getPlanDate.md b/en/docs/auto-catalog/functions/Fun_getPlanDate.md index a53aa24..4d836e3 100644 --- a/en/docs/auto-catalog/functions/Fun_getPlanDate.md +++ b/en/docs/auto-catalog/functions/Fun_getPlanDate.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Plan-date filter compiler — translates a date-range filter JSON (with `bFilterCondition` ∈ `month`/`week`/`weekpre`/`day`/`daybefore`/`tomorrowbefore`/`aftertomorrowbefore`/`between`) into an `AND BETWEEN ... AND ...` SQL fragment, anchored at the supplied `p_sOffWork` clock-off time and prefixed with the table alias. Lets the production-plan tree query reuse the front-end's relative-date filter widgets. + +**What it does:** Parses `bFilterName` / `bFilterCondition` / `bFilterValue` from the JSON, prepends `sTableAlias.` to the field, then branches on `bFilterCondition` to assemble the BETWEEN/< clause against `CURDATE()` / `NOW()` / `LAST_DAY` / `WEEKDAY` offsets; for `between`, splits `bFilterValue` on `,` into the two endpoints. + +**Invocation:** Called by `sp_manufacture_productionplaninfotrace` / `*trace1`, `Sp_Manufacture_ProductionPlanInfoTree_Base`, `Sp_Manufacture_ProductionPlanInfoTree_Base_TC` — the production-plan tree-loading procedures. Used together with `Fun_getOneByKey` / `Fun_HasJsonKey` / `Fun_RemoveJsonKey` to rebuild the WHERE clause from the front-end filter payload. diff --git a/en/docs/auto-catalog/functions/Fun_getProcessByControlName.md b/en/docs/auto-catalog/functions/Fun_getProcessByControlName.md index 3d14377..6ac83d1 100644 --- a/en/docs/auto-catalog/functions/Fun_getProcessByControlName.md +++ b/en/docs/auto-catalog/functions/Fun_getProcessByControlName.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Work-order process-flow renderer (生产管理 → 工单 / 生产计划) — assembles a JSON array describing each `mftworkorderprocess` step of a given work-order along with a colour-coded state for the planning UI's gantt/flow chart. Despite the header comment mentioning a `控制表ID` parameter, only `sWorkOrderId` is actually used in the body (the second arg is unreferenced). + +**What it does:** joins `mftProductionPlanSlave` → `mftworkorderprocess` → `eleprocess` → `sisprocessclassify`, groups by `iOrder` to collapse multi-slave rows into one entry per process step, picks `MIN(sState)` as the worst-case status, and `GROUP_CONCAT`s a `JSON_OBJECT` per step (`sProcessName`, `sWorkOrderId`, `sState`, `background` colour decided by state/`bFrozen`). Returns a `[...]`-wrapped JSON array, or `''` when no rows match. + +**Invocation:** wrapped by `Fun_getProcessByWorkOrderId` (the one-arg convenience version that passes `''` as `sWorkControlId`). Neither function is referenced by any other routine, form-master sSqlStr, gdsmodule hook, or xly-src file. Status: appears orphaned. No live caller found in any channel — candidate for maintainer audit (likely a feature-flag UI helper that was wired in a deprecated form). diff --git a/en/docs/auto-catalog/functions/Fun_getProcessByWorkOrderId.md b/en/docs/auto-catalog/functions/Fun_getProcessByWorkOrderId.md index fb02db0..1acd952 100644 --- a/en/docs/auto-catalog/functions/Fun_getProcessByWorkOrderId.md +++ b/en/docs/auto-catalog/functions/Fun_getProcessByWorkOrderId.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** One-argument convenience wrapper for [`Fun_getProcessByControlName`](Fun_getProcessByControlName.md) — meant to render the colour-coded JSON process-flow chart for a work-order without specifying a control-table id. + +**What it does:** delegates straight to `Fun_getProcessByControlName(sWorkOrderId, '')`. + +**Invocation:** no form-master sSqlStr, gdsmodule hook, other routine, or xly-src reference uses this wrapper. Status: appears orphaned. No caller found in any channel — candidate for maintainer audit (likely a UI helper whose calling form was retired). diff --git a/en/docs/auto-catalog/functions/Fun_getProductMaxStyle.md b/en/docs/auto-catalog/functions/Fun_getProductMaxStyle.md index 86320a5..97b391b 100644 --- a/en/docs/auto-catalog/functions/Fun_getProductMaxStyle.md +++ b/en/docs/auto-catalog/functions/Fun_getProductMaxStyle.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Largest-machine-style probe — for a given product (or, when `p_sProductId` is empty, a hard-coded product `sId`), returns the biggest `dMachineLength * dMachineWidth` formatted as `L*W` from `eleprocessstyle`. Used to pick a representative machine size for the product's process variants. + +**What it does:** branches on whether `p_sProductId` is empty: empty path uses a hard-coded `eleprocess.sId` literal (`16850218330008220277598473420000`); non-empty path queries by `eleprocess.sParentId = '16850209050009530246638814024000'` (a process-classification root). Both joins to `eleprocessstyle` and `ORDER BY length*width DESC LIMIT 1`. Header comment `根据首字母拼音查询` is misleading — has nothing to do with pinyin. + +**Invocation:** the only routine referencing it is `Sp_Ai_AddQuoQuoAfter`, which is part of the `ai_*` subsystem that the wiki excludes from its core ERP scope (see [the index](../../index.md#whats-out-of-scope)). No form-master, gdsmodule hook, in-scope routine, or xly-src reference invokes it. Status: appears orphaned for in-scope purposes — candidate for maintainer audit. Also flag: the hard-coded `sId` literals tie this function to one specific tenant's data and will quietly return `NULL` elsewhere. diff --git a/en/docs/auto-catalog/functions/Fun_get_sProductId.md b/en/docs/auto-catalog/functions/Fun_get_sProductId.md index 8ad4e0c..75d7873 100644 --- a/en/docs/auto-catalog/functions/Fun_get_sProductId.md +++ b/en/docs/auto-catalog/functions/Fun_get_sProductId.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 工单 (work-order) — given a `mftworkordermaterials.sId`, resolves the `sProductId` (customer product) that owns this material line. Handles the "merged-job" (合版/拼版) case where one work-order combines multiple slave products, so the material may need to be attributed to the right slave's product. + +**What it does:** reads `sParentId` (work-order id) and `sType` from `mftworkordermaterials`. If `sType=2`, joins via `M.sCombinePartsName = S.sId` to `mftworkorderslave`. Otherwise chains `mftworkordermaterials → mftworkordercontrol → mftworkordercontrolcombine → mftworkorderslave` on `sControlId`/`sSlaveId`. Falls back to "first slave under the same work-order" if neither produces a hit. Returns `sProductId`. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, exhaustive xly-src grep) — candidate for maintainer audit. Sibling functions `Fun_get_sProductId_WM` and `Fun_get_sProductId_WP` (in `script/标版/upgrade/合版信息取客户产品/`) cover the same query for material/process tables under the `_WM`/`_WP` naming; this earlier-named variant looks superseded. diff --git a/en/docs/auto-catalog/functions/Fun_get_sProductId_process.md b/en/docs/auto-catalog/functions/Fun_get_sProductId_process.md index 0d24688..bcb2ba6 100644 --- a/en/docs/auto-catalog/functions/Fun_get_sProductId_process.md +++ b/en/docs/auto-catalog/functions/Fun_get_sProductId_process.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 工单 (work-order) — process-table variant of `Fun_get_sProductId`. Given a `mftworkorderprocess.sId`, resolves the customer `sProductId` for the work-order step. Same merged-job (合版) attribution problem. + +**What it does:** reads `sParentId` (work-order id) and `sType` from `mftworkorderprocess`. If `sType=3`, joins via `M.sCombinePartsName = S.sId` to `mftworkorderslave`. Otherwise chains `mftworkorderprocess → mftworkordercontrol → mftworkordercontrolcombine (filtered to dCombineQty > 0) → mftworkorderslave`. Falls back to "first slave under the same work-order". Returns `sProductId`. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, exhaustive xly-src grep) — candidate for maintainer audit. Likely superseded by `Fun_get_sProductId_WP` (`合版信息取客户产品` upgrade directory). diff --git a/en/docs/auto-catalog/functions/Fun_get_show_config.md b/en/docs/auto-catalog/functions/Fun_get_show_config.md index f4ae9a1..7a2868f 100644 --- a/en/docs/auto-catalog/functions/Fun_get_show_config.md +++ b/en/docs/auto-catalog/functions/Fun_get_show_config.md @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Dynamic-report column-config builder ("动态配置返回函数" family). Thin wrapper around `Fun_get_show_config_hz` that lets callers override the default column width (`iFitWidth`) — used in dynamic-grid reports where some columns need a wider/narrower fit than the default 80. + +**What it does:** calls `Fun_get_show_config_hz` with the supplied parameters (and `bSum=0` forced), then `JSON_REMOVE` the existing `iFitWidth` field and `JSON_MERGE` the caller-specified width back in. Returns the modified JSON. + +**Invocation:** called by `Fun_get_show_config_sear` and by `Sp_CostAccount_CostCarryForward`, `Sp_CostAccount_WorkCenterToOperation`, `Sp_EquipmentOutput_Machine`, `Sp_EquipmentOutput_Machine_YH`, `Sp_Manufacture_CapacityStatistics`, `Sp_mes_Timeanalyse_Machine`, `Sp_MftPlan_MachineProcessLodading`, `Sp_SalesOrder_Analysis`. Reached from each report's button-click / open-form flow. diff --git a/en/docs/auto-catalog/functions/Fun_get_show_config_basic.md b/en/docs/auto-catalog/functions/Fun_get_show_config_basic.md index 3a8f0d8..54f6e8d 100644 --- a/en/docs/auto-catalog/functions/Fun_get_show_config_basic.md +++ b/en/docs/auto-catalog/functions/Fun_get_show_config_basic.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Dynamic-report column-config builder ("动态配置返回函数" family) — the most flexible variant. Accepts a partial JSON of column-config overrides and merges them onto a full default config object (every gdsconfigformslaver-shaped key with sensible defaults, `iFitWidth=80`, `bVisible=false`, `iTag=0`, etc.). + +**What it does:** declares an internal base JSON with all column-config keys defaulted, then `JSON_MERGE_PATCH`-style merges `jUpdateConfigJson` over it (the body actually iterates keys and selectively overrides). Returns the merged JSON. Lets callers supply only the keys they care about. + +**Invocation:** called by `Sp_CostAccount_CostCarryForward` and `Sp_CostAccount_WorkCenterToOperation` to compose per-stage column blocks (合并 multiple `Fun_get_show_config_basic(...)` calls with CONCAT). Reached via the 成本核算 (cost-accounting) carry-forward / workcenter-to-operation report buttons. diff --git a/en/docs/auto-catalog/functions/Fun_get_show_config_hb.md b/en/docs/auto-catalog/functions/Fun_get_show_config_hb.md index a426765..b5fe122 100644 --- a/en/docs/auto-catalog/functions/Fun_get_show_config_hb.md +++ b/en/docs/auto-catalog/functions/Fun_get_show_config_hb.md @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Dynamic-report column-config builder ("动态配置返回函数" family) — "合并" (merge-cell) variant. Same as `Fun_get_show_config_hz` shape but with `bMergeCell=TRUE`, so adjacent rows with the same column value get visually merged in the FROUNT grid (used for grouping/category columns in equipment-output and capacity-statistics reports). + +**What it does:** returns a `JSON_OBJECT` column-config block, same defaults as `_hz` (width 80, NULL-safe, tenant fields), with `bMergeCell` forced TRUE. + +**Invocation:** called by `Sp_EquipmentOutput_Machine`, `Sp_EquipmentOutput_Machine_YH`, `Sp_Manufacture_CapacityStatistics`, `Sp_mes_Timeanalyse_Machine`, `Sp_MftPlan_MachineProcessLodading`, and `Sp_SalaryReport`. Reached from each report's button-click flow under 生产管理 (Equipment-output / Capacity-statistics / Machine-process-loading) and 工资 (SalaryReport). diff --git a/en/docs/auto-catalog/functions/Fun_get_show_config_hbjz.md b/en/docs/auto-catalog/functions/Fun_get_show_config_hbjz.md index eb96db0..bab862f 100644 --- a/en/docs/auto-catalog/functions/Fun_get_show_config_hbjz.md +++ b/en/docs/auto-catalog/functions/Fun_get_show_config_hbjz.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Dynamic-report column-config builder ("动态配置返回函数" family) — "合并基准" / parent-grouping variant. Used to emit a header row that groups child columns (`sActiveKey` becomes the parent-column linkage) in dynamic grids; `bVisible=false` because the parent header is structural, not a data column. + +**What it does:** returns a `JSON_OBJECT` shaped like the other show_config outputs but with reduced parameters — only `sName`, `showName`, `sActiveKey`, `sParentId` are caller-supplied; `bSum=FALSE`, `bMergeCell=false`, `bVisible=false`, `iOrder=0`, `iFitWidth=80`. Each invocation uses a fresh `NewId()` for `sId`. + +**Invocation:** called by `Sp_MftPlan_MachineProcessLodading` (生产管理 → 工序加载报表). No other callers found in routines or src. diff --git a/en/docs/auto-catalog/functions/Fun_get_show_config_hz.md b/en/docs/auto-catalog/functions/Fun_get_show_config_hz.md index f8cb354..0561f16 100644 --- a/en/docs/auto-catalog/functions/Fun_get_show_config_hz.md +++ b/en/docs/auto-catalog/functions/Fun_get_show_config_hz.md @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Dynamic-report column-config builder ("动态配置返回函数" family). Base/seed function in the show_config family. Used by analytical procedures that build a result-grid on the fly and need each output column to carry a JSON config block — the same shape that `gdsconfigformslaver` rows would carry if they were declared statically — so FROUNT can render the column with sensible defaults (sortable, visible, no merge, fit-width 80). + +**What it does:** returns a single `JSON_OBJECT(...)` containing the standard column-config keys (`sName`, `sChinese`/`sBig5` = `showName`, `iOrder`, `iFitWidth=80`, `bVisible`, `bSum`, etc.) plus tenant fields (`sBrandsId`, `sSubsidiaryId`, `sMakePerson`). NULL-safe defaults via `IFNULL`. `sRelation = 'noQuery'`. + +**Invocation:** called by `Fun_get_show_config` (which adds `iFitWidth` override) and by `Sp_SalesOrder_Analysis`. Reached when the report runs from its module entry-point (销售分析 report grid). diff --git a/en/docs/auto-catalog/functions/Fun_get_show_config_pup120.md b/en/docs/auto-catalog/functions/Fun_get_show_config_pup120.md index 31fa02d..03fc5c0 100644 --- a/en/docs/auto-catalog/functions/Fun_get_show_config_pup120.md +++ b/en/docs/auto-catalog/functions/Fun_get_show_config_pup120.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Dynamic-report column-config builder ("动态配置返回函数" family) — "下拉(120宽)" variant. Emits a column-config that renders as a dropdown (`sDropDownType`/`sActiveId`/`sActiveKey` populated) at width 120 in the FROUNT grid. + +**What it does:** returns a `JSON_OBJECT` shaped like `_hz` but with `iFitWidth=120` and the dropdown fields populated from `sActiveId`/`sActiveKey`/`sDropDownType`/`sColorTerms` parameters. NULL-safe defaults. + +**Invocation:** called by `Sp_Manufacture_CapacityStatistics` (生产管理 → 产能统计报表). No other callers found. diff --git a/en/docs/auto-catalog/functions/Fun_get_show_config_pup40.md b/en/docs/auto-catalog/functions/Fun_get_show_config_pup40.md index 0256d09..ee3f01d 100644 --- a/en/docs/auto-catalog/functions/Fun_get_show_config_pup40.md +++ b/en/docs/auto-catalog/functions/Fun_get_show_config_pup40.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Dynamic-report column-config builder ("动态配置返回函数" family) — "下拉(40/65宽)" variant. Same shape as `Fun_get_show_config_pup120` but with `iFitWidth=65`, intended for narrow dropdown columns (yes/no flags, short codes) in dynamic-grid reports. + +**What it does:** returns a `JSON_OBJECT` column-config with width 65, dropdown fields populated from `sActiveId`/`sActiveKey`/`sDropDownType`/`sColorTerms`. NULL-safe defaults match the rest of the family. + +**Invocation:** called by `Sp_EquipmentOutput_Machine` and `Sp_EquipmentOutput_Machine_YH` (生产管理 → 设备产出 / 设备产出夜班). No other routine or src callers found. diff --git a/en/docs/auto-catalog/functions/Fun_get_show_config_sear.md b/en/docs/auto-catalog/functions/Fun_get_show_config_sear.md index 1b2ec51..86a829b 100644 --- a/en/docs/auto-catalog/functions/Fun_get_show_config_sear.md +++ b/en/docs/auto-catalog/functions/Fun_get_show_config_sear.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Dynamic-report column-config builder ("动态配置返回函数" family) — "查询/搜索" (searchable) variant. Wraps `Fun_get_show_config` and patches the result to flag the column as searchable (`bFind=TRUE`) with a dropdown-bound filter (`sChineseDropDown` + `sDropDownType`). + +**What it does:** delegates to `Fun_get_show_config` to get the base config (with caller-specified `iFitWidth`), then `JSON_MERGE`s in `sChineseDropDown`, `bFind=TRUE`, and `sDropDownType`. Returns the merged JSON. + +**Invocation:** called by `Sp_SalesOrder_Analysis` (销售订单分析). Source dir also shows `Sp_OpsOutside_Analysis` invokes it (外发分析). Reached from the analytical-report grid's open / refresh flow. diff --git a/en/docs/auto-catalog/functions/Fun_get_show_config_witd40.md b/en/docs/auto-catalog/functions/Fun_get_show_config_witd40.md index 731e534..b0b1318 100644 --- a/en/docs/auto-catalog/functions/Fun_get_show_config_witd40.md +++ b/en/docs/auto-catalog/functions/Fun_get_show_config_witd40.md @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Dynamic-report column-config builder ("动态配置返回函数" family) — narrow-width (`iFitWidth=65`) plain-cell variant without dropdown / colorTerms. Used in dynamic-grid reports for short numeric / code columns. + +**What it does:** returns a `JSON_OBJECT` column-config block; same key set as `_hz` but with `iFitWidth=65`, `bMergeCell=false`. NULL-safe defaults via `IFNULL`. + +**Invocation:** called by `Sp_EquipmentOutput_Machine`, `Sp_EquipmentOutput_Machine_YH`, `Sp_Manufacture_CapacityStatistics`. Source dir also shows `Sp_SalaryReport` uses it. Reached from each report's button-click flow under 生产管理 / 工资. diff --git a/en/docs/auto-catalog/functions/Fun_get_show_config_ys.md b/en/docs/auto-catalog/functions/Fun_get_show_config_ys.md index a0d2fb6..399e226 100644 --- a/en/docs/auto-catalog/functions/Fun_get_show_config_ys.md +++ b/en/docs/auto-catalog/functions/Fun_get_show_config_ys.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Dynamic-report column-config builder ("动态配置返回函数" family) — "颜色规则" (color-terms) variant at default width 80. Lets a column carry FROUNT cell-level conditional-formatting rules (`sColorTerms`) — e.g., red background when `sState='未审核'`. + +**What it does:** returns a `JSON_OBJECT` column-config block; same shape as `_hz` (width 80, NULL-safe, tenant fields) with `sColorTerms` parameter wired through. + +**Invocation:** called by `Sp_EquipmentOutput_Machine`, `Sp_EquipmentOutput_Machine_YH`, `Sp_mes_Timeanalyse_Machine`, `Sp_MftPlan_MachineProcessLodading`. Reached from each report's open/refresh flow under 生产管理. diff --git a/en/docs/auto-catalog/functions/Fun_get_show_config_ys100.md b/en/docs/auto-catalog/functions/Fun_get_show_config_ys100.md index 127f190..1b33e62 100644 --- a/en/docs/auto-catalog/functions/Fun_get_show_config_ys100.md +++ b/en/docs/auto-catalog/functions/Fun_get_show_config_ys100.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Dynamic-report column-config builder ("动态配置返回函数" family) — "颜色规则" variant at width 100. Same role as `Fun_get_show_config_ys` but emits `iFitWidth=100`. + +**What it does:** returns a `JSON_OBJECT` column-config block with `iFitWidth=100` and `sColorTerms` parameter wired through. Otherwise identical to `_ys`. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, exhaustive xly-src grep across all extensions) — candidate for maintainer audit. Likely an unused width variant kept alongside `_ys` (80), `_ys40` (65), `_ys100` (this one). diff --git a/en/docs/auto-catalog/functions/Fun_get_show_config_ys40.md b/en/docs/auto-catalog/functions/Fun_get_show_config_ys40.md index bdb78b3..e69040c 100644 --- a/en/docs/auto-catalog/functions/Fun_get_show_config_ys40.md +++ b/en/docs/auto-catalog/functions/Fun_get_show_config_ys40.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Dynamic-report column-config builder ("动态配置返回函数" family) — "颜色规则(窄)" variant at width 65. Same role as `Fun_get_show_config_ys` but for narrow columns; emits `iFitWidth=65`. + +**What it does:** returns a `JSON_OBJECT` column-config block with `iFitWidth=65` and `sColorTerms` parameter wired through. Otherwise identical to `_ys`. + +**Invocation:** called by `Sp_EquipmentOutput_Machine`, `Sp_EquipmentOutput_Machine_YH`, `Sp_mes_Timeanalyse_Machine`, `Sp_MftPlan_MachineProcessLodading`. Reached from each report's open/refresh flow under 生产管理. diff --git a/en/docs/auto-catalog/functions/Fun_iCalcListJson.md b/en/docs/auto-catalog/functions/Fun_iCalcListJson.md index e408a32..a9ad49b 100644 --- a/en/docs/auto-catalog/functions/Fun_iCalcListJson.md +++ b/en/docs/auto-catalog/functions/Fun_iCalcListJson.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** JSON-array sum-reducer — given a JSON array `p_json` and a column name `cloumnName` (sic), sums the values of that column across all array entries and returns the result as `decimal(18,6)`. Used inside work-order data-pack std-calc routines to roll up nested per-part quantities pre-assembled in JSON form. + +**What it does:** validates the JSON; walks `JSON_LENGTH` entries; for each entry `JSON_EXTRACT`s `$[i].`, strips surrounding quotes, casts to `DECIMAL(18,6)`, adds to a running sum. Returns `0` on empty/invalid input. + +**Invocation:** referenced by `Sp_WorkOrder_CalcDataBsProductStd` and `Sp_WorkOrder_CalcDataPackProductStd` (work-order base/pack product std-calc). xly-src copies also live under customer overlays (`script/客户/快马/`, `千彩/`, `金宣发/`). diff --git a/en/docs/auto-catalog/functions/Fun_up_workOrderProcessId.md b/en/docs/auto-catalog/functions/Fun_up_workOrderProcessId.md index cd1bd1f..d5e124b 100644 --- a/en/docs/auto-catalog/functions/Fun_up_workOrderProcessId.md +++ b/en/docs/auto-catalog/functions/Fun_up_workOrderProcessId.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Work-order process-graph walker — given a `mftworkorderprocess.sId` and the row's `sType`, returns the sId of the previous (upstream) process step in the same work-order's flow. Header gloss: "获取上工序ID" (get upstream process id). + +**What it does:** When `sType='3'` (combined-parts step), first matches by `sCombinePartsName`, then by `sNextId` traversal. When `sType='0'` (origin) it returns `p_sId` itself. Otherwise looks up the row whose `sNextId` equals `p_sId`. Falls back to the input when nothing matches. + +**Invocation:** Orphan-via-dead-chain. Only caller `fun_GetPreProcessQty` is itself an orphan (per session 6 audit — hardcodes a tenant `eleprocess.sId`). No form-master, module-hook, or xly-src reference. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/GetChineseChar.md b/en/docs/auto-catalog/functions/GetChineseChar.md index 37d4e32..0c7ee70 100644 --- a/en/docs/auto-catalog/functions/GetChineseChar.md +++ b/en/docs/auto-catalog/functions/GetChineseChar.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Intended to split a mixed Chinese/Latin string and return only the non-Chinese (ASCII) part — useful for separating product codes/SKUs from their Chinese descriptive names. Header gloss mis-spells the intent: "传入字符串获取其中中文部门" (read as "...部分"). + +**What it does:** Walks the string one character at a time; classifies each via `REGEXP '[u0391-uFFE5]'` and accumulates into `szwChar` (non-match → "non-Chinese") or `snChar` (match → "Chinese"). Returns `szwChar`. + +**Invocation:** Status: appears orphaned. No form-master, gdsmodule, other-routine, or xly-src caller (the matching `xly-src/script/标版/30000101/GetChineseChar.sql` is the definition itself). Bug suspect: the regex character class `[u0391-uFFE5]` is taken as literal `u`/`0`/`3`/`9`/`1`/…/`F`/`E`/`5` rather than the intended Unicode range `Α-¥` — the function effectively classifies every character as non-Chinese and returns the whole input. Same broken regex as `Fun_GetCh` flagged in session 4. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/GetDispatchUnit.md b/en/docs/auto-catalog/functions/GetDispatchUnit.md index b311eb5..aa6310e 100644 --- a/en/docs/auto-catalog/functions/GetDispatchUnit.md +++ b/en/docs/auto-catalog/functions/GetDispatchUnit.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Production-report unit picker. For a given work-order + process, returns the appropriate reporting unit (`张` / `付` / `印次` / `贴` / or the product's own `sProductUnit`) based on the process's `sProductionReportId` category. + +**What it does:** Reads `EleProcess.sProductionReportId` for the process, then maps via a hardcoded GUID switch — five literal GUIDs map to fixed Chinese unit names; a sixth (`6904E091-…`) falls back to `eleproduct.sProductUnit` joined from the work-order's first slave row. + +**Invocation:** Orphan-via-dead-chain. Only routine caller is `Sp_Manufacture_ProductionProcess`, which itself has no form-master, gdsmodule, or Java caller (a manufacturing-search proc that appears unwired). Hardcodes tenant-specific `sProductionReportId` GUIDs — would silently default to `NULL` on any other deployment. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/GetMaterialsAuxiliaryQty.md b/en/docs/auto-catalog/functions/GetMaterialsAuxiliaryQty.md index ab9bdf0..ffb1149 100644 --- a/en/docs/auto-catalog/functions/GetMaterialsAuxiliaryQty.md +++ b/en/docs/auto-catalog/functions/GetMaterialsAuxiliaryQty.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Materials auxiliary-unit stock query. Returns either a single location's on-hand auxiliary quantity (`iType=0`) or the available auxiliary stock for the whole tenant after netting in-transit virtual moves (`iType≠0`). + +**What it does:** When `iType=0`, looks up `elematerialsstock.dAuxiliaryQty` matching the eight key columns. When `iType≠0`, sums `dAuxiliaryQty` from `elematerialsstock` across all warehouses, then adjusts: subtracts the `MitMaterialsStoreVirtual` rows tagged with purchase-form `sFormId='192116810113315217757747140'` and adds back work-order-form rows (`'19211681019715469179247390'` and `'19211681019715329305562620'`). + +**Invocation:** Status: appears orphaned. No form-master, gdsmodule, other-routine, or xly-src caller (the matching `xly-src/script/标版/30000101/GetMaterialsAuxiliaryQty.sql` is the definition itself). Sibling of the substantive `Fun_GetMaterialsQtyUnit` family — appears to be an earlier capitalized name retained but unwired. Hardcodes tenant-specific `sFormId` GUIDs. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/GetMaterialsPrice.md b/en/docs/auto-catalog/functions/GetMaterialsPrice.md index a5d4eec..52b2490 100644 --- a/en/docs/auto-catalog/functions/GetMaterialsPrice.md +++ b/en/docs/auto-catalog/functions/GetMaterialsPrice.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Canonical materials-price lookup — returns the price for a `EleMaterials.sId` according to the per-tenant `CbxOfferMaterials` setting (which of four price columns to use). Used wherever a routine needs "the price of this material right now" for 报价/工单/采购 cost calculations. + +**What it does:** reads `SysSystemSettings.CbxOfferMaterials` into `iType`, then `SELECT`s one of four price columns from `EleMaterials` keyed by `(sId, sBrandsId, sSubsidiaryId)`: `0`→`dPurchasePrice` (采购价), `1`→`dRecentPurchasePrice` (最近采购价), `2`→`dDesignateSalesPrice` (指定销售价), `3`→`dSalesPrice` (销售价). Returns 0 for empty input or missing rows. Ignores the declared `sMaterialsStyle` parameter — pricing is keyed only on `sId`. + +**Invocation:** referenced by 17+ stored routines including the entire `Sp_Quotation_CalcData*` and `Sp_WorkOrder_CalcData*` cost-build family (`Std`/`Flex`/`Book`/`Pack`/`Set`/`LastStd`/`zr` variants), `Sp_Inventory_MaterialsInventoryV56Price` and `Sp_Manufacture_sWodPurchareMaterials_copy1`. Wrapped by `Fun_Cashier_GetMaterialsPrice_Quo`. Form-side: embedded in the 采购申请→采购订单 conversion form (sId `192116810113315263819752160`) and the OEE 待入库客来料任务列表 (sId `101251240115016347243410860`). Also referenced in xly-src `Sp_financial_OrderGrossProfit`/`CustomerGrossProfit`/`SaleManGrossProfit` (margin reports). diff --git a/en/docs/auto-catalog/functions/GetNextMachine.md b/en/docs/auto-catalog/functions/GetNextMachine.md index daf4fa5..69d0ade 100644 --- a/en/docs/auto-catalog/functions/GetNextMachine.md +++ b/en/docs/auto-catalog/functions/GetNextMachine.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 得到后道工序的机台 — for a given work-order process (`uGuid`, `uProcessGuid`, optionally `sControlId`), returns the space-separated list of distinct machine names assigned to the **next** process in the same control-group. Used by 产量上报 / OEE 报工 / 巡检 reports to show operators which downstream machine the current process feeds into. + +**What it does:** in `MftWorkOrderProcess`, looks up the current process's `iOrder` and `sType`; finds the next process (next-higher `iOrder` under the same `sParentId` + `sControlId`). Then in `MftProductionPlanSlave` it `group_concat`s the distinct `elemachine.sMachineName` rows matching that next process (or, when `sType='0'`, the whole control group's `stype='1'` plan slaves). Two branches: with-control-id and without-control-id (treats the work order as one flat sequence). + +**Invocation:** referenced by `Sp_Manufacture_PlanReport`, `Sp_Manufacture_ProcessReport`, `Sp_Manufacture_ProductionReport`, `Sp_Manufacture_Report`, `Sp_OEE_PlanByProcess`, `Sp_OEE_ProductionReport`, `Sp_OEE_ProductionReportAll`. Also referenced in xly-src scripts for `Sp_Mobile_PatrolInspection`, `Sp_PC_PatrolInspection`, `Sp_Mobile_Inspection`. Companion of `GetPriorProcess` (prior-direction lookup) and `GetPriorPlate` (prior-plate lookup). diff --git a/en/docs/auto-catalog/functions/GetPriorPlate.md b/en/docs/auto-catalog/functions/GetPriorPlate.md index 643bb83..f7f7866 100644 --- a/en/docs/auto-catalog/functions/GetPriorPlate.md +++ b/en/docs/auto-catalog/functions/GetPriorPlate.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 得到模具或蓝纸准备情况 — for an APS gantt row (a `MftProductionPlanSlave`), returns a one-line preparation-status string for the **prior** plate/mould/proof step. Examples: `"模切刀(外)发外"`, `"调墨OK 12号08:30(3)"`, `"组 专色待调"`, `" 待发外"`. Drives the "状态" column on APS scheduling boards so planners see whether the mould / blueprint / ink is ready before letting the current job start. + +**What it does:** reads the current `MftWorkOrderProcess` row to get `sType` and process name. Branches on process name keyword (`模切`/`凹凸`/`烫金` → look up the prior `刀版`/`模具` step in `mftworkorderprocess`; otherwise → look up the prior `蓝纸`/`制版` step). For each candidate prior step, joins to `opsoutsideprocessmaster`/`opsoutsideinstoreslave` to check outsourcing-receipt status, and to `mftproductionplanslave` to check `tMakeup` (ink-mixing done time). Composes a Chinese status fragment depending on what's missing. For the special `sType='1'` ink-prep case, formats `调墨OK(组)` or `组 专色待调`. + +**Invocation:** referenced by `Sp_Manufacture_GetAPSState` (the APS state-column builder used by 排产 gantt). Also referenced in xly-src `schedule/Sp_Manufacture_GetAPSstate.sql`. Companion of `GetPriorProcess`, `GetPriorProcessPlan`, and `GetNextMachine` — the family of upstream/downstream context functions for APS rows. diff --git a/en/docs/auto-catalog/functions/GetPriorProcess.md b/en/docs/auto-catalog/functions/GetPriorProcess.md index c13df84..3b1ae43 100644 --- a/en/docs/auto-catalog/functions/GetPriorProcess.md +++ b/en/docs/auto-catalog/functions/GetPriorProcess.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 得到前道工序 — for a given work-order process row, returns a one-line "prior process" label with a status symbol so 产量上报 / OEE 报工 / APS gantt screens can show at a glance whether the upstream step is done. Glyph legend: `★` = upstream produced output (`dProductionReportQty>0`), `◎` = upstream's downstream is in state `2`, `☆` = pending. Outsourced steps get a `(外)` suffix. + +**What it does:** reads the current row's `iOrder`/`sType`/process-name from `MftWorkOrderProcess` (treating `sType='3'` rows as `iOrder+10000`). Empty result for cutting/制作 leaf steps. For `sType` 0/1/2 picks the largest-`iOrder` row that is upstream within the same control group and composes ``. For `sType='3'` (special control-group type), it falls back to a control-group view: either reports the prior `sType='3'` step or aggregates completion (`★全部完工` or `☆完工/`) across auto-arrange (`bAutoArrange=1`) processes upstream. + +**Invocation:** referenced by `Sp_Manufacture_PlanReport`, `Sp_Manufacture_ProcessReport`, `Sp_Manufacture_ProductionPlanInfo12`, `Sp_Manufacture_ProductionReport`, `Sp_Manufacture_Report`, `Sp_OEE_PlanByProcess`, `Sp_OEE_ProductionReport`. Companion of `GetNextMachine` (downstream-machine list), `GetPriorPlate` (mould/proof preparation), and `GetPriorProcessPlan` (prior step's plan-side info). Caveat: one branch references `@uGuid`/`@sCurProcessName` (session vars) instead of the proc-local `uGuid`/`p_sCurProcessName` — the auto-arrange count branch will always see those vars as `NULL` unless the caller set them, suggesting copy-paste bug. diff --git a/en/docs/auto-catalog/functions/GetPriorProcessPlan.md b/en/docs/auto-catalog/functions/GetPriorProcessPlan.md index df8b81d..f871c68 100644 --- a/en/docs/auto-catalog/functions/GetPriorProcessPlan.md +++ b/en/docs/auto-catalog/functions/GetPriorProcessPlan.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 得到上道工序生产情况 — for a current APS gantt row, builds the "prior process production status" text the planner sees on the schedule board. Shape: `-(qty)/` or `-未生产/无计划` if the upstream step has neither been reported nor scheduled. Walks back through 蓝纸确认 → 文件制作 → upstream `sType<3` steps in priority order so the planner always sees the most relevant blocker first. + +**What it does:** reads the current `MftWorkOrderProcess` row (`iOrder`, `sType`, `sCombinePartsName`). When `sType='1'` (印刷/main process), looks for prior steps with `eleprocess.sProcessPhase = '蓝纸确认'` in the same control group, joins to the matching `mftproductionplanslave` row (`sWorkOrderProcessTbId` match), formats `processName-<报工时间(qty)>/<计划时间>`. If nothing useful is found, falls back to `文件制作`, then to any non-control prior step, then (when `sCombinePartsName` is set) widens to combined parts via `mftworkordercontrolcombine`. Each fallback uses the same `(@rownum/@rank/@sPsId)` ranking trick to pick the latest row per control group. + +**Invocation:** referenced by `Sp_Manufacture_GetAPSState` — embedded in the APS state-column builder alongside `GetPriorPlate` and `GetPriorProcess`. Same module path: `工作中心 → 生产管理 → 排产` (APS gantt). Also referenced in xly-src `script/标版/30100101/schedule/Sp_Manufacture_GetAPSstate.sql`. diff --git a/en/docs/auto-catalog/functions/IsNumeric.md b/en/docs/auto-catalog/functions/IsNumeric.md index 4cc73b7..309f409 100644 --- a/en/docs/auto-catalog/functions/IsNumeric.md +++ b/en/docs/auto-catalog/functions/IsNumeric.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** SQL-Server `IsNumeric` polyfill — returns `1` when `str` is a (signed) numeric literal, `0` otherwise. Used as a guard before casting user-entered specs/qty strings to numbers; the unit-conversion family (`Fun_GetAuxiliaryQtyUnit`, `Fun_GetMaterialsQtyUnit`, `Fun_GetMaterialsQtyUnitSupple`, `Fun_GetReelAuxiliaryQtyUnit`, `Fun_GetProcessAuxiliaryQty`) calls it before doing arithmetic on free-form `sName`-style label fields. + +**What it does:** returns `0` for `NULL` or empty input. Otherwise tests `str REGEXP '-?[1-9]d*$'` and `str REGEXP '-?[0-9]+(.[0-9]{1,3})?$'`; returns `1` if either matches. Note: both regexes are subtly wrong — `d` and `.` are unescaped (MySQL `REGEXP` interprets `d` as the literal char and `.` as any char), so the first regex actually accepts strings ending in a digit-followed-by-`d` runs, and the second accepts any digit run with up to 3 trailing characters. In practice the second pattern is loose enough that genuine numeric strings still get a `1`, which is why callers haven't noticed. + +**Invocation:** referenced by 30+ routines — the entire `Fun_Get*QtyUnit*` family, `Sp_BillOfApply`/`ApplyLine`/`NoPicking`/`NoPicking_Cljg`, `Sp_GetMachineByApsRule`, `sp_GetMaterialsQtyUnit`, `Sp_Manufacture_InsertWorkOrder`, `Sp_Manufacture_sSodPurchareMaterials`, `Sp_Manufacture_sWodPurchareMaterials_copy1`, `Sp_MaterialsStoreVirtual`, `Sp_Quotation__CalcDataPackLastStd`. Canonical "is this string a number?" guard for the BOM/cost build chain. Caveat (regex escaping): see body note above — flag for maintainer audit. diff --git a/en/docs/auto-catalog/functions/JSON_MERGE_REPLACE.md b/en/docs/auto-catalog/functions/JSON_MERGE_REPLACE.md index f7fdba0..6077d22 100644 --- a/en/docs/auto-catalog/functions/JSON_MERGE_REPLACE.md +++ b/en/docs/auto-catalog/functions/JSON_MERGE_REPLACE.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Polyfill for MySQL 8's `JSON_MERGE_PATCH` semantics on MySQL 5.7 — given two JSON objects, returns object 1 with object 2's keys overlaying it (each key from 2 *replaces* the same key from 1, instead of stacking into an array like the built-in `JSON_MERGE` does). Used by the dynamic-column-config layer that overlays per-user column-display tweaks on top of the system default config. + +**What it does:** validates both inputs are JSON. Iterates `JSON_KEYS(sJsonTwo)`; for each key, extracts its value from `sJsonTwo`, removes the same key from `sJonsOne` if present, then `JSON_MERGE`s the single-key object back in. Returns the rebuilt object. Loop body strips surrounding quotes from the extracted value unless it contains `{` (preserves nested objects). + +**Invocation:** referenced by `Fun_get_show_config_basic` — the baseline column-config resolver in the dynamic-report-column family (`Fun_get_show_config*`). Also surfaced in xly-src `script/标版/upgrade/动态配置返回函数/`. Header comment `如果2中的值1中存在,提供1胡` is truncated/garbled — function actually does the opposite (keys from 2 win over keys from 1). diff --git a/en/docs/auto-catalog/functions/NewId2.md b/en/docs/auto-catalog/functions/NewId2.md index bed7b82..72d665d 100644 --- a/en/docs/auto-catalog/functions/NewId2.md +++ b/en/docs/auto-catalog/functions/NewId2.md @@ -19,4 +19,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Variant id-generator that swaps the random and timestamp halves of `newId` — emits `'1' + 8-digit-rand + 9-digit-rand + 14-char-timestamp`, so the leading digits are random rather than the current date. Header is copy-pasted from `newId` and is again wrong about the length (the body produces 32 chars, not 27). + +**What it does:** returns `CONCAT('1', CEILING(RAND()*9e7+1e7), CEILING(RAND()*9e8+1e8), DATE_FORMAT(NOW(),'%Y%m%d%H%i%s'))` — 1 + 8 + 9 + 14 = 32 numeric chars. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep). Live id generation flows through `newId` (137 callers). Likely a variant developers prototyped but never adopted — candidate for maintainer audit / deletion. diff --git a/en/docs/auto-catalog/functions/Sp_Sis_GetMertialsInventoryFormGuid.md b/en/docs/auto-catalog/functions/Sp_Sis_GetMertialsInventoryFormGuid.md index 8d24062..4ad060c 100644 --- a/en/docs/auto-catalog/functions/Sp_Sis_GetMertialsInventoryFormGuid.md +++ b/en/docs/auto-catalog/functions/Sp_Sis_GetMertialsInventoryFormGuid.md @@ -18,4 +18,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Inventory-direction classifier for materials transactions — given a `sFormId` (the form/document type that triggered the move), returns `'0'` for in-store movements (入库类: 采购入库, 退货入库, 委外回收入库, 客来料入库, etc.), `'1'` for out-store movements (出库类: 领料, 退料, 委外发料, 销售出库, etc.). The hardcoded sId lists embed the standard xly inventory form-types — each placeholder slot tagged `后续增加` reserves room for client-defined custom forms. Used by the materials in/out store calculation chain to pick the right qty-direction sign. + +**What it does:** keeps two long string lists (`sInSql` and `sOutSql`) of form-guid literals; runs `LOCATE(sFormId, ...)` against each; returns `'0'` if the form is in the in-store list, `'1'` if in the out-store list, `NULL` otherwise. Despite the `Sp_` prefix this is a **function** (returns `varchar(1)`); the sibling `Sp_Sis_GetMertialsInventoryFormGuid` *procedure* exists separately with the same name. + +**Invocation:** referenced by 20+ materials-stock routines including `Sp_calc_materialsstoreLimit`, `Sp_check_MaterialsStockLimitNew`, the entire `Sp_Inventory_InOutStore*`/`SP_Inventory_InOutWarehouse*` family, `Sp_Inventory_MaterialsInOutStoreDoing`, `Sp_Inventory_MaterialsInventory_Outdated`, `SP_Inventory_ProductInOutWarehouseCost/Money`, `Sp_MaterialAgingAnalysis_detail`, `Sp_System_AutoMaterialsPriceSingle`, `Sp_System_CalcMaterialsPrice*`. Also referenced in `script/标版/upgrade/.../Sp_Calc_sPis.sql`. Misnamed: the `Sp_` prefix and the catalog filename both suggest a procedure, but this is a function — the actual procedure version is a separate routine. Caveat: hard-coded sId lists must be updated by hand when new form types are added; clients deploying with extra inventory forms need the function rewritten. diff --git a/en/docs/auto-catalog/functions/Stuff.md b/en/docs/auto-catalog/functions/Stuff.md index f6f8e7f..04c7cd5 100644 --- a/en/docs/auto-catalog/functions/Stuff.md +++ b/en/docs/auto-catalog/functions/Stuff.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 使用字符串替换从指定位置开始指定长度的字符,返回新字符串 — SQL-Server `STUFF` polyfill. Removes a `length`-character window starting at `startIndex` from `str` and splices `Newstr` in its place. Used by the formula-replacement engine to substitute placeholders inside cost-formula strings at known offsets. + +**What it does:** returns `CONCAT(LEFT(str, startIndex-1), Newstr, RIGHT(str, ...))`. The right-hand slice uses `LOCATE(SUBSTR(str, startIndex, length), str)` instead of the simpler `startIndex + length`, so when the deleted substring also occurs *earlier* in `str` the function would slice from the earlier occurrence (subtle bug — only safe when the substring is unique or the first occurrence is exactly at `startIndex`). + +**Invocation:** referenced by the auto-send-check-message + formula-replace family: `Sp_System_AutoSendCheckMsg`, `Sp_System_ReplaceField`, `Sp_System_ReplaceFieldNew`, `Sp_System_ReplaceField_Detail`, `Sp_System_ReplaceField_NEW`, `Sp_System_ReplaceField_NEW_ACT`. Also referenced in xly-src upgrade scripts under `script/标版/upgrade/20220111公式解析实际详情/` and `20220321计算获取公式解析/`. No form-master binding — strictly an internal string helper. diff --git a/en/docs/auto-catalog/functions/fun_GetPreProcessQty.md b/en/docs/auto-catalog/functions/fun_GetPreProcessQty.md index 57e68fe..c65af7f 100644 --- a/en/docs/auto-catalog/functions/fun_GetPreProcessQty.md +++ b/en/docs/auto-catalog/functions/fun_GetPreProcessQty.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Previous-process production-reported-qty lookup — for a given work-order process row, finds its upstream process (via `Fun_up_workOrderProcessId`) and returns that upstream's reported output: `dProductionReportQty + dOpsProductionReportQty`, falling back to `dProcessOutQty` when no report exists, with adjustment-rate / single-piece-qty multipliers applied for the assembly-process case. Catalog header: `获取工单上工序报工数`. + +**What it does:** Calls `Fun_up_workOrderProcessId(p_sWorkOrderProcessTbId, p_sType, p_sWorkOrderId)` to resolve the predecessor `sId`; reads the current row's `sProcessId`/`dAdjustRate`/`sControlId`; branches on `p_sType` (3 / 0 / other); when other and `sProcessId='1691254111216986535515270'` with zero adjust-rate, multiplies by `mftworkordercontrol.dSinglePQty`, otherwise multiplies by `IF(dAdjustRate=0,1,dAdjustRate)`. Returns the resulting decimal. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep) — candidate for maintainer audit. The hardcoded `sProcessId` literal indicates an in-flight branch tied to one specific process record (likely a 装配 / assembly process); without a caller the function is currently inert. diff --git a/en/docs/auto-catalog/functions/fun_getNextMonth_lasterWeekday.md b/en/docs/auto-catalog/functions/fun_getNextMonth_lasterWeekday.md index ec40e4b..fb8b85c 100644 --- a/en/docs/auto-catalog/functions/fun_getNextMonth_lasterWeekday.md +++ b/en/docs/auto-catalog/functions/fun_getNextMonth_lasterWeekday.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** "Last *iDay*-of-week in the month after `tDate`" calculator — e.g. given any date, return next month's last Monday, last Saturday, etc. Used in scheduled-cut / 自动裁纸 procedures that need to set a recurring monthly reference date. + +**What it does:** Adds 1 month to `tDate`, takes `LAST_DAY`, computes that month-end's weekday (`WEEKDAY+1`, Mon=1…Sun=7), then steps back so the result is on the requested `iDay` weekday — falling into the prior week when `iDay` exceeds the month-end's weekday. + +**Invocation:** Called by `Sp_Calc_sEmt` — the `sEmt` (estimated material cut / 自动估算) calculation procedure. No other callers found. diff --git a/en/docs/auto-catalog/functions/fun_getWorkProcess_NextId.md b/en/docs/auto-catalog/functions/fun_getWorkProcess_NextId.md index 0437b05..699479b 100644 --- a/en/docs/auto-catalog/functions/fun_getWorkProcess_NextId.md +++ b/en/docs/auto-catalog/functions/fun_getWorkProcess_NextId.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Next work-order-process probe — for a given work-order + control-row, returns the `sId` of the first `mftworkorderprocess` whose `sType < 3` (intermediate stage). Falls back to the first `sType=3` (成品) step when no intermediate exists. Used by parts/components std-calc routines to figure out "which process picks up this material next?" + +**What it does:** `SELECT sId FROM mftworkorderprocess WHERE sParentId=p_sWorkOrderId AND sControlId=p_sWorkOrderControlId AND sType<3 ORDER BY iOrder LIMIT 1`; on empty, retries with `sType=3`. + +**Invocation:** referenced by `Sp_WorkOrder_CalcDataPackPartsStd_child` (work-order parts/component standards aggregator). No form-master or gdsmodule hook reaches it directly — it is a building block of the parts-std calc chain. diff --git a/en/docs/auto-catalog/functions/fun_getWorkProcess_NextIdnew.md b/en/docs/auto-catalog/functions/fun_getWorkProcess_NextIdnew.md index 5bc0942..83ea001 100644 --- a/en/docs/auto-catalog/functions/fun_getWorkProcess_NextIdnew.md +++ b/en/docs/auto-catalog/functions/fun_getWorkProcess_NextIdnew.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** AGV-aware variant of [`fun_getWorkProcess_NextId`](fun_getWorkProcess_NextId.md) — finds the next intermediate work-order-process step **excluding any process whose `eleprocess.bEffectAGV = 0`** (i.e. drops processes that AGV routing should skip). Starts from a `mftworkorderslave.sId` (resolves it to its parent work-order first) instead of the work-order id directly. + +**What it does:** resolves `mftworkorderslave.sParentId` → `p_sWorkOrderId`. Joins `mftworkorderprocess` to `eleprocess` filtering `EP.bEffectAGV=0`, then picks the first `sType<3` step matching the given `sControlId`. Falls back to first `sType=3` (成品) step when no intermediate match. + +**Invocation:** referenced by `Sp_WorkOrder_CalcDataPackPartsStd_child` alongside the non-`new` variant. No other routine, form-master sSqlStr, gdsmodule hook, or xly-src reference reaches it. diff --git a/en/docs/auto-catalog/functions/fun_getWorkProcess_NextQty.md b/en/docs/auto-catalog/functions/fun_getWorkProcess_NextQty.md index cb774fc..860a670 100644 --- a/en/docs/auto-catalog/functions/fun_getWorkProcess_NextQty.md +++ b/en/docs/auto-catalog/functions/fun_getWorkProcess_NextQty.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Next-process input-quantity probe — for a given `mftworkordercontrol.sId`, returns the `dProcessInQty` (next-process input quantity / 下道工序投入数) of the first finished-process (`sType=3`) step in the same work-order. Used by work-order standards-aggregator routines that need to plan how much of a finished product the next stage consumes. + +**What it does:** `SELECT sParentId FROM mftworkordercontrol WHERE sId=p_sWorkOrderControlId` → `p_sWorkOrderId`, then `SELECT dProcessInQty FROM mftworkorderprocess WHERE sParentId=p_sWorkOrderId AND sType=3 ORDER BY iOrder LIMIT 1`. + +**Invocation:** referenced by `Sp_Calc_sWod` (work-order delivery 工单delivery std-calc), `Sp_WorkOrder_CalcDataPackLastStd` and `Sp_WorkOrder_CalcDataPackProductStd`. Building block of the work-order calc chain. diff --git a/en/docs/auto-catalog/functions/fun_getWorkProcess_Next_WareHouseNo.md b/en/docs/auto-catalog/functions/fun_getWorkProcess_Next_WareHouseNo.md index 9680480..0744e8f 100644 --- a/en/docs/auto-catalog/functions/fun_getWorkProcess_Next_WareHouseNo.md +++ b/en/docs/auto-catalog/functions/fun_getWorkProcess_Next_WareHouseNo.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Next-process warehouse location probe — for a given work-order process row (`p_workorderprocessId`), returns the `sWareHouseNo` (库区 / warehouse-zone) of the **next** process step from `mftproductionplanslave`. Used by AGV / 库区 routing logic to know where the next-stage WIP should be staged. + +**What it does:** uses correlated row-numbering on `mftworkorderprocess` to find the current step's order, then picks the next step in the same control. Branches on `p_sType`: non-`3` paths walk within the control-id `mftworkordercontrol` join; `3` (成品 / finished) walks within `sType=3` steps directly. Falls back to "first finished-process step" if no next step exists. Once a next process `sId` is found, looks up `mftproductionplanslave.sWareHouseNo` matching that `(sWorkOrderId, sWorkOrderProcessTbId)`. + +**Invocation:** no form-master sSqlStr, gdsmodule hook, other routine, or xly-src reference uses this function — only an xly-src `script/标版/30000101/fun_getWorkProcess_Next_WareHouseNo.sql` install file. Status: appears orphaned. No live caller in any channel — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/fun_get_jurisdiction.md b/en/docs/auto-catalog/functions/fun_get_jurisdiction.md index ccd8302..8ae89f9 100644 --- a/en/docs/auto-catalog/functions/fun_get_jurisdiction.md +++ b/en/docs/auto-catalog/functions/fun_get_jurisdiction.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Permission gate helper — given a user id and a target model/module id, returns 1 if the user is allowed to operate on it, else 0. The comment header `获取盒型图片` ("get box-type image") is incorrect/copy-paste residue; the actual body reads `sftlogininfo` and `sftlogininfojurisdictiongroup × sysjurisdiction` to authorize. + +**What it does:** if `sftlogininfo.sType = 'sysadmin'` for the user, returns 1 unconditionally. Otherwise concatenates all `sysjurisdiction.sKey` values granted to the user (via `sftlogininfojurisdictiongroup`) where `sAction <> ''`, and returns 1 iff `sModelId` appears in that concatenated key list. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, exhaustive xly-src grep across all extensions) — candidate for maintainer audit. Permission checking in production flows through `BusinessBaseService` / Java filters, not this function. diff --git a/en/docs/auto-catalog/functions/fun_getaccordercostanalysiscost_diff.md b/en/docs/auto-catalog/functions/fun_getaccordercostanalysiscost_diff.md index b36797e..eed0b39 100644 --- a/en/docs/auto-catalog/functions/fun_getaccordercostanalysiscost_diff.md +++ b/en/docs/auto-catalog/functions/fun_getaccordercostanalysiscost_diff.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Cost-accounting variance helper — `获取成本误差`. Compares one expense column on `accexpenseentrydepartmentmaster_dif` (the per-workcenter cost-difference ledger) against the booked expense amount and returns the residual. + +**What it does:** reads `dTotalMoney` from `accexpenseentrydepartmentmaster_dif` keyed by `sColumnName` + `sWorkCenterId`. If non-zero, returns `dTotalMoney - p_dExpenseMoney`; otherwise returns 0. + +**Invocation:** called from `Sp_CostAccount_WorkCenterToOperation_Event` (work-center → operation cost-allocation event) and `Sp_System_ProductionCost` (production-cost rollup) — both part of the cost-accounting subsystem (`Sp_System_ProductionCost` itself has `Sp_System_ProductionCostBak`, `_new`, `_24222`, `Test` siblings indicating active iteration). diff --git a/en/docs/auto-catalog/functions/fun_getreportId_byArrMaterialsType.md b/en/docs/auto-catalog/functions/fun_getreportId_byArrMaterialsType.md index dcf4255..62f544c 100644 --- a/en/docs/auto-catalog/functions/fun_getreportId_byArrMaterialsType.md +++ b/en/docs/auto-catalog/functions/fun_getreportId_byArrMaterialsType.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Customer-specific report-id dispatch — the `到货` (goods-arrival / 到货单) variant of `fun_getreportId_byMaterialsType`. Maps a materials-class flag (`paper` vs everything-else) onto one of two hard-coded `report.sId` GUIDs so a workflow can pick the right Jasper/print template per material class. + +**What it does:** `IF p_sMaterialsType='paper' RETURN '17049...'` (纸张 report) else `RETURN '17047...'` (辅料 report). + +**Invocation:** no form-master sSqlStr, gdsmodule hook, other routine, or xly-src reference uses this function. Status: appears orphaned. No caller found in any channel — candidate for maintainer audit. The hard-coded report `sId`s are tenant-specific and would silently break if reused elsewhere. diff --git a/en/docs/auto-catalog/functions/fun_getreportId_byMaterialsType.md b/en/docs/auto-catalog/functions/fun_getreportId_byMaterialsType.md index b5823cd..f1c4e4f 100644 --- a/en/docs/auto-catalog/functions/fun_getreportId_byMaterialsType.md +++ b/en/docs/auto-catalog/functions/fun_getreportId_byMaterialsType.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Materials-class report-id dispatch — sibling of [`fun_getreportId_byArrMaterialsType`](fun_getreportId_byArrMaterialsType.md), maps a materials-class flag (`paper` vs everything-else) onto one of two hard-coded `report.sId` GUIDs so the print/print-export step can pick a class-appropriate template. The `byArr*` sibling targets a different document context (到货/goods-arrival); this one is the general-purpose materials variant. + +**What it does:** `IF p_sMaterialsType='paper' RETURN '17013...'` (纸张 report) else `RETURN '17107...'` (辅料 report). + +**Invocation:** no form-master sSqlStr, gdsmodule hook, other routine, or xly-src reference uses this function. Status: appears orphaned. No caller found in any channel — candidate for maintainer audit. Tenant-specific report `sId`s. diff --git a/en/docs/auto-catalog/functions/fun_getreportId_bycus.md b/en/docs/auto-catalog/functions/fun_getreportId_bycus.md index e2b85d4..74fbaf5 100644 --- a/en/docs/auto-catalog/functions/fun_getreportId_bycus.md +++ b/en/docs/auto-catalog/functions/fun_getreportId_bycus.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Customer-specific print-report dispatch — maps a customer `sId` (or a "source-customer" `sId`, for re-billed orders) onto one of ~14 hard-coded `report.sId` GUIDs, falling back to a generic report. Functionally a per-tenant lookup table cooked into procedural form, naming customers like `嘉年实业(香港)`, `深圳烟草工业`, `国药集团致君`, `深圳市浩瀚卓越`, `金进精密科技`, `伟易达`, `美律电子`, etc. + +**What it does:** sequence of `ELSEIF p_sCustId = '' THEN RETURN ''` clauses with a final `ELSE` for everyone else. Reads no tables. + +**Invocation:** no form-master sSqlStr, gdsmodule hook, other routine, or xly-src reference uses this function. Status: appears orphaned. No caller found in any channel — candidate for maintainer audit. The hard-coded customer + report `sId`s are tenant-specific; would silently miss-route if copied to a different deployment. diff --git a/en/docs/auto-catalog/functions/fun_gettzreportId_bycus.md b/en/docs/auto-catalog/functions/fun_gettzreportId_bycus.md index 1b54307..d995aa1 100644 --- a/en/docs/auto-catalog/functions/fun_gettzreportId_bycus.md +++ b/en/docs/auto-catalog/functions/fun_gettzreportId_bycus.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Customer-specific 通知 (tz / `tz` likely "通知" / notification) print-report dispatch — sibling of [`fun_getreportId_bycus`](fun_getreportId_bycus.md). Same shape, same 14 hard-coded customer `sId`s, but returns a different set of report `sId`s tied to a notification/通知 document flow. + +**What it does:** sequence of `ELSEIF p_sCustId = '' THEN RETURN ''` clauses, with a final `ELSE` for non-listed customers. Reads no tables. + +**Invocation:** no form-master sSqlStr, gdsmodule hook, other routine, or xly-src reference uses this function. Status: appears orphaned. No caller found in any channel — candidate for maintainer audit. Tenant-specific customer + report `sId`s. diff --git a/en/docs/auto-catalog/functions/fun_workmaterials_used.md b/en/docs/auto-catalog/functions/fun_workmaterials_used.md index 045b57e..21fbed2 100644 --- a/en/docs/auto-catalog/functions/fun_workmaterials_used.md +++ b/en/docs/auto-catalog/functions/fun_workmaterials_used.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Work-order downstream-usage check — for a given `mftworkordermaterials.sId`, returns a human-readable string naming the first bill that consumed this work-order material (purchase order, production picking). Header gloss: "工单材料使用情况". Used to block deletes/edits when material rows have already been transacted. + +**What it does:** Queries `viw_purpurchaseorderdetail` for a `sSrcSlaveId` match → returns `'采购订单使用:'`. Otherwise queries `viw_mitproductionmaterials` → returns `'生产领料使用:'`. Empty string if neither hit. + +**Invocation:** Orphan-via-dead-chain. Only routine caller is `Sp_WorkOrder_CheckUpdateNew`, which itself has no caller (no module hook, no form-master, no xly-src reference). The sibling `fun_workprocess_used` / `fun_workproduct_used` form a parallel "is-used" check trio that all funnel into the same dead `Sp_WorkOrder_CheckUpdateNew`. Bug suspect: second IF tests `p_sUsed` instead of `p_sUsed2`, so the production-picking branch never returns — confirm before re-wiring. diff --git a/en/docs/auto-catalog/functions/fun_workprocess_used.md b/en/docs/auto-catalog/functions/fun_workprocess_used.md index 0cf57a6..fbea0e0 100644 --- a/en/docs/auto-catalog/functions/fun_workprocess_used.md +++ b/en/docs/auto-catalog/functions/fun_workprocess_used.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Work-order process-step usage check — for a given `mftworkorderprocess.sId`, returns a human-readable string naming the first downstream bill that has already used this process row (production-report or outside-process dispatch). Used to block deletes/edits of process rows that have already been transacted. Header gloss is mis-copied from the materials variant ("工单材料使用情况"). + +**What it does:** Queries `viw_MftProductionReport` joined to `mftproductionplanslave` for a `sWorkOrderProcessTbId` match → returns `'已产量上报:'`. Otherwise queries `Viw_OpsOutsideProcess` → returns `'工序已发外:'`. Empty string if neither hit. + +**Invocation:** Orphan-via-dead-chain. Only caller `Sp_WorkOrder_CheckUpdateNew` itself has no caller (no module hook, no form-master, no xly-src reference). Companion to `fun_workmaterials_used` and `fun_workproduct_used`. diff --git a/en/docs/auto-catalog/functions/fun_workproduct_used.md b/en/docs/auto-catalog/functions/fun_workproduct_used.md index 22cbc2e..ce1942a 100644 --- a/en/docs/auto-catalog/functions/fun_workproduct_used.md +++ b/en/docs/auto-catalog/functions/fun_workproduct_used.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Work-order finished-product usage check — for a given `mftworkorderslave.sId`, returns a human-readable string naming the first downstream bill (finished-goods put-away or customer receipt) tied to that slave row. Header gloss: "工单从表使用情况". + +**What it does:** Looks for the slave row's sId in `Viw_PitProductInStore.sSrcSlaveId` → returns `'成品入库:'`. Otherwise checks `viw_cahreceipt.sSrcSlaveId` → returns `'收款单:'`. Empty string if neither hit. + +**Invocation:** Status: appears orphaned. No routine, form-master, gdsmodule, or xly-src caller. Companion to `fun_workmaterials_used` / `fun_workprocess_used` — the trio was clearly designed for a save-time "can-delete?" gate on the work-order edit form, but the consuming `Sp_WorkOrder_CheckUpdateNew` proc is itself unhooked, leaving this function with no live path. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/functions/get_config_data.md b/en/docs/auto-catalog/functions/get_config_data.md index b7bd811..3691471 100644 --- a/en/docs/auto-catalog/functions/get_config_data.md +++ b/en/docs/auto-catalog/functions/get_config_data.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Per-user dropdown-label resolver. Given a `gdsconfigformslave.sId` (a single dropdown row) and a JSON key, returns the localized display value matching the user's `sftlogininfo.sLanguage` setting. + +**What it does:** Reads `sLanguage` from `sftlogininfo` for `sUserId` (default `'sChinese'`), then selects `sChineseDropDown` / `sBig5DropDown` / `sEnglishDropDown` from the `gdsconfigformslave` row, and returns `JSON_UNQUOTE(JSON_EXTRACT(dropdown, '$.'))`. + +**Invocation:** Status: appears orphaned. No form-master, gdsmodule, other-routine, or xly-src caller. Candidate for maintainer audit — overlaps `Fun_Sis_GetConstNew` which is the live i18n path. diff --git a/en/docs/auto-catalog/functions/get_config_data_JSON.md b/en/docs/auto-catalog/functions/get_config_data_JSON.md index 1f13b2a..f17dec3 100644 --- a/en/docs/auto-catalog/functions/get_config_data_JSON.md +++ b/en/docs/auto-catalog/functions/get_config_data_JSON.md @@ -19,4 +19,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Sibling of `get_config_data` — returns the whole language-matched dropdown JSON instead of a single key's value. **Hard-codes `iIncrement = 1509089`** so the `sConfigSlaveId` parameter is ignored entirely. + +**What it does:** Reads `sftlogininfo.sLanguage` for `sUserId` (default `'sChinese'`), then returns the corresponding `sChineseDropDown` / `sBig5DropDown` / `sEnglishDropDown` of `gdsconfigformslave` row `iIncrement = 1509089`. The expected per-key JSON_EXTRACT is commented out, so the raw JSON is returned. + +**Invocation:** Status: appears orphaned. No form-master, gdsmodule, other-routine, or xly-src caller. Candidate for maintainer audit — the hardcoded `iIncrement` literal and unused `sConfigSlaveId` parameter strongly suggest this is debug scaffolding. diff --git a/en/docs/auto-catalog/functions/newId.md b/en/docs/auto-catalog/functions/newId.md index 287fe59..d59fa58 100644 --- a/en/docs/auto-catalog/functions/newId.md +++ b/en/docs/auto-catalog/functions/newId.md @@ -19,4 +19,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生成27位纯数字的ID 模仿后台Java代码生成 — canonical primary-key generator on the SQL side. Mirrors xly's Java-side `Sid.java` "all-numeric 27-char id" convention so a `CALL` inside a stored proc / form `sSqlStr` produces an `sId` indistinguishable from one minted by `BusinessBaseService.add(...)`. Whenever a routine has to insert a row but the caller didn't pass a guid, it uses this. + +**What it does:** returns `CONCAT( DATE_FORMAT(NOW(),'%Y%m%d%H%i%s') , CEILING(RAND()*9e7+1e7) , CEILING(RAND()*9e9+1e9) )` — a 14-char timestamp prefix + an 8-digit and a 10-digit random suffix, producing 32 numeric digits as a `varchar(32)`. Caveat: collision probability is non-zero (RAND-based), and the catalog header claims 27 digits while the body yields 32 — the gap matters when callers truncate or hash the id. + +**Invocation:** referenced by **137 stored routines** — every `Sp_Ai_*`, `Sp_addBtn_gdsmodle`, `sp_addCustomer`, `Sp_Add_Flow`, `Sp_Bill_Force_Complete`, `Sp_calc_*storeLimit`, `Sp_Calc_sWod`, `Sp_Cashier_*Journal`, `Sp_Check_s*` insert-path, `Sp_Con_*Reset`, `Sp_CostAccount_CostCarryForward`, `Sp_DailyStatisticalReport`, `init_plc_config`, `sendPlcData`, plus 4 forms (`sSqlStr` / `sConfigSqlStr` direct embeds). Java callers in xly-src: `SupplierInventoryServiceImpl`, `PlcServiceImpl`, `SearchGroupbyServiceImpl`. Also embedded in upgrade scripts under `script/标版/upgrade/`. Sibling: `NewId2`. diff --git a/en/docs/auto-catalog/functions/to_pinyin.md b/en/docs/auto-catalog/functions/to_pinyin.md index eb5d48d..e80abd8 100644 --- a/en/docs/auto-catalog/functions/to_pinyin.md +++ b/en/docs/auto-catalog/functions/to_pinyin.md @@ -18,4 +18,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Converts a Chinese string to its lower-case pinyin transliteration. Intended for building search-friendly pinyin keys for customer/product/material names (so a user typing `bjly` finds `北京立扬`). Relies on the `t_base_pinyin` lookup table that maps GBK code-points to pinyin syllables. + +**What it does:** hex-encodes the input, walks the byte pairs. For each pair: if the high byte > 128 (CJK range) it computes a GBK code value and looks up the matching `pin_yin_` in `t_base_pinyin` using the `CODE_ ASC LIMIT 1` "first ≥ key" rule, appends it, advances 4 hex chars; otherwise treats the pair as an ASCII char and appends it directly. Returns the lower-cased pinyin string. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines with a `to_pinyin(` invocation, xly-src grep). Live pinyin generation in xly happens Java-side (`PinyinUtil`/`HanyuPinyinHelper`) — this SQL-side polyfill was likely written as a fallback that was never wired up. Same family as orphan `FUN_GET_to_pinyin` (session 4). Candidate for maintainer audit / deletion. diff --git a/en/docs/auto-catalog/procedures/11.md b/en/docs/auto-catalog/procedures/11.md index a52d233..f37ba1f 100644 --- a/en/docs/auto-catalog/procedures/11.md +++ b/en/docs/auto-catalog/procedures/11.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** A scratch/debug fragment of the product-class sales-revenue summary report — groups `viw_salsalesorder` by `sisproductclassify`, totals product money / receipt money / unpaid balance per class, then percentages each class against the grand total. The numeric name `11` and the standalone `SELECT p_sSql` debug echo mark this as developer leftover, not production code. The catalog header `现金日记帐` (cash journal) is mis-copied — the body has nothing to do with a cash journal. + +**What it does:** builds a dynamic SQL string that `INSERT`s into temp table `SAS` per-class sums (`dProductMoney`/`dReceiptMoney`/balance), then concatenates an UPDATE that fills percentages (`dRate`/`dPayRate`/`dBalanceRate`), finally hands the assembled SQL to `Sp_Outstanding_Query` for paging/filtering. Builds a `Fun_GetLookCustomer` data-scope clause into `p_sLookCustomer` but never injects it into the WHERE. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master sSqlStr, gdsmodule hooks, other routines, exhaustive xly-src grep) — candidate for maintainer audit / deletion. diff --git a/en/docs/auto-catalog/procedures/Empty.md b/en/docs/auto-catalog/procedures/Empty.md index 158c2d1..67fa9e7 100644 --- a/en/docs/auto-catalog/procedures/Empty.md +++ b/en/docs/auto-catalog/procedures/Empty.md @@ -15,4 +15,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Developer scratch — a literally-empty procedure (`BEGIN #Routine body goes here... END`) left over from MySQL Workbench's "Create Procedure" wizard template. + +**What it does:** Nothing. Body is the boilerplate placeholder comment with no statements. + +**Invocation:** Status: appears orphaned. No caller in any channel — no form sSqlStr, no gdsmodule hook, no other routine, no xly-src reference. Safe to drop after maintainer confirmation. diff --git a/en/docs/auto-catalog/procedures/Fun_Gb2Big_ChineseToBig.md b/en/docs/auto-catalog/procedures/Fun_Gb2Big_ChineseToBig.md index 8ae0e6a..5683cee 100644 --- a/en/docs/auto-catalog/procedures/Fun_Gb2Big_ChineseToBig.md +++ b/en/docs/auto-catalog/procedures/Fun_Gb2Big_ChineseToBig.md @@ -15,4 +15,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 繁體中文本地化 — paginated rebuild of the Big5 (traditional-Chinese) label cache on `gdsconfigformslave`. For deployments serving Hong Kong / Taiwan / Macau where the UI runs in Big5, every simplified-Chinese caption needs a Big5 twin in the `sBig5*` columns; this procedure refreshes them in 1000-row batches via cursor, calling `F_Gb2Big(sChinese, 1)` per row. + +**What it does:** Counts `gdsconfigformslave`, derives `p_sumPage = ceil(count/1000)`, opens a cursor on each page ordered by `iIncrement DESC`, and per row updates `sBig5 = F_Gb2Big(sChinese,1)` plus — when `sDropDownType='const'` and `sChineseDropDown` contains a `{` — `sBig5DropDown` as well. Sibling table refreshes (`gdsmodule`, `gdsconfigformmaster`, `gdsformconst`, `gdsjurisdiction`) are commented out; the live function variant `Fun_Gb2Big_ChineseToBig()` performs those unpaginated. + +**Invocation:** Status: appears orphaned in normal operation. No form-master, gdsmodule hook, routine caller, or xly-src `CALL`. The companion file `xly-src/script/标版/30000101/Fun_Gb2Big_ChineseToBig.sql` defines only the FUNCTION variant; the procedure is a paginated re-implementation kept as a DBA tool. The pagination helps when `gdsconfigformslave` is too large for a single `UPDATE` to run within memory/lock budgets. diff --git a/en/docs/auto-catalog/procedures/Fun_Get_Change_WorkOrderStatus.md b/en/docs/auto-catalog/procedures/Fun_Get_Change_WorkOrderStatus.md index 3cb4963..34775bd 100644 --- a/en/docs/auto-catalog/procedures/Fun_Get_Change_WorkOrderStatus.md +++ b/en/docs/auto-catalog/procedures/Fun_Get_Change_WorkOrderStatus.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 / 工单完工状态 — recomputes whether a work order is finished (`bBillComplete`) by comparing requested vs reported/in-store quantities. Branches on whether the work order is `bBillOutside` (整单发外) or in-house: outside path compares 成品入库数量 to `opsoutsideprocessslave` totals, in-house path compares 入库数量 plus per-process 产量上报 / 发外回库 完工 status. + +**What it does:** Builds a temp table `workorderTmp` from `viw_mftworkorder`, joins it to source detail tables, then issues an `UPDATE MftWorkOrderMaster` setting `bBillComplete`, `tBillCompleteDate = SYSDATE()` when newly complete, and appends the trigger context (`sLoginId`/`sSrcModifyType`) to `sCompletePerson` as an audit trail. The in-house branch additionally builds a second temp table `p_MftWorkOrderProcess` to classify each process row's `iStatus` (1=未做 / 2=进行中 / 5=完工) by `dProductionReportQty` vs `dDispatchQty` and 发外完工; a work-order is considered complete only when **all** processes reach `iStatus=5`. + +**Invocation:** Status: appears orphaned. No form-master, gdsmodule hook, routine caller, or xly-src reference. The "Fun_" name + `declare result bit(1) ... # return result` commented-out tail suggest this began as a function and was converted to a procedure; the live work-order completion recompute likely lives in the `Sp_Calc_sWod*` / `Sp_WorkOrder_*Complete` family instead. Candidate for maintainer audit — confirm whether this is intended to be wired into bill-event triggers (产量上报 / 成品入库 / 发外回库 save hooks). diff --git a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELECUSTOMER.md b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELECUSTOMER.md index 4582574..412260f 100644 --- a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELECUSTOMER.md +++ b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELECUSTOMER.md @@ -17,4 +17,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础资料 / 客户 (Customer base data) — when a customer (`ELECUSTOMER`) is renamed, renumbered, or reclassified in the **客户** maintenance page, this proc pushes the new `sCustomerNo`/`sCustomerName`/`sCustomerClassifyId` to every denormalized history-table row that already references that customer. + +**What it does:** `SELECT ... INTO @sCustomerNo, @sCustomerName, @sCustomerClassifyId FROM ELECUSTOMER WHERE sId = sEleCustomerId`, then `UPDATE` three denorm tables in turn: `ERPMERGEWORKORDER`, `ERPMERGEPRODUCTIONREPORT`, `ERPMERGESALSALESORDER` — each scoped by `sCustomerId = sEleCustomerId`. Bug worth flagging: the SET clauses swap `sCustomerName = @sCustomerNo` and `sCustomerNo = @sCustomerName` — the two label columns are written to the wrong fields. + +**Invocation:** Reached via `ProDao.proErpMergeBaseEleCustomer(map)` → MyBatis `ProMapper.proErpMergeBaseEleCustomer` (`CALL PRO_ERPMERGEBASEELECUSTOMER(#{sEleCustomerId})`). Fired by the JMS `CHANGE_GDS_MODULE` consumer / `ChangeEleCustomerServiceImpl`-style entity-change service after a customer row mutates, keeping denormalized reporting tables in sync without a full rebuild. See [Cache invalidation on metadata change](../../reference/maintainer/cache-invalidation.md). diff --git a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEEMPLOYEE.md b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEEMPLOYEE.md index 461810c..3df8637 100644 --- a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEEMPLOYEE.md +++ b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEEMPLOYEE.md @@ -17,4 +17,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础资料 / 员工 (Employee base data) — when an employee (`ELEEMPLOYEE`) is renamed in the **员工** maintenance page, this proc pushes the new `sEmployeeName` to every historical production-report row that already references that employee. + +**What it does:** `SELECT sEmployeeName INTO @sEmployeeName FROM ELEEMPLOYEE WHERE sId = sEleEmployeeId`, then `UPDATE ERPMERGEPRODUCTIONREPORT SET sEmployeeName = @sEmployeeName WHERE sEmployeeId = sEleEmployeeId`. One-shot denormalization push. + +**Invocation:** Reached via `ProDao.proErpMergeBaseEleEmployee(map)` → MyBatis `ProMapper.proErpMergeBaseEleEmployee` (`CALL PRO_ERPMERGEBASEELEEMPLOYEE(#{sEleEmployeeId})`). Fired by `ChangeEleEmployeeServiceImpl` (the JMS `CHANGE_GDS_MODULE` consumer for the employee entity) after a base-data row mutates, keeping denormalized reporting tables in sync without a full rebuild. See [Cache invalidation on metadata change](../../reference/maintainer/cache-invalidation.md). diff --git a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEMACHINE.md b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEMACHINE.md index 1ed9229..dd25a7d 100644 --- a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEMACHINE.md +++ b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEMACHINE.md @@ -17,4 +17,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础资料 / 设备 (Machine base data) — when a machine (`ELEMACHINE`) is renamed or renumbered in the **设备** maintenance page, this proc pushes the new `sMachineName`/`sMachineNo` to every historical production-report row that already references that machine. + +**What it does:** `SELECT sMachineName, sMachineNo INTO @sMachineName, @sMachineNo FROM ELEMACHINE WHERE sId = sEleMachineId`, then `UPDATE ERPMERGEPRODUCTIONREPORT SET sMachineName = @sMachineName, sMachineNo = @sMachineNo WHERE sMachineId = sEleMachineId`. One-shot denormalization push. + +**Invocation:** Reached via `ProDao.proErpMergeBaseEleMachine(map)` → MyBatis `ProMapper.proErpMergeBaseEleMachine` (`CALL PRO_ERPMERGEBASEELEMACHINE(#{sEleMachineId})`). Fired by the entity-change service for `elemachine` (JMS `CHANGE_GDS_MODULE` consumer) after a base-data row mutates, keeping denormalized reporting tables in sync without a full rebuild. See [Cache invalidation on metadata change](../../reference/maintainer/cache-invalidation.md). diff --git a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEMATERIALS.md b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEMATERIALS.md index 3f95c25..049bbb2 100644 --- a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEMATERIALS.md +++ b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEMATERIALS.md @@ -17,4 +17,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础资料 / 物料 (Materials base data) — when a material (`ELEMATERIALS`) is renamed or its gram weight is corrected in the **物料** maintenance page, this proc pushes the new `sMaterialsName`/`dGramWeight` to every historical production-report row that already references that material. + +**What it does:** `SELECT sMaterialsName, dGramWeight INTO @sMaterialsName, @dGramWeight FROM ELEMATERIALS WHERE sId = sEleMaterialsId`, then `UPDATE ERPMERGEPRODUCTIONREPORT SET sMaterialsName = @sMaterialsName, dGramWeight = @dGramWeight WHERE sMaterialsId = sEleMaterialsId`. One-shot denormalization push. + +**Invocation:** Reached via `ProDao.proErpMergeBaseEleMaterials(map)` → MyBatis `ProMapper.proErpMergeBaseEleMaterials` (`CALL PRO_ERPMERGEBASEELEMATERIALS(#{sEleMaterialsId})`). Fired by `ChangeEleMaterialsServiceImpl` (the JMS `CHANGE_GDS_MODULE` consumer for the materials entity) after a base-data row mutates, keeping denormalized reporting tables in sync without a full rebuild. See [Cache invalidation on metadata change](../../reference/maintainer/cache-invalidation.md). diff --git a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEPROCESS.md b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEPROCESS.md index e2c4c1c..8551572 100644 --- a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEPROCESS.md +++ b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEPROCESS.md @@ -17,4 +17,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础资料 / 工序 (Process base data) — when a process (`ELEPROCESS`) is renamed, renumbered, has its unit changed, or is moved to a different process classification in the **工序** maintenance page, this proc pushes the new `sProcessNo`/`sProcessName`/`sProcessUnit`/`sProcessClassifyId` (= `ELEPROCESS.sParentId`) to every historical production-report row that already references that process. + +**What it does:** `SELECT sProcessNo, sProcessName, sProcessUnit, sParentId INTO @sProcessNo, @sProcessName, @sProcessUnit, @sProcessClassifyId FROM ELEPROCESS WHERE sId = sEleProcessId`, then `UPDATE ERPMERGEPRODUCTIONREPORT SET ... WHERE sProcessId = sEleProcessId`. One-shot denormalization push. + +**Invocation:** Reached via `ProDao.proErpMergeBaseEleProcess(map)` → MyBatis `ProMapper.proErpMergeBaseEleProcess` (`CALL PRO_ERPMERGEBASEELEPROCESS(#{sEleProcessId})`). Fired by `ChangeEleProcessServiceImpl` (the JMS `CHANGE_GDS_MODULE` consumer for the process entity) after a base-data row mutates, keeping denormalized reporting tables in sync without a full rebuild. See [Cache invalidation on metadata change](../../reference/maintainer/cache-invalidation.md). diff --git a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEPRODUCT.md b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEPRODUCT.md index d757d02..b4a4c30 100644 --- a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEPRODUCT.md +++ b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELEPRODUCT.md @@ -17,4 +17,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础资料 / 产品 (Product base data) — when a product (`ELEPRODUCT`) is renamed, renumbered, its style/unit changed, has its customer-product-no updated, or is moved to a different product classification in the **产品** maintenance page, this proc pushes the new `sProductNo`/`sProductName`/`sProductStyle`/`sProductUnit`/`sCustomerProductNo`/`sProductClassifyId` (= `ELEPRODUCT.sParentId`) to every history-table row that already references that product. + +**What it does:** `SELECT ... INTO @...` from `ELEPRODUCT WHERE sId = sEleProductId`, then `UPDATE` three denorm tables in turn: `ERPMERGEWORKORDER`, `ERPMERGEPRODUCTIONREPORT`, `ERPMERGESALSALESORDER` — each scoped by `sProductId = sEleProductId`. + +**Invocation:** Reached via `ProDao.proErpMergeBaseEleProduct(map)` → MyBatis `ProMapper.proErpMergeBaseEleProduct` (`CALL PRO_ERPMERGEBASEELEPRODUCT(#{sEleProductId})`). Fired by the entity-change service for `eleproduct` (JMS `CHANGE_GDS_MODULE` consumer) after a base-data row mutates, keeping denormalized reporting tables in sync without a full rebuild. See [Cache invalidation on metadata change](../../reference/maintainer/cache-invalidation.md). diff --git a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELETEAM.md b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELETEAM.md index a78f1fa..d4e0da9 100644 --- a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELETEAM.md +++ b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEELETEAM.md @@ -17,4 +17,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Manufacturing — 班组 (Team) base data. When a production team's `sTeamName` or `sTeamNo` is edited on the 班组维护 page, this proc pushes the new name/number onto every historical `ERPMERGEPRODUCTIONREPORT` row that references the team, so production-report queries keep showing the current label. + +**What it does:** reads `sTeamName`, `sTeamNo` from `ELETEAM` for the given id, then `UPDATE ERPMERGEPRODUCTIONREPORT SET sTeamName=@..., sTeamNo=@... WHERE sTeamId = sEleTeamId`. + +**Invocation:** member of the `PRO_ERPMERGEBASE*` denorm-merge family. Called by `ProDao.proErpMergeBaseEleTeam(map)` via MyBatis CALLABLE mapper `ProMapper.xml`, driven from `ChangeEleTeamServiceImpl.changeTableData()` after the JMS `CHANGE_GDS_MODULE` consumer detects an `ELETEAM` row mutation. See [Cache invalidation on metadata change](../../reference/maintainer/cache-invalidation.md) for the dispatch mechanism. diff --git a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEGDSMODULE.md b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEGDSMODULE.md index 6765fbe..de5fac1 100644 --- a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEGDSMODULE.md +++ b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEGDSMODULE.md @@ -17,4 +17,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Platform — form/module label sync. When a `gdsmodule` row's `sChinese` label (the human-readable form name visible in BACK navigation) changes, this proc rewrites `sChinese` onto every historical row across the three merge-reporting tables that references that form id, so report queries display the current label. + +**What it does:** reads `sChinese` from `GDSMODULE` for the given id, then runs `UPDATE` against `ERPMERGEWORKORDER`, `ERPMERGEPRODUCTIONREPORT`, and `ERPMERGESALSALESORDER` for rows whose `sFormId = sGdsModuleId`. + +**Invocation:** member of the `PRO_ERPMERGEBASE*` denorm-merge family. Called by `ProDao.proErpMergeBaseGdsModule(map)` via MyBatis CALLABLE mapper `ProMapper.xml`, driven from `ChangeGdsModuleServiceImpl.changeTableData()` after the JMS `CHANGE_GDS_MODULE` consumer detects a `GDSMODULE` row mutation. See [Cache invalidation on metadata change](../../reference/maintainer/cache-invalidation.md). diff --git a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEMFTWORKORDERCONTROL.md b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEMFTWORKORDERCONTROL.md index ee494f2..95ad06f 100644 --- a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEMFTWORKORDERCONTROL.md +++ b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASEMFTWORKORDERCONTROL.md @@ -17,4 +17,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Manufacturing — work-order print-control sync. When a row in `MFTWORKORDERCONTROL` (the per-process print-control table that owns 正面色数 / 反面色数 / 印刷模式 / 色序 / 拼版数 / 单产量 etc.) is updated from inside the 施工单 (work-order) flow, this proc copies those production-control fields onto every `ERPMERGEPRODUCTIONREPORT` row whose `sSrcControlId` matches, so production-report rows reflect the current print plan. + +**What it does:** reads the 12 control fields (`iPositiveColor`, `iPositiveSpecialColor`, `iOppositeColor`, `iOppositeSpecialColor`, `dSinglePQty`, `dSumPQty`, `iStick`, `sColorSerial`, `dMachineQty`, `dSumMachineQty`, `iPrintModePo`, `iPrintMode`) from `MFTWORKORDERCONTROL` and updates the matching `ERPMERGEPRODUCTIONREPORT` rows by `sSrcControlId`. + +**Invocation:** member of the `PRO_ERPMERGEBASE*` denorm-merge family. Called by `ProDao.proErpMergeBaseWorkOrderControl(map)` via MyBatis CALLABLE mapper `ProMapper.xml`, driven from `ChangeWorkOrderControlServiceImpl.changeTableData()` after the JMS `CHANGE_GDS_MODULE` consumer detects a `MFTWORKORDERCONTROL` row mutation. See [Cache invalidation on metadata change](../../reference/maintainer/cache-invalidation.md). diff --git a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISCUSTOMERCLASSIFY.md b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISCUSTOMERCLASSIFY.md index c898c95..ccb1369 100644 --- a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISCUSTOMERCLASSIFY.md +++ b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISCUSTOMERCLASSIFY.md @@ -17,4 +17,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Base data — 客户分类 (Customer Classification). When a customer-classification row in `SISCUSTOMERCLASSIFY` is renamed, this proc pushes the new `sName` onto every historical row of the three merge-reporting tables that references this classification, so reports keep displaying the current name. + +**What it does:** reads `sName` from `SISCUSTOMERCLASSIFY` for the given id, then `UPDATE`s `sCustomerClassifyName` on `ERPMERGEWORKORDER`, `ERPMERGEPRODUCTIONREPORT`, and `ERPMERGESALSALESORDER` rows whose `sCustomerClassifyId = sSisCustomerClassifyId`. + +**Invocation:** member of the `PRO_ERPMERGEBASE*` denorm-merge family. Called by `ProDao.proErpMergeBaseSisCustomerClassify(map)` via MyBatis CALLABLE mapper `ProMapper.xml`, driven from `ChangeSisCustomerClassifyServiceImpl.changeTableData()` after the JMS `CHANGE_GDS_MODULE` consumer detects a `SISCUSTOMERCLASSIFY` row mutation. See [Cache invalidation on metadata change](../../reference/maintainer/cache-invalidation.md). diff --git a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISDELIVER.md b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISDELIVER.md index d6305b9..a80dd9c 100644 --- a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISDELIVER.md +++ b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISDELIVER.md @@ -17,4 +17,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Base data — 送货方式 / 物流 (Deliver method). When a row in `SISDELIVER` (the shipping-method dictionary referenced by sales orders and work orders) is renamed, this proc rewrites the denormalized `sDeliverName` on every historical row that references the dictionary entry. + +**What it does:** reads `sName` from `SISDELIVER` for the given id, then `UPDATE`s `sDeliverName` on `ERPMERGEWORKORDER` and `ERPMERGESALSALESORDER` rows whose `sDeliverId = sSisDeliverId`. (Production-report does not carry a deliver-id column.) + +**Invocation:** member of the `PRO_ERPMERGEBASE*` denorm-merge family. Called by `ProDao.proErpMergeBaseSisDeliver(map)` via MyBatis CALLABLE mapper `ProMapper.xml`, driven from `ChangeSisDeliverServiceImpl.changeTableData()` after the JMS `CHANGE_GDS_MODULE` consumer detects a `SISDELIVER` row mutation. See [Cache invalidation on metadata change](../../reference/maintainer/cache-invalidation.md). diff --git a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISFORMULA.md b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISFORMULA.md index d0281ca..2811fc2 100644 --- a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISFORMULA.md +++ b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISFORMULA.md @@ -17,4 +17,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Base data — 工资公式 (Wage Formula). When a wage-formula row in `SISFORMULA` is renamed in the formula maintenance page, this proc pushes the new name onto every historical `ERPMERGEPRODUCTIONREPORT` row that uses the formula, so payroll-related production-report queries keep displaying the current label. + +**What it does:** reads `sName` from `SISFORMULA` for the given id and updates `sWageName` on `ERPMERGEPRODUCTIONREPORT` rows whose `sWageId = sSisFormulaId`. + +**Invocation:** member of the `PRO_ERPMERGEBASE*` denorm-merge family. Called by `ProDao.proErpMergeBaseSisFormula(map)` via MyBatis CALLABLE mapper `ProMapper.xml`, driven from `ChangeSisFormulaServiceImpl.changeTableData()` after the JMS `CHANGE_GDS_MODULE` consumer detects a `SISFORMULA` row mutation. See [Cache invalidation on metadata change](../../reference/maintainer/cache-invalidation.md). diff --git a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISPAYMENT.md b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISPAYMENT.md index 39c3bc7..24c8e64 100644 --- a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISPAYMENT.md +++ b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISPAYMENT.md @@ -17,4 +17,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Base data — 收付款方式 (Payment terms). When a payment-method row in `SISPAYMENT` is renamed, this proc pushes the new `sName` onto every historical row that references the term on work-order and sales-order merge-reporting tables. + +**What it does:** reads `sName` from `SISPAYMENT` for the given id, then `UPDATE`s `sGetPayName` on `ERPMERGEWORKORDER` and `ERPMERGESALSALESORDER` rows whose `sGetPayId = sSisPaymentId`. + +**Invocation:** member of the `PRO_ERPMERGEBASE*` denorm-merge family. Called by `ProDao.proErpMergeBaseSisPayment(map)` via MyBatis CALLABLE mapper `ProMapper.xml`, driven from `ChangeSisPaymentServiceImpl.changeTableData()` after the JMS `CHANGE_GDS_MODULE` consumer detects a `SISPAYMENT` row mutation. See [Cache invalidation on metadata change](../../reference/maintainer/cache-invalidation.md). diff --git a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISPROCESSCLASSIFY.md b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISPROCESSCLASSIFY.md index ae4b6d9..d629e61 100644 --- a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISPROCESSCLASSIFY.md +++ b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISPROCESSCLASSIFY.md @@ -17,4 +17,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Base data — 工序分类 (Process Classification). When a process-classification row in `SISPROCESSCLASSIFY` is renamed, this proc pushes the new `sName` onto every historical `ERPMERGEPRODUCTIONREPORT` row that references the classification. + +**What it does:** reads `sName` from `SISPROCESSCLASSIFY` for the given id, then `UPDATE`s `sProcessClassifyName` on `ERPMERGEPRODUCTIONREPORT` rows whose `sProcessClassifyId = sSisProcessClassifyId`. + +**Invocation:** member of the `PRO_ERPMERGEBASE*` denorm-merge family. Called by `ProDao.proErpMergeBaseSisProcessClassify(map)` via MyBatis CALLABLE mapper `ProMapper.xml`, driven from `ChangeSisProcessClassifyServiceImpl.changeTableData()` after the JMS `CHANGE_GDS_MODULE` consumer detects a `SISPROCESSCLASSIFY` row mutation. See [Cache invalidation on metadata change](../../reference/maintainer/cache-invalidation.md). diff --git a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISPRODUCTCLASSIFY.md b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISPRODUCTCLASSIFY.md index a606a1e..7a52f44 100644 --- a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISPRODUCTCLASSIFY.md +++ b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISPRODUCTCLASSIFY.md @@ -17,4 +17,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Base data — 产品分类 (Product Classification). When a product-classification row in `SISPRODUCTCLASSIFY` is renamed, this proc rewrites the denormalized `sProductClassifyName` across all three merge-reporting tables so reports keep showing the current label. + +**What it does:** reads `sName` from `SISPRODUCTCLASSIFY` for the given id, then `UPDATE`s `sProductClassifyName` on `ERPMERGEWORKORDER`, `ERPMERGEPRODUCTIONREPORT`, and `ERPMERGESALSALESORDER` rows whose `sProductClassifyId = sSisProductClassify`. + +**Invocation:** member of the `PRO_ERPMERGEBASE*` denorm-merge family. Called by `ProDao.proErpMergeBaseSisProductClassify(map)` via MyBatis CALLABLE mapper `ProMapper.xml`, driven from `ChangeSisProductClassifyServiceImpl.changeTableData()` after the JMS `CHANGE_GDS_MODULE` consumer detects a `SISPRODUCTCLASSIFY` row mutation. See [Cache invalidation on metadata change](../../reference/maintainer/cache-invalidation.md). diff --git a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISSALESMAN.md b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISSALESMAN.md index c50d5a3..3911495 100644 --- a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISSALESMAN.md +++ b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISSALESMAN.md @@ -17,4 +17,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Base data — 业务员 (Salesman). When a salesman row in `SISSALESMAN` is renamed, this proc pushes the new `sName` onto every historical row of the work-order and sales-order merge-reporting tables that references this salesman, so commission and sales reports keep showing the current name. + +**What it does:** reads `sName` from `SISSALESMAN` for the given id, then `UPDATE`s `sSalesManName` on `ERPMERGEWORKORDER` and `ERPMERGESALSALESORDER` rows whose `sSalesManId = sSisSalesManId`. + +**Invocation:** member of the `PRO_ERPMERGEBASE*` denorm-merge family. Called by `ProDao.proErpMergeBaseSisSalesMan(map)` via MyBatis CALLABLE mapper `ProMapper.xml`, driven from `ChangeSisSalesManServiceImpl.changeTableData()` after the JMS `CHANGE_GDS_MODULE` consumer detects a `SISSALESMAN` row mutation. See [Cache invalidation on metadata change](../../reference/maintainer/cache-invalidation.md). diff --git a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISTAX.md b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISTAX.md index 607f42a..6c1db88 100644 --- a/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISTAX.md +++ b/en/docs/auto-catalog/procedures/PRO_ERPMERGEBASESISTAX.md @@ -17,4 +17,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Base data — 税率 (Tax). When a tax row in `SISTAX` is edited (name or rate), this proc pushes both `sTaxName` and `dTaxRate` onto every historical row of the work-order and sales-order merge-reporting tables that references the tax id. + +**What it does:** reads `sName`, `dRate` from `SISTAX` for the given id, then `UPDATE`s `sTaxName` and `dTaxRate` on `ERPMERGEWORKORDER` and `ERPMERGESALSALESORDER` rows whose `sTaxId = sSisTaxId`. + +**Invocation:** member of the `PRO_ERPMERGEBASE*` denorm-merge family. Called by `ProDao.proErpMergeBaseSisTax(map)` via MyBatis CALLABLE mapper `ProMapper.xml`, driven from `ChangeSisTaxServiceImpl.changeTableData()` after the JMS `CHANGE_GDS_MODULE` consumer detects a `SISTAX` row mutation. See [Cache invalidation on metadata change](../../reference/maintainer/cache-invalidation.md). + +Caveat: pushes the new `dTaxRate` onto historical rows that were originally booked at the old rate — tax-rate retroactivity is a business decision, not a bug, but worth flagging. diff --git a/en/docs/auto-catalog/procedures/PRO_ERPMERGEDELHISTORY.md b/en/docs/auto-catalog/procedures/PRO_ERPMERGEDELHISTORY.md index 6abb7ee..12af844 100644 --- a/en/docs/auto-catalog/procedures/PRO_ERPMERGEDELHISTORY.md +++ b/en/docs/auto-catalog/procedures/PRO_ERPMERGEDELHISTORY.md @@ -18,4 +18,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Platform — denorm-merge reporting retention. Prunes the three big `ERPMERGE*` reporting tables — daily, on a schedule — so historical denormalized rows don't grow unbounded. Companion to the `PRO_ERPMERGEBASE*` push-on-rename family: the base routines keep current rows in sync, this one drops rows that are too old to care about. + +**What it does:** `DELETE FROM ERPMERGESALSALESORDER`, `ERPMERGEWORKORDER`, `ERPMERGEPRODUCTIONREPORT` where each row's `tCreateDate < tCreateTime`. Cutoff is the caller-supplied threshold. + +**Invocation:** Called by `ProDao.proErpMergeDelHistory(map)` via MyBatis CALLABLE mapper `ProMapper.xml`. Driven from `MegerDataFactoryServiceImpl.delMergeTableHistoryData()`, which is run by `MergeTableDelHistoryThread` on the Spring `@Scheduled(cron = "0 10 3 * * ?")` daily 03:10 cron (`ScheduledCorn`). No transaction wrapping — three independent `DELETE`s; partial completion is possible if any one fails. diff --git a/en/docs/auto-catalog/procedures/PRO_ERPMERGEMFTWORKORDER.md b/en/docs/auto-catalog/procedures/PRO_ERPMERGEMFTWORKORDER.md index 3eaa93f..7084e35 100644 --- a/en/docs/auto-catalog/procedures/PRO_ERPMERGEMFTWORKORDER.md +++ b/en/docs/auto-catalog/procedures/PRO_ERPMERGEMFTWORKORDER.md @@ -18,4 +18,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Manufacturing — 生产施工单 (Work Order) reporting-row builder. Whenever a `MFTWORKORDERSLAVE` row is saved/checked, this proc rebuilds the corresponding fully-denormalized row in `ERPMERGEWORKORDER` — joining in customer, product, form, classification, tax, salesman, payment, and deliver labels — so downstream BI/reporting queries can scan a single wide table without re-joining the operational schema. + +**What it does:** loads the slave row by `sSlaveId` into session variables, fetches its master via `@sParentId`, then conditionally fetches name labels from `ELECUSTOMER`, `ELEPRODUCT`, `GDSMODULE`, `SISCUSTOMERCLASSIFY`, `SISTAX`, `SISPRODUCTCLASSIFY`, `SISSALESMAN`, `SISPAYMENT`, `SISDELIVER`. Inside a transaction it `DELETE`s any existing `ERPMERGEWORKORDER` row by `sSlaveId` and `INSERT`s the freshly composed denormalized row. + +**Invocation:** Called by `ProDao.proErpMergeMftWorkOrder(map)` via MyBatis CALLABLE mapper `ProMapper.xml`, driven from `MegerWorkOrderServiceImpl` after a `MFTWORKORDERSLAVE` mutation event. Companion to `PRO_ERPMERGEPRODUCTIONREPORT` (production-report variant) and `PRO_ERPMERGESALSALESORDER` (sales-order variant). See [Cache invalidation on metadata change](../../reference/maintainer/cache-invalidation.md). + +Caveat: `DELETE FROM ERPMERGEWORKORDER WHERE sSlaveId = sSlaveId` — the parameter name shadows the column name, so the predicate `sSlaveId = sSlaveId` is always true (or always-NULL-safe-true depending on optimizer). The DELETE deletes the whole table in each invocation. The INSERT then re-inserts only the current row — net behaviour is correct for a single-row rebuild, but the table gets rewritten on every call, which is destructive if any other live row exists. Worth a maintainer audit. diff --git a/en/docs/auto-catalog/procedures/PRO_ERPMERGEPRODUCTIONREPORT.md b/en/docs/auto-catalog/procedures/PRO_ERPMERGEPRODUCTIONREPORT.md index bca9287..c3daed6 100644 --- a/en/docs/auto-catalog/procedures/PRO_ERPMERGEPRODUCTIONREPORT.md +++ b/en/docs/auto-catalog/procedures/PRO_ERPMERGEPRODUCTIONREPORT.md @@ -18,4 +18,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Manufacturing — 生产报工 (Production Report) reporting-row builder. Rebuilds the denormalized `ERPMERGEPRODUCTIONREPORT` row for one `MFTPRODUCTIONREPORTSLAVE` whenever the report is saved/checked, joining in all the dimensional labels (customer, product, team, work-center, machine, employee, process, work-order, classification names) so analytics can scan one wide table. + +**What it does:** loads the slave row from `MFTPRODUCTIONREPORTSLAVE` by `sSlaveId` and its master from `MFTPRODUCTIONREPORTMASTER` via `@sParentId`, then conditionally fetches name labels from the related base tables. Inside a transaction it `DELETE`s any existing `ERPMERGEPRODUCTIONREPORT` row keyed on `sSlaveId` and `INSERT`s the freshly composed denormalized row. + +**Invocation:** Called by `ProDao.proErpMergeProductionReport(map)` via MyBatis CALLABLE mapper `ProMapper.xml`, driven from `MegerProductionReportServiceImpl` after a `MFTPRODUCTIONREPORTSLAVE` mutation event. Sibling of `PRO_ERPMERGEMFTWORKORDER` and `PRO_ERPMERGESALSALESORDER`. See [Cache invalidation on metadata change](../../reference/maintainer/cache-invalidation.md). + +Caveat: the DELETE predicate is `WHERE sSlaveId = sSlaveId` — same shadowed-name bug as the sibling procs; MySQL binds both sides to the IN parameter so the WHERE is effectively a tautology. Single-row INSERT after a table-wide DELETE may be wider than intended; flag for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/PRO_ERPMERGESALSALESORDER.md b/en/docs/auto-catalog/procedures/PRO_ERPMERGESALSALESORDER.md index 32ae3cc..70386ca 100644 --- a/en/docs/auto-catalog/procedures/PRO_ERPMERGESALSALESORDER.md +++ b/en/docs/auto-catalog/procedures/PRO_ERPMERGESALSALESORDER.md @@ -18,4 +18,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Sales — 销售订单 (Sales Order) reporting-row builder. Rebuilds the denormalized `ERPMERGESALSALESORDER` row for one `SALSALESORDERSLAVE` whenever the sales-order is saved/checked, joining in customer, product, form, classification, tax, salesman, payment, and deliver labels so sales-analytics queries can scan a single wide table. + +**What it does:** loads the slave row from `SALSALESORDERSLAVE` by `sSlaveId` and its master from `SALSALESORDERMASTER` via `@sParentId`, then conditionally pulls name labels from related base tables. Inside a transaction it `DELETE`s any existing `ERPMERGESALSALESORDER` row keyed on `sSlaveId` and `INSERT`s the freshly composed denormalized row. + +**Invocation:** Called by `ProDao.proErpMergeSalSalesOrder(map)` via MyBatis CALLABLE mapper `ProMapper.xml`, driven from `MegerSaleOrderServiceImpl` after a `SALSALESORDERSLAVE` mutation event. Sibling of `PRO_ERPMERGEMFTWORKORDER` and `PRO_ERPMERGEPRODUCTIONREPORT`. See [Cache invalidation on metadata change](../../reference/maintainer/cache-invalidation.md). + +Caveat: the DELETE predicate is `WHERE sSlaveId = sSlaveId` — same shadowed-name bug as the sibling procs; MySQL binds both sides to the IN parameter so the WHERE is effectively a tautology, wiping the whole table on each invocation before the single-row INSERT. Flag for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/PRO_MATERIALS_SMAIL.md b/en/docs/auto-catalog/procedures/PRO_MATERIALS_SMAIL.md index 040a853..65f05ba 100644 --- a/en/docs/auto-catalog/procedures/PRO_MATERIALS_SMAIL.md +++ b/en/docs/auto-catalog/procedures/PRO_MATERIALS_SMAIL.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Materials — 305cm sheet-packing estimator (header: "两变都小于305的材料(单位CM)" = "materials whose both dimensions are under 305cm"). Procedure form of the orphan function `FUN_MATERIALS_SMAIL` (session 8 flagged) — given a requested quantity, sheet width and sheet length (all in cm), returns the number of master sheets needed assuming a 305cm raw sheet, by simulating greedy lay-down of pieces. + +**What it does:** swaps width/length so width≤length, accounts for any whole-master pieces when either dimension exceeds 305, then runs a `WHILE indexOrder < dQty` loop greedily fitting pieces into a 305cm strip, tracking strip count in `clsl` and accumulating leftover lengths into a JSON array. Returns the total master-sheet count `dQtyXy = p_zgs + clsl`. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep across all extensions). The function-variant `FUN_MATERIALS_SMAIL` is similarly orphan — both appear to be experimental packing-estimator scaffolding that was never wired into a live materials-issue or order-quoting flow. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/SP_DeliverGoods_Warning.md b/en/docs/auto-catalog/procedures/SP_DeliverGoods_Warning.md index e5b013a..f028cbc 100644 --- a/en/docs/auto-catalog/procedures/SP_DeliverGoods_Warning.md +++ b/en/docs/auto-catalog/procedures/SP_DeliverGoods_Warning.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 发货计划管理 → 超期未送货预警表 — paged "delivery-warning" report. For each sales-order slave row it computes a `yujing` flag (already complete vs days-until-promised-delivery) and exposes the row with product, customer, tax info so dispatchers can chase late deliveries. + +**What it does:** Defaults `tEndDate` to "now + 1 day" if null and `tStartDate` to `2000-01-01` if null. Builds a temporary copy of `Viw_MftWorkOrder` filtered to the period, joins customer/product/tax info, then routes a dynamic SELECT (with `sFilterOrderBy`, `sGroupby_*_sql`, page/size) through the standard pagination dispatchers (`Sp_Outstanding_Query` / `Sp_Do_UpdateByPageSizeBefore`) to produce `totalCount` and `countMapJson` for column-totals. + +**Invocation:** Status: the live `gdsconfigformmaster` row for 超期未送货预警表 (`101251240115015879470853200`) is bound to the view `Viw_SalSalesOrder` rather than this proc — the form was migrated. The proc is still wired through `Fun_getInitColumnByProName` (the helper that returns the column manifest when `sProductName='SP_DeliverGoods_Warning'`), so it remains the canonical column source. Likely retained as the historical/alternate report body; verify whether any tenant override still calls it. Install body: `script/标版/30100101/SP_DeliverGoods_Warning.sql`. diff --git a/en/docs/auto-catalog/procedures/SP_GetlogisticsPrice.md b/en/docs/auto-catalog/procedures/SP_GetlogisticsPrice.md index 9ab7cd3..c412018 100644 --- a/en/docs/auto-catalog/procedures/SP_GetlogisticsPrice.md +++ b/en/docs/auto-catalog/procedures/SP_GetlogisticsPrice.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Quote-time logistics price lookup — given a destination city + truck tonnage (1.5T/2T/.../7T) + 运输费/等时费 mode + time slot, populate a one-row `tbPriceMoney` temp table with the matching rate from `sislogisticsaddprice` (city-based) or `sislogisticstimeprice` (time-based). The rate column (iOne/iTwo/.../iSeven) is selected by the tonnage parameter. + +**What it does:** Drops and recreates `tbPriceMoney`, then dispatches into one of fourteen INSERT branches based on the `spLogType`/`spTon` pair. Each branch SELECTs a single `i` literal column out of the price source table and writes it identically into eight money/price slots on the temp row. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep across all extensions) — candidate for maintainer audit. Stray `-- select aa from bb;` debug-echo comment confirms scratchpad lineage. diff --git a/en/docs/auto-catalog/procedures/SP_Inventory_InOutWareHouseAll.md b/en/docs/auto-catalog/procedures/SP_Inventory_InOutWareHouseAll.md index 8d0a609..b3e3ecf 100644 --- a/en/docs/auto-catalog/procedures/SP_Inventory_InOutWareHouseAll.md +++ b/en/docs/auto-catalog/procedures/SP_Inventory_InOutWareHouseAll.md @@ -40,4 +40,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 常用模块 → 常用设置 → 材料进销存报表明细(旧) — older legacy variant of the material in/out warehouse report, retained for the "旧" (legacy) detail screen. Produces the same per-material movement ledger as `SP_Inventory_InOutWarehouse` but with the wider `InOutWarehouseAll` working set (every movement classified into 进 / 出 buckets without the cut-slip paper-reel logic). + +**What it does:** Builds the `InOutWarehouse` / `Cur_InOutWarehouse` / `Cur_InOut` cursors from `MitMaterialsStore` movements plus `Viw_MitMaterialsCheck` stock-count adjustments and `EleMaterialsStock` opening balances. Calls `Sp_Sis_GetMertialsInventoryFormGuid` + `Sp_Sis_GetConst` for the form-config constants, normalises material-style strings via `Sp_System_ReplaceField`, and paginates through `Sp_Outstanding_Query`. + +**Invocation:** Bound as the data source of form 材料进销存报表明细(旧) (sId `19211681015115282494392520`) under 常用模块 → 常用设置 → 材料进销存报表明细(旧). Also referenced by `Fun_getInitColumnByProName` (the metadata function that maps proc name → returned column list for paginated reports). xly-src ships install script `script/标版/30100101/SP_Inventory_InOutWareHouseAll.sql`. Newer report variants live in `SP_Inventory_InOutWarehouse` and `Sp_Inventory_MaterialsInOutStoreDoing`. diff --git a/en/docs/auto-catalog/procedures/SP_Inventory_InOutWarehouse.md b/en/docs/auto-catalog/procedures/SP_Inventory_InOutWarehouse.md index 15b7bff..5e9ed4b 100644 --- a/en/docs/auto-catalog/procedures/SP_Inventory_InOutWarehouse.md +++ b/en/docs/auto-catalog/procedures/SP_Inventory_InOutWarehouse.md @@ -42,4 +42,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料库存 → 材料库存查询 → 材料库存台账 — material in/out warehouse ledger (出入库台账). Per-material, per-warehouse opening stock + every receipt/issue/cut/adjustment + running balance over a date window. The auditor's go-to view to reconcile `MitMaterialsStore` movements against `EleMaterialsStock` and the `MitMaterialsCheck` stock-count workflow. + +**What it does:** Resolves the account period from `sysaccountperiod` and `SysSystemSettings`, builds the working `InOutWarehouse` set from `MitMaterialsStore` movements + `Viw_MitMaterialsCheck` (盘点) + `MitMaterialsCutMaster/Slave` (paper-reel cut slips). Defaults dates, calls `Sp_Sis_GetMertialsInventoryFormGuid` + `Sp_Sis_GetConst` for form-config constants, optionally normalises material-style fields via `Sp_System_ReplaceField`, then paginates the rowset via `Sp_Outstanding_Query`. + +**Invocation:** Bound as the data source of form 材料库存台账 (sId `19211681019715754498436890`) under 材料库存 → 材料库存查询 → 材料库存台账, loaded when the user opens the report (the form-binding dispatcher reads the proc name from `gdsconfigformmaster.sSqlStr`). Also called from `Sp_System_AutoMaterialsPriceSingle` and `Sp_System_AutoMaterialsPriceSingle_new` / `_Old` (automatic per-material costing) to fetch period movement totals when reconstructing weighted-average prices. xly-src ships install script `script/标版/30100101/SP_Inventory_InOutWarehouse.sql`. diff --git a/en/docs/auto-catalog/procedures/SP_Inventory_InOutWarehouseCost.md b/en/docs/auto-catalog/procedures/SP_Inventory_InOutWarehouseCost.md index fe14061..bfbe412 100644 --- a/en/docs/auto-catalog/procedures/SP_Inventory_InOutWarehouseCost.md +++ b/en/docs/auto-catalog/procedures/SP_Inventory_InOutWarehouseCost.md @@ -37,4 +37,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 — cost-flavoured fork of `SP_Inventory_InOutWarehouse` that drives the cost-accounting material in/out ledger. Whereas the standard variant works against `EleMaterialsStock` / `elematerialsstockmonth`, this one reads `AccMaterialsStore` / `elematerialsstockmonthCost` / `viw_accmaterialsinit` so the report reflects costed (rather than physical) movements per the closed accounting period. + +**What it does:** Resolves the cost period via `sysaccountperiod` + `SysSystemSettings`, populates `InOutWarehouse` from `AccMaterialsStore` movements and `viw_accmaterialsinit` initial balances, calls `Sp_Sis_GetMertialsInventoryFormGuid` + `Sp_Sis_GetConst` + `Sp_System_ReplaceField` for form-config and material-style normalisation, then paginates via `Sp_Outstanding_Query`. + +**Invocation:** Status: appears orphaned in the live DB. No `gdsconfigformmaster` binding, no `gdsmodule` hook, no other-routine reference. xly-src ships install script `script/标版/30100101/cost/SP_Inventory_InOutWarehouseCost.sql` under the `cost/` install set (a cost-accounting add-on bundle that may not be deployed on every tenant) — candidate for maintainer audit on tenants where cost accounting is enabled. diff --git a/en/docs/auto-catalog/procedures/SP_Inventory_InOutWarehouse_220709.md b/en/docs/auto-catalog/procedures/SP_Inventory_InOutWarehouse_220709.md index 8766c58..232e262 100644 --- a/en/docs/auto-catalog/procedures/SP_Inventory_InOutWarehouse_220709.md +++ b/en/docs/auto-catalog/procedures/SP_Inventory_InOutWarehouse_220709.md @@ -42,4 +42,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup variant of `SP_Inventory_InOutWarehouse` (`_220709` date-stamp suffix — 2022-07-09). Per wiki convention, backup objects are not narrated. + +**What it does:** Same as `SP_Inventory_InOutWarehouse` at the time of copy — drives the 材料库存台账 (material in/out warehouse ledger) report, building `InOutWarehouse` working set against `MitMaterialsStore`, `EleMaterialsStock`, `Viw_MitMaterialsCheck`, `MitMaterialsCutMaster/Slave` (paper-reel cut slips), then paginating via `Sp_Outstanding_Query`. + +**Invocation:** Not expected to be called from production; verify before relying on it. No form binding, no module hook, no other-routine reference, no `xly-src` reference for this date-stamped name. The live form 材料库存台账 (sId `19211681019715754498436890`) calls the un-suffixed `SP_Inventory_InOutWarehouse`. diff --git a/en/docs/auto-catalog/procedures/SP_Inventory_InOutWarehouse_221111.md b/en/docs/auto-catalog/procedures/SP_Inventory_InOutWarehouse_221111.md index 71b883d..a24217d 100644 --- a/en/docs/auto-catalog/procedures/SP_Inventory_InOutWarehouse_221111.md +++ b/en/docs/auto-catalog/procedures/SP_Inventory_InOutWarehouse_221111.md @@ -42,4 +42,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup variant of `SP_Inventory_InOutWarehouse` (`_221111` date-stamp suffix — 2022-11-11). Per wiki convention, backup objects are not narrated. + +**What it does:** Same as `SP_Inventory_InOutWarehouse` at the time of copy — drives the 材料库存台账 (material in/out warehouse ledger) report, working off `MitMaterialsStore`, `EleMaterialsStock`, `elematerialsstockmonth`, `Viw_MitMaterialsCheck`, the paper-reel cut chain (`MitMaterialsCutMaster/Slave`), and paginating via `Sp_Outstanding_Query`. + +**Invocation:** Not expected to be called from production; verify before relying on it. The live form 材料库存台账 calls the un-suffixed `SP_Inventory_InOutWarehouse`. Snapshot sits between `SP_Inventory_InOutWarehouse_220709` and the current version. diff --git a/en/docs/auto-catalog/procedures/SP_Inventory_Materials_Inout_new.md b/en/docs/auto-catalog/procedures/SP_Inventory_Materials_Inout_new.md index 88a342b..b84c959 100644 --- a/en/docs/auto-catalog/procedures/SP_Inventory_Materials_Inout_new.md +++ b/en/docs/auto-catalog/procedures/SP_Inventory_Materials_Inout_new.md @@ -15,4 +15,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 数据修复脚本 — parameterless ad-hoc data-repair procedure. Replays `Sp_System_AutoMaterialsPriceSingle` (per-material automatic costing) over every distinct material/style/warehouse/location combination touched by 生产领料单 (`mitproductionmaterialsmaster` + `MitProductionMaterialsSlave`) within a hardcoded window `'2024-12-28'` ≤ `tCreateDate` < `'2024-12-31 09:48:47'`. Looks like a forensic patch run to re-cost a specific batch of production picks after price-data drift. + +**What it does:** Opens cursor `Cur_Slave` over the deduplicated material combinations, counts them, then loops `Fetch Next` → `CALL Sp_System_AutoMaterialsPriceSingle(...)` for each row, capturing `@sCode` / `@sReturn` into discarded session variables. No parameters, no returns — fire-and-forget. + +**Invocation:** Status: appears orphaned. No form binding, no `gdsmodule` hook, no other-routine reference, no `xly-src` reference. The hardcoded December-2024 date range and "fire-and-forget" shape mark this as a one-shot manual repair tool intended for a DBA to run by hand; not part of any user flow. Candidate for removal once the repair has been confirmed. diff --git a/en/docs/auto-catalog/procedures/SP_Inventory_ProductCalcQty.md b/en/docs/auto-catalog/procedures/SP_Inventory_ProductCalcQty.md index 46d7145..91bffc7 100644 --- a/en/docs/auto-catalog/procedures/SP_Inventory_ProductCalcQty.md +++ b/en/docs/auto-catalog/procedures/SP_Inventory_ProductCalcQty.md @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成品库存 → 库存查询 — incremental finished-product stock recompute keyed to a single product / 自定义项 / warehouse / location key. Called as a step inside the audit/un-audit flow for finished-goods receipt and dispatch documents (送货单, 领料单, 转仓单, 调拨单, 收货单, 退货单 …); refreshes the `pitproductstore` ledger so downstream finished-product stock and out-of-store reports stay in sync per audit click. + +**What it does:** Coerces NULL inputs to `''`. Inside a labelled `top:` block, runs three remediation updates against `pitproductstore`: back-fills `sOrderId/sOrderSlaveId/sOrderNo` from sales-order forms, fills missing `dProductPrice/dProductMoney` from `salsalesorderslave` and from the initial-balance row (`sFormId='101251240115015991142363800'`). Then `CALL SP_Inventory_ProductInOutWareHouse(...)` to rebuild the warehouse in/out flow, and `LEAVE top` — the trailing `Sp_Sis_GetProductInventoryFormGuid` / period-aware path below the leave is dead-stop scaffolding kept for compatibility. + +**Invocation:** Chained from the standard sales / inventory `Sp_Calc_s*` audit procedures — found in the bodies of `Sp_Calc_sDgd`, `Sp_Calc_sDgdCL`, `Sp_Calc_sDgd_1226`, `Sp_Calc_sDgd_20250612`, `Sp_Calc_sDYDgd`, `Sp_Calc_sOpi1`, `Sp_Calc_sPaj`, `Sp_Calc_sPsa`, `Sp_Calc_sPst`/`_copy1`, `Sp_Calc_sPtr`, `Sp_Calc_sRgd`/`sRgd1`/`sRgd_new`, and `SP_Inventory_Product_Inout_new`, plus the named wrapper `call_SP_Inventory_ProductCalcQty`. Not bound directly to a form or `gdsmodule` hook. xly-src ships `script/标版/30100101/SP_Inventory_ProductCalcQty.sql`. diff --git a/en/docs/auto-catalog/procedures/SP_Inventory_ProductInOutWareHouse.md b/en/docs/auto-catalog/procedures/SP_Inventory_ProductInOutWareHouse.md index 9652d05..bfaffda 100644 --- a/en/docs/auto-catalog/procedures/SP_Inventory_ProductInOutWareHouse.md +++ b/en/docs/auto-catalog/procedures/SP_Inventory_ProductInOutWareHouse.md @@ -40,4 +40,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成品库存 → 库存查询 → 成品库存台账 — finished-product warehouse in/out 流水账 (movement ledger) per product / 自定义项 / warehouse / location across a date window. The `iUpdate=1` mode writes back into `pitproductstore` so `SP_Inventory_ProductCalcQty` and the standard audit chain rely on this proc to refresh the ledger after every audit click. + +**What it does:** Builds a temp table `InOutWarehouse` seeded with the opening balance (`pitproductstore` rows before `tStartDate` summed into `p_dProductMoneyOne`), inserts in-window receipts and dispatches with running average cost (`dProductPrice = SUM(money)/SUM(qty)`), joins `eleproduct` for `sProductNo` / display columns, then pages / counts through `Sp_Outstanding_Query`. When called from `SP_Inventory_ProductCalcQty` it runs in update mode (`iUpdate=1`) to back-write the recomputed cost/qty into `pitproductstore`. + +**Invocation:** Bound as the data source of form-master `19211681015115285157572790` (成品库存台账 — 库存查询). Also chained inside `Sp_Calc_sPst`/`_copy1`, `Sp_Calc_sPtr`, and `SP_Inventory_ProductCalcQty` for the audit-time stock refresh. xly-src ships `script/标版/30100101/SP_Inventory_ProductInOutWareHouse.sql` and `script/标版/optimize/SP_Inventory_ProductInOutWareHouse.sql`; `script/客户/千彩/SP_Inventory_ProductInOutWareHouse.sql` and `script/客户/无锡中江/SP_Inventory_ProductInOutWareHouseXGJE.sql` are customer overrides. diff --git a/en/docs/auto-catalog/procedures/SP_Inventory_ProductInOutWarehouseCost.md b/en/docs/auto-catalog/procedures/SP_Inventory_ProductInOutWarehouseCost.md index c5359ed..e61359c 100644 --- a/en/docs/auto-catalog/procedures/SP_Inventory_ProductInOutWarehouseCost.md +++ b/en/docs/auto-catalog/procedures/SP_Inventory_ProductInOutWarehouseCost.md @@ -38,4 +38,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Cost-column split of the finished-product warehouse-ledger family — sibling of `SP_Inventory_ProductInOutWareHouse` keyed to surface unit-cost and cost-money fields for cost analysis rather than qty/price. Trailing `sCode`/`sReturn` OUT params follow the standard error-channel convention. + +**What it does:** Mirrors the temp-table opening + in-window movements pattern of `SP_Inventory_ProductInOutWareHouse` against `pitproductstore` and `eleproductstock`, but the projected column lineup is the cost view (`dCostPrice`, `dCostMoney`, `dInProductMoney`). Pagination / count-JSON via `Sp_Outstanding_Query`. + +**Invocation:** Status: appears orphaned. No form-master binding, no `gdsmodule` hook, no other DB caller. Present only as `script/标版/30100101/cost/SP_Inventory_ProductInOutWarehouseCost.sql` in xly-src — install ships it but no live form points at it. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/SP_Inventory_ProductInOutWarehouseMoney.md b/en/docs/auto-catalog/procedures/SP_Inventory_ProductInOutWarehouseMoney.md index 124c8da..8758150 100644 --- a/en/docs/auto-catalog/procedures/SP_Inventory_ProductInOutWarehouseMoney.md +++ b/en/docs/auto-catalog/procedures/SP_Inventory_ProductInOutWarehouseMoney.md @@ -38,4 +38,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Money-column split of the finished-product warehouse-ledger family — sibling of `SP_Inventory_ProductInOutWareHouse` projecting product value (`dProductMoney`, foreign-currency money) for financial inventory-value reporting. Trailing `sCode`/`sReturn` OUT params follow the standard error-channel convention. + +**What it does:** Same temp-ledger build as `SP_Inventory_ProductInOutWareHouse` (opening balance, in/out movements over a date window, joins to `eleproduct`/`elewarehouse` for display) with the SELECT list scoped to money columns. Returns paginated rowset and count-aggregation JSON through `Sp_Outstanding_Query`. + +**Invocation:** Status: appears orphaned. No form-master binding, no `gdsmodule` hook, no other DB caller. Lives in xly-src as `script/标版/optimize/SP_Inventory_ProductInOutWarehouseMoney.sql` and `script/标版/30100101/cost/SP_Inventory_ProductInOutWarehouseMoney.sql`. Candidate for maintainer audit — the live 库存产品价值 form binds to `Sp_Inventory_ProductInOutStore`, not this warehouse-side variant. diff --git a/en/docs/auto-catalog/procedures/SP_Inventory_Product_Inout_new.md b/en/docs/auto-catalog/procedures/SP_Inventory_Product_Inout_new.md index ecef189..e60820d 100644 --- a/en/docs/auto-catalog/procedures/SP_Inventory_Product_Inout_new.md +++ b/en/docs/auto-catalog/procedures/SP_Inventory_Product_Inout_new.md @@ -15,4 +15,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 数据修复脚本 — parameterless ad-hoc data-repair procedure, the product-side counterpart of `SP_Inventory_Materials_Inout_new`. Replays `SP_Inventory_ProductCalcQty` over every distinct product/style/warehouse/location combination touched by 产品退货单 (`pitproductrejectmaster` + `pitproductrejectslave`) within a hardcoded window `'2024-12-26'` < `tCreateDate` < `'2024-12-31 09:38:49'`. Looks like a forensic patch run to rebuild product stock totals after the 2024-12 batch of product-return slips. + +**What it does:** Counts the impacted reject-slip rows (skipping `bNoObject=1`), opens cursor `Cur_OrderSlave` over them, and per fetch calls `SP_Inventory_ProductCalcQty(...)` with the customer/product/style/warehouse/location/date keys. No parameters, no returns — fire-and-forget. + +**Invocation:** Status: appears orphaned. No form binding, no `gdsmodule` hook, no other-routine reference, no `xly-src` reference. The hardcoded December-2024 date range marks this as a one-shot manual repair tool to run by hand; not part of any user flow. Candidate for removal once the repair has been confirmed. diff --git a/en/docs/auto-catalog/procedures/SP_Inventory_SemgoodsInOutWareHouse.md b/en/docs/auto-catalog/procedures/SP_Inventory_SemgoodsInOutWareHouse.md index 3acdc1b..c815985 100644 --- a/en/docs/auto-catalog/procedures/SP_Inventory_SemgoodsInOutWareHouse.md +++ b/en/docs/auto-catalog/procedures/SP_Inventory_SemgoodsInOutWareHouse.md @@ -44,4 +44,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 半成品出入库流水账 — semi-finished-goods (半成品 / Semgoods) counterpart of `SP_Inventory_ProductInOutWareHouse`. Warehouse in/out 流水账 over a date window for the semi-goods ledger keyed by product / 半成品零件 (`sPartsNameGuid`) / 工序 (`sProcessIdGuid`) / 版本 (`sVerGuid`) / 自定义项 / warehouse / location; used by the semi-goods audit chain to refresh the ledger after each audit click. + +**What it does:** Builds a temp ledger seeded with semi-goods opening balance before `tStartDate`, inserts in-window receipts and dispatches with running average cost, joins to `elesemgoods` / `elewarehouse` for display, then either returns the paginated rowset via `Sp_Outstanding_Query` or — when called in update mode (`iUpdate=1`) from a semi-goods audit proc — back-writes the recomputed qty/cost into the semi-goods stock table. + +**Invocation:** Chained from the semi-goods audit procedures `Sp_Calc_sSmi` (半成品入库) and `Sp_Calc_sSmo` (半成品出库). Not bound directly to a form-master in the live `gdsconfigformmaster`. xly-src ships `script/标版/30100101/SP_Inventory_SemgoodsInOutWareHouse.sql` and `script/标版/optimize/SP_Inventory_SemgoodsInOutWareHouse.sql`. diff --git a/en/docs/auto-catalog/procedures/SP_ProductStoreNowJN.md b/en/docs/auto-catalog/procedures/SP_ProductStoreNowJN.md index 34b15f3..c9b0269 100644 --- a/en/docs/auto-catalog/procedures/SP_ProductStoreNowJN.md +++ b/en/docs/auto-catalog/procedures/SP_ProductStoreNowJN.md @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 产品/印件信息 — paged "right now" inventory snapshot for a single 产品 (`sProductGuid`): builds a multi-section text report covering current stock, unfilled orders, in-production qty, rework qty, pending in-store-applications, and unaudited sales. `JN` suffix marks this as the 江南-customer fork of `Sp_ProductStoreNow` — the base proc is shipped per-tenant. + +**What it does:** Looks up `sProductNo`/`sProductName` from `eleproduct`, then builds rows in a temp table `Tmp(sId, sMemo)` — each row is a Chinese-formatted line: `库存数:…` from `eleproductstock`, `订单余数信息:` from `viw_mftworkorder` (where `bCheck=1`), `在生产数:` from same view filtered `bBillComplete=0`, 返工中的在生产数 from `Viw_PitProductReject` (`sType='2'`), 入库申请数 from `viw_pitproductinstore`, 已下单未审核数 from `viw_salsalesorder` (`bCheck=0 AND bInvalid=0`). Hands the temp table to `Sp_Outstanding_Query` for paging, total-count, and `bFilter` splicing. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep across all extensions) — likely a customer-side report variant kept alongside the standard `Sp_ProductStoreNow`; candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/SP_Return_Flow.md b/en/docs/auto-catalog/procedures/SP_Return_Flow.md index c2fa615..c84eeb2 100644 --- a/en/docs/auto-catalog/procedures/SP_Return_Flow.md +++ b/en/docs/auto-catalog/procedures/SP_Return_Flow.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 工作流 / 报价单 — toolbar action that withdraws (撤回) a started approval flow on a bill before the next approver acts on it, returning the bill to pre-approval state. COMMENT `'报价单撤回流程'`. Implemented generically on `biz_flow.sMasterTableName` so it works for any bill type whose flow has been started but not finished. + +**What it does:** Parses `sProInParam` JSON to get the bill id `p_sId` and a textarea reason. Looks up the latest `biz_flow` row for that bill (`sSrcId=p_sId` ORDER BY `start_time` DESC LIMIT 1), reading `instance_id`, `sMasterTableName`, `id`. Aborts with sCode=-1 if no flow found. Sets `biz_flow.type='已撤销'`, `end_time=NOW()`, `update_time=NOW()`, `update_by=Fun_GetLoginUserName(...)`. If `sMasterTableName` is known, executes dynamic `UPDATE SET sStatus=0 WHERE sId='p_sId' …`. Finally `DELETE FROM biz_todo_item WHERE instance_id=p_instanceId AND is_handle=0` to clear pending todos. The Activiti runtime-task delete is commented out (left for the runtime to clean up). + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 撤回流程 toolbar button on any flow-enabled bill names this proc as the action. Ships in xly-src as `xlyEntry/src/main/resources/flyway/V1.0.6__202354_SPReturnFlow.sql` (flyway migration) and `script/标版/upgrade/更新WAR脚本/20230210_消息、工作流、定时 模块/消息、工作流、定时 模块_20230210.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_AL_SHDCheckSave.md b/en/docs/auto-catalog/procedures/Sp_AL_SHDCheckSave.md index 55b6c92..4e2da7c 100644 --- a/en/docs/auto-catalog/procedures/Sp_AL_SHDCheckSave.md +++ b/en/docs/auto-catalog/procedures/Sp_AL_SHDCheckSave.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 送货单 (Delivery) save-time validation + qty redistribution for `saldelivergoodsslavechildren` (the batch-level child of 送货单 slave) — header says 业务单据保存校验. The `AL` prefix and `SHD` token mark this as a customer-specific helper rather than a standard `Sp_Check_s` proc. + +**What it does:** Rejects the save with localized code `-1` if any product/batch combination (`sProductId`,`sDefineNo`,`sDefineNo2`) appears more than once under the same master. Then for each `sProductId` under `sGuid` it sums the `dProductQty + dGiveQty` on `saldelivergoodsslave`, walks `saldelivergoodsslavechildren` rows in `iOrder` sequence using MySQL session variables (`@dQty`/`@dCheckQty`/`@sProduct`) to compute running totals, and rewrites `dProductQty`/`dUseQty` so the children sum exactly matches the slave-line qty (truncates the last child when the running total would exceed). Finally deletes any child rows whose final `dUseQty<=0`. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName`/`sSaveProNameBefore`/`sDeleteProName` slot in this database references it, no `gdsconfigformmaster.sSqlStr` embeds it, no other routine calls it, and `grep` finds zero call sites in `xly-src`. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Add_Flow.md b/en/docs/auto-catalog/procedures/Sp_Add_Flow.md index 27f6ead..b01bc50 100644 --- a/en/docs/auto-catalog/procedures/Sp_Add_Flow.md +++ b/en/docs/auto-catalog/procedures/Sp_Add_Flow.md @@ -31,4 +31,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Workflow engine — the canonical "submit-for-approval" entry point. Header says 插入流程 ("insert flow"). When a user clicks 审批 (Approve / submit-for-review) on any form that has a configured `gdsmoduleflow` row, this proc records the approval request as a `biz_flow` row carrying the source bill id, the form-defined column/value snapshot, the calc-proc name, and the do-call-proc payload — the workflow service then runs that flow asynchronously. + +**What it does:** Looks up the flow definition from `gdsmoduleflow` by `sModuleflowId` (yielding `sFlowType`, `sFlowTypeName`, `sReportId`, `sSrcFormId`, `sCalcProName`, `sMasterTableName`, `bReturnStart`); resolves the form's primary slave-table id (`p_sMaintableId`) via `gdsconfigformmaster`; optionally rebuilds report-payload state from `Sp_System_ReplaceField_JSON`; generates `sFlowId = newId()`; `INSERT INTO biz_flow` with type/name/title/reason/start_time/apply-user/tenant fields and the caller-provided `sTableParams`/`sTableParamsValue`/`sDoCallPro`. + +**Invocation:** Called by `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., "Sp_Add_Flow", ...)`, which is itself invoked from `CheckExamineFlowServiceImpl.doSendCheckFolw()` — the approval-submit service endpoint. 47+ `Sp_Apply_Flow_*` specialised pre-flow procs (one per business object: SalSaleOrder, MaterialsApply, QualityAccident*, ProcessChange, PurpurchaseOrder, etc.) reference this name; in the flow architecture they are the per-form calc-procs invoked alongside this proc. + +Caveats: body contains a stray `SELECT ddd FROM bbbb;` (~line 108) that looks like leftover debug — this would error at runtime unless the table exists; flag for maintainer audit. Also the version under `script/标版/upgrade/定时器/Sp_Add_Flow.sql` and `flyway/V1.0.7__202354_SpAddFlow.sql` / `V2.0.10__2023915_SpAddFlow.sql` are install/upgrade artefacts — the live version is whichever Flyway version migrated last. diff --git a/en/docs/auto-catalog/procedures/Sp_AdjustMoneyCl_BtnRepair.md b/en/docs/auto-catalog/procedures/Sp_AdjustMoneyCl_BtnRepair.md index c56d967..102969b 100644 --- a/en/docs/auto-catalog/procedures/Sp_AdjustMoneyCl_BtnRepair.md +++ b/en/docs/auto-catalog/procedures/Sp_AdjustMoneyCl_BtnRepair.md @@ -24,4 +24,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 报销申请 (expense-reimbursement) module — batch-edit button proc for the travel/差旅 reimbursement form (the `Cl` suffix marks the 差旅 variant). Header says 差旅报销单调整金额. Sibling of `Sp_AdjustMoney_BtnRepair`; the only difference is the recompute formula uses the four travel components (`dAirfare`, `dHotelExpense`, `dOtherExpense`, `dTravelAllowance`) instead of `dAccountMoney`. + +**What it does:** Parses `sProInParam` JSON; reads `$.changeValue.dAdjustMoney` and `$.changeValue.sAdjustMemo`; validates `sAdjustMemo` is non-empty (returns `Fun_Sis_GetConstNew('sAdjReasonCantEmpty')`, `sCode=-1` otherwise); iterates `$.params[*].value[*].sId` and runs `UPDATE expensereimbursementslave SET dAdjustMoney=…, dMaterialsMoney = dAirfare + dHotelExpense + dOtherExpense + dTravelAllowance + dAdjustMoney, sAdjustMemo=… WHERE sId=…` for each selected id. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master `sSqlStr`/`sConfigSqlStr`, `gdsmodule` hooks, `gdsconfigformslave.sButtonParam` / `sButtonEnabled`, other routines, xly-src grep) — candidate for maintainer audit. Same orphan condition as the non-Cl sibling: `_BtnRepair` procs dispatch via `sButtonParam` but no button row currently references this proc name. + +Caveat: same as the non-Cl sibling — the empty-memo branch sets `sCode=-1` but does not `LEAVE top`, so the update still runs. diff --git a/en/docs/auto-catalog/procedures/Sp_AdjustMoney_BtnRepair.md b/en/docs/auto-catalog/procedures/Sp_AdjustMoney_BtnRepair.md index 33ac5b9..cb45ffc 100644 --- a/en/docs/auto-catalog/procedures/Sp_AdjustMoney_BtnRepair.md +++ b/en/docs/auto-catalog/procedures/Sp_AdjustMoney_BtnRepair.md @@ -24,4 +24,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 报销申请 (expense-reimbursement) module — batch-edit button proc for the general expense reimbursement form. Header says 费用报销单调整金额. When the user multi-selects reimbursement detail rows and clicks the BtnBsOperation.BtnRepair dialog, the proc was expected to apply a single `dAdjustMoney` value (with an `sAdjustMemo` justification) to every selected `expensereimbursementslave` row, recomputing `dMaterialsMoney = dAccountMoney + dAdjustMoney`. Follows the canonical `_BtnRepair` template signature (`sProInParam` JSON + `sMakePerson`/`sBrId`/`sSuId` IN, `sCode`/`sReturn` OUT). + +**What it does:** Parses `sProInParam` JSON; reads `$.changeValue.dAdjustMoney` and `$.changeValue.sAdjustMemo`; validates `sAdjustMemo` is non-empty (returns `Fun_Sis_GetConstNew('sAdjReasonCantEmpty')`, `sCode=-1` otherwise); iterates `$.params[*].value[*].sId` and runs `UPDATE expensereimbursementslave SET dAdjustMoney=…, dMaterialsMoney = dAccountMoney + dAdjustMoney, sAdjustMemo=… WHERE sId=…` for each selected id. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master `sSqlStr`/`sConfigSqlStr`, `gdsmodule` hooks, `gdsconfigformslave.sButtonParam` / `sButtonEnabled`, other routines, xly-src grep) — candidate for maintainer audit. `_BtnRepair` procs are normally dispatched dynamically via `sButtonParam` on a button row, but no row in `gdsconfigformslave` currently references this proc name; either the button was removed during a refactor or the form was decommissioned. + +Caveat: validation sets `sCode=-1` but does not `LEAVE top`, so the empty-memo branch still continues and applies the update regardless — bug worth flagging. diff --git a/en/docs/auto-catalog/procedures/Sp_AfterPost_sAcc.md b/en/docs/auto-catalog/procedures/Sp_AfterPost_sAcc.md index 8195e62..60257f0 100644 --- a/en/docs/auto-catalog/procedures/Sp_AfterPost_sAcc.md +++ b/en/docs/auto-catalog/procedures/Sp_AfterPost_sAcc.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量事故报告 (quality-accident report) — the `Sp_AfterPost_*` family is the canonical post-审核 (post-approval) calc-proc tier in xly's bill lifecycle (alongside `Sp_beforeSave_*`, `Sp_afterSave_*`, `Sp_Calc_*`, `Sp_Check_*`, `Sp_saveReturn_*`). The `_sAcc` variant is meant to fire after a quality-accident bill's approval to refresh the master row's "has attachment" flag. + +**What it does:** Validates `sData` is JSON (else returns `sCode=1`); runs a single `UPDATE mftqualityaccidentMaster A LEFT JOIN (SELECT COUNT(sId) iCount, sParentId FROM eleproductfile GROUP BY sParentId) B ON A.sId=B.sParentId SET A.bFile = IF(IFNULL(B.iCount,0)>0,1,0) WHERE sId=sGuid` so the accident row reflects whether any `eleproductfile` attachments exist for it. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep, schema `*Post*` columns) — candidate for maintainer audit. The lifecycle slot the proc was designed for (`Sp_AfterPost_*`) is not wired in the current Java Bill flow; the attachment-flag refresh has either been moved into a different calc-proc or dropped. diff --git a/en/docs/auto-catalog/procedures/Sp_AfterPost_sQtt.md b/en/docs/auto-catalog/procedures/Sp_AfterPost_sQtt.md index d50f0cb..f574b7c 100644 --- a/en/docs/auto-catalog/procedures/Sp_AfterPost_sQtt.md +++ b/en/docs/auto-catalog/procedures/Sp_AfterPost_sQtt.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 报价单 (quotation / quote) — historic post-审核/反审核 hook for the quotation form. The `Sp_AfterPost_*` family is the canonical post-审核 calc-proc tier in xly's bill lifecycle (alongside `Sp_beforeSave_*`, `Sp_afterSave_*`, `Sp_Calc_*`, `Sp_Check_*`, `Sp_saveReturn_*`). For `_sQtt` (sQtt = QuoQuotation) the proc supervised the audit-approval side-effects: locking check, cross-flow validation, master flag updates, and downstream propagation to sales-chance and product-customer rows. + +**What it does:** `iFlag=1` (审核 path) — refuses if the bill is locked in `SysLocking`; if `CkxDefineCheck=1`, cursors over `quoquotationslave` and `viw_quoquotation × quoquotationprocess × quoquotationcontrol` calling `Sp_System_CheckFlow` to enforce cross-document flow rules; updates `QuoQuotationMaster` (`bCheck=1`, `sStatus=1`, `sCheckPerson`, `tCheckDate`); sets `salsaleschanceproduct.sQuotationId` from `viw_QuoQuotation`; rebuilds `bFailure`/`tFailureDate` so prior approved quotes for the same customer+product become expired; mirrors price into `eleproductcustomer (dQuotationPrice, tQuotationDate)`. `iFlag=0` (反审 path) — refuses uncheck if `bCheck=0`; calls `Sp_Bill_Used('QuoQuotationMaster', ..., 'SaleTrial', ...)` to refuse uncheck if downstream-used; clears the same fields and rolls `bFailure` back to the most recent surviving quote. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep, schema `*Post*` columns) — candidate for maintainer audit. Despite the rich body, the `Sp_AfterPost_*` lifecycle slot is not wired in the current Java Bill flow; equivalent quotation post-审核 logic now flows through `Sp_Check_sQtt` / `QuoquotationServiceImpl`. + +Caveats: the second cursor inside `iFlag=1` sets `ReplaceField_Sum` from `viw_mftworkorderprocess` (work-order view), not from the `viw_quoquotation × quoquotationprocess × quoquotationcontrol` join its own cursor uses — likely copy-paste, the loop bound is wrong; hardcodes `M.sFormId = '101251240115016036175782700'` (tenant-specific form GUID) in the failure-flag propagation. diff --git a/en/docs/auto-catalog/procedures/Sp_AfterPost_sSod.md b/en/docs/auto-catalog/procedures/Sp_AfterPost_sSod.md index 502edc6..f4a328b 100644 --- a/en/docs/auto-catalog/procedures/Sp_AfterPost_sSod.md +++ b/en/docs/auto-catalog/procedures/Sp_AfterPost_sSod.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售订单 (sales order). Header says "销售订单执行后执行过程(线上获取订单,名片单页自动审核后,调用)" — designed as the post-审核 hook for orders auto-approved from the online/B2C 名片 single-page order channel. Sibling of `Sp_AfterPost_sAcc` / `Sp_AfterPost_sQtt` in the canonical post-审核 calc-proc tier. + +**What it does:** Empty stub. Both `iFlag=1` and `else` branches contain nothing but `LEAVE top` — the proc returns `sCode=1` without touching any table. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep, schema `*Post*` columns) — candidate for maintainer audit. The proc is a placeholder reserving the lifecycle slot for the 名片单页/B2C auto-approval flow but the body was never filled in; production sales-order post-审核 logic flows through `Sp_Check_sSod` / `Sp_Calc_sSodAfter`. diff --git a/en/docs/auto-catalog/procedures/Sp_Ai_AddCommonAfter.md b/en/docs/auto-catalog/procedures/Sp_Ai_AddCommonAfter.md index 98573d1..dc52bce 100644 --- a/en/docs/auto-catalog/procedures/Sp_Ai_AddCommonAfter.md +++ b/en/docs/auto-catalog/procedures/Sp_Ai_AddCommonAfter.md @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** AI-assistant order-insertion handler — header says `AI_调用下单 插入订单`. Intended to be invoked by the AI/chatbot path: receives a `sControlName` (Chinese button label e.g. `送货下单`) plus a JSON `sData` payload, validates the source-form / control config, hardcodes `p_sTableName='saldelivergoodsmaster'`, generates a bill number by `DATE_FORMAT(NOW(),'...')`, and inserts a delivery-goods header row tied to seed-tenant `'1111111111'`. + +**What it does:** Validates `sSrcFormId` and `sControlName` non-empty (returns localized error otherwise). Hardcodes target table = `saldelivergoodsmaster` and form sId `11811781131121915179924491520`. Most of the per-form-derived lookups (`gdsconfigformslave` join, `Sp_Sis_GetMaxNo` call, dynamic `p_sTableName`/`p_sFormId`) are commented out — the live path only generates a date-string bill number, builds a single-row INSERT skeleton, and returns. + +**Invocation:** Status: appears orphaned. No `gdsconfigformslave.sControlName`/`sActiveId` binding, no `gdsmodule` hook, no other routine references it, and `grep` finds zero call sites anywhere in `xly-src` (no Java handler dispatches `Sp_Ai_*`). Candidate for maintainer audit — AI-assistant scaffolding apparently never wired into a live control. Hardcodes seed-tenant `sBrandsId='1111111111'`. diff --git a/en/docs/auto-catalog/procedures/Sp_Ai_AddCommonAfterNew.md b/en/docs/auto-catalog/procedures/Sp_Ai_AddCommonAfterNew.md index f5a8b3c..858dcc9 100644 --- a/en/docs/auto-catalog/procedures/Sp_Ai_AddCommonAfterNew.md +++ b/en/docs/auto-catalog/procedures/Sp_Ai_AddCommonAfterNew.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** AI-assistant order-insertion handler, generic-form variant — header says `AI_调用下单 插入订单`. Newer revision of `Sp_Ai_AddCommonAfter` that derives `p_sTableName`/`p_sFormId` dynamically from `gdsconfigformslave` keyed on the AI-provided `sControlName`, then reads `sSlaveId` + `operateType` out of the JSON `sData` payload. Adds an OUT `sBillId` so the caller can chain follow-up actions on the inserted row. + +**What it does:** Validates `sSrcFormId`/`sControlName` non-empty. Looks up the target-form `sActiveId`/`sTbName`/`sChinese` via `gdsconfigformslave` JOIN `gdsconfigformmaster` filtered by the AI-provided `sChinese` button name. Parses `sSlaveId` and `operateType` from the JSON payload. The rest of the body (the actual INSERT/UPDATE branches keyed on `operateType`) is largely commented out — this is scaffolding for an AI-driven generic-create flow. + +**Invocation:** Status: appears orphaned. No `gdsconfigformslave` binding, no `gdsmodule` hook, no other routine references it, and `grep` finds zero call sites anywhere in `xly-src`. Candidate for maintainer audit — AI-assistant scaffolding apparently never wired into a live control. Hardcodes seed-tenant `sBrandsId='1111111111'`. diff --git a/en/docs/auto-catalog/procedures/Sp_Ai_AddQuoQuoAfter.md b/en/docs/auto-catalog/procedures/Sp_Ai_AddQuoQuoAfter.md index 66352a4..fb869a2 100644 --- a/en/docs/auto-catalog/procedures/Sp_Ai_AddQuoQuoAfter.md +++ b/en/docs/auto-catalog/procedures/Sp_Ai_AddQuoQuoAfter.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** AI-assistant quotation-insertion handler — header says `AI_调用下单 插入订单`. Receives a free-form natural-language prompt parsed into a JSON `sData` payload describing one quotation (产品/数量/规格/材料/印后工艺/...), then materializes a row into the 报价单 / `quoquotation*` family on form sId `101251240115016076506222050`. + +**What it does:** Reads `sUserName` from `sftlogininfo` (defaults `p_sMakePerson='ai'` if not found). Wraps the inbound `sData` as a JSON array, extracts product/customer/process/材料/印后工艺 fields into local variables (with one hardcoded fallback `sProductClassifyId='20240108210154670452968456436630'`), looks up matching `eleproduct` / `elecustomer` / `eleprocess` ids using `Fun_getProductMaxStyle` (which itself is orphan-via-dead-chain) and other helper queries, and constructs the quotation master + slave INSERT skeleton. Targets seed-tenant `'1111111111'` only. + +**Invocation:** Status: appears orphaned. No `gdsconfigformslave` binding, no `gdsmodule` hook, no other routine references it, and `grep` finds zero call sites anywhere in `xly-src`. Candidate for maintainer audit — AI-assistant scaffolding apparently never wired into a live control. Hardcodes seed-tenant + classification GUID + form GUID `101251240115016076506222050`. diff --git a/en/docs/auto-catalog/procedures/Sp_Ai_AddSalsalOrder.md b/en/docs/auto-catalog/procedures/Sp_Ai_AddSalsalOrder.md index c692617..3265284 100644 --- a/en/docs/auto-catalog/procedures/Sp_Ai_AddSalsalOrder.md +++ b/en/docs/auto-catalog/procedures/Sp_Ai_AddSalsalOrder.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** AI-assistant 销售订单 (Sales Order) generator — header says `AI_调用下单 插入订单`. Stub implementation: when the AI flow says "create me a sales order", this proc allocates a new bill number on `salsalesordermaster` for form `101251240115016002469445380` and returns a success message including the number. + +**What it does:** Calls `SP_Sis_GetMaxNo('salsalesordermaster', p_sNewWorkOrderNo, '101251240115016002469445380', '', '', '', '1111111111','1111111111')` to mint a new bill number, then sets `sReturn = CONCAT('下单成功,单据号:', p_sNewWorkOrderNo)`. The `JSON_TABLE`-based loop over the inbound `sData` payload (which would insert the actual master+slave rows) is commented out. + +**Invocation:** Status: appears orphaned. No `gdsconfigformslave` binding, no `gdsmodule` hook, no other routine references it, and `grep` finds zero call sites anywhere in `xly-src`. Candidate for maintainer audit — AI-assistant scaffolding apparently never wired into a live control. Hardcodes seed-tenant + the same form GUID used by `Sp_Ai_AddWorkOrder`. diff --git a/en/docs/auto-catalog/procedures/Sp_Ai_AddWorkOrder.md b/en/docs/auto-catalog/procedures/Sp_Ai_AddWorkOrder.md index 7624062..9dbf5d7 100644 --- a/en/docs/auto-catalog/procedures/Sp_Ai_AddWorkOrder.md +++ b/en/docs/auto-catalog/procedures/Sp_Ai_AddWorkOrder.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** AI-assistant 生产工单 (Work Order) generator — header says `AI_调用下单 插入订单`. Stub implementation: when the AI flow says "create me a work order", this proc allocates a new bill number on `mftworkordermaster` for form `101251240115016002469445380` and returns an anchor-tagged success message. + +**What it does:** Calls `SP_Sis_GetMaxNo('mftworkordermaster', p_sNewWorkOrderNo, '101251240115016002469445380', '', '', '', '1111111111','1111111111')` to mint a new bill number, then sets `sReturn = CONCAT('施工单己经生成,单号为 ', p_sNewWorkOrderNo, ',点击查看详情')`. The `JSON_TABLE`-based loop over the inbound `sData` payload (which would insert master+slave rows) is commented out. + +**Invocation:** Status: appears orphaned. No `gdsconfigformslave` binding, no `gdsmodule` hook, no other routine references it, and `grep` finds zero call sites anywhere in `xly-src`. Candidate for maintainer audit — AI-assistant scaffolding apparently never wired into a live control. Hardcodes seed-tenant + the same form GUID used by `Sp_Ai_AddSalsalOrder` (note: form `101251240115016002469445380` is the 生产工单 module). diff --git a/en/docs/auto-catalog/procedures/Sp_Ai_AiGlobalAgentQuestionThread.md b/en/docs/auto-catalog/procedures/Sp_Ai_AiGlobalAgentQuestionThread.md index 6d069e4..eca072d 100644 --- a/en/docs/auto-catalog/procedures/Sp_Ai_AiGlobalAgentQuestionThread.md +++ b/en/docs/auto-catalog/procedures/Sp_Ai_AiGlobalAgentQuestionThread.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Operates on `ai_global_agent_question_sql` — part of the AI-features subsystem, which the wiki excludes from its core ERP scope (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Writes/updates `ai_global_agent_question_sql` with cached SQL for global agent Q&A. + +**Invocation:** Not surveyed; out of scope for this catalog. diff --git a/en/docs/auto-catalog/procedures/Sp_Ai_AiSqlErrorHistoryThread.md b/en/docs/auto-catalog/procedures/Sp_Ai_AiSqlErrorHistoryThread.md index d25694e..1c8b6d3 100644 --- a/en/docs/auto-catalog/procedures/Sp_Ai_AiSqlErrorHistoryThread.md +++ b/en/docs/auto-catalog/procedures/Sp_Ai_AiSqlErrorHistoryThread.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Operates on `ai_sql_error_history` — part of the AI-features subsystem, which the wiki excludes from its core ERP scope (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Writes/updates `ai_sql_error_history` with failing SQL attempts and later corrections. + +**Invocation:** Not surveyed; out of scope for this catalog. diff --git a/en/docs/auto-catalog/procedures/Sp_Ai_AiUserAgentQuestionThread.md b/en/docs/auto-catalog/procedures/Sp_Ai_AiUserAgentQuestionThread.md index 9b09f92..36a8935 100644 --- a/en/docs/auto-catalog/procedures/Sp_Ai_AiUserAgentQuestionThread.md +++ b/en/docs/auto-catalog/procedures/Sp_Ai_AiUserAgentQuestionThread.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Operates on `ai_user_agent_question` — part of the AI-features subsystem, which the wiki excludes from its core ERP scope (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Writes/updates `ai_user_agent_question` with per-user agent question history. + +**Invocation:** Not surveyed; out of scope for this catalog. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_CLReject.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_CLReject.md index a69efd2..41c1ea1 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_CLReject.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_CLReject.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料报废 (Material Reject/Scrap) workflow-apply data builder — header says 流程启动前调用-材料报废. One of the per-form `Sp_Apply_Flow_
` procs the workflow engine invokes before starting an approval chain on `mitproductionmaterialsmaster` (单据类型: 材料报废 / 返工领料 / etc). + +**What it does:** Resolves four approver tiers from `eleemployee` by `iPosition` — 财务经理 (11), 总经理 (1), 品管 (18), 国内事业副总 (34). Builds `p_sMaterialsName` by aggregating `mitproductionmaterialsslave` joined to `elematerials` into a `物料名称➜规格➜数量➜单位` summary. Emits `sTableParams` = label-JSON, `sTableParamsValue` = value-JSON of `sBillNo`/`sBussinessType`/`sMaterialsMemo`/`sMemo` plus a derived `iBusinessType` enum (1=材料报废, 2=返工领料, 3=other) and the four approver lists (`OneFlow`/`TwoFlow`/`ThreeFlow`/`TenFlow`). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` where `sApplyProName` is read from `gdsmoduleflow.sApplyProName` on the 材料报废 workflow config row (`gdsmoduleflow` is empty in this database — workflow configs are tenant-provisioned per deployment). diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_CPReject.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_CPReject.md index 9cfd1d9..0d26720 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_CPReject.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_CPReject.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成品报废 (Finished-Product Reject/Scrap) workflow-apply data builder — header says 流程启动前调用-成品报废. One of the per-form `Sp_Apply_Flow_` procs the workflow engine invokes before starting an approval chain on `pitproductrejectmaster` (where `iSourceType` distinguishes 成品报废 / 返工出库 / 子产品出库). + +**What it does:** Resolves three approver tiers from `eleemployee` by `iPosition` — 财务经理 (33), 总经理 (1), 储运二级部门负责人 (32). Builds `p_sProductName` by aggregating `PitProductRejectSlave` joined to `eleproduct` into a `产品名称➜规格➜数量➜单位` summary. Emits `sTableParams` = label-JSON, `sTableParamsValue` = value-JSON of `sBillNo`/`sSourceType` (derived label from `iSourceType` 4/5/7) / `sProductMemo` / `sMemo` plus `iRejectStatus` and the three approver lists (`OneFlow`/`TwoFlow`/`ThreeFlow`). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` where `sApplyProName` is read from `gdsmoduleflow.sApplyProName` on the 成品报废 workflow config row (`gdsmoduleflow` is empty in this database — workflow configs are tenant-provisioned per deployment). diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Cahreceipt.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Cahreceipt.md index 02018ab..b2cc280 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Cahreceipt.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Cahreceipt.md @@ -1,7 +1,7 @@ # `Sp_Apply_Flow_Cahreceipt` (procedure) -> 流程启动前调用-收款单舍入金额,比如说超过100元的, - 二级部门、一级部门,财务审核, +> 流程启动前调用-收款单舍入金额,比如说超过100元的, + 二级部门、一级部门,财务审核, 超过2000的总经理审核 @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 收款单 (Cash Receipt) workflow-apply data builder — header says "流程启动前调用-收款单舍入金额,比如说超过100元的, 二级部门、一级部门,财务审核, 超过2000的总经理审核". One of the per-form `Sp_Apply_Flow_` procs in the `Sp_Apply_Flow_*` family that the workflow engine invokes before kicking off an approval chain to populate the approval card's display labels, value JSON, and candidate-approver lists. + +**What it does:** Resolves the four approver tiers (二级部门 / 一级部门 / 财务 / 总经理) from `eleemployee` joined through `sisdepart` for the 制单人 plus `iPosition`-filtered managers (`iPosition=11` for finance, `iPosition=1` for GM). Builds `p_sProductName` by aggregating `cahreceiptslave` rows where `dRoundingMoney > 0` into a `产品名称➜开票金额➜舍入金额` summary. Emits two outputs: `sTableParams` = JSON of column-label translations; `sTableParamsValue` = JSON containing the resolved field values + the four approver name lists (`OneFlow`/`TwoFlow`/`ThreeFlow`/`FourFlow`) joined from `cahreceiptmaster` + `elecustomer`. The `sSrcReportData` JSON output is fully commented out (defaults flow through `Sp_Add_Flow`). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` where `sApplyProName` is read from `gdsmoduleflow.sApplyProName` on the 收款单 workflow config row (`gdsmoduleflow` is empty in this database — workflow configs are tenant-provisioned per deployment). See [`Sp_Add_Flow`](./Sp_Add_Flow.md) for the surrounding flow-insert entry point. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Fksq.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Fksq.md index 3b39f9a..7031bbc 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Fksq.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Fksq.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 费用报销 / 付款申请 (catalog header: "流程启动前调用-费用报销单") — per-form workflow-apply data builder in the `Sp_Apply_Flow_*` family. Dispatches across two related forms via `sFormGuid` branching: `1691254111217018313281950` (差旅 / 出差报销 column-label set) and `1691254111217018313528400` (付款申请 column-label set), defaulting to the standard 费用报销 layout. + +**What it does:** Resolves seven approver tiers from `eleemployee` and `sisdepart`: 部门负责人 / 部门领导 (joined to `expensereimbursementmaster.sDepartId` + `sMasterDepartId`), 费用会计 (`sisposition.sName='税务费用核算专员'`), 财务负责人 / 国内事业副总 / 总经理 / 副董执行董事 (`iPosition` 11 / 34 / 1 / 38). Applies one 烟包-aware override: if `advanceCostCheckMaster.iCigPack=2` (non-tobacco-pack) and the 部门领导 resolves to `'李国哲'`, the 部门领导 is reassigned to the employee of `sisdepart.sId='17344171700007029955590024910000'`. Pulls 费用细项 / 备注 from `expensereimbursementslave`. Builds two outputs: `sTableParams` (column-label JSON keyed by `sFormGuid`) and `sTableParamsValue` (JSON of master values + the seven approver name lists `OneFlow` / `TowFlow` / `ThreeFlow` / `FourFlow` / `SixFlow` / `SevenFlow` / `EightFlow`). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` where `sApplyProName` is read from `gdsmoduleflow.sApplyProName` on the 费用报销 / 付款申请 workflow config row. `gdsmoduleflow` is empty in this database — workflow configs are tenant-provisioned per deployment. See [`Sp_Add_Flow`](./Sp_Add_Flow.md) for the surrounding flow-insert entry point. + +Flags: the 烟包 override reads `iCigPack` from `advanceCostCheckMaster` (predecessor 出差预核算单) but the rest of the proc keys on `expensereimbursementmaster.sId=sGuId` — if the proc is invoked with a 出差预核算 sGuId the master joins return no rows; the typo `p_TowFlow` (should be `Two`) is consistent throughout but harmless. Form GUIDs `1691254111217018313281950` / `1691254111217018313528400` do not exist in this DB's `gdsconfigformmaster` (tenant-specific). diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Fybx.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Fybx.md index 357ede8..d420b0f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Fybx.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Fybx.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 费用报销 / 付款申请 (catalog header: "流程启动前调用-费用报销单") — near-clone of [`Sp_Apply_Flow_Fksq`](./Sp_Apply_Flow_Fksq.md); the only structural difference is that the 烟包 flag (`iCigPack`) is read from `expensereimbursementmaster` rather than `advanceCostCheckMaster`. The duplicated proc presumably exists because 费用报销 (Fybx) and 付款申请 (Fksq) point at different source tables for the 烟包 flag. + +**What it does:** Resolves seven approver tiers from `eleemployee` joined through `sisdepart`: 部门负责人 / 部门领导 (via `expensereimbursementmaster.sDepartId` + `sMasterDepartId`), 费用会计 (`sisposition.sName='税务费用核算专员'`), 财务负责人 / 国内事业副总 / 总经理 / 副董执行董事 (`iPosition` 11 / 34 / 1 / 38). Applies the same 李国哲 override when `iCigPack=2`. Branches `sTableParams` (column-label JSON) on `sFormGuid` ∈ {`1691254111217018313281950`, `1691254111217018313528400`} or falls through to the default 费用报销 label set. Builds `sTableParamsValue` (JSON of master values from `expensereimbursementmaster` + `sExpenseDetail`/`sMemo` from `expensereimbursementslave` + the seven approver name lists `OneFlow` / `TowFlow` / `ThreeFlow` / `FourFlow` / `SixFlow` / `SevenFlow` / `EightFlow` + `iCigPack`). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` where `sApplyProName` is read from `gdsmoduleflow.sApplyProName` on the 费用报销 workflow config row. `gdsmoduleflow` is empty in this database — workflow configs are tenant-provisioned per deployment. + +Flags: near-duplicate of `Sp_Apply_Flow_Fksq` (same approver-resolution block, same form-branch labels, same JSON shape); one variant probably superseded the other but both remain installed. Form GUIDs are tenant-specific (not present in this DB). diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MachineFix.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MachineFix.md index 71c3dc0..dc8ef8a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MachineFix.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MachineFix.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 设备维修 → 设备管理 (catalog header: "流程启动前调用-设备维修申请") — per-form workflow-apply data builder backing the 维修申请 / 设备报修 单据 (form `192116811124916389453432110` / `101251240115016076506222750` referenced in the commented-out report-payload block). One of the per-form `Sp_Apply_Flow_` procs that the workflow engine invokes before kicking off the maintenance-approval chain. + +**What it does:** Resolves the制单人's 二级部门 (department-head) name list by chaining `eptmachinerepairfixmaster.sMakePerson` → `eleemployee.sDepartId` → `sisdepart.sEmployeeId` → `eleemployee.sEmployeeName`, into `p_OneFlow`. Builds `p_sShowMemo` by aggregating `eptmachinerepairfixslave` rows into `'故障类别:{sMaintenanceCycle}➜故障描述:{sMaintainContent}'` joined by newline. Emits `sTableParams` (column-label JSON for 维修申请单/设备名称/报修申请人/报修部门/故障明细/故障描述) and `sTableParamsValue` (JSON of master values joined across `eptmachinerepairfixmaster`/`eleemployee`/`sisdepart`/`elemachine` + `OneFlow` + `iOut` flag — `iOut=0` when `sMachineId='17030614920003057848750279902700'`, else `1`, hardcoded machine sId). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` where `sApplyProName` is read from `gdsmoduleflow.sApplyProName` on the 维修申请 workflow config row. `gdsmoduleflow` is empty in this database — workflow configs are tenant-provisioned per deployment. + +Flags: `iOut` machine-sId branch hardcodes a tenant-specific 设备 GUID (`17030614920003057848750279902700`) — if cloned to another deployment the predicate becomes a no-op. The output JSON sets the `"sDeptName"` key twice (second overwrites the first — likely paste error). diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsApply.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsApply.md index f2fad08..0bb3bde 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsApply.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsApply.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 补料申请 → 现场物料管理 → 生产执行 (catalog header: "流程启动前调用-补料申请"; module sId `12012615914116370198739420`, supplementary-material request kicked off when production needs additional material mid-run). Per-form workflow-apply data builder backing the 补料申请单据 (form sId `12012615914116395420094430`, tbName `mitproductionapplymaster`). + +**What it does:** Resolves four approver tiers from `eleemployee`: 品质部 / 技术部 / 机修部 (`iPosition` 18 / 19 / 29) and 车间主任 (制单人的部门负责人 — chain `mitproductionapplymaster.sMakePerson` → `eleemployee.sDepartId` → `sisdepart.sEmployeeId` → `eleemployee.sEmployeeName`, into `p_FourFlow`). Aggregates `mitproductionapplyslave` rows into `p_sMaterialsMemo` as `'材料名称:{sMaterialsName}➜补料数量:{dAuxiliaryQty}'` joined by newline. Emits `sTableParams` (column-label JSON: 补料单号/补料信息/参与部门/备注) and `sTableParamsValue` (JSON of master values + `iFlowTrend` + the four approver name lists `OneFlow`/`TwoFlow`/`ThreeFlow`/`FourFlow`). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` where `sApplyProName` is read from `gdsmoduleflow.sApplyProName` on the 补料申请 workflow config row. `gdsmoduleflow` is empty in this database — workflow configs are tenant-provisioned per deployment. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsApplyLL.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsApplyLL.md index e6da78f..2e32ff7 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsApplyLL.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsApplyLL.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 领料申请 → 现场物料管理 → 生产执行 (catalog header: "流程启动前调用-领料申请"; module sId `101251240115016056026513090`, the material-issue request submitted before warehouse releases stock). Per-form workflow-apply data builder backing the 领料申请单据 (form sId `101251240115016056026129010`, tbName `mitproductionapplymaster`). + +**What it does:** Resolves the领料人员's 二级部门负责人 list as the single approver tier (`p_OneFlow`) — explicitly *not* the制单人, because the same person may submit on behalf of multiple departments (e.g., 机修 and 技术). Resolution chain: `mitproductionapplymaster.sEmployeeId` → `eleemployee.sDepartId` → `sisdepart.sEmployeeId` → `eleemployee.sEmployeeName`. Pulls 使用部门 from `mitproductionapplymaster.sUseDeptId` → `sisdepart.sName` and 设备名称 from `mitproductionapplymaster.sMachineId` → `elemachine.sMachineName`. Aggregates `mitproductionapplyslave` rows into `p_sMaterialsMemo` as `'材料名称:{sMaterialsName}➜领料申请数量:{dAuxiliaryQty}'` joined by newline. Emits `sTableParams` (column-label JSON: 领料申请单号/领料信息/使用部门/设备名称/备注) and `sTableParamsValue` (JSON of master values + `iSource` + `OneFlow`). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` where `sApplyProName` is read from `gdsmoduleflow.sApplyProName` on the 领料申请 workflow config row. `gdsmoduleflow` is empty in this database — workflow configs are tenant-provisioned per deployment. The proc-header comment explicitly notes: "领料申请:除工单领料外,其它领料增加一个审核节点审批通过后领料 (目前有领料出现错误的问题)". diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsBack.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsBack.md index 292c0d3..0af0042 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsBack.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsBack.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 退料申请 → 现场物料管理 → 生产执行 (catalog header: "流程启动前调用-退料申请") — per-form workflow-apply data builder for the material-return-from-floor flow. Backing form is the 退料申请 variant of the 领料申请 single-table `mitproductionapplymaster`. The first approver tier mirrors `Sp_Apply_Flow_MaterialsApplyLL` (领料人员's 二级部门负责人, not the制单人) so that the same person submitting on behalf of multiple departments still routes to the correct boss. + +**What it does:** Resolves four approver tiers — 主任 (制单人's 部门负责人 by `eleemployee.sEmployeeName=B.sMakePerson` chain), 物控经理 (`iPosition=6`), 品质经理 (`iPosition=18`), and 领料申请人's 二级部门负责人 (looked up via the originating `mitproductionapplyslave.sSrcId` → `mitproductionmaterialsmaster.sEmployeeId` → `sisdepart` chain, stored in `p_FourFlow`). Aggregates `mitproductionapplyslave` rows into `p_sMaterialsMemo` as `'材料名称:{sMaterialsName}➜退料数量:{dAuxiliaryQty}'`. Translates `sBackType` to text via CASE (1→正常退料, 2→变更换料, 3→质量问题, else→虚拟退料). Emits `sTableParams` (退料单号/退料信息/退料类型/备注) and `sTableParamsValue` (master values + `iFlowBack` + the four approver name lists). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` where `sApplyProName` is read from `gdsmoduleflow.sApplyProName` on the 退料申请 workflow config row. `gdsmoduleflow` is empty in this database — workflow configs are tenant-provisioned per deployment. The companion update-proc [`Sp_Apply_Flow_MaterialsBack_Proc1`](./Sp_Apply_Flow_MaterialsBack_Proc1.md) writes `iFlowBack` back to the master when the approver changes the route. + +Flags: contains a stray `select p_OneFlow;` mid-body — debug echo left in production. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsBack_Proc1.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsBack_Proc1.md index f807bdd..4130ed3 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsBack_Proc1.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsBack_Proc1.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 退料申请 → 现场物料管理 → 生产执行 (catalog header: "退料申请 过程1") — companion update-proc to [`Sp_Apply_Flow_MaterialsBack`](./Sp_Apply_Flow_MaterialsBack.md). Where the latter is the 流程启动前 data-builder, this proc is the in-flow step-handler invoked when an approver re-routes the request by changing the `iFlowBack` selector. + +**What it does:** Reads `iFlowBack` from the inbound `sData` JSON (`JSON_EXTRACT(sData, '$.iFlowBack')`, stripping quote marks), then `UPDATE mitproductionapplymaster SET iFlowBack = p_iFlowBack WHERE sId = sGuid`. Returns the standard `sCode/sReturn` workflow contract. + +**Invocation:** Dispatched dynamically by the workflow engine on an in-flow step. Java side runs `doProByNameFlow(...)` with the proc name pulled from the workflow step's calc-proc configuration (per the same `gdsmoduleflow` family pattern). `gdsmoduleflow` is empty in this database — workflow configs are tenant-provisioned per deployment. No direct callers in DB routines or xly-src grep. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsChange.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsChange.md index 0cde7b0..13921ae 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsChange.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsChange.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料变更单 → 生产单据 → 生产管理 (catalog header: "流程启动前调用-材料变更"; module sId `101251240115016119087978230`, form sId `101251240115016119087978910`, tbName `mftprocesschangemaster`). Per-form workflow-apply data builder triggered when the shop floor needs to swap a planned material for an alternative — the approval chain is gated by a 差额 (price-difference) threshold of 5000. + +**What it does:** Resolves three approver tiers: 物控经理 (`iPosition=6`), 供应链部长 (`iPosition=5`), 技术部长 (`iPosition=9`). Aggregates `mftprocesschangematerials` rows (joined twice to `elematerials` — once for source, once for replacement) into `p_sChangeMemo` as `'源材料:{name}➜{style}➜{qty}***新材料:{name}➜{style}➜{qty}'` joined by newline. Computes `p_dDifferenceMoney` = `SUM(A.dMaterialsQty*C.dRecentPurchasePrice - A.dOriginalMaterialsQty*B.dRecentPurchasePrice)` and sets `p_iOut=1` when the difference exceeds 5000 (gating the escalation node). Emits `sTableParams` (变更单号/差额/变更信息) and `sTableParamsValue` (master values + `iOut` + the three approver name lists). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` where `sApplyProName` is read from `gdsmoduleflow.sApplyProName` on the 材料变更 workflow config row. `gdsmoduleflow` is empty in this database — workflow configs are tenant-provisioned per deployment. + +Flags: 差额 uses `dRecentPurchasePrice` (most-recent purchase price, not the row's frozen price), so the threshold gating depends on live `elematerials` rather than the variant's recorded prices. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsPrice.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsPrice.md index d37bcd5..04f3984 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsPrice.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsPrice.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 物料指导价 / 材料询价比价 (catalog header: "流程启动前调用-物料指导价"; backing table `elematerialscoachmaster`, "材料价格辅导单" — the master record of the guidance-price proposal that finance must approve before quoting / purchasing). Per-form workflow-apply data builder for the price-setting approval flow. + +**What it does:** Resolves eight approver tiers: 二级部门经理 (制单人's department head, chained via `eleemployee.sEmployeeName=B.sMakePerson` → `sisdepart.sEmployeeId`), 供应商管理部 (employees of hardcoded department sId `'20231120093820561209518017890988'`), 供应链部长 / 总经理 (`iPosition` 5 / 1), 国内副总 (`iPosition=34`), 副董执行董事 (`iPosition=38`), 财务经理 (`iPosition=11`), 董事长 (`iPosition=39`). Emits `sTableParams` (单据号/申请人/备注) and `sTableParamsValue` (master values + the eight approver name lists `OneFlow`/`TwoFlow`/`ThreeFlow`/`FourFlow`/`SixFlow`/`SevenFlow`/`EightFlow`/`NineFlow` — `FiveFlow` is skipped). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` where `sApplyProName` is read from `gdsmoduleflow.sApplyProName` on the 物料指导价 workflow config row. `gdsmoduleflow` is empty in this database — workflow configs are tenant-provisioned per deployment. + +Flags: 供应商管理部 lookup hardcodes department sId `'20231120093820561209518017890988'` — tenant-specific. The approver-tier numbering skips `FiveFlow` (visible gap in the JSON) — likely a slot reserved for a later-added position that never landed. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsReturn.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsReturn.md index 501fdeb..d9b412d 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsReturn.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsReturn.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 研发反馈审核 / 研发工单 (catalog header: "流程启动前调用-研发反馈审核") — per-row workflow-apply data builder triggered from a `mftworkorderslave` row of a 研发工单 (R&D work order). The "Return" in the proc name refers to the feedback-return loop (车间主管 → 技术工程 → 技术部长 → 供应链部长), not material return. + +**What it does:** Resolves one approver tier (供应链部长, `iPosition=5`) into `p_OneFlow`. Unwraps the inbound `sGuid` if it is a JSON envelope of the shape `{"params":[{"key":"slave","value":[{"sSlaveId":"..."}]}]}` — used when the proc is invoked from a multi-select 自定义按钮; if JSON parse fails it sets `sCode=-8 / sReturn='请选择数据'` and `LEAVE top`. After unwrapping, `sGuid` is treated as a `mftworkorderslave.sId`. Emits `sTableParams` (研发工单号/研发材料/车间主管反馈/技术工程反馈/技术部长反馈/测试是否合格) and `sTableParamsValue` (JSON joining `mftworkorderslave`/`mftworkordermaster`/`elematerials` for the slave-row 反馈 columns + `OneFlow`). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` where `sApplyProName` is read from `gdsmoduleflow.sApplyProName` on the 研发反馈 workflow config row. `gdsmoduleflow` is empty in this database — workflow configs are tenant-provisioned per deployment. + +Flags: `Declare p_iType Int Default 0` is declared but never used. The JSON-unwrap path is the only branch that sets `sGuid` correctly; if a caller passes a raw slave-row sId (not wrapped), the proc immediately returns `sCode=-8`. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsTest.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsTest.md index af8cb9b..db2d7c6 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsTest.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsTest.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料检验 / 来料检验 → 质量管理单据 → 质量管理 (catalog header: "流程启动前调用-材料检验"; module sId `15828617570008732160077596657000`, form sId — incoming-materials IQC inspection). Per-form workflow-apply data builder for the inbound-material inspection (`qlycomematerialstestmaster`) approval flow, gated by `iTestResult` (合格/不合格 outcome) and `iTypeResult`/`iTypeResult1` (disposition routes). + +**What it does:** Resolves five approver tiers: SQE (`iPosition=17`), 物控人员 (the制单人 of the linked `purpurchaseordermaster` via `qlycomematerialstestmaster.sPurChaseOrderId`), 物控经理 (`iPosition=6`), 品质经理 (`iPosition=18`), 生产部长 (`iPosition=8`). Reads `iTestResult` into `p_iOut` (gates 不合格 escalation nodes). Emits `sTableParams` (检验单号/采购订单号/材料名称/不合格数/检验备注) and `sTableParamsValue` (JSON joining `qlycomematerialstestmaster`/`elematerials` for `sBillNo`/`sPurChaseOrderNo`/`sMaterialsName`/`dNoQualifyQty`/`sMemo` + `iOut`/`iTypeResult`/`iTypeResult1` + the five approver name lists). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` where `sApplyProName` is read from `gdsmoduleflow.sApplyProName` on the 材料检验 workflow config row. `gdsmoduleflow` is empty in this database — workflow configs are tenant-provisioned per deployment. The companion in-flow update-procs are [`Sp_Apply_Flow_MaterialsTest_Proc1`](./Sp_Apply_Flow_MaterialsTest_Proc1.md) (`iTypeResult1` setter) and [`Sp_Apply_Flow_MaterialsTest_Proc2`](./Sp_Apply_Flow_MaterialsTest_Proc2.md) (`iTypeResult` setter). + +Flags: `p_TwoFlow` is loaded as a single `sMakePerson` *name string* rather than a `Group_CONCAT`-style list (other tiers are lists) — downstream consumers must accept both shapes. `Declare p_iOut1 Int Default 0` is unused. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsTest_Proc1.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsTest_Proc1.md index cb3fcd4..5f4672d 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsTest_Proc1.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsTest_Proc1.md @@ -30,4 +30,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 来料检验 → 质量管理单据 → 质量管理 (catalog header: "来料检验 过程1") — companion in-flow update-proc to [`Sp_Apply_Flow_MaterialsTest`](./Sp_Apply_Flow_MaterialsTest.md). Where the latter is the 流程启动前 data-builder, this proc is the in-flow step-handler invoked when an approver sets the `iTypeResult1` disposition route on the IQC unfit-material disposition flow. + +**What it does:** Reads `iTypeResult1` from the inbound `sData` JSON (`JSON_EXTRACT(sData, '$.iTypeResult1')`, stripping quotes), then `UPDATE qlycomematerialstestmaster SET iTypeResult1 = p_sTypeResult1, iTestResult = (CASE WHEN p_sTypeResult1=1 THEN 0 ELSE iTestResult END) WHERE sId = sGuid`. The `iTestResult` reset to 0 when `iTypeResult1=1` reflects the rule: choosing disposition #1 (typically 让步接收) clears the pass/fail flag for downstream reposting. Returns the standard `sCode/sReturn` workflow contract. + +**Invocation:** Dispatched dynamically by the workflow engine on an in-flow step. Java side runs `doProByNameFlow(...)` with the proc name pulled from the workflow step's calc-proc configuration. `gdsmoduleflow` is empty in this database — workflow configs are tenant-provisioned per deployment. No direct callers in DB routines or xly-src grep. + +Flags: variable declared `varchar(100)` then assigned to an integer column — implicit cast. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsTest_Proc2.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsTest_Proc2.md index 3ac7b43..8f7c5e5 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsTest_Proc2.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_MaterialsTest_Proc2.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 来料检验 → 质量管理单据 → 质量管理 (catalog header: "来料检验 过程2") — companion in-flow update-proc to [`Sp_Apply_Flow_MaterialsTest`](./Sp_Apply_Flow_MaterialsTest.md), paired with [`Sp_Apply_Flow_MaterialsTest_Proc1`](./Sp_Apply_Flow_MaterialsTest_Proc1.md). Where Proc1 writes the `iTypeResult1` slot, Proc2 writes the `iTypeResult` slot — the two disposition routes are tracked separately because the IQC unfit-material disposition flow has two parallel decision steps. + +**What it does:** Reads `iTypeResult` from the inbound `sData` JSON (`JSON_EXTRACT(sData, '$.iTypeResult')`, stripping quotes), then `UPDATE qlycomematerialstestmaster SET iTypeResult = p_sTypeResult WHERE sId = sGuid`. Returns the standard `sCode/sReturn` workflow contract. + +**Invocation:** Dispatched dynamically by the workflow engine on an in-flow step. Java side runs `doProByNameFlow(...)` with the proc name pulled from the workflow step's calc-proc configuration. `gdsmoduleflow` is empty in this database — workflow configs are tenant-provisioned per deployment. No direct callers in DB routines or xly-src grep. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsCheck.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsCheck.md index d99d6ab..f36d8e9 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsCheck.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsCheck.md @@ -1,9 +1,9 @@ # `Sp_Apply_Flow_OpsCheck` (procedure) -> 流程启动前调用-发外对账修改单价 - 对账改了单价总价也会变,发票也涉及到改价格。 - 这个到时候需要增加审批流程,比如说超过100元的, - 二级部门、一级部门,财务审核, +> 流程启动前调用-发外对账修改单价 + 对账改了单价总价也会变,发票也涉及到改价格。 + 这个到时候需要增加审批流程,比如说超过100元的, + 二级部门、一级部门,财务审核, 超过2万的总经理审核 @@ -33,4 +33,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 发外对账 → 发外加工流程 → KPI流程操作菜单 (catalog header: "流程启动前调用-发外对账修改单价 — 对账改了单价总价也会变,发票也涉及到改价格 / 二级部门、一级部门,财务审核, 超过2万的总经理审核"). Per-form workflow-apply data builder for the subcontracted-process reconciliation (`opsoutsidecheckingmaster`) when reconciliation changes the unit price. + +**What it does:** Resolves six approver tiers: 二级部门 (制单人's department head), 一级部门 (制单人's grandparent department head), 财务 (`iPosition=11`), 总经理 (`iPosition=1`), 副董执行董事 (`iPosition=38`), 国内事业副总 (`iPosition=34`). Computes 是否烟包 (`p_iOut`) by joining `opsoutsidecheckingslave` → `salsalesordermaster` → `elecustomer` → `siscustomerproperty.sName='烟包'`. Aggregates `p_dChangeMoney` = `SUM(dMaterialsMoney) - SUM(dMaterialsPrice*dMaterialsQty)` across slave rows where the current price differs from the source-工序发外 row's price, *excluding* a hardcoded list of 7 工序 sIds (模切版/菲林/etc) that are exempt from price-change approval. Builds `p_sProcessMemo` / `p_sProductName` summaries grouped by the source form (`opsoutsideprocessmaster.sFormId='101801153119616594919790770'` for 工序发外 vs `'192116810113315234963208090'` for 整单发外). Emits `sTableParams` (发外对账单号/供应商名称/差异金额/对账信息/对账备注) and `sTableParamsValue` (master values + `iOut` + the six approver name lists `OneFlow`/`TwoFlow`/`ThreeFlow`/`FourFlow`/`NineFlow`/`TenFlow`). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` where `sApplyProName` is read from `gdsmoduleflow.sApplyProName` on the 发外对账 workflow config row. `gdsmoduleflow` is empty in this database — workflow configs are tenant-provisioned per deployment. + +Flags: the exempt-工序 list (7 hardcoded process sIds: `1691254111216986535514710` etc, including `17024524340001397977945229603600`, `17050515990006986455489932151000`, `17054858080003494616334115346000`) and the source-form sIds are tenant-specific — cloning to a different deployment loses the price-change-exemption rule. Approver-tier numbering uses `NineFlow`/`TenFlow` slots (gaps at FiveFlow/SixFlow/SevenFlow/EightFlow), aligning with the family-wide convention where tier numbering reserves slots for related procs. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsProcess.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsProcess.md index d449b9f..9a36dbf 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsProcess.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsProcess.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 工序发外 → 发外加工流程 → KPI流程操作菜单 (catalog header: "流程启动前调用-工序发外"; module sId `192116810113315232400087230`, form sId `192116810113315232402114180`, tbName `opsoutsideprocessmaster`). Per-form workflow-apply data builder for the process-level subcontracting flow, gated by multiple price-vs-guidance comparisons and 是否烟包 (tobacco-pack route). + +**What it does:** Resolves ten approver tiers: 发外 (`iPosition=14`), 报价员 (`iPosition=35`), 生产+报价+营销 会签 (`iPosition in (3,8,16)`), 生产部长 (制单人's grandparent department head — climbs `sisdepart.sParentId` twice), 总经理 (`iPosition=1`), 副董执行董事 (`iPosition=38`), 国内事业副总 (`iPosition=34`), 财务总鉴 (`iPosition=11`), 董事长 (`iPosition=39`). Computes seven escalation flags: `iOut2` (exempt 7 工序 sIds — same hardcoded list as `Sp_Apply_Flow_OpsCheck`), `iOut` (any row exceeds 指导价), `iOut3` (exceeds 报价员报价 given that it already exceeds 指导价), `iOut4` (exceeds 报价 by >2000), `iOut1` (sum of dMaterialsMoney > 2000), `iOut5` (是否烟包 — joins customer/product to `siscustomerproperty.sName='烟包'` or 产品 classify root sId `'16624527080007919539418229414000'`). Aggregates `p_sProcessMemo` per slave row as `'工序名称:{n}➜发外单价:{p}➜指导价:{g}➜报价员报价:{q}➜总价:{m}'`. Emits `sTableParams` (发外单号/外协商/发外总价/发外信息/发外加工原因/发外备注) and `sTableParamsValue` (master values + all 5 `iOut*` flags + the ten approver name lists). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` where `sApplyProName` is read from `gdsmoduleflow.sApplyProName` on the 工序发外 workflow config row. `gdsmoduleflow` is empty in this database — workflow configs are tenant-provisioned per deployment. + +Flags: the 7-element exempt 工序-sId list and the 烟包 classification root sId `'16624527080007919539418229414000'` are tenant-specific. The 生产部长 resolution climbs `sisdepart.sParentId` *twice* — fragile if a department's hierarchy depth changes. `iOut3` is computed inside an `IF p_iCount1 > 0` block so it's only set when 指导价 was already exceeded; otherwise it remains 0 from the declared default. `iOut4` uses `(A.dMaterialsQty*A.dQuotationPrice)>2000` rather than the commented-out `(A.dOldMaterialsMoney-...)>2000` — comment suggests the metric was revised. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsProduct.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsProduct.md index 25b35b2..5b2f0dc 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsProduct.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsProduct.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 整单发外 → 发外加工流程 → KPI流程操作菜单 (catalog header: "流程启动前调用-成品外购"; module sId `192116810113315234963208090`, form sId `192116810113315234988665330`, tbName `opsoutsideprocessmaster`). Per-form workflow-apply data builder for the single-row (per-slave) whole-order subcontracting flow. Compared with the bulk variants `OpsProductMore` / `OpsProductMorebecome`, this proc evaluates pricing on a single `opsoutsideprocessslave` row. + +**What it does:** Resolves four approver tiers: 营销部长 (`iPosition=3`) merged with 对应部门部长 (`iPosition=8` 生产部长 or `iPosition=5` 供应链部长 depending on whether the制单人's `sDepartId` parent equals `'20231120093814639059733069696942'`), 总经理 (`iPosition=1`), 二级部门经理 (制单人's department head). Pulls the linked `salsalesorderslave` row's pricing (`dQuoRate`/`dQuoPrice`/`dProductPrice`) and the slave's `dMaterialsPrice` into `p_dQuoRate`/`p_dQuoPrice`/`p_dOpsPrice`/`p_dProductPrice`. Computes four escalation flags: `iOut` (毛利率 ≤ 1.05), `iOut1` (发外单价 > 基准价×(毛利率−0.05)), `iOut2` (发外单价 > 基准价×毛利率), `iOut3` (发外单价 > 基准价). All flags short-circuit to 0 when `p_dProductPrice=0`. Emits `sTableParams` (发外单号/外协商/总金额/产品信息/发外备注) and `sTableParamsValue` (single-row JSON from `opsoutsideprocessslave`/`eleproduct`/`opsoutsideprocessmaster`/`elesupply` + the four `iOut*` flags + the four approver name lists). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` where `sApplyProName` is read from `gdsmoduleflow.sApplyProName` on the 整单发外 workflow config row. `gdsmoduleflow` is empty in this database — workflow configs are tenant-provisioned per deployment. + +Flags: `p_OneFlow` is built as `CONCAT(p_OneFlow,',',p_TwoFlow)` — so 营销部长 names get the 对应部门部长 names appended. Downstream consumers must accept the comma-joined dual list. Department-classification GUID `'20231120093814639059733069696942'` (生产 root) is hardcoded — tenant-specific. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsProductMore.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsProductMore.md index 3054a6d..5aa8e5c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsProductMore.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsProductMore.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 整单发外 → 发外加工流程 → KPI流程操作菜单 (catalog header: "流程启动前调用-成品外购"; backing table `opsoutsideprocessmaster`). Extended (multi-slave) variant of [`Sp_Apply_Flow_OpsProduct`](./Sp_Apply_Flow_OpsProduct.md) — evaluates pricing thresholds across *all* `opsoutsideprocessslave` rows for the master, with a richer 10-tier approver list and extra `iOut4` (烟包) flag. + +**What it does:** Resolves ten approver tiers: 营销部长 (`iPosition=3`), 对应部门部长 (生产部长 `iPosition=8` / 供应链 `iPosition=40` / 采购 `iPosition=5` — branched by制单人's `sisdepart.sParentId` against three tenant-specific dept root sIds), 总经理 (`iPosition=1`), 二级部门经理 (制单人's department head), 营销经理 (`iPosition=37`), 营销负责人 (`iPosition=34`), 副董执行董事 (`iPosition=38`), 财务经理 (`iPosition=11`), 董事长 (`iPosition=39`), 核价审核1 (`iPosition=35`). Counts five price-comparison conditions (`p_iCount1..5`) across all slave rows where `bChild=0`: any-row price=0, 毛利率 ≤ 1.05, 发外单价 > 基准价, 发外单价 > 基准价×(毛利率−0.05), 发外单价 > 订单单价. Computes 是否烟包 (`p_iOut4`) by joining 产品 → `sisproductclassify` parent → classify root sId `'16624527080007919539418229414000'`. Builds `p_sProductName` (per-slave aggregate `'产品名称:{n}➜数量:{q}➜价格:{m}'`) and `p_dTotalMoney` = `SUM(dMaterialsMoney)`. Emits `sTableParams` (发外单号/外协商/总金额/产品信息/发外备注) and `sTableParamsValue` (master + the 5 `iOut*` flags + the 10 approver name lists). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` where `sApplyProName` is read from `gdsmoduleflow.sApplyProName` on the 整单发外 multi-row workflow config row. `gdsmoduleflow` is empty in this database — workflow configs are tenant-provisioned per deployment. + +Flags: three department-classification GUIDs hardcoded: `'20231120093814639059733069696942'` (生产 root), `'17344173190001090119214960551400'` (供应链 root), and the 烟包 root `'16624527080007919539418229414000'` — tenant-specific. `p_iCount2` (基准价×毛利率) is calculated but `iOut2` is set from `p_iCount4` (订单单价) — variable naming drift between query and assignment. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsProductMorebecome.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsProductMorebecome.md index 2a316b4..dc34f49 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsProductMorebecome.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OpsProductMorebecome.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 整单发外 / 成品外购 单价变更 → 发外加工流程 → KPI流程操作菜单 (catalog header: "流程启动前调用-成品外购单价变更"; backing table `opsoutsideprocessbecomemaster` — the "become" / 变更 variant of the integral-purchase flow, used when an existing 整单发外 needs a re-pricing). Per-form workflow-apply data builder modelled after [`Sp_Apply_Flow_OpsProductMore`](./Sp_Apply_Flow_OpsProductMore.md) but trimmed to four approver tiers. + +**What it does:** Resolves four approver tiers: 营销部长 (`iPosition=3`), 对应部门部长 (生产部长 `iPosition=8` / 供应链 `iPosition=40` / 供应链部长 `iPosition=5` — branched by制单人's `sDepartId` parent), 总经理 (`iPosition=1`, then immediately overwritten by `iPosition=11` 财务总鉴), 财务总鉴 (`iPosition=11`). Counts five pricing conditions across `opsoutsideprocessbecomeslave` rows: price>0, 毛利率 ≤ 1.05, 发外单价 > 基准价, 发外单价 > 基准价×(毛利率−0.05), 发外单价 > 基准价×毛利率. Builds `p_sProductName` (per-slave aggregate `'产品名称:{n}➜数量:{q}➜价格:{m}'`) and `p_dTotalMoney` = `SUM(dMaterialsMoney)`. Emits `sTableParams` (发外单号/外协商/总金额/产品信息/发外备注) and `sTableParamsValue` (master values from `opsoutsideprocessbecomemaster`/`elesupply` + 4 `iOut*` flags + the four approver name lists `OneFlow`/`TwoFlow`/`ThreeFlow`/`FourFlow`). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` where `sApplyProName` is read from `gdsmoduleflow.sApplyProName` on the 成品外购单价变更 workflow config row. `gdsmoduleflow` is empty in this database — workflow configs are tenant-provisioned per deployment. + +Flags: real bug — `p_ThreeFlow` is set first to 总经理 (`iPosition=1`) then immediately overwritten by 财务总鉴 (`iPosition=11`), so the 总经理 tier is never returned. `p_iCount3` is also assigned twice (once for 基准价×(毛利率−0.05), once for 基准价×毛利率), the second assignment shadows the first, and `p_iCount4` is referenced but never assigned — so `iOut2` (`基准价×毛利率`) is always 0. Department-classification GUIDs `'20231120093814639059733069696942'` (生产 root) and `'17344173190001090119214960551400'` (供应链 root) are hardcoded — tenant-specific. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Order.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Order.md index 9e68275..75a7a0a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Order.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Order.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售订单 — workflow-apply data builder for the 销售订单 approval flow. Returns the JSON payload (`sTableParams` schema + `sTableParamsValue`) that the BACK approval UI renders on the order before routing it. + +**What it does:** Reads `salsalesordermaster`/`salsalesorderslave` for `sGuid`, joining `elecustomer`+`eleproduct`. Two branches: when the slave's `sProductInfo` JSON is populated, it extracts `sProductName`/`sProductUnit` from that JSON; otherwise it falls back to the joined `eleproduct` row. Sums `dProductQty` and takes MAX(`dProductMoney`) across all slaves of the order. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` where `sApplyProName` is read from `gdsmoduleflow.sApplyProName`. Table is empty in this DB — workflow configs are tenant-provisioned per deployment. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OrderChange.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OrderChange.md index fb0b886..4c8a585 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OrderChange.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OrderChange.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 订单变更单 — workflow-apply data builder for the 销售订单变更 approval flow. Builds the approver-tier roster and the change-detail summary that the BACK approval UI shows before routing. + +**What it does:** From `salsalesorderbecomemaster`/`salsalesorderbecomeslave` for `sGuid`, builds change-line memo (`sProductName`+`dProductQty`+`dProductMoney`+`sEvaluateNo`) and returns JSON with `iBecome`/`iCancel` mapped to display strings (订单取消/数量变更/数量单价同时变更/单价变更). Resolves seven approver tiers from `eleemployee.iPosition` (6=物控经理, 23=销售管理, 19=技术部经理, 21=生产计划部经理 OR `iPosition1=21`, 3=营销部长, 11=财务经理, 15=报价主管). Sets `iOut`/`iOut1` flags for "已下采购单" and "已下工单" by joining `purpurchaseorderdetail` and `mftworkorderslave` to the becomemaster. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` where `sApplyProName` is read from `gdsmoduleflow.sApplyProName`. Table empty in this DB — workflow configs tenant-provisioned per deployment. Superseded variant `Sp_Apply_Flow_OrderChangeNew` exists with extra dept-based tier logic. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OrderChangeNew.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OrderChangeNew.md index 5e868b7..baeacd6 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OrderChangeNew.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_OrderChangeNew.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 订单变更单新 — newer workflow-apply data builder for the 销售订单变更 approval flow, replacing `Sp_Apply_Flow_OrderChange`. Adds ten approver tiers + seven scenario flags + 营销一二部 dept-derived branching. + +**What it does:** Same `salsalesorderbecomemaster`/`Slave` payload as the original, but tier resolution is widened: `iPosition` 35/6/19/21/14/1/37/11 cover 核价主管/物控经理/技术部长/生产计划经理/发外部门经理/总经理/销售经理/财务经理; one tier (`p_FiveFlow`) is computed dynamically by walking `opsoutsideprocessmaster`→`sisdepart`→`eleemployee` to find the 外购部门 manager for the order's outsource record. Climbs `sisdepart.sParentId` to classify the apply-employee's parent dept as 营销一部 (`17344171700007029955590024910000`) or 营销二部 (`20231120093814840397991462270158`) and emits `p_saledept` 1/2. Sets seven flags `p_iOut1`..`p_iOut7` for downstream: 已下采购, 已下工单, 是否有外购, 是否有发外, 是否有分切工序 (process sId `1691254111216986535514780`), 是否有领料, 是否烟包 (product-classify root `16624527080007919539418229414000`). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB). + +Flags: tenant-specific dept-root + process + product-classify GUIDs hardcoded (won't carry to a clone). Form-sId predicates `'192116810113315234963208090'` (工序发外) and `'101801153119616594919790770'` (发外) used to filter `opsoutsideprocessmaster` flavor — also tenant-baked. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessChange.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessChange.md index ac1930e..c965461 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessChange.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessChange.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 工艺变更单 — workflow-apply data builder for the 工艺变更 approval flow on `mftprocesschangemaster`. Builds the ten-tier approver roster and the variance summary that the BACK approval UI surfaces before routing. + +**What it does:** Reads `mftprocesschangemaster` for `sGuid`; payload exposes `sBeforeMemo`/`sAfterMemo` change diff, `iChangeType` mapped to display strings (材料变更/工艺变更/文件内容变更/暂停/启动) plus `iFileType` (保留-新增版本/删除-原版本替换), `dPoorMoney` cost variance, and `iOrderChange` flag. Resolves ten approver tiers: `iPosition` 35/19/4/6/3/8/37 are 核价员/技术经理/客服经理/物控经理/营销部长/生产部长/营销经理; 客服 (`p_TwoFlow`) is the order-sales 制单人 chained via `salsalesordermaster`→`mftworkorderslave`→`mftprocesschangemaster`; 车间主任 (`p_ThreeFlow`) is the dept-leader of the change-master 制单人 via `sisdepart.sEmployeeId`; 工艺 (`p_FourFlow`) is the work-order 制单人. Sets four scenario flags: 是否车间提出 (`iProposeType`), 变更类型 (`iChangeType`), `iOut2`=YFGD prefix in `sWorkOrderNo`, 材料是否下过订单 via `purpurchaseorderdetail`→`mftworkordermaterials` join, 是否烟包 via product-classify root `16624527080007919539418229414000`. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB). Companion procs `_Proc1`/`_Proc2` write back `dPoorMoney`/`iOrderChange` from in-flow user input. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessChange_Proc1.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessChange_Proc1.md index 7b694d7..85fb8b0 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessChange_Proc1.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessChange_Proc1.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 工艺变更 — in-flow updater for the 工艺变更 approval flow. Persists the approver-supplied 差异金额 (`dPoorMoney`) onto `mftprocesschangemaster` at one of the intermediate approval steps. + +**What it does:** Parses `dPoorMoney` from the inbound `sData` JSON (with `REPLACE(... ,'"','')` to strip JSON quoting) and UPDATEs `mftprocesschangemaster.dPoorMoney WHERE sId = sGuid`. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., proName, ...)` where `proName` is read from a workflow-step config row (companion to the Apply-time proc `Sp_Apply_Flow_ProcessChange`). Wired as one of the intermediate-task callbacks of that flow. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessChange_Proc2.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessChange_Proc2.md index 61a538f..9615bc6 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessChange_Proc2.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessChange_Proc2.md @@ -30,4 +30,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 工艺变更 — second in-flow updater (sibling of `_Proc1`) for the 工艺变更 approval flow. Persists the approver-supplied 订单变更标志 (`iOrderChange`) onto `mftprocesschangemaster`. + +**What it does:** Parses `iOrderChange` from the inbound `sData` JSON and UPDATEs `mftprocesschangemaster.iOrderChange WHERE sId = sGuid`. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., proName, ...)` from a workflow-step config row. Wired as one of the intermediate-task callbacks of the `Sp_Apply_Flow_ProcessChange` flow. + +Flag: catalog header copied verbatim from `_Proc1` (says "工艺变更 过程1" but is the 过程2 variant). diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessTest.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessTest.md index 8e0d624..28fa12e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessTest.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessTest.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 工序发外检验 — workflow-apply data builder for the 发外检验单 approval flow on `Qlyoutsideproducttestmaster`. Builds the five-tier approver roster and the inspection summary for the BACK approval UI. + +**What it does:** Reads `Qlyoutsideproducttestmaster` for `sGuid` joined to `eleprocess`/`elesupply`/`eleproduct`. Payload carries `sBillNo`, `sWorkOrderNo`, `sCheckMemo` (= `工序名➜产品名➜供应商名`), `dNoQualifyQty`, `sMemo`, plus `iTypeResult`/`iTypeResult1` for downstream branching. Resolves five tiers from `eleemployee.iPosition` (17=SQE, 14=外协经理, 18=品质经理, 8=生产部长); 外协人员 (`p_TwoFlow`) is the source-outsource 制单人 chained through `opsoutsideprocessmaster.sId=Qlyoutsideproducttestmaster.sSrcId`. Also reads `iTestResult` into `p_iOut` for the dispatch JSON. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB). Companion procs `_Proc1`/`_Proc2` write back `iTypeResult1`/`iTypeResult` from in-flow user input. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessTest_Proc1.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessTest_Proc1.md index ec1a3e5..f217c04 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessTest_Proc1.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessTest_Proc1.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 发外检验 — in-flow updater for the 工序发外检验 approval flow. Persists the approver-supplied `iTypeResult1` (品质判定 — 合格/让步接收/退货等) onto `Qlyoutsideproducttestmaster`, and clears `iTestResult` when the new judgement is 1. + +**What it does:** Parses `iTypeResult1` from inbound `sData` JSON and UPDATEs `Qlyoutsideproducttestmaster.iTypeResult1 = p_sTypeResult1, iTestResult = (CASE WHEN p_sTypeResult1=1 THEN 0 ELSE iTestResult END) WHERE sId = sGuid`. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., proName, ...)` from a workflow-step config row. Wired as one of the intermediate-task callbacks of the `Sp_Apply_Flow_ProcessTest` flow. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessTest_Proc2.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessTest_Proc2.md index 40df588..4274d63 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessTest_Proc2.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProcessTest_Proc2.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 发外检验 — second in-flow updater (sibling of `_Proc1`) for the 工序发外检验 approval flow. Persists the approver-supplied `iTypeResult` (检验结论) onto `Qlyoutsideproducttestmaster`. + +**What it does:** Parses `iTypeResult` from inbound `sData` JSON and UPDATEs `Qlyoutsideproducttestmaster.iTypeResult WHERE sId = sGuid`. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., proName, ...)` from a workflow-step config row. Wired as one of the intermediate-task callbacks of the `Sp_Apply_Flow_ProcessTest` flow. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProductTest.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProductTest.md index 70a679c..16dfcd6 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProductTest.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProductTest.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成品发外检验 — workflow-apply data builder for the 发外成品检验 approval flow on `QlyProductTestMaster`. Sibling of `Sp_Apply_Flow_ProcessTest` but for finished-product (not process-step) external inspection. + +**What it does:** Reads `QlyProductTestMaster` for `sGuid` joined to `eleproduct`/`elesupply`/`elecustomer`. Payload carries `sBillNo`, `sWorkOrderNo`, `sCheckMemo` (= `产品名➜客户名➜供应商名`), `dNoQualifyQty`, `iTypeResult`/`iTypeResult1`. Resolves five tiers from `eleemployee.iPosition` (17=SQE, 14=外协经理, 18=品质经理, 8 OR 21=生产经理/生产部长); 外协人员 (`p_TwoFlow`) is the source-outsource 制单人 via `opsoutsideprocessmaster.sId=QlyProductTestMaster.sSrcId`. **Early exit:** if `iTestResult=0` (already qualifies) sets `sCode=2` and LEAVE top without emitting the payload — workflow handles this as a manual-close case. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB). Companion procs `_Proc1`/`_Proc2` write back `iTypeResult1`/`iTypeResult` from in-flow user input. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProductTest_Proc1.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProductTest_Proc1.md index 04fbd24..e1fb432 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProductTest_Proc1.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProductTest_Proc1.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 发外成品检验 — in-flow updater for the 成品发外检验 approval flow. Persists the approver-supplied `iTypeResult1` (品质判定 — 合格/让步接收等) onto `QlyProductTestMaster`, and clears `iTestResult` when the new judgement is 1. + +**What it does:** Parses `iTypeResult1` from inbound `sData` JSON and UPDATEs `QlyProductTestMaster.iTypeResult1 = p_sTypeResult1, iTestResult = (CASE WHEN p_sTypeResult1=1 THEN 0 ELSE iTestResult END) WHERE sId = sGuid`. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., proName, ...)` from a workflow-step config row. Wired as one of the intermediate-task callbacks of the `Sp_Apply_Flow_ProductTest` flow. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProductTest_Proc2.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProductTest_Proc2.md index 53a8933..acffbc2 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProductTest_Proc2.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProductTest_Proc2.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 发外成品检验 — second in-flow updater (sibling of `_Proc1`) for the 成品发外检验 approval flow. Persists the approver-supplied `iTypeResult` (检验结论) onto `QlyProductTestMaster`. + +**What it does:** Parses `iTypeResult` from inbound `sData` JSON and UPDATEs `QlyProductTestMaster.iTypeResult WHERE sId = sGuid`. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., proName, ...)` from a workflow-step config row. Wired as one of the intermediate-task callbacks of the `Sp_Apply_Flow_ProductTest` flow. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProductVersion.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProductVersion.md index 6a78b85..e73e58f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProductVersion.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ProductVersion.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 版本变更 — workflow-apply data builder for the 产品版本变更 approval flow on `mftproductchange`. Builds a two-tier approver roster (技术部 + 仓储) and the version-change summary for the BACK approval UI. + +**What it does:** Reads `mftproductchange` for `sGuid` joined to `elecustomer`/`eleproduct`. Payload exposes `sBillNo`, `sCustomerName`, `sProductName`, `sChangeReason` (旧产品处理 disposition), `sFileType` (旧版文件处理), and the two approver groups. Resolves 技术部 (`p_OneFlow`) by `eleemployee.iPosition=19` and 仓储 (`p_TwoFlow`) by `iPosition=7`. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB). No `_Proc*` companions for this flow — purely an Apply-time payload builder. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_PurCheck.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_PurCheck.md index c429f2f..6a14ece 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_PurCheck.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_PurCheck.md @@ -1,9 +1,9 @@ # `Sp_Apply_Flow_PurCheck` (procedure) -> 流程启动前调用-采购对账对账修改单价 - 对账改了单价总价也会变,发票也涉及到改价格。 - 这个到时候需要增加审批流程,比如说超过100元的, - 二级部门、一级部门,财务审核, +> 流程启动前调用-采购对账对账修改单价 + 对账改了单价总价也会变,发票也涉及到改价格。 + 这个到时候需要增加审批流程,比如说超过100元的, + 二级部门、一级部门,财务审核, 超过2万的总经理审核 @@ -33,4 +33,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购对账(单价变更) — workflow-apply data builder for the 采购对账修改单价 approval flow on `purpurchasecheckingmaster`. Builds the five-tier approver roster (二级部门→一级部门→财务→总经理 plus 事业部负责人) and the price-variance line summary. + +**What it does:** Reads `purpurchasecheckingmaster` for `sGuid` joined to `elesupply`. For each `purpurchasecheckingslave` row where `dMaterialsPrice<>` the originating `purpurchaseorderslave.dMaterialsPrice` AND the source-no does not contain 'KK' (KK = 扣款 lines exempted), accumulates `p_dChangeMoney = SUM(dMaterialsMoney) − SUM(orderPrice*newPrice)` (signed variance) and concatenates `p_sMaterialsName` with 现单价/原单价 per line. Resolves二级部门 (`p_OneFlow`) and 一级部门 (`p_TwoFlow`) by walking `sisdepart.sParentId` from the 制单人's dept. Three position-based tiers: `iPosition` 11=财务, 1=总经理, 34=事业部负责人. Also reads first slave's `iCigPack` (烟包 flag). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB). + +Flag: `dMaterialsMoney − dMaterialsPrice*dMaterialsPrice` formula multiplies new-price by new-price (should be `dAuxiliaryQty*dMaterialsPrice` — likely a copy-paste typo in the variance calc); inspect against `purpurchaseorderslave` column meanings before relying on `dChangeMoney` for thresholding. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_PurOrder.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_PurOrder.md index 8f9c61c..31952e0 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_PurOrder.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_PurOrder.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购订单 — minimal workflow-apply data builder for an older 采购订单 approval flow on `purpurchaseordermaster`. Tiny payload — header line only, no employee-tier resolution. Superseded by the much richer `Sp_Apply_Flow_PurpurchaseOrder` which carries tier roster + variance flags. + +**What it does:** Reads `purpurchaseordermaster` for `sGuid` joined to `purpurchaseorderslave` + `elesupply`. Payload exposes `sBillNo`, `sSupplyName`, `dAuxiliaryQty` (SUM), `dMoney` (SUM `dMaterialsMoney`), `sType` (1 if any `dAdvanceMoney>0` else 0), and a hardcoded `sUser` = "管广飞". + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB). + +Flag: hardcoded user literal `"管广飞"` in `sUser` — tenant-specific developer scaffolding. Likely never bound in production; the live 采购订单 flow uses `Sp_Apply_Flow_PurpurchaseOrder` instead. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_PurpurchaseOrder.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_PurpurchaseOrder.md index eb8bf98..7f50ce3 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_PurpurchaseOrder.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_PurpurchaseOrder.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购订单 — live workflow-apply data builder for the 采购订单 approval flow on `purpurchaseordermaster`, superseding the minimal `Sp_Apply_Flow_PurOrder`. Builds seven-tier roster, two price-variance flags, and a 烟包 indicator. + +**What it does:** Reads `purpurchaseordermaster` for `sGuid` joined to `elesupply`. **Two variance branches:** `p_iType=1` when any line has `dMaterialsPrice>dGuidePrice` AND its `sismaterialsclassify.bPrice=1` (guidance-priced category); `p_iType1=1` when the sum of over-guidance line money `p_dOutMoney>30000`. Also reads `p_iOut1` = count of order lines whose material classify has `bPrice=1` (indicates the order can be guidance-checked at all). Resolves seven tiers from `eleemployee.iPosition`: 6=物控经理, 5=供应链部长, 1=总经理, 34=国同事业副总, 38=副董执行董事, 39=董事长, 11=财务总鉴. Reads master `iCigPack`. Concatenates per-line `物料➜规格➜数量+单位➜单价` summary using `dOldMaterialsPrice`. Final payload includes `iSource`, `dTotalMoney`, all seven tier fields plus the two variance flags. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB). + +Flag: `p_iOut1` query lacks WHERE `A.sParentId=sGuId` — counts guidance-priced lines across **all** purchase orders globally, not just this order. `p_dOutMoney>30000` threshold (30k CNY) is hardcoded; comment header mentions "超过2万的总经理审核" — comment says 20k, code says 30k. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Purpurchaseapply.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Purpurchaseapply.md index 831e58f..735be11 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Purpurchaseapply.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Purpurchaseapply.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购申请单 — workflow-apply data builder for the 采购申请 approval flow on `purpurchaseapplymaster`. Four-tier roster, with the first tier branching by `iType` (申请类型). Superseded by `Sp_Apply_Flow_Purpurchaseapplynew` which adds 烟包/dept-walking branches. + +**What it does:** Reads `purpurchaseapplymaster.iType` and uses it to pick `p_OneFlow`: `iType=1` 客服申请 fills four tiers from `eleemployee.iPosition` 4/3/2/1 (客服经理/营销部长/营销副总/总经理); `iType=2` 常备物料 uses position 7 only; `iType=3` 车间辅料 uses 8 OR 9; default uses position 8. Sums applied total: `p_dTotalMoney = ROUND(SUM(dMaterialsQty*dGuidePrice),3)` joining `elematerials`. Concatenates per-line `物料➜规格➜数量+单位` summary. Final payload joins `eleemployee`+`sisdepart` for 申请人/申请部门 display. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB). Likely the older bound proc — `Sp_Apply_Flow_Purpurchaseapplynew` carries the live tier logic. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Purpurchaseapplynew.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Purpurchaseapplynew.md index 8743e7d..1d641b2 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Purpurchaseapplynew.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Purpurchaseapplynew.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购申请单(新) — replacement workflow-apply data builder for the 采购申请 approval flow on `purpurchaseapplymaster`, superseding `Sp_Apply_Flow_Purpurchaseapply`. Adds dept-based tier resolution, 烟包 routing, and four additional senior tiers (副董/总鉴/董事长). + +**What it does:** Reads `purpurchaseapplymaster` for `sGuid`. Resolves apply-employee's `sDepartId` and parent `sParentDeptId` from `sisdepart`. First two tiers (`p_OneFlow`/`p_TwoFlow`) come from `sisdepart.sEmployeeId` for the apply-dept and its parent (dept-leader hierarchy). Five position-based tiers: `iPosition` 2=营销副总, 1=总经理, 37=销售经理, 34=国同事业副总, 38=副董执行董事, 11=财务总鉴, 39=董事长. Reads `iApplySort` (1=烟包, 2=否) for routing. `p_dTotalMoney = ROUND(SUM(dMaterialsQty*dGuidePrice),3)` joining `elematerials`; material memo includes 指导价. Payload also exposes display string for `iType` (客服申请/常备物料/车间辅料申请/设备零配件需求/补料申请). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB). The live binding for the current 采购申请 form. + +Flag: declares `p_iType` and `iType` is referenced inside the JSON build but the local `p_iType` is read into a local that isn't re-passed to JSON_OBJECT — the JSON `"iType",iType` field refers to the master column directly, so the local read is dead. `p_FiveFlow`...`p_ElevenFlow` are dynamically populated but some tiers (`p_FiveFlow`=销售经理 iPosition=37, `p_SixFlow`=34, `p_NineFlow`=38, `p_TenFlow`=11, `p_ElevenFlow`=39) may have empty results in this tenant. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Qualityaccident.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Qualityaccident.md index 020a022..cef5819 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Qualityaccident.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Qualityaccident.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量事故报告 — workflow-apply data builder for the 质量事故 approval flow on `mftqualityaccidentmaster`. Builds the eleven-tier approver roster (including conditional 会签 group) plus three event-classification flags and the 烟包 indicator. + +**What it does:** Reads `mftqualityaccidentmaster` for `sGuid` joined to `elecustomer`+`eleproduct`. Payload exposes `sBillNo`, `sCustomerName`, `sProductName`, `dLoseMoney`, `dRewardPunishmentMoney`, `iCustomerLook` (1 if customer-visible and 客服 is set), `sDeptMemo` (department + 考核金额 per slave row aggregated). **Threshold flag:** `p_iOut=1` when `dLoseMoney>5000 OR dRewardPunishmentMoney>2000` (triggers 总经理 review). `p_iOut1=1` when `sType>2` (severity classification). **Three deduction types** drive 会签 (`p_EightFlow`) assembly into a `p_EmpTable` temp: `bDeductionMaterials=1` adds 物控经理 (`iPosition=6`); `sType<>''` adds 生产计划经理 (`iPosition=21` OR `iPosition1=21`); `bDeductionSupply=1` adds 外协 dept-leaders matched by `LOCATE(sFlowDeptName, sisdepart.sName)`. `p_EightFlow = GROUP_CONCAT(DISTINCT)` of the temp; `p_iOut2=1` only if the result is non-empty. **Position-based fixed tiers:** 1=总经理, 18=品质经理, 11=财务经理, 35=核价主管, 5=物控经理, 38=副董执行董事, 34=国内事业副总, 39=董事长. 客服 (`p_FiveFlow`) is the order 制单人 via `salsalesordermaster.sId=sOrderId`. 烟包 (`p_iCigPack`) is 1/2 based on `SisCustomerProperty.sName='烟包'`. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB). + +Flag: `p_ThreeFlow` (生产计划部经理) is declared but never populated (the SELECT into it is commented out); the JSON still emits `"ThreeFlow",p_ThreeFlow` so consumers receive empty string. `iCustomerLook` condition requires both `bCustomerLook=1` and `p_FiveFlow<>''` — if the order's 制单人 has been deleted, customer-look review is silently skipped. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentCL.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentCL.md index 0abcf91..4248799 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentCL.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentCL.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量事故 (material-loss variant — 流程启动前调用-质量事故报告材料) — workflow-apply data builder for the material-related quality-accident approval flow on `mftqualityaccidentmaster`. Builds an eight-tier approver roster plus two loss-threshold flags driving routing. + +**What it does:** Resolves tiers from `eleemployee.iPosition`: 18=品质经理, 6=物控经理, 5=供应链部长, 11=财务经理, 1=总经理, 38=副董执行董事, 34=国内事业副总, 39=董事长. Reads `dLoseMoney` from `mftqualityaccidentmaster`: `p_iOut=1` when loss>0, `p_iOut1=1` when loss>5000 (5k-CNY senior-review threshold). Renders `sReprint` (处理方式) into 特采/退货补送/退货完成/报废 labels and emits supply/material display labels plus `iCigPack` (烟包 indicator) into `sTableParamsValue`. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB — workflow configs tenant-provisioned per deployment). + +Flag: 烟包 (`p_iCigPack`) declaration + lookup commented out — `iCigPack` is emitted directly from master column `A.iCigPack` instead. Loose stub. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentCustomer.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentCustomer.md index 4ac83a0..b6e1279 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentCustomer.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentCustomer.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 客户索赔单 (流程启动前调用-客户索赔单) — workflow-apply data builder for the customer-claim approval flow on `saldelivergoodsdedmaster` (negative-delivery / claim-deduction header). Builds a six-tier roster, line summary, and 烟包 routing flag. + +**What it does:** Resolves tiers from `eleemployee.iPosition`: 18=品管部, 1=总经理, 27=应收会计, 37=营销经理, 34=营销负责人 国内副总. `p_TwoFlow` (业务员) is resolved via the join `elecustomer→sissalesman→eleemployee` from the claim's customer rather than `iPosition`. Counts `saldelivergoodsdedslave` lines whose product belongs to classify subtree of `'16624527080007919539418229414000'` (烟包产品 root); `p_iOut=1` if any. Computes `p_dTotalMoney` as `0-SUM(dProductMoney)` (claim amounts stored as negative on slave). Emits per-line memo CONCAT-ing `产品名称➜数量+单位➜索赔金额`. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB — workflow configs tenant-provisioned per deployment). + +Flag: hardcodes tenant-specific 烟包产品 classify root `16624527080007919539418229414000`. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentMaterials.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentMaterials.md index 26b2791..09aa3e1 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentMaterials.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentMaterials.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 供应商扣款单 (流程启动前调用-供应商扣款单) — workflow-apply data builder for the supplier-deduction approval flow on `purpurchaseinstorededmaster` (negative-incoming / deduction header). Builds a nine-tier roster and per-line summary. + +**What it does:** Resolves tiers from `eleemployee.iPosition`: 18=品管部, 6=物控部, 8=生产部, 26=应付会计, 1=总经理, 38=副董执行董事, 34=国内事业副总, 11=财务总鉴, 39=董事长. Emits per-line memo CONCAT-ing `物料名称➜辅助数量+单位➜扣款金额` from `purpurchaseinstorededslave`. Computes `p_dTotalMoney` as `0-SUM(dMaterialsMoney)`. Final payload includes `iCigPack` (烟包 indicator) read straight from master. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB — workflow configs tenant-provisioned per deployment). + +Note: companion in-flow updater `Sp_Apply_Flow_QualityaccidentMaterials_Proc1` writes back the user-decided `dOKMaterialsMoney` into the master after the relevant approval step. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentMaterials_Proc1.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentMaterials_Proc1.md index b5d4934..7142668 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentMaterials_Proc1.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentMaterials_Proc1.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 供应商扣款单 (供应商扣款单号 过程1) — in-flow updater companion to `Sp_Apply_Flow_QualityaccidentMaterials`. Writes the approver-entered confirmed deduction amount back to the master on the relevant approval step. + +**What it does:** Reads `dOKMaterialsMoney` from the `sData` JSON payload (stripped of quotes), flips sign to negative if positive, and `UPDATE purpurchaseinstorededmaster SET dOKMaterialsMoney = ... WHERE sId = sGuid`. No transaction or error handling. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sProName, ...)` keyed off `gdsmoduleflowdetail` (the per-task overrides table linked to `gdsmoduleflow`). Reached only when the supplier-deduction approval flow's Proc1-bound task fires. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentNB.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentNB.md index a37a898..555b7af 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentNB.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentNB.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 内部扣款单 (流程启动前调用-内部扣款单) — workflow-apply data builder for the internal-deduction approval flow on `saldelivergoodsdedinmaster` (employee/dept-level deduction header). Builds a four-tier roster anchored to the responsible department. + +**What it does:** Resolves tiers from `eleemployee.iPosition`: 18=品管部, 30=HR, 11=财务经理. `p_TwoFlow` (责任部门负责人) is resolved by joining `saldelivergoodsdedinmaster.sDeptId` → `sisdepart.sEmployeeId` → `eleemployee.sId` (the dept's named leader, not by position). Emits per-line memo CONCAT-ing `责任职员➜责任金额` from `saldelivergoodsdedinslave`. Final payload includes `dExamineMoney`, `sProductName`, `sDeptName`, `sEmpName` for the display block. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB — workflow configs tenant-provisioned per deployment). diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentsSupply.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentsSupply.md index 3961b6f..530645c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentsSupply.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentsSupply.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 外协商扣款单 (流程启动前调用-外协商扣款单) — workflow-apply data builder for the outsource-supplier deduction approval flow on `opsoutsideinstorededmaster`. Builds a nine-tier roster with dept-driven 物控/外发 fallbacks and 烟包 indicator. + +**What it does:** Resolves tiers from `eleemployee.iPosition`: 18=品管部, 26=应付会计, 1=总经理, 38=副董执行董事, 34=国内事业副总, 11=财务总鉴, 39=董事长. `p_TwoFlow` (生产部) is resolved via `opsoutsideinstorededmaster.sFlowDeptId` → `sisdepart.sEmployeeId` → `eleemployee`, falling back to `iPosition=6` (物控经理) when the dept lookup is empty. `p_FourFlow` (外发经理) climbs one dept level up (`sParentId`) from the same dept anchor, falling back to `iPosition=14`. Reads `iCigPack` from master. Emits per-line memo CONCAT-ing `产品名称➜辅助数量+单位➜扣款金额`; `p_dTotalMoney = 0-SUM(dMaterialsMoney)`; preserves any prior `dOKMaterialsMoney` else uses computed total. `LIMIT 1` on master join. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB — workflow configs tenant-provisioned per deployment). + +Flag: JSON key `"ElevenFlow "` (with trailing space) emitted — downstream consumers keyed on bare `ElevenFlow` will miss this tier; companion in-flow updater `Sp_Apply_Flow_QualityaccidentsSupply_Proc1` writes back `dOKMaterialsMoney`. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentsSupply_Proc1.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentsSupply_Proc1.md index 33e1677..95205dc 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentsSupply_Proc1.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentsSupply_Proc1.md @@ -30,4 +30,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 外协商扣款单 (供应商扣款单号 过程1 — catalog header is mis-copied from the `QualityaccidentMaterials_Proc1` sibling) — in-flow updater companion to `Sp_Apply_Flow_QualityaccidentsSupply`. Writes the approver-entered confirmed deduction amount back to the master on the relevant approval step. + +**What it does:** Reads `dOKMaterialsMoney` from the `sData` JSON payload (stripped of quotes), flips sign to negative if positive (with `IFNULL(...,0)` guard), and `UPDATE opsoutsideinstorededmaster SET dOKMaterialsMoney = ... WHERE sId = sGuid`. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sProName, ...)` keyed off `gdsmoduleflowdetail` (the per-task overrides table linked to `gdsmoduleflow`). Reached only when the outsource-supplier deduction flow's Proc1-bound task fires. + +Flag: catalog header `供应商扣款单号 过程1` is copy-pasted from `Sp_Apply_Flow_QualityaccidentMaterials_Proc1`; this proc operates on `opsoutsideinstorededmaster`, not the materials master. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ReturnWork.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ReturnWork.md index 869ae86..351fc9c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ReturnWork.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_ReturnWork.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 返工单 (流程启动前调用-返工单) — workflow-apply data builder for the rework approval flow on `mftproductionplanbillslave` (production-plan rework lines). Builds a three-tier roster and quality-sample routing flag. + +**What it does:** Resolves tiers from `eleemployee.iPosition`: 18 OR 28=品质部 (品管/品质两个分组合并), `iPosition1=21`=生产计划经理 (note `iPosition1`, a secondary-role column), 11=财务经理. Joins `mftproductionplanbillslave` with the originating `salsalesorderslave` (`A.sOrderSlaveId=B.sId`) and emits `sBillNo`, `sWorkOrderNo`, `sCustomerName`, `sProductName`, `dProcessQty`, plus `dProductNoTaxMoney = A.dLossMoney if set else ROUND(A.dProcessQty * B.dProductNoTaxPrice, 2)`. `iOut=1` when `bQualitySample=1` (quality-sample branch). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB — workflow configs tenant-provisioned per deployment). diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_SalInvoice.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_SalInvoice.md index 3868285..8aac6a0 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_SalInvoice.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_SalInvoice.md @@ -1,7 +1,7 @@ # `Sp_Apply_Flow_SalInvoice` (procedure) -> 流程启动前调用-销售发票舍入金额,比如说超过100元的, - 二级部门、一级部门,财务审核, +> 流程启动前调用-销售发票舍入金额,比如说超过100元的, + 二级部门、一级部门,财务审核, 超过2万的总经理审核 @@ -31,4 +31,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售发票 (流程启动前调用-销售发票舍入金额) — workflow-apply data builder for the sales-invoice rounding-amount approval flow on `salsalesinvoicemaster`. Header comment notes the intent: "对账改了单价总价也会变,发票也涉及到改价格...超过100元的,二级部门、一级部门,财务审核,超过2万的总经理审核". Builds a six-tier roster with applicant-dept-driven branching and 烟包 indicator. + +**What it does:** Reads `sMakePerson` from master. Resolves `p_OneFlow` (二级部门) via `eleemployee.sDepartId` → `sisdepart.sEmployeeId` (the applicant's dept leader). Resolves `p_TwoFlow` (一级部门) by climbing one `sisdepart.sParentId` level. Resolves tiers from `eleemployee.iPosition`: 11=财务, 1=总经理, 34=国同事业副总, 38=副董执行董事. Counts `salsalesinvoiceslave` whose product belongs to classify subtree `'16624527080007919539418229414000'` (烟包产品 root); `p_iOut2=1` if any. Per-line memo restricted to lines with `dRoundingMoney>0 AND sRoundingReason<>'汇率差异'` and `dRoundingMoney` aggregated under the same filter (汇率差异 rounding is excluded from the threshold check). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB — workflow configs tenant-provisioned per deployment). + +Flag: header comment says "超过2万的总经理审核" but proc emits only the tier roster — threshold gating is left to the consumer JSON-evaluator (no `p_iOut1` analog). Hardcodes 烟包产品 classify root. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_SalSaleCheck.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_SalSaleCheck.md index d0bc562..74ec1d4 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_SalSaleCheck.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_SalSaleCheck.md @@ -1,9 +1,9 @@ # `Sp_Apply_Flow_SalSaleCheck` (procedure) -> 流程启动前调用-销售对账修改单价 - 对账改了单价总价也会变,发票也涉及到改价格。 - 这个到时候需要增加审批流程,比如说超过100元的, - 需要客服经理审核,营销部长审核,销售副总审核,财务审核, +> 流程启动前调用-销售对账修改单价 + 对账改了单价总价也会变,发票也涉及到改价格。 + 这个到时候需要增加审批流程,比如说超过100元的, + 需要客服经理审核,营销部长审核,销售副总审核,财务审核, 超过2万的总经理审核 @@ -33,4 +33,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售对账修改单价 (流程启动前调用-销售对账修改单价) — workflow-apply data builder for the sales-checking price-change approval flow on `salsalescheckingmaster`. Header documents intent: when 对账 changes line price the invoice price also changes; >100元 needs 客服经理/营销部长/销售副总/财务 review, >2万 needs 总经理. Builds a six-tier roster, price-variance line summary, and 烟包 indicator. + +**What it does:** Resolves tiers from `eleemployee.iPosition`: 4=客服经理, 37=销售经理, 34=国内事业副总, 11=财务, 1=总经理, 38=副董执行董事. Computes `p_dChangeMoney = ROUND(SUM(B.dProductPrice*A.dProductQty),2) − ROUND(SUM(A.dProductMoney),2)` over `salsalescheckingslave A JOIN salsalesorderslave B ON A.sOrderSlaveId=B.sId` where the rounded prices differ and the new price is positive. Sets `p_iOut=1` (烟包) by joining the slave's order's customer's `SisCustomerProperty.sName='烟包'`. Emits per-line memo CONCAT-ing `产品名称➜数量➜现单价➜原单价` filtered to changed-price lines only. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB — workflow configs tenant-provisioned per deployment). + +Flag: header documents threshold gating (100元 / 2万 cutoffs) but proc emits only the roster — threshold gating is left to the consumer JSON-evaluator (no `p_iOut1`/`p_iOut2` cutoff flags). diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_SalSaleOrder.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_SalSaleOrder.md index 3b4300f..746dae8 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_SalSaleOrder.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_SalSaleOrder.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售订单 (流程启动前调用-销售订单) — large workflow-apply data builder for the sales-order approval flow on `salsalesordermaster`. Builds a fourteen-tier roster plus 会签 group, 营销一/二部 classification, and seven boolean routing flags (白名单, 特批, 框架协议, 备货, 费用, 烟包, 客户类型). + +**What it does:** Resolves tiers from `eleemployee.iPosition`: 4=客服经理, 10=法务, 3=营销部长, 11=财务, 12=总经办, 2=营销副总, 1=总经理, 23=销售管理专员, 27=应收会计, 37=销售经理, 34=营销负责人(同时分配给 ElevenFlow 和 TwelveFlow), 38=副董执行董事, 39=董事长. `p_MoreFlow` (会签) = all `iPosition=3`. Counts `salsalesorderslave` lines whose product belongs to classify subtree `'16624527080007919539418229414000'` (烟包产品 root): `p_iOut2=1` if any. Sets `p_iOut=1` when any line is `sBillType='备货'`, `p_iOut1=1` when `sBillType='费用'`. Climbs applicant dept via `sisdepart.sParentId` to set `p_saledept` (=1 营销一部 `1734417170...`, =2 营销二部 `2023112009...`). Reads master `bApproved` (特批), customer `bWhile` (白名单), and counts active `elecustomeraccord` (`bCheck=1 AND tBufferDate>NOW()`) for `p_iAccord` (框架协议). Computes `p_dTotalMoney = SUM(dProductMoney)`. Emits per-line memo CONCAT-ing `生产类型➜毛利率➜产品分类➜产品名称➜数量➜金额` filtered to non-split lines (`IFNULL(sFatherSlaveId,'')=''`). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB — workflow configs tenant-provisioned per deployment). + +Flag: `p_ElevenFlow` and `p_TwelveFlow` both populate from `iPosition=34` (duplicate value — only one of营销负责人 ElevenFlow/TwelveFlow should differ; this slot is dev scaffolding); `p_MoreFlow` = same `iPosition=3` as `p_ThreeFlow` (会签 and 营销部长 are identical, so 会签 isn't multi-party); hardcodes 烟包 classify root + tenant dept GUIDs (营销一/二部). diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_SalSalesNotify.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_SalSalesNotify.md index 32e4089..635662b 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_SalSalesNotify.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_SalSalesNotify.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 送货通知单 (流程启动前调用-送货通知单) — workflow-apply data builder for the delivery-notify approval flow on `saldelivernotifymaster`. Builds a five-tier roster, 营销一/二部 classification, and three routing flags (逾期未收款, 有数量, 烟包). + +**What it does:** Resolves tiers from `eleemployee.iPosition`: 3=营销部长, 2=营销副总, 1=总经理, 34=营销负责人, 37=销售经理. Climbs applicant dept via `sisdepart.sParentId` to set `p_saledept` (=1 营销一部 `1734417170...`, =2 营销二部 `2023112009...`). Counts 烟包 products on `salsalesinvoiceslave.sParentId=sGuId` whose classify subtree includes `'16624527080007919539418229414000'`; `p_iOut2=1` if any (note: filter on `salsalesinvoiceslave` not `saldelivernotifyslave` — likely lookup error). Sets `p_iOut1` to count of `saldelivernotifyslave` with `dProductQty>0`. Sets `p_iOut=1` (逾期客户标记) when there exists any `SalSalesInvoice` for the same customer whose `tGetPayDate` month-end + 1 day < NOW() AND unpaid amount > 0.1. Computes `p_dTotalMoney = SUM(dProductMoney)`. Emits per-line memo CONCAT-ing `产品名称➜数量➜价格`. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB — workflow configs tenant-provisioned per deployment). + +Flag: 烟包 count lookup hits `salsalesinvoiceslave` (the invoice slave) but should hit `saldelivernotifyslave` (the notify slave) — likely a copy-paste from `Sp_Apply_Flow_SalInvoice`; `iOut2` is wrong for delivery-notify forms with no companion invoice yet. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_StepPrice.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_StepPrice.md index 02463e4..a87d022 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_StepPrice.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_StepPrice.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 阶梯价格审批 (流程启动前调用-阶梯价格审批) — workflow-apply data builder for the tiered-price approval flow on `eleproductpricemaster` with `eleproductpriceslave` step-price lines. Builds a seven-tier roster, 营销一/二部 classification, and two routing flags (low-margin band, 烟包). + +**What it does:** Resolves tiers from `eleemployee.iPosition`: 35=估价审核1, 1=总经理, 34=营销负责人, 37=销售经理, 38=副董执行董事, 11=财务总鉴, 39=董事长. Climbs applicant dept via `sisdepart.sParentId` to set `p_saledept` (=1 营销一部 `1734417170...`, =2 营销二部 `2023112009...`). Counts active step-price lines `WHERE A.dQuoRate*100<110 and bNotUsed=0` (毛利率 <10%); `p_iOut=1` if any (low-margin escalation). Counts product-classify subtree under `'16624527080007919539418229414000'` (烟包产品 root); `p_iOut1=1` if any. Emits per-line memo CONCAT-ing `起止数➜销售单价➜基准价➜毛利率➜估价单号` from `eleproductpriceslave`. Final payload includes master `sBillNo`, customer name, product name, plus all tiers and flags. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB — workflow configs tenant-provisioned per deployment). + +Flag: a large commented-out CURSOR block (`cur1` over `SisRate`) shows an earlier design where the tier and approver position were per-margin-band dynamic; the live proc uses the simpler `<110%` cutoff. Hardcodes 烟包 classify root + tenant dept GUIDs. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Supply.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Supply.md index 69c50be..488c2f7 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Supply.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Supply.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 供应商准入 (流程启动前调用-供应商准入) — workflow-apply data builder for the supplier-onboarding approval flow on `elesupply`. Builds an eleven-tier roster, supplier-classify-driven branch, payment-term flag, dept flag (供应链管理), and 烟包 indicator. + +**What it does:** Resolves tiers from `eleemployee.iPosition`: 6=物控经理, 5=采购部长, 8=技术部长, 9=生产部长, 11=财务经理, 1=总经理, 38=副董执行董事, 34=国内副总, 39=董事长, 40=供应链经理, 41=产品设计与开发. Reads `sParentId` (supplier classify) and `sGetPayId`. Computes `p_iFlow1=1` when payment is one of four prepaid/票到/货到/预付款 GUIDs (`1573542941...`, `1682658739...`, `2023113014...`, `1701870942...`). Computes `p_iFlow` by classify: 1=纸张/辅料/模具 (`1698744948...`/`1701485801...`/`1701485812...`), 2=加工商/设备配件/服务商 (`1698744954...`/`1698744966...`/`1698744980...`), 3=物流 (else). Checks applicant dept against `'17344173190001090119214960551400'` (供应链 dept root); `p_dept=1` if match. Emits master `sSupplyNo`, `sSupplyName`, `sissupplyclassify.sName`, `sMemo`, `iCigPack` (read directly from master `A.iCigPack`). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB — workflow configs tenant-provisioned per deployment). + +Flag: hardcodes 12 tenant-specific GUIDs (4 payment terms + 6 supplier classifies + 供应链 dept root + 烟包 classify) — supplier classifications need re-mapping if cloned to a different tenant. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Work.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Work.md index 2372a42..65ed65f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Work.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Work.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产工单 — minimal pre-approval display-data builder. Continues the `Sp_Apply_Flow_*` workflow-apply family but, unlike its sibling Apply procs, only emits the seven work-order header fields (单号 / 品名 / 规格 / 批量 / 单位 / 产品批号 / 生产日期 / 有效期至) without any tier roster. + +**What it does:** Reads master `mftworkordermaster` joined to slave `mftworkorderslave` and `eleproduct` for `sGuid` and INTOs eight fields into `sTableParamsValue` as a JSON_OBJECT. `sTableParams` lists the seven Chinese labels for those keys. No tier resolution, no variance flags — pure display payload. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB — workflow configs tenant-provisioned per deployment). + +Flag: workflow-apply procs typically populate tier columns; this proc emits only the header fields. Consumer flow definition must reach approvers via `gdsmoduleflow` rows rather than embedded `Flow` JSON keys. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Ystz.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Ystz.md index 7adb75d..346df18 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Ystz.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Ystz.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 预算调整单 (header: `预算調整单`, traditional-character variant) — workflow-apply data builder for the budget-adjustment approval flow on `budgetAdjustmentCheckMaster`. Builds an eight-tier roster plus a 烟包 indicator. + +**What it does:** Reads master `budgetAdjustmentCheckMaster` for `sGuid` and resolves `p_OneFlow` (申请人部门负责人 via `sDepartId` → `sisdepart.sEmployeeId`), `p_TowFlow` (上级部门领导 via `sMasterDepartId`), `p_ThreeFlow` (财务经理 `iPosition=11`), `p_FiveFlow` (副董执行董事 `iPosition=38`), `p_SixFlow` (国内副总 `iPosition=34`), `p_SevenFlow` (总经理 `iPosition=1`), `p_EightFlow` (董事长 `iPosition=39`). Reads `iCigPack` from `advanceCostCheckMaster`; when not-烟包 AND `p_TowFlow='李国哲'`, redirects `p_TowFlow` to the 事业部 dept head at hardcoded sId `17344171700007029955590024910000`. Reads one `budgetadjustmentcheckslave` for `iAdjustmentType=2`, then composes JSON with `sApplyPerson`/`sBeforeExpenseDetail`/`sAfterExpenseDetail`/`dMaterialsMoney`/`sMemo`/`iAdjustmentType`/all tier fields/`iCigPack`. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB — workflow configs tenant-provisioned per deployment). + +Flags: emits `"EightFlow", p_SevenFlow` — assigns 总经理 value to the 董事长 slot (copy-paste bug; `p_EightFlow` populated but never emitted). The 烟包 cross-table lookup reads `iCigPack` from `advanceCostCheckMaster` (费用预借) rather than `budgetAdjustmentCheckMaster` itself — assumes the budget-adjustment master has a same-id row in `advanceCostCheckMaster`, which isn't enforced by FK. Tenant-specific dept-root sId `17344171700007029955590024910000` hardcoded. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Yzfy.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Yzfy.md index 690a319..f169a8f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Yzfy.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_Yzfy.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 费用预支单 — workflow-apply data builder for the cost-advance approval flow on `advanceCostCheckMaster`. Builds a seven-tier base roster plus two management-control overrides (人力资源 + 总经办) gated on the expense-detail's `sControlDepartId`. + +**What it does:** Reads master `advanceCostCheckMaster` for `sGuid` and resolves seven base tiers — `p_OneFlow` (申请人部门负责人), `p_TwoFlow` (上级部门领导), `p_ThreeFlow` (税务费用核算专员 via `sisposition.sName`), `p_FourFlow` (财务负责人 `iPosition=11`), `p_FiveFlow` (副董执行董事 `iPosition=38`), `p_SixFlow` (国内副总 `iPosition=34`), `p_SevenFlow` (总经理 `iPosition=1`). The same 李国哲/烟包 swap pattern as `Sp_Apply_Flow_Ystz` redirects `p_TwoFlow` to dept-head sId `17344171700007029955590024910000` for non-烟包. Then joins `advancecostcheckslave` to `descriptionOfFeesMaster` and detects two control departments: `sControlDepartId='20231120093814625300245934269895'` (人力资源 → sets `p_iAdjustmentType=1`, populates `p_ControlFlow`) and `'20231120093814302718413294429806'` (总经办 → sets `p_iAdjustmentType1=1`, populates `p_ControlFlow1`). `p_iAdjustType=1` if either; if 总经办-only, `p_iAdjustmentType=2`. Final JSON includes 8 tier fields plus the two control flow slots, three adjust-type flags, and `iCigPack`. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB — workflow configs tenant-provisioned per deployment). + +Flags: hardcodes 4 tenant-specific GUIDs — 事业部 dept (`17344171700007029955590024910000`), 人力资源 control dept (`20231120093814625300245934269895`), 总经办 control dept (`20231120093814302718413294429806`). 财务经理 (`p_FourFlow`) reads `iPosition=11` rather than the commented-out `sisposition.sName='财务经理'` query — `iPosition` semantics must match across employee data. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_materialspd.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_materialspd.md index 6d13ad8..46166d9 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_materialspd.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_materialspd.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料盘点单据 → 材料库单据 → 材料库存 (catalog header: "流程启动前调用-材料盘点"; module sId `192116810113315228128521360`, form sId `192116810113315228129419200`, tbName `mitmaterialscheckmaster`). Per-form workflow-apply data builder for the warehouse stock-count submission. + +**What it does:** Resolves two approver tiers from `eleemployee`: 仓库组长 (`iPosition=32 AND (sEmployeeNo='00034' OR iPosition=7)`) and 成本会计 (`sEmployeeNo='06376' OR iPosition=33`). Both clauses hardcode tenant-specific employee numbers as fallbacks alongside the position-id route. Emits `sTableParams` (盘点单号/盘点仓库/盘点人/盘点时间/盘点备注) and `sTableParamsValue` (master values joined to `eleemployee` for the 盘点人 name and `siswarehouse` for the warehouse name + `OneFlow`/`TwoFlow`). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` where `sApplyProName` is read from `gdsmoduleflow.sApplyProName` on the 材料盘点 workflow config row. `gdsmoduleflow` is empty in this database — workflow configs are tenant-provisioned per deployment. + +Flags: 仓库组长 predicate `WHERE iPosition=32 AND (sEmployeeNo='00034' OR iPosition=7)` is malformed — the parenthesised OR is ANDed with `iPosition=32` so the `iPosition=7` branch is unreachable (always false when `iPosition=32`). The 成本会计 fallback uses `sEmployeeNo='06376'` and `iPosition=33` — tenant-specific GUIDs hardcoded into approver-resolution logic. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_mftMaterialsReturn.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_mftMaterialsReturn.md index 712484c..5c8e39e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_mftMaterialsReturn.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_mftMaterialsReturn.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料测试反馈 / 研发反馈 (catalog header: "流程启动前调用-材料测试"; backing table `mftmaterialstest` — supplier-material trial-run feedback record). Per-form workflow-apply data builder for the supplier-feedback approval flow. Naming is confusing: "MaterialsReturn" in the proc name refers to *feedback return to supplier*, not material physical return, mirroring the convention in [`Sp_Apply_Flow_MaterialsReturn`](./Sp_Apply_Flow_MaterialsReturn.md). + +**What it does:** Resolves one approver tier (供应链部长, `iPosition=5`) into `p_OneFlow`. Emits `sTableParams` (反馈单号/供应商/测试物料/车间主管反馈/技术工程反馈/技术部长反馈/测试结果/备注信息) and `sTableParamsValue` (JSON joining `mftmaterialstest`/`elematerials` for `sBillNo`/`sMaterialsName`/`sSupplyName`/三段 `sFeedBack{1,2,3}Memo`/`sMemo` + `sSucceed` translated via CASE on `iSucceed` (1→通过, 2→未通过, else→empty) + `OneFlow`). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` where `sApplyProName` is read from `gdsmoduleflow.sApplyProName` on the 材料测试 workflow config row. `gdsmoduleflow` is empty in this database — workflow configs are tenant-provisioned per deployment. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_productpd.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_productpd.md index 4b8bf51..34981b3 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_productpd.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_productpd.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成品盘点 — workflow-apply data builder for the 成品盘点 approval flow on `pitproductcheckmaster`. Builds the two-tier approver roster (仓库组长 + 成本会计) and the count-sheet header for the BACK approval UI. + +**What it does:** Reads `pitproductcheckmaster` joined to `siswarehouse` for `sGuid`. Payload exposes `sBillNo`, `sWareHouseName`, `sEmployeeName` (= 制单人), `sCreateDate` formatted `%Y-%m-%d`, `sMemo`. Resolves 仓库组长 (`p_OneFlow`) by `eleemployee.iPosition=32 AND (sEmployeeNo='00034' OR iPosition=7)` and 成本会计 (`p_TwoFlow`) by `sEmployeeNo='06376' OR iPosition=33`. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB). + +Flag: 仓库组长 predicate `iPosition=32 AND (sEmployeeNo='00034' OR iPosition=7)` is malformed — the second `iPosition=7` branch is unreachable since the outer `AND iPosition=32` already filtered to 32 (same bug as `Sp_Apply_Flow_materialspd`). Hardcoded 工号 `'00034'`/`'06376'` are tenant-baked. diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_sCustomer.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_sCustomer.md index f7f4422..ea813b3 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_sCustomer.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_sCustomer.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 客户准入 (流程启动前调用-客户准入) — workflow-apply data builder for the customer-onboarding approval flow on `elecustomer`. Builds a six-tier roster, 营销一/二部 classification, 白名单 flag, payment-term tier, and customer-property routing flag. + +**What it does:** Resolves tiers from `eleemployee.iPosition`: 4=客服经理, 20=税务费用核算单元 (header comment marks this with ???), 3=营销部长, 11=财务经理, 1=总经理, 34=营销负责人. Reads customer `bWhile` into `p_iWhile`. Climbs applicant dept via `sisdepart.sParentId` to set `p_saledept` (=1 营销一部 `1734417170...`, =2 营销二部 `2023112009...`). Emits `sBillNo` (customer code), `sCustomerName`, `sParentName` (供应商分类 — copy-pasted label from supplier proc, actually `siscustomerclassify.sName`), `sGetPayName` (`sispayment.sName`), `iPay` (`sispayment.iAfterDeliverDay`: 0→1 prepaid, <60→2, else→3), `iOut=1` when `sCustomerPropertyId='16988935270007883055824272309000'` (一次性客户/zero-credit profile). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB — workflow configs tenant-provisioned per deployment). + +Flag: hardcodes 营销一/二部 dept GUIDs + `sCustomerPropertyId` literal; comment for `iPosition=20` 税务费用核算单元 carries `???` (developer uncertainty about whether this is the correct position). diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_sCustomerAccord.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_sCustomerAccord.md index e036ffd..253860c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_sCustomerAccord.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_sCustomerAccord.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 框架协议 (流程启动前调用-框架协议) — workflow-apply data builder for the customer-framework-agreement approval flow on `elecustomeraccord`. Builds a six-tier roster with dynamic营销一/二部 position-tier swap, 招标 and 新/老客户 routing flags. + +**What it does:** Climbs applicant dept via `sisdepart.sParentId` to set `p_saledeptl` (=37 营销一部 `1734417170...` → uses销售经理 iPosition=37 for tier-2 lookup; =1 营销二部 `2023112009...` → uses总经理 iPosition=1; default=1). Resolves tiers from `eleemployee.iPosition`: 4=客服经理, 10=法务, 2=销售副总, 1=总经理. `p_TwoFlow` (营销部长/财务会签) = `iPosition IN (p_saledeptl, 11)`. `p_FourFlow` (总经办/财务/营销部长 会签) = `iPosition IN (p_saledeptl, 11, 12)`. Emits master `sBillNo`, `sAccordName` (CONCAT(`sAccordNo`,'➜',`sAccordName`)), `dYearMoney`, customer name, `iTender=1` when `bBidding=1` (招标), `iNewOld=1` when `sCustomerProperty='新'`. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB — workflow configs tenant-provisioned per deployment). + +Flag: variable name `p_saledeptl` (with trailing `l`) is unusual but consistent throughout the proc; hardcodes tenant dept-root GUIDs (营销一/二部). diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_salDesign.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_salDesign.md index 1b0ab3e..701d292 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_salDesign.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_salDesign.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 设计申请单 (流程启动前调用-设计申请单) — workflow-apply data builder for the design-application approval flow on `salsalesordermaster` with `sFormId='1691254111217201634922170'`. Builds a three-tier roster anchored to the applicant's department. + +**What it does:** Reads `sMakePerson` from `salsalesordermaster`, climbs the applicant's `sisdepart.sParentId` to find the first-level dept, then resolves `p_OneFlow` (一级部门负责人) by joining `sisdepart.sEmployeeId` → `eleemployee` on that parent dept. Resolves tiers from `eleemployee.iPosition`: 31=产品中心负责人, 9=技术部长. Renders `sBillType` (1=包装设计, 2=产品设计, 3=平面设计, 4=自主开发, 5=品牌设计, else 其它) and `iOut=1` when `bTechnology=1` (technology-led branch). Emits master `sBillNo`, `sCustomerName`, slave `sProjectName`, `dProductQty`, `dCostMoney`, `sMemo` (joined on `iOrder=1` of the slave). + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB — workflow configs tenant-provisioned per deployment). + +Flag: form-sId `1691254111217201634922170` hardcoded as match filter — proc silently returns empty payload when applied to any other form bound to the same `salsalesordermaster` (e.g., 销售订单, 销售订单变更). diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_salesmaterials.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_salesmaterials.md index e2490e1..dee2a16 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_salesmaterials.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_salesmaterials.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 研发申请材料测试 (流程启动前调用-研发申请材料测试) — workflow-apply data builder for the R&D material-test application approval flow on `salsalesordermaster`. Builds a six-tier roster with applicant-dept-driven branch and applicant-dept-equals-客服经理 short-circuit. + +**What it does:** Reads `sMakePerson` and `sOrderType` from master (recoded as `p_iOrderType`: 5→1, 4→2, else 3). Resolves `p_FourFlow` (二级部门负责人) by climbing applicant's dept once via `sisdepart.sId=eleemployee.sDepartId` → `sisdepart.sEmployeeId`. Resolves tiers from `eleemployee.iPosition`: 6=物控, 9=技术部, 8=生产部, 4=客服经理, 5=供应链部长. Sets `p_iOut=1` when `p_FourFlow=p_FiveFlow` (applicant's二级部门负责人 is also the 客服经理, collapses parallel approval). Emits per-line memo CONCAT-ing `研发材料➜研发数量➜供应商➜试制原因及要求` from `salsalesorderslave`. Renders `sOrderType` into 打样/印前/设计/拷文件/新品测试 labels and `iDemand` into 内部需求/外部需求. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB — workflow configs tenant-provisioned per deployment). diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_salesreturn.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_salesreturn.md index dd03639..4d06e30 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_salesreturn.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_salesreturn.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售退货 (流程启动前调用-销售退货) — workflow-apply data builder for the sales-return approval flow on `salrejectgoodsmaster` (executed-return header, not the apply). Builds a three-tier roster covering after-sales, quality, and warehousing. + +**What it does:** Resolves tiers from `eleemployee.iPosition`: 4=客服经理, 18=品质部, 7=仓储. Emits per-line memo CONCAT-ing `产品名称➜退货数量` from `salrejectgoodsslave`. Renders `sType` (1=退货补送, else 直接退货) and master `sBillNo`, `sMemo` into `sTableParamsValue`. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB — workflow configs tenant-provisioned per deployment). Companion to `Sp_Apply_Flow_salesreturnapply` (the upstream application that drives this return). diff --git a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_salesreturnapply.md b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_salesreturnapply.md index 51a93a7..738bb1c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Apply_Flow_salesreturnapply.md +++ b/en/docs/auto-catalog/procedures/Sp_Apply_Flow_salesreturnapply.md @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售退货申请 (流程启动前调用-销售退货申请) — workflow-apply data builder for the sales-return application approval flow on `salrejectgoodsapplymaster` (the upstream apply, preceding the executed return). Builds a four-tier roster, 营销一/二部 classification, 烟包 indicator, and 非事故 routing flag. + +**What it does:** Resolves tiers from `eleemployee.iPosition`: 4=客服经理, 18 OR 28=品质部, 7=仓储, 37=销售经理. Reads applicant dept via `eleemployee→salrejectgoodsapplymaster.sMakePerson`, climbs `sisdepart.sParentId`, and sets `p_saledept`: =1 when parent dept = `17344171700007029955590024910000` (营销一部), =2 when `20231120093814840397991462270158` (营销二部). Counts `salrejectgoodsapplyslave` lines whose product belongs to classify subtree `'16624527080007919539418229414000'` (烟包产品 root); `p_iOut=1` if any. Emits per-line memo CONCAT-ing `产品名称➜退货数量`, plus `bNotAccident` recoded as `iNotAccident`. + +**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sApplyProName, ...)` from `gdsmoduleflow.sApplyProName` (empty in this DB — workflow configs tenant-provisioned per deployment). + +Flag: hardcodes tenant-specific dept-root GUIDs (营销一/二部) + 烟包产品 classify root — same set as `Sp_Apply_Flow_SalSaleOrder`/`OrderChangeNew`. diff --git a/en/docs/auto-catalog/procedures/Sp_BatchGetSid.md b/en/docs/auto-catalog/procedures/Sp_BatchGetSid.md index c48dd88..5b3b078 100644 --- a/en/docs/auto-catalog/procedures/Sp_BatchGetSid.md +++ b/en/docs/auto-catalog/procedures/Sp_BatchGetSid.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 条码(随机码)生成 → 条码管理 → 材料库存 — bulk id-allocator used by the 随机码 (random-code) barcode generation form to pre-mint `iCount` fresh `newId()` values for batch-printing a barcode roll. + +**What it does:** Defaults `iCount` to 20 when 0/null. Creates temp table `p_TmpTable(sId)`, loops `iCount` times inserting `newid()` into it, `SELECT * FROM p_TmpTable` (rowset back to caller), then drops the temp table. + +**Invocation:** Embedded in `gdsconfigformmaster` form `16050651010009472619904464080000` (条码(随机码)生成) under module `16483507160005496961716614988000` (条码管理). Also defined as a procedure-install script at `xly-src/script/标版/30100101/Sp_BatchGetSid.sql`. No Java caller or other procedure references this name. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop1.md b/en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop1.md index 1678447..5ba69ff 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop1.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop1.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 车间效率综合看板-根 — root/composite 车间效率 (workshop efficiency) overview board. Acts as the top-level dashboard tile for the Cqzy (车间综合 / workshop-综合) family `Sp_Bd_Cqzy_workshop1..6` — the earlier evolution of the cq_workshop / bi20-24 family. + +**What it does:** Hardcodes a 6-row `p_Bd_PlcNo_No(iPlcNo,iNo)` map for PLCs `1, 2, 3, 4, 6, 7`, then per-PLC reads `elemachine`/`plc_currentmachinevalue`/`mft_workorder*` to assemble per-machine 当前状态/工单/产量/调机时间 rows into `p_Bd_workshop1`, emits a JSON board into `sReturn`. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_Bd_Cqzy_workshop1.sql`. No form-master sSqlStr, no `gdsmodule` hook, no Java caller. Status: reachable only via an external dashboard HTTP endpoint that invokes the proc by name. + +Flag: PLC literals tenant-deployment-specific; the Cqzy_workshop2/3/5/6 carry `封存` (sealed) markers — workshop1 likely the only one still active. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop2.md b/en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop2.md index e2abbf2..dde021d 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop2.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop2.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 丝印车间 — Cqzy-family 丝印 (silk-screen) 车间看板, an older sibling of `Sp_Bd_cq_workshop_sy` from the 2021 dashboard evolution that targeted the `commonAuto/templateQCM_CQZY*` front-end templates. Covers 8 PLCs `15-22`. + +**What it does:** Hardcodes an 8-row `p_Bd_PlcNo_No(iPlcNo,iNo)` map (with `iNo` starting at 3 — implies positions 1-2 expected to be filled by sibling boards), per-PLC reads `elemachine`/`plc_currentmachinevalue`/`mft_workorder*` to assemble per-machine 当前状态/工单/产量 rows into `p_Bd_workshop2`, emits a JSON board into `sReturn`. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_Bd_Cqzy_workshop2.sql`. No form-master sSqlStr, no `gdsmodule` hook, no Java caller. Status: reachable only via an external dashboard HTTP endpoint. The COMMENT header is bare `丝印车间` (no 封存 marker yet — predates the workshop5/6 retirement). + +Flag: PLC literals `15-22` tenant-deployment-specific; the iNo sequence skipping 1-2 is fragile to front-end template changes. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop3.md b/en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop3.md index 79cdb40..baf5e18 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop3.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop3.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 检验车间 — Cqzy-family 检验 (inspection) 车间看板, an older sibling of `Sp_Bd_cq_workshop_pj` from the 2021 dashboard evolution. Covers 9 PLCs `29-37`. + +**What it does:** Hardcodes a 9-row `p_Bd_PlcNo_No(iPlcNo,iNo)` map for the 检验 cluster, per-PLC reads `elemachine`/`plc_currentmachinevalue`/`mft_workorder*` to assemble per-machine 当前状态/工单/产量 rows into `p_Bd_workshop3`, emits a JSON board into `sReturn`. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_Bd_Cqzy_workshop3.sql`. No form-master sSqlStr, no `gdsmodule` hook, no Java caller. Status: reachable only via an external dashboard HTTP endpoint. The COMMENT header is bare `检验车间` (no 封存 marker — predates the workshop5/6 retirement). + +Flag: PLC literals `29-37` tenant-deployment-specific; body is near-identical to the retired `Sp_Bd_Cqzy_workshop6` (which carries `封存` and the `templateQCM_CQZY6` description). diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop5.md b/en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop5.md index bc87ab0..397139a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop5.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop5.md @@ -1,7 +1,7 @@ # `Sp_Bd_Cqzy_workshop5` (procedure) -> @author:zhucx - @date:20210620 封存 +> @author:zhucx + @date:20210620 封存 @describe: 丝印车间看板 对应 commonAuto/templateQCM_CQZY5 @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 丝印车间看板 — sealed (`封存` 2021-06-20) variant of `Sp_Bd_Cqzy_workshop2`, corresponded to front-end template `commonAuto/templateQCM_CQZY5`. Same 丝印 (silk-screen) line, 8 PLCs `15-22` (with `(23,1),(24,2)` commented out — formerly 10-PLC layout reduced to 8). + +**What it does:** Same shape as `Sp_Bd_Cqzy_workshop2`: hardcodes PLC list, per-PLC assembles per-machine 当前状态/工单/产量 rows into `p_Bd_workshop5`, emits a JSON board into `sReturn`. + +**Invocation:** No form-master sSqlStr, no `gdsmodule` hook, no install script under `xly-src/script/`, no Java caller. Status: marked `封存` in the header — retired from production. Body retained for reference; the live equivalent is `Sp_Bd_Cqzy_workshop2`. Candidate for maintainer audit before deletion. + +Flag: header marks 封存 but the body is intact (not commented out) — if the proc is dropped from a clone, verify no legacy dashboard endpoint still calls it. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop6.md b/en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop6.md index 8a47cc1..e3cc221 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop6.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_Cqzy_workshop6.md @@ -1,7 +1,7 @@ # `Sp_Bd_Cqzy_workshop6` (procedure) -> @author:zhucx - @date:20210620 封存 +> @author:zhucx + @date:20210620 封存 @describe: 检验车间看板 对应 commonAuto/templateQCM_CQZY6 @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 检验车间看板 — sealed (`封存` 2021-06-20) variant of `Sp_Bd_Cqzy_workshop3`, corresponded to front-end template `commonAuto/templateQCM_CQZY6`. Same 检验 (inspection) line, 9 PLCs `29-37`. + +**What it does:** Same shape as `Sp_Bd_Cqzy_workshop3`: hardcodes PLC list, per-PLC assembles per-machine 当前状态/工单/产量 rows into `p_Bd_workshop6`, emits a JSON board into `sReturn`. + +**Invocation:** No form-master sSqlStr, no `gdsmodule` hook, no install script under `xly-src/script/`, no Java caller. Status: marked `封存` in the header — retired from production. Body retained for reference; the live equivalent is `Sp_Bd_Cqzy_workshop3`. Candidate for maintainer audit before deletion. + +Flag: header marks 封存 but the body is intact (not commented out) — verify no legacy dashboard endpoint still calls it before dropping. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_Root_Production.md b/en/docs/auto-catalog/procedures/Sp_Bd_Root_Production.md index 2d328c1..fd3741f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_Root_Production.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_Root_Production.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 — production-board template ("通用界面自定义模板1"). Aggregates current PLC machine-status counts plus today's activity totals (工单 / 入库 / 送货 / 异常 etc.) for the production overview tile. + +**What it does:** Fills `p_ProductionBoard(sName,sValue)` with a date stamp and fixed-string environment readings (`temperature=27.6度`, `humidity=56.2%`), then runs a window-ranked subquery on `plc_machinedata` (latest non-`endWorked` status per `sMachineId`, ranked by `tStartDate desc`) and groups by `sStatus` to count machines in each state. Pads the standard buckets (`startWorking` / `offwork` / `abnormal` / `maintain` / `fileError` / `PaperError` / `waitError`) with 0 when missing, then appends today's COUNT for `mftworkordermaster`, `pitproductinstoremaster`, and other activity tables. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_Bd_Root_Production.sql`. No form-master, no `gdsmodule` hook, no Java caller, no other-routine caller. Reached only by an external dashboard HTTP endpoint that calls the proc by name. The hard-coded temperature/humidity strings indicate this is a demo template, not a live tile — verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus.md b/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus.md index 5d91984..a6aaefd 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus.md @@ -1,7 +1,7 @@ # `Sp_Bd_Root_allstatus` (procedure) -> @author:zhucx - @date:20210620 封存 +> @author:zhucx + @date:20210620 封存 @describe: 看板管理-数字工厂状态看板 @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 / 数字工厂状态看板 — top-of-board status summary covering environment readings and today's supply-chain totals. Author tagged `封存` 2021-06-20. + +**What it does:** Pulls 1区 temperature/humidity from `viw_plc_machine` (`iPlcNo = 27`), then overwrites with simulated readings for 上海/重庆 (random values around 20°C/25°C and 50%/55%), and appends today's count + 万元 totals for `viw_salsalesorder` and `viw_purpurchaseorder` (`bCheck=1` and `tcreateDate = today`). Returns `p_Root_allstatus(sName,sValue)` directly to the renderer. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_Bd_Root_allstatus.sql`. No form-master, no `gdsmodule` hook, no Java caller. Other DB references are siblings `Sp_Bd_Root_allstatus25`/`25_new`/`26` — none call it. Reached only by an external dashboard HTTP endpoint. Marked `封存` (sealed); the mixed "真实数据" + "模拟数据" inserts mean the live readings are immediately overwritten by the random fallbacks — verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus25.md b/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus25.md index d736525..67d1db1 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus25.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus25.md @@ -1,7 +1,7 @@ # `Sp_Bd_Root_allstatus25` (procedure) -> @author:zhucx - @date:20210620 封存 +> @author:zhucx + @date:20210620 封存 @describe: 看板管理-数字工厂状态看板 @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 / 数字工厂状态看板 — 16-press production-floor status grid for the digital-factory board. For each PLC slot (1–16 keyed to demo machine numbers `00000010` / `00000005` / `CD102-7` repeated to fill the grid), reports current order, machine status, planned hours, current shift's quantity, this-month quantity. Author tagged `封存` 2021-06-20. + +**What it does:** Seeds `p_Bd_PlcNo_No(iPlcNo,iNo)` with the 16-slot mapping, then cursor-loops over each slot pulling `viw_plc_machine`, `mftproductionplan*`, `plc_machinedata`, `eleteam`, etc. for that machine — recording sample times (实际调机时间 / 标准调机时间), counts (本班数量 / 本月数量, 本班单数 / 本月单数), team handoff state, plan progress — into temp table `p_Bd_workshop5(sName,sValue)`, then returns the rowset. + +**Invocation:** No install script in xly-src, no form-master, no `gdsmodule` hook, no Java caller. Other DB reference is sibling `Sp_Bd_Root_allstatus25_new` only. Reached only by an external dashboard HTTP endpoint that calls the proc by name. Marked `封存` (sealed) — superseded by `Sp_Bd_Root_allstatus25_new` and the demo-fixed `iPlcNo` literals (`00000010`, `00000005`, `CD102-7`) suggest this never targeted production data. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus25_new.md b/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus25_new.md index 43c607d..09e8e5e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus25_new.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus25_new.md @@ -1,7 +1,7 @@ # `Sp_Bd_Root_allstatus25_new` (procedure) -> @author:zhucx - @date:20210620 封存 +> @author:zhucx + @date:20210620 封存 @describe: 看板管理-数字工厂状态看板 @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 / 数字工厂状态看板 — successor of `Sp_Bd_Root_allstatus25`. Same 16-press production-floor status grid but with a streamlined signature (`sBrId`, `sSuId` only) and no JSON-string OUT parameter — returns the rowset directly for the dashboard renderer. Author tagged `封存` 2021-06-20. + +**What it does:** Identical seeding and cursor logic to `Sp_Bd_Root_allstatus25` over the same 16-slot demo PLC table — fills `p_Bd_workshop5(sName,sValue)` with per-slot order / status / shift quantity / month quantity, then `SELECT *` returns it. + +**Invocation:** No install script in xly-src, no form-master, no `gdsmodule` hook, no Java caller, no other-routine caller. Reached only by an external dashboard HTTP endpoint that calls the proc by name. Marked `封存` (sealed); the demo-fixed `iPlcNo` literals (`00000010`, `00000005`, `CD102-7`) suggest this is a sample/template board, not a live production tile. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus26.md b/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus26.md index a514a7f..a44d47e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus26.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus26.md @@ -1,7 +1,7 @@ # `Sp_Bd_Root_allstatus26` (procedure) -> @author:zhucx - @date:20210620 封存 +> @author:zhucx + @date:20210620 封存 @describe: 看板管理-数字工厂状态看板 @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 / 数字工厂状态看板 — variant of `Sp_Bd_Root_allstatus25` for the 16-press production-floor status grid. Same author and `封存` tag. + +**What it does:** Same shape as `Sp_Bd_Root_allstatus25` — seeds `p_Bd_PlcNo_No` with the 16-slot demo PLC list and cursor-loops to fill `p_Bd_workshop5(sName,sValue)` per slot with order/status/quantity/shift-time fields. + +**Invocation:** No install script in xly-src, no form-master, no `gdsmodule` hook, no Java caller, no other-routine caller. Reached only by an external dashboard HTTP endpoint that calls the proc by name. Marked `封存` (sealed). **Bug:** the `INSERT INTO p_Bd_PlcNo_No(sMachineNo,iNo)` and the cursor `SELECT sMachineNo,iNo FROM p_Bd_PlcNo_No` reference a column `sMachineNo` that the `CREATE TEMPORARY TABLE` does not define — the temp table only has `iPlcNo` and `iNo`. The proc will fail at the seeding INSERT every time it is called. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_1.md b/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_1.md index 44e1203..6863c90 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_1.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_1.md @@ -1,8 +1,8 @@ # `Sp_Bd_Root_allstatus_1` (procedure) -> @author:zhucx - @date:20210620 封存 - @describe: 看板管理-数字工厂状态看板 下 销售数据展示 +> @author:zhucx + @date:20210620 封存 + @describe: 看板管理-数字工厂状态看板 下 销售数据展示 根据印件中的 印件属性为取值 @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 / 数字工厂状态看板 — "销售数据展示" tile (bottom of board). Shows this-month sales totals (万元) bucketed by `eleproduct.sProductproperty` (印件属性): 卡盒类 / 书刊类 / 坑盒类 / 其他 etc. Author tagged `封存` 2021-06-20. + +**What it does:** Seeds `p_Root_allstatus_1` with one row per distinct `eleproduct.sProductproperty` at 0. Joins `viw_salsalesorder` (`bCheck=1`, `tcreateDate >= 当月1号`) with `eleproduct` and sums `dProductMoney/10000` plus a 300 offset per bucket. Then forces 卡盒类 / 书刊类 / 坑盒类 / 其他 to constant or constant-plus-actual values (36 / 58 / 86 / 86). Returns a JSON string `{"data":[{"x":,"y":}...],"yUnit":"万"}` via OUT `sReturn`. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_Bd_Root_allstatus_1.sql`. No form-master, no `gdsmodule` hook, no Java caller, no other-routine caller. Reached only by an external dashboard HTTP endpoint. Marked `封存` (sealed); the hard-coded `+300` offset and per-bucket numeric forces (36/58/86) mean output is mostly demo data — verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_1_new.md b/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_1_new.md index a6d4eeb..083c0f1 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_1_new.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_1_new.md @@ -1,8 +1,8 @@ # `Sp_Bd_Root_allstatus_1_new` (procedure) -> @author:zhucx - @date:20210620 封存 - @describe: 看板管理-数字工厂状态看板 下 销售数据展示 +> @author:zhucx + @date:20210620 封存 + @describe: 看板管理-数字工厂状态看板 下 销售数据展示 根据印件中的 印件属性为取值 @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 / 数字工厂状态看板 — successor of `Sp_Bd_Root_allstatus_1`. Same "销售数据展示" bucketed-by-印件属性 tile, but with no input parameters and returning the rowset directly (`sValue AS data, sName AS axis`) instead of a JSON string. Author tagged `封存` 2021-06-20. + +**What it does:** Same body as `Sp_Bd_Root_allstatus_1` — seeds `p_Root_allstatus_1` from `eleproduct.sProductproperty`, joins `viw_salsalesorder` (current month, `bCheck=1`) summing `dProductMoney/10000 + 300`, then forces 卡盒类/书刊类/坑盒类/其他 to 36/58/86/86, and emits a two-column result set. + +**Invocation:** No install script in xly-src, no form-master, no `gdsmodule` hook, no Java caller, no other-routine caller. Reached only by an external dashboard HTTP endpoint that calls the proc by name. Marked `封存` (sealed); same hard-coded offsets/forces as the non-`_new` version — output is mostly demo data. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_2.md b/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_2.md index fd94c73..4c18b82 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_2.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_2.md @@ -1,8 +1,8 @@ # `Sp_Bd_Root_allstatus_2` (procedure) -> @author:zhucx - @date:20210620 封存 - @describe: 看板管理-数字工厂状态看板 下 采购数据展示 +> @author:zhucx + @date:20210620 封存 + @describe: 看板管理-数字工厂状态看板 下 采购数据展示 根据材料的 材料分类为取值 @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 / 数字工厂状态看板 — "采购数据展示" tile (bottom of board). Shows purchase totals (万元) bucketed by `elematerials.sMaterialsType` (材料分类): paper / label / finished / half_finished / corrugated / sMach_accessories / 辅料. Author tagged `封存` 2021-06-20. + +**What it does:** Seeds `p_Root_allstatus_2` with one row per distinct `elematerials.sMaterialsType` at 0. Joins `viw_purpurchaseorder` (`bCheck=1`, **no date filter — the "本月" filter is commented out**) with `elematerials` and sums `dMaterialsMoney/10000` plus a 100 offset per bucket. Translates the internal codes to Chinese labels (`paper`→纸张, `label`→不干胶, `finished`→成品, `half_finished`→半成品, `corrugated`→瓦楞, `sMach_accessories`→设备配件, else 辅料) and serialises to JSON `{"data":[{"x":,"y":}...],"yUnit":"万"}` via OUT `sReturn`. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_Bd_Root_allstatus_2.sql`. No form-master, no `gdsmodule` hook, no Java caller, no other-routine caller. Reached only by an external dashboard HTTP endpoint. Marked `封存` (sealed); the `+100` offset means output is partly demo data and the commented-out date filter means the sum spans all history rather than the current month — verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_2_new.md b/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_2_new.md index 9aa4f99..7310a4d 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_2_new.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_2_new.md @@ -1,8 +1,8 @@ # `Sp_Bd_Root_allstatus_2_new` (procedure) -> @author:zhucx - @date:20210620 封存 - @describe: 看板管理-数字工厂状态看板 下 采购数据展示 +> @author:zhucx + @date:20210620 封存 + @describe: 看板管理-数字工厂状态看板 下 采购数据展示 根据材料的 材料分类为取值 @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 / 数字工厂状态看板 — successor of `Sp_Bd_Root_allstatus_2`. Same "采购数据展示" 材料分类-bucketed tile, but with no input parameters and returning the rowset directly (`axis`,`data`) instead of a JSON string. Author tagged `封存` 2021-06-20. + +**What it does:** Same body as `Sp_Bd_Root_allstatus_2` — seeds `p_Root_allstatus_2` from `elematerials.sMaterialsType`, joins `viw_purpurchaseorder` (`bCheck=1`) summing `dMaterialsMoney/10000 + 100`, translates the internal code to Chinese label, and emits a two-column result set. + +**Invocation:** No install script in xly-src, no form-master, no `gdsmodule` hook, no Java caller, no other-routine caller. Reached only by an external dashboard HTTP endpoint that calls the proc by name. Marked `封存` (sealed); same `+100` offset and missing date filter as the non-`_new` version — output is partly demo data and spans all history. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_3.md b/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_3.md index 7281df4..96a43a6 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_3.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_3.md @@ -1,8 +1,8 @@ # `Sp_Bd_Root_allstatus_3` (procedure) -> @author:zhucx - @date:20210620 封存 - @describe: 看板管理-数字工厂状态看板 下 销售数据展示 +> @author:zhucx + @date:20210620 封存 + @describe: 看板管理-数字工厂状态看板 下 销售数据展示 根据印件中的 印件属性为取值 @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 / 数字工厂状态看板 — "今日要事" counter strip (bottom of board). Shows today's counts across 8 ERP activity buckets: 今日工单 / 在排工单 / 今日异常 / 工单变更 / 今日入库 / 今日送货 / 发外工单 / 今日退货. Author tagged `封存` 2021-06-20. + +**What it does:** Fills `p_Root_allstatus_3(sName, sValue, iOrder)` row-by-row with `COUNT()` queries against `mftworkordermaster`, `mftproductionplan` (`sState IN (2,3,7)`), `mftqualityaccidentmaster`, `mftprocesschangemaster`, `pitproductinstoremaster`, `saldelivergoodsmaster`, `opsoutsideprocessmaster`, `salrejectgoodsmaster`, each filtered by `bCheck=1` and `tcreateDate = today`. Each query is followed by an `IF NOT EXISTS` block that inserts a 0 row so the bucket is always present. Result is serialised to JSON via OUT `sReturn`. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_Bd_Root_allstatus_3.sql`. No form-master, no `gdsmodule` hook, no Java caller, no other-routine caller. Reached only by an external dashboard HTTP endpoint. Marked `封存` (sealed) — superseded by `Sp_Bd_Root_allstatus_3_new`. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_3_new.md b/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_3_new.md index ddac2a5..b64487a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_3_new.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_Root_allstatus_3_new.md @@ -1,8 +1,8 @@ # `Sp_Bd_Root_allstatus_3_new` (procedure) -> @author:zhucx - @date:20210620 封存 - @describe: 看板管理-数字工厂状态看板 下 销售数据展示 +> @author:zhucx + @date:20210620 封存 + @describe: 看板管理-数字工厂状态看板 下 销售数据展示 根据印件中的 印件属性为取值 @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 / 数字工厂状态看板 — successor of `Sp_Bd_Root_allstatus_3`. Same "今日要事" counter strip with the 8 ERP activity buckets but no input parameters and a direct rowset return. Author tagged `封存` 2021-06-20. + +**What it does:** Same body as `Sp_Bd_Root_allstatus_3` — fills `p_Root_allstatus_3` with today's `COUNT()` for 今日工单 / 在排工单 / 今日异常 / 工单变更 / 今日入库 / 今日送货 / 发外工单 / 今日退货, padding missing buckets with 0, then returns the rowset. + +**Invocation:** No install script in xly-src, no form-master, no `gdsmodule` hook, no Java caller, no other-routine caller. Reached only by an external dashboard HTTP endpoint that calls the proc by name. Marked `封存` (sealed). diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_bi16.md b/en/docs/auto-catalog/procedures/Sp_Bd_bi16.md index 8674b1f..c4dcda5 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_bi16.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_bi16.md @@ -1,7 +1,7 @@ # `Sp_Bd_bi16` (procedure) -> @author:zhucx - @date:20211224 +> @author:zhucx + @date:20211224 @describe: 喷码车间 @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 喷码车间 workshop dashboard (kanban) — board procedure for the 喷码 (inkjet) workshop in the `Sp_Bd_bi` workshop-board family (16=喷码, 17=模烫, 18=印刷, 19=糊盒, 20=喷码现场, 21=模烫现场, 22=印刷现场, 23=糊盒现场, 24=品检现场). Returns the per-machine current-shift status block consumed by the 看板/dashboard page. + +**What it does:** Seeds a temp table `p_Bd_PlcNo_No(iPlcNo,iNo)` with five 喷码 machine PLC numbers (`26,7,5,6,27`) and iterates them with a cursor. For each machine, looks up current 工单 / 班组 / 设备状态 via `viw_plc_machine`, joins `mftworkordermaster`+`mftworkorderprocess` to compute 实际调机时间 / 标准调机时间 / 调机偏差 / 当前色号 / 完成版数 + 完成模数 from `plc_machinedata`, then aggregates into `p_Bd_workshop5(sName,sValue)` and emits a `{"data":[{"x":..., "y":...}], ...}` JSON for chart rendering. + +**Invocation:** Installed by `xly-src/script/标版/30100101/kanban/Sp_Bd_bi16-喷码.sql`. No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Status: appears reachable only via an external dashboard HTTP endpoint that invokes the proc by name. Per wiki scope, kanban dashboard procs sit outside the routine call-graph wiring tracked in this catalog. + +Tenant note: `iPlcNo` literals (`26,7,5,6,27`) are tied to one deployment's machine numbering — cloning to a new deployment requires re-mapping per `elemachine.iPlcNo`. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_bi17.md b/en/docs/auto-catalog/procedures/Sp_Bd_bi17.md index 20cd9ea..d75b63e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_bi17.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_bi17.md @@ -1,7 +1,7 @@ # `Sp_Bd_bi17` (procedure) -> @author:zhucx - @date:20211224 +> @author:zhucx + @date:20211224 @describe: 模烫车间 @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 模烫车间 workshop dashboard (kanban) — board procedure for the 模烫 (die-cut + hot-stamping) workshop in the `Sp_Bd_bi` workshop-board family. Returns the per-machine current-shift status block consumed by the 看板/dashboard page. + +**What it does:** Same shape as `Sp_Bd_bi16` (sibling for 喷码) — seeds `p_Bd_PlcNo_No` with four 模烫 machine PLC numbers (`8,9,10,11`), cursor-iterates per machine, reads current 工单 / 班组 / 设备状态 via `viw_plc_machine`, joins `mftworkordermaster`+`mftworkorderprocess`, computes 实际/标准/偏差 调机时间 + 当前色号 + 完成版数/模数 from `plc_machinedata`, aggregates into `p_Bd_workshop5(sName,sValue)` and emits a `{"data":[...]}` JSON for the dashboard widget. + +**Invocation:** Installed by `xly-src/script/标版/30100101/kanban/Sp_Bd_bi17-模烫.sql`. No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Status: appears reachable only via an external dashboard HTTP endpoint that invokes the proc by name. Per wiki scope, kanban dashboard procs sit outside the routine call-graph wiring tracked in this catalog. + +Tenant note: `iPlcNo` literals (`8,9,10,11`) are tied to one deployment's machine numbering — cloning requires re-mapping per `elemachine.iPlcNo`. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_bi18.md b/en/docs/auto-catalog/procedures/Sp_Bd_bi18.md index 20b3888..b8dd8bb 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_bi18.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_bi18.md @@ -1,7 +1,7 @@ # `Sp_Bd_bi18` (procedure) -> @author:zhucx - @date:20211224 +> @author:zhucx + @date:20211224 @describe: 印刷车间 @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 印刷车间 workshop dashboard (kanban) — board procedure for the 印刷 (printing) workshop in the `Sp_Bd_bi` workshop-board family. Returns the per-machine current-shift status block consumed by the 看板/dashboard page. MES-integrated variant — reads MES-system tables in addition to xly's own. + +**What it does:** Same shape as siblings `Sp_Bd_bi16`/`Sp_Bd_bi17` — seeds `p_Bd_PlcNo_No` with the 印刷 machine PLC numbers (`23,12,1,2,13`), cursor-iterates per machine, reads current 工单 / 班组 / 设备状态 via `viw_plc_machine`, joins `mftworkordermaster`+`mftworkorderprocess`, computes 实际/标准/偏差 调机时间 + 当前色号 + 完成版数/模数 from `plc_machinedata`, aggregates into `p_Bd_workshop5` and emits a `{"data":[...]}` JSON. Reads MES counter columns via the `MEStt` join (replaced by xly's own counter in the `_nomes` sibling). + +**Invocation:** Installed by `xly-src/script/标版/30100101/kanban/Sp_Bd_bi18-印刷.sql`. No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller (other than appearing as a comment string in `Sp_Bd_bi18_nomes`), no Java caller. Status: appears reachable only via an external dashboard HTTP endpoint that invokes the proc by name. Per wiki scope, kanban dashboard procs sit outside the routine call-graph wiring tracked in this catalog. + +Tenant note: `iPlcNo` literals (`23,12,1,2,13`) are deployment-specific. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_bi18_nomes.md b/en/docs/auto-catalog/procedures/Sp_Bd_bi18_nomes.md index 7cf732c..f36544c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_bi18_nomes.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_bi18_nomes.md @@ -1,7 +1,7 @@ # `Sp_Bd_bi18_nomes` (procedure) -> @author:zhucx - @date:20211224 +> @author:zhucx + @date:20211224 @describe: 印刷车间 @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 印刷车间 workshop dashboard (kanban) — `_nomes` (= "no MES") fork of `Sp_Bd_bi18`, intended for deployments where the MES system is not present. Same business intent: per-machine current-shift status for the 印刷 (printing) workshop kanban page. + +**What it does:** Same shape as `Sp_Bd_bi18` — same PLC list (`23,12,1,2,13`), same per-machine cursor over `mftworkordermaster`/`mftworkorderprocess`/`plc_machinedata`, but the `MEStt` join is removed and counter values come from xly's own production-report tables instead. Smaller body (~20.8K vs 21.9K). + +**Invocation:** No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller (its only cross-reference is the `Sp_Bd_bi18` comment header), no `xly-src` script install path, no Java caller. Status: appears orphaned — `_nomes` was authored as a non-MES fallback but the live deployment is the MES variant. Candidate for maintainer audit. + +Tenant note: `iPlcNo` literals (`23,12,1,2,13`) are deployment-specific. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_bi19.md b/en/docs/auto-catalog/procedures/Sp_Bd_bi19.md index 7a2f369..82c2fe5 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_bi19.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_bi19.md @@ -1,7 +1,7 @@ # `Sp_Bd_bi19` (procedure) -> @author:zhucx - @date:20211224 +> @author:zhucx + @date:20211224 @describe: 糊盒车间 @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 糊盒车间 workshop dashboard (kanban) — board procedure for the 糊盒 (carton-gluing/boxing) workshop in the `Sp_Bd_bi` workshop-board family. Returns the per-machine current-shift status block consumed by the 看板/dashboard page. + +**What it does:** Same shape as siblings `Sp_Bd_bi16`/`Sp_Bd_bi17`/`Sp_Bd_bi18` — seeds `p_Bd_PlcNo_No` with seven 糊盒 machine PLC numbers (`25,29,14,15,16,17,28,...`), cursor-iterates per machine, reads current 工单 / 班组 / 设备状态 via `viw_plc_machine`, joins `mftworkordermaster`+`mftworkorderprocess`, computes 实际/标准/偏差 调机时间 + 当前色号 + 完成版数/模数 from `plc_machinedata`, aggregates into `p_Bd_workshop5` and emits a `{"data":[...]}` JSON. + +**Invocation:** Installed by `xly-src/script/标版/30100101/kanban/Sp_Bd_bi19-糊盒.sql`. No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Status: appears reachable only via an external dashboard HTTP endpoint that invokes the proc by name. Per wiki scope, kanban dashboard procs sit outside the routine call-graph wiring tracked in this catalog. + +Tenant note: `iPlcNo` literals are deployment-specific. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_bi20.md b/en/docs/auto-catalog/procedures/Sp_Bd_bi20.md index 5db7347..59c75c6 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_bi20.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_bi20.md @@ -1,7 +1,7 @@ # `Sp_Bd_bi20` (procedure) -> @author:zhucx - @date:20220111 +> @author:zhucx + @date:20220111 @describe: 喷码+分切现场 @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 喷码+分切现场 workshop dashboard (kanban) — board procedure for the 喷码 + 分切 (inkjet + slitting) shop-floor view in the `Sp_Bd_bi` workshop-board family. Returns the per-machine current-shift status block consumed by the 看板/dashboard page; the on-floor `_现场` siblings (20=喷码, 21=模烫, 22=印刷, 23=糊盒, 24=品检) extend the workshop boards (16–19) with team/班组 + 工单批次 + 调机时间 line-by-line breakdowns. + +**What it does:** Seeds `p_Bd_PlcNo_No` with four PLC numbers (`7,5,6,27`), cursor-iterates per machine, reads current 工单号 / 当前班组 / 当前设备状态 / 当前色号 from `viw_plc_machine`, joins `mftworkordermaster`+`mftworkorderprocess`+`Mft_WorkOrder_Parts`+`eleteam`+`mftproductionplanmaster`+`mftproductionplanslave` for the active 计划/工单, computes 实际/标准/偏差 调机时间 + 完成版数 + 完成模数 from `plc_machinedata`/`p_Bd_Speed`, aggregates into `p_Bd_workshop`/`p_Bd_workshop5` and emits a `{"data":[...]}` JSON. + +**Invocation:** Installed by `xly-src/script/标版/30100101/kanban/Sp_Bd_bi20-喷码现场.sql`. No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller (other than appearing as a comment string in the bi20 variant procs), no Java caller. Status: appears reachable only via an external dashboard HTTP endpoint that invokes the proc by name. Per wiki scope, kanban dashboard procs sit outside the routine call-graph wiring tracked in this catalog. + +Tenant note: `iPlcNo` literals (`7,5,6,27`) are tied to one deployment's machine numbering. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_bi20_1.md b/en/docs/auto-catalog/procedures/Sp_Bd_bi20_1.md index 0848a4b..f59e9db 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_bi20_1.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_bi20_1.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 喷码+分切现场 稼动图 — single-machine 稼动率 (OEE / utilization rate) sub-chart for one PLC machine on the 喷码现场 kanban. Companion to `Sp_Bd_bi20` (the multi-machine status board) — `_1` returns the utilization rate gauge for one machine identified by `sPlcNo`. + +**What it does:** Reads `elemachine` + `viw_plc_machine` for `iPlcNo=sPlcNo` to resolve `sMachineGuid`, `sTeamId`, `sOffWork`/`sShiftsWork`, machine `sWorkType`. Computes the shift window (`p_tStartDate` = `FUN_GET_DATE_BC_STARTDATE_NEW(NOW(),p_sOffWork,p_sShiftsWork)`, `p_tEndDate=NOW()`), then aggregates `plc_machinedata.dProduceHour` per `sStatus` (working/idle/changeover/...) into `p_bd_MachinePlanTemplate3`, divides 实际生产秒 by 总秒数 to compute 时间稼动率 (`p_dTimeOee`), 速度稼动率 (`p_dSpeedOee`), and 总稼动率 (`p_dOee`), and emits a JSON gauge `{"data":[{"x":"OEE","y":...}], "subTitle":"<总稼动率%>"}` into `sReturn`. + +**Invocation:** Installed by `xly-src/script/标版/30100101/kanban/Sp_Bd_bi20_1.sql`. No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller (other than as a string in the `_new`/`_newZZT` evolution variants), no Java caller. Status: appears reachable only via an external dashboard HTTP endpoint that invokes the proc by name. Per wiki scope, kanban dashboard procs sit outside the routine call-graph wiring tracked in this catalog. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_bi20_1_new.md b/en/docs/auto-catalog/procedures/Sp_Bd_bi20_1_new.md index 63f5800..1273a84 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_bi20_1_new.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_bi20_1_new.md @@ -23,4 +23,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 喷码+分切现场 稼动图 — second-generation rewrite of `Sp_Bd_bi20_1`. Same intent (single-machine OEE gauge for the 喷码现场 kanban) with refined shift-window and reference-value handling. + +**What it does:** Same overall logic as `Sp_Bd_bi20_1` — reads `elemachine`/`viw_plc_machine` for `iPlcNo=sPlcNo`, computes shift window via `FUN_GET_DATE_BC_STARTDATE_NEW`, aggregates `plc_machinedata.dProduceHour` per `sStatus` to derive 时间稼动率 / 速度稼动率 / 总稼动率, emits JSON gauge into `sReturn`. Adjusts the reference 标准值 baselines (`p_dStdTimeOee` / `p_dStdSpeedOee` / `p_dStdOee` / `p_dStdOeeQty`) and the day-quota / month-plan defaults (`p_dDayQty=8000`, `p_dMonthPlanQty=240000`). + +**Invocation:** No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller (other than as a comment-line reference in `_newZZT`), no `xly-src` script install path, no Java caller. Status: appears orphaned — superseded by `Sp_Bd_bi20_1_newZZT` which adds an `iType` switch. Candidate for maintainer audit. + +Flag: catalog header `喷码+分切现场 稼动图` is identical to the `_1` and `_newZZT` siblings — only the body differs. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_bi20_1_newZZT.md b/en/docs/auto-catalog/procedures/Sp_Bd_bi20_1_newZZT.md index 9a78fd2..c4adae0 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_bi20_1_newZZT.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_bi20_1_newZZT.md @@ -24,4 +24,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 喷码+分切现场 稼动图 — current production variant of `Sp_Bd_bi20_1`. `ZZT` suffix (柱状图 / 折线图 toggle) adds an `iType` switch so the same proc can return either gauge-style or column/line-chart JSON for the 喷码现场 kanban. + +**What it does:** Same shift-window resolution + per-status aggregation over `plc_machinedata` as `Sp_Bd_bi20_1`/`_new`. Adds `iType` branch — `iType=0` emits the gauge JSON, `iType=1` emits a multi-bar chart JSON with the per-status hours laid out as columns. Includes the same reference-baseline tuning as `_new`. + +**Invocation:** Installed by `xly-src/script/标版/20250616/Sp_Bd_bi20_1_newZZT.sql`. No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Status: appears reachable only via an external dashboard HTTP endpoint that invokes the proc by name. Per wiki scope, kanban dashboard procs sit outside the routine call-graph wiring tracked in this catalog. + +Flag: identical catalog header `喷码+分切现场 稼动图` across `_1`/`_new`/`_newZZT` — only the install bundle date (`20250616` install) and the new `iType` parameter distinguish this as the live variant. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_bi20_2.md b/en/docs/auto-catalog/procedures/Sp_Bd_bi20_2.md index 0b946e5..09257ee 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_bi20_2.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_bi20_2.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 单个机台时间分析 — single-machine time-breakdown ring/pie chart for the 喷码现场 kanban. Companion to `Sp_Bd_bi20_1` (utilization gauge): `_1` reports the OEE %, `_2` reports the per-status hour decomposition (working / idle / changeover / waiting / ...) for the same machine. + +**What it does:** Reads `elemachine` for `iPlcNo=sPlcNo` to resolve `p_sMachineGuid` + `sOffWork`/`sShiftsWork`/`sWorkType`. Computes shift window via `FUN_GET_DATE_BC_STARTDATE_NEW(NOW(),p_sOffWork,p_sShiftsWork)`. Aggregates `plc_machinedata.dProduceHour` GROUPED BY `sStatus` (with NULL collapsed to `waitingWork`) into `p_bd_EqStatus(sName,sValue,iOrder)`, joins `plc_machinedata_status` for the Chinese display name + color, and selects the per-status rows directly back to the caller (no JSON wrapping). + +**Invocation:** Installed by `xly-src/script/标版/30100101/kanban/Sp_Bd_bi20_2.sql`. No form-master sSqlStr, no `gdsmodule` hook, called from `Sp_MachinePoweranalysis_1` and `Sp_MachineSpeedanalysis_1` via commented-out CALL lines (currently dead), no live caller, no Java caller. Status: appears reachable only via an external dashboard HTTP endpoint that invokes the proc by name. Per wiki scope, kanban dashboard procs sit outside the routine call-graph wiring tracked in this catalog. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_bi20_2_nomes.md b/en/docs/auto-catalog/procedures/Sp_Bd_bi20_2_nomes.md index 281d43d..4902665 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_bi20_2_nomes.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_bi20_2_nomes.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 单个机台时间分析 — `_nomes` (no MES) + caller-driven-window fork of `Sp_Bd_bi20_2`. Same intent (single-machine per-status hour decomposition for the 喷码现场 kanban) but takes the shift window + machine + team as IN parameters rather than computing them from `elemachine`. + +**What it does:** Accepts `tStartDate`/`tEndDate`/`p_sMachineId`/`p_sTeamId` IN parameters, aggregates `plc_machinedata.dProduceHour` GROUPED BY `sStatus` over that window for that machine, joins `plc_machinedata_status` for display label/color, returns the per-status rowset directly. + +**Invocation:** No form-master sSqlStr, no `gdsmodule` hook, only commented-out CALL references in `Sp_MachinePoweranalysis_1`/`Sp_MachineSpeedanalysis_1`, no `xly-src` script install path, no Java caller. Status: appears orphaned — non-MES fork was authored but the live `_2new`/`_2` variants own the kanban path. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_bi20_2new.md b/en/docs/auto-catalog/procedures/Sp_Bd_bi20_2new.md index 8ca0598..0982906 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_bi20_2new.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_bi20_2new.md @@ -23,4 +23,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 单个机台时间分析 — current production rewrite of `Sp_Bd_bi20_2`. Same intent (single-machine per-status hour breakdown for the 喷码现场 kanban) installed via the 2025-06-16 install bundle. + +**What it does:** Same shape as `Sp_Bd_bi20_2` — reads `elemachine` for `iPlcNo=sPlcNo`, computes shift window via `FUN_GET_DATE_BC_STARTDATE_NEW`, aggregates `plc_machinedata.dProduceHour` per `sStatus` (NULL → `waitingWork`), joins `plc_machinedata_status` for label+color, returns per-status rows. + +**Invocation:** Installed by `xly-src/script/标版/20250616/Sp_Bd_bi20_2new.sql`. No form-master sSqlStr, no `gdsmodule` hook, no live other-routine caller (only as a comment-string in commented-out CALL lines in `Sp_MachinePoweranalysis_1`/`Sp_MachineSpeedanalysis_1`), no Java caller. Status: appears reachable only via an external dashboard HTTP endpoint that invokes the proc by name. Per wiki scope, kanban dashboard procs sit outside the routine call-graph wiring tracked in this catalog. + +Flag: `-- Call Sp_Bd_bi20_2(14, ...)` comment-header (note `_2`, not `_2new`) was copy-pasted from `_2` and not updated — minor doc drift. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_bi20_hh.md b/en/docs/auto-catalog/procedures/Sp_Bd_bi20_hh.md index 967f7de..68a3ea6 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_bi20_hh.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_bi20_hh.md @@ -1,7 +1,7 @@ # `Sp_Bd_bi20_hh` (procedure) -> @author:zhucx - @date:20220111 +> @author:zhucx + @date:20220111 @describe: 喷码+分切现场 @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 糊盒现场 workshop dashboard (kanban) — `_hh` (糊盒/hu-he, carton-gluing) fork of `Sp_Bd_bi20`. Despite the header saying `喷码+分切现场` (copy-pasted from sibling), the body's PLC list (`34,33,32,30`) targets 糊盒 machines per `elemachine.iPlcNo`. Returns the per-machine current-shift status block for the 糊盒现场 kanban page. + +**What it does:** Same shape as `Sp_Bd_bi20` (喷码 sibling) — seeds `p_Bd_PlcNo_No(iPlcNo,iNo)` with `(34,1),(33,2),(32,3),(30,4)`, cursor-iterates per machine, reads current 工单号/班组/状态 from `viw_plc_machine`, computes 实际/标准/偏差 调机时间 + 完成版数/模数 from `plc_machinedata`, aggregates into `p_Bd_workshop5` and emits a `{"data":[...]}` JSON. + +**Invocation:** No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no `xly-src` script install path, no Java caller. Status: appears orphaned — the live 糊盒现场 kanban presumably calls `Sp_Bd_bi23-糊盒现场.sql` from the canonical kanban folder; `_hh` is likely a fork-named scratch variant. Candidate for maintainer audit. + +Flag: catalog header `喷码+分切现场` was copy-pasted from `Sp_Bd_bi20` and not updated for the 糊盒 PLC list — doc-vs-body mismatch. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_bi20_ys.md b/en/docs/auto-catalog/procedures/Sp_Bd_bi20_ys.md index e730c17..2bb327f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_bi20_ys.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_bi20_ys.md @@ -1,7 +1,7 @@ # `Sp_Bd_bi20_ys` (procedure) -> @author:zhucx - @date:20220111 +> @author:zhucx + @date:20220111 @describe: 喷码+分切现场 @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 印刷现场 workshop dashboard (kanban) — `_ys` (印刷/ying-shua, printing) fork of `Sp_Bd_bi20`. Despite the header saying `喷码+分切现场` (copy-pasted from sibling), the body's PLC list (`4,6,2,5`) targets 印刷 machines per `elemachine.iPlcNo`. Returns the per-machine current-shift status block for the 印刷现场 kanban page. + +**What it does:** Same shape as `Sp_Bd_bi20` (喷码 sibling) — seeds `p_Bd_PlcNo_No(iPlcNo,iNo)` with `(4,1),(6,2),(2,3),(5,4)`, cursor-iterates per machine, reads current 工单号/班组/状态 from `viw_plc_machine`, computes 实际/标准/偏差 调机时间 + 完成版数/模数 from `plc_machinedata`, aggregates into `p_Bd_workshop5` and emits a `{"data":[...]}` JSON. + +**Invocation:** No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no `xly-src` script install path, no Java caller. Status: appears orphaned — the canonical kanban folder has `Sp_Bd_bi22-印刷现场.sql` for the 印刷现场 view, so `_ys` is likely a fork-named scratch variant. Candidate for maintainer audit. + +Flag: catalog header `喷码+分切现场` was copy-pasted from `Sp_Bd_bi20` and not updated for the 印刷 PLC list — doc-vs-body mismatch. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_bi21.md b/en/docs/auto-catalog/procedures/Sp_Bd_bi21.md index e9ffdc5..936d827 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_bi21.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_bi21.md @@ -1,7 +1,7 @@ # `Sp_Bd_bi21` (procedure) -> @author:zhucx - @date:20220111 +> @author:zhucx + @date:20220111 @describe: 模烫现场 @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 模烫现场 workshop dashboard (kanban) — board procedure for the 模烫 (die-cut + hot-stamping) shop-floor view in the `Sp_Bd_bi` workshop-board family. Companion to `Sp_Bd_bi17` (the 模烫 workshop board); `_21` is the on-floor (`现场`) extension with班组 + 工单批次 details. + +**What it does:** Seeds `p_Bd_PlcNo_No(iPlcNo,iNo)` with four 模烫 machine PLC numbers (`8,9,10,11` — same as `Sp_Bd_bi17`), cursor-iterates per machine, reads current 工单号 / 班组 / 设备状态 / 当前色号 from `viw_plc_machine`, joins `mftworkordermaster`+`mftworkorderprocess`+`Mft_WorkOrder_Parts`+`eleteam` for the active 工单 details, computes 实际/标准/偏差 调机时间 + 完成版数 + 完成模数 from `plc_machinedata`, aggregates into `p_Bd_workshop`/`p_Bd_workshop5` and emits a `{"data":[...]}` JSON. + +**Invocation:** Installed by `xly-src/script/标版/30100101/kanban/Sp_Bd_bi21-模烫现场.sql`. No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Status: appears reachable only via an external dashboard HTTP endpoint that invokes the proc by name. Per wiki scope, kanban dashboard procs sit outside the routine call-graph wiring tracked in this catalog. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_bi22.md b/en/docs/auto-catalog/procedures/Sp_Bd_bi22.md index 12bdbe5..863c10e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_bi22.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_bi22.md @@ -1,7 +1,7 @@ # `Sp_Bd_bi22` (procedure) -> @author:zhucx - @date:20220111 +> @author:zhucx + @date:20220111 @describe: 印刷现场 @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 印刷现场 — four-machine 现场看板 (workshop kanban) for the 印刷 (printing) line, sibling to `Sp_Bd_bi20` (喷码现场), `Sp_Bd_bi21` (模烫现场), `Sp_Bd_bi23` (糊盒现场), `Sp_Bd_bi24` (品检现场). Returns the four-tile status board for PLCs `1, 2, 13, 23`. + +**What it does:** Hardcodes a 4-row `p_Bd_PlcNo_No(iPlcNo,iNo)` map, then for each PLC reads `elemachine`/`plc_currentmachinevalue`/`mft_workorder*` to assemble per-machine 当前状态/当前工单/已生产数量/调机时间/异常 tiles into `p_Bd_workshop5`, finally emitting a JSON board into `sReturn`. + +**Invocation:** Installed by `xly-src/script/标版/30100101/kanban/Sp_Bd_bi22-印刷现场.sql`. No form-master sSqlStr, no `gdsmodule` hook, no Java caller. Status: reachable only via an external dashboard HTTP endpoint that invokes the proc by name — kanban procs sit outside the routine call-graph wiring this catalog tracks. The MES-fork `Sp_Bd_bi22_nomes` is the non-MES variant. + +Flag: the four PLC literals `1, 2, 13, 23` are tenant-deployment-specific (no `elemachine.sName` lookup) — re-mapping needed if cloned. The header comment `@describe: 印刷现场` matches the body. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_bi22_nomes.md b/en/docs/auto-catalog/procedures/Sp_Bd_bi22_nomes.md index 3764fb0..bffa13e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_bi22_nomes.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_bi22_nomes.md @@ -1,7 +1,7 @@ # `Sp_Bd_bi22_nomes` (procedure) -> @author:zhucx - @date:20220111 +> @author:zhucx + @date:20220111 @describe: 印刷现场 @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 印刷现场 — non-MES fork of `Sp_Bd_bi22`, same four-machine 现场看板 for the 印刷 line but without MES-integrated work-order joins. Same PLC list `1, 2, 13, 23`. + +**What it does:** Same shape as `Sp_Bd_bi22`: hardcodes a 4-row `p_Bd_PlcNo_No` map, reads `elemachine`/`plc_currentmachinevalue` per PLC, assembles per-machine tiles into `p_Bd_workshop5`, emits a JSON board into `sReturn`. The MES-specific 工单 lookups are bypassed in this variant. + +**Invocation:** No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no install script under `xly-src/script/`, no Java caller. Status: appears orphan — likely a non-MES fallback that was forked but never wired to a dashboard endpoint. Candidate for maintainer audit before deletion. The MES-integrated `Sp_Bd_bi22` is the live one. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_bi23.md b/en/docs/auto-catalog/procedures/Sp_Bd_bi23.md index 3b769db..0612fdb 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_bi23.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_bi23.md @@ -1,7 +1,7 @@ # `Sp_Bd_bi23` (procedure) -> @author:zhucx - @date:20220111 +> @author:zhucx + @date:20220111 @describe: 糊盒现场 @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 糊盒现场 — four-machine 现场看板 (workshop kanban) for the 糊盒 (carton-gluing) line, sibling to the bi20–bi24 family. Returns the four-tile status board for PLCs `25, 14, 15, 16`. + +**What it does:** Hardcodes a 4-row `p_Bd_PlcNo_No(iPlcNo,iNo)` map, then for each PLC reads `elemachine`/`plc_currentmachinevalue`/`mft_workorder*` to assemble per-machine 当前状态/当前工单/已生产数量/调机时间 tiles into `p_Bd_workshop5`, finally emitting a JSON board into `sReturn`. + +**Invocation:** Installed by `xly-src/script/标版/30100101/kanban/Sp_Bd_bi23-糊盒现场.sql`. No form-master sSqlStr, no `gdsmodule` hook, no Java caller. Status: reachable only via an external dashboard HTTP endpoint that invokes the proc by name. + +Flag: PLC literals `25, 14, 15, 16` tenant-deployment-specific. Bi23 has no `_nomes` variant in this DB (unlike bi22). diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_bi24.md b/en/docs/auto-catalog/procedures/Sp_Bd_bi24.md index 64c7b6f..f495cef 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_bi24.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_bi24.md @@ -1,7 +1,7 @@ # `Sp_Bd_bi24` (procedure) -> @author:zhucx - @date:20220111 +> @author:zhucx + @date:20220111 @describe: 品检现场 @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 品检现场 — four-machine 现场看板 (workshop kanban) for the 品检 (quality-inspection) line, sibling to the bi20–bi23 family. Returns the four-tile status board for PLCs `18, 3, 4, 29`. + +**What it does:** Hardcodes a 4-row `p_Bd_PlcNo_No(iPlcNo,iNo)` map, then for each PLC reads `elemachine`/`plc_currentmachinevalue`/`mft_workorder*` to assemble per-machine 当前状态/当前工单/已生产数量/调机时间 tiles into `p_Bd_workshop5`, finally emitting a JSON board into `sReturn`. + +**Invocation:** Installed by `xly-src/script/标版/30100101/kanban/Sp_Bd_bi24-品检现场.sql`. No form-master sSqlStr, no `gdsmodule` hook, no Java caller. Status: reachable only via an external dashboard HTTP endpoint that invokes the proc by name. + +Flag: PLC literals `18, 3, 4, 29` tenant-deployment-specific. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_bi4.md b/en/docs/auto-catalog/procedures/Sp_Bd_bi4.md index 58166a6..704eeb8 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_bi4.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_bi4.md @@ -1,7 +1,7 @@ # `Sp_Bd_bi4` (procedure) -> @author:zhucx - @date:20220111 +> @author:zhucx + @date:20220111 @describe: 三屏设备 @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 三屏设备 — three-screen device 现场看板 for a specific 3-PLC cluster on the workshop floor. Sibling of the bi20–bi24 four-tile family but only 3 tiles wide. + +**What it does:** Hardcodes a 3-row `p_Bd_PlcNo_No(iPlcNo,iNo)` map for PLCs `10, 11, 12`, then for each PLC reads `elemachine`/`plc_currentmachinevalue`/`mft_workorder*` to assemble per-machine 当前状态/当前工单/已生产数量/调机时间 tiles into `p_Bd_workshop5`, emitting a JSON board into `sReturn`. + +**Invocation:** No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no install script under `xly-src/script/`, no Java caller. Status: appears orphan — likely a one-off dashboard variant that may still be reachable via an external HTTP endpoint by proc-name. Candidate for maintainer audit. + +Flag: header date `20220111` matches the bi16-24 cohort but the `bi4` numbering is out of band (the rest run bi16–24). PLC list `10, 11, 12` tenant-deployment-specific. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_bi_Lostorder.md b/en/docs/auto-catalog/procedures/Sp_Bd_bi_Lostorder.md index be8afd8..b2cee5b 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_bi_Lostorder.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_bi_Lostorder.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 客户估价分析 → 报价&估计管理 → 销售管理 — dashboard chart procedure that classifies a customer's quotations into "lost-by-status" buckets versus "已成交订单" (closed-deal orders) for a given date window. Header: 丢单原因分析. + +**What it does:** Reads `viw_quoquotation` for one `sCustomerId=sCustomerIdpro` inside `[tStartDate,tEndDate]`, splits rows into two groups: rows whose `sId` does NOT appear as `viw_salsalesorder.sSrcId` (lost — grouped by `sType` lost-reason; empty `sType` rewritten to `Fun_Sis_GetConstNew('','sOrderNotCustomer','',...)` = 未走客户确认流程直接下单), and rows that DO appear (won — labelled `Fun_Sis_GetConstNew('','sCompleteOrder','',...)`). Aggregates `dProductMoney` per bucket into temp `Tmp_bi_Lostorder(sName,sValue)`, then emits a single `{"data":[{"x":...,"y":...}...], "hasLegend":true, "subTitle":"", ...}` JSON string into `sReturn` for the dashboard widget. + +**Invocation:** Embedded in `gdsconfigformmaster` form `16758336770001677223131387683300` (客户估价分析) under module `101251240115015967857770020` (报价&估计管理 → 销售管理). No Java caller or other procedure references this name. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_hh.md b/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_hh.md index 88f7afe..032b060 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_hh.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_hh.md @@ -1,7 +1,7 @@ # `Sp_Bd_cq_workshop_hh` (procedure) -> @author:zhucx - @date:20211224 +> @author:zhucx + @date:20211224 @describe: 糊盒车间 @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 糊盒车间 — workshop-wide 车间看板 (per-shift summary board) for the 糊盒 line, covering 7 PLCs `33-39`. Predecessor of the narrower 4-tile `Sp_Bd_bi23` 现场 board. + +**What it does:** Hardcodes a 7-row `p_Bd_PlcNo_No(iPlcNo,iNo)` map for the 糊盒 cluster, then for each PLC reads `elemachine`/`plc_currentmachinevalue`/`mft_workorder*` to assemble per-machine 当前状态/当前工单号/已生产数量/调机时间 rows into `p_Bd_workshop5`, emitting a JSON board into `sReturn`. + +**Invocation:** No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no install script under `xly-src/script/` (only sibling `_ys` has one). No Java caller. Status: reachable only via an external dashboard HTTP endpoint that invokes the proc by name; per wiki scope, kanban procs sit outside the routine call-graph wiring this catalog tracks. + +Flag: PLC literals `33-39` tenant-deployment-specific. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_mt.md b/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_mt.md index 5f93296..eeade9a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_mt.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_mt.md @@ -1,7 +1,7 @@ # `Sp_Bd_cq_workshop_mt` (procedure) -> @author:zhucx - @date:20211224 +> @author:zhucx + @date:20211224 @describe: 模烫车间 @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 模烫车间 — workshop-wide 车间看板 for the 模烫 (die-cutting/embossing) line, covering 13 PLCs from the mid-range cluster `8, 15-26`. Predecessor of the narrower 4-tile `Sp_Bd_bi21` 模烫现场 board. The "root" of the cq_workshop_* family — its `Sp_Bd_cq_workshop_mt` call-comment is copy-pasted into every sibling's header. + +**What it does:** Hardcodes a 13-row `p_Bd_PlcNo_No(iPlcNo,iNo)` map for the 模烫 cluster, then per-PLC reads `elemachine`/`plc_currentmachinevalue`/`mft_workorder*` to assemble 当前状态/当前工单号/已生产数量/调机时间/异常 rows into `p_Bd_workshop5`, emits a JSON board into `sReturn`. + +**Invocation:** No form-master sSqlStr, no `gdsmodule` hook, no install script under `xly-src/script/` for this proc. Other-routine callers `Sp_Bd_cq_workshop_hh/pj/pm/sy` reference it only in the stale `-- call Sp_Bd_cq_workshop_mt(...)` comment. Status: reachable only via an external dashboard HTTP endpoint. + +Flag: PLC literals `8, 15-26` tenant-deployment-specific. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_pj.md b/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_pj.md index 739266a..90ef9e7 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_pj.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_pj.md @@ -1,7 +1,7 @@ # `Sp_Bd_cq_workshop_pj` (procedure) -> @author:zhucx - @date:20211224 +> @author:zhucx + @date:20211224 @describe: 品检车间 @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 品检车间 — workshop-wide 车间看板 for the 品检 (quality-inspection) line, covering 7 PLCs `43-45, 29-32`. Predecessor of the narrower 4-tile `Sp_Bd_bi24` 品检现场 board. + +**What it does:** Hardcodes a 7-row `p_Bd_PlcNo_No(iPlcNo,iNo)` map for the 品检 cluster, then per-PLC reads `elemachine`/`plc_currentmachinevalue`/`mft_workorder*` to assemble per-machine 当前状态/当前工单号/已生产数量/调机时间 rows into `p_Bd_workshop5`, emits a JSON board into `sReturn`. + +**Invocation:** No form-master sSqlStr, no `gdsmodule` hook, no install script under `xly-src/script/` for this proc. Status: reachable only via an external dashboard HTTP endpoint that invokes the proc by name. + +Flag: PLC literals `43-45, 29-32` tenant-deployment-specific; the `-- call Sp_Bd_cq_workshop_mt(...)` header comment is copy-pasted from the family root. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_pm.md b/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_pm.md index 737df30..1713ee9 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_pm.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_pm.md @@ -1,7 +1,7 @@ # `Sp_Bd_cq_workshop_pm` (procedure) -> @author:zhucx - @date:20211224 +> @author:zhucx + @date:20211224 @describe: 喷码车间 @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 喷码车间 — workshop-wide 车间看板 for the 喷码 (code-printing) line, covering 6 PLCs `48-53`. Predecessor of the narrower 4-tile `Sp_Bd_bi20` 喷码现场 board. + +**What it does:** Hardcodes a 6-row `p_Bd_PlcNo_No(iPlcNo,iNo)` map for the 喷码 cluster, then per-PLC reads `elemachine`/`plc_currentmachinevalue`/`mft_workorder*` to assemble per-machine 当前状态/当前工单号/已生产数量/调机时间 rows into `p_Bd_workshop5`, emits a JSON board into `sReturn`. + +**Invocation:** No form-master sSqlStr, no `gdsmodule` hook, no install script under `xly-src/script/` for this proc. Status: reachable only via an external dashboard HTTP endpoint that invokes the proc by name. + +Flag: PLC literals `48-53` tenant-deployment-specific; header `-- call Sp_Bd_cq_workshop_mt(...)` is copy-pasted from the family root. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_sy.md b/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_sy.md index cbcf3d4..1ddb230 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_sy.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_sy.md @@ -1,7 +1,7 @@ # `Sp_Bd_cq_workshop_sy` (procedure) -> @author:zhucx - @date:20211224 +> @author:zhucx + @date:20211224 @describe: 丝印车间 @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 丝印车间 — workshop-wide 车间看板 for the 丝印 (silk-screen) line, covering only 2 PLCs `46, 47`. Smallest of the cq_workshop_* family. + +**What it does:** Hardcodes a 2-row `p_Bd_PlcNo_No(iPlcNo,iNo)` map for the 丝印 PLC pair, then per-PLC reads `elemachine`/`plc_currentmachinevalue`/`mft_workorder*` to assemble per-machine 当前状态/当前工单号/已生产数量/调机时间 rows into `p_Bd_workshop5`, emits a JSON board into `sReturn`. + +**Invocation:** No form-master sSqlStr, no `gdsmodule` hook, no install script under `xly-src/script/` for this proc. Status: reachable only via an external dashboard HTTP endpoint that invokes the proc by name. The newer 4-tile 现场 family (`Sp_Bd_bi20-24`) does not include a 丝印 variant — this proc remains the only 丝印 board. + +Flag: PLC literals `46, 47` tenant-deployment-specific; header `-- call Sp_Bd_cq_workshop_mt(...)` is copy-pasted from the family root. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_ys.md b/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_ys.md index e3309b7..0f7a460 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_ys.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_ys.md @@ -1,7 +1,7 @@ # `Sp_Bd_cq_workshop_ys` (procedure) -> @author:zhucx - @date:20211224 +> @author:zhucx + @date:20211224 @describe: 印刷车间 @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 印刷车间 — workshop-wide 车间看板 for the 印刷 (printing) line, covering 7 PLCs `1-7` (skipping 5 in the iNo mapping — `(4,4)` then `(3,6)` — likely a typo from when the original 8-machine layout was reduced). Predecessor of the narrower 4-tile `Sp_Bd_bi22` 印刷现场 board. + +**What it does:** Hardcodes a 7-row `p_Bd_PlcNo_No(iPlcNo,iNo)` map for the 印刷 cluster, then per-PLC reads `elemachine`/`plc_currentmachinevalue`/`mft_workorder*` to assemble per-machine 当前状态/当前工单号/已生产数量/调机时间 rows into `p_Bd_workshop5`, emits a JSON board into `sReturn`. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_Bd_cq_workshop_ys.sql`. No form-master sSqlStr, no `gdsmodule` hook, no Java caller. Status: reachable only via an external dashboard HTTP endpoint that invokes the proc by name. + +Flag: PLC literals `1-7` tenant-deployment-specific; iNo mapping skips position 5 (likely a stale typo). diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_ys_nomes.md b/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_ys_nomes.md index aacef83..f5d0622 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_ys_nomes.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_cq_workshop_ys_nomes.md @@ -1,7 +1,7 @@ # `Sp_Bd_cq_workshop_ys_nomes` (procedure) -> @author:zhucx - @date:20211224 +> @author:zhucx + @date:20211224 @describe: 印刷车间 @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 印刷车间 — non-MES fork of `Sp_Bd_cq_workshop_ys`, same 印刷 (printing) 车间看板 but without MES-integrated work-order joins. Different PLC list `23, 12, 1, 2, 13` (5 PLCs, iNo gap at 5-6 — only positions 1,2,3,4,7 populated). + +**What it does:** Same shape as `Sp_Bd_cq_workshop_ys`: hardcodes a PLC list, reads `elemachine`/`plc_currentmachinevalue` per PLC, assembles per-machine 当前状态/工单/产量 tiles into `p_Bd_workshop5`, emits a JSON board into `sReturn`. The MES-specific 工单 lookups are bypassed. + +**Invocation:** No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no install script under `xly-src/script/`, no Java caller. Status: appears orphan — likely a non-MES fallback that was forked but never wired. Candidate for maintainer audit. The MES-integrated `Sp_Bd_cq_workshop_ys` is the live one. + +Flag: PLC list differs entirely from MES sibling (`23,12,1,2,13` vs `1-7`) — possibly targets a different deployment's hardware. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_hy_workshop_oy.md b/en/docs/auto-catalog/procedures/Sp_Bd_hy_workshop_oy.md index abc3ec0..c352085 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_hy_workshop_oy.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_hy_workshop_oy.md @@ -1,7 +1,7 @@ # `Sp_Bd_hy_workshop_oy` (procedure) -> @author:zhucx - @date:20220111 +> @author:zhucx + @date:20220111 @describe: 凹印车间 @@ -29,4 +29,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 凹印车间 — gravure-printing workshop kanban (author:zhucx, 2022-01-11). Tenant variant of the workshop-wide kanban family (`Sp_Bd_cq_workshop_*` / `Sp_Bd_Cqzy_workshop*` covered in earlier sessions) targeted at the 凹印 (gravure) line via PLC numbers 1–6. + +**What it does:** Seeds `p_Bd_PlcNo_No` with the six gravure-machine `(iPlcNo,iNo)` pairs `(1,2)…(6,7)`, then cursors through each PLC. For each one, it pulls the current machine's status, current work-order, real-time `dProcessQty`/速度/班组 from `viw_plc_machine` + `plc_machinedata`, computes per-machine 当班/当月/异常 metrics, and stuffs the result into `p_Bd_workshop5(sName,sValue)` keyed `M_`. Final SELECT emits the full table as a JSON envelope for the front-end template. + +**Invocation:** No install script under `xly-src/script/标版/30100101/`, no form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Status: appears orphaned. No caller found in any channel — candidate for maintainer audit. Likely reached only by a tenant-baked external dashboard endpoint that invokes the proc by name (the `hy_` prefix suggests a customer-specific 凹印 fork — re-mapping needed if cloned). + +Hardcodes 6 gravure-PLC numbers — re-mapping needed if PLC numbering differs at another deployment. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_workefficiency.md b/en/docs/auto-catalog/procedures/Sp_Bd_workefficiency.md index 7b9f1eb..21b970a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_workefficiency.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_workefficiency.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 / 车间效率综合看板 — environment widget for the workshop-efficiency dashboard. Reports the current date-time plus the workshop's 1区 zone temperature and humidity. + +**What it does:** Builds temp `p_Bd_workefficiency(sName,sValue)`. Inserts a `date` row with `date_format(SYSDATE(),'%Y-%m-%d %H:%i')`, then inserts `temperature` and `humidity` rows pulled from `viw_plc_machine` where `iSemens=2` and `sPlcsStatusName IN ('1区温度','1区湿度')`. Returns the temp table. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_Bd_workefficiency.sql`. No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller — reachable only via an external dashboard HTTP endpoint that invokes the proc by name. Sibling/root proc `Sp_Bd_workshop1` populates the rest of the dashboard's tiles. diff --git a/en/docs/auto-catalog/procedures/Sp_Bd_workshop1.md b/en/docs/auto-catalog/procedures/Sp_Bd_workshop1.md index 9723969..35e5447 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bd_workshop1.md +++ b/en/docs/auto-catalog/procedures/Sp_Bd_workshop1.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 / 车间效率综合看板 — per-station tile builder for the 19-position workshop-efficiency dashboard. For each preconfigured PLC machine (`iPlcNo` → display slot `iNo`), reports current work-order, team, planned vs. actual quantity, speed, status colour, and shift info. + +**What it does:** Seeds a hardcoded `p_Bd_PlcNo_No(iPlcNo,iNo)` map of 19 rows mapping PLC numbers (1-7, 15-25) to dashboard positions 1-21 with gaps at 5 and 20. Cursor-loops the map, and for each PLC reads `viw_plc_machine` for current team (`sPlcsStatusName='当前班组'`), current bill, machine id, `sOffWork`/`sShiftsWork` cutovers, then resolves `mftworkordermaster` / `mftworkorderprocess` / `mftproductionplanmaster` for planned & adjustable quantities, and aggregates `plc_machinedata` for actual produce qty/hour. Computes per-station speed, status colour (`#49aa02` green default, switched red when behind target), and writes `p_Bd_workshop`/`p_Bd_Speed` rows that the caller assembles into the dashboard payload. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_Bd_workshop1.sql`. No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller — reachable only via an external dashboard HTTP endpoint. Paired with `Sp_Bd_workefficiency` (date/temperature/humidity widget). + +Flag: the PLC-to-slot map is hardcoded inside the proc body — adding or rearranging workshop tiles requires editing this routine. diff --git a/en/docs/auto-catalog/procedures/Sp_BillOfApply.md b/en/docs/auto-catalog/procedures/Sp_BillOfApply.md index 05e00ff..8bb5d13 100644 --- a/en/docs/auto-catalog/procedures/Sp_BillOfApply.md +++ b/en/docs/auto-catalog/procedures/Sp_BillOfApply.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产执行 / 现场物料管理 / 根据工单领料申请 — list-page datasource that builds the "by-work-order materials-application" picker. Used on the form `101251240115016056038424570` (sParentId → 现场物料管理) to let line-side staff pick the work order whose unfulfilled material demand they want to apply for. + +**What it does:** Standard paged-list shape (`sBrId, sSuId, sLoginId, bFilter, pageNum, pageSize, sUnTaskFormId, totalCount OUT, countCloumn, countMapJson OUT, sFilterOrderBy, sGroupby_select_sql, sGroupby_group_sql`). Constructs a dynamic SQL into `P_Tmp_List` by joining `eleproduct` (product), `EleMaterials` / `elematerialsstock` (material + on-hand), `elecustomer`, `siswarehouse`, and `MftWorkOrderControl` (work-order control), then resolves auxiliary-unit conversions (`p_dAuxiliaryQtySum`, `p_dProductionApplyAuxiliaryQty`) from `SysSystemSettings`, and applies the filter/orderBy/groupBy before pagination. + +**Invocation:** Wired to form `101251240115016056038424570` under module 现场物料管理 (`16351574590001409130024039409000`) → 生产执行 (`19211681019715708716954960`). Resolved via the standard list-paging dispatch (`gdsconfigformmaster.sSqlStr` embeds the `CALL Sp_BillOfApply(...)` invocation). diff --git a/en/docs/auto-catalog/procedures/Sp_BillOfApplyLine.md b/en/docs/auto-catalog/procedures/Sp_BillOfApplyLine.md index 3075d1a..7915cfe 100644 --- a/en/docs/auto-catalog/procedures/Sp_BillOfApplyLine.md +++ b/en/docs/auto-catalog/procedures/Sp_BillOfApplyLine.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产执行 / 现场物料管理 — line-side variant of `Sp_BillOfApply` (body header comment `-- 线边仓物料`, "line-side warehouse materials"). Builds the same "by-work-order materials-application" pickup list, but scoped to line-side / 线边仓 inventory instead of the main warehouse. + +**What it does:** Same paged-list shape as `Sp_BillOfApply`: joins `eleproduct`, `EleMaterials` / `elematerialsstock`, `elecustomer`, `siswarehouse`, `MftWorkOrderControl` and resolves auxiliary-unit sums from `SysSystemSettings`, materialising the page into `P_Tmp_List`. The differentiator is the filter clause that restricts `siswarehouse` rows to line-side ones. + +**Invocation:** Status: appears orphaned. No caller in any channel (form-master, gdsmodule, other DB routines, xly-src grep across all extensions). Likely an unwired variant intended for a separate 线边仓 form that was never published, or superseded by `Sp_BillOfApply` plus a runtime warehouse filter. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_BillOfNoPicking.md b/en/docs/auto-catalog/procedures/Sp_BillOfNoPicking.md index f61bd0f..8bc41bd 100644 --- a/en/docs/auto-catalog/procedures/Sp_BillOfNoPicking.md +++ b/en/docs/auto-catalog/procedures/Sp_BillOfNoPicking.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 未领料清单 — paginated list-query builder for the "unpicked materials" report that hangs off the 生产领料 / 扫码领料 / 材料检验 / 材料转换 form group, returning the bills whose materials still need picking (driven by the `CkxReelPaper` system setting in `SysSystemSettings`). + +**What it does:** Builds a `P_Tmp_List` temp table, composes a dynamic `p_sSql` (with optional `bFilter`, `sFilterOrderBy`, `sGroupby_*`, and a `p_sLimit` pageNum/pageSize slice), then `CALL Sp_Do_UpdateByPageSizeBefore` to project the final rows. Returns `totalCount` and `countMapJson` for grouped sums. Reel-paper materials switch to per-sheet picking via the `p_bReelPaper` flag. Column whitelist is mirrored by `Fun_getInitColumnByProName` for the same key `Sp_BillOfNoPicking`. + +**Invocation:** Bound as `gdsconfigformmaster.sSqlStr` on 5 forms — `1/2 生产工单->生产领料` (`192116810113315311392412610`), `扫码领料` (`101251240115015959855666640`), `扫码领料(唯一码)` (`101251240115016051703207440`), `材料加工->材料检验` (`101251240115016088819365630`), `生产工单->材料转换` (`101251240115016189233954050`). Page-load and filter actions invoke it through the standard form-data-source pipeline. diff --git a/en/docs/auto-catalog/procedures/Sp_BillOfNoPicking_Cljg.md b/en/docs/auto-catalog/procedures/Sp_BillOfNoPicking_Cljg.md index 19adce5..9a983bb 100644 --- a/en/docs/auto-catalog/procedures/Sp_BillOfNoPicking_Cljg.md +++ b/en/docs/auto-catalog/procedures/Sp_BillOfNoPicking_Cljg.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产执行 / 现场物料管理 / 未领料清单 — customer-variant (suffix `_Cljg`) of the base `Sp_BillOfNoPicking` "unpicked-materials list" datasource. The base proc is wired on five 未领料清单 forms (sIds `192116810113315311392412610`, `101251240115015959855666640`, etc.); this `_Cljg` variant is a side-build apparently for one site's costing/计件 view. + +**What it does:** Same paged-list shape as the base, with the in-body header comment `因增加了[物料需求],在[系统参数设定]中加了,领料数据来源管制,故将[未领料清单]改为根据设定来取数据的形式 add by DengWH 2013-01-23`. Reads `SysSystemSettings.领料数据来源管制` to choose its source set, joins `eleproduct`, `EleMaterials` / `elematerialsstock`, `elecustomer`, `eleprocess`, `MftWorkOrderControl`, and the `viw_purpurchaseorder` view, then materialises rows where applied quantity exceeds picked quantity into `P_Tmp_List`. + +**Invocation:** Status: appears orphaned. The base `Sp_BillOfNoPicking` is wired to five forms; this `_Cljg` variant has no form-master, gdsmodule, DB-routine, or xly-src caller — only the install-script `script/标版/30100101/Sp_BillOfNoPicking_Cljg.sql` references it. Candidate for maintainer audit — likely a customer-specific fork that lost its form binding during migration. diff --git a/en/docs/auto-catalog/procedures/Sp_BillOfNoPicking_copy1.md b/en/docs/auto-catalog/procedures/Sp_BillOfNoPicking_copy1.md index 4bf7ba2..2cc0a50 100644 --- a/en/docs/auto-catalog/procedures/Sp_BillOfNoPicking_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_BillOfNoPicking_copy1.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_BillOfNoPicking` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_BillOfNoPicking` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Bill_Force_Complete.md b/en/docs/auto-catalog/procedures/Sp_Bill_Force_Complete.md index 35fe6bc..14aee4f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bill_Force_Complete.md +++ b/en/docs/auto-catalog/procedures/Sp_Bill_Force_Complete.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Cross-module / 单据强制完成 — generic "force-complete a document" action that closes out a still-open bill (purchase order, work order, production plan, etc.) without going through normal-flow completion. Drives the 强制完成 button on virtually every transactional list view. + +**What it does:** Accepts a CSV of bill IDs, a per-form `sTableParam` describing which tables to mark, plus reason/audit fields (`sReason`, `sClientType`, `sComputeName`, `sIpAddress`, `sLoginId`, `sFormId`). Inserts an audit row into `syscomplete` and `syslog`, then iterates the parsed table list to set completion flags on the bill's slave/process rows: `mftworkorderslave`, `mftworkorderprocess`, `mftworkordermaterials`, `mftproductionplanslave`, `purpurchasearriveslave`, `purpurchaseorderslave`, `salsalesorderslave`, `salsalesorderprocess`, `qlycomematerialstestmaster`, `mftqualityaccidentMaster`, etc. `sType` ("force" or other) tweaks behaviour. + +**Invocation:** Called by `BillServiceImpl.billForceCompleteSingle()` (xly's `xlyBusinessService`), exposed via `BillService` interface — the front-end 强制完成 toolbar action sends the form's `queryParam` map and the proc closes every configured slave row. diff --git a/en/docs/auto-catalog/procedures/Sp_Bill_Force_Complete_copy1.md b/en/docs/auto-catalog/procedures/Sp_Bill_Force_Complete_copy1.md index 5230e26..74b1ffc 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bill_Force_Complete_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_Bill_Force_Complete_copy1.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_Bill_Force_Complete` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_Bill_Force_Complete` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Bill_Used.md b/en/docs/auto-catalog/procedures/Sp_Bill_Used.md index 7dc8a33..e75b902 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bill_Used.md +++ b/en/docs/auto-catalog/procedures/Sp_Bill_Used.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Cross-module / 单据是否被下级使用 — the universal "is this document referenced downstream?" guard, called from every `Sp_Calc_s*` audit/un-audit proc before allowing a check/uncheck (or delete) to proceed. Comment header: `单据是否被下级使用存储过程`. + +**What it does:** Dispatches on `sTableName` (e.g. `SalDeliverGoodsMaster`, `PurPurchaseOrderMaster`, `MftWorkOrderMaster`, ...) and runs the matching downstream-existence query — counts non-invalidated rows in the consuming slave table whose `sSrcSlaveId` ties back to this document, and on a hit returns `sCode=0` plus a human message in `sReturn` and the offending IDs in `sReturnIds`. `sType` ("Audit", "SaleTrial", "Delete", ...) varies the strictness. The body has dozens of `IF sTableName = '...'` branches covering AccMaterialsInitMaster, AccProductDoingMaster, CahPayMentMaster, CahReceiptMaster, EleCustomer, EleEmployee, EleMaterialsStock, MftProductionPlanMaster, mftworkordermaster, salsaleschancemaster, and many others. + +**Invocation:** Called by ~60 `Sp_Calc_s*` audit/un-audit procedures (e.g. `Sp_Calc_sDgd`, `Sp_Calc_sSod`, `Sp_Calc_sWod`, `Sp_Calc_sPpa`, …) when a user clicks 审核/反审核/作废 on the corresponding document; also called by `Sp_AfterPost_sQtt`, `sp_btn_action`, `Sp_System_BatchPriceMoney`, `Sp_UpdateAdd_Check`, and the templated `sProcName.sql` macros in `xlyEntry` / `xlyFlow`. Multiple customer overrides at `script/客户/{千彩,统兴}/Sp_Bill_Used.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Bill_Used_Base.md b/en/docs/auto-catalog/procedures/Sp_Bill_Used_Base.md index b29312f..806d7fc 100644 --- a/en/docs/auto-catalog/procedures/Sp_Bill_Used_Base.md +++ b/en/docs/auto-catalog/procedures/Sp_Bill_Used_Base.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Cross-module / 修改单独校验 — customer-override hook for the "is this base-data row safe to modify?" guard. Comment header: `修改单独校验`. The stock-build body is a near-empty stub (declarations only, no checks); the proc exists so individual customer builds (e.g. `script/客户/千彩/Sp_Bill_Used_Base.sql`) can replace it with site-specific lock rules. + +**What it does:** Stub body: declares `p_bUsed = 0`, sets `sCode = 1`, returns. The customer-override version at `script/客户/千彩/` reads `sftlogininfo.bBaseCnUpdat` for `sLoginId` (per-user override flag) and, if not granted, runs per-table `IF sTableName = LOWER('EleCustomer') THEN ...` blocks counting downstream references in `salsalesorderslave`, etc., setting `p_bUsed` and populating `sReturnIds` so the caller can refuse the edit. + +**Invocation:** Status: appears orphaned in the stock build — no caller in any channel (form-master, gdsmodule hooks, other DB routines, xly-src `.java`/`.xml`). Designed to be a customer-extensible companion to `Sp_Bill_Used`, but never wired in the standard codebase. Customer 千彩 supplies a full override but does not patch any caller to invoke it — verify before assuming the guard runs. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnCalculation_Machine_time_byMachineType.md b/en/docs/auto-catalog/procedures/Sp_BtnCalculation_Machine_time_byMachineType.md index 1018d0d..8e7af49 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnCalculation_Machine_time_byMachineType.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnCalculation_Machine_time_byMachineType.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 排程 / 统筹排程 — machine-loop time-calculator for the unified-planning button (统筹排程 / 计算时间). Iterates printing machines (`p_sMachineType=1`) or all non-printing machines (`p_sMachineType<>1`) and recomputes per-`mftproductionplanslave` start/end times based on the last 报工 (`mftproductionreportmaster.tCreateDate`) plus shift definition on `elemachine.sWorkType/sShiftsWork/sOffWork`. + +**What it does:** Cursors `elemachine` rows filtered by `p_sMachineType`. Per machine, reads the latest checked production-report `tCreateDate` and seeds it through `FUN_GET_DATE_BC_STARTDATE_NEWTYPE` to derive `p_dbtimestart`. When `p_sMachineType=2`, picks the earliest in-progress (`sState IN ('1','2')`) `mftproductionplanslave` ordered by `tReportCompletDate/tHeoryCompletDate`; otherwise picks earliest by `tStartDate`. Then back-rolls scheduled `tHeoryCompletDate` for the chained next-process planslaves so downstream processes shift in lockstep. Locked rows (`bCalcTimeLock=1`) are respected by tracking `p_tMaxEndDate`. + +**Invocation:** Called by sibling procedure `Sp_unifiedPlanning_BtnCalculation_Machine` — twice, with `NULL` (印刷机) and `2` (其它机台). That sibling is in turn dispatched dynamically via `GenericProcedureCallServiceImpl.doSetTimeCalcMachineHour()` (special-cased on `sProName='sp_unifiedplanning_btncalculation'`) when the 统筹排程 → 计算时间 button fires from the schedule UI. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnCalculation_Machine_time_byMachineTypeEnd.md b/en/docs/auto-catalog/procedures/Sp_BtnCalculation_Machine_time_byMachineTypeEnd.md index 5704c13..549cf17 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnCalculation_Machine_time_byMachineTypeEnd.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnCalculation_Machine_time_byMachineTypeEnd.md @@ -23,4 +23,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 排程 / 统筹排程 — terminal-pass variant of `Sp_BtnCalculation_Machine_time_byMachineType` for the unified-planning 计算时间 button. Walks `elemachine` rows whose `iCalcOrder>0` and `sMachineType<>1` (non-printing presses ordered by their explicit calc sequence) and re-anchors `mftproductionplanslave` times for the unconsumed (`bProductionReportComplete=0`, `dProcessQty-dProductionReportQty>0`) plan-slaves on each machine, finally re-sequencing locked (`bEmploy=1` / `sState='2'`) rows so released (`bEmploy=0`) rows pick up after them. + +**What it does:** Per-machine cursor → for each chained next-process planslave, sets `tHeoryCompletDate=p_tDate` to propagate the new completion date down the routing graph. Then, when `p_tEmployStartDate` is set, rebuilds a `MftProductionPlanSlave_Tmp_Employ` temp table whose `iOrder` starts from `MAX(iOrder)` of locked rows and increments per `(tStartDate, iOrderNew ASC)`, and UPDATEs `mftproductionplanslave.iOrder` from it — effectively pushing the unlocked queue after the locked queue. Uses temp tables `MftProductionPlanSlave_next` (next-process lookup) and the large commented-out `MftProductionPlanSlave_MachineTypeEnd` skeleton (dead). + +**Invocation:** Called only by `Sp_unifiedPlanning_BtnCalculation_Machine` as the second-stage pass after `Sp_BtnCalculation_Machine_time_byMachineType` finishes printing-machine seeding. Reached from the 统筹排程 → 计算时间 button via `GenericProcedureCallServiceImpl.doSetTimeCalcMachineHour()`. + +Flag: large blocks of the body are commented-out variants of `MftProductionPlanSlave_MachineTypeEnd`/cursor logic — confirm whether the live path matches the intent before relying on the procedure name. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEventCalculatewages.md b/en/docs/auto-catalog/procedures/Sp_BtnEventCalculatewages.md index eb33006..1fbb068 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEventCalculatewages.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEventCalculatewages.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 工人计件工资 — toolbar handler that 确认 a 生产报工 slave line (`mftproductionreportslave`) and computes its piece-wage payout. Verifies the master is already audited (`bCheck=1`) and that the user supervises the slave's machine department, then invokes the formula engine `Sp_System_ReplaceField` against the line's `sWageId` formula to produce `dAllMoney` and per-employee `dWageMoney`. + +**What it does:** Parses `$.params[*].value[*]` with `sId, dProcessQty, dHour, dAdjustableHour, sParams`. Gates: master `bCheck=1` else returns `sUpDataNotReview`; user's `eleemployee.sDepartId` must match the slave's `elemachine.sDeptId` else returns `sCantConfirmOtherDepart`. Updates the slave with the supplied/fallback quantities, marks `bAffirm=1, sAffirm, tAffirmDate`, computes `dEmpHour=(dHour+dAdjustableHour)*Σ(mftproductionreportemployee.dEmpNum)`, then `dTimeHourMoney/dTimeMoney` from `sisworkcenter.dAverageHourSalary`. Branches on `sPayrollCalculate` ('0' = slave-level formula → distribute by `dProportion`; '1'/'2' = per-employee formula via cursor, then aggregate to slave). + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 工人计件工资 grid's 确认 toolbar button names this proc as its action. Internally calls `Sp_System_ReplaceField` (formula resolver). Variant: `Sp_BtnEventCalculatewages_financial` (财务确认 — same logic, different department-mismatch message `sSupervisorDepartNotMatch`). diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEventCalculatewages_bak.md b/en/docs/auto-catalog/procedures/Sp_BtnEventCalculatewages_bak.md index 495e7f9..e1b7b0e 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEventCalculatewages_bak.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEventCalculatewages_bak.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_BtnEventCalculatewages` (`_bak` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_BtnEventCalculatewages` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEventCalculatewages_financial.md b/en/docs/auto-catalog/procedures/Sp_BtnEventCalculatewages_financial.md index f882559..bdcc32e 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEventCalculatewages_financial.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEventCalculatewages_financial.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 工人计件工资 / 财务确认 — finance-side variant of `Sp_BtnEventCalculatewages`. Same flow (verify master `bCheck=1`, gate by user's 部门 vs machine 部门, compute `dAllMoney`/`dWageMoney` via `Sp_System_ReplaceField`) but the department-mismatch error swaps to the localised `sSupervisorDepartNotMatch` ("本设备对应的部门主管,与当前用户所在部门不匹配,禁止确认非本部门数据") to make the message specific to the finance step. + +**What it does:** Identical to `Sp_BtnEventCalculatewages` — see that procedure for the per-line update of `mftproductionreportslave` (`bAffirm, sAffirm, tAffirmDate, dEmpHour, dTimeMoney`) and the `sPayrollCalculate` branch over `mftproductionreportemployee` rows. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 工资查询/财务确认 toolbar button names this proc as its action. Internally calls `Sp_System_ReplaceField`. Twin: `Sp_BtnEventCalculatewages` (production-side confirm). diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEventCopyGroupJurisdiction.md b/en/docs/auto-catalog/procedures/Sp_BtnEventCopyGroupJurisdiction.md index e1048ab..0b9b43a 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEventCopyGroupJurisdiction.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEventCopyGroupJurisdiction.md @@ -24,4 +24,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 系统权限 / 权限组 — toolbar handler that copies all `sysjurisdiction` permission rows from a source 权限组 (`sGroupId`) to a target group (`sToGroupId`) within the same brand/subsidiary. Used by admins to clone a freshly-built role definition onto a sibling group. + +**What it does:** Parses the last entry from `$.params[*].value[*]` (the loop overwrites variables — only the final pair sticks) to get `sGroupId` and `sToGroupId`. Returns `sCode=-1, chooseData` (via `Fun_Sis_GetConstNew`) if `sProInParam` is not valid JSON. Then `DELETE`s every `sysjurisdiction` row keyed on `(sToGroupId, sBrId, sSuId)`, and `INSERT`s a fresh copy from the source group with `NewId()` and current operator/timestamp. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 权限组 admin grid's 权限复制 toolbar button names this proc as its action. Sibling: `Sp_BtnEventCopyUserJurisdiction` (user-level copy across multiple permission tables). + +Flag: the parsing WHILE loop overwrites `p_sGroupId`/`p_sToGroupId` on every iteration and `p_iTmp` is never incremented within the inner reads, so only the **last** pair is acted on. Multi-row selections silently lose all but one. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEventCopyUserJurisdiction.md b/en/docs/auto-catalog/procedures/Sp_BtnEventCopyUserJurisdiction.md index 33ecf63..53141c0 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEventCopyUserJurisdiction.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEventCopyUserJurisdiction.md @@ -24,4 +24,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 系统权限 / 人员权限 — toolbar handler that clones five user-scoped permission tables from one login (`sUserId`) to another (`sToUserId`) within the same brand/subsidiary. Used by admins to mirror a senior user's permission set onto a new hire without rebuilding it field-by-field. + +**What it does:** Parses the last entry from `$.params[*].value[*]` to get `sUserId` and `sToUserId` (returns `chooseData` via `Fun_Sis_GetConstNew` if input isn't valid JSON). For each of five tables — `sftlogininfojurisdictiongroup` (权限组), `sftlogininfocustomergroup` (客户查看), `sftlogininfosupplygroup` (供应商查看), `sftlogininfopersongroup` (人员查看), `sftlogininfodrivergroup` (司机查看) — it `DELETE`s all rows where `sParentId=p_sToUserId` then `INSERT`s a fresh copy from the source rows keyed on `sParentId=p_sUserId`, generating new `sId` via `NewId()`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 用户管理 grid's 权限复制 toolbar button names this proc as its action. Sibling: `Sp_BtnEventCopyGroupJurisdiction` (group-level copy of `sysjurisdiction`). + +Flag: same loop-overwrite bug as the group variant — only the last `(sUserId, sToUserId)` pair is acted on; multi-row selections silently drop all but one. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEventDepartSure_New.md b/en/docs/auto-catalog/procedures/Sp_BtnEventDepartSure_New.md index 8c4797c..2ffb4d3 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEventDepartSure_New.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEventDepartSure_New.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 / 部门核算 — toolbar handler that toggles 部门核算确认 (`accdepart.bConfirm`) for the selected costing-period rows. Period gate: rejects the operation if the chosen `sysaccountperiod.bCost=1` (period already cost-closed), preventing changes to a sealed period. + +**What it does:** Parses `$.params[*].value[*]` with `sId, sCostPeriod` from `sProInParam`. For each row, reads `sysaccountperiod.bCost` for the period — if `1`, returns `sCode=-1, sBtnDepartFinished` ("该会计期间已核算完成,不能进行此操作"). Otherwise flips `accdepart.bConfirm` and stamps `sConfirmMonth=p_sPeriodId` for matching `(sId, sBrId, sSuId)`. Final `sReturn='Operation successful'`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 部门核算 grid's 确认 toolbar button names this proc as its action. Siblings in the cost-confirm family: `Sp_BtnEventworkcenterSure_New`, `Sp_BtnEventMaterialsSure_New`, `Sp_BtnEventProductInStoreSure_New`, `Sp_BtnEventProductionmaterialSure_New`, `Sp_BtnEventProductSure_New`. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEventMaterialsPost_New.md b/en/docs/auto-catalog/procedures/Sp_BtnEventMaterialsPost_New.md index a193f80..6106c31 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEventMaterialsPost_New.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEventMaterialsPost_New.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料存货核算 / 材料盘点 — toolbar handler that re-posts an inventory-gain (盘盈) price/value onto an `accmaterialsstore` row whose source form is the 材料盘点单据 (`sFormId=192116810113315228128521360`). Used to back-fill an inventory-take adjustment with a unit price entered after the original count, recomputing total money. + +**What it does:** Resolves the latest frozen `sysaccountperiod` (`bFrozen=1`, ORDER BY `tStartDate` DESC LIMIT 1) into `p_sPeriodId` (read but not used in the UPDATE — only the form gate matters). Parses `$.params[*].value[*]` with `sId, dMaterialsPrice, sFormId`. For each row where `sFormId='192116810113315228128521360'` AND `dMaterialsPrice>0`, sets `accmaterialsstore.dMaterialsPrice=p_dMaterialsPrice, dMaterialsMoney=ROUND(p_dMaterialsPrice*dMaterialsQty,2)` for matching `(sId, sBrId, sSuId)`. Other form sources are silently skipped. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 材料盘点 grid's 盘盈回写 toolbar button (or similar 价格补录 action) names this proc as its action. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEventMaterialsSure_New.md b/en/docs/auto-catalog/procedures/Sp_BtnEventMaterialsSure_New.md index f4b9e2b..c172bb3 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEventMaterialsSure_New.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEventMaterialsSure_New.md @@ -22,4 +22,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料存货核算 — toolbar handler that batch-toggles 确认 on `accmaterialsstore` rows for a given costing period. Period gate: rejects the operation if `sysaccountperiod.bCalMaterials=1` (material cost already closed for that period). + +**What it does:** Reads `$.params[0].value[0].sCostPeriod` and the array of `sId`s, then builds a temporary table `Sp_ids_Table` via PREPARE/EXECUTE using `JSON_EXTRACT(p_values, '$[*].sId')` reshaped into `('a'),('b'),...`. Gates: if `sysaccountperiod.bCalMaterials=1` for the chosen period, returns `sCode=-1, sBtnDepartFinished`. Otherwise joins `accmaterialsstore` against the temp table and flips `bConfirm = NOT bConfirm`, then sets `sConfirmMonth = CASE WHEN bConfirm=0 THEN '' ELSE p_sPeriodId END`. Drops the temp table. (The original per-row WHILE loop is left commented out at the end.) + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 材料存货核算 grid's 确认 toolbar button names this proc as its action. Siblings in the cost-confirm family: `Sp_BtnEventDepartSure_New`, `Sp_BtnEventworkcenterSure_New`, `Sp_BtnEventProductInStoreSure_New`, `Sp_BtnEventProductionmaterialSure_New`, `Sp_BtnEventProductSure_New`. + +Flag: the bulk `sConfirmMonth` update is computed from the **already-flipped** `bConfirm`, which is correct, but the inner CASE references the table's current `bConfirm` after the first UPDATE — semantically the intended "blank when unconfirming" branch fires correctly only because the first UPDATE has already toggled. Verify expected behaviour after maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEventProductInStoreSure_New.md b/en/docs/auto-catalog/procedures/Sp_BtnEventProductInStoreSure_New.md index fe4312e..7f53455 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEventProductInStoreSure_New.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEventProductInStoreSure_New.md @@ -22,4 +22,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 产品存货核算 / 成品入库 — toolbar handler that batch-toggles 确认 on `accproductstore` rows for a given costing period, and clears the period's product-side `accordercostanalysis` rows (`iBillType=2`) so they can be rebuilt. + +**What it does:** Reads `$.params[0].value[0].sCostPeriod` and the array of `sId`s from `sProInParam`, builds `Sp_ids_Table` via PREPARE/EXECUTE. Joins `accproductstore` against the temp table and flips `bConfirm = NOT bConfirm`, then sets `sConfirmMonth = CASE WHEN bConfirm=0 THEN '' ELSE p_sPeriodId END` for matching `(sCostPeriod, sBrId, sSuId)`. Drops the temp table. Then `DELETE`s every `accordercostanalysis` row in the same period with `iBillType=2`. Reads `tStartDate, tEndDate` from `sysaccountperiod` (computed but only the rebuild INSERT is commented out). Final `sReturn='Operation successful'`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 产品存货核算 grid's 确认 toolbar button names this proc as its action. Siblings in the cost-confirm family: `Sp_BtnEventDepartSure_New`, `Sp_BtnEventworkcenterSure_New`, `Sp_BtnEventMaterialsSure_New`, `Sp_BtnEventProductionmaterialSure_New`, `Sp_BtnEventProductSure_New`. + +Flag: the planned re-INSERT into `accordercostanalysis` (joining `Viw_MftWorkOrder` to confirmed `accproductstore` rows for the period) is entirely commented out — confirmation deletes the analysis rows without rebuilding them. Maintainer audit recommended. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEventProductReportCancel.md b/en/docs/auto-catalog/procedures/Sp_BtnEventProductReportCancel.md index ceecb4f..4d3e40f 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEventProductReportCancel.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEventProductReportCancel.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产报工 / 班次日确认 — toolbar handler that revokes the per-day confirmation on a `mftproductionreportslave` row (`sConfirmDayInfo='0'`). Pairs with `Sp_BtnEventProductReportConfirm`, which sets the flag to `'1'`. + +**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam`. For each slave id, sets `mftproductionreportslave.sConfirmDayInfo='0'`. Returns `sCode=-1, paramsErro` on missing input. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 生产报工 grid's 取消日确认 toolbar button names this proc as its action. Inverse: `Sp_BtnEventProductReportConfirm`. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEventProductReportConfirm.md b/en/docs/auto-catalog/procedures/Sp_BtnEventProductReportConfirm.md index 77776b5..137f0b1 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEventProductReportConfirm.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEventProductReportConfirm.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产报工 / 班次日确认 — toolbar handler that marks a `mftproductionreportslave` row as day-confirmed (`sConfirmDayInfo='1'`). Used by shop-floor supervisors to lock today's reported output for the slave line. Inverse: `Sp_BtnEventProductReportCancel`. + +**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam`. For each slave id, sets `mftproductionreportslave.sConfirmDayInfo='1'`. Returns `sCode=-1, paramsErro` on missing input. Final `sReturn='操作成功'` (untranslated, unlike its sibling which returns the English literal). + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 生产报工 grid's 日确认 toolbar button names this proc as its action. Inverse: `Sp_BtnEventProductReportCancel`. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEventProductSure_New.md b/en/docs/auto-catalog/procedures/Sp_BtnEventProductSure_New.md index aa48116..0c96d9f 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEventProductSure_New.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEventProductSure_New.md @@ -22,4 +22,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 / 订单成本汇总 — toolbar handler that batch-toggles 确认 on `accordercostanalysis` rows for a costing period and then rebuilds the period's `accworkcenter` cost-aggregates from confirmed work-orders, production reports, and machine roster. Drives the downstream 工作中心成本 view used by costing reports. + +**What it does:** Reads `$.params[0].value[0].sCostPeriod` plus the `sId` array, builds `Sp_ids_Table`, then flips `accordercostanalysis.bConfirm` for matching rows and updates `sConfirmMonth` based on the new flag value. Nulls out the period's `accworkcenter` aggregate columns (`dPower, iPeople, iMachine, dProcessQty, dMonthHour, ...`), then rebuilds them from joined sources: machine count from `elemachine GROUP BY sCostCenterId`; people, average power, total-hour salary from `sisworkcenter`; period production hours, process qty, area, color/plate quantity from joined `accordercostanalysis × elemachine × sisworkcenter` (and from `viw_mftproductionreport` in the commented variants). Re-issues the same DELETE+INSERT against `accordercostanalysis` per `iBillType` 1/3/4/5/6 (rebuild grain by bill type — work order, in-store, etc.). + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 订单成本汇总 / 成本核算 grid's 确认 toolbar button names this proc as its action. Siblings in the cost-confirm family: `Sp_BtnEventDepartSure_New`, `Sp_BtnEventworkcenterSure_New`, `Sp_BtnEventMaterialsSure_New`, `Sp_BtnEventProductInStoreSure_New`, `Sp_BtnEventProductionmaterialSure_New`. + +Flag: large procedure with multiple alternative blocks commented out — verify which DELETE/INSERT/Update branches are intended live before relying on the output. Several rebuild variants reference `viw_mftproductionreport` only in commented form. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEventProductionmaterialSure_New.md b/en/docs/auto-catalog/procedures/Sp_BtnEventProductionmaterialSure_New.md index 0ddb4f4..69fa879 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEventProductionmaterialSure_New.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEventProductionmaterialSure_New.md @@ -22,4 +22,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 / 生产领料 — toolbar handler that batch-toggles 确认 on `accproductionmaterialsslave` (生产领料明细) rows for a costing period, then rebuilds the indirect-material expense-entry (`accexpenseentrydepartmentmaster` / 公摊费用录入) and its department/work-center splits keyed on the `elematerials.sOtherCostFrameId` cost-frame. + +**What it does:** Reads `$.params[0].value[0].sCostPeriod` and the array of `sId`s; builds `Sp_ids_Table` via PREPARE/EXECUTE. Gates: if `sysaccountperiod.bCost=1` for the period, returns `sCode=-1, sBtnDepartFinished`. Toggles `accproductionmaterialsslave.bConfirm` and stamps `sConfirmMonth` for matching `(sCostPeriod, sBrId, sSuId)`. Then DELETEs prior `accexpenseentrydepartmentmaster/slave` and `accexpenseentryworkcenterslave` rows whose `sMakePerson='系统插入'` for this period and whose 成本架构 sFrameType is one of `auxiliary`, `mainMaterials`, `mainMaterialsBox`. For each remaining distinct `sOtherCostFrameId` (cursor `Cur_ReplaceField`), allocates `SP_Sis_GetMaxNo` and INSERTs a new expense-entry master (`sFormId='101801153119616595200652250'`, `dExpenseeMoney = Σ accproductionmaterialsslave.dMaterialsMoney` joined to `sisdepart`), then inserts `accexpenseentrydepartmentslave` per department and apportions to work-centers via temp tables `accproductionmaterialssumslave_Tmp`, `accmaterialsworkcenter_Tmp`, `accmaterialsdiffworkcenter_Tmp` (rate = `accworkcenter.dProcessQty`; diff truing-up so the work-center splits sum back to the department total). Finally calls `Sp_System_CheckSaveFlowCps` and `Sp_Calc_sCps` to trigger save-flow and recalculation on the new expense-entry master. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 生产领料(成本) grid's 确认 toolbar button names this proc as its action. Siblings in the cost-confirm family: `Sp_BtnEventDepartSure_New`, `Sp_BtnEventworkcenterSure_New`, `Sp_BtnEventMaterialsSure_New`, `Sp_BtnEventProductInStoreSure_New`, `Sp_BtnEventProductSure_New`. + +Flag: the period gate reads `p_sPeriodId` BEFORE it's parsed from `sProInParam` (the `SELECT bCost INTO p_bCost ... WHERE sPeriodId=p_sPeriodId` runs first, with `p_sPeriodId` still empty/NULL), so the gate is effectively skipped on the first call. The parsing block sits after the gate, ordering is wrong. Maintainer audit recommended. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEventWorkPost_New.md b/en/docs/auto-catalog/procedures/Sp_BtnEventWorkPost_New.md index c3a836f..5567842 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEventWorkPost_New.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEventWorkPost_New.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 工单成本分析 — toolbar handler used to override per-line manual adjustments on the work-order cost-analysis grid. Lets a cost accountant pin a corrected `dAdjustHour` and `dAdjustProcessQty` against a `accordercostanalysis` row when the auto-calculated values are wrong, and re-derives the dependent area/colour-process figures from `mftworkordercontrol` machine width/length. + +**What it does:** Parses `$.params[*].value[*]` from `sProInParam` for `sId`, `dAdjustHour`, `dAdjustProcessQty`. For each row, updates `accordercostanalysis` with the supplied adjustments, then re-derives `dAreaQty = dAdjustProcessQty * dMachineWidth * dMachineLength / 1000000` and `iProcessColorQty = dAdjustProcessQty * (dCalcQty1 + dCalcQty2) * 0.001` via a join through `mftproductionplanslave` to `mftworkordercontrol`. Scoped to `sBrandsId`/`sSubsidiaryId`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — front-end button on the 工单成本分析 grid passes this procedure name in the action payload. Newer revision of the legacy `Sp_BtnEventWorkPost` handler. Source file present at `script/标版/30100101/cost/Sp_BtnEventWorkPost_New.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEvent_AccProductFrozen.md b/en/docs/auto-catalog/procedures/Sp_BtnEvent_AccProductFrozen.md index 38d1ee0..543d46e 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEvent_AccProductFrozen.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEvent_AccProductFrozen.md @@ -25,4 +25,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务 / 成品初始化 — button-click handler that freezes selected `accproductinitslave` rows ("送货未开票冻结" per the COMMENT, though body acts on product-init slave rows). Once frozen, downstream cost / closing logic skips them. + +**What it does:** Validates `sProInParam` length, parses the `$.params[*].value[*].sSlaveId` JSON envelope, and for each id `UPDATE accproductinitslave SET bFrozen=1, sFrozenPerson=sMakePerson, tFrozenDate=NOW()`. Errors via `Sp_Sis_GetConst('paramsErro', ...)` when the envelope is malformed. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 成品初始化 grid's 冻结 toolbar button names `Sp_BtnEvent_AccProductFrozen` as the action. Inverse of `Sp_BtnEvent_AccProductUnFrozen`. No static caller, no `gdsmodule` hook. + +Flag: COMMENT header says `送货未开票冻结` but the body updates `accproductinitslave` (成品初始化) — comment is stale. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEvent_AccProductUnFrozen.md b/en/docs/auto-catalog/procedures/Sp_BtnEvent_AccProductUnFrozen.md index 85ce214..7b28426 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEvent_AccProductUnFrozen.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEvent_AccProductUnFrozen.md @@ -25,4 +25,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务 / 成品初始化 — button-click handler that unfreezes selected `accproductinitslave` rows previously frozen by `Sp_BtnEvent_AccProductFrozen`. Releases them back into downstream cost / closing flow. + +**What it does:** Same JSON-envelope iteration as the Frozen sibling: walks `$.params[*].value[*].sSlaveId` and `UPDATE accproductinitslave SET bFrozen=0, sFrozenPerson=sMakePerson, tFrozenDate=NOW()`. Validates `sProInParam` length and returns `sCode=-1` with `paramsErro` message when malformed. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 成品初始化 grid's 解冻 toolbar button names `Sp_BtnEvent_AccProductUnFrozen` as the action. No static caller, no `gdsmodule` hook. + +Flag: COMMENT header is `送货未开票冻结` and default `sReturn` is `'送货未开票冻结成功!'` — copy-pasted from the Frozen sibling; should be `'解冻成功'` for the unfreeze direction. Also `sFrozenPerson`/`tFrozenDate` are overwritten with the unfreezing user/timestamp, losing the original-freeze attribution. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEvent_BillSlaveLastInstore.md b/en/docs/auto-catalog/procedures/Sp_BtnEvent_BillSlaveLastInstore.md index f192a7e..fa4bfba 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEvent_BillSlaveLastInstore.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEvent_BillSlaveLastInstore.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产 / 返工单 — button-click handler that flags selected `mftproductionplanbillslave` (production-plan bill slave) rows as the "last batch" (最后一批) so subsequent in-storage tracking treats them as the terminal delivery for the rework / split-batch order. + +**What it does:** Validates `sProInParam` length, parses `$.params[*].value[*].sId`, and per id `UPDATE mftproductionplanbillslave SET iLastInStock=1, tLastInStockDate=NOW(), sLastInStockPerson=sMakePerson`. Returns `Operation successful` (default English-locale message — likely a copy-paste artifact). + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 返工单 grid's 最后一批 toolbar button names `Sp_BtnEvent_BillSlaveLastInstore` as the action. No static caller, no `gdsmodule` hook. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEvent_DeliverGoodsFinance.md b/en/docs/auto-catalog/procedures/Sp_BtnEvent_DeliverGoodsFinance.md index afeea7f..56ba788 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEvent_DeliverGoodsFinance.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEvent_DeliverGoodsFinance.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售 / 送货单 — button-click handler for finance to confirm an entire delivery-note (`saldelivergoodsmaster`) at the master level, after the warehouse-dispatch (储运) side has confirmed every line. Drives downstream invoicing/billing on the delivery note. + +**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam`. For each master id, first counts `saldelivergoodsslave` rows still at `bSingleReceipt=0`; if any remain the run aborts with `sCode=-1` and the localised `sDeliveryCyNotConfirm` ("该送货单储运未确认,禁止财务确认") message from `Fun_Sis_GetConst`. Otherwise sets `bFinance=1, sFinancePerson, tFinanceDate=NOW()` on both `saldelivergoodsmaster` and every matching `saldelivergoodsslave (sParentId=p_sId)`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 送货单 grid's 财务确认 toolbar button names `Sp_BtnEvent_DeliverGoodsFinance` as the action. Inverse: `Sp_BtnEvent_DeliverGoodsFinanceReset`. Per-line variant: `Sp_BtnEvent_DeliverGoodsFinanceSlave`. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEvent_DeliverGoodsFinanceReset.md b/en/docs/auto-catalog/procedures/Sp_BtnEvent_DeliverGoodsFinanceReset.md index 28878d9..ab04057 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEvent_DeliverGoodsFinanceReset.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEvent_DeliverGoodsFinanceReset.md @@ -25,4 +25,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售 / 送货单 — button-click handler that reverses a prior 财务确认 on a delivery-note (`saldelivergoodsmaster`), unsetting the finance-confirm flag on the master and every slave line so the document can be edited or re-confirmed. + +**What it does:** Walks `$.params[*].value[*].sId` from `sProInParam` and per master id sets `bFinance=0, sFinancePerson=sMakePerson, tFinanceDate=NOW()` on `saldelivergoodsmaster` and matching `saldelivergoodsslave (sParentId=p_sId)`. No pre-check against 储运 state — purely a flag reset. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 送货单 grid's 财务撤销 toolbar button names `Sp_BtnEvent_DeliverGoodsFinanceReset` as the action. Inverse of `Sp_BtnEvent_DeliverGoodsFinance`. + +Flag: stamping the unfreeze user/timestamp into `sFinancePerson` / `tFinanceDate` overwrites the original-confirm attribution (parallel to the AccProductUnFrozen comment). diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEvent_DeliverGoodsFinanceSlave.md b/en/docs/auto-catalog/procedures/Sp_BtnEvent_DeliverGoodsFinanceSlave.md index c6be47d..3acec23 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEvent_DeliverGoodsFinanceSlave.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEvent_DeliverGoodsFinanceSlave.md @@ -25,4 +25,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售 / 送货单 — per-line variant of `Sp_BtnEvent_DeliverGoodsFinance`: finance confirms individual `saldelivergoodsslave` rows ("送货单财务批量确认") rather than the whole master, so a delivery-note can be partially confirmed line-by-line. + +**What it does:** Walks `$.params[*].value[*].sSlaveId` from `sProInParam`. Per slave id, first checks `saldelivergoodsslave.bSingleReceipt=0 AND sId=p_sSlaveId`; if found, aborts with `sCode=-1` and localised `sDeliveryCyNotConfirm` ("该送货单储运未确认,禁止财务确认") message from `Fun_Sis_GetConst`. Otherwise sets `bFinance=1, sFinancePerson=sMakePerson, tFinanceDate=NOW()` on that single slave row. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 送货单 line-grid 财务批量确认 toolbar button names `Sp_BtnEvent_DeliverGoodsFinanceSlave` as the action. Sibling of the master-level `Sp_BtnEvent_DeliverGoodsFinance`. + +Flag: contains a stray `select p_iSCount;` diagnostic that leaks a result-set back to the caller. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEvent_KLLMaterialsItestFast.md b/en/docs/auto-catalog/procedures/Sp_BtnEvent_KLLMaterialsItestFast.md index 5904fa6..bb3fc80 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEvent_KLLMaterialsItestFast.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEvent_KLLMaterialsItestFast.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购 / 客来料请购 — button-click handler that marks selected `purpurchaseapplyslave` (purchase-apply slave) rows for the "客来料" (customer-supplied material, KLL) flow as 快速检验 (fast inspection), so the QC stage uses the abbreviated test path instead of full incoming-inspection. + +**What it does:** Validates `sProInParam` length, parses `$.params[*].value[*].sSlaveId`, and per id `UPDATE purpurchaseapplyslave SET bFast=1, tFastDate=NOW(), sFastPerson=sMakePerson`. Default `sReturn='确认成功!'`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 客来料请购 grid's 设置快速检验 toolbar button names `Sp_BtnEvent_KLLMaterialsItestFast` as the action. Sibling of `Sp_BtnEvent_MaterialsItestFast` (which acts on `purpurchasearriveslave` for normal purchase-arrival rows). diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEvent_LogAheadComfirm.md b/en/docs/auto-catalog/procedures/Sp_BtnEvent_LogAheadComfirm.md index 965355e..c7ffc36 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEvent_LogAheadComfirm.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEvent_LogAheadComfirm.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 物流 / 物流单 — button-click handler that toggles 预审核 (pre-confirm / ahead-complete) flag on selected `logisticsordermaster` rows. The "Comfirm" misspelling is consistent across the family. Used by warehouse-dispatch to mark a logistics note as preliminarily ready before final confirmation. + +**What it does:** Validates `sProInParam` length, parses `$.params[*].value[*].sId`, deduplicates via a `p_sAllId` running list (`LOCATE` guard), and per unique id `UPDATE logisticsordermaster SET bAheadComplete = (CASE WHEN bAheadComplete=1 THEN 0 ELSE 1 END), tAheadDate=NOW(), sAheadPerson=sMakePerson` — toggles, not sets. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 物流单 grid's 预审核 toolbar button names `Sp_BtnEvent_LogAheadComfirm` as the action. Companion of `Sp_BtnEvent_LogisticsComfirm` (final confirm). diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEvent_LogisticsComfirm.md b/en/docs/auto-catalog/procedures/Sp_BtnEvent_LogisticsComfirm.md index 83174f1..7a4d3c1 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEvent_LogisticsComfirm.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEvent_LogisticsComfirm.md @@ -25,4 +25,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 物流 / 物流单 — button-click handler that toggles the final 确认 flag on selected `logisticsordermaster` rows. Sets `bConfirmComplete` to gate downstream invoicing / billing on the logistics note. + +**What it does:** Validates `sProInParam` length, parses `$.params[*].value[*].sId`, and per id `UPDATE logisticsordermaster SET bConfirmComplete = (CASE WHEN bConfirmComplete=1 THEN 0 ELSE 1 END), tConfirmDate=NOW(), sConfirmPerson=sMakePerson` — toggles the flag (so the same button reverses a previous confirm). + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 物流单 grid's 确认 toolbar button names `Sp_BtnEvent_LogisticsComfirm` as the action. Companion of `Sp_BtnEvent_LogAheadComfirm` (pre-confirm). + +Flag: unlike its `LogAheadComfirm` sibling, this version has no `p_sAllId` dedup guard — a duplicated id in the input would toggle and re-toggle, leaving the flag at its pre-button value silently. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEvent_MaterialsItestFast.md b/en/docs/auto-catalog/procedures/Sp_BtnEvent_MaterialsItestFast.md index b353c18..2a8e931 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEvent_MaterialsItestFast.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEvent_MaterialsItestFast.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购 / 采购到货 — button-click handler that marks selected `purpurchasearriveslave` (purchase-arrival slave) lines as 快速检验 (fast inspection), shortening the QC path on the arrival document. + +**What it does:** Validates `sProInParam` length, parses `$.params[*].value[*].sSlaveId`, and per id `UPDATE purpurchasearriveslave SET bFast=1, tFastDate=NOW(), sFastPerson=sMakePerson`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 采购到货 grid's 设置快速检验 toolbar button names `Sp_BtnEvent_MaterialsItestFast` as the action. Sibling of `Sp_BtnEvent_KLLMaterialsItestFast` (acts on `purpurchaseapplyslave` for customer-supplied material). Companion of `Sp_BtnEvent_MaterialsItestType` (which marks the material master as 免检). diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEvent_MaterialsItestType.md b/en/docs/auto-catalog/procedures/Sp_BtnEvent_MaterialsItestType.md index e345fd5..e67681f 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEvent_MaterialsItestType.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEvent_MaterialsItestType.md @@ -25,4 +25,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础资料 / 材料 (elematerials) — button-click handler that promotes selected `elematerials` rows to 免检 (exempt from incoming inspection) by setting their `iTestType=3` on the material master, so future purchase-arrivals of the same material auto-skip QC. + +**What it does:** Validates `sProInParam` length, parses `$.params[*].value[*].sMaterialsId`, and per id `UPDATE elematerials SET iTestType=3, tSetTestDate=NOW() WHERE sId=p_sId`. Default `sReturn='财务确认成功!'` (a copy-pasted message). + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 设置免检 toolbar button on `elematerials` / 材料 grids names `Sp_BtnEvent_MaterialsItestType` as the action. Companion of `Sp_BtnEvent_MaterialsItestFast` (per-arrival fast-check). No static caller, no `gdsmodule` hook. + +Flag: default `sReturn` ("财务确认成功!") is wrong for this proc — should be `设置免检成功`. The hardcoded `iTestType=3` constant assumes the type-3 enum stays mapped to "免检" in `Fun_Sis_GetConst` / `eleparamslist`. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEvent_NoPurchase.md b/en/docs/auto-catalog/procedures/Sp_BtnEvent_NoPurchase.md index 75bff6c..7668944 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEvent_NoPurchase.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEvent_NoPurchase.md @@ -25,4 +25,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购 / 采购订单 — button-click handler that toggles 订单未采购 (`bNoPurchase`) on selected `purpurchaseorderslave` lines, flagging an order line as "not to be purchased" so requisition / MRP downstream skips it. + +**What it does:** Validates `sProInParam` length, parses `$.params[*].value[*].sSlaveId`, and per id `UPDATE purpurchaseorderslave SET bNoPurchase=(CASE WHEN bNoPurchase=1 THEN 0 ELSE 1 END) WHERE sId=p_sSlaveId` — toggles, no person/date stamp captured. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 采购订单 line-grid 未采购 toolbar button names `Sp_BtnEvent_NoPurchase` as the action. No static caller, no `gdsmodule` hook. + +Flag: unlike other BtnEvent siblings, this proc captures no `sNoPurchasePerson`/`tNoPurchaseDate` — toggling leaves no audit trail for who marked or unmarked a line. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEvent_NotifyMerge.md b/en/docs/auto-catalog/procedures/Sp_BtnEvent_NotifyMerge.md index 407f4f1..3803419 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEvent_NotifyMerge.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEvent_NotifyMerge.md @@ -25,4 +25,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售 / 送货通知单 — button-click handler that merges several 送货通知单 (`saldelivernotifymaster`) into one by re-parenting all slave lines to the first selected master, so a single delivery covers multiple notify documents. Customer-uniqueness is enforced before merging. + +**What it does:** Walks `$.params[*].value[*].sId` into a comma-CSV `p_sAllId`, keeping the first id as `p_sParentId`. Counts distinct `saldelivernotifyslave.sCustomerId` over `sParentId IN p_sAllId`; if more than one customer, aborts with `sCode=-1` and the localised `sDifferentCustomerCantHb` ("不同的客户不能进行合并") message. Otherwise `UPDATE saldelivernotifyslave SET sSrcParentId=sParentId, sParentId=p_sParentId` for all matched slaves, attaching them to the surviving master. Default success message `sShNoticeHb` ("送货通知单合并成功") via `Fun_Sis_GetConst`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 送货通知单 grid's 合并 toolbar button names `Sp_BtnEvent_NotifyMerge` as the action. No static caller, no `gdsmodule` hook. + +Flag: `LOCATE(A.sParentId, p_sAllId)>0` is a substring match, not a list match — a sParentId that is a prefix of another id (`abc` matching `abcdef`) would be merged in error. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEvent_OpsInstoreComfirm.md b/en/docs/auto-catalog/procedures/Sp_BtnEvent_OpsInstoreComfirm.md index 87f4990..d1486f6 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEvent_OpsInstoreComfirm.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEvent_OpsInstoreComfirm.md @@ -25,4 +25,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 仓库 / 成品外购入库 — button-click handler that toggles 确认 (`bConfirmComplete`) on selected `opsoutsideinstoremaster` rows (outsource-product in-store notes). Marks the in-store note as accepted so downstream invoicing and inventory postings can run. + +**What it does:** Validates `sProInParam` length, parses `$.params[*].value[*].sId`, and per id `UPDATE opsoutsideinstoremaster SET bConfirmComplete=(CASE WHEN bConfirmComplete=1 THEN 0 ELSE 1 END), tConfirmDate=NOW(), sConfirmPerson=sMakePerson` — toggles. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 成品外购入库单 grid's 确认 toolbar button names `Sp_BtnEvent_OpsInstoreComfirm` as the action. Sibling of `Sp_BtnEvent_LogisticsComfirm`, `Sp_BtnEvent_mitOutComfirm` (same toggle pattern, different master table). + +Flag: default `sReturn='物流单确认成功!'` is copy-pasted from `Sp_BtnEvent_LogisticsComfirm` — should be `成品外购入库单确认成功`. No dedup guard either, so duplicated ids in the input would re-toggle. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEvent_ProcessItestType.md b/en/docs/auto-catalog/procedures/Sp_BtnEvent_ProcessItestType.md index 56a7f25..ffe4711 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEvent_ProcessItestType.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEvent_ProcessItestType.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 工序 / 免检设置 — toolbar handler that flags a set of `eleprocess` rows (工序 master) as exemption-from-inspection (`iTestType=3`, "free of test"). The same flag controls whether downstream QC/品检 steps are required for that 工序. + +**What it does:** Parses `$.params[*].value[*].sProcessId` from `sProInParam`. For each id, sets `eleprocess.iTestType=3` and stamps `sSetName=sMakePerson`. If `sProInParam` is shorter than 5 chars, returns `sCode=-1` with the localised `paramsErro` message from `Sp_Sis_GetConst`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 工序 grid's 设置免检 toolbar button names this proc as its action. Companion: `Sp_BtnEvent_ProductItestType` for products. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEvent_ProductItestType.md b/en/docs/auto-catalog/procedures/Sp_BtnEvent_ProductItestType.md index b5d23df..f37251d 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEvent_ProductItestType.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEvent_ProductItestType.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 产品 / 免检设置 — toolbar handler that flags a set of `eleproduct` rows (产品 master) as exemption-from-inspection (`iTestType=3`). The flag suppresses downstream QC/品检 requirements for that 产品. + +**What it does:** Parses `$.params[*].value[*].sProductId` from `sProInParam`. For each id, sets `eleproduct.iTestType=3`. If `sProInParam` is shorter than 5 chars, returns `sCode=-1` with the localised `paramsErro` message from `Sp_Sis_GetConst`. Unlike its sibling for 工序, it does not stamp the operator name. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 产品 grid's 设置免检 toolbar button names this proc as its action. Companion: `Sp_BtnEvent_ProcessItestType` for 工序. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEvent_PurInstoreComfirm.md b/en/docs/auto-catalog/procedures/Sp_BtnEvent_PurInstoreComfirm.md index a00f15f..8bb60a8 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEvent_PurInstoreComfirm.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEvent_PurInstoreComfirm.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购入库 — button-click handler that toggles the 物流确认 (logistics-side completion) flag on a batch of 采购入库单 (`purpurchaseinstoremaster`) rows. Marks each selected master as confirmed-complete with the operator name and timestamp; second click reverses the toggle. + +**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam`. For each unique master id (deduplicated via `p_sAllId`), flips `purpurchaseinstoremaster.bConfirmComplete` (`CASE WHEN 1 THEN 0 ELSE 1 END`) and stamps `tConfirmDate=NOW(), sConfirmPerson=sMakePerson`. Returns `sCode=-1, paramsErro` if `sProInParam` is shorter than 5 chars. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 采购入库 grid's 物流单确认 toolbar button names this proc as its action. Sibling: `Sp_BtnEvent_PurInstorePrintName` for stamping the print operator on the same table. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEvent_PurInstorePrintName.md b/en/docs/auto-catalog/procedures/Sp_BtnEvent_PurInstorePrintName.md index 00c30a6..8a23142 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEvent_PurInstorePrintName.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEvent_PurInstorePrintName.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购入库 — button-click handler that records the user who printed a 采购入库单 (`purpurchaseinstoremaster`) by writing their name into `sPrintName`. Used for print-audit trail on the goods-receipt label. + +**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam`. For each unique master id (deduplicated via `p_sAllId`), sets `purpurchaseinstoremaster.sPrintName=sMakePerson`. Returns `sCode=-1, paramsErro` if `sProInParam` is shorter than 5 chars. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 采购入库 grid's 标记打印人 toolbar button names this proc as its action. Sibling: `Sp_BtnEvent_PurInstoreComfirm` for logistics confirmation on the same table. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEvent_UpdateOpsAgainCar.md b/en/docs/auto-catalog/procedures/Sp_BtnEvent_UpdateOpsAgainCar.md index a8f2e3d..b6b8d69 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEvent_UpdateOpsAgainCar.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEvent_UpdateOpsAgainCar.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 工序发外 — toolbar handler for the "再次派车" (re-dispatch transport) flow on 工序发外明细 (`opsoutsideprocessslave`). Allows resetting send-out and send-back carrier quantities so a fresh派车单 can be issued against the same outsource process line. + +**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam`. For each master id, updates every `opsoutsideprocessslave` row whose `sParentId=p_sId`: increments `iOutNum=iOutNum+1`, resets `dInSendCarQty=0, dOutSendCarQty=0`. Returns `sCode=-1, paramsErro` on missing input. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 工序发外 grid's 再次派车 toolbar button names this proc as its action. Sibling: `Sp_BtnEvent_UpdateOutProcessLogistics` for setting the in/out logistics method on the same slave table. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEvent_UpdateOutProcessLogistics.md b/en/docs/auto-catalog/procedures/Sp_BtnEvent_UpdateOutProcessLogistics.md index 8a671d9..b36015e 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEvent_UpdateOutProcessLogistics.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEvent_UpdateOutProcessLogistics.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 工序发外 — toolbar handler for setting the in/out logistics method on 工序发外明细 (`opsoutsideprocessslave`). Lets the dispatcher batch-assign which carrier/transport mode covers send-out and return shipments for a set of outsource lines. + +**What it does:** Parses `$.params[*].value[*].sSlaveId` from `sProInParam`. Reads `iInLogistics` and `iOutLogistics` codes from `$.changeValue` (the toolbar prompt's input). For each slave id, sets `opsoutsideprocessslave.iInLogistics=p_iInLogistics, iOutLogistics=p_iOutLogistics`. Returns `sCode=-1, paramsErro` on missing input. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 工序发外 detail grid's 设置物流 toolbar button names this proc as its action. Sibling: `Sp_BtnEvent_UpdateOpsAgainCar` for the re-dispatch flow on the same slave table. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEvent_WorkUnComplete.md b/en/docs/auto-catalog/procedures/Sp_BtnEvent_WorkUnComplete.md index 0c2d532..ce4d9f3 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEvent_WorkUnComplete.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEvent_WorkUnComplete.md @@ -25,4 +25,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产工单 — toolbar handler that reverses 工单完工 (work-order-complete). Lets the shop floor un-complete a finished `mftworkordermaster` so further reports/postings can be made; the original completion timestamp is overwritten with the cancel timestamp and `sCompletePerson` records who cancelled. + +**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam`. For each master id, sets `mftworkordermaster.bBillComplete=0, tBillCompleteDate=NOW(), sCompletePerson=CONCAT(sMakePerson,'取消完工')`. Returns `sCode=-1, paramsErro` on missing input. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 生产工单 grid's 取消完工 toolbar button names this proc as its action. Inverse of the `bBillComplete=1` setter on the same table. + +Flag: the timestamp column is reused for both completion and cancellation, so the audit trail loses the original completion time on cancel. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEvent_mitOutComfirm.md b/en/docs/auto-catalog/procedures/Sp_BtnEvent_mitOutComfirm.md index a90a282..fb20195 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEvent_mitOutComfirm.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEvent_mitOutComfirm.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产 / 材料出库单 — button-click handler that toggles 确认 (`bConfirmComplete`) on selected `mitproductionmaterialsmaster` (material out-bound note) rows. Marks the issue ticket as accepted by production so downstream cost / consumption postings can run. + +**What it does:** Validates `sProInParam` length, parses `$.params[*].value[*].sId`, deduplicates against a running `p_sAllId` via `LOCATE`, and per unique id `UPDATE mitproductionmaterialsmaster SET bConfirmComplete=(CASE WHEN bConfirmComplete=1 THEN 0 ELSE 1 END), tConfirmDate=NOW(), sConfirmPerson=sMakePerson` — toggles. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 材料出库单 grid's 确认 toolbar button names `Sp_BtnEvent_mitOutComfirm` as the action. Sibling of `Sp_BtnEvent_LogisticsComfirm`, `Sp_BtnEvent_OpsInstoreComfirm` (same toggle pattern, different master table). diff --git a/en/docs/auto-catalog/procedures/Sp_BtnEventworkcenterSure_New.md b/en/docs/auto-catalog/procedures/Sp_BtnEventworkcenterSure_New.md index 3cca3d4..7feeccd 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnEventworkcenterSure_New.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnEventworkcenterSure_New.md @@ -22,4 +22,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 / 工作中心 — toolbar handler that toggles 工作中心核算确认 (`accworkcenter.bConfirm`) for the selected costing-period rows, then re-aggregates `accdepart` totals from confirmed work-centers under each department. Period gate: rejects if `sysaccountperiod.bCost=1`. + +**What it does:** Parses `$.params[*].value[*]` with `sId, sCostPeriod`. Per row: reads `sysaccountperiod.bCost` — if `1`, returns `sCode=-1, sBtnDepartFinished` ("该会计期间已核算完成,不能进行此操作"). Otherwise flips `accworkcenter.bConfirm` and stamps `sConfirmMonth=p_sPeriodId` for matching `(sId, sBrId, sSuId)`. After the loop: resets every `accdepart` row's `dPower/dDepreciation/dMonthHour/iPeople/iMachine/dArea/dAveragePower/dAllHourSalary` to 0, then re-aggregates them from `accworkcenter` `SUM(...) GROUP BY sDepartId, sCostPeriod` where `bConfirm=1`, joining on `A.sSrcId=B.sDepartId AND A.sCostPeriod=B.sCostPeriod` (the secondary update also brings in `dColorQty, dProcessQty, dSumPlateQty, dMonthArea`). + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 工作中心 grid's 确认 toolbar button names this proc as its action. Siblings in the cost-confirm family: `Sp_BtnEventDepartSure_New`, `Sp_BtnEventMaterialsSure_New`, `Sp_BtnEventProductInStoreSure_New`, `Sp_BtnEventProductionmaterialSure_New`, `Sp_BtnEventProductSure_New`. + +Flag: the post-loop `accdepart` reset has no `WHERE sCostPeriod=p_sPeriodId` — it zeros every period's `accdepart` row globally before re-aggregating from the temp join. Other periods lose their precomputed `accdepart` values until those periods are confirmed again. Maintainer audit recommended. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnRepairUpdateCheckMemo.md b/en/docs/auto-catalog/procedures/Sp_BtnRepairUpdateCheckMemo.md index 9b0224a..4b32d2e 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnRepairUpdateCheckMemo.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnRepairUpdateCheckMemo.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量事故 — bulk "批量修改" dialog handler that lets a QC reviewer record an inspection memo `sCheckMemo` on selected `mftqualityaccidentMaster` rows, stamping reviewer + review date alongside. + +**What it does:** Parses `$.params[*].value[*].sId` and `$.changeValue.textareaValue` from `sProInParam`. For each master id, opens a cursor against `mftqualityaccidentMaster` scoped by `sBrandsId=sBrId AND sSubsidiaryId=sSuId`, and per row sets `sCheckMemo = p_textareaValue, sCkPerson = sMakePerson, tCKDate = NOW()`. Cursor loop is structurally degenerate (always one row, since the key is already `sId = p_sId`), but the tenancy guard inside the cursor query is the proc's tenant-safety filter. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — front-end "复核备注" dialog on the 质量事故 grid registers this procedure name. Note the unusual naming (`Sp_BtnRepair` not `Sp_BtnRepair_`): older naming convention than the `Sp_BtnRepair_*` family. Sibling of `Sp_BtnRepairUpdateJzMemo` (集中-meeting memo counterpart on the same table). diff --git a/en/docs/auto-catalog/procedures/Sp_BtnRepairUpdateJzMemo.md b/en/docs/auto-catalog/procedures/Sp_BtnRepairUpdateJzMemo.md index cc54e96..939e779 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnRepairUpdateJzMemo.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnRepairUpdateJzMemo.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量事故 — bulk "批量修改" dialog handler that lets the 集中 (JZ, centralised-review) reviewer record a final-judgement memo `sJzMemo` on selected `mftqualityaccidentMaster` rows, stamping reviewer + review date alongside. + +**What it does:** Parses `$.params[*].value[*].sId` and `$.changeValue.textareaValue` from `sProInParam`. For each master id, opens a cursor against `mftqualityaccidentMaster` scoped by `sBrandsId=sBrId AND sSubsidiaryId=sSuId`, and per row sets `sJzMemo = p_textareaValue, sJZPerson = sMakePerson, tJZDate = NOW()`. Cursor loop is structurally degenerate (single-row by key) but provides the tenancy filter. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — front-end "集中处理意见" dialog on the 质量事故 grid registers this procedure name. Older naming convention without the trailing underscore. Sibling of `Sp_BtnRepairUpdateCheckMemo` (`sCheckMemo` counterpart on the same table). diff --git a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateBackMemo.md b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateBackMemo.md index e966a53..e05b161 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateBackMemo.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateBackMemo.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产计划 / 变更主表数据 — bulk "批量修改" dialog handler that lets a planner overwrite the rejection / push-back memo (`sBackMemo`) on selected `mftproductionplanbillslave` lines from the production-plan-bill grid. + +**What it does:** Parses `$.params[*].value[*].sId` and `$.changeValue.sBackMemo` from `sProInParam`. For each row id, executes `UPDATE mftproductionplanbillslave SET sBackMemo = p_sMemo WHERE sId = p_sId`. No tenancy filter on update — relies on the dialog supplying tenant-scoped sIds. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — front-end "批量修改" dialog on the 生产计划单 grid registers this procedure name. Built from the `sButtonParam.sql` template (see `xlyEntry/.../templesql/sButtonParam.sql`, whose comment documents the `BtnRepair` `changeValue` + `textareaValue` payload contract). Sibling of the `Sp_BtnRepair_Update*` family. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateBackStates.md b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateBackStates.md index 252f966..0053186 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateBackStates.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateBackStates.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售设计 / 变更设计状态 — bulk "批量修改" dialog handler that overwrites the design-status flag `sStates` on selected `salsalesdesignmaster` rows. + +**What it does:** Parses `$.params[*].value[*].sId` and `$.changeValue.sStates` from `sProInParam`. For each row id, executes `UPDATE salsalesdesignmaster SET sStates = p_sStates WHERE sId = p_sId`. `$.changeValue.textareaValue` (memo) is parsed but not persisted by the current body. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — front-end "批量修改设计状态" toolbar dialog on the 销售设计 grid registers this procedure name. Built from the `sButtonParam.sql` template (see `xlyEntry/.../templesql/sButtonParam.sql`). Sibling of the `Sp_BtnRepair_Update*` family. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateCustomer.md b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateCustomer.md index e8e2f18..3e0f313 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateCustomer.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateCustomer.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 客户档案 / 变更主表数据 — bulk "批量修改" dialog handler for the 客户 (customer) master grid. Lets a sales-admin overwrite a curated set of customer-profile fields (name, short name, salesman, merchandiser, contacts, address, etc.) across many rows in one click. + +**What it does:** Parses `$.params[*].value[*].sId` and per-field values from `$.changeValue` (`sCustomerName`, `sCustomerShort`, `sStorePerson`, `sSalesManId`, `bMoreOut`, `sParentId`, `sCustomerPropertyId`, `sMerchandiserId`, `sSrcCustomerId`, `sContacts`, `sMobile`, `sPhone1`, `sCompanyAddress`). For each `sId`, executes `UPDATE elecustomer A SET ...` using `IF(IFNULL(p_x,'')='',A.x,p_x)` per field so blank changeValue entries are skipped — only `bMoreOut` and `sSrcCustomerId` are overwritten unconditionally. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — front-end "批量修改" dialog on the 客户档案 grid registers this procedure name. Built from the `sButtonParam.sql` template. Sibling of the `Sp_BtnRepair_Update*` family. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateGYSFKBackMemo.md b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateGYSFKBackMemo.md index 583a0cb..a8c2457 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateGYSFKBackMemo.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateGYSFKBackMemo.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购入库 / 供应商反馈 — bulk "批量修改" dialog handler that lets purchasing record a 供应商 (GYS) push-back memo on selected `purpurchaseinstorededmaster` rows. The `sBackMemo` captures supplier-side feedback on a delivered purchase-in-storage record. + +**What it does:** Parses `$.params[*].value[*].sId` and `$.changeValue.sBackMemo` from `sProInParam`. For each row id, executes `UPDATE purpurchaseinstorededmaster SET sBackMemo = p_sMemo WHERE sId = p_sId`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — front-end "供应商反馈" dialog on the 采购入库 grid registers this procedure name. Built from the `sButtonParam.sql` template. Sibling of `Sp_BtnRepair_UpdateWXFKBackMemo` (the outsourced-in-storage counterpart). diff --git a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateGYSMaterialsMoney.md b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateGYSMaterialsMoney.md index 1265a31..efe2362 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateGYSMaterialsMoney.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateGYSMaterialsMoney.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购入库 / 供应商扣款金额修改 — bulk "批量修改" dialog handler that lets purchasing finance overwrite the supplier line-amount `dMaterialsMoney` on `purpurchaseinstorededslave` (e.g. quality-deduction adjustments), then re-derives unit price and tax breakdown from `sistax.dRate`. + +**What it does:** For each `sId` in the JSON payload, executes (1) `UPDATE purpurchaseinstorededslave A JOIN sistax B ON A.sTaxId=B.sId SET A.dMaterialsMoney = p_dMaterialsMoney WHERE A.sId = p_sId`, then (2) recomputes `dMaterialsPrice = dMaterialsMoney/dMaterialsQty`, plus `dMaterialsNoTaxPrice`, `dMaterialsNoTaxMoney`, `dMaterialsTaxMoney`, `dMaterialsTaxForeignMoney`, `dMaterialsForeignMoney` via the tax-rate factor `1+B.dRate/100`. Stamps `sChangePerson = sMakePerson`, `tChangeDate = NOW()`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — front-end "供应商扣款金额修改" dialog on the 采购入库 detail grid registers this procedure name. Built from the `sButtonParam.sql` template. Sibling of `Sp_BtnRepair_UpdateWXSMaterialsMoney` (outsourced counterpart). diff --git a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateLogSlavePrice.md b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateLogSlavePrice.md index dbd4687..73bb527 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateLogSlavePrice.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateLogSlavePrice.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 物流单 / 重新计算物流单从表金额 — bulk "批量修改" dialog handler that recalculates `logisticsorderslave` per-line material money/price by allocating the master total proportionally to a chosen base (product price × auxiliary qty, or materials price × auxiliary qty), rather than per-line manual entry. + +**What it does:** For each master `sId` in the payload, runs a multi-step recalc on `logisticsorderslave`: (1) populate `dSrcMoney` from a fallback chain (`B.dProductPrice * A.dAuxiliaryQty`, then `B.dMaterialsPrice * A.dAuxiliaryQty`); (2) sum `dSrcMoney` into `p_dSrcTotalMoney` and `dProductMoney` into `p_dTotalMoney`; (3) re-distribute `dMaterialsMoney = ROUND(dSrcMoney / p_dSrcTotalMoney * p_dTotalMoney, 2)` and back-derive `dMaterialsPrice` per line. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — front-end "重新计算金额" dialog on the 物流单 grid registers this procedure name. Built from the `sButtonParam.sql` template; only the textareaValue memo is parsed from changeValue (no per-field values). diff --git a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateNotUsed.md b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateNotUsed.md index d73f68c..cbf618f 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateNotUsed.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateNotUsed.md @@ -25,4 +25,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 产品报价 / 变更从表数据 — bulk "批量修改" dialog handler on the 产品报价 (product-quotation) slave grid. Lets the quotation owner overwrite the obsolete-row flag `bNotUsed` plus the six quoted-price components on selected `eleproductpriceslave` lines in one click. + +**What it does:** Parses per-row `sId` plus per-field values from `$.changeValue`: `bNotUsed`, `dQuoMaterialsPrice`, `dAssistMaterialsPrice`, `dQuoPrintPrice`, `dQuoPrintAfterPrice`, `dQuoManualPrice`, `dQuoFreightPrice`. For each row id, `UPDATE eleproductpriceslave SET ...` with `IFNULL(p_x, 0)` (defaults to 0 when not supplied — so a partial dialog blanks unset price components to zero). + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — front-end "批量修改" dialog on the 产品报价从表 grid registers this procedure name. Built from the `sButtonParam.sql` template. Sibling of the `Sp_BtnRepair_Update*` family. + +Caveat: blanking semantics — every price column is `IFNULL(p_x, 0)`, so any field the user does not edit in the dialog will be reset to 0 rather than preserved. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdatePMC.md b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdatePMC.md index aa44c7a..6983481 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdatePMC.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdatePMC.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售订单 / PMC意见 — bulk "批量修改" dialog handler that lets PMC (production-material-control) staff record a feedback note `sPMCReason` against selected `salsalesorderslave` lines (typically explaining capacity/material issues blocking the order line). + +**What it does:** Parses `$.params[*].value[*].sId` and `$.changeValue.sPMCReason` from `sProInParam`. For each row id, `UPDATE salsalesorderslave SET sPMCReason = p_sPMCReason WHERE sId = p_sId`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — front-end "PMC意见" dialog on the 销售订单 detail grid registers this procedure name. Built from the `sButtonParam.sql` template. Sibling of the `Sp_BtnRepair_Update*` family. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdatePlanMemo.md b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdatePlanMemo.md index 70110ad..542887b 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdatePlanMemo.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdatePlanMemo.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产计划 / 变更计划备注数据 — bulk "批量修改" dialog handler that overwrites the planner memo `sMemo` on selected `mftproductionplanslave` rows. + +**What it does:** Parses `$.params[*].value[*].sId` and `$.changeValue.sMemo` from `sProInParam`. For each row id, `UPDATE mftproductionplanslave SET sMemo = p_sMemo WHERE sId = p_sId`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — front-end "批量修改备注" dialog on the 生产计划 grid registers this procedure name. Built from the `sButtonParam.sql` template. Sibling of the `Sp_BtnRepair_Update*` family. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateProcessMaster.md b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateProcessMaster.md index 5ae7989..0436254 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateProcessMaster.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateProcessMaster.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 工艺变更 / 变更工艺变更主表数据 — bulk "批量修改" dialog handler that overwrites the poor-quality cost amount `dPoorMoney` on selected `mftprocesschangemaster` (process-change ticket) rows. + +**What it does:** Parses `$.params[*].value[*].sId` and `$.changeValue.dPoorMoney` from `sProInParam`. For each master id, `UPDATE mftprocesschangemaster SET dPoorMoney = p_dPoorMoney WHERE sId = p_sId`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — front-end "批量修改" dialog on the 工艺变更单 grid registers this procedure name. Built from the `sButtonParam.sql` template. Sibling of the `Sp_BtnRepair_Update*` family. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateSalesMaster.md b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateSalesMaster.md index a504994..641152a 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateSalesMaster.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateSalesMaster.md @@ -25,4 +25,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售订单 / 变更主表数据 — bulk "批量修改" dialog handler that overwrites four sales-order-master fields on selected `salsalesordermaster` rows: customer-order-no, accident-no, NPD flag, and memo. + +**What it does:** Parses `$.params[*].value[*].sId` plus `$.changeValue.{sCustomerOrderNo, sAccidentNo, iNPD, sMemo}` from `sProInParam`. For each master id, `UPDATE salsalesordermaster SET sCustomerOrderNo=p_sCustomerOrderNo, sAccidentNo=p_sAccidentNo, iNPD=p_iNPD, sMemo=p_sMemo WHERE sId=p_sId` — all four fields overwritten unconditionally, blanks blank the row. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — front-end "批量修改" dialog on the 销售订单 master grid registers this procedure name. Built from the `sButtonParam.sql` template. Sibling of `Sp_BtnRepair_UpdateSalesSlave` and the rest of the `Sp_BtnRepair_Update*` family. + +Caveat: no `IF(IFNULL(..)='', A.x, p_x)` guard — unset dialog fields will blank the underlying columns rather than preserve them. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateSalesSlave.md b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateSalesSlave.md index 820ae11..2561eda 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateSalesSlave.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateSalesSlave.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售订单 / 变更从表数据 — bulk "批量修改" dialog handler for sales-order detail lines. Overwrites `sCustomerProductNo`, `sBillType`, `tDeliverDate` on selected `salsalesorderslave` rows; updates `sBillTypeNo` only on reorder ("翻单") lines; cascades the new `sCustomerProductNo` to downstream `saldelivernotifyslave` rows. + +**What it does:** Parses per-row `sId` plus `$.changeValue.{sBillType, sBillTypeNo, sCustomerProductNo, tDeliverDate}`. For each row: (1) `UPDATE salsalesorderslave SET sBillTypeNo = ... WHERE sId = p_sId AND LOCATE('翻单', sBillType) > 0`; (2) `UPDATE salsalesorderslave SET sCustomerProductNo, sBillType, tDeliverDate ...` using `IF(IFNULL(p_x, '') = '', A.x, p_x)` per field; (3) cascade to `saldelivernotifyslave A JOIN salsalesorderslave B ON A.sOrderSlaveId=B.sId SET A.sCustomerProductNo=B.sCustomerProductNo WHERE A.sCustomerProductNo=''`. A parallel cascade to `saldelivergoodsslave` is commented out. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — front-end "批量修改" dialog on the 销售订单 detail grid registers this procedure name. Built from the `sButtonParam.sql` template. Sibling of `Sp_BtnRepair_UpdateSalesMaster`. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateWXFKBackMemo.md b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateWXFKBackMemo.md index f369019..8230b16 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateWXFKBackMemo.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateWXFKBackMemo.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 委外入库 / 外协商反馈 — bulk "批量修改" dialog handler that lets ops record a 外协商 (WX, outsourced-supplier) push-back memo on selected `opsoutsideinstorededmaster` rows. + +**What it does:** Parses `$.params[*].value[*].sId` and `$.changeValue.sBackMemo` from `sProInParam`. For each master id, `UPDATE opsoutsideinstorededmaster SET sBackMemo = p_sMemo WHERE sId = p_sId`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — front-end "外协商反馈" dialog on the 委外入库 grid registers this procedure name. Built from the `sButtonParam.sql` template. Sibling of `Sp_BtnRepair_UpdateGYSFKBackMemo` (purchase-in-storage counterpart). diff --git a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateWXSMaterialsMoney.md b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateWXSMaterialsMoney.md index 2b825f8..466d810 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateWXSMaterialsMoney.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateWXSMaterialsMoney.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 委外入库 / 外协商扣款金额修改 — bulk "批量修改" dialog handler that lets ops finance overwrite the line amount `dMaterialsMoney` on `opsoutsideinstorededslave` (outsourced-supplier deduction adjustments), then re-derives unit price and tax breakdown from `sistax.dRate`. + +**What it does:** For each `sId` in the payload, executes (1) `UPDATE opsoutsideinstorededslave A JOIN sistax B ON A.sTaxId=B.sId SET A.dMaterialsMoney = p_dMaterialsMoney WHERE A.sId = p_sId`, then (2) recomputes `dMaterialsPrice = dMaterialsMoney/dMaterialsQty` plus `dMaterialsNoTaxPrice`, `dMaterialsNoTaxMoney`, `dMaterialsTaxMoney`, `dMaterialsTaxForeignMoney`, `dMaterialsForeignMoney` via the tax-rate factor `1+B.dRate/100`. Stamps `sChangePerson = sMakePerson`, `tChangeDate = NOW()`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — front-end "外协商扣款金额修改" dialog on the 委外入库 detail grid registers this procedure name. Built from the `sButtonParam.sql` template. Sibling of `Sp_BtnRepair_UpdateGYSMaterialsMoney` (purchase-in-storage counterpart). diff --git a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateWorkOrderMaster.md b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateWorkOrderMaster.md index 3aaf74f..509cae3 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateWorkOrderMaster.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdateWorkOrderMaster.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 工单 / 变更主表数据 — bulk "批量修改" dialog handler that overwrites the material cost amount `dMCostMoney` on selected `mftworkordermaster` rows (post-hoc cost adjustment when the auto-derived figure is wrong). + +**What it does:** Parses `$.params[*].value[*].sId` and `$.changeValue.dMCostMoney` from `sProInParam`. For each master id, `UPDATE mftworkordermaster SET dMCostMoney = p_dMCostMoney WHERE sId = p_sId`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — front-end "批量修改" dialog on the 工单 master grid registers this procedure name. Built from the `sButtonParam.sql` template. Sibling of the `Sp_BtnRepair_Update*` family. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdatesSupply.md b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdatesSupply.md index 4b18559..eb301d3 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdatesSupply.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnRepair_UpdatesSupply.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 供应商档案 / 变更供应商主表数据 — bulk "批量修改" dialog handler for the 供应商 (supplier) master grid. Lets a procurement-admin overwrite supplier-profile fields across many `elesupply` rows in one click. + +**What it does:** Parses `$.params[*].value[*].sId` and per-field values from `$.changeValue` (`sSupplyName`, `sSupplyShort`, `sSupplyType`, `sParentId`, `sContacts`, `sMobile` placeholder, `sPhone1`, `sCompanyAddress`, `sEmail`, `sTaxId`, `sGetPayId`). For each `sId`, `UPDATE elesupply SET ...` using the `IF(IFNULL(p_x,'')='',A.x,p_x)` pattern so blank changeValue entries preserve existing values. Sibling of `Sp_BtnRepair_UpdateCustomer` on the customer side. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — front-end "批量修改" dialog on the 供应商档案 grid registers this procedure name. Built from the `sButtonParam.sql` template. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnUpdate_InvoiceSubCheck.md b/en/docs/auto-catalog/procedures/Sp_BtnUpdate_InvoiceSubCheck.md index 07877b0..cc646c3 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnUpdate_InvoiceSubCheck.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnUpdate_InvoiceSubCheck.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售开票 / 开票提交审核 — toolbar handler for submitting a sales invoice for review. Flips the `bSubCheck` flag from 0→1 on selected `SalSalesInvoiceMaster` rows, recording the submitter and submission timestamp; second-press idempotent (skips already-submitted rows). + +**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam`. For each master id, `UPDATE SalSalesInvoiceMaster SET bSubCheck=1, tSubCheckDate=NOW(), sSubCheckPerson=sMakePerson WHERE sId=p_sId AND bSubCheck=0`. Only the textareaValue field is parsed from changeValue (no per-field values). + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — front-end "提交审核" toolbar button on the 销售开票 grid registers this procedure name. Naming `Sp_BtnUpdate_` (not `Sp_BtnEvent_` / `Sp_BtnRepair_`) suggests a third button-handler convention — toolbar action without dialog input. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnUpdate_OnOpsConfirm.md b/en/docs/auto-catalog/procedures/Sp_BtnUpdate_OnOpsConfirm.md index 904d7aa..d5767be 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnUpdate_OnOpsConfirm.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnUpdate_OnOpsConfirm.md @@ -25,4 +25,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 外协加工单 / 外协商确认发货 — outsourced-processing supplier portal: lets a subcontractor (外协商) toggle the "shipment confirmed" flag on selected `opsoutsideprocessslave` lines they have been allocated. + +**What it does:** Parses `$.params[*].value[*].sSlaveId` from the JSON payload; for each slave line whose current `bOutConfirm=0`, sets `bOutConfirm` to its toggle (CASE 1↔0), stamps `tOutConfirmDate=NOW()` and `sOutConfirmPerson=sMakePerson`. Reads `$.changeValue.textareaValue` but the value is never written — appears to be a stub for an unimplemented remark field. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — toolbar button on the 外协加工单 supplier-portal grid registers this procedure name in its button config. No callers in any DB metadata column or xly-src grep for this DB instance. + +Flag: the `WHERE A.sId=p_sId and bOutConfirm =0` guard means once a row is confirmed, the CASE toggle can never run again — effective behaviour is one-way "confirm", not toggle. Comment says 确认发货 (confirm shipment). diff --git a/en/docs/auto-catalog/procedures/Sp_BtnUpdate_OnOpsOrder.md b/en/docs/auto-catalog/procedures/Sp_BtnUpdate_OnOpsOrder.md index fa10f92..c9d50d4 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnUpdate_OnOpsOrder.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnUpdate_OnOpsOrder.md @@ -25,4 +25,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 外协加工单 / 外协商接收加工单 — outsourced-processing supplier portal: lets the subcontractor (外协商) acknowledge receipt of an `opsoutsideprocessmaster` work-order assigned to them. + +**What it does:** Parses `$.params[*].value[*].sId` (master rows) and for each row whose current `bSupply=0`, sets `bSupply` to its toggle (CASE 1↔0), stamps `tSupplyDate=NOW()`, `sSupplyPerson=sMakePerson`. Reads `$.changeValue.textareaValue` but does not persist it. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — toolbar "接收加工单" button on the 外协加工单 supplier-portal grid. No callers found in DB metadata or xly-src grep for this DB instance. + +Flag: same `bSupply=0` guard as the OnPurOrder/OnOpsConfirm siblings — effectively one-way acknowledge, not a toggle. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnUpdate_OnPurOrder.md b/en/docs/auto-catalog/procedures/Sp_BtnUpdate_OnPurOrder.md index 1ec532e..ea1229e 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnUpdate_OnPurOrder.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnUpdate_OnPurOrder.md @@ -25,4 +25,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购订单 / 供应商接收订单 — supplier portal: lets a vendor mark a `purpurchaseordermaster` purchase order as received/acknowledged once they have seen it in the supplier-facing grid. + +**What it does:** Parses `$.params[*].value[*].sId` (master rows) and for each row whose current `bSupply=0`, sets `bSupply` to its toggle (CASE 1↔0), stamps `tSupplyDate=NOW()`, `sSupplyPerson=sMakePerson`. Reads `$.changeValue.textareaValue` but does not persist it. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — toolbar "接收订单" button on the 采购订单 supplier-portal grid. No callers in DB metadata or xly-src grep for this DB instance. + +Flag: same `bSupply=0` guard as the OnOpsOrder/OnOpsConfirm/RevSupply siblings — effectively one-way receipt-acknowledge, not a toggle. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnUpdate_RevSupply.md b/en/docs/auto-catalog/procedures/Sp_BtnUpdate_RevSupply.md index 2f03d6b..dfda496 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnUpdate_RevSupply.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnUpdate_RevSupply.md @@ -25,4 +25,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 供应商评审 / 供应商评审提交打分 — supplier-rating workflow: toggles the "score submitted" flag on a `revsupplymaster` (supplier evaluation header) once a reviewer has finalised their scorecard. + +**What it does:** Parses `$.params[*].value[*].sId` and for each master row whose `bCheck=0` (note the WHERE column is `bCheck`, not the toggled `bSubCheck`), sets `bSubCheck` to its toggle (CASE 1↔0), stamps `tSubCheckDate=NOW()`, `sSubCheckPerson=sMakePerson`. Reads `$.changeValue.textareaValue` but does not persist it. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — toolbar "提交打分" button on the 供应商评审 grid. No callers in DB metadata or xly-src grep for this DB instance. + +Flag: WHERE-clause column mismatch — guards on `bCheck=0` (final-check) but mutates `bSubCheck` (sub-check). Once the parent evaluation is checked, the score-submit toggle can no longer fire even if the score itself was never recorded. Likely a copy-paste bug from the OnPurOrder template. diff --git a/en/docs/auto-catalog/procedures/Sp_BtnUpdate_SalesMaterials.md b/en/docs/auto-catalog/procedures/Sp_BtnUpdate_SalesMaterials.md index 3fdbe38..28975a3 100644 --- a/en/docs/auto-catalog/procedures/Sp_BtnUpdate_SalesMaterials.md +++ b/en/docs/auto-catalog/procedures/Sp_BtnUpdate_SalesMaterials.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 研发工单 / 研发材料审批流 — R&D bill-of-materials approval: marks selected `mftworkorderslave` (work-order material lines) as material-checked and side-effects the underlying material master(s) into invalid state pending re-approval. + +**What it does:** Parses `$.params[*].value[*].sSlaveId` and per line: (1) sets `mftworkorderslave.bMCheck=1` and `tMCheckDate=NOW()` (no toggle — always sets to 1); (2) joins back to `elematerials` via `sMaterialsId` and, for any referenced material whose `bCheck=0`, sets `bInvalid=1`. Effectively flags the work-order line as approved and invalidates the still-unchecked component records so they cannot be reused until re-approved. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — toolbar approval button on the 研发工单 / 研发材料 grid. No callers in DB metadata or xly-src grep for this DB instance. diff --git a/en/docs/auto-catalog/procedures/Sp_CTPPlanList_BtnEventFinished.md b/en/docs/auto-catalog/procedures/Sp_CTPPlanList_BtnEventFinished.md index 6b21205..eb035e1 100644 --- a/en/docs/auto-catalog/procedures/Sp_CTPPlanList_BtnEventFinished.md +++ b/en/docs/auto-catalog/procedures/Sp_CTPPlanList_BtnEventFinished.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 出版/印版 → 待出版任务列表 (CTPPlanList) — button handler marking selected plan rows as "出版完成". Standard JSON-batch shape: the caller picks rows in the front-end CTP plan list and clicks the 出版完成 button; this proc stamps `bPublish=1` plus publish-person/publish-date on each `mftproductionplanslave` row. + +**What it does:** Validates `sProInParam` (≥5 chars), parses `$.params[].value[].sId` from the JSON payload, then for each `sId` runs `UPDATE mftproductionplanslave SET tPublishDate=NOW(), sPublishPerson=sMakePerson, bPublish=1 WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. No KPI write, no flow, no back-write. + +**Invocation:** `sp_btn_action*`-style — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` when the 出版完成 button is wired to this proc by name. No `gdsconfigformmaster`/`gdsmodule` hook references; xly-src ships `script/标版/30100101/Sp_CTPPlanList_BtnEventFinished.sql` as the install body. The button binding lives in the form configuration (button column referencing this proc), not in the standard hook tables. diff --git a/en/docs/auto-catalog/procedures/Sp_CTPPlanList_BtnEventFinished_cut.md b/en/docs/auto-catalog/procedures/Sp_CTPPlanList_BtnEventFinished_cut.md index db2e5f1..1bf3610 100644 --- a/en/docs/auto-catalog/procedures/Sp_CTPPlanList_BtnEventFinished_cut.md +++ b/en/docs/auto-catalog/procedures/Sp_CTPPlanList_BtnEventFinished_cut.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 出版/印版 → 待出版任务列表 (CTPPlanList) — sibling of `Sp_CTPPlanList_BtnEventFinished` that marks selected plan rows as "切版完成". Stamps `bCut=1` plus cut-person/cut-date on each `mftproductionplanslave` row when the 切版完成 button fires. + +**What it does:** Validates `sProInParam` (≥5 chars), parses `$.params[].value[].sId` from the JSON payload, then for each `sId` runs `UPDATE mftproductionplanslave SET tPublishDate=NOW(), sCutPerson=sMakePerson, bCut=1 WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. Note: copies the publish-stamp column `tPublishDate` even though this is the cut step — that field-name reuse is intentional (the table tracks the most-recent stage timestamp). + +**Invocation:** `sp_btn_action*`-style — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` when the 切版完成 button on the CTPPlanList form is wired to this proc. xly-src ships `script/标版/30100101/Sp_CTPPlanList_BtnEventFinished_cut.sql` as the install body. No form-master/gdsmodule hook reference; the button binding lives in form configuration. diff --git a/en/docs/auto-catalog/procedures/Sp_CalcAttribDate.md b/en/docs/auto-catalog/procedures/Sp_CalcAttribDate.md index 5b42263..d3dc308 100644 --- a/en/docs/auto-catalog/procedures/Sp_CalcAttribDate.md +++ b/en/docs/auto-catalog/procedures/Sp_CalcAttribDate.md @@ -19,4 +19,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 / 上报 — date-attribution helper that resolves which calendar day a production-report slave (`mftproductionreportslave`) should belong to. The shop runs across shift boundaries, so the slave row's `tVestingDate` (归属日期) is not always the same as `tCreateDate`; the team type (白班/晚班) and the machine's `sOffWork`/`sShiftsWork` cut-off govern which day the output is credited to for shift-based wage and KPI roll-ups. + +**What it does:** Cursors over `viw_mftproductionreport` (optionally narrowed by `sGuid`) where `bInvalid=0`. For each row, reads `elemachine.sOffWork`, `sShiftsWork`, `sWorkType`. When `sWorkType='1'` (day-only) sets `tVestingDate` to the create date with `sTeamType='1'`. Otherwise compares the create-time-of-day to the shift cut-off (`tShiftsWork`) and assigns the date to either the same day or the previous day, with `sTeamType` updated accordingly on `mftproductionreportslave`. + +**Invocation:** Called by procedure `Sp_Calc_sPpr` (生产上报审核 audit handler) — re-derives the slave's vesting date whenever an upstream report is audited. No direct Java caller; no form-master binding. diff --git a/en/docs/auto-catalog/procedures/Sp_CalcCost_BtnEventCalcCost.md b/en/docs/auto-catalog/procedures/Sp_CalcCost_BtnEventCalcCost.md index fb5adde..d11217c 100644 --- a/en/docs/auto-catalog/procedures/Sp_CalcCost_BtnEventCalcCost.md +++ b/en/docs/auto-catalog/procedures/Sp_CalcCost_BtnEventCalcCost.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 业财一体化 / 成本核算 — month-end cost-accounting run. Triggered from the 成本核算 (cost accounting) screen's main 核算 button against one accounting period (`sysaccountperiod`); rolls work-order direct cost, indirect material cost, expense-allocation by cost-centre, and frozen-inventory valuation, then writes back to the order/stock/period tables. + +**What it does:** Parses one `sysaccountperiod.sId` out of `sProInParam`, refuses when the prior period has no `sCalCostPerson` (must close prior period first). Stamps `mftworkordermaster.tFactCountCost = period_end + 1` on every checked order whose `tCreateDate` falls in the period (and on un-finalised carry-over orders). Then performs the cost roll-up via dynamic SQL into `TmpCost`, joins back into `MftWorkOrderSlave`/`CotOrderCostAnalysis`/`EleProductStock`/`PitProductInStoreSlave`, and finally writes `sCalCostPerson`, `tCalCostDate`, `bCost=1` (and related flags) on `sysaccountperiod`. Uses `EleWorkCenter` and `EleCostFrame` counts to scope which work-centres/expense frames apply. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 成本核算 form's 核算 toolbar button names `Sp_CalcCost_BtnEventCalcCost` as the action. Companion procs (`Sp_CalcCost_BtnEventReCalcCost`, `Sp_CalcCost_BtnEventReCalcCost_new`) cover re-run scenarios. diff --git a/en/docs/auto-catalog/procedures/Sp_CalcCost_BtnEventReCalcCost.md b/en/docs/auto-catalog/procedures/Sp_CalcCost_BtnEventReCalcCost.md index 08a3b0a..68c5cc1 100644 --- a/en/docs/auto-catalog/procedures/Sp_CalcCost_BtnEventReCalcCost.md +++ b/en/docs/auto-catalog/procedures/Sp_CalcCost_BtnEventReCalcCost.md @@ -1,7 +1,7 @@ # `Sp_CalcCost_BtnEventReCalcCost` (procedure) -> @author:杨恒林 - @date:20210920 封存 +> @author:杨恒林 + @date:20210920 封存 @describe: 本月未结帐成本核算, “成本核算”界面 调用 @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 业财一体化 / 成本核算 — mid-month re-cost run for an un-closed period, exposed from the 成本核算 (cost accounting) screen for analysts who need refreshed costs before a period is formally closed. Per the COMMENT this body is marked 封存 (sealed/legacy, by 杨恒林 on 2021-09-20) — production now favours `Sp_CalcCost_BtnEventReCalcCost_new`. + +**What it does:** Same JSON-param shape and `sysaccountperiod` lookups as `Sp_CalcCost_BtnEventCalcCost`. Builds dynamic SQL into temporary tables, recomputes per-cost-centre and per-expense-frame allocations against `mftworkordermaster`/`MftWorkOrderSlave`/`CotOrderCostAnalysis`, and updates the running totals — without flipping the period's `bCost` to 1 (i.e., does not finalise the close). Aimed at the case where the period is still open and the user wants to see what costs would look like with currently-checked orders. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — 成本核算 form's 重新核算 (本月未结帐) toolbar button. Replaced by `Sp_CalcCost_BtnEventReCalcCost_new`; verify which is wired before relying on this body. diff --git a/en/docs/auto-catalog/procedures/Sp_CalcCost_BtnEventReCalcCost_new.md b/en/docs/auto-catalog/procedures/Sp_CalcCost_BtnEventReCalcCost_new.md index c4415a3..a4c1d2a 100644 --- a/en/docs/auto-catalog/procedures/Sp_CalcCost_BtnEventReCalcCost_new.md +++ b/en/docs/auto-catalog/procedures/Sp_CalcCost_BtnEventReCalcCost_new.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 业财一体化 / 成本核算 — current rewrite of the mid-month re-cost run, replacing the legacy `Sp_CalcCost_BtnEventReCalcCost` (封存). Invoked from the 成本核算 (cost accounting) screen when an analyst wants to refresh order/product cost for an open accounting period. + +**What it does:** Validates that `sProInParam` carries a `sysaccountperiod.sId`; refuses when (a) the period's `bCalProducts=1` (product-stock cost already done — re-cost not allowed at this stage), or (b) a later period already has `bCost=1` (later month closed, this one mustn't be retroactively recosted). Then re-runs the order-cost roll-up against `mftworkordermaster`/`MftWorkOrderSlave`/`CotOrderCostAnalysis` for the period window. Does not flip `bCost`/`bCalProducts` — strictly recalculates. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — 成本核算 form's "本月未结帐" 重新核算 button. diff --git a/en/docs/auto-catalog/procedures/Sp_CalcPlan_dHour.md b/en/docs/auto-catalog/procedures/Sp_CalcPlan_dHour.md index e0eff0c..74fbf33 100644 --- a/en/docs/auto-catalog/procedures/Sp_CalcPlan_dHour.md +++ b/en/docs/auto-catalog/procedures/Sp_CalcPlan_dHour.md @@ -1,6 +1,6 @@ # `Sp_CalcPlan_dHour` (procedure) -> @author:钱豹 +> @author:钱豹 根据排成Id计算dHour @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 / 排程 — per-plan-row machine-hour calculator (作者: 钱豹). Given one `mftproductionplanslave.sId`, derives the slave row's planned hours and machine-changeover (调机) hours using the machine's adjustable formula (`elemachine.sPlanCapacityId` / `sAdjustableFormulaId`), so the scheduler shows realistic time on each plan row. + +**What it does:** Reads the slave's product/process/machine context from `mftproductionplanslave` joined to `EleMachine`. When an adjustable formula is configured, builds the formula's input tuple (`billSlave,billControl,billProcedure,billMaster,baseProduct` over `mftproductionplanslave,mftworkordercontrol,mftworkorderprocess,eleprocessparam,eleProduct,mftworkorderslave`) and calls `Sp_System_ReplaceField_Detail` to evaluate it, capturing the raw hour, an annotated `sAdjustHour` (formula trace), and a fallback message when the formula errors. Writes back to `mftproductionplanslave.dCalcHour1` and `sAdjustHour`. Returns the cumulative `p_dHour` to the caller. + +**Invocation:** Called by procedure `Sp_Manufacture_InsertMftPlanSlave` (when a plan slave is inserted/refreshed) and `Sp_Manufacture_SetTime` (when plan times are re-derived). No direct Java caller and no form-master binding — strictly a helper inside the scheduling proc family. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_Change.md b/en/docs/auto-catalog/procedures/Sp_Calc_Change.md index 3c9d06b..45a5577 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_Change.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_Change.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 固定资产 / 固定资产变更申请单 — fixed-asset "change" (变更) application: marks an asset-change request as approved (or reverts) on `eptmachinefixedchange`. Used when an asset's attributes (location, custodian, etc.) need to be re-recorded. + +**What it does:** Same shape as `Sp_Calc_about`, but on `eptmachinefixedchange`. Refuses if `sGuid` empty or row `bInvalid=1`. `iFlag=1` sets `bCheck=1, sStatus=1, sCheckPersON=sLoginId, tCheckDate=NOW()`; `iFlag=0` reverses. Scoped by `sBrandsId/sSubsidiaryId`. Sibling of `Sp_Calc_about`, `Sp_Calc_borrow`, `Sp_Calc_clear`. + +**Invocation:** Status: appears orphaned. No caller found in any channel — candidate for maintainer audit. Signature matches the workflow check-hook contract; likely bound only in customer-specific overrides. + +Flag: `sTmpReturn` declared but never assigned — trailing branch is dead (shared with siblings). diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_Product.md b/en/docs/auto-catalog/procedures/Sp_Calc_Product.md index 348c797..0359296 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_Product.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_Product.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础资料 / 产品档案 — finished-product (产品 / `eleproduct`) master check / uncheck. Sets the product-master `bCheck` flag so that a freshly entered product can be referenced by sales/production after sign-off, or reverted for editing. + +**What it does:** Validates `sGuid`. With `iFlag=1`: if a row already has `bCheck=1` at the given `sId`+brand+subsidiary, returns the `sNoCanCheckBybCheck` constant and `sCode=-1`; else `UPDATE eleproduct SET bCheck=1 WHERE sId=sGuid AND sBrandsId AND sSubsidiaryId`. With `iFlag<>1`: symmetric — guards on `bCheck=0` (and curiously reuses the same `sNoCanCheckBybCheck` message, not the `…UnCheck` variant), then sets `bCheck=0`. + +**Invocation:** Status: appears orphaned in this DB instance. No `gdsmodule.sCalcProName`, `gdsmoduleflow`, form-master, or routine-level caller. xly-src lookup finds only the deployment-bundle copy at `script/标版/30100101/Sp_Calc_Product.sql`. Standard `Sp_Calc_*` check-hook signature. + +Flag: the uncheck branch reads `sNoCanCheckBybCheck` instead of `sNoCanCheckBybUnCheck` — likely copy-paste bug, message text will be wrong on the uncheck error path. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_Scrap.md b/en/docs/auto-catalog/procedures/Sp_Calc_Scrap.md index 4f58fa8..7c07c93 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_Scrap.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_Scrap.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 固定资产报废申请单 — fixed-asset (equipment) scrapping-application check / uncheck on `eptmachinefixedscrap`. Approving the application freezes the scrap decision; the actual asset write-off happens in downstream finance procs that read `bCheck=1` rows. + +**What it does:** Validates `sGuid`. Refuses if `eptmachinefixedscrap.bInvalid=b'1'`. With `iFlag=1`: refuses if already checked; sets `bCheck=1`, `sStatus=1`, `sCheckPersON=sLoginId` (sic — column name preserves the typo in the schema), `tCheckDate=NOW()`. With `iFlag=0`: refuses if already unchecked, then clears the same fields. Lightweight — no slave-row or cross-table writes from the audit itself. + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, no form-master, no other procedure caller, no xly-src reference. The `eptmachinefixedscrap` table exists; the audit handler is unwired in this DB instance. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_about.md b/en/docs/auto-catalog/procedures/Sp_Calc_about.md index cf349e5..12e1412 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_about.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_about.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 固定资产 / 固定资产闲置申请单 — fixed-asset "idle" (闲置) application: marks an asset-idle request as approved (or reverts) on `eptmachinefixedsabout`. + +**What it does:** Refuses if `sGuid` is empty or the row is `bInvalid=1` (returns localized `paramsErro`/`sNoCanCheckBybInvalid`). With `iFlag=1`: refuses if already `bCheck=1` else sets `bCheck=1, sStatus=1, sCheckPersON=sLoginId, tCheckDate=NOW()`. With `iFlag=0`: refuses if already `bCheck=0` else clears the same fields. All queries are scoped by `sBrandsId/sSubsidiaryId`. Member of the `Sp_Calc_*` fixed-asset family (sibling of `Sp_Calc_borrow`, `Sp_Calc_Change`, `Sp_Calc_clear`). + +**Invocation:** Status: appears orphaned. No caller found in any channel — `gdsmodule.sCalcProName`/`sSaveProName` family, `gdsmoduleflow`, `gdsconfigformmaster`, other routines, or xly-src grep. The `Sp_Calc_*` signature matches the workflow check-hook contract (`iFlag`, `iTmpCheck`, `sFormGuid`, `sGuid`, ...) but no binding row exists in this DB — candidate for maintainer audit (likely bound only in customer-specific overrides). + +Flag: `sTmpReturn` is declared but never assigned — the trailing `IF sTmpReturn <> ''` branch is dead. Sibling family shares the same dead branch. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_borrow.md b/en/docs/auto-catalog/procedures/Sp_Calc_borrow.md index 9f7d92f..37625a2 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_borrow.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_borrow.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 固定资产 / 固定资产外借申请单 — fixed-asset "borrow / loan out" (外借) application: marks an asset-loan-out request as approved (or reverts) on `eptmachinefixedborrow`. + +**What it does:** Same shape as `Sp_Calc_about`, but on `eptmachinefixedborrow`. Refuses if `sGuid` empty or row `bInvalid=1`. `iFlag=1` checks (refuses if already checked) — sets `bCheck=1, sStatus=1, sCheckPersON=sLoginId, tCheckDate=NOW()`. `iFlag=0` reverses. All queries scoped by `sBrandsId/sSubsidiaryId`. Member of the `Sp_Calc_*` fixed-asset family. + +**Invocation:** Status: appears orphaned. No caller found in any channel (`gdsmodule.sCalcProName`, `gdsmoduleflow`, `gdsconfigformmaster`, other routines, xly-src grep) — candidate for maintainer audit. Signature matches the workflow check-hook contract; likely bound only in customer-specific overrides. + +Flag: `sTmpReturn` declared but never assigned — trailing `IF sTmpReturn <> ''` branch is dead (shared with siblings). diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_clear.md b/en/docs/auto-catalog/procedures/Sp_Calc_clear.md index fe15b4a..d609e9a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_clear.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_clear.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 固定资产 / 固定资产清理申请单 — fixed-asset "clearance / disposal" (清理) application: marks an asset-disposal request as approved (or reverts) on `eptmachinefixedclear`. Used when retiring/scrapping an asset. + +**What it does:** Same shape as `Sp_Calc_about`, but on `eptmachinefixedclear`. Refuses if `sGuid` empty or row `bInvalid=1`. `iFlag=1` sets `bCheck=1, sStatus=1, sCheckPersON=sLoginId, tCheckDate=NOW()`; `iFlag=0` reverses. Scoped by `sBrandsId/sSubsidiaryId`. Sibling of `Sp_Calc_about`, `Sp_Calc_borrow`, `Sp_Calc_Change`. + +**Invocation:** Status: appears orphaned. No caller found in any channel — candidate for maintainer audit. Signature matches the workflow check-hook contract; likely bound only in customer-specific overrides. + +Flag: `sTmpReturn` declared but never assigned — trailing branch is dead (shared with siblings). diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_plateprocessing.md b/en/docs/auto-catalog/procedures/Sp_Calc_plateprocessing.md index 4910751..786f83e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_plateprocessing.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_plateprocessing.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 制造 / 内部加工审核 — internal plate-processing approval: checks/unchecks a `plateprocessing` row and propagates the processed quantity back to the originating `mftworkorderprocess` work-order line so that downstream production reporting reflects the outsourced or in-house plate processing done against the work order. + +**What it does:** Validates `sGuid`; refuses if the bill is `bInvalid=1`. With `iFlag=1`: refuses if already checked (`bCheck=1`); on `mftworkorderprocess` joined to `plateprocessing` by `sSrcSlaveId`, sets `bOutSideComplete=1` and increments `dOutsideProcessQty` by `M.dProcessQty`; then stamps `plateprocessing.bCheck=1, sCheckPerson, tCheckDate`. With `iFlag=0`: symmetric reverse — decrements `dOutsideProcessQty`, sets `bOutSideComplete=0`, clears `bCheck`. Scoped by `sBrandsId/sSubsidiaryId`. + +**Invocation:** Status: appears orphaned in this DB instance. No `gdsmodule.sCalcProName`, `gdsmoduleflow`, form-master, or routine-level caller. xly-src lookup finds only the deployment-bundle copy at `script/标版/30100101/Sp_Calc_plateprocessing.sql`. Standard `Sp_Calc_*` check-hook signature — likely bound from a customer-specific module override. + +Flag: variable named `iCount` is referenced in the `iFlag=1` branch (`IF iCount > 0 THEN`) but the local declaration is `p_iCount` — the IF reads an undefined/session variable, so the "already checked" guard never fires in that branch. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_pruOrderBgd.md b/en/docs/auto-catalog/procedures/Sp_Calc_pruOrderBgd.md index 28e6cb5..5f703be 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_pruOrderBgd.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_pruOrderBgd.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 → 采购单据 → 采购变更 — purchase-order change-document check: approves a `purpurchaseorderchangemaster` row, marks the underlying purchase order as changed, and re-runs the order's quantity-recalc (`Sp_Calc_sPod`) so order-level fulfilment math stays consistent with the change. + +**What it does:** Validates `sGuid`. Refuses if `salsalesorderchangemaster.bCheck=1` for the same `sId` (cross-document guard against a stale sales-order-change record). Reads `sChaseOrderId/sChaseOrderNo` from `purpurchaseorderchangemaster`; if there is a chased PO, sets `purpurchaseordermaster.bChange=1` and calls `Sp_Calc_sPod(0, 2, sFormId, sChaseOrderId, sLoginId, ...)` — if that returns `sCode<0`, propagates the failure prefixed with `purchase:`. Finally stamps `purpurchaseorderchangemaster.bCheck=1, sCheckPerson, tCheckDate=NOW()`. + +**Invocation:** Bound to `gdsmodule.sProcName` on module `采购变更` (sId `101251240115016233275096110`) under 采购管理 → 采购单据. Dispatched via the front-end's "审核" button on that module's master form. xly-src has deployment-bundle copies under `script/标版/`. + +Flag: only handles the check path (`iFlag` parameter is read but the body never branches on it) — uncheck is missing entirely. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sAcc.md b/en/docs/auto-catalog/procedures/Sp_Calc_sAcc.md index 714845f..f80d682 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sAcc.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sAcc.md @@ -1,7 +1,7 @@ # `Sp_Calc_sAcc` (procedure) -> @author:zhucx - @date:2021.11.29 +> @author:zhucx + @date:2021.11.29 @describe: 质量管理-质量事故报告-审核 @@ -29,4 +29,13 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产单据 → 质量事故报告 — quality-incident report check / uncheck on `mftqualityaccidentMaster` (with slave `mftqualityaccidentslave`). Approves a manufacturing-quality incident write-up, posts the result into KPI tracking, and feeds the unqualified-product report. + +**What it does:** Validates `sGuid` and `SysLocking` (concurrent edit guard). Reads master `bInvalid`, `tCreateDate`, `sSrctype`. Refuses if invalid or if the row's create date falls outside the accounting period (when `SysSystemSettings.CkxIntervalMonthModifyBill=0`, checks `sysaccountperiod.bFrozen`). With `iFlag=1`: refuses if already checked; if `SysSystemSettings.CkxDefineCheck=1` and `iTmpCheck<>1`, runs slave-row replace-field cursor and `Sp_System_CheckFlow` workflow start; then sets master `bCheck=1` and writes a `kpidetail` row plus an update to `qlyunqualifiedreportmaster`. Calls `Sp_Bill_Used`. With `iFlag=0`: symmetric uncheck. + +**Invocation:** Bound to `gdsmodule.sProcName` on: +- `质量事故报告` (sId `101251240115015934849804300`) — 生产管理 → 生产单据 +- `设备异常单` (sId `101251240115016045682733390`) — 生产管理 → 生产单据 (reuses this proc despite the YC-suffixed variant existing) +- `01/01 新增质量事故报告` (sId `11811781131121915261093794470`) — KPI流程操作菜单 → 质量管理流程 + +Flag: `设备异常单` (equipment-abnormal) is wired to `Sp_Calc_sAcc` rather than the dedicated `Sp_Calc_sAcc_YC` — likely intentional fallback, but the YC variant targets `mftqualityaccidenteqp*` not `mftqualityaccident*`, so this module's writes land in the general accident table. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sAcc_YC.md b/en/docs/auto-catalog/procedures/Sp_Calc_sAcc_YC.md index b10a8ff..497673a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sAcc_YC.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sAcc_YC.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产单据 → 质量事故报告 (equipment variant) — equipment-specific quality-accident report check / uncheck. Targets `mftqualityaccidenteqpmaster` (note the `eqp` table suffix), distinct from the general `mftqualityaccidentmaster` handled by sibling `Sp_Calc_sAcc`. + +**What it does:** Validates `sGuid`. Reads master `bInvalid, tCreateDate`. Refuses if `bInvalid=1`. Period-locking via `SysSystemSettings.CkxIntervalMonthModifyBill=0 → sysaccountperiod.bFrozen` (same as sibling). With `iFlag=1`: refuses if already checked; counts attached `filfilemanage` images for the bill (the count is stored in `p_iImageCount` but never read — preparatory hook for an image-required guard); then sets master `bCheck=1, sStatus=1, sCheckPerson=sLoginId, tCheckDate=NOW()`. With `iFlag=0`: symmetric uncheck guarded on `bCheck=0` (returns `sNoCanCheckBybUnCheck`). + +**Invocation:** Status: appears orphaned in this DB instance. No `gdsmodule.sProcName/sCalcProName`, form-master, routine, or xly-src caller. The matching `设备异常单` module (sId `101251240115016045682733390`) is bound to `Sp_Calc_sAcc` instead — `Sp_Calc_sAcc_YC` looks intended for that module but is not currently wired up. Candidate for maintainer audit. + +Flag: image-count read with no consuming branch — dead-code or unfinished image-requirement gate. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sAcod.md b/en/docs/auto-catalog/procedures/Sp_Calc_sAcod.md index 6332e7f..8f6db67 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sAcod.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sAcod.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 / 客户档案 — 客户框架协议 (customer framework agreement / accord) check / uncheck on `elecustomeraccord`. Approves a multi-period sales-pricing-or-volume agreement with a customer so it can act as a price/discount baseline downstream. + +**What it does:** Validates `sGuid`. With `iFlag=1`: refuses if already `bCheck=1` (returns `sNoCanCheckBybCheck`); else sets `bCheck=1, sStatus=1, sCheckPerson=sLoginId, tCheckDate=NOW()`. With `iFlag<>1`: guards on `bCheck=0` then clears the four fields. Scoped by `sBrandsId/sSubsidiaryId`. No accounting-period or invalid-flag guard. + +**Invocation:** Status: appears orphaned. No caller found in any channel (gdsmodule hooks, gdsmoduleflow, form-master, other routines, xly-src grep) — candidate for maintainer audit. Standard `Sp_Calc_*` check-hook signature; likely bound only in customer-specific overrides. + +Flag: uncheck branch reuses `sNoCanCheckBybCheck` instead of `sNoCanCheckBybUnCheck` — same copy-paste bug as `Sp_Calc_Product`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sAsq.md b/en/docs/auto-catalog/procedures/Sp_Calc_sAsq.md index 58fde64..54f01cd 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sAsq.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sAsq.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售单据 → 销售品质异常单据 — sales quality-abnormal report check / uncheck on `salqualityabnormalmaster`. Approves a customer-side quality-complaint write-up. + +**What it does:** Validates `sGuid`. Reads master `sBillNo, sCustomerId, sSalesManId, tCreateDate, sMakePerson, bInvalid`. Refuses if `bInvalid=1`. With `iFlag=1`: refuses if already `bCheck=1`; sets `bCheck=1, sStatus=1, sCheckPerson=sLoginId, tCheckDate=NOW()`. With `iFlag=0`: symmetric uncheck (returns `sNoCanCheckBybUnCheck` on `bCheck=0` row). Scoped by `sBrandsId/sSubsidiaryId`. + +**Invocation:** Bound to `gdsmodule.sProcName` on `销售品质异常单据` (sId `15888249530003323555072594268700`) under 销售管理 → 销售单据. Dispatched via the front-end "审核 / 反审核" button on that module's master form. xly-src deployment-bundle copies under `script/标版/`. + +Flag: the leading variable declarations (`sCustomerGuid`, `sBillNo`, `sSaleManGuid`, etc.) are populated by SELECT INTO but never used — vestigial code left after a refactor that stripped the side-effect logic. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sBBProcess.md b/en/docs/auto-catalog/procedures/Sp_Calc_sBBProcess.md index 48f968f..1bad6a6 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sBBProcess.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sBBProcess.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 补版任务 (re-plate / patch-plate outsourced process) — audit / un-audit hook on `mftoutprocessmaster`. A 补版任务 is a small outsourced rework job (typically when a printing plate needs partial re-engraving); this routine flips its check state. + +**What it does:** Validates `sGuid`. With `iFlag=1`: refuses if the row is already `bCheck=1`, otherwise sets `mftoutprocessmaster.bCheck=1`, `sStatus=1`, `sCheckPerson=sLoginId`, `tCheckDate=NOW()`. With `iFlag=0`: symmetric uncheck — refuses if already unchecked, then clears the same fields. Lightweight: no slave-row posting, no cross-table writes. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName/sSaveProName/sDeleteProName/sSaveProNameBefore` binding, no `gdsconfigformmaster` reference, no other procedure or function calls it, no xly-src hit. The proc comment `补版任务` plus the standard `Sp_Calc_s*` audit signature suggests it was authored for a planned 补版任务 module that either ships disabled or is wired only at a customer site not represented in this DB instance. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sBac.md b/en/docs/auto-catalog/procedures/Sp_Calc_sBac.md index 4fd0fdb..cbdaa51 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sBac.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sBac.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 预算管理 / 预算调整审批 — budget-adjustment check / uncheck on `budgetAdjustmentCheckMaster`. On approval, posts each slave-row adjustment amount (`dMaterialsMoney`) into the right monthly column of the target department-budget row (`departmentalBudgetslave.dBudget`) plus the yearly `dSumBudget`. + +**What it does:** Validates `sGuid`. Reads `tCreateDate` (for year/month derivation), `sMasterDepartId`, and `bInvalid` from `budgetAdjustmentCheckMaster`; refuses if invalid. With `iFlag=1`: refuses if already checked. Resolves the bill's year/month via `DATE_FORMAT(tCreateDate, '%Y'/'%m')`. Then, on each of the twelve `ELSEIF p_sMonth='01'..='12'` branches, runs `UPDATE departmentalBudgetslave B JOIN budgetadjustmentcheckslave A ON A.sAfterExpenseDetailId=B.sExpenseDetailId JOIN departmentalbudgetmaster C ON B.sParentId=C.sId SET B.dBudget = B.dBudget + A.dMaterialsMoney WHERE A.sParentId=sGuid AND C.sDepartId=p_sMasterDepartId AND C.sYear=p_sYear AND C.bCheck=1`. Finally bumps `dSumBudget` and `budgetmaster` totals for adjustment types 1 or 2; reverses on uncheck (not shown in fragment). + +**Invocation:** Status: appears orphaned in this DB instance. No `gdsmodule.sProcName/sCalcProName`, form-master, routine, or xly-src caller. Likely bound from a customer-specific budget-management module override (the budget tables suggest a customised 部门预算 module). Standard `Sp_Calc_*` check-hook signature. + +Flag: per-month dispatch is a 12-way ELSEIF chain — fragile if the bill's `tCreateDate` month differs from the budget month the adjustment is *for*; the proc uses the create-date month rather than a dedicated `iAdjustmentMonth` column. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sBgd.md b/en/docs/auto-catalog/procedures/Sp_Calc_sBgd.md index ba8a0ee..b470768 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sBgd.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sBgd.md @@ -27,4 +27,12 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产单据 → 工艺变更单 — process-change-order check / uncheck on `mftprocesschangemaster`. Approves a 工艺变更 (manufacturing-process change) and back-writes the change into the affected work-orders' BOM, process, slave, and control rows, then refreshes standardized data via the `Sp_WorkOrder_CalcData*Std` helpers. + +**What it does:** Validates `sGuid` and re-checks. With `iFlag=1`: refuses if already checked; loads `sWorkOrderId`, `sWorkOrderNo`, `bPlanFrozen`, `bPlanMaterialCheck`, `bCheckWork`, `iChangeType` from the master, then `UPDATE`s `mftworkordermaster`, `mftworkorderslave`, `mftworkorderprocess`, `mftworkordermaterials`, `mftworkordercontrol` to apply the change. Calls `Sp_Calc_sWod`, `Sp_WorkOrder_CalcDataStd`, `Sp_WorkOrder_CalcDataBookStd`, `Sp_WorkOrder_CalcDataSetStd`, `Sp_WorkOrder_CalcDataPackStd` to recompute derived totals, then sets `mftprocesschangemaster.bCheck=1`. With `iFlag=0`: symmetric uncheck. + +**Invocation:** Bound to `gdsmodule.sProcName` on: +- `工艺变更单` (sId `101251240115016062111323530`) — 生产管理 → 生产单据 +- `功能模块界面设置单据` (sId `16411004790004762980820285096000`) — 开发平台 (developer-platform overlay; not normally seen by end users) + +xly-src has a `客户/千彩/Sp_Calc_sBgd.sql` customer-specific override of this proc — verify which one is currently deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sBis.md b/en/docs/auto-catalog/procedures/Sp_Calc_sBis.md index d6b9e89..4d0fd5c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sBis.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sBis.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 工艺变更单 — alternative check / uncheck handler on `mftprocesschangemaster`. Same master table as `Sp_Calc_sBgd` but posts the change cost back into 报价单 and 质量事故 totals (`dSReserve3`) rather than into the work-order BOM. + +**What it does:** Validates `sGuid`. With `iFlag=1`: refuses if already checked; sets master `bCheck=1`, `sStatus=1`, `sCheckPerson=sLoginId`, `tCheckDate=tCheckTime`. Then sums `mftprocesschangematerials.dMaterialsMoney` and `mftprocesschangeprocess.dProcessMoney` grouped by `sSrcId`, joining onto `quoquotationslave A` (matched by `sParentId=sSrcId`) to bump `A.dSReserve3` by the change cost. Body fragment then continues to update `mftqualityaccidentMaster` similarly. Uncheck path (`iFlag=0`) reverses. + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, no form-master, no other procedure caller, no xly-src reference. Sibling proc `Sp_Calc_sBgd` is bound to the 工艺变更单 module; this `Sp_Calc_sBis` variant exists alongside it but is unwired. Candidate for maintainer audit — likely a quotation-flavoured fork of the same audit kept for legacy/future toggle. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sCcp.md b/en/docs/auto-catalog/procedures/Sp_Calc_sCcp.md index f4211e6..8b41613 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sCcp.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sCcp.md @@ -27,4 +27,12 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量管理 → 质量管理单据 → 内部质量投诉单据 — internal-quality-complaint check / uncheck on `ComComplaint`. Approves an internal complaint write-up (defect / process / supplier issue raised by a downstream department) so it appears in quality dashboards. + +**What it does:** Validates `sGuid`. Reads `ComComplaint.bInvalid`; refuses if invalid. With `iFlag=1`: refuses if already checked, otherwise sets master `bCheck=1`, `sCheckPerson=sLoginId`, `tCheckDate=tCheckTime`, `sStatus=1`. With `iFlag=0`: refuses if already unchecked, then clears the same fields. + +**Invocation:** Bound to `gdsmodule.sProcName` on: +- `内部质量投诉单据` (sId `15831246720003184823218709145600`) — 质量管理 → 质量管理单据 +- `文件管理列表` (sId `101251240115016170698509870`) — 人事行政 → 文件管理 (reuses this proc as its check hook — likely an unintentional copy-paste; the file-management module's audit shouldn't normally touch `ComComplaint`) + +Flag: the `文件管理列表` binding is suspect — operating on `ComComplaint` from a 文件管理 menu makes no business sense. Verify with the maintainer. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sCio.md b/en/docs/auto-catalog/procedures/Sp_Calc_sCio.md index 2aa9473..e55627c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sCio.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sCio.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 产品管理 → 客户档案管理 → 客户信息 — customer-master check / uncheck on `elecustomer`. Approving a customer record flips its `bCheck=1` so it becomes selectable in sales/delivery documents, and back-fills the projected payment-receivable dates (`tGetPayDate`) on any open invoices using that customer's payment-term setup. + +**What it does:** Validates `sGuid`. With `iFlag=1`: refuses if already checked; sets `elecustomer.bCheck=1`, `sStatus=1`, `sCheckPerson=sLoginId`, `tCheckDate=NOW()`. Then runs `UPDATE SalSalesInvoiceMaster A JOIN salsalesinvoiceslave D ON A.sId=D.sParentId JOIN elecustomer B JOIN sispayment C ON B.sGetPayId=C.sId SET A.tGetPayDate = DATE_ADD(A.tInvoiceDate, INTERVAL C.iAfterDeliverDay DAY)` for the just-checked customer where the invoice still has unreceived amount. Uncheck (`iFlag=0`) reverses the master flags only. + +**Invocation:** Bound to `gdsmodule.sProcName` on: +- `客户信息` (sId `192116810111915048607109671`) — 产品管理 → 客户档案管理 +- `客户报备信息单据` (sId `101251240115015977193229000`) — 销售管理 → 销售单据 (customer-registration / 客户报备 flow reuses this audit since it ultimately writes back into `elecustomer`) diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sCldApply.md b/en/docs/auto-catalog/procedures/Sp_Calc_sCldApply.md index c9023ce..0a8c25d 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sCldApply.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sCldApply.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 子产品领用申请 — child-product (kit-component) requisition-form check / uncheck on `salchildproductapplymaster`. When sales need to draw a sub-item from inventory against a parent product order, this audit approves the request so the delivery-notify / 送货 pipeline can fulfill it. + +**What it does:** Validates `sGuid` and `SysLocking` (concurrent edit guard). Reads `SysSystemSettings.CbxDeliverGoodsNotify` to pick the delivery source (`sDeliverType`, default `salesorder`). Reads master `bInvalid`; refuses if invalid. With `iFlag=1`: refuses if already checked, then writes master `bCheck=1` and walks the slave rows to deduct from stock / append to the chosen 送货 source (full body continues with cursor logic, replace-field check-flow, and stock posting). With `iFlag=0`: symmetric uncheck. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName/sSaveProName/sDeleteProName/sSaveProNameBefore` binding, no `gdsconfigformmaster` reference, no other procedure or function calls it, no xly-src hit. The 子产品领用申请 module exists in the schema (`salchildproductapplymaster`) but its audit handler is unwired in this DB instance. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sClfbx.md b/en/docs/auto-catalog/procedures/Sp_Calc_sClfbx.md index 0049c60..fe100ce 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sClfbx.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sClfbx.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 差旅费用报销 — travel-expense-reimbursement check / uncheck on `travelExpenseApplyMaster`. An employee files a 差旅费报销 application and finance/manager approval flips its check state. + +**What it does:** Validates `sGuid`. Reads master `bInvalid`, `tCreateDate`; refuses if invalid. Enforces the accounting-period freeze guard: when `SysSystemSettings.CkxIntervalMonthModifyBill=0`, checks `sysaccountperiod.bFrozen` for the row's `tCreateDate` and refuses if the period is frozen. With `iFlag=1`: refuses if already checked, otherwise sets master `bCheck=1` (and the rest of the body posts the reimbursement amount into the expense-accounting ledger). With `iFlag=0`: symmetric uncheck. + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, no form-master, no other procedure caller, no xly-src reference. The `travelExpenseApplyMaster` table exists; the audit handler is unwired in this DB instance. Candidate for maintainer audit — likely the 差旅费报销 module was authored but not deployed to default modules. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sCmt.md b/en/docs/auto-catalog/procedures/Sp_Calc_sCmt.md index 8bd68ea..ef52f04 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sCmt.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sCmt.md @@ -1,8 +1,8 @@ # `Sp_Calc_sCmt` (procedure) -> @author:zhucx - @date:2021.11.21 封存 - @describe: +> @author:zhucx + @date:2021.11.21 封存 + @describe: 1.移动端-来料检验-保存自动调用本过程,当系统设定中本单据为自动审核时 @@ -30,4 +30,11 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量管理 → 质量管理单据 → 材料检验单据 — incoming-materials-inspection check / uncheck on `qlycomematerialstestmaster`. Auditing a 来料检验 (incoming-material inspection) row freezes the inspection result and (per the proc's banner comment) is also auto-invoked from the mobile-side save path when the system setting marks the form as 自动审核. + +**What it does:** Validates `sGuid` and `SysLocking` (concurrent edit guard). Reads master `sBillNo`, `bInvalid`, `tCreateDate`; refuses if invalid. With `iFlag=1`: refuses if already checked; the (currently commented-out, dated 2023-06-25) `PurPurchaseOrderSlave` back-write block accumulated tested / sample qty totals back onto the purchase-order slave — kept around for rollback but disabled. Then sets master `bCheck=1`. With `iFlag=0`: symmetric uncheck. + +**Invocation:** Bound to `gdsmodule.sProcName` on: +- `材料检验单据` (sId `15827054010002527067474512475000`) — 质量管理 → 质量管理单据 +- `库存检验` (sId `101251240115016105078918480`) — 质量管理 → 质量管理单据 +- `材料检验(mobile单据)` (sId `12012615914116374731613080`) — 现场 (mobile front-end of the same audit) diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sCno.md b/en/docs/auto-catalog/procedures/Sp_Calc_sCno.md index 9e58eb7..c902f6a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sCno.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sCno.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 客户审核 — alternative customer-audit check / uncheck on `elenewcustomer`. Variant of the customer-master audit that targets the 新客户 (new-customer-application) staging table rather than the live `elecustomer` table; approval also runs the `SysSystemSettings.CkxDefineCheck=1` replace-field cursor over `SalSalesOrderSlave` to fold customer-derived defaults into open sales orders. + +**What it does:** Validates `sGuid`. Reads `SysSystemSettings.CkxDefineCheck`. With `iFlag=1`: refuses if `elenewcustomer.bCheck=1`; when `CkxDefineCheck=1` and `iTmpCheck<>1`, opens a cursor over `SalSalesOrderSlave JOIN salsalesordermaster JOIN eleproduct` keyed on the customer's open orders, then loops applying replace-field substitutions per slave. Finally sets master `bCheck=1` (continued in untruncated body). With `iFlag=0`: symmetric uncheck. + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, no form-master, no other procedure caller, no xly-src reference. The `elenewcustomer` table exists but the audit handler is unwired — sibling `Sp_Calc_sCio` is the bound 客户信息 audit. Candidate for maintainer audit; likely a deprecated alternate of the customer-approval workflow. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sCoach.md b/en/docs/auto-catalog/procedures/Sp_Calc_sCoach.md index c79fe40..d5f7dfd 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sCoach.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sCoach.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 产品指导价 (material guide-price update) — check / uncheck on `elematerialscoachmaster`. Approving a 指导价 (guide-price) batch posts the new prices back into `elematerials.dGuidePrice` so later quotation / BOM lookups pick them up. + +**What it does:** Validates `sGuid`. With `iFlag=1`: refuses if already checked; sets `elematerialscoachmaster.bCheck=1`, `sStatus=1`, `sCheckPerson=sLoginId`, `tCheckDate=NOW()`. Then runs `UPDATE elematerials A INNER JOIN elematerialscoachslave B ON A.sId=B.sMaterialsId SET A.dGuidePrice=B.dNewPrice WHERE B.sParentId=sGuid` — sweeping the new prices onto the live material rows. With `iFlag=0`: clears the master flags (does not roll back the dGuidePrice writes — flagged below). + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, no form-master, no other procedure caller, no xly-src reference. The `elematerialscoach*` tables exist; the audit handler is unwired in this DB instance. Candidate for maintainer audit. + +Flag: the uncheck branch does not reverse the `elematerials.dGuidePrice` overwrite — once a guide-price batch is checked, the price change sticks even if the batch is later un-audited. Maintainer should confirm this is intended. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sCps.md b/en/docs/auto-catalog/procedures/Sp_Calc_sCps.md index a2f6724..3f69a7e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sCps.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sCps.md @@ -27,4 +27,13 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 费用录入 (department-expense entry) — check / uncheck on `accexpenseentrydepartmentmaster`. Approves a department-expense ledger entry; on approval, refreshes the `sFrameType` lookup from `elecostframe` so the row is correctly bucketed for cost-rollup. Used both as an interactive audit and as a server-side helper invoked by the cost-closing / material-confirm workflows. + +**What it does:** Validates `sGuid`. Reads master `bInvalid`; refuses if invalid. With `iFlag=1`: refuses if already checked; runs `UPDATE accexpenseentrydepartmentmaster A INNER JOIN elecostframe B ON A.sExpenseeId=B.sId SET A.sFrameType=B.sFrameType`, then sets `bCheck=1`, `sCheckPerson=sLoginId`, `tCheckDate=tCheckTime`. With `iFlag=0`: refuses if already unchecked, then clears the same fields. + +**Invocation:** Called by other stored procedures during the cost-closing / 生产领料确认 pipeline (verified via routine-definition grep): +- `Sp_BtnEventProductionmaterialSure_New` — fires this audit when 生产领料确认 (production-material-issue confirm) detects new expense rows. +- `Sp_financialClosing_BtnEventCalcCost_New` — invoked from the cost-checking pass before month-end close. +- `Sp_financialClosing_BtnEventExpense` — invoked from the expense-closing pass. + +All three callers pass `iFlag='1', iTmpCheck='0', sFormGuid='101801153119616595200652250'` and `sMakePerson` in {`'系统插入'`, `'检查插入'`}. No direct `gdsmodule` button binding — this audit is a back-end utility, not a user-clicked one. Customer-override file `script/标版/20250616/Sp_Calc_sCps_ftfydr.sql` exists alongside the standard `optimize/Sp_Calc_sCps.sql` — verify which is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sCut.md b/en/docs/auto-catalog/procedures/Sp_Calc_sCut.md index a9eda30..54db9e1 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sCut.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sCut.md @@ -27,4 +27,12 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料库 → 材料库单据 → 物料转换单据 — material-cut / material-conversion check / uncheck on `MitMaterialsCutMaster`. A 物料转换 turns one stocked material (e.g. a large parent sheet/roll) into one or more child materials; auditing the doc posts the conversion into the materials-store ledger and refreshes the linked work-order BOM. Same proc is reused by `材料转换(入)` (the inbound-side conversion view). + +**What it does:** Validates `sGuid`. With `iFlag=1`: refuses if already checked; updates the `MitMaterialsCutMaster` audit flags, runs `Update MftWorkOrderMaterials` / `Update MitMaterialsStore` to apply the conversion against the affected work-order BOM and store rows, then `INSERT INTO EleMaterialsStock` / `UPDATE EleMaterialsStock` posts the stock movement, and `CALL Sp_calc_materialsstoreLimit` re-checks per-location stock limits. With `iFlag=0`: symmetric uncheck reverses each step. + +**Invocation:** Bound to `gdsmodule.sProcName` on: +- `物料转换单据` (sId `101251168116315839165634020`) — 材料库 → 材料库单据 +- `材料转换(入)` (sId `986502008721788802615003001`) — 通用常量 → 常用设置 → 销售管理 (inbound conversion view; same audit serves both directions) + +xly-src ships `script/标版/30100101/Sp_Check_sCut.sql` as a pre-audit validator that pairs with this proc. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sCut333.md b/en/docs/auto-catalog/procedures/Sp_Calc_sCut333.md index c9014b1..ff29dd9 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sCut333.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sCut333.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / experimental variant of `Sp_Calc_sCut` (the 物料转换单据 audit on `MitMaterialsCutMaster`). The `333` suffix tags it as a sandboxed copy; same opening boilerplate as `Sp_Calc_sCut`, with a workflow hook (`CALL Sp_System_CheckFlow`) added that the production proc does not have. + +**What it does:** Same as `Sp_Calc_sCut`: validates `sGuid`, on `iFlag=1` updates `MitMaterialsCutMaster`, `MitMaterialsStore`, `MftWorkOrderMaterials`, posts to `EleMaterialsStock`; additionally calls `Sp_System_CheckFlow` for OA/approval-flow start. The body opens with the same commented-out `SAVEPOINT sCut` block and the same `@author:zhucaixi 2012-12-28` legacy comment as the parent proc. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName/sSaveProName/sDeleteProName/sSaveProNameBefore` binding, no `gdsconfigformmaster` reference, no other procedure or function calls it, no xly-src reference. The `333` suffix and the duplicated body confirm this is an internal A/B / staging copy of the live `Sp_Calc_sCut` audit — not expected to be called from production. Candidate for maintainer audit / deletion. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sDYDgd.md b/en/docs/auto-catalog/procedures/Sp_Calc_sDYDgd.md index 8e2ac23..80de358 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sDYDgd.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sDYDgd.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售送货流程 — variant 送货单 (delivery-note) audit on `SalDeliverGoodsMaster`. Functionally a near-duplicate of `Sp_Calc_sDgd` (the production 送货单 hook): same approval/uncheck mechanism that deducts finished-product stock, back-writes delivered qty into the upstream sales-order / work-order / outside-in-store / reject slaves, and stamps the bill as used. The `sDYDgd` name suffix suggests a customer- or feature-specific (大袋 / 单一货单?) cut of `sDgd` kept around as an alternate hook. + +**What it does:** Validates `sGuid`, refuses when invalid, checks `sysaccountperiod.bFrozen` per `SysSystemSettings.CkxIntervalMonthModifyBill`. On `iFlag=1`: runs the per-slave `Sp_System_CheckFlow` audit-workflow loop, `Update SalSalesOrderSlave` (delivered qty), `Update MftWorkOrderMaster/Slave`, `Update SalRejectGoodsSlave`, `Update mftproductionplan`, `Update PitProductStoreVirtual`; calls `Sp_System_AutoMaterialsPriceSingle` (auto-price), `Sp_ProductStoreVirtual`, `SP_Inventory_ProductCalcQty`; finally `CALL Sp_Bill_Used`. Symmetric uncheck on `iFlag=0`. + +**Invocation:** Status: dormant — no live `gdsmodule.sProcName` binding, no other-routine CALLs, no Java reference. Ships as `xly-src/script/标版/30100101/Sp_Calc_sDYDgd.sql` install script, suggesting the proc is deployed but its module hook is wired only in customer-specific overrides. Candidate for maintainer audit — confirm whether it duplicates `Sp_Calc_sDgd` or supersedes it for a specific 客户 / 表单. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sDesign.md b/en/docs/auto-catalog/procedures/Sp_Calc_sDesign.md index 9220f31..f145bd7 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sDesign.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sDesign.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 设计排版单 (design / layout-imposition document) — check / uncheck on `salsalesdesignmaster`. Approves a 设计排版单 (the pre-press design / layout artifact for a sales order) so production planning can pick it up. + +**What it does:** Validates `sGuid` and `SysLocking` (refuses if the doc is being edited). With `iFlag=1`: refuses if `salsalesdesignmaster.bCheck=1`; sets `bCheck=1`, `sStatus=1`, `sCheckPerson=sLoginId`, `tCheckDate=NOW()`. With `iFlag=0`: refuses if already unchecked, then clears the same fields. Standard lightweight `Sp_Calc_s*` audit — no slave-row posting in the visible body. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName/sSaveProName/sDeleteProName/sSaveProNameBefore` binding, no `gdsconfigformmaster` reference, no other procedure or function calls it, no xly-src reference. The `salsalesdesignmaster` table exists; the audit handler is unwired in this DB instance. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sDevApply.md b/en/docs/auto-catalog/procedures/Sp_Calc_sDevApply.md index 176c31c..094e907 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sDevApply.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sDevApply.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 研发申请单 (R&D / new-product development application) — check / uncheck audit. Approves an internal request to create a new product spec (customer, new product GUID, customer-product-no, salesman) so it flows into the product master / pre-sales pipeline; reads `SysSystemSettings.CbxDeliverGoods` to pick the delivery-source default for downstream auto-creation. + +**What it does:** Validates `sGuid` and `SysLocking`. Reads `SysSystemSettings.CbxDeliverGoods` → `sDeliverSrc`. Loads master fields (`sBillNo`, `sCustomerId`, `sCustomerNo`, `sCustomerName`, `sSalesManId`, `tCreateDate`, `sMakePerson`, `bInvalid`) joined with `elecustomer`; refuses if `bInvalid=1`. With `iFlag=1`: refuses if already checked, then runs the new-product creation / sample-order branch (full body posts into `eleproduct`, salesman log, and the chosen delivery source). With `iFlag=0`: symmetric uncheck. + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, no form-master, no other procedure caller, no xly-src reference (only the proc's own source / optimize copies). The 研发申请 (R&D request) module exists in source but the audit handler is unwired in this DB instance. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sDgd.md b/en/docs/auto-catalog/procedures/Sp_Calc_sDgd.md index bab9748..5795263 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sDgd.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sDgd.md @@ -27,4 +27,13 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售送货流程 → 送货单 — sales-delivery-note check / uncheck on `saldelivergoodsmaster`. The 送货单 audit is the central post-shipment trigger: on approval it deducts finished-product stock, posts the movement to `MitMaterialsStore`/`EleMaterialsStock`, back-writes the delivered qty into the upstream sales-order / work-order / outside-in-store / reject slaves, and marks the bill as used in `Sp_Bill_Used`. Same proc serves the desktop 送货单, the mobile 扫码送货 form, and the 材料送货 (material delivery) variant — and is invoked downstream by sales-return audits to reverse a delivery. + +**What it does:** Validates `sGuid`. Loads `tCreateDate`, `bInvalid`, customer fields; refuses if `bInvalid=1`; checks `sysaccountperiod.bFrozen` per `SysSystemSettings.CkxIntervalMonthModifyBill`. With `iFlag=1`: refuses if already checked; opens cursors over the slave rows to `Update SalSalesOrderSlave` (delivered qty), `Update MftWorkOrderSlave`, `Update OpsOutsideInStoreSlave`, `Update PitProductInStoreSlave`, `Update PitProductStoreVirtual`, `Update SalRejectGoodsSlave`; `INSERT INTO MitMaterialsStore` posts the movement; `CALL Sp_calc_materialsstoreLimit` / `Sp_calc_productstoreLimit` re-check stock limits; finally `CALL Sp_Bill_Used` registers consumption. With `iFlag=0`: symmetric uncheck reverses each step. + +**Invocation:** Bound to `gdsmodule.sProcName` on: +- `送货单单据` (sId `11811781131121915179924491520`) — 销售管理 → 销售送货流程 +- `扫码送货(单据)` (sId `101251240115015959853077870`) — 现场 (mobile scan-deliver) +- `材料送货单` (sId `101251240115016140459724020`) — 成品库 → 成品库单据 + +Also invoked by other stored procedures: `Sp_Calc_sRct`, `Sp_Calc_sRct_copy1`, `Sp_Calc_sRcts` (sales-return audits that reverse a delivery), and `Sp_Sis_CopeEventList` (event-replay helper). xly-src `xlyBusinessService/.../BusinessBaseServiceImpl.java` line ~3047 contains a *commented-out* `Sp_Calc_sDgd` special-case for `partyId`-routing — currently inactive but kept around as a placeholder. xly-src also ships `script/客户/千彩/Sp_Calc_sDgd.sql` (customer-specific override) and `script/标版/upgrade/20220126-2861-仓库冻结后...` (warehouse-freeze restriction patch) — verify which is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sDgdCL.md b/en/docs/auto-catalog/procedures/Sp_Calc_sDgdCL.md index c494fb7..c8993e1 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sDgdCL.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sDgdCL.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 送货单 (material variant) — material-side delivery-note check / uncheck on `saldelivergoodsmaster`. Per the proc comment `送货单材料,不是按照从从表` ("delivery-doc material, not via the slave-of-slave"), this variant deducts stock from the material-side slave directly rather than walking through the grandchild slave-of-slave the standard `Sp_Calc_sDgd` uses. Pattern matches a customer-specific deployment that delivers raw materials (cailiao, suffix `CL`) instead of finished products. + +**What it does:** Same envelope as `Sp_Calc_sDgd`: validates `sGuid`, reads `bInvalid` / `tCreateDate`, checks accounting-period freeze, runs the audit branches. On `iFlag=1`: updates `saldelivergoodsmaster`, then back-writes into `SalSalesOrderSlave`, `MftWorkOrderSlave`/`mftworkordermaster`, `mftproductionplan`/`mftproductionplanslave`, `OpsOutsideInStoreSlave`, `PitProductInStoreSlave`, `PitProductStoreVirtual`, `SalDeliverNotifySlave`, `SalRejectGoodsSlave`; `INSERT INTO MitMaterialsStore` / `EleMaterialsStock` / `UPDATE EleProductStock`; `CALL Sp_Bill_Used`, `Sp_calc_materialsstoreLimit`, `Sp_calc_productstoreLimit`, `Sp_System_AutoMaterialsPriceSingle`. Symmetric uncheck. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName/sSaveProName/sDeleteProName/sSaveProNameBefore` binding, no `gdsconfigformmaster` reference, no other procedure or function calls it, no xly-src reference. The standard 送货单 module uses `Sp_Calc_sDgd`; this `CL` variant is unwired in this DB instance — likely a fork preserved for a customer with the slave-only material delivery flow. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sDgd_1226.md b/en/docs/auto-catalog/procedures/Sp_Calc_sDgd_1226.md index 7f24ce8..d45865d 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sDgd_1226.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sDgd_1226.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup variant of `Sp_Calc_sDgd` (the 送货单 audit on `saldelivergoodsmaster`). The `_1226` suffix is a date-stamped snapshot (12-26) kept around for rollback. Per wiki convention, backup objects are not narrated in depth. + +**What it does:** Same as `Sp_Calc_sDgd` at the time of copy — validates `sGuid`, on `iFlag=1` deducts stock and back-writes delivered qty into the upstream `SalSalesOrderSlave`, `MftWorkOrderSlave`/`mftworkordermaster`, `mftproductionplan`/`mftproductionplanslave`, `OpsOutsideInStoreSlave`, `PitProductInStoreSlave`, `PitProductStoreVirtual`, `SalDeliverNotifySlave`, `SalRejectGoodsSlave`, then `INSERT INTO MitMaterialsStore` / `INSERT INTO EleMaterialsStock` / `UPDATE EleProductStock` and `CALL Sp_Bill_Used` + `CALL Sp_System_AutoMaterialsPriceSingle`. Symmetric uncheck. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName/sSaveProName/sDeleteProName/sSaveProNameBefore` binding, no `gdsconfigformmaster` reference, no other procedure or function calls it, no xly-src reference. Not expected to be called from production — verify before relying on it. Sibling backup `Sp_Calc_sDgd_20250612` also exists (later snapshot). The live audit is `Sp_Calc_sDgd`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sDgd_20250612.md b/en/docs/auto-catalog/procedures/Sp_Calc_sDgd_20250612.md index 1b6fa57..a38a019 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sDgd_20250612.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sDgd_20250612.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_Calc_sDgd` (`_20250612` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_Calc_sDgd` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sDgn.md b/en/docs/auto-catalog/procedures/Sp_Calc_sDgn.md index 787f5e7..96dd6d2 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sDgn.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sDgn.md @@ -27,4 +27,12 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售送货流程 → 送货通知单 — sales delivery-notify check / uncheck on `saldelivernotifymaster`. The 送货通知单 audit is a soft commitment ahead of the actual 送货单: on approval it freezes the notify rows, optionally posts the operator's KPI, and back-writes the notified qty into the upstream sales-order. The same proc also serves the material variant 材料送货通知单单据 (material side of the same notify flow). + +**What it does:** Validates `sGuid`, refuses when `bInvalid=1`, and on `iFlag=1` guards on `bCheck` then `Update saldelivernotifymaster`/`saldelivernotifyslave` to set `bCheck=1`, `sStatus=1`, `sCheckPerson`, `tCheckDate`; reads `gdsmodule` + `SysSystemSettings` to decide whether to log a KPI row (`INSERT INTO kpidetail`); calls `Sp_System_CheckFlow` per slave when `CkxDefineCheck=1` to kick off the approval workflow; finally `CALL Sp_Bill_Used` registers consumption. With `iFlag=0`, the symmetric uncheck clears the same flags. + +**Invocation:** Bound to `gdsmodule.sProcName` on: +- `送货通知单单据` (sId `15833158840002862255575040533000`) — 销售管理 → 销售送货流程 +- `材料送货通知单单据` (sId `101251240115016140461755160`) — 销售单据 + +Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit (审核/反审核) button — the standard `Sp_Calc_s` slot. xly-src ships `script/标版/30100101/Sp_Calc_sDgn.sql` (install script) and `script/标版/optimize/Sp_Calc_sDgn.sql` (a performance/lock patch) — verify which is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sEmmt.md b/en/docs/auto-catalog/procedures/Sp_Calc_sEmmt.md index 062da79..36392c5 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sEmmt.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sEmmt.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 设备管理 → 设备单据 → 设备维修 — equipment-maintenance check / uncheck on `eptmachinemaintenancemaster`. Approves a 设备维修 (repair/maintenance record) so it becomes the official record for the machine downtime + parts/labor cost rollup. + +**What it does:** Validates `sGuid`, refuses when `bInvalid=1`. With `iFlag=1`: guards on already-`bCheck=1` then `Update eptmachinemaintenancemaster` setting `bCheck=1, sStatus=1, sCheckPerson, tCheckDate`. With `iFlag<>1`: symmetric uncheck. Standard thin `Sp_Calc_s` audit shape — no slave-cursor, no downstream back-write. + +**Invocation:** Bound to `gdsmodule.sProcName` on `设备维修` (sId `101251240115016055988358370`), parent `设备单据` → 设备管理. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(...)` on the audit/un-audit button. xly-src ships `script/标版/30100101/Sp_Calc_sEmmt.sql` (install) and `script/标版/optimize/Sp_Calc_sEmmt.sql` (patch). + +Note: the COMMENT on the proc reads `'商机跟进'` (sales-lead follow-up), copy-pasted from an unrelated template — purely cosmetic, ignore. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sEmp.md b/en/docs/auto-catalog/procedures/Sp_Calc_sEmp.md index a4c64d8..a5022bc 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sEmp.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sEmp.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 设备管理 → 设备单据 — equipment-plan audit on `etpmachineplanmaster`. Thin check/uncheck hook for a machine-plan (设备计划) master record — sets the bill `bCheck=1, sStatus=1` so the planned schedule becomes the system of record. + +**What it does:** Validates `sGuid`, refuses when `bInvalid=1`. With `iFlag=1`: guards on already-`bCheck=1` then `Update etpmachineplanmaster` setting `bCheck=1, sStatus=1, sCheckPerson, tCheckDate`. With `iFlag<>1`: symmetric uncheck guard on `bCheck=0`. Standard thin `Sp_Calc_s` audit shape. + +**Invocation:** Status: dormant — no live `gdsmodule.sProcName` binding, no `sSaveProName` hook, no other-routine CALLs, no Java reference. Ships only as `xly-src/script/标版/30100101/Sp_Calc_sEmp.sql` install script. The proc is deployed but the matching `etpmachineplanmaster` module hook is wired only via customer-specific override scripts. + +Note: COMMENT reads `'商机跟进'`, copy-paste artefact from the template — ignore. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sEmr.md b/en/docs/auto-catalog/procedures/Sp_Calc_sEmr.md index a900bc5..8cafb95 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sEmr.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sEmr.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 设备管理 → 设备单据 → 设备报修 — equipment-repair-request check / uncheck on `eptmachinerepairfixmaster`. Approves a 设备报修 (报修单 — request-for-repair) so it can flow to a 维修工单 / 维修登记 downstream. + +**What it does:** Validates `sGuid`, refuses when `bInvalid=1`. With `iFlag=1`: guards on already-`bCheck=1` then `Update eptmachinerepairfixmaster` setting `bCheck=1, sStatus=1, sCheckPerson, tCheckDate`. With `iFlag<>1`: symmetric uncheck. Standard thin `Sp_Calc_s` audit shape — no slave-cursor or workflow trigger. + +**Invocation:** Bound to `gdsmodule.sProcName` on `设备报修` (sId `101251240115016055989167490`), parent `设备单据` → 设备管理. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(...)` on the audit/un-audit button. xly-src ships `script/标版/30100101/Sp_Calc_sEmr.sql` (install) and `script/标版/optimize/Sp_Calc_sEmr.sql` (patch). + +Note: COMMENT `'商机跟进'` is a copy-paste artefact, ignore. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sEmt.md b/en/docs/auto-catalog/procedures/Sp_Calc_sEmt.md index b368b55..aea2ed7 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sEmt.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sEmt.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 设备管理 → 设备单据 → 设备保养登记 — equipment-maintenance-registration check / uncheck on `eptmachinemaintainmaster`. Approves a 设备保养登记 (per-machine maintenance log) and writes back the executed maintenance into the matching plan slave so the plan board updates. + +**What it does:** Validates `sGuid`, refuses when `bInvalid=1`. With `iFlag=1`: guards on already-`bCheck=1`, `Update eptmachinemaintainmaster` setting `bCheck=1, sStatus=1, sCheckPerson, tCheckDate`, then `Update EptMachineMaintainPlanSlave` to flip the matching plan slave `bAlreadyMaintain=1` and stamp `tActualMaintainDate=NOW()` so the plan-tracking grid reflects the executed registration. Uncheck reverses both. + +**Invocation:** Bound to `gdsmodule.sProcName` on `设备保养登记` (sId `101251240115016055988181430`), parent `设备单据` → 设备管理. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(...)` on the audit/un-audit button. xly-src ships `script/标版/30100101/Sp_Calc_sEmt.sql` (install) and `script/标版/optimize/Sp_Calc_sEmt.sql` (patch). + +Note: COMMENT `'商机跟进'` is a copy-paste artefact, ignore. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sEtp.md b/en/docs/auto-catalog/procedures/Sp_Calc_sEtp.md index 63776a1..20593fd 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sEtp.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sEtp.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 设备管理 → 设备单据 → 设备保养计划 — equipment-maintenance-plan check / uncheck on `eptmachinemaintainplanmaster`. Approves a 设备保养计划 (per-machine scheduled maintenance plan) so its plan-slave rows become live tickets for the 设备保养登记 (`Sp_Calc_sEmt`) workflow to consume. + +**What it does:** Validates `sGuid`, refuses when `bInvalid=1`. With `iFlag=1`: guards on already-`bCheck=1` then `Update eptmachinemaintainplanmaster` setting `bCheck=1, sStatus=1, sCheckPerson, tCheckDate`. With `iFlag<>1`: symmetric uncheck. Standard thin `Sp_Calc_s` audit shape. + +**Invocation:** Bound to `gdsmodule.sProcName` on `设备保养计划` (sId `101251240115016050003838930`), parent `设备单据` → 设备管理. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(...)` on the audit/un-audit button. xly-src ships `script/标版/30100101/Sp_Calc_sEtp.sql` (install) and `script/标版/optimize/Sp_Calc_sEtp.sql` (patch). + +Note: COMMENT `'商机跟进'` is a copy-paste artefact, ignore. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sEtpCH.md b/en/docs/auto-catalog/procedures/Sp_Calc_sEtpCH.md index be9168e..e48137f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sEtpCH.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sEtpCH.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 设备管理 → 设备单据 — equipment-maintain-plan-change audit on `eptmachinemaintainchangemaster` (COMMENT `'设备保养时间变更'`). Approves a 设备保养时间变更 (reschedule request against an existing 设备保养计划), and on approval pushes the new date back into the original plan slave so the plan reflects the change. + +**What it does:** Validates `sGuid`. With `iFlag=1`: guards on `bCheck=1`, `Update eptmachinemaintainchangemaster` to set `bCheck=1, sStatus=1, sCheckPerson, tCheckDate`, then `Update eptmachinemaintainplanslave` to overwrite `tPlanMaintainDate` with the change-bill's new date for the referenced plan slave. Uncheck reverses the master flags (does not undo the plan-slave date — flag for audit if reversibility matters). + +**Invocation:** Status: appears orphaned. No live `gdsmodule.sProcName` binding, no `sSaveProName` hook, no other-routine CALLs, no xly-src reference (no install script, no Java) — candidate for maintainer audit. Likely either deprecated or bound only in customer-specific overrides for the 设备保养时间变更 form. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sExp.md b/en/docs/auto-catalog/procedures/Sp_Calc_sExp.md index b88e259..0731901 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sExp.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sExp.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本管理 → 成本单据 → 费用分摊单据 — cost-allocation check / uncheck on `CosExpenseShare`. Approves a 费用分摊 (overhead/expense allocation across cost centers or orders) so the allocated amounts feed the cost-rollup queries. + +**What it does:** Tiny stub. Validates `sGuid` (no `bInvalid` check, no account-period guard, no slave loop). With `iFlag=1`: `Update CosExpenseShare Set bCheck=1, sCheckPerson, tCheckDate=NOW() Where sId=sGuid`. With `iFlag<>1`: same `UPDATE` with `bCheck=0`. Unlike most `Sp_Calc_s*` siblings it never refuses an already-checked/unchecked bill — both branches are idempotent overwrites. + +**Invocation:** Bound to `gdsmodule.sProcName` on `费用分摊单据` (sId `15848534690001174150034350979800`), parent `成本单据` → 成本管理. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(...)` on the audit/un-audit button. xly-src ships `script/标版/30100101/Sp_Calc_sExp.sql` (install) and `script/标版/optimize/Sp_Calc_sExp.sql` (patch). + +Note: COMMENT `'销售订单'` is a copy-paste artefact, ignore. Flag for audit: missing `sStatus`-flip and missing already-checked guard versus family norm. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sFixe.md b/en/docs/auto-catalog/procedures/Sp_Calc_sFixe.md index 3d9b355..e18e153 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sFixe.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sFixe.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 设备管理 → 设备单据 — fixed-asset audit on `eptmachinefixedordermaster` (COMMENT `'固定资产审核过程'`). Approves a 固定资产 (fixed-asset order — purchase/transfer/disposal of a machine treated as a capital asset) so it can post into the asset register. + +**What it does:** Validates `sGuid`, refuses when `bInvalid=1`. With `iFlag=1`: guards on already-`bCheck=1`, `UPDATE eptmachinefixedordermaster` setting `bCheck=1, sStatus=1, sCheckPerson, tCheckDate`. With `iFlag<>1`: symmetric uncheck. Standard thin `Sp_Calc_s` audit shape. + +**Invocation:** Status: appears orphaned. No live `gdsmodule.sProcName` binding, no `sSaveProName` hook, no other-routine CALLs, no xly-src reference (no install script in `30100101/`, no Java caller) — candidate for maintainer audit. Likely a customer-specific or in-development module; verify whether the 固定资产 form is enabled per tenant. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sFksq.md b/en/docs/auto-catalog/procedures/Sp_Calc_sFksq.md index e0139bc..5cc4b5d 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sFksq.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sFksq.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 财务单据 — payment-request audit (COMMENT `'付款申请'`). Despite the 付款申请 (payment-request) label and `sFksq` (付款申请) name, the body operates on **`expensereimbursementmaster`** / `expensereimbursementslave` — byte-identical to `Sp_Calc_sFybx` (费用报销). The two siblings appear to be split for module-naming convenience even though they audit the same table. + +**What it does:** Validates `sGuid`, refuses when `bInvalid=1`, checks `sysaccountperiod.bFrozen` per `SysSystemSettings.CkxIntervalMonthModifyBill`. With `iFlag=1`: guards on `bCheck=1`, `Update expensereimbursementmaster` to set the audit flags, `Update expensereimbursementslave` to flip slave `bCheck=1`, and `Update advanceCostCheckMaster` to write back the reimbursed amount against the prior advance-cost record. Uncheck reverses the master/slave flags but does not unwind the `advanceCostCheckMaster` back-write — flag for maintainer audit if reversibility matters. + +**Invocation:** Status: appears orphaned. No live `gdsmodule.sProcName` binding, no `sSaveProName` hook, no other-routine CALLs, no xly-src reference — candidate for maintainer audit. The active 付款申请 form in production is likely `Sp_Calc_sFksq1` (which operates on the newer `paymentRequest` table), with `sFksq` left as a legacy duplicate of the 费用报销 (`Sp_Calc_sFybx`) flow. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sFksq1.md b/en/docs/auto-catalog/procedures/Sp_Calc_sFksq1.md index 929302b..09e82c3 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sFksq1.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sFksq1.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 财务单据 — payment-request audit on **`paymentRequest`** (COMMENT `'付款申请'`). The `_1` suffix marks this as the newer 付款申请 variant: same `Sp_Calc_sFksq` shape rewritten against a dedicated `paymentRequest` table instead of reusing `expensereimbursementmaster`. + +**What it does:** Validates `sGuid`, refuses when `bInvalid=1`, checks `sysaccountperiod.bFrozen` per `SysSystemSettings.CkxIntervalMonthModifyBill`. With `iFlag=1`: guards on `bCheck=1` then `Update paymentRequest` to set `bCheck=1, sStatus=1, sCheckPerson, tCheckDate`. With `iFlag<>1`: symmetric uncheck. The version-1 body drops the `advanceCostCheckMaster` back-write loop that `Sp_Calc_sFksq` carried — pure master flip. + +**Invocation:** Status: appears orphaned. No live `gdsmodule.sProcName` binding, no `sSaveProName` hook, no other-routine CALLs, no xly-src reference — candidate for maintainer audit. Likely bound only in customer-specific overrides for tenants on the newer `paymentRequest` schema. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sFma.md b/en/docs/auto-catalog/procedures/Sp_Calc_sFma.md index 578458a..70de550 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sFma.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sFma.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 人事行政 → 文件管理 → 文件管理单据 — file-management check / uncheck on `filfilemanagemaster`. Approves a 文件 (administrative document — policy, form template, scan, etc.) so it becomes the current published version visible to viewers. + +**What it does:** Validates `sGuid`, refuses when `bInvalid=1`. With `iFlag=1`: guards on already-`bCheck=1` then `Update filfilemanagemaster` setting `bCheck=1, sStatus=1, sCheckPerson, tCheckDate`. With `iFlag<>1`: symmetric uncheck. Standard thin `Sp_Calc_s` audit shape. + +**Invocation:** Bound to `gdsmodule.sProcName` on `文件管理单据` (sId `101251240115016170699027530`), parent `文件管理` → 人事行政. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(...)` on the audit/un-audit button. xly-src ships `script/标版/30100101/Sp_Calc_sFma.sql` (install) and `script/标版/optimize/Sp_Calc_sFma.sql` (patch). + +Note: COMMENT `'商机跟进'` is a copy-paste artefact, ignore. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sFtf.md b/en/docs/auto-catalog/procedures/Sp_Calc_sFtf.md index fdc50b7..71cbb29 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sFtf.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sFtf.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 财务单据 → 财务转账单据 — financial-transfer check / uncheck on `CahFinancialTransfer` (COMMENT `'财务转账'`). Approves a 财务转账 (cash movement between bank accounts / cash boxes) so the offsetting ledger entries become permanent — and once approved, locks the affected accounts and writes the matched stock-invoice / wastebook (出纳流水) lines. + +**What it does:** Validates `sGuid`, refuses when `bInvalid=1`, checks `sysaccountperiod.bFrozen` per `SysSystemSettings.CkxIntervalMonthModifyBill` and `SysLocking` against the involved accounts. With `iFlag=1`: `Update CahFinancialTransfer` to set the audit flags, then `INSERT INTO CahStockInvoice` and `INSERT INTO CahWasteBook` to post the offsetting in/out lines for both ends of the transfer; `Update CahStockInvoice` re-totals the running balance. Uncheck deletes/zero-flags the posted rows. + +**Invocation:** Bound to `gdsmodule.sProcName` on `财务转账单据` (sId `192116810113315231655092270`), parent `财务单据` → 财务管理. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(...)` on the audit/un-audit button. xly-src ships `script/标版/30100101/Sp_Calc_sFtf.sql` (install) and `script/标版/optimize/Sp_Calc_sFtf.sql` (patch). diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sFybx.md b/en/docs/auto-catalog/procedures/Sp_Calc_sFybx.md index eda1f60..43e098d 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sFybx.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sFybx.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 财务单据 — expense-reimbursement check / uncheck on `expensereimbursementmaster` (COMMENT `'费用报销'`). Approves a 费用报销 (employee expense-reimbursement claim) so the reimbursed amount feeds back into the matched advance-cost record (差旅借支 / 备用金). + +**What it does:** Byte-identical to `Sp_Calc_sFksq` apart from the procedure name and the COMMENT — same `expensereimbursementmaster` master flip, same slave flip on `expensereimbursementslave`, same `Update advanceCostCheckMaster` back-write of the reimbursed amount against the prior advance. Validates `sGuid`, refuses `bInvalid=1`, checks `sysaccountperiod.bFrozen` per `SysSystemSettings.CkxIntervalMonthModifyBill`. Uncheck reverses the master/slave flags but does not unwind the `advanceCostCheckMaster` back-write — flag for audit if reversibility matters. + +**Invocation:** Status: appears orphaned. No live `gdsmodule.sProcName` binding, no `sSaveProName` hook, no other-routine CALLs, no xly-src reference (no install script, no Java caller) — candidate for maintainer audit. The production 费用报销 form likely uses a customer-override or has been renamed; verify which proc the live 费用报销单 module currently binds. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sInded.md b/en/docs/auto-catalog/procedures/Sp_Calc_sInded.md index 5ce1cbd..1b0daec 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sInded.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sInded.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售送货流程 — internal-deduction check / uncheck on `saldelivergoodsdedInmaster` (COMMENT `'内部扣款单'`). Approves a 内部扣款单 (internal deduction note — typically a 质量事故 / 客户扣款 back-charged to the responsible internal team) and flips the linked 质量事故 slave so the deduction shows as settled. + +**What it does:** Validates `sGuid`. With `iFlag=1`: guards on `bCheck=1`, `Update saldelivergoodsdedInmaster` to set the audit flags, then `Update mftqualityaccidentSlave` to flip the matching 质量事故 slave's settlement flag (linking the deduction back to the originating quality-incident). Uncheck reverses both. References `elecustomer` and `siscurrency` for label lookups during validation. + +**Invocation:** Status: appears orphaned. No live `gdsmodule.sProcName` binding, no `sSaveProName` hook, no other-routine CALLs, no xly-src reference — candidate for maintainer audit. The 内部扣款单 form may be customer-specific or wired only via override scripts; verify whether the form is enabled per tenant. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sLok.md b/en/docs/auto-catalog/procedures/Sp_Calc_sLok.md index 98502e5..a631cf2 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sLok.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sLok.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 物流管理 → 10.物流单据 → 物流对账单单据 — logistics-reconciliation check / uncheck on `opsoutsidecheckingmaster`. Approves a 物流对账单 (carrier reconciliation against a batch of 物流单), which freezes the matched logistics rows and posts an accounts-payable line to the carrier supplier. + +**What it does:** Validates `sGuid`, refuses when `bInvalid=1`, checks `sysaccountperiod.bFrozen` per `SysSystemSettings.CkxIntervalMonthModifyBill` and `SysLocking` against the carrier supplier. With `iFlag=1`: opens a cursor over `opsoutsidecheckingslave` rows, calls `Sp_System_CheckFlow` per slave when `CkxDefineCheck=1` to drive the approval workflow, `Update opsoutsidecheckingmaster` to set the audit flags, `Update logisticsorderslave` / `Update OpsOutsideInStoreSlave` to flag the source rows as reconciled, `INSERT INTO CahPaymentables` to post the AP line for the carrier, `Update CahSupplyInit` to refresh the supplier opening-balance running total, conditionally `INSERT INTO kpidetail` for the operator, and finally `CALL Sp_Bill_Used`. Symmetric uncheck on `iFlag=0`. + +**Invocation:** Bound to `gdsmodule.sProcName` on `物流对账单单据` (sId `101251240115016270323854760`), parent `10.物流单据` → 物流管理. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(...)` on the audit/un-audit button. xly-src ships `script/标版/30100101/Sp_Calc_sLok.sql` (install) and `script/标版/optimize/Sp_Calc_sLok.sql` (patch). diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sLos.md b/en/docs/auto-catalog/procedures/Sp_Calc_sLos.md index d724b15..c315117 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sLos.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sLos.md @@ -1,7 +1,7 @@ # `Sp_Calc_sLos` (procedure) -> @author:zhucx - @date:2021.11.29 +> @author:zhucx + @date:2021.11.29 @describe: 物流管理-物流单 审核 @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 物流管理 → 10.物流单据 → 物流单单据 — logistics-order check / uncheck on `logisticsordermaster`. Approves a 物流单 (outbound logistics ticket — carrier picking up a 送货单 batch) so the listed deliveries become flagged as shipped-via-this-carrier, ready for downstream 物流对账 reconciliation. + +**What it does:** Validates `sGuid`, refuses when `bInvalid=1`, checks `sysaccountperiod.bFrozen` per the system settings, and `SysLocking` against the carrier supplier. With `iFlag=1`: calls `Sp_Check_sLosTest` for pre-flight validation, `Update logisticsordermaster` to set the audit flags, `Update logisticsorderdetails` (slave detail lines) to flag them as shipped, `UPDATE saldelivergoodsslave` to write back the carrier/物流单 reference into each linked 送货单 row, and `CALL Sp_Bill_Used` to mark the bill consumed. Uncheck reverses the master/detail flags and clears the back-write on `saldelivergoodsslave`. + +**Invocation:** Bound to `gdsmodule.sProcName` on `物流单单据` (sId `101251240115016270322291050`), parent `10.物流单据` → 物流管理. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(...)` on the audit/un-audit button. xly-src ships `script/标版/30100101/Sp_Calc_sLos.sql` (install) and `script/标版/optimize/Sp_Calc_sLos.sql` (patch). Authored 2021-11-29 by `zhucx` per the body header. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sLos_copy1.md b/en/docs/auto-catalog/procedures/Sp_Calc_sLos_copy1.md index 40cf239..5f876f0 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sLos_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sLos_copy1.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_Calc_sLos` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_Calc_sLos` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sMad.md b/en/docs/auto-catalog/procedures/Sp_Calc_sMad.md index de7131c..12c9fcb 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sMad.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sMad.md @@ -27,4 +27,12 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料库存 → 材料库单据 → 材料调拨单据 — material-adjust/transfer check / uncheck on `MitMaterialsAdjustMaster` (COMMENT `'材料调拨'`). 材料调拨 is the inter-warehouse / inter-batch material movement bill: on approval it deducts stock from the source location/batch, credits the destination, posts paired movement rows on `EleMaterialsStock`/`MitMaterialsStore`, and re-checks the stock limits on both sides. + +**What it does:** Validates `sGuid`. Opens cursors over `MitMaterialsAdjustSlave` rows to: `Update EleMaterialsStock` (source qty down / destination qty up — paired updates), `INSERT INTO EleMaterialsStock` + `EleMaterialsStock_master` to spawn the destination batch row when it does not yet exist, `INSERT INTO MitMaterialsStore` to log both directions of the movement, `Update MitMaterialsAdjustMaster` to set the audit flags, `Update purpurchaseinstoreslave` to back-write any linked source-purchase slaves; calls `Sp_System_AutoMaterialsPriceSingle` to refresh weighted prices, `Sp_calc_materialsstoreLimit` to re-evaluate min/max stock alerts, with `SysLocking` taken on the warehouses. Uncheck reverses each posting. + +**Invocation:** Bound to `gdsmodule.sProcName` on two modules: +- `材料调拨单据` (sId `192116810113315231655092270`) — 材料库存 → 材料库单据 (main desktop form) +- `材料调拨(出)` (sId `192116810111915065794192709`) — 通用常量 root (alternate split-form variant) + +Dispatched by Java `BusinessBaseServiceImpl.getPrcName(...)` on the audit/un-audit button. xly-src ships `script/标版/30100101/Sp_Calc_sMad.sql` (install) and `script/标版/optimize/Sp_Calc_sMad.sql` (patch); sibling `Sp_Check_sMad.sql` provides the parallel pre-save validation. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sMat.md b/en/docs/auto-catalog/procedures/Sp_Calc_sMat.md index 7ae2883..18c543f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sMat.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sMat.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础设置 → 纸张与辅料 → 物料信息 — material-master audit on `elematerials` (COMMENT `'物料审核'`). Approves a 物料 (material master record — paper/ink/PS-plate/glue/etc.) so it becomes usable in downstream sales-orders, work-orders, and stock movements. Curiously, the audit also flips the row's `sFormId` from one form-id to another — a form-migration side-effect. + +**What it does:** Validates `sGuid`. With `iFlag=1`: refuses already-`bCheck=1`; opens a 工作流 cursor over `SalSalesOrderSlave` rows joined to `salsalesordermaster`/`eleproduct` and calls `Sp_System_CheckFlow` per slave when `CkxDefineCheck=1` to drive an approval workflow over the **sales-order tables** (unusual for a material-master audit — flag for maintainer audit); then `Update elematerials` to set `bCheck=1, sStatus=1, sCheckPerson, tCheckDate, sFormId='192116811311115106418895950'` only when the current `sFormId='101251240115016270291152360'`. With `iFlag<>1`: symmetric uncheck on `elematerials` without the `sFormId` rewrite. + +**Invocation:** Status: appears orphaned. No live `gdsmodule.sProcName` binding (the matching 物料信息 sId `192116811311115106418895950` has no proc bound — the form-id rewrite suggests it was previously bound under the other id and migrated), no `sSaveProName` hook, no other-routine CALLs, no xly-src reference — candidate for maintainer audit. + +Flag: the embedded `Sp_System_CheckFlow` loop scans `SalSalesOrderSlave` rather than any `elematerials` slave — a copy-paste from the 销售订单 audit template that is almost certainly wrong for a material-master approval. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sMaterials.md b/en/docs/auto-catalog/procedures/Sp_Calc_sMaterials.md index 14fd095..4a70ccf 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sMaterials.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sMaterials.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 物料信息审核 — material-master (`elematerials`) audit / un-audit. The proc is part of the `Sp_Calc_s` audit-button family but is **not currently bound** to any `gdsmodule.sProcName` slot; status appears orphaned. + +**What it does:** Standard audit-button skeleton: defaults the IN params, validates `sGuid`, refuses re-audit / re-un-audit based on `bCheck`, then on `iFlag=1` flips `elematerials.bCheck=1` (plus `sCheckPerson`, `tCheckDate`); on `iFlag=0` clears those columns. No slave table, no KPI logging, no `Sp_System_CheckFlow` workflow call. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` binding (the in-use material-master audit goes through `Sp_Check_smt` / similar), no `gdsconfigformmaster` reference, no other routine calls it, no xly-src grep hits — candidate for maintainer audit. The companion `Sp_Calc_sMaterialsBgd` (材料变更单) is the actively-bound variant. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sMaterialsBgd.md b/en/docs/auto-catalog/procedures/Sp_Calc_sMaterialsBgd.md index b5f6703..7ea70ed 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sMaterialsBgd.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sMaterialsBgd.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产单据 → 材料变更单 — material change-order audit / un-audit on `mftprocesschangemaster`. The 材料变更单 lets shop-floor users swap or re-spec the material attached to a 工单 (work order) mid-flight; auditing the change locks the new selection and propagates it into the downstream work-order material rows. + +**What it does:** Defaults the IN params, branches on `iFlag`. On `iFlag=1` it flips `mftprocesschangemaster.bCheck=1` with audit person/date, and `UPDATE mftworkordermaterials` to back-write the swapped material/qty onto the affected work-order slave rows; also re-evaluates `EleMaterialsStock` with `INSERT INTO EleMaterialsStock` to refresh the on-hand snapshot for the new material. `iFlag=0` reverses the slave back-write and re-evaluates stock. + +**Invocation:** Bound to `gdsmodule.sProcName` on `材料变更单` (sId `101251240115016119087978230`) under 生产管理 → 生产单据. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the 审核/反审核 button. xly-src ships `script/标版/30100101/Sp_Calc_sMaterialsBgd.sql` (install) and `script/标版/optimize/Sp_Calc_sMaterialsBgd.sql` (perf patch) — verify which is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sMcd.md b/en/docs/auto-catalog/procedures/Sp_Calc_sMcd.md index e4b8a1c..d35680e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sMcd.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sMcd.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料库存 → 材料库单据 → 材料盘点单据 — material stocktake audit / un-audit on `MitMaterialsCheckMaster`/`MitMaterialsCheckSlave`. Approving a stocktake commits the counted snapshot: gain rows boost `MitMaterialsStore`, loss rows decrement it, and a `MitCheckProfitLoss` row records the gain/loss delta so finance can reconcile. + +**What it does:** Validates `sGuid`, refuses when `bInvalid=1` or already in the wrong `bCheck` state. On `iFlag=1` flips `MitMaterialsCheckMaster.bCheck=1` plus slave rows, writes/clears `MitCheckProfitLoss`, and `INSERT INTO EleMaterialsStock` to refresh on-hand totals from `MitMaterialsStore`. On `iFlag=0` reverses by `Delete from MitCheckProfitLoss`, restoring prior `MitMaterialsStore` rows, and `Delete FROM EleMaterialsStock` followed by a fresh re-aggregation. + +**Invocation:** Bound to `gdsmodule.sProcName` on `材料盘点单据` (sId `192116810113315228128521360`) under 材料库存 → 材料库单据. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the 审核/反审核 button. xly-src ships `script/标版/30100101/Sp_Calc_sMcd.sql` (install) and `script/标版/optimize/Sp_Calc_sMcd.sql` (perf patch). diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sMft.md b/en/docs/auto-catalog/procedures/Sp_Calc_sMft.md index edc84d6..5baf5e1 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sMft.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sMft.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 新材料测试 — new-material test order audit / un-audit on `mftmaterialstest`. Touches `salsalesorderslave` as well, suggesting the test approval also back-writes a result reference onto the originating sales-order line (e.g., to clear a "材料待测试" hold). + +**What it does:** Standard `Sp_Calc_s` skeleton: defaults the IN params, validates `sGuid`, branches on `iFlag`. On `iFlag=1` flips `mftmaterialstest.bCheck=1` with audit person/date and updates the linked `salsalesorderslave` row; `iFlag=0` reverses both updates. No KPI logging, no workflow call discovered. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` binding, no `gdsconfigformmaster` reference, no other routine refs, no xly-src grep hits — candidate for maintainer audit. The 新材料测试申请 family is also represented by `Sp_Calc_sMpz` / `Sp_Calc_sMsc`, both equally unbound; the actively-used flow may have moved to a different proc or been retired. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sMit.md b/en/docs/auto-catalog/procedures/Sp_Calc_sMit.md index 4eeac50..7a4969f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sMit.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sMit.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 系统设置 → 期初设置 → 材料期初 (单据 + 列表) — material opening-balance audit / un-audit on `MitMaterialsInitMaster`/`MitMaterialsInitSlave`. The 材料期初 is run once per warehouse at system go-live to seed `MitMaterialsStore` with the starting on-hand quantities and `EleMaterialsStock` with the rolled-up snapshot; auditing the period freezes those seed rows. + +**What it does:** Validates `sGuid`, branches on `iFlag`. On `iFlag=1` flips `MitMaterialsInitMaster.bCheck=1` plus slave rows, then for each slave row inserts the opening qty into `MitMaterialsStore` and `INSERT INTO EleMaterialsStock` to rebuild the per-material on-hand snapshot. On `iFlag=0` reverses by `delete from mitmaterialsstore`/`Delete FROM EleMaterialsStock` to drop the seed and recomputing the snapshot without the opening balance. + +**Invocation:** Bound to `gdsmodule.sProcName` on two sibling modules under 系统设置 → 期初设置: `材料期初单据` (sId `101251240115015946054872880`) and `材料期初` list view (sId `101251240115015946178618470`). Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the 审核/反审核 button. xly-src ships `script/标版/30100101/Sp_Calc_sMit.sql` and `script/标版/optimize/Sp_Calc_sMit.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sMit1.md b/en/docs/auto-catalog/procedures/Sp_Calc_sMit1.md index 60bec9d..39f593c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sMit1.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sMit1.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料期初数据导入(财务) — finance-side variant of the material opening-balance import, touching `AccMaterialsInitMaster` instead of the warehouse-side `MitMaterialsInitMaster` that `Sp_Calc_sMit` handles. Auditing this period would commit the finance-only opening valuations. + +**What it does:** Standard `Sp_Calc_s` skeleton: defaults the IN params, branches on `iFlag` and updates `AccMaterialsInitMaster.bCheck`/audit-person/audit-date. The body is leaner than `Sp_Calc_sMit` — no `MitMaterialsStore` or `EleMaterialsStock` writes, consistent with a finance-only ledger seed rather than a stock seed. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` binding, no `gdsconfigformmaster` reference, no other routine refs. xly-src contains only the install scripts `script/标版/30100101/Sp_Calc_sMit1.sql` and `script/标版/optimize/Sp_Calc_sMit1.sql` — no caller code — so the finance-side 材料期初导入 may have been folded into `Sp_Calc_sMit` or retired. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sMma.md b/en/docs/auto-catalog/procedures/Sp_Calc_sMma.md index 706a75d..0574d38 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sMma.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sMma.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料库存 → 材料库单据 → 材料库存调整单据 — material-stock adjustment audit / un-audit on `MitMaterialsStoreAdjustmentMaster`. The 库存调整 is the manual escape hatch for fixing on-hand totals that no other transaction can correct (lost/found stock, post-stocktake patches). Auditing the doc commits the adjustment into `MitMaterialsStore` and refreshes the `EleMaterialsStock` snapshot. + +**What it does:** Defaults the IN params, branches on `iFlag`. On `iFlag=1` flips `MitMaterialsStoreAdjustmentMaster.bCheck=1` and `INSERT INTO EleMaterialsStock` re-aggregating from `MitMaterialsStore` after the adjustment rows post. On `iFlag=0` runs `Delete From MitMaterialsStore` for the doc's adjustment rows and `UPDATE EleMaterialsStock` to restore prior on-hand. + +**Invocation:** Bound to `gdsmodule.sProcName` on `材料库存调整单据` (sId `192116810113315227379171200`) under 材料库存 → 材料库单据. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the 审核/反审核 button. xly-src ships `script/标版/30100101/Sp_Calc_sMma.sql` and `script/标版/optimize/Sp_Calc_sMma.sql`. Note: the sibling `Sp_Calc_sMmm` covers the financial-adjust variant (`MitMaterialsStoreAdjustmoneyMaster`). diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sMmm.md b/en/docs/auto-catalog/procedures/Sp_Calc_sMmm.md index b57a56e..a8c09c7 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sMmm.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sMmm.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 财务单据 → 材料存货调整单据 — material **value** adjustment audit / un-audit on `MitMaterialsStoreAdjustmoneyMaster`. Sister to `Sp_Calc_sMma` (qty side); this variant is the finance-driven version that re-prices existing on-hand without changing quantities — e.g., supplier price revisions, period-end revaluation. + +**What it does:** Defaults the IN params, branches on `iFlag`. On `iFlag=1` flips `MitMaterialsStoreAdjustmoneyMaster.bCheck=1`, writes the re-valuation rows into `MitMaterialsStore`, and `INSERT INTO EleMaterialsStock` to refresh the on-hand snapshot's value columns. `iFlag=0` runs `Delete From MitMaterialsStore` for the doc's value-adjust rows and `UPDATE EleMaterialsStock` to restore prior valuation. + +**Invocation:** Bound to `gdsmodule.sProcName` on `材料存货调整单据` (sId `101251240115015990257724500`) under 财务管理 → 财务单据. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the 审核/反审核 button. xly-src ships `script/标版/30100101/Sp_Calc_sMmm.sql` and `script/标版/optimize/Sp_Calc_sMmm.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sMmm_copy1.md b/en/docs/auto-catalog/procedures/Sp_Calc_sMmm_copy1.md index 2d618be..4b90f8a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sMmm_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sMmm_copy1.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_Calc_sMmm` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_Calc_sMmm` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sModule.md b/en/docs/auto-catalog/procedures/Sp_Calc_sModule.md index 4d89af3..4736f7e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sModule.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sModule.md @@ -1,8 +1,8 @@ # `Sp_Calc_sModule` (procedure) -> @author:zhucx - @date:2022.01.02 - @describe: +> @author:zhucx + @date:2022.01.02 + @describe: 1.PC端-系统设定-开发平台-系统模块-保存自动调用本过程 @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 系统设定 → 开发平台 → 系统模块 — `gdsmodule` save-side hook per the proc header (`PC端-系统设定-开发平台-系统模块-保存自动调用本过程`). The intent is to keep cached derivations or downstream metadata consistent when a developer edits a module definition. + +**What it does:** Standard `Sp_Calc_s` skeleton: defaults the IN params, validates `sGuid` against `gdsmodule`, branches on `iFlag`. The body uses `sTmpReturn` for cascaded error capture, suggesting it chains into one or more helper procs after the master flag flip; tables actually touched were not enumerable in this pass (DB connection dropped while reading the full body). + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` binding (per the schema today), no `gdsconfigformmaster` reference, no other routine refs, no xly-src grep hits. The header comment claims it's called on module-save but the live bindings do not connect it — likely the live system module save now goes through `Sp_Calc_sSm` or an in-Java path. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sMpa.md b/en/docs/auto-catalog/procedures/Sp_Calc_sMpa.md index 086f09e..8352185 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sMpa.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sMpa.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产执行 → MES单据 → 领料申请单据 / 补料申请单据 / 补版申请单据 — production material-pick-list audit / un-audit on `mitproductionapplymaster`/`mitproductionapplyslave`. Approving an apply locks the requested qty against the work-order, posts the picker KPI, and clears the matched semi-goods reservation. + +**What it does:** Validates `sGuid`, branches on `iFlag`. On `iFlag=1` flips `mitproductionapplymaster.bCheck=1` plus slave rows, writes a KPI row to `kpidetail`, `UPDATE MftWorkOrderMaterials` to back-write the applied qty onto the work-order's material slave, and `UPDATE sgdsemigoodsmatchbillmaterials` to consume the matched semi-goods reservation. `iFlag=0` reverses each. + +**Invocation:** Bound to `gdsmodule.sProcName` on three sibling modules under 生产执行 → MES单据: `领料申请单据`, `补料申请单据`, `补版申请单据` (all share `Sp_Check_sMpa` / `Sp_beforeSave_sMpa` too). Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the 审核/反审核 button — the three module slots share the same Sp_Calc but get differentiated downstream by the form sId. xly-src ships `script/标版/30100101/Sp_Calc_sMpa.sql` (install) and `script/标版/optimize/Sp_Calc_sMpa.sql` (perf patch). diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sMpd.md b/en/docs/auto-catalog/procedures/Sp_Calc_sMpd.md index 8dcd95c..2a2cc63 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sMpd.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sMpd.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 设计排版单 — pre-press / 印前 design-layout doc audit / un-audit on `MftPrintBeforeDesignMaster`. The 设计排版单 captures the imposition (排版) decisions (sheet size, up-count, color layout) that the prepress designer finalises before plate-making. + +**What it does:** Standard `Sp_Calc_s` skeleton: defaults the IN params, declares `iDefineCheck` (suggesting it consults a workflow-required flag), validates `sGuid`, and branches on `iFlag` to flip `MftPrintBeforeDesignMaster.bCheck` plus audit person/date. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` binding, no `gdsconfigformmaster` reference, no other routine refs. xly-src contains only `script/标版/30100101/Sp_Calc_sMpd.sql` (install script) with no caller code. The 设计排版单 module may have been retired or its audit re-routed to a Java handler. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sMpp.md b/en/docs/auto-catalog/procedures/Sp_Calc_sMpp.md index f0b07cd..8753b90 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sMpp.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sMpp.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 产品管理 → 产品管理单据 → 膜类工艺(模板) / 产品工艺模板 — product-process-template audit / un-audit on `MftProductMaster`. The 工艺模板 is the reusable recipe (process sequence + std times + materials) that the designer applies when issuing a new 产品工艺卡 for a similar item; auditing a template marks it as production-ready and locked from edits. + +**What it does:** Standard `Sp_Calc_s` skeleton: defaults the IN params, validates `sGuid`, branches on `iFlag`. The only data touch is `Update MftProductMaster` — flipping `bCheck`, `sCheckPerson`, `tCheckDate` — consistent with a master-only template that has no slave-side commitments to lock. + +**Invocation:** Bound to `gdsmodule.sProcName` on two sibling templates under 产品管理 → 产品管理单据: `膜类工艺(模板)` (sId `101251240115016080091311250`) and `产品工艺模板` (sId `101251240115016081864487990`). Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the 审核/反审核 button. xly-src ships `script/标版/30100101/Sp_Calc_sMpp.sql` (install) and `script/标版/optimize/Sp_Calc_sMpp.sql` (perf patch). diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sMpt.md b/en/docs/auto-catalog/procedures/Sp_Calc_sMpt.md index 7da97d0..ef426af 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sMpt.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sMpt.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Multi-form product process-card (产品工艺卡) audit / un-audit on `MftProductMaster`/`mftproductslave`. Used by nearly every product-recipe variant in the catalogue — 轮转/丝印/膜类/套装 工艺卡, 材料工艺卡, 预设产品工艺卡, the SOP-side 产品工艺卡, the legacy 产品工艺卡(兼容停用), and the PLM-side 工艺模板预设单. Auditing a 工艺卡 freezes the recipe (process steps, std times, materials) so production work-orders can copy it without seeing in-flight edits, and pushes the active flag into the related sales/dev/control snapshots. + +**What it does:** Validates `sGuid`, branches on `iFlag`. On `iFlag=1` flips `MftProductMaster.bCheck=1` and `mftproductslave` rows, `Update mftproductcontrol` to refresh the per-product control flags, `Insert INTO EleProduct` (with `update eleproduct` upsert) to materialise the active product snapshot, and back-writes the active recipe onto `salsaleschanceproduct` and `salsalesdevplanmaster` rows so the sales/dev side can quote against the new approval. `iFlag=0` reverses each. + +**Invocation:** Bound to `gdsmodule.sProcName` on **nine** sibling modules across 产品管理单据, 产品档案及SOP, and PLM单据 (轮转工艺卡 sId `101251240115015886014143310`; 丝印工艺卡 `101251240115015923024910330`; 膜类工艺卡 `101251240115016046551448370`; 预设产品工艺卡 `101251240115016081864262840`; 产品工艺卡 `101251240115016082594412050`; 材料工艺卡 `101251240115016088585774590`; 工艺模板预设单 `101251240115016124309963040`; 套装工艺卡 `12012615914116361116650540`; legacy 产品工艺卡(兼容停用) `19211681019715613574532820`). Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on 审核/反审核. xly-src ships install + optimize scripts under `script/标版/`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sMpz.md b/en/docs/auto-catalog/procedures/Sp_Calc_sMpz.md index 3153536..50c6edb 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sMpz.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sMpz.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 新材料测试申请(品质) — quality-department new-material-test request audit / un-audit. Despite the form-title naming, the body's data touch is on `elematerials` and `salsalesdevplanmaster` rather than a `mft*test*` master — suggesting the audit, once approved, promotes the candidate material into `elematerials` and back-writes the test reference onto the originating 销售开发计划. + +**What it does:** Validates `sGuid` with `bCheck`/`bInvalid` guards, branches on `iFlag`. On `iFlag=1` runs `insert into elematerials` (or `delete from elematerials` then re-insert) to materialise the approved material row, and `update salsalesdevplanmaster` to mark the dev-plan line as having a usable material. `iFlag=0` reverses by `delete from elematerials` and restoring the dev-plan flag. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` binding, no `gdsconfigformmaster` reference, no other routine refs, no xly-src grep hits. The 新材料测试申请 family (`Sp_Calc_sMft` / `Sp_Calc_sMpz` / `Sp_Calc_sMsc`) is collectively unbound — the live flow may have consolidated onto a different proc or moved to Java. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sMsc.md b/en/docs/auto-catalog/procedures/Sp_Calc_sMsc.md index 0d66a5a..92bb4b8 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sMsc.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sMsc.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 新材料测试申请(品质) — second quality-department new-material-test request variant (same Chinese label as `Sp_Calc_sMpz`). Touches only `salsalesdevplanmaster`, suggesting an even leaner variant whose audit just flags the originating 销售开发计划 line without materialising an `elematerials` row. + +**What it does:** Standard `Sp_Calc_s` skeleton: defaults the IN params, validates `sGuid` with `bInvalid` guard, branches on `iFlag`. The only data touch is `Update salsalesdevplanmaster` — flipping the test-approval flag for the linked dev-plan row. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` binding, no `gdsconfigformmaster` reference, no other routine refs, no xly-src grep hits. Alongside `Sp_Calc_sMft` and `Sp_Calc_sMpz` (same Chinese family), the live 新材料测试申请 audit is not currently routed through any of these procs. Candidate for maintainer audit; the sChinese duplication between `sMpz` and `sMsc` also suggests one is a renamed/forked copy of the other. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sMsy.md b/en/docs/auto-catalog/procedures/Sp_Calc_sMsy.md index 096b0ba..abaf0fd 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sMsy.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sMsy.md @@ -1,8 +1,8 @@ # `Sp_Calc_sMsy` (procedure) -> @author:zhucx - @date:2021.12.12 - @describe: +> @author:zhucx + @date:2021.12.12 + @describe: 1.PC端-采购管理-采购询价-保存自动调用本过程,当系统设定中本单据为自动审核时 @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 → 采购单据 → 采购询价单 — purchase RFQ (price-inquiry) audit / un-audit. Per the proc header, this runs automatically on save when the form is configured for auto-audit. Auditing an RFQ promotes the negotiated supplier prices into the live material-supply pricing on `elematerialssupply`, so downstream PO creation picks them up. + +**What it does:** Defaults the IN params, branches on `iFlag`. The only data touch is `Update elematerialssupply` — back-writing the RFQ-line prices/lead-times onto the per-supplier material-supply rows. `iFlag=0` reverses the same column writes. + +**Invocation:** Bound to `gdsmodule.sProcName` on `采购询价单` (sId `19211681019715693170550680`) under 采购管理 → 采购单据. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` either on the 审核 button or — per the header — automatically by the save handler when 系统设定 marks 采购询价单 as auto-audit. xly-src ships `script/标版/30100101/Sp_Calc_sMsy.sql` and `script/标版/optimize/Sp_Calc_sMsy.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sOdt.md b/en/docs/auto-catalog/procedures/Sp_Calc_sOdt.md index f6302a4..e9f961d 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sOdt.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sOdt.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量管理 → 质量管理单据 → 发外检验单据 (PC + mobile variants) — outsourced-process inbound-quality check audit / un-audit on `QlyOutSideProductTestMaster`. When goods return from an outsourced step (印刷, 模切, etc.), QC inspects them; approving the 发外检验 commits the accept/reject outcome and unblocks the upstream 发外加工 / 发外到货 rows so finance/warehouse can proceed. + +**What it does:** Defaults the IN params, branches on `iFlag`. On `iFlag=1` flips `QlyOutSideProductTestMaster.bCheck=1` plus audit person/date, and back-writes the inspection result onto `OpsOutsideProcessSlave` (the outsourced-process slave row) and `opsoutsidearriveslave` (the arrival/收货 slave row) so the next step in the workflow sees the QC verdict. `iFlag=0` clears those back-writes. + +**Invocation:** Bound to `gdsmodule.sProcName` on `发外检验单据` (sId `15827076660008241075501010830000`) under 质量管理 → 质量管理单据, and on the mobile-side `发外检验(mobile单据)` (sId `12012615914116374731690490`) under 移动端管理. Both modules also share `Sp_Check_sOdt` / `Sp_beforeSave_sOdt`. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on 审核/反审核. xly-src ships `script/标版/30100101/Sp_Calc_sOdt.sql` and `script/标版/optimize/Sp_Calc_sOdt.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sOis.md b/en/docs/auto-catalog/procedures/Sp_Calc_sOis.md index 65b3e3d..22a7de0 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sOis.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sOis.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 发外加工流程 / 移动端管理 → 发外加工确认 — outsourced-process confirmation audit / un-audit on `OpsOutsideProcessSlave`/`OpsOutsideInStoreMaster`. Bound on three modules: `工序发外确认`, `发外报工(mobile单据)`, and `工序发外确认单据`. Approving a confirmation commits that the outsourced step has returned and is acceptable to count against the work-order progress and (if knife-mould tooling was loaned) updates the tool's location/inventory. + +**What it does:** Defaults the IN params, branches on `iFlag`. On `iFlag=1` flips `OpsOutsideProcessSlave.bCheck=1`, `Update MftWorkOrderProcess` to back-write the confirmed completed qty onto the work-order's process slave (advancing the route), `Update OpsOutsideInStoreMaster` to mark the inbound row checked, and `Update QlyOutSideProductTestSlave` to seed the QC inspection rows. If knife-moulds were issued: `INSERT INTO EleKnifeMould`/`eleknifemouldproduct` + `UPDATE EleKnifeMould` to track the tool returning to in-house custody. `iFlag=0` reverses each. + +**Invocation:** Bound to `gdsmodule.sProcName` on three modules: `工序发外确认` (sId `192116810113315234275562360`) under 发外加工流程, `发外报工(mobile单据)` (sId `101251240115015952158106410`) and `工序发外确认单据` (sId `101251240115016182844497490`) under 移动端管理 → 功能操作. All three share `Sp_Check_sOis` / `Sp_beforeSave_sOis`. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on 审核/反审核. xly-src ships `script/标版/30100101/Sp_Calc_sOis.sql`, `script/标版/optimize/Sp_Calc_sOis.sql`, an upgrade patch under `script/标版/upgrade/20220126-2861-仓库冻结后,入库、领料、送货单不可消审/`, and a customer-override at `script/客户/千彩/Sp_Calc_sOis.sql` — confirm which is deployed before relying on the optimize variant. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sOiv.md b/en/docs/auto-catalog/procedures/Sp_Calc_sOiv.md index c256c93..03178b8 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sOiv.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sOiv.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 发外加工流程 / 外协管理 → 外协单据 → 发外发票 — outsourced-process supplier-invoice audit / un-audit on `OpsOutsideInvoiceMaster`. When the outsourcing vendor sends an invoice for completed steps, finance audits the invoice doc to register the payable, post the operator KPI, and clear the check-rows against `OpsOutsideCheckingSlave`. + +**What it does:** Defaults the IN params, branches on `iFlag`. On `iFlag=1` flips `OpsOutsideInvoiceMaster.bCheck=1`, writes a KPI row to `kpidetail` for the auditing user, `Update OpsOutsideCheckingSlave` to mark the matched checking rows reconciled, `Update CahFinancialAdjust` / `Update CahSupplyInit` to seed the finance-side adjust and supplier-initial rows, then writes the payable into `CahPaymentables`. `iFlag=0` reverses by `Delete FROM CahPaymentables` plus the symmetric back-outs. + +**Invocation:** Bound to `gdsmodule.sProcName` on two sibling modules: `发外发票` (sId `101251168116315832142387420`) under 发外加工流程 and `发外发票(新)` (sId `1012521165114317002882431280`) under 外协管理 → 外协单据. The legacy one also has `Sp_Check_sOiv` / `Sp_beforeSave_sOiv` plus a `Sp_beforeSave_sOiv` delete hook; the (新) variant is leaner. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on 审核/反审核. xly-src ships an upgrade patch at `script/标版/upgrade/20220104审核去除结账校验/Sp_Calc_sOiv.sql` (removed close-of-period validation) — verify which body is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sOpc.md b/en/docs/auto-catalog/procedures/Sp_Calc_sOpc.md index d9c4075..180c35e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sOpc.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sOpc.md @@ -1,9 +1,9 @@ # `Sp_Calc_sOpc` (procedure) -> @author:zhucx - - @date: 2022/12/02 - +> @author:zhucx + + @date: 2022/12/02 + @describe: 发外加工 @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Four-way outsourced-process dispatch audit / un-audit on `opsoutsideprocessmaster`/`opsoutsideprocessslave`. Bound on four sibling modules across 发外加工流程, 模具管理, and 成品库存: `工序发外`, `整单发外`, `合格证登记`, `刀模外发单据`. Approving the dispatch commits that the listed processes / knife-moulds / 合格证 sheets have left the plant for the named vendor; the operation back-writes the dispatched qty onto the work-order route, locks the linked sales-order slave so it can't be cancelled mid-outsourcing, and (for 刀模) reduces the in-house tool inventory. + +**What it does:** Defaults the IN params, branches on `iFlag`. On `iFlag=1` flips `opsoutsideprocessmaster.bCheck=1` and `OpsOutsideProcessSlave` rows, `Update MftWorkOrderProcess` to back-write the dispatched qty onto the work-order's process slave (so progress dashboards see the outsourcing in-flight), `Update salsalesorderslave` to mark the linked sales-order line as constrained, and `Update EleKnifeMould` to debit the tool's in-house count when knife-moulds are dispatched. `iFlag=0` reverses each. Note that `整单发外` is bound with a different `Sp_Check_sOpp`/`Sp_beforeSave_sOpp` pair — the validators differ even though the audit body is shared. + +**Invocation:** Bound to `gdsmodule.sProcName` on four modules: `工序发外` (sId `192116810113315232400087230`) under 发外加工流程 (with `Sp_Check_sOpc` / `Sp_beforeSave_sOpc`), `整单发外` (sId `192116810113315234963208090`) under 发外加工流程 (with `Sp_Check_sOpp` / `Sp_beforeSave_sOpp` — note the **`sOpp`** prefix), `合格证登记` (sId `101251240115016148599285930`) under 成品库存 → 成品库单据, and `刀模外发单据` (sId `172129113112117455565837690`) under 模具管理. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on 审核/反审核. xly-src ships `script/标版/30100101/Sp_Calc_sOpc.sql`, `script/标版/optimize/Sp_Calc_sOpc.sql`, and an upgrade patch at `script/标版/upgrade/20220104审核去除结账校验/Sp_Calc_sOpc.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sOpi.md b/en/docs/auto-catalog/procedures/Sp_Calc_sOpi.md index 7acf7e7..9b046b6 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sOpi.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sOpi.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** KPI流程操作菜单 → 发外加工流程 → 整单发外入库 — outsource-processing finished-goods receipt audit on `OpsOutsideInStoreMaster`. After material is sent out (整单发外) and the vendor returns it as a finished sub-assembly or rework, this proc audits the inbound receipt; on approval it posts the received qty against the originating `mftworkorderslave` line and (when configured) writes the operator's KPI. + +**What it does:** Validates `sGuid`, refuses when `bInvalid=1` or when the master is already at the target `bCheck` state. On `iFlag=1` it sets `bCheck=1, sStatus=1, sCheckPerson, tCheckDate=NOW()` on `OpsOutsideInStoreMaster` and its `opsoutsideinstoreslave` rows, joins back to `mftworkorderslave` to accumulate received quantity, optionally `INSERT`s a `kpidetail` row when `gdsmodule.bKpi` is on, and `CALL`s `Sp_System_CheckFlow` / `Sp_Bill_Used` for workflow + consumption. `iFlag=0` reverses the flags. + +**Invocation:** Bound to `gdsmodule.sProcName` on `整单发外入库` (sId `192116810113315235917608210`) under 发外加工流程. Dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the 审核/反审核 button — the standard `Sp_Calc_s` slot. Install scripts ship at `script/标版/30100101/Sp_Calc_sOpi.sql` with a paired `Sp_Check_sOpi.sql` pre-flight guard. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sOpi1.md b/en/docs/auto-catalog/procedures/Sp_Calc_sOpi1.md index 06f74b0..01539d3 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sOpi1.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sOpi1.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Audit-toggle variant for 整单发外入库 (`OpsOutsideInStoreMaster`) — operates on the same outsource-processing receipt that `Sp_Calc_sOpi` covers, with a slightly different qty-rollup branch on `mftworkorderslave`. Likely a forked copy kept for a customer-specific tweak or an older revision. + +**What it does:** Same shape as `Sp_Calc_sOpi`: validates `sGuid`, refuses when `bInvalid=1` or already at the target `bCheck` state, then flips `bCheck/sStatus/sCheckPerson/tCheckDate` on `OpsOutsideInStoreMaster` + `opsoutsideinstoreslave` and reconciles received qty against `mftworkorderslave`. No KPI insert. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName/sSaveProName`, `gdsconfigformmaster` form-master, sibling-routine or xly-src reference points at `Sp_Calc_sOpi1` — the live 整单发外入库 module routes to `Sp_Calc_sOpi`. Candidate for maintainer audit: confirm whether any tenant override script binds this and drop it if not. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sOpkg.md b/en/docs/auto-catalog/procedures/Sp_Calc_sOpkg.md index 7520ecb..657a3ba 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sOpkg.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sOpkg.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** KPI流程操作菜单 → 发外加工流程 → 发外对账 — outsource-processing reconciliation audit on `opsoutsidecheckingmaster`. After 发外入库 / 发外确认 lines accumulate, the 发外对账 doc consolidates them for AP settlement with the vendor; this proc audits the consolidation, posts a 财务调整 row when adjustments are recorded, and (when configured) writes the operator's KPI. + +**What it does:** Validates `sGuid`/`bInvalid`, guards the `bCheck` toggle, then `Update`s `opsoutsidecheckingmaster` + `opsoutsidecheckingslave` to flip `bCheck/sStatus/sCheckPerson/tCheckDate`. Touches `cahfinancialadjustslave` to reflect adjustment amounts back to financial-adjustment slave rows, reads `gdsmodule` + `SysSystemSettings` to decide on `INSERT INTO kpidetail`, and `CALL`s `Sp_System_CheckFlow` / `Sp_Bill_Used` on the standard approval/consumption hooks. `iFlag=0` reverses the flags. + +**Invocation:** Bound to `gdsmodule.sProcName` on `发外对账` (sId `192116810113315235850403280`) under 发外加工流程. Dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)`. Multiple deployment variants ship under `xly-src/script/标版/`: `30100101/Sp_Calc_sOpkg.sql` (current), `optimize/Sp_Calc_sOpkg.sql` (perf patch), `20250616/Sp_Calc_sOpkg(old).sql` (legacy), and `upgrade/20220104审核去除结账校验/Sp_Calc_sOpkg.sql` (removed accounting-period guard) — verify which is live. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sOpn.md b/en/docs/auto-catalog/procedures/Sp_Calc_sOpn.md index 88549df..0064964 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sOpn.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sOpn.md @@ -1,9 +1,9 @@ # `Sp_Calc_sOpn` (procedure) -> @author:zhucx - - @date: 2022/12/02 - +> @author:zhucx + + @date: 2022/12/02 + @describe: 成外购到货/发外到货 @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Audit handler for an 成外购到货 / 发外到货 (outsource-processing arrival) doc on `opsoutsidearrivemaster` — body header comments declare authorship `zhucx 2022/12/02`. On approval it freezes the arrival rows and rolls received qty back into `opsoutsideprocessslave` (the original 工序发外 line) so the dispatching record knows what came back. + +**What it does:** Standard `Sp_Calc_*` shape — validates `sGuid`, guards on `bInvalid`/`bCheck`, then `Update opsoutsidearrivemaster` and `opsoutsidearriveslave` to set `bCheck=1, sStatus=1, sCheckPerson, tCheckDate=NOW()`; joins back to `opsoutsideprocessslave` to accumulate received quantity. `iFlag=0` reverses. + +**Invocation:** Status: appears orphaned. The live 发外到货 module (sId `101251240115016068101173850`) under 质量管理 → 质量管理单据 is bound to `Sp_Calc_sOsa`, not `Sp_Calc_sOpn`. No `gdsmodule.sProcName/sSaveProName`, form-master, or sibling-routine reference picks `Sp_Calc_sOpn`. Only xly-src install scripts (`script/标版/30100101/Sp_Calc_sOpn.sql`, `script/标版/optimize/Sp_Calc_sOpn.sql`) ship the body. Candidate for maintainer audit — likely a superseded predecessor of `Sp_Calc_sOsa`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sOpn1.md b/en/docs/auto-catalog/procedures/Sp_Calc_sOpn1.md index f5b8854..a0fb5e2 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sOpn1.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sOpn1.md @@ -1,9 +1,9 @@ # `Sp_Calc_sOpn1` (procedure) -> @author:zhucx - - @date: 2022/12/02 - +> @author:zhucx + + @date: 2022/12/02 + @describe: 成外购到货/发外到货 @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Audit handler for 成外购到货/发外到货 send-back variant on `opsoutsidearriveshmaster` ("sh" suffix = 送货 send-back line, i.e. the inbound subset that ships back into stores). Header comments declare authorship `zhucx 2022/12/02`. Sister of `Sp_Calc_sOpn`, which targets `opsoutsidearrivemaster`. + +**What it does:** Same `Sp_Calc_*` shape — validates `sGuid`, guards on `bInvalid`/`bCheck`, `Update opsoutsidearriveshmaster` + `opsoutsidearriveshslave` flipping `bCheck/sStatus/sCheckPerson/tCheckDate`. No qty roll-up beyond the master/slave flip in the body sampled. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName/sSaveProName`, `gdsconfigformmaster` form-master, sibling-routine, or xly-src reference points at `Sp_Calc_sOpn1`. Candidate for maintainer audit — likely a forked variant left in place when the active 发外到货 path was consolidated onto `Sp_Calc_sOsa`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sOpp.md b/en/docs/auto-catalog/procedures/Sp_Calc_sOpp.md index d1475b0..e089575 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sOpp.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sOpp.md @@ -1,9 +1,9 @@ # `Sp_Calc_sOpp` (procedure) -> @author:zhucx - - @date: 2022/12/02 - +> @author:zhucx + + @date: 2022/12/02 + @describe: 成品外购审核 @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Audit handler for 成品外购审核 (finished-goods outsource-purchase approval) on `OpsOutsideProcessMaster` — the 工序发外 / 整单发外 dispatch master. Header comments declare authorship `zhucx 2022/12/02`. Sister of `Sp_Calc_sOpc`, which is the proc actually wired to the 工序发外 / 整单发外 modules today. + +**What it does:** Standard audit-toggle shape — validates `sGuid`/`bInvalid`, then `Update`s `OpsOutsideProcessMaster` + `OpsOutsideProcessSlave` flipping `bCheck/sStatus/sCheckPerson/tCheckDate`. Joins to the outsource slave to keep related records consistent. + +**Invocation:** Status: appears orphaned. The 整单发外 module (sId `192116810113315234963208090`) and 工序发外 module (sId `192116810113315232400087230`) both bind `sProcName=Sp_Calc_sOpc` and `sSaveProName=Sp_Check_sOpp` — note `sOpp` here is the pre-save guard, not the audit. No `gdsmodule.sProcName/sSaveProName`, form-master, sibling routine, or xly-src reference (beyond the install scripts at `script/标版/30100101/` and `script/标版/optimize/`) targets `Sp_Calc_sOpp`. Candidate for maintainer audit — likely a superseded predecessor of `Sp_Calc_sOpc`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sOppbecome.md b/en/docs/auto-catalog/procedures/Sp_Calc_sOppbecome.md index cbe9a57..3f6d921 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sOppbecome.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sOppbecome.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Audit handler for 成品外购价格变更 (outsource-processing price-change) on `opsoutsideprocessbecomemaster`. After AP discovers the vendor priced a 工序发外 / 整单发外 line differently from the dispatch record, this doc rewrites material price/amount/tax across the affected `opsoutsideprocessslave` and `opsoutsideinstoreslave` rows so the downstream 发外对账 / settlement reflects the new price. + +**What it does:** Validates `sGuid`, refuses re-audit when `bCheck=1`, then flips `bCheck/sStatus/sCheckPerson/tCheckDate` on `opsoutsideprocessbecomemaster`. Joins `opsoutsideprocessbecomeslave` (the change-rows) back to `opsoutsideprocessslave` (dispatch) and `opsoutsideinstoreslave` (receipts), rewriting `dMaterialsPrice / dMaterialsMoney / dMaterialsNoTaxPrice / dMaterialsNoTaxMoney / dMaterialsTaxMoney / dMaterialsTaxForeignMoney / dMaterialsForeignMoney` against `sistax.dRate`. `iFlag=0` reverses the flags but does not unwind the rewritten prices. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName/sSaveProName`, `gdsconfigformmaster` form-master, sibling-routine, or xly-src reference points at `Sp_Calc_sOppbecome`. Candidate for maintainer audit — confirm whether the 成品外购价格变更 feature ships in this tenant's UI; the proc body is consistent and ready to run if a module is later bound. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sOrderBgd.md b/en/docs/auto-catalog/procedures/Sp_Calc_sOrderBgd.md index 8e4b23a..040c531 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sOrderBgd.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sOrderBgd.md @@ -27,4 +27,12 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Two-bind audit for 订单变更单据 — sales-order change request. The 订单变更单 is the formal record of an in-flight 销售订单 amendment (qty / price / spec / due-date change); on approval it back-writes the change into `salsalesordermaster` so downstream production / planning sees the new terms. Also serves the 模具管理 → 6.内部版材管理 → 版材内部加工单 module (sibling form reusing the same change-doc pattern). + +**What it does:** Standard `Sp_Calc_*` validate-and-flip — guards `sGuid`/`bInvalid`/`bCheck`, then `Update`s `salsalesorderchangemaster` to set `bCheck=1, sStatus=1, sCheckPerson, tCheckDate=NOW()`, and `UPDATE salsalesordermaster` to apply the changed fields back onto the parent sales-order. `iFlag=0` reverses the flags. + +**Invocation:** Bound to `gdsmodule.sProcName` on: +- `订单变更单据` (sId `101251240115016233151134120`) — 销售管理 → 销售单据 +- `版材内部加工单` (sId `101251240115016284068261640`) — 模具管理 → 6.内部版材管理 + +Dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button. Install scripts ship at `script/标版/30100101/Sp_Calc_sOrderBgd.sql` and `script/标版/optimize/Sp_Calc_sOrderBgd.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sOsa.md b/en/docs/auto-catalog/procedures/Sp_Calc_sOsa.md index 18462d5..aea635c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sOsa.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sOsa.md @@ -27,4 +27,12 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Two-bind audit for the outsource arrival doc on `opsoutsidearrivemaster` — covers the 质量管理 → 质量管理单据 → 发外到货 form (vendor delivery returning material from a 工序发外 dispatch) and the 质量管理 → 发外进料检验(IQC) → 已发外未到货任务列表 list. The page's `> 采购到货` label is misleading: the wired table is the 发外 (outsource) arrival, not `PurPurchaseArrive*`. + +**What it does:** Standard validate-and-flip — guards `sGuid`/`bInvalid`/`bCheck`, then `Update opsoutsidearrivemaster` to set `bCheck=1, sStatus=1, sCheckPerson, tCheckDate=NOW()`. `iFlag=0` reverses the flags. No additional qty roll-up in the sampled body. + +**Invocation:** Bound to `gdsmodule.sProcName` on: +- `发外到货` (sId `101251240115016068101173850`) — 质量管理 → 质量管理单据 +- `已发外未到货任务列表` (sId `101251240115016068102785410`) — 质量管理 → 发外进料检验(IQC) + +Dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button. Install scripts ship at `script/标版/30100101/Sp_Calc_sOsa.sql` and `script/标版/optimize/Sp_Calc_sOsa.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sOutProcess.md b/en/docs/auto-catalog/procedures/Sp_Calc_sOutProcess.md index 530f431..669878f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sOutProcess.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sOutProcess.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Audit handler for 补模具发外 (supplementary mould outsource-dispatch) on `mftoutprocessmaster` — the supplementary-dispatch master that books extra 工序 to a vendor when the planned outsource quantity was insufficient. On approval it freezes the master/slave rows and chains to `Sp_Exec_sOutProcess` to apply the qty roll-up; on un-audit it rolls back the dispatch quantity on `mftworkorderprocess`. + +**What it does:** Validates `sGuid`, refuses re-audit when `bCheck=1`, sets `bCheck=1, sStatus=1, sCheckPerson, tCheckDate=NOW()` on `mftoutprocessmaster`, then `CALL Sp_Exec_sOutProcess(iFlag, iTmpCheck, sFormGuid, sGuid, sLoginId, @sReturn, sBrId, sSuId, @sCode)` to execute the dispatch-qty roll-up. Reverse branch (`iFlag=0`) zeroes the audit fields and joins `mftoutprocessslave` to `mftworkorderprocess` to subtract `dOutsideQty -= iOutsideQty`. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName/sSaveProName`, `gdsconfigformmaster` form-master, sibling routine, or xly-src reference points at `Sp_Calc_sOutProcess`. Candidate for maintainer audit; `Sp_Exec_sOutProcess` is also referenced by name only and may share the same fate. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPaj.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPaj.md index 494b183..e8dcf3a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPaj.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPaj.md @@ -27,4 +27,12 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Two-bind audit for 成品调拨 (finished-goods inter-warehouse transfer) on `pitproductadjustmaster`/`PitProductAdjustSlave`. Serves the 成品库存 → 成品库单据 → 成品调拨 doc and the parent 成品调拨(入) report list. On approval it freezes the transfer and posts inventory movements into `EleProductStock_master` (the electronic stock ledger) using a cursor (`Cur_OrderSlave`) over the slave lines. + +**What it does:** Standard validate-and-flip with stock-side mutation — guards `sGuid`/`bInvalid`/`bCheck`, then `Update PitProductAdjustMaster` + `PitProductAdjustSlave` to set `bCheck=1, sStatus=1, sCheckPerson, tCheckDate=NOW()`. Opens a cursor over the slave rows, for each line `INSERT INTO EleProductStock_master` to record the from-warehouse decrement and to-warehouse increment, and links the movements back via `sParentId`/`sSlaveId`. `iFlag=0` reverses the flags and the stock entries. + +**Invocation:** Bound to `gdsmodule.sProcName` on: +- `成品调拨` (sId `192116810113315264648983180`) — 成品库存 → 成品库单据 +- `成品调拨(入)` (sId `192116810111915318167333520`) — 成品库存 (entry-side variant) + +Dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)`. The body is large (~48K chars) due to the per-line cursor work and conditional stock-cost rebuild — defer to `script/标版/30100101/Sp_Calc_sPaj.sql` plus the optimize patch for the canonical version. Paired pre-flight guard ships as `Sp_Check_sPaj.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPca.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPca.md index e05269d..abd5a1c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPca.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPca.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料库存 → 材料库单据 → 采购到货(送检)单据 — audit handler for the purchasing arrival-for-inspection doc on `PurPurchaseArriveMaster`. This is the goods-receipt that goes to QC inspection rather than directly into stock; on approval the master row is frozen and the inspection workflow can pick the lines up. + +**What it does:** Standard `Sp_Calc_*` validate-and-flip — guards `sGuid`/`bInvalid`/`bCheck`, then `Update PurPurchaseArriveMaster` to set `bCheck=1, sStatus=1, sCheckPerson, tCheckDate=NOW()`. `iFlag=0` reverses the flags. + +**Invocation:** Bound to `gdsmodule.sProcName` on `采购到货(送检)单据` (sId `101251240115016068096930620`) — 材料库存 → 材料库单据. Dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button. Install script ships at `script/标版/30100101/Sp_Calc_sPca.sql`. Note: a sibling `Sp_Calc_sPca1` (orphaned) targets `PurPurchaseArriveshMaster` — the 送货 send-back variant. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPca1.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPca1.md index f823e1f..3e960cc 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPca1.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPca1.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Audit handler for 供应商送货 (vendor delivery / "sh" send-back) on `PurPurchaseArriveshMaster` — the supplier-delivery doc that is the inbound counterpart of a `PurPurchaseArriveMaster` (送检) cycle. Body is largely the same shape as `Sp_Calc_sPca` but the qty-roll-up that would write back to `purpurchaseorderslave.dArriveAuxiliaryQty/dArriveQty` is commented out (2023-06-26 注释) along with the `Sp_Bill_Used` check (2023-07-04 注释). + +**What it does:** Standard validate-and-flip — guards `sGuid`/`bInvalid`/`bCheck`, then `Update PurPurchaseArriveshMaster` to set `bCheck=1, sStatus=1, sCheckPerson, tCheckDate=tCheckTime`. Reverse branch (`iFlag=0`) zeroes the audit fields. All cross-table side-effects in the body are commented out. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName/sSaveProName`, `gdsconfigformmaster` form-master, sibling-routine, or xly-src reference points at `Sp_Calc_sPca1`. Candidate for maintainer audit — the commented-out code suggests the proc was carved off `Sp_Calc_sPca` for the 送货 send-back path and then deferred when the qty roll-up was reworked. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPck.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPck.md index 929a203..71a6984 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPck.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPck.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成品库存 → 成品库单据 → 成品盘点 — audit handler for the finished-goods stocktaking doc on `PitProductCheckMaster`/`PitProductCheckSlave`. The 成品盘点 records the on-hand vs. system-recorded gap per stock line; on approval it freezes the count and (in the canonical body) posts the variance against the electronic stock ledger so the next cost run sees corrected quantities. + +**What it does:** Standard validate-and-flip — guards `sGuid`/`bInvalid`/`bCheck`, then `UPDATE pitproductcheckmaster` + `Update PitProductCheckSlave` to set `bCheck=1, sStatus=1, sCheckPerson, tCheckDate=NOW()`. Joins `PitProductCheckSlave` back to the stock-ledger side to apply the variance row by row. `iFlag=0` reverses the flags. + +**Invocation:** Bound to `gdsmodule.sProcName` on `成品盘点` (sId `192116810113315264733417750`) — 成品库存 → 成品库单据. Dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button. Install scripts at `script/标版/30100101/Sp_Calc_sPck.sql` and `script/标版/optimize/Sp_Calc_sPck.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPct.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPct.md index e92d5eb..86d385b 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPct.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPct.md @@ -27,4 +27,12 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Two-bind audit for the 工序检验 (in-process / process inspection) doc on `QlyProcessTestMaster`. Serves both the desktop 质量管理 → 质量管理单据 → 工序检验单据 and the mobile 移动端管理 → 现场 → 功能操作 → 工序检验(单据). On approval it freezes the inspection result and (when configured) writes the inspector's KPI row so the operator gets credit for the inspection event. + +**What it does:** Validates `sGuid`, refuses re-audit when `bCheck=1`, then `Update QlyProcessTestMaster` to set `bCheck=1, sStatus=1, sCheckPerson, tCheckDate=NOW()`; joins back to `QlyProcessTestMaster` aliases for related-record consistency, reads `gdsmodule` + `SysSystemSettings` to decide whether to `INSERT INTO kpidetail`, and `CALL`s the standard workflow/consumption hooks (`Sp_System_CheckFlow`, `Sp_Bill_Used`). `iFlag=0` reverses the flags. + +**Invocation:** Bound to `gdsmodule.sProcName` on: +- `工序检验单据` (sId `15818303350003257780407017498600`) — 质量管理 → 质量管理单据 +- `工序检验(单据)` (sId `101251240115016197764940500`) — 移动端管理 → 现场 → 功能操作 + +Dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)`. Install scripts ship at `script/标版/30100101/Sp_Calc_sPct.sql` and `script/标版/optimize/Sp_Calc_sPct.sql`. Variants `Sp_Calc_sPct1` (首检/印刷大检), `Sp_Calc_sPct2` (巡检), `Sp_Calc_sPct3` (OEE 机长首检) cover different QC modes against the same table. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPct1.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPct1.md index 709acc3..9b23817 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPct1.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPct1.md @@ -1,8 +1,8 @@ # `Sp_Calc_sPct1` (procedure) -> @author:zhucx - @date:2021.11.21 封存 - @describe: +> @author:zhucx + @date:2021.11.21 封存 + @describe: 1.移动端-生产首检-保存自动调用本过程,当系统设定中本单据为自动审核时 @@ -30,4 +30,13 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Three-bind audit for the QC 首检 / 印刷大检 family on `QlyProcessTestMaster`. Header authorship: `zhucx 2021.11.21 封存`. Serves the mobile 品质首检 form, the desktop 品质首检 PC variant, and the mobile 印刷大检 form. The 首检 doc records the first-piece inspection at the start of a run; on approval it not only freezes the inspection record but also flips `mftproductionplanslave.bFirst1Inspection` so the production-plan slave knows the first-piece check was passed. + +**What it does:** Standard validate-and-flip — guards `sGuid`/`bInvalid`/`bCheck`, sets `bCheck=1, sStatus=1, sCheckPerson, tCheckDate=NOW()` on `QlyProcessTestMaster`. Joins `mftproductionplanslave` ← `plc_machinedata` ← `QlyProcessTestMaster` to mark `bFirst1Inspection=1` on the matching production-plan slave row, then (when configured) `INSERT INTO kpidetail` and `CALL`s the workflow hook. `iFlag=0` reverses both the master flags and the production-plan flag. + +**Invocation:** Bound to `gdsmodule.sProcName` on: +- `品质首检(mobile单据)` (sId `12012615914116373957014740`) — 移动端管理 → 现场 → 功能操作 +- `品质首检pc` (sId `101801153119616487115552840`) — 质量管理 → 过程质量控制(PQC) +- `印刷大检(mobile单据)` (sId `101801153119616509371170730`) — 移动端管理 → 现场 → 功能操作 + +Dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)`. Auto-invoked from the mobile-side save path when the module's auto-audit flag is on (per the header note). Install scripts at `script/标版/30100101/Sp_Calc_sPct1.sql` and `script/标版/optimize/Sp_Calc_sPct1.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPct2.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPct2.md index 1871899..8b634d6 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPct2.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPct2.md @@ -1,8 +1,8 @@ # `Sp_Calc_sPct2` (procedure) -> @author:zhucx - @date:2021.11.21 封存 - @describe: +> @author:zhucx + @date:2021.11.21 封存 + @describe: 1.移动端-生产巡检-保存自动调用本过程,当系统设定中本单据为自动审核时 @@ -30,4 +30,12 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Two-bind audit for the QC 巡检 (patrol / in-process inspection) family on `QlyProcessTestMaster`. Header authorship: `zhucx 2021.11.21 封存`. Serves the mobile 品质巡检 form and the desktop 品质巡检 PC variant. 巡检 records sample-check results during the run (after 首检, before 末检); on approval the inspection is frozen and the production-plan slave's patrol flag is updated. + +**What it does:** Validates `sGuid`, refuses re-audit when `bCheck=1`, then `Update QlyProcessTestMaster` to set `bCheck=1, sStatus=1, sCheckPerson, tCheckDate=NOW()`. Joins back through `mftproductionplanslave` to flag the patrol pass on the matching production-plan slave. `iFlag=0` reverses the flags. + +**Invocation:** Bound to `gdsmodule.sProcName` on: +- `品质巡检(mobile单据)` (sId `12012615914116371307197380`) — 移动端管理 → 现场 → 功能操作 +- `品质巡检PC` (sId `101801153119616487082337640`) — 质量管理 → 过程质量控制(PQC) + +Dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)`. Auto-invoked from the mobile save path when the module's auto-audit flag is on. Install scripts at `script/标版/30100101/Sp_Calc_sPct2.sql` and `script/标版/optimize/Sp_Calc_sPct2.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPct3.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPct3.md index 2763e2c..c283a56 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPct3.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPct3.md @@ -1,8 +1,8 @@ # `Sp_Calc_sPct3` (procedure) -> @author:zhucx - @date:2021.11.21 封存 - @describe: +> @author:zhucx + @date:2021.11.21 封存 + @describe: 1.OEE端-生产首检-保存自动调用本过程,当系统设定中本单据为自动审核时 @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** OEE管理 → 机长首检登记(OEE) — audit handler for the OEE-side 生产首检 doc on `QlyProcessTestMaster`. Header authorship: `zhucx 2021.11.21 封存`. The OEE machine-data flow lets the machine operator (机长) self-register a first-piece inspection from the OEE terminal; on approval this proc freezes the inspection record and flips the matching `mftproductionplanslave.bFirst1Inspection` so the production line sees the first-piece check has cleared. + +**What it does:** Standard `Sp_Calc_*` validate-and-flip — guards `sGuid`/`bInvalid`/`bCheck`, sets `bCheck=1, sStatus=1, sCheckPerson, tCheckDate=NOW()` on `QlyProcessTestMaster`. Joins `mftproductionplanslave` ← `plc_machinedata` ← `QlyProcessTestMaster` (the OEE-side join, distinct from the desktop `Sp_Calc_sPct1` join) to mark `bFirst1Inspection=1`. `iFlag=0` reverses the flags. + +**Invocation:** Bound to `gdsmodule.sProcName` on `机长首检登记(OEE)` (sId `12012615914116373127639240`) — OEE管理. Dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)`. Auto-invoked from the OEE-terminal save path when the module's auto-audit flag is on (per the header note). Install scripts at `script/标版/30100101/Sp_Calc_sPct3.sql` and `script/标版/optimize/Sp_Calc_sPct3.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPctOEE.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPctOEE.md index 10598fa..7d90bd7 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPctOEE.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPctOEE.md @@ -1,8 +1,8 @@ # `Sp_Calc_sPctOEE` (procedure) -> @author:zhucx - @date:2021.11.21 封存 - @describe: +> @author:zhucx + @date:2021.11.21 封存 + @describe: 1.移动端-生产首检-保存自动调用本过程,当系统设定中本单据为自动审核时 @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Audit handler for an OEE-side 生产首检 doc on `QlyProcessTestMaster`. Header authorship: `zhucx 2021.11.21 封存`. Same business shape as `Sp_Calc_sPct3` (OEE 机长首检登记) — validates the inspection master, flips audit flags, and joins through `plc_machinedata` to mark `mftproductionplanslave.bFirst1Inspection=1`. Likely the original name before the production-bound version was renamed to `Sp_Calc_sPct3`. + +**What it does:** Validates `sGuid`, guards on `bInvalid` and on existing `bCheck`. Additionally checks `SysLocking` (refuses when the doc is row-locked, returning the localised `SysLocking` error). On `iFlag=1` it `Update`s `QlyProcessTestMaster` to set the audit fields and joins through `plc_machinedata` ← `QlyProcessTestMaster` to flag `mftproductionplanslave.bFirst1Inspection=1`. `iFlag=0` reverses the flags. + +**Invocation:** Status: appears orphaned. The live OEE 机长首检登记(OEE) module (sId `12012615914116373127639240`) is bound to `Sp_Calc_sPct3`, not `Sp_Calc_sPctOEE`. No `gdsmodule.sProcName/sSaveProName`, `gdsconfigformmaster` form-master, sibling routine, or xly-src reference picks `Sp_Calc_sPctOEE`. Candidate for maintainer audit — almost certainly a superseded predecessor of `Sp_Calc_sPct3`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPdt.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPdt.md index af1d899..4981fc4 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPdt.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPdt.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量管理 → 质量管理单据 → 成品检验单据 — finished-goods inspection audit (审核/反审核) on `QlyProductTestMaster`. Also serves the variants 发货检验单据 (delivery-inspection) and 成品检验(mobile单据) under the 功能操作 mobile branch. + +**What it does:** Guards on `bInvalid`/`bCheck` and `SysLocking`, reads `SysSystemSettings.CkxProductInSotrecheck` to decide whether to run `Sp_financialClosing_BtnEventCheckout_CheckInstore` and `Sp_CheckChild_sPdt` (cross-checking the upstream stock-in master/process for the inspection batch). On `iFlag=1` flips `bCheck=1, sStatus=1, sCheckPerson, tCheckDate` on `QlyProductTestMaster`, propagates `tCheckedDate` into `eleproductstock`, and — when `iTestResult` flags a rejection — adjusts `opsoutsideprocessslave.dCheckQty`/`dRetuAuxiliaryQty` (returning quantity to the outsourced-process upstream); when `iLastInStock=1` writes `sLossMemo, sLossPerson` back to `mftworkorderslave`. `iFlag=0` runs `Sp_Bill_Used` to refuse uncheck if downstream rows exist, then symmetrically clears the flags. + +**Invocation:** Bound to `gdsmodule.sProcName` on 成品检验单据 (sId `15831288240001057224508428921300`), 成品检验(单据) and 成品检验(mobile单据) under 功能操作, plus 发货检验单据 — all dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button. `script/标版/30100101/Sp_Calc_sPdt.sql` is the install script. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPdtFJ.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPdtFJ.md index 8a5f541..62002c4 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPdtFJ.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPdtFJ.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量管理 → finished-goods re-inspection audit (成品复检审核) on `QlyProductTestMaster` — a stripped-down sibling of `Sp_Calc_sPdt` covering re-test of already-tested finished goods. The comment `成品复检审核` distinguishes it from the initial inspection variant. + +**What it does:** Guards on `sGuid`, `SysLocking`, and `bInvalid` against `QlyProductTestMaster`. On `iFlag=1` flips `bCheck=1, sStatus=1, sCheckPerson, tCheckDate` and propagates `tCheckedDate` to `eleproductstock` via `sSrcSlaveId`; on `iFlag=0` calls `Sp_Bill_Used` (form-key `SaleTrial`) to block uncheck when downstream rows exist, then clears the flags. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` binding, no `gdsconfigformmaster` references, no callers in `information_schema.ROUTINES`, no xly-src hits across all extensions. The `Sp_Calc_s` naming suggests it was a planned secondary-inspection variant of `Sp_Calc_sPdt` that was never wired into a form — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPin.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPin.md index 8ee62e7..c5b1fc8 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPin.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPin.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 → purchase-inquiry (采购询价单) audit on `PurPurchaseinquirymaster` — a lightweight check/uncheck for the inquiry-RFQ document that precedes a purchase order. + +**What it does:** Guards on `sGuid` only (no `bInvalid` or `SysLocking` checks). On `iFlag=1` confirms the row is not already `bCheck=1` then `Update PurPurchaseinquirymaster` to set `bCheck=1, sStatus=1, sCheckPerson, tCheckDate=NOW()`; reads `SysSystemSettings.CkxDefineCheck` but does not act on it (workflow not wired). `iFlag=0` symmetrically clears the flags. No KPI write, no downstream-bill scan. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` binding, no `gdsconfigformmaster` reference, no callers in `information_schema.ROUTINES`, no hits in xly-src across all extensions (not even an install script under `script/标版/`). Candidate for maintainer audit — the procedure exists in the DB but the 采购询价单 module has no form wired to it. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPis.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPis.md index 644c15d..0d35bad 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPis.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPis.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** KPI流程操作菜单 → 物料采购流程 → 采购入库 — purchase stock-in audit/un-audit on `PurPurchaseInStoreMaster`/`Slave`. The check posts the receipt into material stock and links it back to the purchase-order, arrival, reject, and quality-check upstream rows; the uncheck rolls it all back. + +**What it does:** Guards on `bInvalid`/`SysLocking`/`bFrozen` (accounting-period). On `iFlag=1`: deletes any stale `MitMaterialsStore`/`CahPaymentables` keyed to this bill, recomputes per-material stock movement (`call Sp_MaterialsPurchaseStoreVirtual`, `Update MitMaterialsStoreVirtual`/`elematerialsstock`), writes payable rows into `CahPaymentables`, updates last-price into `EleMaterials`/`EleMaterialsSupply`, propagates check-status into `PurPurchaseOrderSlave`/`PurPurchaseArriveSlave`/`PurPurchaseRejectSlave`/`QlyComeMaterialsTestSlave`, enforces `Sp_calc_materialsstoreLimit` (stock-limit refuse on negative), then flips `bCheck=1, sStatus=1` on the master/slave rows. `iFlag=0` calls `Sp_Bill_Used` to refuse uncheck when downstream rows exist, then symmetrically reverses. + +**Invocation:** Bound to `gdsmodule.sProcName` on 采购入库 (sId `192116810113315220315711060`, parent 物料采购流程) and 扫码入库(单据) (sId `101251240115016051704122330`, parent 功能操作) — dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button. Multiple upgrade scripts (`20220126-2861-仓库冻结后,入库、领料、送货单不可消审/Sp_Calc_sPis.sql`, `20250616/sp_calc_spis.sql`, `30100101/Sp_Calc_sPis.sql`) ship in xly-src — verify which is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPit.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPit.md index f9d25d6..7a6b4be 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPit.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPit.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 系统设置 → 期初设置 → 产品期初单据 — finished-product opening-balance audit on `PitProductInitMaster`/`Slave`. The check posts the opening profit/loss quantity into `PitProductStore` so the closing-period stock report reflects the initial inventory state. + +**What it does:** Guards on `bInvalid` against `PitProductInitMaster`. On `iFlag=1`: resets `PitProductInitSlave.dOriginalQty/dOriginalMoney/dProfitLossPrice = 0`, then computes `dProfitLossQty = dProductQty - dOriginalQty` and `dProfitLossMoney = dProductMoney - dOriginalMoney`; deletes any pre-existing `PitProductStore` row keyed on `sBillId=sGuid` and inserts a fresh stock-movement row per non-zero slave line (only when `dProfitLossQty <> 0 OR dProfitLossMoney <> 0`), backdating `tCreateDate` by `-1 MINUTE` to place it before the period start; enforces `Sp_calc_productstoreLimit` (returns `sCode=-8` on stock-shortage); then flips `bCheck=1, sStatus=1, sCheckPerson, tCheckDate` on the master. `iFlag=0` re-runs the limit check and clears the flags. + +**Invocation:** Bound to `gdsmodule.sProcName` on 产品期初单据 (sId `101251240115015991142363800`, parent 期初设置) — dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button. `script/标版/30100101/Sp_Calc_sPit.sql` is the install script. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPit1.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPit1.md index 1ba1986..289154e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPit1.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPit1.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Finance opening-balance — work-in-progress (在制品) opening import audit on `accProductDoingMaster`. The check freezes a WIP opening-balance row into the current accounting period (`sConfirmMonth`, `bConfirm=1`) so cost-accounting can roll forward; the procedure refuses a second check if another period's balance is already audited. + +**What it does:** Guards on `sGuid`, `SysLocking`, `bInvalid`. Loads `sCostPeriod` and reads `Fun_Sis_GetConstNew(…,'sPit1HaveAccountData')` to refuse audit when a row in a different `sCostPeriod` is already `bCheck=1`. On `iFlag=1` updates `accProductDoingMaster` to `bCheck=1, sStatus=1, sCheckPerson, tCheckDate=NOW(), sConfirmMonth=DATE_FORMAT(NOW(),'%Y%m'), bConfirm=1`. `iFlag=0` clears the flags. Mechanism mirrors `Sp_Calc_sPit2` (which targets `accproductinitmaster` for finished-product opening, not WIP). + +**Invocation:** Status: appears orphaned in the live database. No `gdsmodule.sProcName` binding, no `gdsconfigformmaster` reference, no callers in `information_schema.ROUTINES`. xly-src ships an install script (`script/标版/30100101/Sp_Calc_sPit1.sql`) but no Java/XML wiring — the 在制品期初(财务) module exists in scripts only. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPit2.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPit2.md index 4b19627..3209658 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPit2.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPit2.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Finance opening-balance — finished-product (在制品财务) opening import audit on `accproductinitmaster`. Identical comment to `Sp_Calc_sPit1` but targets the finished-product opening table rather than the WIP table; the check stamps the row into the current accounting period (`sConfirmMonth`, `bConfirm=1`). + +**What it does:** Guards on `sGuid`, `SysLocking`, `bInvalid` against `accproductinitmaster`. On `iFlag=1` updates `accproductinitmaster` to `bCheck=1, sStatus=1, sCheckPerson, tCheckDate=NOW(), sConfirmMonth=DATE_FORMAT(NOW(),'%Y%m'), bConfirm=1`. `iFlag=0` clears the flags. The cross-period refusal block present in `Sp_Calc_sPit1` is commented out here — sibling code suggests this variant intentionally permits multiple period rows. + +**Invocation:** Status: appears orphaned in the live database. No `gdsmodule.sProcName` binding, no `gdsconfigformmaster` reference, no callers in `information_schema.ROUTINES`. xly-src ships only an install script (`script/标版/30100101/Sp_Calc_sPit2.sql`) — no Java/XML wiring. Candidate for maintainer audit; possibly retired in favour of `Sp_Calc_sPit` (成品期初). diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPiv.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPiv.md index 771d5bd..509863f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPiv.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPiv.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 → 对账与结算 → 采购发票明细 (also 物料采购流程 → 采购发票) — purchase-invoice audit on `PurPurchaseInvoiceMaster`. The check posts the invoice into accounts-payable and back-stamps the linked checking master with the invoice number; the uncheck rolls back the payable row and KPI entries. + +**What it does:** Guards on `bInvalid`/`SysLocking`. Aggregates `dMaterialsMoney`+`dMaterialsTaxMoney` from `purpurchaseinvoiceslave`. On `iFlag=1`: when `SysSystemSettings.CkxDefineCheck=1` and `iTmpCheck<>1` iterates each slave through `Sp_System_CheckFlow` (multi-step approval workflow keyed on PurPurchaseInvoiceMaster/Slave/EleSupply/EleMaterials); deletes any prior `CahPaymentables` for `sBillId=sGuid` and inserts a fresh payable row with `dBillMoney=dTotalMoney, dCheckingMoney=dTaxMoney`; opens a cursor over each slave to write a `kpidetail` row (with operator from `sftlogininfo`) when the line carries `sSrcId`/`sSrcNo`/`tSrcDate`/`sUnTaskFormId`; stamps `sInvoiceNo` back into `purpurchasecheckingmaster` via the checking-slave→invoice-slave join; flips `bCheck=1, sStatus=1` on the master. `iFlag=0` symmetrically deletes `CahPaymentables` + `kpidetail` and clears the back-stamped `sInvoiceNo` to NULL. + +**Invocation:** Bound to `gdsmodule.sProcName` on 采购发票明细 (sId `19211681019715780440296680`, parent 对账与结算) and 采购发票 (sId `19211681019715782883617940`, parent 物料采购流程) — dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button. xly-src ships `script/标版/30100101/Sp_Calc_sPiv.sql` (install) and `script/标版/upgrade/20220104审核去除结账校验/Sp_Calc_sPiv.sql` (patch removing closing-period validation) — verify which is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPiv_copy1.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPiv_copy1.md index bd3ddd1..1371836 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPiv_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPiv_copy1.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_Calc_sPiv` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_Calc_sPiv` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPkg.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPkg.md index f18af46..1488614 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPkg.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPkg.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** KPI流程操作菜单 → 物料采购流程 → 采购对账 — purchase reconciliation (对账) audit on `PurPurchaseCheckingMaster`. The check matches the supplier's invoice/receipt against the system's stock-in records and posts the reconciliation row into the supplier-payables ledger; the uncheck rolls it back. + +**What it does:** Refuses audit when the master lacks `tInvoiceDate`, `tReceiveDate`, or `sInvoiceNo` (i.e. the invoice meta has not been filled in). On `iFlag=1`: optionally drives `Sp_System_CheckFlow` per slave when `CkxDefineCheck=1`, runs `Sp_Bill_Used` to verify no downstream rows block the audit, and updates supplier last-price into `EleMaterials`/`EleMaterialsSupply`; propagates the checking status into `CahSupplyInit`, `cahfinancialadjustslave`, `accmaterialsinitslave`, `PurPurchaseInStoreSlave`, `PurPurchaseRejectSlave`; finally flips `bCheck=1, sStatus=1` on `PurPurchaseCheckingMaster`. `iFlag=0` reverses. + +**Invocation:** Bound to `gdsmodule.sProcName` on 采购对账 (sId `192116810113315220489243410`, parent 物料采购流程) — dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button. xly-src ships `script/标版/30100101/Sp_Calc_sPkg.sql` (install) and `script/标版/upgrade/20220104审核去除结账校验/Sp_Calc_sPkg.sql` (patch removing closing-period validation). diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPmd.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPmd.md index c04ac84..a00a5b9 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPmd.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPmd.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Unified material-movement audit (`COMMENT '生产领料、补料、退料、报废'`) — single procedure that handles production issue (领料), re-issue (补料), return (退料), scrap (报废), and several inbound variants, all keyed by `sFormGuid` against `MitProductionMaterialsMaster`. Posts movements into `MitMaterialsStore` (the unified material-stock ledger) on check; reverses on uncheck. + +**What it does:** Guards on `bInvalid`/`SysLocking`. Reads `SysSystemSettings.CkxMaterialsStockLimit` to decide whether stock-shortage refusal is hard. On `iFlag=1` enforces `Sp_calc_materialsstoreLimit` per slave row (returns negative `sCode` with the offending material list), calls `Sp_MaterialsStoreVirtual` to recompute the virtual-stock projection, inserts movement rows into `MitMaterialsStore` keyed on `sFormId` (issue vs return etc. controlled by the source form's sign convention), then flips `bCheck=1, sStatus=1, sCheckPerson, tCheckDate` on `MitProductionMaterialsMaster`. `iFlag=0` symmetrically reverses (deletes the `MitMaterialsStore` rows and clears flags). + +**Invocation:** Bound to `gdsmodule.sProcName` on a wide set of forms under 物料领用流程 (生产领料单据, 生产退料单据, 1/1 新增生产补料) and 材料库 (来料入库单据, 其它入库单据, 其它出库单据, 生产领料(新), 生产退料(唯一码), 生产补料(唯一码)), plus 扫码领料(单据) under 功能操作 — all dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)`. xly-src ships current (`script/标版/20250616/Sp_Calc_sPmd.sql`) and legacy (`Sp_Calc_sPmd(old).sql`) versions plus an upgrade patch — verify which is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPmd_old.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPmd_old.md index 05400a6..0c3a1da 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPmd_old.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPmd_old.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_Calc_sPmd` (`_old` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_Calc_sPmd` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPmt.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPmt.md index a372f2b..2e891cb 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPmt.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPmt.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** KPI流程操作菜单 → 财务收付款 → 付款单 — supplier payment audit on `CahPaymentMaster`. The check posts the payment into the cashbook (`CahWasteBook`), settles the matched payable rows (`CahPaymentables` / `CahFinancialAdjust` / `cahsupplyinit` / `accmaterialsinitslave`), back-stamps the linked purchase-checking and outsourced-checking documents, and writes a KPI row; the uncheck rolls every leg back. + +**What it does:** Guards on `bInvalid`/`SysLocking` against `CahPaymentMaster`. Aggregates `dTotalMoney`/`dMinusMoney`/`dRoundingMoney` from `CahPaymentSlave`. On `iFlag=1`: when `CkxDefineCheck=1` & `iTmpCheck<>1` iterates each slave through `Sp_System_CheckFlow`; deletes any stale `CahPaymentNewMaster` rows for this bill and reinserts a fresh consolidated row; writes a `CahWasteBook` entry tagged with the `CbxPayablesType` setting; updates `CahPaymentables`/`CahFinancialAdjust`/`cahsupplyinit` so the matched payables show `dPayMoney`/`dCheckingMoney` consumed; propagates `sCheckPerson`/`tCheckDate` into upstream `PurPurchaseCheckingMaster`/`PurPurchaseInStoreMaster`/`PurPurchaseInvoiceSlave`/`OpsOutsideProcessMaster`/`opsoutsidecheckingslave`/`opsoutsideinvoiceslave`; writes `kpidetail` per slave; flips `bCheck=1, sStatus=1` on the master. `iFlag=0` symmetrically reverses. + +**Invocation:** Bound to `gdsmodule.sProcName` on 付款单 (sId `192116810113315233387186220`, parent 财务收付款) — dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button. xly-src ships `script/标版/30100101/Sp_Calc_sPmt.sql` (install) and `script/标版/upgrade/20220104审核去除结账校验/Sp_Calc_sPmt.sql` (period-validation removal patch). Body size 75K — the largest in the `Sp_Calc_s*` family. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPmt_copy1.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPmt_copy1.md index 66d3ba3..1778f19 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPmt_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPmt_copy1.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_Calc_sPmt` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_Calc_sPmt` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPoc.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPoc.md index d230dce..452f335 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPoc.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPoc.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Purchasing — purchase-contract (采购合同) audit on `PurPurchaseOrderMaster`. A trimmed variant of `Sp_Calc_sPod` (the body comment still reads "采购订单"); shares parameter list and approval-workflow scaffolding. Status currently inert in the live DB. + +**What it does:** Guards on `sGuid`/`SysLocking`. When `CkxDefineCheck=1` & `iTmpCheck<>1` iterates the slaves through `Sp_System_CheckFlow` for multi-step approval. Runs `Sp_Bill_Used` to refuse uncheck when downstream rows exist. Flips `bCheck=1, sStatus=1, sCheckPerson, tCheckDate` on `PurPurchaseOrderMaster` for the matching `sGuid`; `iFlag=0` clears the flags. + +**Invocation:** Status: appears orphaned in the live database. No `gdsmodule.sProcName` binding, no `gdsconfigformmaster` reference, no callers in `information_schema.ROUTINES`. xly-src ships only an install script (`script/标版/30100101/Sp_Calc_sPoc.sql`) — no Java/XML wiring. The 采购合同 use case looks to have been absorbed into the standard 采购订单 flow under `Sp_Calc_sPod`. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPod.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPod.md index 32e8b23..4998b8f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPod.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPod.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** KPI流程操作菜单 → 物料采购流程 → 采购订单 — purchase-order audit on `PurPurchaseOrderMaster`/`Slave`. Also serves 采购订单(单据) under 功能操作 (mobile). On check the PO is opened to receiving, the latest negotiated price is rolled into supplier records, and quantities are propagated into upstream demand documents (sales-order materials, work-order materials, semi-goods match-bill); on uncheck the same legs are reversed. + +**What it does:** Aggregates slave rows by `sMaterialsId+sMaterialsStyle` via cursor; recomputes total/tax money. On `iFlag=1` runs `Sp_System_CheckFlow` per slave when `CkxDefineCheck=1` & `iTmpCheck<>1`; calls `Sp_MaterialsPurchaseStoreVirtual` to update the virtual-stock projection; pushes the negotiated `dLastPrice` into `EleMaterials` and `EleMaterialsSupply`; back-stamps `dPurchasedQty`/`dPurchasedAuxiliaryQty` into `MftWorkOrderMaterials`, `mftworkorderslave`, `PurPurchaseApplySlave`, `salsalesordermaterials`, `sgdsemigoodsmatchbillmaterials`; updates `purpurchaseorderdetail` rollup; flips `bCheck=1, sStatus=1`. `iFlag=0` calls `Sp_Bill_Used` first to refuse when downstream rows exist, then reverses. + +**Invocation:** Bound to `gdsmodule.sProcName` on 采购订单 (sId `192116810113315217757747140`, parent 物料采购流程) and 采购订单(单据) (sId `101251240115015989270450430`, parent 功能操作). Also called server-side from `Sp_Calc_pruOrderBgd` (采购变更) with `iFlag=0` to un-audit the chased PO before the change document is itself audited. Dispatched primarily by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button. Body size 54K. xly-src ships `script/标版/30100101/Sp_Calc_sPod.sql` (install) and `script/标版/upgrade/20220104审核去除结账校验/Sp_Calc_sPod.sql` (period-validation removal patch). diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPpa.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPpa.md index e8b3203..d640a31 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPpa.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPpa.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 → 采购明细 → 采购申请单据 — purchase-application (采购申请, PR) audit on `PurPurchaseApplyMaster`. Also serves 客来料入库通知单据 (customer-supplied-material inbound notify) under 销售单据 (the same approval + rollup mechanics apply because the upstream demand row format is shared). The check opens the application for PO consumption; the uncheck rolls quantities back. + +**What it does:** Aggregates `purpurchaseapplyslave` by `sMaterialsId+sMaterialsStyle`, summing `dMaterialsQty`/`dAuxiliaryQty` per material. On `iFlag=1` optionally drives `Sp_System_CheckFlow` per slave when `CkxDefineCheck=1` & `iTmpCheck<>1`; back-stamps the applied quantity into the upstream demand rows (`MftWorkOrderMaterials.dAppliedQty`, `salsalesordermaterials.dAppliedQty`); updates `purpurchaseapplydetail` rollup; flips `bCheck=1, sStatus=1, sCheckPerson, tCheckDate` on `PurPurchaseApplyMaster`. `iFlag=0` calls `Sp_Bill_Used` first to refuse when a PO already references this PR, then reverses. + +**Invocation:** Bound to `gdsmodule.sProcName` on 采购申请单据 (sId `192116810113315217105813660`, parent 采购明细) and 客来料入库通知单据 (sId `101251240115016341830790030`, parent 销售单据) — dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button. xly-src ships `script/标版/30100101/Sp_Calc_sPpa.sql` (install) and a period-validation removal patch. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPpa1.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPpa1.md index 1b33dd0..ff16b90 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPpa1.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPpa1.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 → 采购单据 → 采购申请(新) — newer purchase-application variant tied to whole-bill outsourcing (`COMMENT '生产工单—整单发外'`). Audits a `mftworkordermaster` row when the entire work-order is sent out for processing, generating the outsourced material-request automatically. + +**What it does:** Guards on `bInvalid`/`SysLocking`/`bFrozen` (accounting-period via `CkxIntervalMonthModifyBill`). When `CkxDefineCheck=1` & `iTmpCheck<>1` drives `Sp_System_CheckFlow` for approval. On `iFlag=1` flips `bCheck=1, sStatus=1, sCheckPerson, tCheckDate` on `mftworkordermaster` and updates `MftWorkOrderMaterials` to mark the materials as fully-outsourced. `iFlag=0` calls `Sp_Bill_Used` to refuse uncheck when downstream rows exist, then reverses. + +**Invocation:** Bound to `gdsmodule.sProcName` on 采购申请(新) (sId `192116811110216195779824320`, parent 采购单据 → 采购管理) — dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button. xly-src only ships the `gdsmodule.sql` binding line (no separate install SQL file) — the proc lives directly in the DB; verify the deployed body if customising. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPpn.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPpn.md index 16a7917..26b3a91 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPpn.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPpn.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Production planning — 生产计划 audit on `MftProductionPlanMaster`. The check freezes a plan header and propagates the planned-status onto the matching `MftWorkOrderProcess` rows so downstream production reports can recognise the plan as active. + +**What it does:** Guards on `sGuid`/`SysLocking`/`bInvalid`/`CkxIntervalMonthModifyBill` period-frozen check against `MftProductionPlanMaster`. When `CkxDefineCheck=1` & `iTmpCheck<>1` runs `Sp_System_CheckFlow` per slave for multi-step approval. On `iFlag=1` flips `bCheck=1, sStatus=1, sCheckPerson, tCheckDate` on `MftProductionPlanMaster` and stamps the plan-status into `MftWorkOrderProcess`; `iFlag=0` clears them. + +**Invocation:** Status: appears orphaned in the live database. No `gdsmodule.sProcName` binding, no `gdsconfigformmaster` reference, no callers in `information_schema.ROUTINES`. xly-src ships only an install script (`script/标版/30100101/Sp_Calc_sPpn.sql`) — no Java/XML wiring. The 生产计划 module in production may instead use the family member `Sp_Calc_sPpr` (产量上报) or the planning logic may have moved into `MftProductionPlan*` MyBatis services; candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPpr.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPpr.md index 165e7bd..a0245f2 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPpr.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPpr.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** KPI流程操作菜单 → 订单生产流程 → 产量上报 — production-output reporting (报工) audit on `MftProductionReportMaster`/`Slave`. The check posts reported output against work-order slaves and process rows, drives the work-order completion state-machine, recomputes plan-side quantities, and updates the linked sales-order shipment-ready totals. Also serves the mobile variant 内部报工(mobile单据). + +**What it does:** Guards on `bInvalid`/`SysLocking`/`bFrozen` (period). Reads `SysSystemSettings.CbxProductionReport` mode flag. On `iFlag=1`: runs `Sp_Check_mftProductionReportValue` to validate reported quantities, `Sp_CheckExceedReport` to refuse over-reporting beyond planned qty, `Sp_Check_SaveOeeReportCheck` to validate against OEE-machine output; calls `Sp_CalcAttribDate` to roll the report into the correct accounting period; flips counters on `mftproductionreportslave`, `mftproductionplan`/`mftproductionplanslave`, `MftWorkOrderProcess`, `MftWorkOrderControl`, `mftworkordermaster` (status), `sgdsemigoodsmatchbillmaster`/`Slave`, `salsalesorderslave` (shipment-ready); writes employee KPI into `mftproductionreportemployee` and rolls remaining mould-life into `eleknifemould`; finally calls `Sp_Change_WorkOrderStatus` to advance the work-order state-machine and flips `bCheck=1, sStatus=1` on the master. `iFlag=0` symmetrically reverses. + +**Invocation:** Bound to `gdsmodule.sProcName` on 产量上报 (sId `19211681019715476042694840`, parent 订单生产流程) and 内部报工(mobile单据) (parent 功能操作) — dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button. Additionally called by `OeeServiceImpl` (Java field `private final static String sProName = "Sp_Calc_sPpr"`, paired with `sFormIdOee = "19211681019715476042694840"`) when the PLC/OEE feed auto-submits an output report — the service routes the call through `BusinessBaseService` and follows up with `checkOutputReport`. xly-src ships `script/标版/30100101/Sp_Calc_sPpr.sql` (install) plus upgrade patches (`20230206上报工资计算`, `20220104审核去除结账校验`). diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPqa.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPqa.md index ffb4294..2062730 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPqa.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPqa.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 → 采购单据 → 采购品质异常 — purchase quality-abnormal (PQA) audit on `purqualityabnormalmaster`. Records and approves a quality-issue ticket raised against an incoming purchase, freezing the master row once the QA process has agreed on disposition. + +**What it does:** Guards on `bInvalid` against `purqualityabnormalmaster`. On `iFlag=1` refuses if the row is already `bCheck=1`, then `Update purqualityabnormalmaster` to set `bCheck=1, sCheckPerson, tCheckDate=NOW(), sStatus=1`. `iFlag=0` symmetrically clears. No KPI write, no downstream propagation — this is a lightweight check/uncheck. + +**Invocation:** Bound to `gdsmodule.sProcName` on 采购品质异常 (sId `101251240115016111131581760`, parent 采购单据 → 采购管理) — dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button. `script/标版/30100101/Sp_Calc_sPqa.sql` is the install script. + +Caveat: the procedure's stored `COMMENT` clause reads `'商机跟进'` (sales-lead follow-up), inherited from a copied-template ancestor. The actual body targets `purqualityabnormalmaster` and matches the 采购品质异常 module — treat the stale comment as documentation drift, not a different intent. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPrice.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPrice.md index 4672cb8..d35337a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPrice.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPrice.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Pricing — price-approval (价格审批) audit on `eleproductpricemaster`. A finished-product price-card lifecycle: the row is editable until audited; once `bCheck=1, sStatus=1` it becomes the active reference price for downstream sales-order pricing lookups. + +**What it does:** Guards on `sGuid`. On `iFlag=1` refuses when the row is already `bCheck=1`, then `Update eleproductpricemaster` to set `bCheck=1, sStatus=1, sCheckPerson, tCheckDate=NOW()`. `iFlag=0` symmetrically clears (and on uncheck also blanks `sCheckPerson=''`, `tCheckDate=null`). No KPI write, no downstream propagation — minimal check/uncheck. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` binding, no `gdsconfigformmaster` reference, no callers in `information_schema.ROUTINES`, no xly-src hits across any extension (not even an install script). The procedure exists in the DB but the 价格审批 module has no form wired to it — candidate for maintainer audit. Likely a stub kept for a planned price-approval workflow that was never deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPrj.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPrj.md index 6559d9a..cd5769f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPrj.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPrj.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** KPI流程操作菜单 → 物料采购流程 → 2/4 新增采购退货 — purchase-rejection (采购退货, return-to-supplier) audit on `PurPurchaseRejectMaster`/`Slave`. The check posts the return out of material stock, registers the negative payable, and back-stamps the matched stock-in line; the uncheck rolls every leg back. + +**What it does:** Guards on `bInvalid`/`SysLocking` via a join on `PurPurchaseRejectSlave`. Aggregates `dMaterialsMoney`/`dMaterialsTaxMoney` from the slave; reads supplier from the master. On `iFlag=1`: enforces `Sp_calc_materialsstoreLimit` to refuse uncheck-blocking shortages; calls `Sp_System_AutoMaterialsPriceSingle` to refresh material last-price post-return; deletes any stale `MitMaterialsStore`/`CahPaymentables` for this bill and reinserts the negated movement rows + payable row (`INSERT INTO MitMaterialsStore`, `INSERT INTO EleMaterialsStock`); updates `EleMaterialsStock` aggregate; back-stamps `dRejectQty` into `purpurchaseinstoreslave`/`purpurchaseorderslave`; flips `bCheck=1, sStatus=1` on `PurPurchaseRejectMaster`. `iFlag=0` calls `Sp_Bill_Used` to refuse uncheck when downstream rows depend on it, then reverses. + +**Invocation:** Bound to `gdsmodule.sProcName` on 2/4 新增采购退货 (sId `192116810113315221425660510`, parent 物料采购流程) — dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button. xly-src ships `script/标版/30100101/Sp_Calc_sPrj.sql` (install) and `Sp_Check_sPrj.sql` (cross-check helper invoked before audit). diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sProd.md b/en/docs/auto-catalog/procedures/Sp_Calc_sProd.md index 9e413bc..3974f72 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sProd.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sProd.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Master-data product (`eleproduct`) audit / un-audit — the "产品价格审核" routine, intended to lock a product master row after pricing is approved. The audit flips `bCheck=1`, `sStatus=1`, stamps `sCheckPerson`/`tCheckDate`; un-audit reverses it. + +**What it does:** Validates `sGuid`; guards on `bCheck` (refuses to re-audit / re-uncheck the same state); `UPDATE eleproduct` accordingly, tenant-scoped by `sBrandsId`/`sSubsidiaryId`. No back-writing, no chain calls, no workflow hook. + +**Invocation:** Standard `Sp_Calc_s` audit-button slot, dispatched by Java `BusinessBaseServiceImpl.getPrcName(...)` against `gdsmodule.sProcName`. No module currently sets `sProcName='Sp_Calc_sProd'` in this snapshot — so although the proc is wired for the standard 审核 dispatcher contract, no live form points at it. Candidate for maintainer audit: either the binding lives in a customer overlay not in this snapshot, or this is dead/staging code superseded by another product-audit path. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sProductChange.md b/en/docs/auto-catalog/procedures/Sp_Calc_sProductChange.md index 01eb16e..4d617e1 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sProductChange.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sProductChange.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 产品管理 → 产品管理单据 → 产品版本变更单 — audit / un-audit of a 产品变更申请 (product-change request) on `mftproductchange`. On approval, the proc commits the change by bumping the linked product's version (`eleproduct.sProductVer`) — i.e. promotes the change request into a new product revision. + +**What it does:** Validates `sGuid`, refuses when `bInvalid=1`, then on `iFlag=1` guards on `bCheck` and `UPDATE mftproductchange` to set `bCheck=1`, `sStatus=1`, `sCheckPerson`, `tCheckDate`, plus `UPDATE eleproduct SET sProductVer = CONCAT('V', LPAD(RIGHT(sProductVer,2)+1, 2, '0'))` joined on `mftproductchange.sProductId` — incrementing the product version (V01 → V02 etc.). `iFlag=0` un-checks the request but does NOT roll back the version bump on the product, which is a one-way side effect. + +**Invocation:** Bound to `gdsmodule.sProcName` on `产品版本变更单` (sId `12012615914116361726917970`) under 产品管理 → 产品管理单据. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button — the standard `Sp_Calc_s` slot. Install scripts: `script/标版/30100101/Sp_Calc_sProductChange.sql` and `script/标版/upgrade/20211115产品变更/Sp_Calc_sProductChange.sql`. + +Caveat: the un-audit branch does not decrement `eleproduct.sProductVer`. After reversing a 产品版本变更单 audit, the product still shows the bumped version — verify whether that is intended. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPrw.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPrw.md index e426ddb..f7a1d2c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPrw.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPrw.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产单据 → 产量计件 — audit / un-audit of a 产量计件 (piecework production-report wage) bill on `mftproductionreportwagemaster`. The audit freezes the operator's reported output for payroll/KPI calculation. + +**What it does:** Validates `sGuid`, refuses when `bInvalid=1`, then on `iFlag=1` guards on `bCheck` and `UPDATE mftproductionreportwagemaster` to set `bCheck=1`, `sStatus=1`, `sCheckPerson`, `tCheckDate`. `iFlag=0` reverses the flags. Note: the un-audit "already-unchecked" guard reads from `salsalesdevmaster` (a 销售开发 table) rather than the production-report table — a copy/paste residue from when this proc was forked from `Sp_Calc_sScd`/similar. + +**Invocation:** Bound to `gdsmodule.sProcName` on `产量计件` (sId `101251240115016088043411460`) under 生产管理 → 生产单据. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button. Install scripts: `script/标版/30100101/Sp_Calc_sPrw.sql`. + +Caveat: the `ROUTINE_COMMENT` is stale ('销售机会') and the un-audit guard queries the wrong table (`salsalesdevmaster`). Header is misleading — the body actually serves piecework production reporting. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPsa.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPsa.md index 9311264..b90fd67 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPsa.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPsa.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成品库存 → 成品库单据 → 成品库存调整单据 — audit / un-audit of a 成品库存调整 (finished-goods inventory adjustment) bill on `PitProductStoreAdjustmentMaster`/`PitProductStoreAdjustmentSlave`. On approval, the adjusted quantity is posted into the `PitProductStore` inventory ledger and recomputed via the standard product-stock helpers. + +**What it does:** Validates `sGuid`, locking checks, then on `iFlag=1` cursors over `PitProductStoreAdjustmentSlave`, `INSERT INTO PitProductStore` an offsetting row per slave, `CALL Sp_calc_productstoreLimit` for warehouse-cap enforcement, and `CALL SP_Inventory_ProductCalcQty` to refresh on-hand counts; `UPDATE PitProductStoreAdjustmentMaster` to flip `bCheck=1`, `sStatus=1`, `sCheckPerson`, `tCheckDate`. `iFlag=0` `DELETE FROM PitProductStore` the posted rows and reverses the master flags. + +**Invocation:** Bound to `gdsmodule.sProcName` on `成品库存调整单据` (sId `192116810113315264709817020`) under 成品库存 → 成品库单据. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button. Install scripts: `script/标版/30100101/Sp_Calc_sPsa.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPst.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPst.md index 44f501e..bcebf26 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPst.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPst.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成品库存 → 成品库单据 (and KPI流程操作菜单 → 销售送货流程) — audit / un-audit of a 成品入库 (finished-goods receipt) bill on `PitProductInStoreMaster`/`PitProductInStoreSlave`. On approval, qty is posted into `PitProductStore`, the source work-order (`MftWorkOrderMaster`/`Slave`) is back-written with completed quantity, and the linked sales-order slave (`salsalesorderslave`) is updated to reflect what's now on hand. + +**What it does:** Long body. Validates `sGuid`, calls `Sp_Bill_Used` to verify the bill is not consumed downstream; on `iFlag=1` cursors slave rows, `INSERT INTO PitProductStore` and `INSERT INTO MitMaterialsStoreVirtual` for the receipt, `CALL Sp_calc_productstoreLimit`/`SP_Inventory_ProductCalcQty`/`SP_Inventory_ProductInOutWareHouse`, back-writes `mftworkordermaster`/`mftworkorderslave` completed-qty + status, syncs `mftproductionplan(slave/billslave)`, updates `eleproduct(stock)`, posts `qlyproducttestmaster` (quality test rows), updates `sgdsemigoodsmatchbillmaster/slave` (半成品 match) and `salsalesorderslave`; flips `PitProductInStoreMaster.bCheck=1`. `iFlag=0` reverses inventory deltas and master/slave flags. Resolves the inventory form-guid via `Sp_Sis_GetProductInventoryFormGuid`. + +**Invocation:** Bound to `gdsmodule.sProcName` on two modules — `成品扫码入库(单据)` (sId `101251240115016189918441220`, under 现场 → 功能操作) and `成品入库` (sId `192116810113315228246447250`, under KPI流程操作菜单 → 销售送货流程). Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button. Install scripts: `script/标版/30100101/Sp_Calc_sPst.sql`, an upgrade patch `script/标版/upgrade/20220126-2861-仓库冻结后,入库、领料、送货单不可消审/Sp_Calc_sPst.sql`, plus customer overrides at `script/客户/千彩/` and `script/客户/朝阳/` — verify which is deployed per tenant. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPst_copy1.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPst_copy1.md index 4e12d6b..2830131 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPst_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPst_copy1.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_Calc_sPst` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_Calc_sPst` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sPtr.md b/en/docs/auto-catalog/procedures/Sp_Calc_sPtr.md index 40b3931..1ca206b 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sPtr.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sPtr.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成品库存 → 出库管理 → 成品领用单据 — audit / un-audit of a 产品领用 (finished-goods issue / retrieval) bill on `PitProductRejectMaster`/`PitProductRejectSlave` (the "reject"-named tables also carry internal-issue rows). On approval, the issued qty is taken out of `PitProductStore`, the consuming work-order / sales-order / outside-process / 半成品 match rows are back-written, and the product master stock (`EleProductStock`) is decremented. + +**What it does:** Validates `sGuid`, cursors slave rows, on `iFlag=1` `INSERT INTO PitProductStore` an offsetting (negative) row per slave, `CALL Sp_calc_productstoreLimit`/`SP_Inventory_ProductCalcQty`/`SP_Inventory_ProductInOutWareHouse`, `UPDATE EleProductStock` to deduct, and back-writes `MftWorkOrderSlave`, `mftproductionplanbillslave`, `salsalesorderslave`, `opsoutsideprocessslave`, `sgdsemigoodsmatchbillslave`, `PitProductInStoreSlave` to reflect consumed quantities; flips `PitProductRejectMaster.bCheck=1`, `sStatus=1`, stamps `sCheckPerson`/`tCheckDate`. `iFlag=0` `DELETE FROM PitProductStore` the posted rows and reverses every back-write. + +**Invocation:** Bound to `gdsmodule.sProcName` on `成品领用单据` (sId `101251240115015920999005840`) under 成品库存 → 出库管理. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button. Install scripts: `script/标版/30100101/Sp_Calc_sPtr.sql` plus `script/标版/30100101/Sp_Check_sPtr.sql` (companion pre-audit checker). diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sQtt.md b/en/docs/auto-catalog/procedures/Sp_Calc_sQtt.md index d6a0ba4..82e6c70 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sQtt.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sQtt.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 报价&估计管理 / 销售单据 — audit / un-audit of a 报价单 (sales quotation) on `quoquotationmaster`/`quoquotationslave`. The most widely-bound `Sp_Calc_s*` in this snapshot — it serves the regular 报价单, the 卷筒 / 膜类 / 书刊 / 盒型 / 套装 product variants, the compatibility-suspended generic forms, the new 17/05 quote form, the self-service quote, and the quote-approval (报价审批) module. On approval it locks the quote, snapshots customer-product pricing, optionally posts KPI rows, and triggers the configured approval workflow. + +**What it does:** Validates `sGuid`/`bInvalid`, `CALL Sp_Bill_Used` to verify the quote is not consumed downstream; on `iFlag=1` flips `quoquotationmaster.bCheck=1`, `sStatus=1`, stamps `sCheckPerson`/`tCheckDate`; writes a price snapshot row to `eleproductcustomer` (per-customer-product pricing table) from each `quoquotationslave`; updates `salsaleschanceproduct` so the linked 销售机会 picks up the approved price; logs to `syslog`/`syslogdetail`; `CALL Sp_System_CheckFlow` per slave to launch the configured workflow when `CkxDefineCheck=1`. `iFlag=0` reverses the flags. + +**Invocation:** Bound to `gdsmodule.sProcName` on a large fleet of 报价单 modules — 卷筒/书刊/膜类/盒型/套装 variants, the 自助报价 self-service form, 报价审批, the new 17/05 form, 01/04 新增新报价单, plus several `兼容停用` (compatibility-suspended) rows. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button — the standard `Sp_Calc_s` slot. Install scripts: `script/标版/30100101/Sp_Calc_sQtt.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sQtt_hm.md b/en/docs/auto-catalog/procedures/Sp_Calc_sQtt_hm.md index c774c7e..50d12ff 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sQtt_hm.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sQtt_hm.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Variant of [`Sp_Calc_sQtt`](Sp_Calc_sQtt.md) — audit / un-audit of a 报价单 (sales quotation) on `quoquotationmaster`/`quoquotationslave`. The `_hm` suffix marks a tenant/site-specific fork that adds a quotation-price recalc step (`Sp_System_BatchNPriceMoney_quo`) and back-writes the linked sales-order's price columns from the approved quote. + +**What it does:** Same skeleton as `Sp_Calc_sQtt` — `CALL Sp_Bill_Used`, flip `bCheck`/`sStatus`/`sCheckPerson`/`tCheckDate` on `quoquotationmaster`, log via `syslog`/`syslogdetail`, post the customer-product price snapshot to `eleproductcustomer`, and `Sp_System_CheckFlow` to kick off any configured approval workflow. Additional vs. the base: `CALL Sp_System_BatchNPriceMoney_quo` to batch-recompute quote prices, plus `UPDATE quoquotationslave` and back-writes into `salsalesordermaster`/`salsalesorderslave` so an approved quote re-prices any already-linked order. `CALL Sp_System_DelMsgCheckFlow` cleans up workflow messages on un-audit. Also touches `salsaleschanceproduct` to update opportunity prices. + +**Invocation:** No `gdsmodule.sProcName='Sp_Calc_sQtt_hm'` binding in this snapshot, no callers found in any channel. **Status: appears orphaned.** Likely a per-customer overlay routine that gets activated by overwriting `gdsmodule.sProcName` on the relevant 报价单 module rows during install at customer sites. `_hm` plausibly = customer code (e.g. 浩宇 or similar) — verify against deployment scripts before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sRbm.md b/en/docs/auto-catalog/procedures/Sp_Calc_sRbm.md index efa35df..425d3c3 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sRbm.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sRbm.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 财务单据 → 报销申请 — audit / un-audit of a 报销申请 (expense-reimbursement application) on `reimbursementapplicationmaster`. On approval the request becomes payable; un-audit reopens it for editing. + +**What it does:** Validates `sGuid`, refuses when `bInvalid=1`. On `iFlag=1` guards on already-checked, then `UPDATE reimbursementapplicationmaster` to set `bCheck=1`, stamp `sCheckPerson`/`tCheckDate`. `iFlag=0` un-checks symmetrically. No back-writing, no chain calls, no workflow hook beyond the master flag. + +**Invocation:** Bound to `gdsmodule.sProcName` on `报销申请` (sId `101251240115016045695138900`) under 财务管理 → 财务单据. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button. Install scripts: `script/标版/30100101/Sp_Calc_sRbm.sql`. + +Caveat: `ROUTINE_COMMENT` is stale ('销售机会') — the body operates on the reimbursement table, not on `salsaleschancemaster`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sRct.md b/en/docs/auto-catalog/procedures/Sp_Calc_sRct.md index 12678be..658611c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sRct.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sRct.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** KPI流程操作菜单 → 财务收付款 → 收款单 — audit / un-audit of a 收款单 (customer-receipt / AR receipt) on `CahReceiptMaster`/`CahReceiptSlave`. The most-touching audit in the family: a receipt may settle against sales orders, sales contracts, delivery notes, quality-deduction slaves, reject-goods slaves, sales-checking slaves, sales-invoices, trade orders and work-orders all in one bill. On approval it posts the receipt to the customer's AR ledger, allocates per-slave to the original source bill (back-writing `dCheckMoney`/`dCheckMoneyForeign` etc.), runs the chained re-audits, writes the wastebook, posts the operator KPI, and updates customer-init balances. + +**What it does:** Body is ~81K chars. Validates `sGuid`, locks, refuses on `bInvalid=1`. On `iFlag=1` cursors `CahReceiptSlave`, dispatches per-slave by source-bill type — back-writes `SalSalesOrderMaster/Slave`, `SalSalesContractMaster/Slave`, `SalDeliverGoodsMaster/Slave`, `SalRejectGoodsSlave`, `SalQualityAbnormalSlave`, `SalSalesCheckingSlave`, `SalSalesInvoiceSlave`, `SalTradeOrderMaster`, `MftWorkOrderMaster/Slave`, `QuoQuotationMaster` — calling the originating bill's own re-audit proc where needed (`Sp_Calc_sDgd`, `Sp_Calc_sQtt`, `Sp_Calc_sSod`, `Sp_Calc_sWod`); `Insert Into CahWasteBook` posts the financial wastebook entry; `Update CahCustomerInit`/`CahFinancialAdjust`/`CahPaymentMaster` to update the customer init / adjust / payment balances; `INSERT INTO kpidetail` when KPI logging is enabled for the operator; flips `CahReceiptMaster.bCheck=1`/`sStatus=1`. `iFlag=0` `delete from cahreceiptnewmaster`/`cahwastebook` and reverses every back-write. + +**Invocation:** Bound to `gdsmodule.sProcName` on `收款单` (sId `192116810113315231731646200`) under KPI流程操作菜单 → 财务收付款. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button. Install scripts: `script/标版/30100101/Sp_Calc_sRct.sql`, an upgrade patch `script/标版/upgrade/20220104审核去除结账校验/Sp_Calc_sRct.sql`, plus customer overrides at `script/客户/扬州浩宇/` and `script/客户/千彩/` — verify which is deployed per tenant. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sRct_copy1.md b/en/docs/auto-catalog/procedures/Sp_Calc_sRct_copy1.md index 200531e..a62be23 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sRct_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sRct_copy1.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_Calc_sRct` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_Calc_sRct` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sRcts.md b/en/docs/auto-catalog/procedures/Sp_Calc_sRcts.md index 57cae52..1941c3e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sRcts.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sRcts.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Sister proc of [`Sp_Calc_sRct`](Sp_Calc_sRct.md), suffix `s` likely for "汇总" / "summary" — its header reads `收款单(汇总)`. Audit / un-audit of a consolidated 收款单 that aggregates multiple source bills under one master. The body re-emits one row into `cahreceiptnewmaster` per source-bill type and chains `Sp_Calc_sDgd`/`Sp_Calc_sSod`/`Sp_Calc_sWod` so the underlying delivery / sales-order / work-order auto-audit through the same flow. + +**What it does:** Skeleton matches `Sp_Calc_sRct` (validate + lock + cursor slave + flip master), but on the back-write side it: `Insert Into cahreceiptnewmaster` rows for the consolidated receipt, `Insert Into CahWasteBook`, `Update CahReceiptMaster`/`CahFinancialAdjust`, back-writes `SalSalesOrderMaster`/`SalDeliverGoodsMaster`/`MftWorkOrderMaster`, posts `kpidetail`, and calls `Sp_Calc_sDgd`/`Sp_Calc_sSod`/`Sp_Calc_sWod` per consolidated source slave. `iFlag=0` `delete from cahreceiptnewmaster`/`cahwastebook` and reverses. + +**Invocation:** No `gdsmodule.sProcName='Sp_Calc_sRcts'` binding in this snapshot — only `Sp_Calc_sRct` is wired up. xly-src ships `script/标版/30100101/Sp_Calc_sRcts.sql` (install script) but no live form points at it. **Status: appears orphaned.** Likely a tenant-specific consolidated-receipt audit that gets activated by overwriting `gdsmodule.sProcName` on a 收款单(汇总) module row during customer install — candidate for maintainer audit before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sRetunWork.md b/en/docs/auto-catalog/procedures/Sp_Calc_sRetunWork.md index 881fe9e..cb8d2a0 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sRetunWork.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sRetunWork.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 返工单审核 — audit / un-audit of a 返工单 (rework / re-work order) on `mftproductionplanbillslave`. Used when a finished or partly-finished piece fails QC and a rework cycle is scheduled into the production plan. The audit flips the planbill-slave's `bCheck`/`sStatus`/`sCheckPerson`/`tCheckDate` so downstream MES can pick the rework as an actionable plan row. + +**What it does:** Validates `sGuid`, refuses when the source row is being edited (`SysLocking` lock check) or `bInvalid=1`. On `iFlag=1` guards on already-checked, then `UPDATE mftproductionplanbillslave` to set `bCheck=1`, `sStatus=1`, stamp `sCheckPerson`/`tCheckDate`. `iFlag=0` reverses. Body declares hooks for source-order / materials / supplier-pay processing that are kept but not exercised in the active branch — likely vestiges of a richer prior version. + +**Invocation:** No `gdsmodule.sProcName='Sp_Calc_sRetunWork'` binding in this snapshot, no other proc/func references it, no metadata `gdsconfigformmaster` hits. xly-src ships `script/标版/30100101/Sp_Calc_sRetunWork.sql` (install script). **Status: appears orphaned in the standard dispatcher path.** Either dispatched via a 返工单 module installed in a customer overlay not in this snapshot, or invoked from a manual maintenance script — candidate for maintainer audit. + +Naming note: `sRetunWork` is missing the "r" in 返工 → should likely be `sReturnWork`. Casing/spelling outlier kept for backwards-compat with any deployed binding that uses the misspelling. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sRev.md b/en/docs/auto-catalog/procedures/Sp_Calc_sRev.md index f4ff307..aac0867 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sRev.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sRev.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 供应商评审 — audit / un-audit of a 供应商评审 (supplier review / scoring) bill on `revsupplymaster`/`revsupplyslave`. The review aggregates per-department scores (iScoreOne … iScoreFour) for a supplier; on approval the supplier's master record (`elesupply.iLevel`) would have been re-graded (A/B/C/D based on total score). + +**What it does:** Validates `sGuid`, refuses when `bInvalid=1`. On `iFlag=1` guards on already-checked, calls `Sp_Bill_Used('salsaleschancemaster', …, 'SaleTrial', …)` — a hold-over reference to the sales-chance "SaleTrial" used-bill check, looks like copy-paste; then would flip `revsupplymaster.bCheck`/`sStatus`/`sCheckPerson`/`tCheckDate`. Most of the per-department-score validation and `elesupply.iLevel` write-back is commented out — current path is a minimal flag flip. `iFlag=0` un-checks. + +**Invocation:** No `gdsmodule.sProcName='Sp_Calc_sRev'` binding in this snapshot, no callers in any channel, no xly-src grep hits. **Status: appears orphaned.** Either dispatched only from a customer overlay or staging / preview code that never made it into a live 供应商评审 module — candidate for maintainer audit. The disabled grading logic is the substantive part of the proc; reactivate before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sRgd.md b/en/docs/auto-catalog/procedures/Sp_Calc_sRgd.md index e0fe5f6..59681ad 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sRgd.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sRgd.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售单据 → 材料销售退货单据 (and KPI流程操作菜单 → 销售送货流程 → 2/4 新增销售退货) — audit / un-audit of a 销售退货 (sales return / RGD = reject-goods) bill on `SalRejectGoodsMaster`/`SalRejectGoodsSlave`. On approval the returned material/product is posted back into inventory (`MitMaterialsStore` for material returns, `PitProductStore` for product returns), AR receivables are decremented on `CahReceivables`, and the originating delivery-goods slave is back-written to release the delivered qty. + +**What it does:** Body ~74K chars. Validates `sGuid`, refuses when `bInvalid=1`, `CALL Sp_Bill_Used` to verify not consumed. On `iFlag=1` cursors `SalRejectGoodsSlave`, dispatches by material-vs-product: `INSERT INTO MitMaterialsStore` (or `PitProductStore`) the return-in row, `INSERT INTO EleMaterialsStock` history, `UPDATE EleProductStock` to add the returned qty, `CALL Sp_calc_materialsstoreLimit`/`Sp_calc_productstoreLimit`/`SP_Inventory_ProductCalcQty` to refresh on-hand and enforce warehouse caps, `CALL Sp_System_AutoMaterialsPriceSingle` to set the inbound price; back-writes `SalDeliverGoodsSlave` to free the delivered qty; `INSERT INTO CahReceivables` an offsetting negative receivable row; `CALL Sp_System_CheckFlow` to launch the configured workflow when `CkxDefineCheck=1`; flips `SalRejectGoodsMaster.bCheck=1`, `sStatus=1`. `iFlag=0` reverses all of it. + +**Invocation:** Bound to `gdsmodule.sProcName` on two modules — `材料销售退货单据` (sId `101251240115016140617006200`, under 销售管理 → 销售单据) and `2/4 新增销售退货` (sId `11811781131121915179924871530`, under KPI流程操作菜单 → 销售送货流程). Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button. Install scripts: `script/标版/30100101/Sp_Calc_sRgd.sql`, an optimize patch `script/标版/optimize/Sp_Calc_sRgd.sql`, a 20250616 rewrite at `script/标版/20250616/Sp_Calc_sRgd.sql` (with `Sp_Calc_sRgd(old).sql` archived alongside), plus customer override `script/客户/千彩/Sp_Calc_sRgd.sql` — verify which is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sRgd1.md b/en/docs/auto-catalog/procedures/Sp_Calc_sRgd1.md index 3f93425..df20f59 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sRgd1.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sRgd1.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Variant of [`Sp_Calc_sRgd`](Sp_Calc_sRgd.md) — audit / un-audit of a 销售退货 (sales return / reject-goods) bill on `SalRejectGoodsMaster`/`SalRejectGoodsSlave`. The `1` suffix marks a numbered staging copy kept alongside the live version, presumably from a refactor cycle. + +**What it does:** Same skeleton as `Sp_Calc_sRgd` (cursor slave, `INSERT INTO MitMaterialsStore`/`PitProductStore`, `INSERT INTO EleMaterialsStock`, `UPDATE EleProductStock`, back-write `SalDeliverGoodsSlave`, post `CahReceivables` adjustment, `CALL Sp_Bill_Used`/`SP_Inventory_ProductCalcQty`/`Sp_System_AutoMaterialsPriceSingle`/`Sp_System_CheckFlow`, flip master `bCheck`) but without the materials-warehouse-cap call (`Sp_calc_materialsstoreLimit`) that the live version keeps. + +**Invocation:** No `gdsmodule.sProcName='Sp_Calc_sRgd1'` binding, no callers in any channel, no xly-src grep hits. **Status: appears orphaned.** Numbered backup variant of the live `Sp_Calc_sRgd` — per wiki convention numbered/named copies are not narrated as production code; verify before relying on it. Likely safe to drop, but check whether any customer overlay rebinds a module to this name. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sRgdApply.md b/en/docs/auto-catalog/procedures/Sp_Calc_sRgdApply.md index a1eab2e..bbc62d8 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sRgdApply.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sRgdApply.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售退货申请 — audit / un-audit of a 销售退货申请 (sales-return application / pre-approval) on `SalRejectGoodsApplyMaster`. Sits upstream of the actual 销售退货 (`Sp_Calc_sRgd`): the customer files a return request, ops approves it via this proc, and a downstream 销售退货 bill is later created against the approved application. + +**What it does:** Validates `sGuid`, locks (`SysLocking` check), refuses when `bInvalid=1`. Reads the `CbxDeliverGoodsNotify` system setting to know whether the upstream link is a sales-order or a delivery-note. On `iFlag=1` guards on already-checked, then `UPDATE SalRejectGoodsApplyMaster` to set `bCheck=1`, stamp `sCheckPerson`/`tCheckDate`. `iFlag=0` reverses. Compared to `Sp_Calc_sRgd` this proc does NOT touch inventory, receivables, or delivery-slave qty — it just gates the application's approved status. + +**Invocation:** No `gdsmodule.sProcName='Sp_Calc_sRgdApply'` binding in this snapshot, no other proc/func references it, no xly-src grep hits. **Status: appears orphaned in the standard dispatcher path.** Dispatched via a 销售退货申请 module that may live in a customer overlay, or via a separate workflow path not yet surveyed here — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sRgd_new.md b/en/docs/auto-catalog/procedures/Sp_Calc_sRgd_new.md index 4fec697..0a15bb6 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sRgd_new.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sRgd_new.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Variant of [`Sp_Calc_sRgd`](Sp_Calc_sRgd.md) — audit / un-audit of a 销售退货 (sales return / reject-goods) bill on `SalRejectGoodsMaster`/`SalRejectGoodsSlave`. The `_new` suffix marks an in-progress rewrite staged alongside the live version. + +**What it does:** Same skeleton as `Sp_Calc_sRgd` — cursor slave, `INSERT INTO MitMaterialsStore`/`PitProductStore`, `INSERT INTO EleMaterialsStock`, `UPDATE EleProductStock`, back-write `SalDeliverGoodsSlave`, post `CahReceivables` adjustment, `CALL Sp_Bill_Used`/`SP_Inventory_ProductCalcQty`/`Sp_System_AutoMaterialsPriceSingle`/`Sp_System_CheckFlow`, flip `SalRejectGoodsMaster.bCheck=1`/`sStatus=1`/`sCheckPerson`/`tCheckDate`. Body matches the `Sp_Calc_sRgd1` variant — also omits `Sp_calc_materialsstoreLimit` vs the live `Sp_Calc_sRgd`. + +**Invocation:** No `gdsmodule.sProcName='Sp_Calc_sRgd_new'` binding, no callers in any channel, no xly-src grep hits. **Status: appears orphaned.** `_new` suffix is the conventional xly marker for a staged rewrite — per wiki convention, backup/variant objects are not narrated as production code. Verify against deployment scripts before relying on it; likely safe to drop once the rewrite cycle is closed. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sSample.md b/en/docs/auto-catalog/procedures/Sp_Calc_sSample.md index df4ca99..d54c14c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sSample.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sSample.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** "样例" (sample / template) — boilerplate template for the `Sp_Calc_s` audit family. Operates against `SalSampleMaster` (a sample-bill table presumably used as a fixture for the template). Not a live business proc: it ships as a starting point for engineers cloning the audit/un-audit pattern into a new module. + +**What it does:** Standard `Sp_Calc_s*` skeleton — IFNULL the params, `SysLocking` guard, `bInvalid` guard, on `iFlag=1` guard on already-checked then `UPDATE SalSampleMaster SET bCheck=1, sStatus=1, sCheckPerson, tCheckDate` for the matching `sId`/`sBrandsId`/`sSubsidiaryId`; `iFlag=0` reverses. The 作废 flag check is hard-coded `SET @bInvalid = 1` then immediately fails the "is-invalidated" guard — i.e. running this proc against any real row will always return the "cannot audit invalidated bill" error, by design (so the template never accidentally mutates production data). + +**Invocation:** No `gdsmodule.sProcName='Sp_Calc_sSample'` binding, no callers in any channel, no xly-src grep hits. **Status: template — not expected to be invoked from production.** The hard-coded `@bInvalid=1` guard confirms intent: kept in the catalog as a copy-paste source for new audit procs, not as a live routine. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sScc.md b/en/docs/auto-catalog/procedures/Sp_Calc_sScc.md index 8a55439..08bc095 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sScc.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sScc.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售单据 → 商机机会单据 (and 销售管理 → KPI事项 → 01/07 报价申请单据) — audit / un-audit of a 销售机会 (sales-opportunity / lead) bill on `salsaleschancemaster`. The audit locks the opportunity as committed before downstream quotes and orders are created against it. + +**What it does:** Validates `sGuid`, refuses when `bInvalid=1`. On `iFlag=1` guards on already-checked, `CALL Sp_Bill_Used('salsaleschancemaster', …, 'SaleTrial', …)` to verify the opportunity has not already been consumed downstream; then `UPDATE salsaleschancemaster` to set `bCheck=1`, `sStatus=1`, stamp `sCheckPerson`/`tCheckDate`. `iFlag=0` reverses the flags. + +**Invocation:** Bound to `gdsmodule.sProcName` on two modules — `商机机会单据` (sId `101251240115016035903299520`, under 销售管理 → 销售单据; the binding string has a trailing space — `'Sp_Calc_sScc '`) and `01/07 报价申请单据` (sId `172129113112117422778572910`, under 销售管理 → KPI事项). Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the audit/un-audit button. Install scripts: `script/标版/30100101/Sp_Calc_sScc.sql` plus `script/标版/optimize/Sp_Calc_sScc.sql`. + +Caveat: the trailing-space binding on `商机机会单据` is fragile — anything that string-compares `sProcName` without `RTRIM` would miss it. Worth normalizing. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sScd.md b/en/docs/auto-catalog/procedures/Sp_Calc_sScd.md index 7673f3f..00997b5 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sScd.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sScd.md @@ -27,4 +27,12 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 — 长期合同 (long-term sales contract) audit / un-audit on `salsalesContractmaster`. A 长期合同 is a frame contract that pre-commits a customer to volume; auditing it freezes the slave rows, locks the linked quotation, and seeds downstream receivables. + +**What it does:** Validates `sGuid`, refuses when `bInvalid=1`, and on `iFlag=1` guards on `bCheck` then `Update salsalesContractmaster`/`salsalesContractSlave` to set `bCheck=1`, `sCheckPerson`, `tCheckDate`; also locks the originating `quoquotationslave`, optionally registers a `kpidetail` row, seeds `CahReceivables`, may upsert `EleProduct`/`eleproductcustomer`/`EleProductStock`, and calls `Sp_System_CheckFlow` per slave when define-check is on. `iFlag=0` reverses the same chain (delete `CahReceivables`, clear flags) and `CALL Sp_Bill_Used` registers consumption either way. + +**Invocation:** Bound to `gdsmodule.sProcName` on: +- `长期合同单据` (sId `16033546780009409151975037702000`) — 销售管理 +- `长期合同明细` (sId `16033543010008296913785356518000`) + +Dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the 审核/反审核 button — the standard `Sp_Calc_s` slot. xly-src ships `script/标版/30100101/Sp_Calc_sScd.sql` (install) and `script/标版/optimize/Sp_Calc_sScd.sql` (perf patch) — verify which is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sSck.md b/en/docs/auto-catalog/procedures/Sp_Calc_sSck.md index 27200ad..0154b2e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sSck.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sSck.md @@ -27,4 +27,12 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售对账单据 (sales reconciliation / `salsalescheckingmaster`) audit / un-audit. The 对账单 ties together delivered, invoiced and returned quantities so finance can ack the period close. + +**What it does:** Validates `sGuid` and `bInvalid`, then on `iFlag=1` sets `bCheck=1`, `sCheckPerson`, `tCheckDate` on `SalSalesCheckingMaster`/`SalSalesCheckingSlave`; writes-back the upstream rows (`UPDATE SalSalesOrderSlave`, `SalDeliverGoodsSlave`, `saldelivernotifyslave`, `SalRejectGoodsSlave`, `MftWorkOrderSlave`, `SalQualityAbnormalSlave`, `cahfinancialadjustslave`, `accproductinitslave`) to mark the corresponding qty as 对账-locked; inserts a `CahReceivables` row and an optional `kpidetail` row; updates `CahCustomerInit` and calls `Sp_System_CheckFlow` per slave when define-check is on; finally `CALL Sp_Bill_Used`. `iFlag=0` reverses every step. + +**Invocation:** Bound to `gdsmodule.sProcName` on: +- `销售对账单据` (sId `11811781131121915184849572550`) — also configured with `sSaveProName=Sp_Check_sSck`, `sSaveProNameBefore=Sp_beforeSave_sSck`, `sDeleteProName=Sp_afterSave_sSck` +- Repurposed on packaging-related forms `盒型定义`, `盒数据`, `盒型组件维护`, `自动拼版单据` — these reuse the audit slot for their own approval flow + +Dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the 审核/反审核 button. Caveat: the comment `销售对账单存储过程` only describes one of the bound forms — the packaging forms above also call this proc; check whether the body's `salsalescheckingmaster` lookups silently no-op for those forms or whether a customer override (`script/客户/千彩/Sp_Calc_sSck.sql`) is in play. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sScr.md b/en/docs/auto-catalog/procedures/Sp_Calc_sScr.md index e7cd4b1..61cf7f5 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sScr.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sScr.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 派车单单据 (sales delivery dispatch / `SalSendCarMaster`) audit / un-audit. Auditing the 派车单 commits a vehicle and driver to a set of 送货单 lines and writes the dispatch reference back onto each 送货单 slave. + +**What it does:** Validates `sGuid`, refuses when `bInvalid=1`, and on `iFlag=1` guards on `bCheck`/account period then sets `bCheck=1`, `sCheckPerson`, `tCheckDate` on `SalSendCarMaster`; iterates `salsendcarslave` to `UPDATE saldelivergoodsslave` (write the dispatch id / scheduled date onto the matching delivery line) and may call `Sp_System_CheckFlow` per slave when define-check is on. `iFlag=0` reverses the writeback and clears the flags. + +**Invocation:** Bound to `gdsmodule.sProcName` on `派车单单据` (sId `15839936170002427227633635401000`) — 销售管理. Dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the 审核/反审核 button. xly-src carries an `script/标版/20220104审核去除结账校验/Sp_Calc_sScr.sql` upgrade patch and a 千彩 customer override at `script/客户/千彩/Sp_Calc_sScr.sql` — verify which is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sScxl.md b/en/docs/auto-catalog/procedures/Sp_Calc_sScxl.md index 6b6f2a5..8f9be57 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sScxl.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sScxl.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 数采下料 (data-collection cutting record) — audit / un-audit flag flip on `Xfq_Working_record_lineMaster`. The proc is the standard `Sp_Calc_s` slot for the cutting-record bill but is not currently wired up anywhere in the live metadata. + +**What it does:** Validates `sGuid`, refuses when `bInvalid=1`, and on `iFlag=1` guards on `bCheck` then `UPDATE Xfq_Working_record_lineMaster` to set `bCheck=1`, `sStatus=1`, `sCheckPerson`, `tCheckDate`. `iFlag=0` reverses with `bCheck=0, sStatus=0`. No KPI, no flow-check, no upstream writeback. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` binding, no form-master `sSqlStr` ref, no other-routine caller, no xly-src caller (only the install script `script/标版/30100101/Sp_Calc_sScxl.sql` and no `Sp_Calc_sScxl.sql` optimize patch). Likely an orphaned cutting-record audit slot — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sSdfu.md b/en/docs/auto-catalog/procedures/Sp_Calc_sSdfu.md index 2dc9518..3ec2e56 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sSdfu.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sSdfu.md @@ -27,4 +27,12 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 开发跟进 / 印前任务跟进 (development follow-up / prepress task follow-up — `salsalesdevfollowupmaster`) audit / un-audit. The follow-up bill records progress against a development-plan slave (`salsalesdevplanslave`), and on audit writes the followed-up qty back to the plan and any linked sales-order slave. + +**What it does:** Validates `sGuid`/`bInvalid`, then on `iFlag=1` sets `bCheck=1`, `sCheckPerson`, `tCheckDate` on `salsalesdevfollowupmaster`, and writes back: `UPDATE salsalesdevplanslave` (mark follow-up qty) and `UPDATE salsalesorderslave` when the plan slave references a sales-order line. `iFlag=0` rolls all of that back. Reads `salsalesdevplanmaster`/`salsalesorderslave` for context, no KPI / flow-check side-effects. + +**Invocation:** Bound to `gdsmodule.sProcName` on: +- `开发跟进` (sId `101251240115016045486980270`) — 销售机会 / 开发管理 +- `印前任务跟进` (sId `101251240115016054412953830`) + +Dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the 审核/反审核 button — the `Sp_Calc_s` slot. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sSdp.md b/en/docs/auto-catalog/procedures/Sp_Calc_sSdp.md index 20f2e96..ffbf2d3 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sSdp.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sSdp.md @@ -27,4 +27,13 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 开发计划 / 印前任务计划 / 项目立项单据 (development plan / prepress-task plan / project initiation — `salsalesdevplanmaster`) audit / un-audit. The 开发计划 schedules prepress/dev tasks against an 开发申请; on audit it freezes the plan rows, locks the originating 开发申请 line, and writes process-version refs onto `mftproductprocess` for any product being developed. + +**What it does:** Validates `sGuid`/`bInvalid`, then on `iFlag=1` sets `bCheck=1`, `sCheckPerson`, `tCheckDate` on `salsalesdevplanmaster`; writes-back to the originating `salsalesdevmaster` (audit qty on the development application) and updates `mftproductprocess` to record process versions; reads `viw_salsalesdevplan` for context. `iFlag=0` reverses the chain. + +**Invocation:** Bound to `gdsmodule.sProcName` on: +- `开发计划` (sId `101251240115016044841089590`) +- `印前任务计划` (sId `101251240115016054411974580`) +- `项目立项单据` (sId `101251240115016147549171140`) + +Dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the 审核/反审核 button — the standard `Sp_Calc_s` slot. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sSdv.md b/en/docs/auto-catalog/procedures/Sp_Calc_sSdv.md index ccdf675..bc6e086 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sSdv.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sSdv.md @@ -27,4 +27,14 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售机会 → 开发申请 (development application — `salsalesdevmaster`) audit / un-audit. The 开发申请 turns a 销售机会 product line into a tracked development task; on audit it locks the application and may write the linked-chance product back so that the chance is marked "in development". + +**What it does:** Validates `sGuid`/`bInvalid`, then on `iFlag=1` sets `bCheck=1`, `sCheckPerson`, `tCheckDate` on `salsalesdevmaster`; updates `salsaleschanceproduct` on the linked 销售机会 to flag the product as under development. `iFlag=0` reverses both. + +**Invocation:** Bound to `gdsmodule.sProcName` on: +- `开发申请` (sId `101251240115016044797781880`) +- `开发申请->开发计划` (sId `101251240115016052380061680`) — the convert/audit shortcut +- `工单变更申请` (sId `101251240115016117326536100`) — reused for the manufacturing-order change-request bill +- `项目评定` (sId `101251240115016126904308390`) — reused for the project-evaluation bill + +Dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the 审核/反审核 button. Reuse across non-dev forms means the body's reads against `salsalesdevmaster` may silently no-op for those — verify per form. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sSfu.md b/en/docs/auto-catalog/procedures/Sp_Calc_sSfu.md index 040f71a..f0c67a7 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sSfu.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sSfu.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 商机跟进单据 (sales lead follow-up — `salsalesFollowUpmaster`) audit / un-audit. The 商机跟进 records visit / call / progress notes against a 销售机会 (sales chance); auditing it freezes the follow-up and flags the parent chance / chance-product as touched. + +**What it does:** Validates `sGuid`/`bInvalid`, then on `iFlag=1` sets `bCheck=1`, `sCheckPerson`, `tCheckDate` on `salsalesFollowUpmaster`; updates `salsaleschancemaster` and `salsaleschanceproduct` on the linked 销售机会 to record the latest follow-up state. `iFlag=0` reverses the flags and writeback. + +**Invocation:** Bound to `gdsmodule.sProcName` on `商机跟进单据` (sId `101251240115016035948853880`) — 销售管理. Dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the 审核/反审核 button. xly-src also carries `script/标版/optimize/Sp_Calc_sSfu.sql` (perf patch) alongside the install script. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sSgm.md b/en/docs/auto-catalog/procedures/Sp_Calc_sSgm.md index 231eaa9..bfb3469 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sSgm.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sSgm.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 装配工艺卡 (assembly process card — `sgdsemigoodsmatchmaster`) audit / un-audit. The 装配工艺卡 captures the per-process route for a semi-goods assembly bill; auditing locks the route so downstream work-orders can consume it. + +**What it does:** Validates `sGuid`/`bInvalid`, then on `iFlag=1` sets `bCheck=1`, `sCheckPerson`, `tCheckDate` on `sgdsemigoodsmatchmaster`; reads `eleprocess` for process metadata and writes `sgdsemigoodsmatchprocess` to fill in process refs / sequencing. `iFlag=0` reverses the flag and the writeback. + +**Invocation:** Bound to `gdsmodule.sProcName` on `装配工艺卡` (sId `101251240115015942008559830`) — 制造管理. Dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the 审核/反审核 button. Despite the page comment "发外检验" (outsourced-inspection), the actual deployed body targets the assembly-process-card master — verify both the comment and any customer override. + +Flag: page comment `发外检验` does not match the deployed body (which targets `sgdsemigoodsmatchmaster`, an assembly-route bill). One of the two is stale — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sSiv.md b/en/docs/auto-catalog/procedures/Sp_Calc_sSiv.md index b9b68d4..5cd768a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sSiv.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sSiv.md @@ -27,4 +27,12 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售发票 (sales invoice — `salsalesinvoicemaster`) audit / un-audit. Auditing a 销售发票 commits the AR (accounts-receivable) row, freezes the linked 对账单/送货单/退货 lines, and optionally posts an operator KPI. + +**What it does:** Validates `sGuid`/`bInvalid` and reads `viw_salsalesinvoice` for context; on `iFlag=1` sets `bCheck=1`, `sCheckPerson`, `tCheckDate` on `SalSalesInvoiceMaster`/`SalSalesInvoiceSlave`; writes-back `Update salsalescheckingmaster`/`SalSalesCheckingSlave` (对账 freeze), `saldelivernotifyslave`, `salrejectgoodsslave`; `INSERT INTO CahReceivables` to post the AR row and `Update CahCustomerInit`/`CahFinancialAdjust` to refresh customer balance; logs an optional `kpidetail` row; calls `Sp_System_CheckFlow` per slave when define-check is on. `iFlag=0` reverses every step (`Delete FROM CahReceivables`, clear flags, undo writeback). + +**Invocation:** Bound to `gdsmodule.sProcName` on: +- `销售发票单据` (sId `15780358080007074056281633539000`) — also `sSaveProName=Sp_Check_sSiv`, `sSaveProNameBefore=Sp_beforeSave_sSiv`, `sDeleteProName=Sp_afterSave_sSiv` +- `销售发票明细` (sId `15777565190004256392637270378500`) + +Dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the 审核/反审核 button — the standard `Sp_Calc_s` slot. xly-src has multiple patches (`optimize/`, `upgrade/20220104审核去除结账校验/`, customer-side `Demo3.sql`) — verify which is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sSmb.md b/en/docs/auto-catalog/procedures/Sp_Calc_sSmb.md index f71dea6..93a5cdd 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sSmb.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sSmb.md @@ -27,4 +27,12 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 装配工单 / 配墨工单 (assembly work-order / ink-mixing work-order — `sgdsemigoodsmatchbillmaster`) audit / un-audit. Auditing the 装配工单 expands the BOM into production-plan rows, reserves material stock and back-writes the parent 销售订单 with planned qty. + +**What it does:** Validates `sGuid`/`bInvalid`, then on `iFlag=1` sets `bCheck=1` on `sgdsemigoodsmatchbillmaster` and its slave/materials/process rows; iterates a `Materials_cursor` and `INSERT INTO mftproductionplan` (one plan row per material) calling `Sp_Manufacture_InsertMftPlan` and `Sp_MaterialsStoreVirtual` for each; updates `EleMaterialsStock` (deduct) and `MitMaterialsStoreVirtual` (delete-reseed); writes back `UPDATE SalSalesOrderSlave` (mark assembled qty); replaces `mftworkorderparam` rows via `Sp_System_ReplaceField`. `iFlag=0` reverses by `DELETE FROM mftproductionplan` and restoring stock. + +**Invocation:** Bound to `gdsmodule.sProcName` on: +- `装配工单` (sId `101251240115015922165750500`) — 制造管理 +- `配墨工单` (sId `101251240115016045673367650`) + +Dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the 审核/反审核 button. xly-src ships an `script/标版/optimize/Sp_Calc_sSmb.sql` perf patch — verify which is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sSmc.md b/en/docs/auto-catalog/procedures/Sp_Calc_sSmc.md index 5195a86..3147b6d 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sSmc.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sSmc.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 半成品盘点 (semi-goods stock-take — `sgdsemigoodscheckmaster`) audit / un-audit. Auditing posts the counted deltas against the perpetual semi-goods stock so the 帐面/实物 difference becomes the new book qty. + +**What it does:** Validates `sGuid`/`bInvalid` and `SysLocking`, then on `iFlag=1` sets `bCheck=1`, `sCheckPerson`, `tCheckDate` on `sgdsemigoodscheckmaster` and its slave; iterates `sgdsemigoodscheckSlave`, `UPDATE elesemigoodsstock` to set the new on-hand and `INSERT INTO sgdSemigoodsStore` for the audit-trail movement row; `iFlag=0` reverses both, restoring the prior on-hand. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` binding, no form-master `sSqlStr` ref, no other-routine caller, no xly-src grep hit. The 半成品盘点 form is wired up under a sibling proc; this looks like a legacy audit slot retained by name convention only — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sSmi.md b/en/docs/auto-catalog/procedures/Sp_Calc_sSmi.md index c9f4d6c..c563dce 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sSmi.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sSmi.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 半成品入库 (semi-goods inbound — `sgdsemigoodsinstoremaster`) audit / un-audit. Auditing the inbound bill writes the semi-goods qty into stock, posts the movement row and back-writes the originating 入库申请 with the received qty. + +**What it does:** Validates `sGuid`/`bInvalid` and `SysLocking`, then on `iFlag=1` sets `bCheck=1`, `sCheckPerson`, `tCheckDate` on `sgdsemigoodsinstoremaster`; iterates `sgdsemigoodsinstoreslave`, calls `SP_Inventory_SemgoodsInOutWareHouse` (`+1` direction) per row to write `INSERT INTO sgdSemigoodsStore` and `UPDATE elesemigoodsstock` for the on-hand; writes back `UPDATE sgdsemigoodsinstoreapplyslave` to mark the apply line as received. `iFlag=0` reverses every step. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` binding, no form-master `sSqlStr` ref, no other-routine caller, no live xly-src Java caller — only the install scripts in `script/标版/30100101/` and the optimize patch at `script/标版/optimize/Sp_Calc_sSmi.sql`. The 半成品入库 form is currently wired up under a different proc; candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sSmia.md b/en/docs/auto-catalog/procedures/Sp_Calc_sSmia.md index 957ca14..7cd4b80 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sSmia.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sSmia.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 半成品入库申请 (semi-goods inbound application — `sgdsemigoodsinstoreapplymaster`) audit / un-audit. The application bill pre-commits an inbound qty against a 工单 (work-order) line; auditing locks the application and back-writes the work-order process slave. + +**What it does:** Validates `sGuid`/`bInvalid` and `SysLocking`, then on `iFlag=1` sets `bCheck=1`, `sCheckPerson`, `tCheckDate` on `sgdsemigoodsinstoreapplymaster`; iterates `sgdsemigoodsinstoreapplyslave` and `Update mftworkorderprocess` to mark the originating work-order process step as applied. `iFlag=0` reverses both. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` binding, no form-master `sSqlStr` ref, no other-routine caller. xly-src carries install scripts (`script/标版/30100101/Sp_Calc_sSmia.sql`) and an optimize patch (`script/标版/optimize/Sp_Calc_sSmia.sql`) but no Java caller — the live 入库申请 form is wired up under a different proc; candidate for maintainer audit. Despite the page comment 装配工单, the deployed body targets the inbound-application master. + +Flag: page comment `装配工单` does not match the deployed body (which targets `sgdsemigoodsinstoreapplymaster`). One of the two is stale — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sSmo.md b/en/docs/auto-catalog/procedures/Sp_Calc_sSmo.md index 7dc4f30..480f9d0 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sSmo.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sSmo.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 半成品出库 (semi-goods outbound — `sgdsemigoodsoutstoremaster`) audit / un-audit. Mirror of `Sp_Calc_sSmi`: auditing the outbound bill deducts the semi-goods qty from stock, posts the movement row and back-writes the originating 出库申请. + +**What it does:** Validates `sGuid`/`bInvalid` and `SysLocking`, then on `iFlag=1` sets `bCheck=1`, `sCheckPerson`, `tCheckDate` on `sgdsemigoodsoutstoremaster`; iterates `sgdsemigoodsoutstoreslave`, calls `SP_Inventory_SemgoodsInOutWareHouse` (`-1` direction) per row to deduct from `elesemigoodsstock` and `INSERT INTO sgdSemigoodsStore` for the movement row; writes back `UPDATE sgdsemigoodsoutstoreapplyslave` to mark the apply line as picked. `iFlag=0` reverses every step. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` binding, no form-master `sSqlStr` ref, no other-routine caller, no Java caller — only install/optimize SQL scripts. Despite the page comment 装配工单, the deployed body targets the semi-goods outbound master. Candidate for maintainer audit. + +Flag: page comment `装配工单` does not match the deployed body (which targets `sgdsemigoodsoutstoremaster`). One of the two is stale — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sSmoa.md b/en/docs/auto-catalog/procedures/Sp_Calc_sSmoa.md index 746f957..9ef6c3f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sSmoa.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sSmoa.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 半成品出库申请 (semi-goods outbound application — `sgdsemigoodsoutstoreapplymaster`) audit / un-audit. Mirror of `Sp_Calc_sSmia`: the application bill pre-commits an outbound qty against a 工单 line; auditing locks the application and back-writes the work-order process slave. + +**What it does:** Validates `sGuid`/`bInvalid` and `SysLocking`, then on `iFlag=1` sets `bCheck=1`, `sCheckPerson`, `tCheckDate` on `sgdsemigoodsoutstoreapplymaster`; iterates `sgdsemigoodsoutstoreapplyslave` and `Update mftworkorderprocess` to mark the originating work-order process step as planned to issue. `iFlag=0` reverses both. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` binding, no form-master `sSqlStr` ref, no other-routine caller. xly-src carries `script/标版/30100101/Sp_Calc_sSmoa.sql` (install) and `script/标版/optimize/Sp_Calc_sSmoa.sql` (perf patch) but no Java caller. Candidate for maintainer audit. Despite the page comment 装配工单, the deployed body targets the outbound-application master. + +Flag: page comment `装配工单` does not match the deployed body (which targets `sgdsemigoodsoutstoreapplymaster`). One of the two is stale — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sSod.md b/en/docs/auto-catalog/procedures/Sp_Calc_sSod.md index c57440a..e9cc633 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sSod.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sSod.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售订单 (sales order — `SalSalesOrderMaster`/`Slave`) audit / un-audit. This is the central sales-order approval proc: on audit it freezes the order, expands BOM/process snapshots, reserves stock, seeds AR, refreshes the customer product file, and may auto-trigger the workflow engine. Reused across many order variants (轮转 / 丝印 / 膜类 / 套装 / 书刊 / 材料 / 项目申请 / 补货 / 打样申请 / 配送任务 / 备货 / 代收 / 项目立项-related forms). + +**What it does:** Validates `sGuid`/`bInvalid`/`SysLocking`/`sysaccountperiod`, then on `iFlag=1` sets `bCheck=1`, `sCheckPerson`, `tCheckDate` on `SalSalesOrderMaster`/`SalSalesOrderSlave`; cleans-and-rewrites order children (`DELETE FROM salsalesordercontrol`, `salsalesordercontrolcombine`, `salsalesordermaterials`, `salsalesorderprocess`, `salSalesOrderChild`, `CahReceivables` then re-`INSERT` from authoritative sources); upserts `EleProduct`/`eleproductcustomer`/`EleProductStock` to refresh the customer product file; calls `Sp_ProductStoreVirtual` to reserve virtual stock against `PitProductStoreVirtual`, `SP_Sis_GetMaxNo` for new product/lot codes, `Sp_System_CheckFlow` per slave when define-check is on, `Sp_System_AutoSendMobileCheckMsg` to push the audit notification, and `Sp_Bill_Used` to register consumption. `iFlag=0` reverses every step. + +**Invocation:** Bound to `gdsmodule.sProcName` on 30+ forms — the canonical ones being `1/3 新增销售订单` (sId `101251240115016086186007360`, with `sSaveProName=Sp_Check_sSod`, `sSaveProNameBefore=Sp_beforeSave_sSod`, `sDeleteProName=Sp_afterSave_sSod`) and `1/3 新增轮转销售订单` (sId `101251240115015878710737470`). Also reused on `销售订单单据(兼容停用)`, `轮转/丝印/膜类/套装/书刊/材料类销售订单`, `打样申请`, `项目申请(S-BOM)`, `合版订单处理`, `印前文件处理单据`, `配送任务`/`配送记录`/`备货记录`/`代收记录`, `补货订单`, `异常待处理订单`, `工单任务预测`, etc. + +Dispatched dynamically by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on the 审核/反审核 button. Also called directly from Java by `ErpOrderProcurementServiceImpl.doCallSsod()` via the `CheckErpOrderThread` flow when an online (线上) order or business-card single-page order auto-audits after import — and immediately followed by `doCallSsodAfter()` which calls `Sp_Calc_sSodAfter`. A 高旺 customer override (`script/客户/高旺/20211101成品库存多单位/Sp_Calc_sSod.sql`) and a 千彩 override (`script/客户/千彩/Sp_Calc_sSod.sql`) exist — verify which is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sSodAfter.md b/en/docs/auto-catalog/procedures/Sp_Calc_sSodAfter.md index 42c0899..9ec18d0 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sSodAfter.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sSodAfter.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售订单执行后执行过程 (post-audit hook for sales-order, fired specifically when an online (线上) order or business-card single-page order auto-audits after import). The hook exists so customer-specific deployments can inject extra logic after `Sp_Calc_sSod` finishes, without having to override the main audit proc. + +**What it does:** The stock body is intentionally a no-op: validates parameters, then `iFlag=1` and `iFlag=0` both `LEAVE top` immediately. Customer overrides (e.g. `script/客户/...`) replace the body with deployment-specific writebacks. + +**Invocation:** Called directly from Java by `ErpOrderProcurementServiceImpl.doCallSsodAfter()` immediately after `doCallSsod()` in the `CheckErpOrderThread` flow — i.e. only on the auto-audit path for online orders / business-card orders, not on the UI 审核 button. Exceptions inside are swallowed by the caller. No `gdsmodule.sProcName` binding (intentional — only the Java path drives it). xly-src ships the install script at `script/标版/30100101/Sp_Calc_sSodAfter.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sSodbecome.md b/en/docs/auto-catalog/procedures/Sp_Calc_sSodbecome.md index 89a26d5..4022814 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sSodbecome.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sSodbecome.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售订单变更审核 (sales-order change-request audit — `SalSalesOrderbecomeMaster`). When a 销售订单 is changed (qty / spec / delivery date) after audit, the variance is recorded on a 变更 bill; auditing that 变更 propagates the new values back into the live 销售订单, work-order, delivery-notify and delivery-goods slaves. + +**What it does:** Validates `sGuid`/`bInvalid`/`SysLocking`/`sysaccountperiod`, then on `iFlag=1` sets `bCheck=1`, `sCheckPerson`, `tCheckDate` on `SalSalesOrderbecomeMaster`; propagates the changed fields into `salsalesordermaster`/`salsalesorderslave` and synchronises downstream rows: `Update mftworkordermaster`/`mftworkorderslave` (work-order specs), `Update saldelivernotifyslave` and `Update saldelivergoodsslave` (open delivery-notify and delivery lines). `iFlag=0` rolls back to the pre-change values. + +**Invocation:** Status: not bound to any current `gdsmodule.sProcName`, form-master `sSqlStr` ref, or other-routine caller; no xly-src grep hit. Despite the rich change-propagation body, this audit slot for `SalSalesOrderbecomeMaster` is not wired into the live metadata in this database — candidate for maintainer audit. Likely either superseded by a sibling proc / btn-event handler or pending re-wiring after a recent change. Verify deployment. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sSpfu.md b/en/docs/auto-catalog/procedures/Sp_Calc_sSpfu.md index 56c16a8..1d87d02 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sSpfu.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sSpfu.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售打样跟进 (sales sample-printing follow-up — `salsalesprintfollowupmaster`) audit / un-audit. The 打样跟进 records progress against a 打样申请 (sample-print application); auditing freezes the follow-up so it can drive downstream costing. + +**What it does:** Validates `sGuid`/`bInvalid`, then on `iFlag=1` sets `bCheck=1`, `sCheckPerson`, `tCheckDate` on `salsalesprintfollowupmaster`; `iFlag=0` reverses the flag. No KPI, no flow-check, no downstream writeback in the deployed body. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` binding, no form-master `sSqlStr` ref, no other-routine caller, no Java caller — only the install script at `script/标版/30100101/Sp_Calc_sSpfu.sql`. Despite the page comment 商机跟进, the deployed body targets `salsalesprintfollowupmaster` (打样跟进), not `salsalesFollowUpmaster` (商机跟进 — that's `Sp_Calc_sSfu`). Candidate for maintainer audit. + +Flag: page comment `商机跟进` does not match the deployed body (which targets `salsalesprintfollowupmaster`, the 打样跟进 bill). One of the two is stale — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sSpp.md b/en/docs/auto-catalog/procedures/Sp_Calc_sSpp.md index 09904d7..57e5d42 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sSpp.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sSpp.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Salutes the `Sp_Calc_s*` audit/un-audit signature (iFlag 1/0 → bCheck on a master), targetting `salsalesprintplanmaster` (印前计划主表). The proc's COMMENT says 商机跟进 but the actual table it touches is the prepress-plan master — the comment appears stale. + +**What it does:** Validates `sGuid`, refuses if `bInvalid=1` (cannot audit an invalidated row), refuses audit/un-audit when the row is already in the requested state, then `UPDATE salsalesprintplanmaster SET bCheck = {1|0}, sCheckPerson = sLoginId, tCheckDate = NOW()` for the given id. Strips dashes from `sReturn` at the end. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` binds this name — 商机跟进单据 uses `Sp_Calc_sSfu`, and 印前任务计划 uses `Sp_Calc_sSdp`. Only xly-src reference is `script/标版/30100101/Sp_Calc_sSpp.sql` (install script). No Java caller, no other-routine caller, no form-master reference. Candidate for maintainer audit — likely a renamed/abandoned earlier audit handler. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sStd.md b/en/docs/auto-catalog/procedures/Sp_Calc_sStd.md index 2ddd2ae..87e383f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sStd.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sStd.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Bears the `Sp_Calc_s*` audit/un-audit signature against `QlyProcessTestMaster` (a quality / process-test master). The COMMENT misleadingly says 销售订单 — actual ops are on the quality table, suggesting the COMMENT was copy-pasted. + +**What it does:** With `iFlag=1` runs `Update QlyProcessTestMaster Set bCheck=1 Where sId=sGuid` (scoped by brand/subsidiary); with `iFlag=0` flips `bCheck=0`. No invalidate-guard, no bill-used registration, no flow trigger — minimal compared to other `Sp_Calc_s*` siblings. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` row binds this name; xly-src has only the install script `script/标版/30100101/Sp_Calc_sStd.sql`. No Java caller, no other-routine caller, no form-master reference. Candidate for maintainer audit — the canonical std (品质过程测试) audit handler is named elsewhere. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sStl.md b/en/docs/auto-catalog/procedures/Sp_Calc_sStl.md index 46df291..49e6c9e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sStl.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sStl.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 财务单据 → 财务调整单据 — audit/un-audit handler for the financial-adjustment voucher (`CahFinancialAdjust`). The 财务调整单据 lets finance post manual receivable/payable/inventory corrections; auditing the bill is the formal commitment step before downstream `Sp_Bill_Used` chains pick it up. + +**What it does:** Validates `sGuid`; refuses when a `SysLocking` row exists for the bill (concurrent operation lock). Loads `tCreateDate`, `bInvalid` from `CahFinancialAdjust`; refuses when `bInvalid=1`. Reads `SysSystemSettings.CkxIntervalMonthModifyBill` and (when 0) checks `sysaccountperiod.bFrozen` to guard against modifying a closed period. With `iFlag=1` flips `bCheck=1`, stamps `sCheckPerson`/`tCheckDate` on the master; with `iFlag=0` reverses. May trigger `Sp_System_CheckFlow` when 自定义审批流 is enabled and `Sp_Bill_Used` for usage registration. + +**Invocation:** Bound to `gdsmodule.sProcName` on 财务调整单据 (sId `192116810113315265349306830`) — 财务管理 → 财务单据. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, ...)` on the 审核/反审核 button. xly-src ships `script/标版/30100101/Sp_Calc_sStl.sql` (install) and `script/标版/optimize/Sp_Calc_sStl.sql` (patch). diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sStl_copy1.md b/en/docs/auto-catalog/procedures/Sp_Calc_sStl_copy1.md index 5a1d6e6..08ade2a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sStl_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sStl_copy1.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_Calc_sStl` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_Calc_sStl` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sSuBJ.md b/en/docs/auto-catalog/procedures/Sp_Calc_sSuBJ.md index 0db1811..4cf1680 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sSuBJ.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sSuBJ.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Has the `Sp_Calc_s*` audit/un-audit signature against `PurPurchasesuppinquirymaster` (采购询价单 = supplier inquiry/quote sheet). COMMENT says 供应商报价单 — the master table comment confirms this is the procurement-side inquiry/quote bill. + +**What it does:** Validates `sGuid`. With `iFlag=1` checks the master is not already `bCheck=1`, then flips `bCheck=1` and stamps `sCheckPerson`/`tCheckDate`. With `iFlag=0` mirrors as un-audit. Honours the `iDefineCheck`/`CkxDefineCheck` system setting (custom approval flow) — would route through `Sp_System_CheckFlow` rather than directly flipping the flag. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` row binds this name (采购询价单 uses `Sp_Calc_sMsy`). xly-src has no occurrence anywhere. No Java caller, no other-routine caller, no form-master reference. Candidate for maintainer audit — either a legacy duplicate of `Sp_Calc_sMsy` or a stub for a feature that was never wired up. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sSup.md b/en/docs/auto-catalog/procedures/Sp_Calc_sSup.md index c79d38f..67e1a3e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sSup.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sSup.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Bears the `Sp_Calc_s*` audit/un-audit signature against `elenewsupply` (new-supplier onboarding / 新供应商申请). COMMENT says 供应商审核 — auditing the new-supplier registration moves it toward becoming a usable `elesupply` row. + +**What it does:** Validates `sGuid`. With `iFlag=1` and `bCheck=0`, flips `bCheck=1`/`sStatus=1`/`sCheckPerson`/`tCheckDate` on `elenewsupply`; when `iDefineCheck=1` and `iTmpCheck<>1` runs `Sp_System_ReplaceField_*` and `Sp_System_CheckFlow` so the custom approval workflow can fire. With `iFlag=0` mirrors as un-audit. Refuses transitions that are already in the requested state. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` row binds this name; xly-src has no occurrence anywhere. No Java caller, no other-routine caller, no form-master reference. Candidate for maintainer audit — the live 供应商准入/审核 hook is likely a sibling such as `Sp_Calc_sSupply` (which targets the same business but the canonical `elesupply` table). diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sSupply.md b/en/docs/auto-catalog/procedures/Sp_Calc_sSupply.md index fd7b11b..af0fb35 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sSupply.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sSupply.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Bears the `Sp_Calc_s*` audit/un-audit signature against `elesupply` (供应商主数据 = supplier master). COMMENT says 供应商准入 — auditing approves the supplier for use in procurement bills. + +**What it does:** Validates `sGuid`. With `iFlag=1` and the master not already `bCheck=1`, flips `bCheck=1`/`sStatus=1`/`sCheckPerson`/`tCheckDate` on `elesupply`. With `iFlag=0` symmetric un-audit. Localised error messages via `Sp_Sis_GetConst`. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` row binds this name; xly-src has no occurrence anywhere. No Java caller, no other-routine caller, no form-master reference. Candidate for maintainer audit — `elesupply` does have an audit flow, just wired under a different proc. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sUdf.md b/en/docs/auto-catalog/procedures/Sp_Calc_sUdf.md index 780a0d4..3ed139a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sUdf.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sUdf.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 业财一体化 → 单据 → 财务凭证单据 — audit/un-audit handler for the accounting voucher (`udfvouchermaster` / `udfvoucherslave`). Auditing posts the voucher into the closed period for GL reporting; unaudit reverses it. + +**What it does:** Validates `sGuid`. With `iFlag=1`, refuses when the master is already `bCheck=1`; then guards expense-category voucher lines (`sAccountNo` `6601` / `6602`) — refuses when any slave row is missing `sFflex5` (部门) or `sFflex9` (费用科目代码), returning the localised "费用类凭证需填写部门和费用科目代码" message via `Fun_Sis_GetConstNew`. On success `Update udfvouchermaster SET bCheck=1, sStatus='1'`. With `iFlag=0` symmetric un-audit on the same master. + +**Invocation:** Bound to `gdsmodule.sProcName` on 财务凭证单据 (sId `15928127560001382627511178461700`) — 业财一体化 → 单据. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, ...)` on the 审核/反审核 button. xly-src ships `script/标版/30100101/Sp_Calc_sUdf.sql` (install) and `script/标版/optimize/Sp_Calc_sUdf.sql` (patch). Sibling: `Sp_Calc_sUdft` for the voucher-template variant. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sUdft.md b/en/docs/auto-catalog/procedures/Sp_Calc_sUdft.md index e1f1b40..d003443 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sUdft.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sUdft.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 业财一体化 → 单据 → 凭证模板单据 — audit/un-audit handler for the accounting-voucher template (`udfvouchertemplatemaster`). The template lets finance preconfigure standard postings (e.g. "depreciation of fixed assets") that the voucher form clones; auditing the template marks it as ready-to-use. + +**What it does:** Validates `sGuid`. With `iFlag=1`, refuses when the template is already `bCheck=1`, then `Update udfvouchertemplatemaster SET bCheck=1, sStatus='1'` for the given id. With `iFlag=0` symmetric un-audit. Simpler than `Sp_Calc_sUdf` — no expense-category guard, no slave validation. + +**Invocation:** Bound to `gdsmodule.sProcName` on 凭证模板单据 (sId `101251240115016274437635530`) — 业财一体化 → 单据. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, ...)` on the 审核/反审核 button. xly-src ships `script/标版/30100101/Sp_Calc_sUdft.sql` (install) and `script/标版/optimize/Sp_Calc_sUdft.sql` (patch). Sibling of `Sp_Calc_sUdf`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sWod.md b/en/docs/auto-catalog/procedures/Sp_Calc_sWod.md index 72138d4..82fe33c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sWod.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sWod.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产单据 / 订单生产流程 — work-order audit (审核 / 反审核). The umbrella `Sp_Calc_s*` handler for every flavour of 工单 (production work-order) in xly: 生产工单, 印刷工单系列 (轮转 / 丝印 / 柔印 / 数码 / 膜类 / 书刊 / 通用 / 套装 / 材料加工), prepress 打样工单, 制版/印刷工作单, plus their 补单 (supplemental) variants. Auditing the work-order locks specs and emits its production plan; un-auditing reverses. + +**What it does:** ~168 KB body. Branches on `iFlag`. On audit: validates `sGuid`, refuses on `bInvalid=1` or already `bCheck=1`; copies/locks technology, materials and process versions; allocates a new `MftProductMaster`/`MftProductSlave`/`MftProductControl` row when the work-order changes product (`sChangeProductGuid`), `Insert into mftproductionplan` to seed the production-plan row, `Insert into eleproductcustomer` to register customer-product binding, `Insert into EleMaterialsStock` reservation, `UPDATE EleKnifeMould` to reserve knife-mould assets, may `CALL SP_Sis_GetMaxNo` for the plan no. Optionally invokes `Sp_System_CheckFlow` (custom approval). Finally `CALL Sp_Bill_Used` for usage registration. On un-audit symmetric clean-up. + +**Invocation:** Bound to `gdsmodule.sProcName` on **22+** work-order modules: 生产工单, 轮转工单, 合版工单, 丝印工单 + 补单, 柔印工单, 数码工单, 膜类工单 + 补单, 书刊工单 + 补单, 通用工单 + 补单, 套装工单, 材料加工单, 实验工单, 打样工单 (各类), 白样 / 蓝纸 / 制版 / 测试 / 印刷工作单, 2/3 新增生产补单 + 新增轮转补单, 包装补单(new), 生产工单(兼容停用), 生产补单(兼容停用). For 生产工单 / 轮转工单 / 2-3 新增生产补单 also drives the `sSaveProName=Sp_Check_sWod`, `sSaveProNameBefore=Sp_beforeSave_sWod`, `sDeleteProName=Sp_afterSave_sWod` hooks. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, ...)`. Also called by sibling procs `Sp_Calc_sBgd`, `Sp_Calc_sRct`, `Sp_Calc_sRcts`, `Sp_Calc_sRct_copy1` (cascading audit of related bills). xly-src ships install + optimize scripts at `script/标版/30100101/Sp_Calc_sWod.sql` and `script/标版/optimize/Sp_Calc_sWod.sql`, plus customer overrides under `script/客户/` (金宣发, 千彩, 上海亚峰 — verify which is deployed). diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sYear.md b/en/docs/auto-catalog/procedures/Sp_Calc_sYear.md index a4bf521..45b316f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sYear.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sYear.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Bears the `Sp_Calc_s*` audit/un-audit signature against `elematerialsyearmaster` (材料年度单价 — annual material-pricing master). COMMENT says 年度单价 — auditing a year's price list freezes it as the reference rate for the calendar year. + +**What it does:** Validates `sGuid`. With `iFlag=1`, refuses when already `bCheck=1`; on success `Update elematerialsyearmaster SET bCheck=1, sStatus=1, sCheckPerson, tCheckDate=NOW()`. With `iFlag=0` symmetric un-audit, refusing when already at `bCheck=0`. Localised messages via `Sp_Sis_GetConst`. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` row binds this name; xly-src has no occurrence anywhere. No Java caller, no other-routine caller, no form-master reference. Candidate for maintainer audit — the 年度单价 maintenance flow exists in the UI but its audit handler must be named differently in the deployed gdsmodule row. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sYsTb.md b/en/docs/auto-catalog/procedures/Sp_Calc_sYsTb.md index 73d3ccc..7a323a3 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sYsTb.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sYsTb.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Bears the `Sp_Calc_s*` audit/un-audit signature against `departmentalBudgetMaster` (部门预算填报主表 — departmental budget-entry master). COMMENT says 预算填报审批 — auditing approves the department's submitted budget for the period. + +**What it does:** Validates `sGuid`. Reads `departmentalBudgetMaster.bInvalid`, refuses when invalidated. Checks `SysSystemSettings.CkxIntervalMonthModifyBill` (currently the period-frozen guard against `sysaccountperiod.bFrozen` is commented out in the body — see Caveat). With `iFlag=1` flips the master to bCheck/sStatus checked state; with `iFlag=0` reverses. Honours custom approval flow when configured. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` row binds this name; xly-src has no occurrence anywhere. No Java caller, no other-routine caller, no form-master reference. Candidate for maintainer audit. + +Caveat: the period-frozen guard block (`sysaccountperiod.bFrozen` check) is commented out in the deployed body — a budget submission can be audited even when the accounting period is closed. Flag for finance maintainer. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sYzfy.md b/en/docs/auto-catalog/procedures/Sp_Calc_sYzfy.md index dc8c09f..abea7b8 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sYzfy.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sYzfy.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Bears the `Sp_Calc_s*` audit/un-audit signature against `advanceCostCheckMaster` (预支费用审批主表 — advance-expense approval master). COMMENT says 预支费用审批 — auditing approves an employee's advance-expense application before disbursement. + +**What it does:** Validates `sGuid`. Reads `advanceCostCheckMaster.bInvalid` and `tCreateDate`; refuses when invalidated. The period-frozen guard against `sysaccountperiod.bFrozen` and the `CkxIntervalMonthModifyBill` setting are both commented out in the deployed body (see Caveat). With `iFlag=1` flips the master to checked state; with `iFlag=0` reverses. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` row binds this name; xly-src has no occurrence anywhere. No Java caller, no other-routine caller, no form-master reference. Candidate for maintainer audit. + +Caveat: the accounting-period frozen guard is commented out — advance-expense audits can be applied to periods that finance has already closed. Sibling of `Sp_Calc_sYsTb` which has the same disabled-guard issue. Flag for finance maintainer. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_scusded.md b/en/docs/auto-catalog/procedures/Sp_Calc_scusded.md index 09bed71..a17e2b6 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_scusded.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_scusded.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 客户索赔 — customer-deduction / customer-claim check / uncheck on `saldelivergoodsdedmaster`. Approves a deduction the customer has applied against a delivery (price chargeback, claim, short-pay) so the receivable totals update; locks in the currency-rate snapshot at audit time. + +**What it does:** Validates `sGuid`. Reads master `bInvalid`; refuses if invalid. With `iFlag=1`: sets `saldelivergoodsdedmaster.bCheck=1`, `sStatus=1`, `sCheckPerson=sLoginId`, `tCheckDate=tCheckTime`, then refreshes `dCurrencyRate` by joining `elecustomer C ON M.sCustomerId=C.sId` and `siscurrency S ON C.sCurrency=S.sCurrency`. With `iFlag=0`: clears master flags (currency-rate snapshot stays). + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName/sSaveProName/sDeleteProName/sSaveProNameBefore` binding, no `gdsconfigformmaster` reference, no other procedure or function calls it, no xly-src hit. The 客户索赔 table exists in the schema but the audit handler is unwired in this DB instance. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_sopsded.md b/en/docs/auto-catalog/procedures/Sp_Calc_sopsded.md index 31ce69f..31dc6f5 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_sopsded.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_sopsded.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Audit handler for 外协商扣款 (outsource-vendor chargeback) on `opsoutsideinstorededmaster` — the "ded" (deduction) variant of 发外入库. After QC rejects part of an outsourced delivery, this doc records a chargeback against the vendor; on approval the master/slave rows are frozen and the approval workflow is engaged. + +**What it does:** Validates `sGuid`/`bInvalid`, requires `sFlowDeptId` to be set before audit (returns the localised `sChooseReviewDepart` error otherwise), then `Update`s `opsoutsideinstorededmaster` + `opsoutsideinstorededslave` to set `bCheck=1, sStatus=1, sCheckPerson, tCheckDate=NOW()`. The reverse branch (`iFlag=0`) clears the same flags. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName/sSaveProName`, `gdsconfigformmaster` form-master, sibling-routine, or xly-src reference targets `Sp_Calc_sopsded` (note lower-case `s` in `sopsded` — distinct identifier). Candidate for maintainer audit; confirm whether the 外协商扣款 module is exposed in this tenant's menu before adopting. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_spurded.md b/en/docs/auto-catalog/procedures/Sp_Calc_spurded.md index 9646f8e..197a90a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_spurded.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_spurded.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 供应商扣款 — audit / un-audit of a 供应商扣款 (supplier deduction / charge-back) bill on `purpurchaseinstorededmaster`. Tied to the purchase-receipt deduction flow (e.g. supplier shipped short or off-spec, deduct from payable). Most of the post-audit recalculation logic in the body is commented out — current path is a minimal flag flip on master. + +**What it does:** Validates `sGuid`, refuses when `bInvalid=1`. On `iFlag=1` `UPDATE purpurchaseinstorededmaster` to flip `bCheck=1`, `sStatus=1`, stamp `sCheckPerson`/`tCheckDate`; `iFlag=0` reverses. Several blocks that would recompute `purpurchaseinstorededslave.dMaterialsMoney`, `dMaterialsPrice`, tax-money breakdowns from `sistax`, etc., are present as comments — historical logic preserved but disabled. + +**Invocation:** No `gdsmodule.sProcName` binding found in this snapshot, no `gdsconfigformmaster.sSqlStr` reference, no other proc/func calls it, and no xly-src grep hits. **Status: appears orphaned.** Either dispatched only from a customer overlay not in this snapshot, deactivated when its mainline logic was commented out, or stub left in place for legacy compatibility — candidate for maintainer audit. + +Naming note: lowercase `spurded` (vs the family's `s` style) suggests the proper code is `sPurDed`; an inconsistent casing of `Sp_Calc_sPurDed`. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_tice.md b/en/docs/auto-catalog/procedures/Sp_Calc_tice.md index 5a276c8..caaffb8 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_tice.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_tice.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Has the `Sp_Calc_s*` audit/un-audit signature against `eptmachinefixednoticemaster` (设备固定资产报修通知主表 — equipment fixed-asset repair-notice master). COMMENT says 印刷工单审核 but that's stale copy-paste; the actual table is the equipment-asset notice bill. The proc name's `_tice` suffix comes from "no**tice**". + +**What it does:** Validates `sGuid`; refuses on `bInvalid=1`. With `iFlag=1`, refuses when already `bCheck=1`; otherwise `UPDATE eptmachinefixednoticemaster SET bCheck=1, sStatus=1, sCheckPersON=sLoginId, tCheckDate=NOW()`. With `iFlag=0` symmetric un-audit. (Note: column name is mis-cased as `sCheckPersON` in the body — case-sensitive on case-sensitive collations.) + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` row binds this name; xly-src has no occurrence anywhere. No Java caller, no other-routine caller, no form-master reference. Candidate for maintainer audit — together with sibling `Sp_Calc_tore` (same body shape against `eptmachinefixedinstoremaster`), these look like a stalled-out repair-notice / asset-storage audit pair. diff --git a/en/docs/auto-catalog/procedures/Sp_Calc_tore.md b/en/docs/auto-catalog/procedures/Sp_Calc_tore.md index 0850b40..f9bbc38 100644 --- a/en/docs/auto-catalog/procedures/Sp_Calc_tore.md +++ b/en/docs/auto-catalog/procedures/Sp_Calc_tore.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Has the `Sp_Calc_s*` audit/un-audit signature against `eptmachinefixedinstoremaster` (设备固定资产入库主表 — equipment fixed-asset inbound-storage master). COMMENT says 印刷工单审核 but that's stale; the table is the equipment-asset entry-to-warehouse bill. The proc name's `_tore` suffix comes from "ins**tore**". + +**What it does:** Validates `sGuid`; refuses on `bInvalid=1`. With `iFlag=1`, refuses when already `bCheck=1`; otherwise `UPDATE eptmachinefixedinstoremaster SET bCheck=1, sStatus=1, sCheckPersON=sLoginId, tCheckDate=NOW()`. With `iFlag=0` symmetric un-audit. (Note: column name is mis-cased as `sCheckPersON` in the body.) + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` row binds this name; xly-src has no occurrence anywhere. No Java caller, no other-routine caller, no form-master reference. Candidate for maintainer audit — sibling of `Sp_Calc_tice` against the notice variant; both look like an unwired equipment-asset audit pair. diff --git a/en/docs/auto-catalog/procedures/Sp_Cashier_BankJournal.md b/en/docs/auto-catalog/procedures/Sp_Cashier_BankJournal.md index c276130..2da0c74 100644 --- a/en/docs/auto-catalog/procedures/Sp_Cashier_BankJournal.md +++ b/en/docs/auto-catalog/procedures/Sp_Cashier_BankJournal.md @@ -34,4 +34,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 出纳 → 银行日记账 — paged bank-journal report for one settlement account. Computes opening balance from `CahCashierInit` plus all prior `CahWasteBook` rows up to the period start, then lists every `CahWasteBook` entry in the requested window with running balance, joining receipt/payment masters so each row carries customer/supplier name and expense item. + +**What it does:** Reads the cashier cutoff `tCashierDate` from `SysAccountPeriod`, sums prior in/out money from `CahWasteBook` to seed `p_dInitMoney`, then opens a cursor over `CahWasteBook` for the chosen `sBankInfo` and inserts each line into temporary `Cash` with running balance. Enriches `sMemo` by joining `CahReceiptMaster`+`elecustomer` (inbound) and `CahPaymentMaster`+`elesupply` (outbound). Trims pre-period rows, inserts a "上期结余" carry-row, fills `sBankName` from `sisbank`, and finally builds dynamic SQL routed through `Sp_Outstanding_Query`/`Sp_Do_UpdateByPageSizeBefore` for pagination/total-count. + +**Invocation:** Bound as the data-source of the 银行日记账 form (sId `15782950790001381104094341598500`) via `gdsconfigformmaster.sSqlStr`. Loaded when the user opens 出纳 → 银行日记账; the form-binding dispatcher fetches the proc name from the form-master row. xly-src ships an `optimize/Sp_Cashier_BankJournal.sql` patch alongside the base `30100101/` script — verify which is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Cashier_CashJournal.md b/en/docs/auto-catalog/procedures/Sp_Cashier_CashJournal.md index ce224de..9f90175 100644 --- a/en/docs/auto-catalog/procedures/Sp_Cashier_CashJournal.md +++ b/en/docs/auto-catalog/procedures/Sp_Cashier_CashJournal.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 出纳 → 现金日记账 — paged cash-journal report for the dedicated `cash` settlement bucket. Cash-side counterpart of `Sp_Cashier_BankJournal`: same shape, but `sSettlementId='cash'` is hard-coded. + +**What it does:** Reads the cashier cutoff `tCashierDate` from `SysAccountPeriod` and the initial cash balance from `CahCashierInit` (`sSettlementId='cash'`). Seeds `p_dInitMoney` by summing prior `CahWasteBook.dInMoney - dOutMoney` up to the period start, inserts a "期初余额" row into temp `Cash`, then cursors `CahWasteBook` rows in the window and appends each with running balance. Enriches `sMemo` from `CahReceiptMaster`+`elecustomer` (receipts) and `CahPaymentMaster`+`elesupply` (payments, plus `sExpenseItems`). Drops pre-period rows except the carry, then re-uses `Sp_Outstanding_Query` for pagination/total-count. + +**Invocation:** Bound as the data-source of the 现金日记账 form (sId `15782952160006452847376994410000`) via `gdsconfigformmaster.sSqlStr`. Loaded when the user opens 出纳 → 现金日记账. xly-src ships an `optimize/Sp_Cashier_CashJournal.sql` patch on top of the base `30100101/` script — verify which is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Cashier_GetCostMaterialsPrice.md b/en/docs/auto-catalog/procedures/Sp_Cashier_GetCostMaterialsPrice.md index f68bd53..1b431ba 100644 --- a/en/docs/auto-catalog/procedures/Sp_Cashier_GetCostMaterialsPrice.md +++ b/en/docs/auto-catalog/procedures/Sp_Cashier_GetCostMaterialsPrice.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 / 库存 — material cost-price resolver. Returns the unit cost for a given material (and optional style / define-no / warehouse-location) following whichever costing model the tenant has selected in `SysSystemSettings.CbxMaterialsCostMode`. + +**What it does:** Reads the `CbxMaterialsCostMode` setting (0/1/2 = `EleMaterials.dPurchasePrice` / `dRecentPurchasePrice` / `dPurchasePrice`; 3 = weighted-average from `elematerialsstock.dMaterialsMoney / dMaterialsQty` keyed by style+defineNo and optionally warehouse-location; 4 = recent purchase). For modes 3/4 it honours `CkxMaterialsTax` — if tax is excluded, divides the purchase price by 1.16. Falls back through dRecentPurchasePrice → dPurchasePrice when the chosen channel yields 0. Output `dPrice` is the resolved cost. + +**Invocation:** Inlined from sibling pricers — `Sp_Cashier_GetMaterialsPrice` calls it when `CbxOfferMaterials='recentcost'`; the function wrapper family (`Fun_Cashier_GetMaterialsPrice*`) covers the same path for scalar contexts. No direct form/Java caller — only reached transitively through those wrappers used by quotation/work-order/gross-profit calculators. diff --git a/en/docs/auto-catalog/procedures/Sp_Cashier_GetMaterialsPrice.md b/en/docs/auto-catalog/procedures/Sp_Cashier_GetMaterialsPrice.md index 719c072..ba564e9 100644 --- a/en/docs/auto-catalog/procedures/Sp_Cashier_GetMaterialsPrice.md +++ b/en/docs/auto-catalog/procedures/Sp_Cashier_GetMaterialsPrice.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购 / 财务 — material offer-price resolver. Returns the per-unit price the system should suggest for a given material when building a purchase/quotation row, branching on whether a supplier is specified and on the tenant's `CbxOfferMaterials` setting. + +**What it does:** If `sSupplyGuid` is supplied, walks `elematerialssupply` (checked rows only) in decreasing specificity — (supply + material + style) → (supply + material) → (material + style) → material — taking `dQuantityPrice` from the most recent match, then falls back to `EleMaterials.dRecentPurchasePrice` and finally `dPurchasePrice`. Without a supplier it reads `SysSystemSettings.CbxOfferMaterials` (`plannedpurchase` / `recentpurchase` / `designatedsales` / `recentcost`) and pulls the matching column from `EleMaterials`; the `recentcost` branch delegates to `Sp_Cashier_GetCostMaterialsPrice`. Always returns a non-null `dPrice` via `IfNull`. + +**Invocation:** Status: appears orphaned at the proc level — no form-master, gdsmodule hook, other-routine caller, or xly-src caller besides the install scripts (`script/标版/30100101/`) and a commented-out reference in `Sp_Manufacture_sWodPurchareMaterials.sql`. Live callers go through the scalar wrapper `Fun_Cashier_GetMaterialsPrice` (and its `_new`/`_Quo` variants), which quotation/work-order/gross-profit calculators invoke inline. Candidate for maintainer audit — likely superseded by the function family. diff --git a/en/docs/auto-catalog/procedures/Sp_Cashier_GetProductPrice.md b/en/docs/auto-catalog/procedures/Sp_Cashier_GetProductPrice.md index 21fdef8..908738e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Cashier_GetProductPrice.md +++ b/en/docs/auto-catalog/procedures/Sp_Cashier_GetProductPrice.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售 / 报价 — product offer-price resolver (sales side). Was intended to return a per-unit selling price for a given product and customer by walking `eleproductcustomer` for the customer-specific quotation/list price, then falling back through `Viw_SalSalesChecking` / `Viw_SalDeliverGoods` / `Viw_SalSalesOrder` historical prices. + +**What it does:** Currently a stub — the entire resolution body is commented out. It sets `dPrice='0'` and immediately returns 0. The dead code (preserved as a comment block) was the planned customer→quotation→list-price→sales-history cascade described above. + +**Invocation:** Status: appears orphaned. No form-master, gdsmodule hook, other-routine caller, or xly-src caller — only the install script `script/标版/30100101/Sp_Cashier_GetProductPrice.sql`. The active product-price path is the `Fun_Sis_*` / `Fun_Order_*` family invoked from quotation/sales-order calculators. Candidate for maintainer audit — either reinstate the body or drop the proc. diff --git a/en/docs/auto-catalog/procedures/Sp_Cashier_OrderMoneyWarning.md b/en/docs/auto-catalog/procedures/Sp_Cashier_OrderMoneyWarning.md index 6ae6b72..0e2f083 100644 --- a/en/docs/auto-catalog/procedures/Sp_Cashier_OrderMoneyWarning.md +++ b/en/docs/auto-catalog/procedures/Sp_Cashier_OrderMoneyWarning.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 应收账款 → 订金->收款 — outstanding-prepayment warning list. Lists sales orders (or work orders) whose 预收订金 has not yet been fully received, so cashiers can chase the customer or know that an unfulfilled prepayment is still pending. + +**What it does:** Reads `SysAccountPeriod.tARDate` as the AR cutoff and `SysSystemSettings.CbxAdvanceType` to pick the source — `salesorder` reads checked `SalSalesOrderMaster` rows where `dAdvanceMoney - dRealAdvanceMoney > 0` and `bAdvanceComplete = iState`; `workorder` reads `Viw_MftWorkOrder` joined to `cahreceiptmaster` (excluding rows already receipted) with the analogous `bSlaveAdvanceComplete` flag. Stages results in `p_tmp_OrderMoneyWarning`, then enriches customer/salesman/payment labels from `elecustomer`/`sissalesman`/`sispayment`, computes a credit-limit indicator and `tLimitDate = Fun_GetLimitDate(...)`, and finally pages via `Sp_Outstanding_Query`. + +**Invocation:** Bound as the data-source of the 订金->收款 form (sId `192116810113315273126649110`, 财务管理 → 应收账款) and the 选择预收订金 picker (sId `192116810113315312149519830`) via `gdsconfigformmaster.sSqlStr`. Output column-metadata is computed by `Fun_getInitColumnByProName` (which special-cases this proc name). diff --git a/en/docs/auto-catalog/procedures/Sp_Cashier_SumJournal.md b/en/docs/auto-catalog/procedures/Sp_Cashier_SumJournal.md index 24dd916..2506c2f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Cashier_SumJournal.md +++ b/en/docs/auto-catalog/procedures/Sp_Cashier_SumJournal.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 出纳 → 日记账查询 — one-row-per-account journal summary across every bank settlement plus the special `cash` bucket. Gives cashiers a single-screen view of opening balance, period in/out, and closing balance for the chosen date window. + +**What it does:** Reads `SysAccountPeriod.tCashierDate` as the cashier cutoff (leaves the result empty if unset). Seeds a temp `Cash` table with one row per non-invalid `sisbank` entry (linked to form `15782950790001381104094341598500` 银行日记账) plus the synthetic `cash` row (linked to form `15782952160006452847376994410000` 现金日记账). Joins `CahWasteBook` grouped by `IF(sSettlementId='cash','cash',sBankId)` to fill `dInMoney`/`dOutMoney` for the window, layers in `CahCashierInit.dMoney` as opening balance, then adds the prior-period in/out delta. Renames the cash row label to "现金" and computes `dBalanceMoney = dInitMoney + dInMoney - dOutMoney`. Pages via `Sp_Do_UpdateByPageSizeBefore` and selects. + +**Invocation:** Bound as the data-source of the 日记账查询 form (sId `19211681019715708481355840`, 财务管理 → 出纳) via `gdsconfigformmaster.sSqlStr`. Also re-used by `Sp_Task_TodayMoneySmallai` for the AI assistant's daily cash-position briefing. diff --git a/en/docs/auto-catalog/procedures/Sp_Cashier_SumJournalTodayMoney.md b/en/docs/auto-catalog/procedures/Sp_Cashier_SumJournalTodayMoney.md index 124fb6c..74eb7ff 100644 --- a/en/docs/auto-catalog/procedures/Sp_Cashier_SumJournalTodayMoney.md +++ b/en/docs/auto-catalog/procedures/Sp_Cashier_SumJournalTodayMoney.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 出纳 — today-money variant of `Sp_Cashier_SumJournal`. Builds the same per-account opening / in / out / closing summary across `sisbank` plus the synthetic `cash` row, intended for the AI assistant's "today's cash position" briefing. + +**What it does:** Mirrors `Sp_Cashier_SumJournal` line-for-line through the join phase: reads `SysAccountPeriod.tCashierDate` cutoff, seeds temp `Cash` with one row per active `sisbank` + a `'cash'` row, joins `CahWasteBook` for in/out totals in the window, applies `CahCashierInit.dMoney` opening balances, layers in pre-period delta, relabels cash → 现金, and computes `dBalanceMoney`. Difference from `Sp_Cashier_SumJournal`: this variant has no final `SELECT` / pagination call — the caller is expected to consume the temporary `Cash` table directly within the same session. + +**Invocation:** Called by `Sp_Task_TodayMoneySmallai` (xiaoyang.ai daily cashier-briefing task). Status: appears partially orphaned — no form-master, gdsmodule hook, or Java caller other than the install script and `Sp_Task_TodayMoneySmallai`. The missing terminal `SELECT` (compared to `Sp_Cashier_SumJournal`) suggests this is a templated helper consumed only by the task proc; flag if you find a UI form bound to it. diff --git a/en/docs/auto-catalog/procedures/Sp_Change_WorkOrderStatus.md b/en/docs/auto-catalog/procedures/Sp_Change_WorkOrderStatus.md index 7421a7e..c5d4914 100644 --- a/en/docs/auto-catalog/procedures/Sp_Change_WorkOrderStatus.md +++ b/en/docs/auto-catalog/procedures/Sp_Change_WorkOrderStatus.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 制造管理 / 工单 — completion-status re-evaluator for a comma-separated list of work-order ids. Triggered after produce/outsource events to decide whether the work-order is now fully completed and stamp `bBillComplete`, `tBillCompleteDate`, and an audit trail in `sCompletePerson`. + +**What it does:** Splits `sWorkOrderGuids` on commas; for each id loads slave rows from `viw_mftworkorder` into temp `workorderTmp`. When the master has `bBillOutside=1` it aggregates `opsoutsideprocessslave.dInStoreAuxiliaryQty`/`dMaterialsQty` (checked, non-invalid) into `dOutsideInStoreQty`, then counts slaves still short of `dProductQty`; if zero remain, sets the master complete. Otherwise (in-house path) compares `dProductQty` vs `dProductInStoreQty` per slave and applies the same complete-flag flip. The `sCompletePerson` column gets a `----:成品入库/整单发外入库<0|1>` trail concatenated for each invocation, building an in-place audit log. + +**Invocation:** Called by `Sp_Calc_sPpr` (产量上报 form, sId `19211681019715476042694840`, the production-report audit/un-audit handler) and the equivalent mobile form 内部报工 (sId `101251240115015916850901130`). Whenever a production report or outsource-return is audited, the upstream proc forwards the affected work-order ids here to refresh completion state. xly-src ships `script/标版/30100101/Sp_Change_WorkOrderStatus.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_CheckChild_sPdt.md b/en/docs/auto-catalog/procedures/Sp_CheckChild_sPdt.md index bfd8bb1..fac5870 100644 --- a/en/docs/auto-catalog/procedures/Sp_CheckChild_sPdt.md +++ b/en/docs/auto-catalog/procedures/Sp_CheckChild_sPdt.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成品检验 audit-time child-product completeness check, called from `Sp_Calc_sPdt`. Composite products (multi-component 销售订单 lines) need every child component shipped before the parent can be audited: this helper looks up the child rows in `salsalesorderslave` (where `sFatherSlaveId` links a 子产品 to its parent line) and ensures each child's `dOutProductRejQty` already covers `dProductQty * dCombineCoefficient`. If any child is short, the audit aborts with `sCode=-8` and a per-product breakdown. + +**What it does:** Resolves the `qlyproducttestmaster` row by `sGuid`, joins `mftworkorderslave` (filtered to `bMain=1`) to discover all order-slave references on the QC bill, and builds a temp table summing `IF(dArrProductQty>0, dArrProductQty, dProductQty)` per `sOrderSlaveId`. Joins back to `salsalesorderslave` + `eleproduct` to find any child row whose `dOutProductRejQty < B.dProductQty * A.dCombineCoefficient`; concatenates `"子产品:出库不足,应出库 X 已出库 Y"` lines into `p_sMsg`. Sets `sCode=-8`, `sReturn=p_sMsg`, and `LEAVE TOP` if any short row is found. + +**Invocation:** Called by `Sp_Calc_sPdt` (成品检验审核) — the standard `Sp_Calc_s` audit dispatcher for 成品检验 — as part of its 审核 (`iFlag=1`) pre-flight, after the bill's own `bCheck` guard and before it commits the audit flags. No direct UI binding. diff --git a/en/docs/auto-catalog/procedures/Sp_CheckChild_sPst.md b/en/docs/auto-catalog/procedures/Sp_CheckChild_sPst.md index 4d30b8a..eda85dd 100644 --- a/en/docs/auto-catalog/procedures/Sp_CheckChild_sPst.md +++ b/en/docs/auto-catalog/procedures/Sp_CheckChild_sPst.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成品入库 save-time child-product completeness check, called from `Sp_Check_sPst`. Mirror of `Sp_CheckChild_sPdt` for the inbound (rather than QC) side: when a composite product is being booked into stock, every child component must have been delivered before the parent's 入库 can proceed. The proc looks up the child rows in `salsalesorderslave` (via `sFatherSlaveId`) and verifies each child's `dOutProductRejQty` already covers `dProductQty * dCombineCoefficient`. + +**What it does:** Reads `pitproductinstoreslave` rows for the master `sParentId=sGuid`, joins `mftworkorderslave` (filtered to `bMain=1`) to discover the order-slave references, and builds a temp table summing `dProductQty` per `sOrderSlaveId`. Joins back to `salsalesorderslave` + `eleproduct` to find any child row whose `dOutProductRejQty < B.dProductQty * A.dCombineCoefficient`; concatenates `"子产品:出库不足,应出库 X 已出库 Y"` lines into `p_sMsg`. Sets `sCode=-8`, `sReturn=p_sMsg`, and `LEAVE TOP` if any short row is found. + +**Invocation:** Called by `Sp_Check_sPst` (成品入库单据保存之前数据校验) during the `Sp_Check_sPst` post-save flow, after the QC-qty cap check and before the 余数仓库 overflow logic. No direct UI binding. diff --git a/en/docs/auto-catalog/procedures/Sp_CheckExceedReport.md b/en/docs/auto-catalog/procedures/Sp_CheckExceedReport.md index 872d162..df10575 100644 --- a/en/docs/auto-catalog/procedures/Sp_CheckExceedReport.md +++ b/en/docs/auto-catalog/procedures/Sp_CheckExceedReport.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产报工 (production report) per-process over-quantity gate, called from `Sp_Calc_sPpr`. For each reported process whose `eleProcess.sReportType` is `2` (按实际投入数) it enforces that you cannot report more on a downstream process than what was reported on the prior process; `sReportType` of `3` (按计划投入数) and `4` (按正数) carry their own caps that this proc evaluates the same way. The setting `CkxProductionReport` in `SysSystemSettings` (`productionplan` or `workorder`) decides whether the prior-process anchor is the production plan slave or the work-order process slave. + +**What it does:** Opens a cursor over `viw_mftproductionreport` rows for the current bill (`sId=sGuid`) joined to `eleProcess` filtered to `sReportType <> '1'`. For each row, calls `Sp_SortReportProcess` to refresh `mftworkorderprocess.iGroupOrder`, then looks up the current process's `iGroupOrder` (from `mftproductionplanslave` or `mftworkorderprocess` depending on the system setting), the minimum `iGroupOrder` on the work order, and the prior process's `dProductionReportQty`/`sProcessName`. Compares the cumulative `dReportQty` against the prior anchor; when over, sets `sCode` to a negative status, builds `sReturn` with `已报工, 本工序累计已超出` style messages, and exits via the cursor's NOT FOUND handler. + +**Invocation:** Called by `Sp_Calc_sPpr` (生产报工审核, the `Sp_Calc_s` audit dispatcher for 生产报工) during the audit-time validation pass. Not bound to any UI module directly. diff --git a/en/docs/auto-catalog/procedures/Sp_CheckSalSendCar_RepalceField.md b/en/docs/auto-catalog/procedures/Sp_CheckSalSendCar_RepalceField.md index b5253ec..ca16eed 100644 --- a/en/docs/auto-catalog/procedures/Sp_CheckSalSendCar_RepalceField.md +++ b/en/docs/auto-catalog/procedures/Sp_CheckSalSendCar_RepalceField.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 派车单 (vehicle-dispatch bill) post-save freight-fee back-writer for `salsendcarmaster`/`salsendcarslave`. After the 派车单 is saved, this proc calls the formula engine (`Sp_System_ReplaceField_New`) with a 运费公式 ID, the carrier/customer/product context, and the dispatcher's 主表/从表 row IDs, then writes the resulting 运费 back to `salsendcarmaster.dProductMoney`. + +**What it does:** Counts `salsendcarmaster` rows for `sGuid`; if found, opens a block where it builds the formula's argument string `sAllGuids = sId,sSlaveId,sCustomerId,sProductId` by joining `salsendcarslave` to `salsendcarmaster`, declares the table list `'SalSendCarMaster,SalSendCarSlave,EleCustomer,EleProduct'` and type list `'billMaster,billSlave,baseCustomer,baseProduct'`. Sets `p_sCarFormulaId=''` (note: hard-coded blank in the snapshot — the formula ID must be supplied by configuration before this proc is useful) and `p_dProductMoney=0`, then calls `Sp_System_ReplaceField_New` to evaluate the formula. Updates `salsendcarmaster.dProductMoney` with the returned `p_dProductMoney` for `sId=sGuid`. A larger cursor-driven per-slave variant is fully commented out — only the master-level single-row branch is live. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName`/`sSaveProNameBefore`/`sProcName` hook, no `gdsconfigformmaster` binding, no other-routine caller, no xly-src reference. The proc's COMMENT (`'派车单保存后调用计算回写单据金额'`) and signature mirror the 派车 freight-calc hook pattern, so it is likely scaffolded for the 派车单 module but the configured 运费公式 ID is empty in the snapshot — the proc is effectively dormant until both the formula and the dispatch wiring are filled in. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_QlyMaterialRule.md b/en/docs/auto-catalog/procedures/Sp_Check_QlyMaterialRule.md index ca4de09..9eddba1 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_QlyMaterialRule.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_QlyMaterialRule.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 品质管理 → 进料检验规则单据 (`gdsmodule.sId='12012615914116374916774630'`) — post-save validator that prevents the same 物料分类 from appearing on two simultaneously-active 进料检验标准 (`EleTestStandard`) records. Runs after the user saves a 进料检验规则 to guarantee a single rule wins per material category. + +**What it does:** Sums `eleteststandardobject.sTestObjectId` group counts across all `EleTestStandard` rows where `sFormId='12012615914116374916774630'` for the tenant; if any `sTestObjectId` appears more than once and is also on the just-saved standard (`sParentId=sGuid`), joins `sismaterialsclassify` to render the offending names into `p_sNames` and aborts with `sCode=-8, sReturn=' 重复,不能存在于不同的标准之中'`. On the happy path leaves `sReturn='保存成功!'`. + +**Invocation:** Status: no caller found. No `gdsmodule` hook references it (`sSaveProName`/`sSaveProNameBefore` are blank on the 进料检验规则单据 module), no other routine references it, and `xly-src` has no match. Likely registered for a removed module variant or wired by metadata not captured in this database — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_SaveOeeReport.md b/en/docs/auto-catalog/procedures/Sp_Check_SaveOeeReport.md index feea15d..fe1e16b 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_SaveOeeReport.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_SaveOeeReport.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → OEE / 产量上报 — post-save validator and OEE-metric back-fill for `mftproductionreportmaster/slave`. Guards against over-reporting (cumulative report qty per work-order line exceeds the planned `dProcessQty`) and re-derives adjust-time / produce-time / idle-time / employee-hour columns from `plc_machinedata` so the report row carries the OEE inputs the dashboards downstream expect. + +**What it does:** With `iFlag=0` (initial save) builds a temp `p_Root_MftProductionReportSlave` keyed by `sSrcSlaveId`, sums prior reports against `mftproductionplanslave.dProcessQty`, and aborts the save when any process is over-reported. Then cursors the just-saved slave rows joined to `viw_mftproductionreport`, pulls last-report timestamps and `plc_machinedata` samples per `sMachineId/sSrcSlaveId` to compute `dAdjustableQty`, `dAdjustableHour`, `dHour`, `dOtherHour`, `dAllHour`, `dEmpHour`, `tStartDate/tEndDate`, and finally writes them back to `mftproductionreportslave` so OEE = (生产时间 / 全时间) etc. can be computed by the OEE dashboards. + +**Invocation:** Called from `Sp_Calc_sPpr` (the 产量上报 audit handler), not bound as a gdsmodule hook directly. xly-src ships `script/标版/30100101/Sp_Check_SaveOeeReport.sql` as the install body. Sibling `Sp_Check_SaveOeeReportCheck` is the audit-time variant gated on `sId=sGuid` rather than the all-tenant pass; `Sp_Check_SaveOeeReportAAA` is a developer scratch copy (see its own page). diff --git a/en/docs/auto-catalog/procedures/Sp_Check_SaveOeeReportAAA.md b/en/docs/auto-catalog/procedures/Sp_Check_SaveOeeReportAAA.md index 06b76c9..3d314ca 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_SaveOeeReportAAA.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_SaveOeeReportAAA.md @@ -15,4 +15,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Developer scratch copy of `Sp_Check_SaveOeeReport`. The body cursors `viw_mftproductionreport` filtered by the hard-coded test brand `sBrandsId='1111111111'` (the dev sandbox tenant) and the `AAA` suffix marks it as a throwaway. Per wiki convention, scratch/backup objects are not narrated for business behaviour. + +**What it does:** Same OEE back-fill logic as [`Sp_Check_SaveOeeReport`](Sp_Check_SaveOeeReport.md) — pulls `plc_machinedata` samples and writes `dAdjustableQty`/`dHour`/`dOtherHour`/`dAllHour`/`dEmpHour` onto `mftproductionreportslave` — but takes no parameters and runs against the test tenant only. + +**Invocation:** Status: appears orphaned. No `gdsmodule` binding, no other routine references the name, no `xly-src` hit. Not expected to be called from production; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_SaveOeeReportCheck.md b/en/docs/auto-catalog/procedures/Sp_Check_SaveOeeReportCheck.md index 5d0a24e..ca4cf63 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_SaveOeeReportCheck.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_SaveOeeReportCheck.md @@ -19,4 +19,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → OEE 产量上报审核 — audit-time OEE back-fill counterpart to `Sp_Check_SaveOeeReport`. Re-derives the same OEE-input columns on `mftproductionreportslave` but scoped to one document (`sId=sGuid`) and tenant pair, so the values are fresh at 审核 time. + +**What it does:** Cursors `viw_mftproductionreport` filtered by `sId=sGuid, sBrandsId=sBrId, sSubsidiaryId=sSuId`, then per slave pulls `plc_machinedata` between the previous report's `tCreateDate` and now, computes `dAdjustableQty/dAdjustableHour/dHour/tStartDate/tEndDate/dOtherHour/dAllHour/dEmpHour`, and writes them back to `mftproductionreportslave`. Also propagates the standard `dStdHour/dStdAdjustHour` from `mftproductionplanslave`. + +**Invocation:** Called from `Sp_Calc_sPpr` (产量上报 audit/un-audit handler) during the audit branch — see [`Sp_Calc_sPpr`](Sp_Calc_sPpr.md). Not bound as a gdsmodule hook directly. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_dOraQtyTs.md b/en/docs/auto-catalog/procedures/Sp_Check_dOraQtyTs.md index 69f2961..23fcb12 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_dOraQtyTs.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_dOraQtyTs.md @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Reusable generic check 校验是否超过源单数量 — prevents a downstream document from issuing more quantity than its upstream source authorizes, with an extra layer of specification-attribute (`Ts`) grouping for fabric/colour-spec scenarios. + +**What it does:** Given the slave table, its quantity columns, the source table/column, and an optional `Ts` specification table/column, builds temp tables `p_sSrcSlaveId` and `p_sSlaveId_qty` via dynamic SQL, sums the current document's quantities per source-slave, joins back to source quantities and the spec table, and returns `sCode = -1` with a `已开数量 / 源单据数量` diff message (formatted via `Sp_Sis_GetConst('sDoraQtyUpQty', …)`) when any current quantity exceeds the source. The non-`Ts` sibling is `Sp_Check_dOraQty`. + +**Invocation:** Called from save-quantity checks in upstream/downstream document procedures, including `Sp_Check_sRgd` (新增销售退货 / 销售送货流程) — the `Sp_Check_*` family is invoked by `Sp_Calc_*` save procedures via the dispatcher pattern. Also called by `Sp_Check_sDgda`. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_eleteststandardFeed.md b/en/docs/auto-catalog/procedures/Sp_Check_eleteststandardFeed.md index f8d8a51..b71764c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_eleteststandardFeed.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_eleteststandardFeed.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 进料检验规则单据 → 质检规则设定 → 质量管理 — before saving an incoming-material inspection rule, prevent the same material from appearing in more than one active rule document so the inspection engine picks an unambiguous standard. + +**What it does:** Cursors `eleteststandardobject` rows under `sGuid` (the rule being saved), and for each `sTestObjectId` (material), counts other `eleteststandard` rows in form `12012615914116374916774630` (进料检验规则单据) carrying the same object. If any exist, sets `sReturn` to the localised `sStandardHaveMaterial` message plus the conflicting rule names and returns `sCode = -1`. Also rejects same-material duplicates within `sGuid` itself. + +**Invocation:** Save-time check on form 进料检验规则单据 — invoked via the `Sp_Check_*` dispatcher from the `Sp_Calc_*` save procedure for that form's `sCode`. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_eleteststandardFirst.md b/en/docs/auto-catalog/procedures/Sp_Check_eleteststandardFirst.md index bbfba96..8cc831b 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_eleteststandardFirst.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_eleteststandardFirst.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产首检规则单据 → 质检规则设定 → 质量管理 — before saving a production first-piece (首检) inspection rule, prevent the same process from being registered in more than one active rule so the first-piece engine picks an unambiguous standard. + +**What it does:** Cursors `eleteststandardobject` rows under `sGuid` (the rule being saved), and for each `sTestObjectId` (process), counts other `eleteststandard` rows in form `12012615914116370215408310` (生产首检规则单据) carrying the same object. If any exist, sets `sReturn` to the localised `sStandardHaveProcess` message plus the conflicting rule names and returns `sCode = -1`. Also rejects duplicate processes within `sGuid` itself. + +**Invocation:** Save-time check on form 生产首检规则单据 — invoked via the `Sp_Check_*` dispatcher from the `Sp_Calc_*` save procedure for that form's `sCode`. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_eleteststandardPatrol.md b/en/docs/auto-catalog/procedures/Sp_Check_eleteststandardPatrol.md index 09d5ca1..39a5457 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_eleteststandardPatrol.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_eleteststandardPatrol.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产巡检规则单据 → 质检规则设定 → 质量管理 — before saving a production patrol-inspection (巡检) rule, prevent the same process from being registered in more than one active rule so the patrol engine picks an unambiguous standard. + +**What it does:** Cursors `eleteststandardobject` rows under `sGuid` (the rule being saved), and for each `sTestObjectId` (process), counts other `eleteststandard` rows in form `12012615914116374914703890` (生产巡检规则单据) carrying the same object. If any exist, sets `sReturn` to the localised `sStandardHaveProcess` message plus the conflicting rule names and returns `sCode = -1`. Also rejects duplicate processes within `sGuid` itself. + +**Invocation:** Save-time check on form 生产巡检规则单据 — invoked via the `Sp_Check_*` dispatcher from the `Sp_Calc_*` save procedure for that form's `sCode`. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_eleteststandardProcess.md b/en/docs/auto-catalog/procedures/Sp_Check_eleteststandardProcess.md index 5461bba..902e687 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_eleteststandardProcess.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_eleteststandardProcess.md @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 外发工序检验规则 (form `1691254111217054007077750`, currently not present in this tenant's `gdsmodule`) under 质检规则设定 → 质量管理 — before saving an outsourced-process inspection rule, prevent the same process from being registered in more than one active rule. + +**What it does:** Cursors `eleteststandardobject` rows under `sGuid`, and for each `sTestObjectId` (process), counts other `eleteststandard` rows in form `1691254111217054007077750` carrying the same object. If any exist, returns `sCode = -1` with the localised `sStandardHaveProcess` message plus conflicting rule names. Also rejects duplicate processes within `sGuid` itself. + +**Invocation:** Save-time check for the 外发工序检验规则 form — invoked via the `Sp_Check_*` dispatcher from the form's `Sp_Calc_*` save procedure. + +The target form id (`1691254111217054007077750`) is not present in this tenant's `gdsmodule`/`gdsconfigformmaster`, so this routine may be dormant on the current deployment — likely a feature reserved for tenants that enable outsourced-process inspection. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_eleteststandardProduct.md b/en/docs/auto-catalog/procedures/Sp_Check_eleteststandardProduct.md index 603ceac..38f0200 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_eleteststandardProduct.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_eleteststandardProduct.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成品检验规则单据 → 质检规则设定 → 质量管理 — before saving a finished-goods inspection rule, prevent the same product from being registered in more than one active rule so the FQC engine picks an unambiguous standard. + +**What it does:** Cursors `eleteststandardobject` rows under `sGuid` (the rule being saved), and for each `sTestObjectId` (product), counts other `eleteststandard` rows in form `12012615914116374917672960` (成品检验规则单据) carrying the same object. If any exist, sets `sReturn` to the localised `sStandardHaveProduct` message plus the conflicting rule names and returns `sCode = -1`. Also rejects duplicate products within `sGuid` itself. + +**Invocation:** Save-time check on form 成品检验规则单据 — invoked via the `Sp_Check_*` dispatcher from the `Sp_Calc_*` save procedure for that form's `sCode`. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_mftProductionReportValue.md b/en/docs/auto-catalog/procedures/Sp_Check_mftProductionReportValue.md index f439ff2..a838715 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_mftProductionReportValue.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_mftProductionReportValue.md @@ -19,4 +19,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 产量上报 → 订单生产流程 (also 功能操作 → 内部报工 (mobile单据) on 移动端管理) — tenant-specific output-value (产值) calculator for a printing-press 产量上报 (production-quantity report) document. Computes a press's billable charge from reported quantity, side count (正/反), regular and spot colours, full-plate (专满版 / 两色座) flags, and per-machine pricing rules. + +**What it does:** Cursors slave rows of the report document; per row, looks up the press (1/3/8/9 号机) configuration, derives an effective colour count (specials × 1.5 or × 2 depending on press), counts presses (色令), looks up unit price and base/overage 开机费, and computes `dTotalColorMoney` and `dTotalMoney`, writing back to the slave rows. + +**Invocation:** Called from `Sp_Calc_sPpr` (the save procedure for 产量上报 / 内部报工 mobile) during checked-save. Tenant-specific: hard-coded press numbers and pricing semantics make this routine non-portable to other deployments. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_mftProductionReportValueTest.md b/en/docs/auto-catalog/procedures/Sp_Check_mftProductionReportValueTest.md index 3b65e1c..009e6e1 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_mftProductionReportValueTest.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_mftProductionReportValueTest.md @@ -19,4 +19,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Test/sandbox copy of `Sp_Check_mftProductionReportValue` — the production-output-value calculator for a printing-press 产量上报 document. Same business intent (compute billable 产值 from press number, colours, full-plate flags, 色令, 开机费) but kept as a developer scratch variant. + +**What it does:** Near-identical body to `Sp_Check_mftProductionReportValue`: cursors slave rows of the report, derives effective colour counts and prices per press, and recomputes `dTotalColorMoney` / `dTotalMoney` to write back. Differences are limited to minor reordering of variable declarations. + +**Invocation:** Status: appears orphaned. No caller found in any channel — `Sp_Calc_sPpr` calls the non-`Test` variant. No module hook, no form embed, no other-routine call, no xly-src reference. Candidate for maintainer audit / deletion once the production variant is confirmed stable. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sAcc.md b/en/docs/auto-catalog/procedures/Sp_Check_sAcc.md index 347d5d3..d9191e5 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sAcc.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sAcc.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 品质管理 → 质量事故报告 / 客户投诉单 / 设备异常单 — post-save validator on `mftqualityaccidentmaster`. Enforces the business rules around 不良品处理方式 (rework/scrap/return-to-外协): bad-product flag must pair with scrap qty, 外协商扣款 must pair with 部门, 退加工商 must select supplier, etc. Same proc serves three forms that share the underlying table. + +**What it does:** Branches on `sFormGuid` (`11811781131121915261093794470` = 新增质量事故报告; `101251240115016045682733390` = 设备异常单; `101251240115016180439686010` = 新增客户投诉单). For each, runs a battery of `SELECT COUNT(1) INTO p_iCount` consistency checks (bad-flag/reprint mismatch, missing scrap/rework qty, missing department on 外协商扣款, missing supplier on 退加工商) and aborts with the localised `Fun_Sis_GetConstNew` message (`sDealNeedScrap`, `sDealNeedScrapQty`, `sWxUpZeroNeedWxskk`, `sBlDealNeedWxs`, etc.). Also normalises cost-split fields against `mftqualityaccidentslave` totals before returning. + +**Invocation:** Bound to `gdsmodule.sSaveProName` (post-save) on `质量事故报告` (`101251240115015934849804300`), `设备异常单` (`101251240115016045682733390`), `01/01 新增质量事故报告` (`11811781131121915261093794470`), `01/02 新增客户投诉单` (`101251240115016180439686010`) — all four roll up under 品质管理. Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. Pre-save peer is `Sp_beforeSave_sAcc`; xly-src ships `script/标版/30100101/Sp_Check_sAcc.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sCio.md b/en/docs/auto-catalog/procedures/Sp_Check_sCio.md index 8c51cab..6988799 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sCio.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sCio.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售 → 客户信息 / 客户报备信息 — placeholder post-save hook on customer-audit forms (`sCio` = sales-customer-info). The body is a no-op stub that returns `sCode=1, sReturn=''`, leaving the validation contract in place for future rules without yet enforcing any. + +**What it does:** Initialises `sCode=1`, defaults `iFlag` to 0, clears `sReturn`, opens an empty `top:` block, and exits. No table touch, no validation. + +**Invocation:** Status: appears orphaned. The peer `Sp_Calc_sCio` is bound on `客户信息` (`192116810111915048607109671`) and `客户报备信息单据` (`101251240115015977193229000`) modules' `sProcName`, but `Sp_Check_sCio` itself is not wired as `sSaveProName`/`sSaveProNameBefore` on those modules. No other routine references it, no `xly-src` hit. Effectively a stub awaiting a rule — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sCmt.md b/en/docs/auto-catalog/procedures/Sp_Check_sCmt.md index 2315f14..34769c3 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sCmt.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sCmt.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 品质管理 → 材料检验 (`mitmaterialscheckmaster/slave`) — post-save validator and price/tax/qty back-calculator on the 材料检验单据 form family (incoming-material QC). Used by `材料检验单据` (`15827054010002527067474512475000`), `库存检验` (`101251240115016105078918480`), and `材料检验(mobile单据)` (`12012615914116373127639240`). + +**What it does:** Reads `NetMoney`/`NetPrice` precision from `SysSystemSettings`. Cursors every just-saved slave row, joins the upstream source (`purpurchasearriveslave` / `mitmaterialsstoreslave`), pulls `sComputeId`/`sReComputeId` for the line's compute formula, and re-derives `dMaterialsMoney/dMaterialsQty/dAuxiliaryQty/dMaterialsNoTaxMoney/dMaterialsTaxMoney` using `sistax.dRate` (forward or reverse calc depending on `bInverse`). Updates the rows so totals are consistent post-save; falls through with `sCode=1` on success. + +**Invocation:** Bound to `gdsmodule.sSaveProName` on `材料检验单据` (`15827054010002527067474512475000`), `库存检验` (`101251240115016105078918480`), and `材料检验(mobile单据)` (`12012615914116373127639240`) — all under 品质管理 → 材料检验. Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. Pre-save peer is `Sp_beforeSave_sCmt`. xly-src ships `script/标版/30100101/Sp_Check_sCmt.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sCut.md b/en/docs/auto-catalog/procedures/Sp_Check_sCut.md index 7237fd0..40f32c8 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sCut.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sCut.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 物料管理 → 物料转换单据 (`mitmaterialscutmaster/slave`) — post-save red-stroke (红冲) guard. Blocks a duplicate red-stroke save: if the document is a red-stroke (`sMinusSrcId` set) and the upstream source's slaves no longer net to zero after this attempt, the save is refused. + +**What it does:** Reads `sMinusSrcId` from `mitmaterialscutmaster` for `sId=sGuid`. If non-empty, joins the original document's `mitmaterialscutslave` against the sum of all already-issued red-stroke slaves (`SUM(dAuxiliaryQty) GROUP BY sMinusSrcSlaveId`); if any source line's `dAuxiliaryQty + counter-qty <> 0`, aborts with `sCode=-1` and the localised `sCcprkHaveRedData` ("已存在红冲数据,不允许重复提交") message from `Fun_Sis_GetConstNew`. No work on non-red-stroke documents. + +**Invocation:** Bound to `gdsmodule.sSaveProName` on `物料转换单据` (`101251168116315839165634020`) under 物料管理 → 仓储管理. Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. xly-src ships `script/标版/30100101/Sp_Check_sCut.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sDgd.md b/en/docs/auto-catalog/procedures/Sp_Check_sDgd.md index 8f463ee..0e1a3d9 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sDgd.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sDgd.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售送货流程 → 送货单 (`saldelivergoodsmaster/slave`) — post-save validator and money/qty back-calculator on the 送货单 family. Also serves 扫码送货(单据) (`101251240115015959853077870`), where lines are scanned barcodes. + +**What it does:** First runs the standard 红冲 guard against `saldelivergoodsmaster.sMinusSrcId` (refuses a duplicate red-stroke). Reads `NetMoney`/`NetPrice` from `SysSystemSettings`. Then opens a cursor over `saldelivergoodsslave`, joins `salsalesorderslave` (the originating order), re-derives `dProductMoney/dProductPrice/dProductNoTaxMoney/dProductTaxMoney/dProductForeignMoney` using `sistax.dRate` and the order's `dCurrencyRate` (forward/reverse calc by `bInverse`), and writes the recomputed values back. Splits the auxiliary money fields (`dProofingMoney`, `dPlateMoney`, `dKnifeMouldMoney`) per line. Aborts with the localised `sCcprkHaveRedData` message on duplicate red-stroke. + +**Invocation:** Bound to `gdsmodule.sSaveProName` on `送货单单据` (`11811781131121915179924491520`), `扫码送货(单据)` (`101251240115015959853077870`), and `材料送货单` (`101251240115016140459724020`) — all under 销售管理 → 销售送货流程. Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. Pre-save peer is `Sp_beforeSave_sDgd`; audit handler is `Sp_Calc_sDgd`. xly-src ships `script/标版/30100101/Sp_Check_sDgd.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sDgd_bak.md b/en/docs/auto-catalog/procedures/Sp_Check_sDgd_bak.md index e4ec37f..ee5e0b8 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sDgd_bak.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sDgd_bak.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_Check_sDgd` (`_bak` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_Check_sDgd` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sDgda.md b/en/docs/auto-catalog/procedures/Sp_Check_sDgda.md index ff54e18..b059ebb 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sDgda.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sDgda.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 材料送货单 (`saldelivergoodsmaster`, material side of 送货单) — post-save validator covering employee binding, 库存条码 mapping, and source-qty consistency against the upstream 送货通知 (`saldelivernotifyslave`). Heavier validator than `Sp_Check_sDgd` because it also runs barcode-warehouse propagation. + +**What it does:** Reads `sMinusSrcId/sMinusType/sWareHouseId/sInWareHouseId/sBillNo` from `SalDeliverGoodsmaster`. Propagates `sWareHouseId/sInWareHouseId` to every `saldelivergoodsslave` and to the bound `mitmaterialsstorebarcode` rows, stamping `sMasterBillNo`. Joins `sftlogininfo`+`eleemployee` on `sUserName=sLoginId`; if no employee binding exists, aborts with `sDgdNotEmployee` ("当前操作人非员工,需要绑定员工关系,否则影响门卫放行"). Then calls `Sp_Check_dOraQtyTs` to verify slave `dProductQty` does not exceed the source `saldelivernotifyslave.dProductQty`, and runs further barcode-uniqueness checks on `mitmaterialsstorebarcode`. + +**Invocation:** Called from the PDA wrapper `Sp_Check_sDgda_phone` and (per the 送货单 family convention) the same gdsmodule path used for the material 送货单 variant. xly-src has no SQL install script for this proc — it lives only in the live database. Pre-save peer is presumed to be the generic `Sp_beforeSave_sDgd` family. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sDgda_phone.md b/en/docs/auto-catalog/procedures/Sp_Check_sDgda_phone.md index 4ecb50a..6f4f723 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sDgda_phone.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sDgda_phone.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → PDA 扫码送货 — PDA-side adapter that chains the after-save handler `Sp_afterSave_sDgda_phone` and then delegates to the desktop validator [`Sp_Check_sDgda`](Sp_Check_sDgda.md). Keeps the mobile and desktop save paths in lockstep on `saldelivergoodsmaster` (material-side delivery). + +**What it does:** Initialises `sCode=1`, `iFlag=0`, `sReturn=''`. If `sReturn` is already non-empty leaves with `sCode=-1`. Otherwise calls `Sp_afterSave_sDgda_phone(sGuid, sBrId, sSuId, sCode, sReturn)` for the PDA-specific post-save routine, then forwards all parameters to `Sp_Check_sDgda` to share its 红冲/库存/数量校验 logic. + +**Invocation:** Called from `Sp_Calc_sDgd` and the PDA delivery save path (no direct `gdsmodule` hook — wired by code rather than metadata; the procedure name appears in the desktop validator's source body as `CALL Sp_Check_sDgda`). xly-src has no SQL install script for this proc — it lives only in the live database. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sDgn.md b/en/docs/auto-catalog/procedures/Sp_Check_sDgn.md index 7564f9a..905b489 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sDgn.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sDgn.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售送货流程 → 送货通知单 (`saldelivernotifymaster/slave`) — post-save validator and money/qty back-calculator on the 送货通知单 form. Also serves 材料送货通知单单据 (`101251240115016140461755160`) which shares the same table. + +**What it does:** Initial guard: if any slave with `dProductQty>0 OR dGiveQty>0` has `bRemainderScrap=1`, aborts with `sCantChooseBfck` ("正数和备品数不为0时,不能勾选余数报废出库选项"). Reads `NetMoney/NetPrice` precision from `SysSystemSettings`. Cursors every just-saved `saldelivernotifyslave` row, joins `salsalesorderslave` (the originating sales-order line), and re-derives `dProductMoney/dProductPrice/dProductNoTaxMoney/dProductTaxMoney/dProductForeignMoney/dProductTaxForeignMoney/dNProductPrice/dProofingMoney/dPlateMoney/dKnifeMouldMoney` using the order's `dCurrencyRate` and `sistax.dRate` (forward/reverse calc by `bInverse`). + +**Invocation:** Bound to `gdsmodule.sSaveProName` on `送货通知单单据` (`15833158840002862255575040533000`) and `材料送货通知单单据` (`101251240115016140461755160`) — both under 销售管理 → 销售送货流程. Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. Pre-save peer is `Sp_beforeSave_sDgn`; audit handler is `Sp_Calc_sDgn`. xly-src ships `script/标版/30100101/Sp_Check_sDgn.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sFksq.md b/en/docs/auto-catalog/procedures/Sp_Check_sFksq.md index e7d9df7..2a7c9ba 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sFksq.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sFksq.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 付款申请单 (sFksq = 付款申请,on `expensereimbursementmaster`/`advanceCostCheckMaster`) — post-save validator that guards the link between a 付款申请 and the 预支单 it draws against, and back-fills the bank-account fields from the matching 费用细项 + 部门 line. + +**What it does:** Reads `sAdvanceOrderCodeId` from `expensereimbursementmaster` for `sId=sGuid`. Joins `advanceCostCheckMaster` + the saved 报销单 + grouped `advancecostcheckslave` (by `sExpenseDetailId/sParentId`) to check that the requested `dMaterialsMoney` does not exceed the 预支单's remaining 金额; if it does, aborts with `sPayUpPrePay` ("付款申请金额大于预支单金额,请重新填写付款申请单"). Then updates `expensereimbursementmaster.sAccountNo/sAccountId` from `descriptionoffeesslave` joined on `(sMExpenseDetailId, sMasterDepartId)` so the bank account reflects the chosen expense item / department. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName/sSaveProNameBefore` binding, no other routine references the name, no `xly-src` hit. The peer `Sp_Calc_sFksq` exists but is also not module-bound; both look like a half-wired feature for the 付款申请 form — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sFybx.md b/en/docs/auto-catalog/procedures/Sp_Check_sFybx.md index 5d4cc7d..5bdc900 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sFybx.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sFybx.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 费用报销单 (sFybx = 费用报销, on `expensereimbursementmaster`/`expensereimbursementslave`) — post-save validator that guards the linkage between a 费用报销 and its source 预支费用单, totals the slave money back onto the master, recomputes the remaining 预支单 balance, and back-fills bank-account fields. + +**What it does:** Reads `sAdvanceOrderCodeId` from `expensereimbursementmaster` for `sId=sGuid`. Rejects when the referenced `advanceCostCheckMaster.bCheck=0` (`sAdvanceExpenseNotReview` — "预支费用单未审核请审核后再报销"). Verifies that every 费用细项 (`sExpenseDetailId`) used on the 报销单 also exists on the 预支单's slave (`sExpenseDetailNotExist`). Aborts when the 报销单's per-细项 `dAccountMoney` total exceeds the 预支单's per-细项 `dMaterialsMoney` (`sReimbursementUpAdvance`). On success, sums slave `dMaterialsMoney` back onto the master, updates `dAdvanceBalanceMoney` (= 预支总额 - 已用 - 当前报销), and writes `sAccountNo/sAccountId` onto the slave by joining `descriptionoffeesslave` on `(sExpenseDetailId, sDepartId)`. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName/sSaveProNameBefore` binding, no other routine references the name, no `xly-src` hit. The peer `Sp_Calc_sFybx` exists but is also not module-bound; both look like a half-wired feature for the 费用报销 form — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sLok.md b/en/docs/auto-catalog/procedures/Sp_Check_sLok.md index fc6f4f2..2d2ef14 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sLok.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sLok.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 物流管理 → 物流对账单 (sLok = logistics-checking-order, on `opsoutsidecheckingmaster/slave`) — post-save validator and money/tax back-calculator for the 物流对账单 form. Sits between a logistics-supplier bill and the matched 物流单 records to reconcile cost. + +**What it does:** Reads `NetMoney`/`NetPrice` precision from `SysSystemSettings`. Recomputes `dMaterialsNoTaxMoney` and `dMaterialsTaxMoney` on every non-manual `opsoutsidecheckingslave` row from `dMaterialsMoney` and `sistax.dRate`. Then cursors the matched slave/source-slave pairs (`sSrcSlaveId`), pulls each material's `sComputeId/sReComputeId/dRate`, and re-derives `dMaterialsMoney/dMaterialsQty/dAuxiliaryQty/dMaterialsNoTaxMoney/dMaterialsTaxMoney` per line so the totals tie back to the original 物流单 entries. + +**Invocation:** Bound to `gdsmodule.sSaveProName` on `物流对账单单据` (`101251240115016270323854760`) under 销售管理 → 物流管理. Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. Pre-save peer is `Sp_beforeSave_sLok`; audit handler is `Sp_Calc_sLok`. xly-src ships `script/标版/30100101/Sp_Check_ssLok.sql` (note the double-s typo) as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sLos.md b/en/docs/auto-catalog/procedures/Sp_Check_sLos.md index 69a17f7..2706469 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sLos.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sLos.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 物流管理 → 物流单 (sLos = logistics-order, on `logisticsordermaster`/`logisticsorderslave`/`logisticsorderdetails`) — post-save validator and price-split back-calculator for the 物流单 form. Apportions one logistics-fee (`logisticsorderdetails.dProductMoney`) across the document's material lines (`logisticsorderslave`) proportionally to each line's source money. + +**What it does:** Refuses save when the document is a pre-audit (`bAheadComplete=1`) — `paramssLogisticPreReviewErro`. Enforces a single 税码 (`sTaxId`) and single 物流商 (`sSupplyId`) per 物流费用明细 (`sLogisticTaxNeedSame`, `sLogisticProviderNeedSame`). Verifies one `sSrcSlaveId` is not on multiple slaves. Reads `NetMoney/NetPrice` precision. Sums slave `dSrcMoney` and detail `dProductMoney`, then writes `dMaterialsMoney = ROUND(dSrcMoney/totalSrc * totalDetail, 2)` plus the derived `dMaterialsPrice/dMaterialsNoTaxPrice/dMaterialsNoTaxMoney/dMaterialsTaxMoney/dMaterialsForeignMoney/dMaterialsTaxForeignMoney/sTaxId` onto each slave so the freight cost is correctly distributed to each line for downstream cost analysis. + +**Invocation:** Bound to `gdsmodule.sSaveProName` on `物流单单据` (`101251240115016270322291050`) under 销售管理 → 物流管理. Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. Pre-save peer is `Sp_beforeSave_sLos`; audit handler is `Sp_Calc_sLos` (which also references `Sp_Check_sLosTest`, an earlier draft). xly-src ships `script/标版/30100101/Sp_Check_sLos.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sLosTest.md b/en/docs/auto-catalog/procedures/Sp_Check_sLosTest.md index 23d33e5..7a682a4 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sLosTest.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sLosTest.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Earlier draft of [`Sp_Check_sLos`](Sp_Check_sLos.md) — the freight-cost apportionment block from 物流单 post-save, kept around as a `Test` variant called by `Sp_Calc_sLos`. Same 物流单 form (`logisticsordermaster`); same back-calculation; trimmed signature (no tenant/login parameters). + +**What it does:** Updates `logisticsorderslave.dSrcMoney` from the joined source slave depending on `iSlaveLogType` (1/5 → `salsalesorderslave.dProductPrice * dAuxiliaryQty`; 2 → `purpurchaseorderslave.dMaterialsPrice * dAuxiliaryQty`; 3/4 → `opsoutsideprocessslave.dMaterialsPrice * dAuxiliaryQty`). Then sums slave `dSrcMoney` and detail `dProductMoney` and writes `dMaterialsMoney = ROUND(dSrcMoney/totalSrc * totalDetail, 2)` plus the derived no-tax/tax/foreign money fields onto every slave, joining `sistax` for `dRate`. Lacks the `bAheadComplete` / single-tax / single-supplier guards that `Sp_Check_sLos` later added. + +**Invocation:** Called from `Sp_Calc_sLos` (the 物流单 audit handler) via a `CALL Sp_Check_sLosTest` line. Not module-bound. The `Test` suffix and the missing guard rails mark it as an in-place test stub; production validation goes through `Sp_Check_sLos`. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sMad.md b/en/docs/auto-catalog/procedures/Sp_Check_sMad.md index d0f6efa..e2877b5 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sMad.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sMad.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 物料管理 → 仓储管理 → 材料调拨单据 (sMad = material-adjust, on `mitmaterialsadjustmaster/slave`) — post-save red-stroke (红冲) guard and after-save hook trigger. Same red-stroke pattern as `Sp_Check_sCut` but on the material-adjustment table family. + +**What it does:** Reads `sMinusSrcId` from `mitmaterialsadjustmaster` for `sId=sGuid`. If non-empty, joins the original document's `mitmaterialsadjustslave` against the sum of all red-stroke counter-slaves (`SUM(dAuxiliaryQty) GROUP BY sMinusSrcSlaveId`); if any source line's `dAuxiliaryQty + counter-qty <> 0`, aborts with `sCcprkHaveRedData` ("已存在红冲数据,不允许重复提交"). On success, calls `Sp_afterSave_sMad(sGuid, sBrId, sSuId, sCode, sReturn)` to run the after-save back-fill (cost/qty distribution). + +**Invocation:** Status: appears unbound at module level. The 材料调拨单据 module (`192116810113315227212629260`) has `sSaveProName=''` and only `sProcName=Sp_Calc_sMad`. No other routine references `Sp_Check_sMad`; xly-src ships only `script/标版/30100101/Sp_Check_sMad.sql` as the install body. Either bound by a customer override script not in the live `gdsmodule`, or expected to be invoked from `Sp_Calc_sMad` at audit time — verify with the maintainer. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sMcd.md b/en/docs/auto-catalog/procedures/Sp_Check_sMcd.md index be8489d..c0450d0 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sMcd.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sMcd.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 物料管理 → 仓储管理 → 材料盘点单据 (sMcd = material-count, on `mitmaterialscheckmaster/slave`) — post-save profit/loss calculator. After a 盘点 saves, computes per-line 盘盈/盘亏 quantity, auxiliary qty, unit price, and money fields from the count entry and the historical material price. + +**What it does:** For each `MitMaterialsCheckSlave` under `sParentId=sGuid` (tenant-scoped), sets `dProfitLossQty = dMaterialsQty - dOriginalQty`, `dProfitLossAuxiliaryQty = dAuxiliaryQty - dOriginalAuxiliaryQty`, then calls `Fun_Cashier_GetMaterialsPrice_new(sMaterialsId, '', sBrId, sSuId)` to populate `dProfitLossPrice` and `dMaterialsPrice`, and writes `dProfitLossMoney = ROUND(price * (dMaterialsQty - dOriginalQty), 2)`. Note: `sMaterialsId` is unqualified — it resolves to whichever sMaterialsId is in scope (likely a bug; intended as `M.sMaterialsId`). + +**Invocation:** Status: appears unbound at module level. The 材料盘点单据 module (`192116810113315228128521360`) has `sSaveProName=''` and only `sProcName=Sp_Calc_sMcd`. No other routine references `Sp_Check_sMcd`; no `xly-src` hit (no install script). Likely wired by a customer override or invoked from `Sp_Calc_sMcd` — verify with the maintainer. Flag: the unqualified `sMaterialsId` reference is a probable bug. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sMpa.md b/en/docs/auto-catalog/procedures/Sp_Check_sMpa.md index 794814f..6968a6c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sMpa.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sMpa.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产执行 → MES单据 → 领料申请单据 / 补料申请单据 / 补版申请单据 — post-save validator on `mitproductionapplymaster`. Same proc serves all three申请 variants (领料/补料/补版) because they share the same master/slave tables. + +**What it does:** Reads `NetMoney`/`NetPrice` precision from `SysSystemSettings`, then runs three gating checks: (1) every requested material must have `sWorkCenterId` matching `elematerialsworkcenter` for the requesting department, else aborts with `sMaterialNeedWorkCenter`; (2) materials currently mid-工艺变更 (open `mftprocesschangemaster` of sType=1 with changed `sMaterialsId`/`sMaterialsStyle`) are blocked with `sMaterialInChange`; (3) once both pass, dedupes slave rows by `(sMaterialsId, sMaterialsStyle, sParentId)` and branches on `sFormGuid` to apply form-specific rules per the embedded comment block. + +**Invocation:** Bound to `gdsmodule.sSaveProName` (post-save) on `补料申请单据` (`12012615914116395420093200`), `补版申请单据` (`12012615914116395420566910`) and `领料申请单据` (`101251240115016056026128440`), all under 生产执行 → MES单据. Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. xly-src ships `script/标版/30100101/Sp_Check_sMpa.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sMpt.md b/en/docs/auto-catalog/procedures/Sp_Check_sMpt.md index 527b6ea..74a30be 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sMpt.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sMpt.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Stub post-save validator nominally for 产品工艺卡 (per the procedure summary), delegating to `Sp_afterSave_sMpt`. Body initialises `sCode`/`iFlag`/`sReturn`, then immediately calls `Sp_afterSave_sMpt(sGuid, sBrId, sSuId, sCode, sReturn)` — no validation logic of its own. + +**What it does:** Forwards `(sGuid, sBrId, sSuId, sCode, sReturn)` to `Sp_afterSave_sMpt` inside the `top:` block; relies on `Sp_afterSave_sMpt` to populate `sReturn`/`sCode` for the caller. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName`/`sSaveProNameBefore`/`sProcName`/`sDeleteProName` row references it; no form-master `sSqlStr` ref; no other DB routine calls it; xly-src grep finds only `script/标版/30100101/Sp_Check_sMpt.sql` (the install body). The matching `Sp_afterSave_sMpt` exists but this wrapper has no live caller — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sOdt.md b/en/docs/auto-catalog/procedures/Sp_Check_sOdt.md index 615f0f9..2d2642e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sOdt.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sOdt.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量管理 → 质量管理单据 → 发外检验单据, and 移动端管理 → 现场 → 功能操作 → 发外检验(mobile单据) — post-save validator on `qlyoutsideproducttestmaster`. Computes 合格/不合格 per slave row from `dNoQualifyQty` vs `iAcQty`/`iAcQty2`, rolls overall test result up to the master, and applies AQL-standard accept-reject totals across the sample group. + +**What it does:** Reads `sSrcSlaveId` from `qlyoutsideproducttestmaster`. Sets `QlyOutSideProductTestSlave.sActValue` to `不合格` when `dNoQualifyQty > iAcQty` OR `dNoQualifyQty2 > iAcQty2`. Updates `qlyoutsideproducttestmaster.iTestResult` (1 if any 不合格 slave row exists) and `dOutSampleQty` (max sample qty across slaves). Then opens a cursor per `sAqlstandardId`, sums `dNoQualifyQty`/`dNoQualifyQty2`, increments `p_iResult` if the group totals exceed `p_iAcQty`/`p_iAcQty2`, and writes the final flag back to `qlyoutsideproducttestmaster.iTestResult`. + +**Invocation:** Bound to `gdsmodule.sSaveProName` (post-save) on `发外检验单据` (`15827076660008241075501010830000`, under 质量管理 → 质量管理单据) and `发外检验(mobile单据)` (`12012615914116374731690490`, under 移动端管理 → 现场 → 功能操作). Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. xly-src ships `script/标版/30100101/Sp_Check_sOdt.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sOis.md b/en/docs/auto-catalog/procedures/Sp_Check_sOis.md index 5c5cc12..6997c72 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sOis.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sOis.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** KPI流程操作菜单 → 发外加工流程 → 工序发外确认, 质量管理单据 → 工序发外确认单据 (mobile), and 移动端管理 → 现场 → 功能操作 → 发外报工(mobile单据) — post-save validator on `opsoutsideinstoreslave`. Recomputes per-line money/qty/tax fields against the chosen tax rate and the material's 正算/反算 formula so the slave totals match `dMaterialsQty × dMaterialsPrice` after price/quantity edits. + +**What it does:** Reads `NetMoney`/`NetPrice` precision from `SysSystemSettings`, then opens a cursor over `opsoutsideinstoreslave` joined to `elematerials` (for `bInverse`, `sReComputeId`, `sComputeId`, `sMaterialsName`) and `sistax` (for `dRate`). For each row recomputes `dMaterialsMoney`/`dMaterialsNoTaxMoney`/`dMaterialsTaxMoney`/`dAuxiliaryQty` via the material's compute formula (forward or inverse), updates the slave with the rounded values, then aggregates the slave totals into the master. + +**Invocation:** Bound to `gdsmodule.sSaveProName` (post-save) on `发外报工(mobile单据)` (`101251240115015952158106410`, under 移动端管理 → 现场 → 功能操作), `工序发外确认` (`192116810113315234275562360`, under KPI流程操作菜单 → 发外加工流程), and `工序发外确认单据` (`101251240115016182844497490`, under 移动端管理 → 现场 → 功能操作). Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. xly-src ships `script/标版/30100101/Sp_Check_sOis.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sOiv.md b/en/docs/auto-catalog/procedures/Sp_Check_sOiv.md index 0eb6729..1ee3948 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sOiv.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sOiv.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** KPI流程操作菜单 → 发外加工流程 → 发外发票 — thin post-save wrapper that delegates to `Sp_afterSave_sOiv`. No validation rules of its own; exists so the save dispatcher can hit the `Sp_Check_*` slot while the actual side-effects live in the `Sp_afterSave_*` peer. + +**What it does:** Initialises `sCode=1`, `iFlag=IFNULL(iFlag,0)`, `sReturn=''`, then immediately calls `Sp_afterSave_sOiv(sGuid, sBrId, sSuId, sCode, sReturn)` inside the `top:` block; relies on that peer to populate `sReturn`/`sCode`. + +**Invocation:** Bound to `gdsmodule.sSaveProName` (post-save) on `发外发票` (`101251168116315832142387420`, under KPI流程操作菜单 → 发外加工流程). Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. No xly-src install script ships for this name — body is database-resident only. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sOpc.md b/en/docs/auto-catalog/procedures/Sp_Check_sOpc.md index a50f9fe..cbe80d4 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sOpc.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sOpc.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** KPI流程操作菜单 → 发外加工流程 → 工序发外 — post-save validator on `opsoutsideprocessmaster`. Confirms the slave totals from `opsoutsideprocessslave` agree with the per-工序 line-items in `opsoutsideprocessdetail`, then recomputes per-row money/tax fields using the material's 正算/反算 formula. + +**What it does:** Reads `NetMoney`/`NetPrice` precision from `SysSystemSettings`. Sums `dMaterialsMoney` from `opsoutsideprocessdetail` (per-工序 split) and `opsoutsideprocessslave` (rolled-up rows); if the two totals differ at 2dp, aborts with `Fun_Sis_GetConstNew(..., 'sJgProcessAmountNoSameFw', ...)` (加工工序总金额不等于发外信息总金额). Then opens a cursor over `opsoutsideprocessslave` joined to `elematerials`/`sistax` and recomputes `dMaterialsMoney`/`dMaterialsNoTaxMoney`/`dMaterialsTaxMoney`/`dAuxiliaryQty` per row using the chosen 正算/反算 formula and tax rate. + +**Invocation:** Bound to `gdsmodule.sSaveProName` (post-save) on `工序发外` (`192116810113315232400087230`, under KPI流程操作菜单 → 发外加工流程). Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. xly-src ships `script/标版/30100101/Sp_Check_sOpc.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sOpi.md b/en/docs/auto-catalog/procedures/Sp_Check_sOpi.md index 954ac09..a6eb42d 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sOpi.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sOpi.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** KPI流程操作菜单 → 发外加工流程 → 整单发外入库 — post-save validator on `opsoutsideinstoremaster`. Combines 红冲 (red-impound) consistency checks, product-name reporting for failing slaves, and the standard 正算/反算 money/tax recompute used across the 发外 family. + +**What it does:** If `sMinusSrcId` is set, sums each prior-slave's `dMaterialsQty` against the rolled-up qty of all later non-`bInvalid` red-impound rows that reference it; non-zero mismatches abort with `sCcprkHaveRedData` (已存在红冲数据,不允许重复提交). Reads `NetMoney`/`NetPrice` precision from `SysSystemSettings`, lists product names from `opsoutsideinstoreslave` joined to `eleproduct` for downstream error reporting, then opens a cursor over the slave rows and recomputes each line's money/tax/auxiliary-qty fields against the material's 正算/反算 formula and tax rate. + +**Invocation:** Bound to `gdsmodule.sSaveProName` (post-save) on `整单发外入库` (`192116810113315235917608210`, under KPI流程操作菜单 → 发外加工流程). Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. xly-src ships `script/标版/30100101/Sp_Check_sOpi.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sOpkg.md b/en/docs/auto-catalog/procedures/Sp_Check_sOpkg.md index 2fb9268..be5d8f0 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sOpkg.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sOpkg.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** KPI流程操作菜单 → 发外加工流程 → 发外对账 — post-save validator on `opsoutsidecheckingmaster`. Prevents mixed 烟包/非烟包 reconciliation, blocks duplicate-source 发外确认 selections, then spreads the master-level 折扣 (discount) money across slaves proportionally and re-applies the price/tax recompute used elsewhere in the 发外 family. + +**What it does:** Reads `NetMoney`/`NetPrice` precision from `SysSystemSettings`. Aborts if `opsoutsidecheckingslave` joined to `elecustomer`/`siscustomerproperty` mixes 烟包 with non-烟包 customers (`sYbNybCantReconciled`), and aborts if any non-红冲 slave references the same `(sSrcNo, sSrcSlaveId)` twice (`sFwqrDataDuplicate`). Then seeds `dMaterialsOldPrice` from `dMaterialsPrice`, computes the slave total, and apportions the master `dLossAllMoney` across slaves as `sLossType='折扣'` per `(qty × oldPrice / total)`. Finishes with the standard cursor-driven money/tax recompute over `opsoutsidecheckingslave` joined to `elematerials`/`sistax`. + +**Invocation:** Bound to `gdsmodule.sSaveProName` (post-save) on `发外对账` (`192116810113315235850403280`, under KPI流程操作菜单 → 发外加工流程). Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. xly-src ships `script/标版/30100101/Sp_Check_sOpkg.sql` as the install body. The procedure summary text (`发外发票单据保存之前数据校验`) misnames the form — actual binding is 发外对账, not 发外发票. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sOpn.md b/en/docs/auto-catalog/procedures/Sp_Check_sOpn.md index b80293c..b99b688 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sOpn.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sOpn.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Post-save validator nominally for 发外到货单据 (per procedure summary), targeting `opsoutsidearriveslave`. Reads `NetMoney`/`NetPrice` precision from `SysSystemSettings`, opens a cursor over `opsoutsidearriveslave` joined to `elematerials`/`sistax`, and recomputes per-row money/tax/qty fields against the material's 正算/反算 formula and tax rate — the same recompute pattern as `Sp_Check_sOis`/`Sp_Check_sOpc`/`Sp_Check_sOpn1`. + +**What it does:** Inside the `top:` block, gates on `IFNULL(sFormGuid,'') <> ''`. For each slave row pulls `(sId, sMaterialsId, sMaterialsStyle, dMaterialsQty, dAuxiliaryQty, dMaterialsPrice, dMaterialsMoney, dRate, sSrcSlaveId, sMaterialsName, bInverse, sReComputeId, sComputeId, …)` and re-derives the money fields rounded to `p_NetMoney`/`p_NetPrice`. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName`/`sSaveProNameBefore`/`sProcName`/`sDeleteProName` row references it; no form-master `sSqlStr` ref; no other DB routine calls it; xly-src grep finds only `script/标版/30100101/Sp_Check_sOpn.sql` (the install body). The 发外到货 flow appears to use `Sp_Check_sOpp` (整单发外) and `Sp_Check_sOpi` (整单发外入库) instead — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sOpn1.md b/en/docs/auto-catalog/procedures/Sp_Check_sOpn1.md index 4395776..4f48708 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sOpn1.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sOpn1.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Post-save validator nominally for 发外送货单据 (per procedure summary), targeting `opsoutsidearriveshslave`. Near-identical to `Sp_Check_sOpn` — reads `NetMoney`/`NetPrice` precision from `SysSystemSettings`, opens a cursor over `opsoutsidearriveshslave` joined to `elematerials`/`sistax`, and recomputes per-row money/tax/qty fields against the material's 正算/反算 formula and tax rate. + +**What it does:** Gates on `IFNULL(sFormGuid,'') <> ''`. Per slave row pulls `(sId, sMaterialsId, sMaterialsStyle, dMaterialsQty, dAuxiliaryQty, dMaterialsPrice, dMaterialsMoney, dRate, sSrcSlaveId, sMaterialsName, bInverse, sReComputeId, sComputeId, …)` and re-derives the money fields rounded to `p_NetMoney`/`p_NetPrice`. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName`/`sSaveProNameBefore`/`sProcName`/`sDeleteProName` row references it; no form-master `sSqlStr` ref; no other DB routine calls it; xly-src grep yields no hit (no install script under `script/标版/`). Looks like a `_1` variant of `Sp_Check_sOpn` that was forked but never wired up — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sOpp.md b/en/docs/auto-catalog/procedures/Sp_Check_sOpp.md index c1bea93..5ba31ba 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sOpp.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sOpp.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** KPI流程操作菜单 → 发外加工流程 → 整单发外 — post-save validator on `opsoutsideprocessmaster`/`opsoutsideprocessslave`. Recomputes per-line money/tax/qty fields against the chosen tax rate and the material's 正算/反算 formula so the slave totals stay coherent after price/quantity edits. + +**What it does:** Reads `NetMoney`/`NetPrice` precision from `SysSystemSettings`. Inside the `top:` block, opens a cursor over `opsoutsideprocessslave` joined to `elematerials` (for `bInverse`, `sReComputeId`, `sComputeId`, `sMaterialsName`) and `sistax` (for `dRate`). For each row recomputes `dMaterialsMoney`/`dMaterialsNoTaxMoney`/`dMaterialsTaxMoney`/`dAuxiliaryQty` via the material's compute formula (forward or inverse), updates the slave with the rounded values, then aggregates the slave totals into the master. + +**Invocation:** Bound to `gdsmodule.sSaveProName` (post-save) on `整单发外` (`192116810113315234963208090`, under KPI流程操作菜单 → 发外加工流程). Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. xly-src ships `script/标版/30100101/Sp_Check_sOpp.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sOsa.md b/en/docs/auto-catalog/procedures/Sp_Check_sOsa.md index e24d705..2625616 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sOsa.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sOsa.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Stub post-save validator nominally for 采购到货 (per procedure summary), delegating to `Sp_afterSave_sOsa`. Body initialises `sCode`/`iFlag`/`sReturn`, then immediately calls `Sp_afterSave_sOsa(sGuid, sBrId, sSuId, sCode, sReturn)` — no validation logic of its own. + +**What it does:** Forwards `(sGuid, sBrId, sSuId, sCode, sReturn)` to `Sp_afterSave_sOsa` inside the `top:` block; relies on that peer to populate `sReturn`/`sCode`. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName`/`sSaveProNameBefore`/`sProcName`/`sDeleteProName` row references it; no form-master `sSqlStr` ref; no other DB routine calls it; xly-src grep yields no hit (no install script under `script/标版/`). The matching `Sp_afterSave_sOsa` exists but this wrapper has no live caller — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sPaj.md b/en/docs/auto-catalog/procedures/Sp_Check_sPaj.md index 31b3bd3..8435dae 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sPaj.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sPaj.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Post-save validator nominally for 成品调拨单据 (per procedure summary), targeting `pitproductadjustmaster`/`pitproductadjustslave`. Enforces the rule that 正数仓 and 余数仓 can't be mixed in one 调拨, and prevents duplicate-submit of 红冲 lines that already net to zero. + +**What it does:** Counts `pitproductadjustslave` rows whose warehouse `bRemainder` does not match the master warehouse's `bRemainder` (`Where A.sParentId=sGuid AND B.bRemainder NOT IN (...)`); on hit, aborts with `sZsYsCantTransferred` (正数仓和余数仓不能进行调拨). Then, if `sMinusSrcId` is set on the master, sums the original slave qty plus all non-`bInvalid` red-impound qty for each `sMinusSrcSlaveId` and counts rows whose net is non-zero; on hit, aborts with `sCcprkHaveRedData` (已存在红冲数据,不允许重复提交). + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName`/`sSaveProNameBefore`/`sProcName`/`sDeleteProName` row references it; no form-master `sSqlStr` ref; no other DB routine calls it; xly-src grep finds only `script/标版/30100101/Sp_Check_sPaj.sql` (the install body). The 成品调拨 module appears to dispatch its post-save logic through a different `sSaveProName` — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sPca.md b/en/docs/auto-catalog/procedures/Sp_Check_sPca.md index 3c7fc37..4c0b880 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sPca.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sPca.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Post-save validator nominally for 采购到货单据 (per procedure summary), targeting `purpurchasearrivemaster`/`purpurchasearriveslave`. Gates on 反算 materials needing 到货数量 entry, then recomputes per-line money/tax/qty fields against the chosen tax rate and the material's 正算/反算 formula. + +**What it does:** Counts `purpurchasearriveslave` rows joined to `elematerials` where `iHandIn=1` AND `bInverse=0`; on hit, aborts with sCode=-8 and `sMaterialNotFsgsDh` (物料不是反算公式物料,请输入到货数量进行计算) concatenated with the offending material names. Reads `NetMoney`/`NetPrice` precision from `SysSystemSettings`, then opens a cursor over `purpurchasearriveslave` joined to `elematerials`/`sistax` and recomputes `dMaterialsMoney`/`dMaterialsNoTaxMoney`/`dMaterialsTaxMoney`/`dAuxiliaryQty` per row using the chosen 正算/反算 formula and tax rate. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName`/`sSaveProNameBefore`/`sProcName`/`sDeleteProName` row references it; no form-master `sSqlStr` ref; no other DB routine calls it; xly-src grep finds only `script/标版/30100101/Sp_Check_sPca.sql` (the install body). The 采购到货 module appears to dispatch its post-save logic through a different `sSaveProName` (or the `sPca1` variant below) — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sPca1.md b/en/docs/auto-catalog/procedures/Sp_Check_sPca1.md index 14e763c..5440160 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sPca1.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sPca1.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Post-save validator nominally for 供应商送货 (per procedure summary), targeting `purpurchasearriveshmaster`/`purpurchasearriveshslave` (the `*sh` send-delivery variant of 采购到货). Same shape as `Sp_Check_sPca` but cursors over the `*sh` slave table. + +**What it does:** Reads `NetMoney`/`NetPrice` precision from `SysSystemSettings`, gates on `IFNULL(sFormGuid,'') <> ''`, then opens a cursor over `purpurchasearriveshslave` joined to `elematerials` (for `bInverse`, `sReComputeId`, `sComputeId`, `sMaterialsName`) and `sistax` (for `dRate`). For each row recomputes `dMaterialsMoney`/`dMaterialsNoTaxMoney`/`dMaterialsTaxMoney`/`dAuxiliaryQty` via the material's 正算/反算 formula and rounds to `p_NetMoney`/`p_NetPrice`. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName`/`sSaveProNameBefore`/`sProcName`/`sDeleteProName` row references it; no form-master `sSqlStr` ref; no other DB routine calls it; xly-src grep yields no hit (no install script under `script/标版/`). Looks like a `_1` variant of `Sp_Check_sPca` that was forked for the `*sh`送货 flow but never wired up — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sPct.md b/en/docs/auto-catalog/procedures/Sp_Check_sPct.md index 9e184e9..82cbdad 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sPct.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sPct.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Stub post-save validator nominally for 品质首检(mobile单据) (per procedure summary), delegating to `Sp_afterSave_sPct`. The body declares the usual local variables for a 首检 check but the actual rule branches are commented out — only the forwarding call remains. + +**What it does:** Declares `p_count`, `p_sBillNo`, `p_sId`, `p_sSrcSlaveId` etc. (unused), checks `IFNULL(sReturn,'') <> ''` to short-circuit, then calls `Sp_afterSave_sPct(sGuid, sBrId, sSuId, sCode, sReturn)`. On non-empty `sReturn` after the peer call, sets `sCode = -1`. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName`/`sSaveProNameBefore`/`sProcName`/`sDeleteProName` row references it; no form-master `sSqlStr` ref; no other DB routine calls it; xly-src grep finds only `script/标版/30100101/Sp_Check_sPct1.sql` (the install body for the `_1` variant) — not the bare `Sp_Check_sPct` body. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sPct1.md b/en/docs/auto-catalog/procedures/Sp_Check_sPct1.md index 6d6e06e..1bcaaea 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sPct1.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sPct1.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Stub post-save validator for the `_1` variant of 品质首检(mobile单据), delegating to `Sp_afterSave_sPct1`. Body is byte-identical in shape to `Sp_Check_sPct` — locals declared but no rule branches active, only the forwarding call. + +**What it does:** Declares `p_count`, `p_sBillNo`, `p_sId`, `p_sSrcSlaveId` etc. (unused), checks `IFNULL(sReturn,'') <> ''` to short-circuit, then calls `Sp_afterSave_sPct1(sGuid, sBrId, sSuId, sCode, sReturn)`. On non-empty `sReturn` after the peer call, sets `sCode = -1`. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName`/`sSaveProNameBefore`/`sProcName`/`sDeleteProName` row references it; no form-master `sSqlStr` ref; no other DB routine calls it; xly-src grep finds `script/标版/30100101/Sp_Check_sPct1.sql` (the install body). Candidate for maintainer audit — both `Sp_Check_sPct` and this `_1` variant lack a live binding. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sPdt.md b/en/docs/auto-catalog/procedures/Sp_Check_sPdt.md index c4114d3..038f973 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sPdt.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sPdt.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Post-save validator nominally for 成品检验单据 (per procedure summary), targeting `QlyProductTestMaster`/`QlyProductTestSlave`. Computes 合格/不合格 per slave row from `dNoQualifyQty` vs `iReQty`, rolls sample/test-result fields up to the master, and applies AQL-standard accept-reject totals across each `sAqlstandardId` group — the成品 peer of `Sp_Check_sOdt`. + +**What it does:** Reads `sSrcSlaveId` from `QlyProductTestMaster`. Sets `QlyProductTestSlave.sActValue` to `不合格` when `dNoQualifyQty >= iReQty`. Updates `QlyProductTestMaster.dSampleAuxiliaryQty` and `dOutSampleQty` to the max `dSampleQty` across slaves. Then opens a cursor per `sAqlstandardId`, sums `dNoQualifyQty`/`dNoQualifyQty2`, increments `p_iResult` when group totals exceed `p_iAcQty`/`p_iAcQty2`, and writes the final flag back as `QlyProductTestMaster.iTestResult`. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName`/`sSaveProNameBefore`/`sProcName`/`sDeleteProName` row references it; no form-master `sSqlStr` ref; no other DB routine calls it; xly-src grep finds only `script/标版/30100101/Sp_Check_sPdt.sql` (the install body). The 成品检验 module may instead route through the `Sp_Check_sPdtFJ` 辅检 variant or a tenant-specific override — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sPdtFJ.md b/en/docs/auto-catalog/procedures/Sp_Check_sPdtFJ.md index e2adcf2..c4ed010 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sPdtFJ.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sPdtFJ.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Post-save validator nominally for 成品复检 (per procedure summary; `FJ` = 复检 re-test), targeting `QlyProductTestMaster`/`QlyProductTestSlave`. Same shape as `Sp_Check_sPdt` — computes 合格/不合格 per slave row from `dNoQualifyQty` vs `iReQty`, then applies AQL-standard accept-reject totals across each `sAqlstandardId` group. + +**What it does:** Reads `sSrcSlaveId` from `QlyProductTestMaster`. Sets `QlyProductTestSlave.sActValue` to `不合格` when `dNoQualifyQty >= iReQty`. Updates `QlyProductTestMaster.dSampleAuxiliaryQty` to the max `dSampleQty` across slaves. Opens a cursor per `sAqlstandardId`, sums `dNoQualifyQty`/`dNoQualifyQty2`, increments `p_iResult` when group totals exceed `p_iAcQty`/`p_iAcQty2`, and writes the final flag back as `QlyProductTestMaster.iTestResult`. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName`/`sSaveProNameBefore`/`sProcName`/`sDeleteProName` row references it; no form-master `sSqlStr` ref; no other DB routine calls it; xly-src grep yields no hit (no install script under `script/标版/`). The 成品复检 sub-flow appears unwired — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sPis.md b/en/docs/auto-catalog/procedures/Sp_Check_sPis.md index 21b442e..1f408bb 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sPis.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sPis.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** KPI流程操作菜单 → 物料采购流程 → 采购入库 — post-save validator on `purpurchaseinstoremaster`. Combines 红冲 (red-impound) consistency checks on the slave qty totals with the standard 正算/反算 money/tax recompute used across the procurement family. + +**What it does:** Reads `NetMoney`/`NetPrice` precision from `SysSystemSettings`. If `sMinusSrcId` is set on the master, sums `dAuxiliaryQty` from `purpurchaseinstoreslave` rows that reference each prior slave via `sMinusSrcSlaveId` (against non-`bInvalid` masters) and counts rows whose net is non-zero; on hit, aborts with `sCcprkHaveRedData` (已存在红冲数据,不允许重复提交). Then gates on `IFNULL(sFormGuid,'') <> ''` and opens a cursor over `purpurchaseinstoreslave` joined to `elematerials`/`sistax`, recomputing per-row money/tax/qty fields against the chosen 正算/反算 formula and tax rate. + +**Invocation:** Bound to `gdsmodule.sSaveProName` (post-save) on `采购入库` (`192116810113315220315711060`, under KPI流程操作菜单 → 物料采购流程). Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. xly-src ships `script/标版/30100101/Sp_Check_sPis.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sPiv.md b/en/docs/auto-catalog/procedures/Sp_Check_sPiv.md index b9ee430..b5f0e24 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sPiv.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sPiv.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 → 物料采购流程 → 采购发票 — post-save validator on `purpurchaseinvoicemaster`. After the user clicks save, this hook fires before the result is returned, but its real work is to delegate to the after-save calculator: it is a thin pass-through wrapper around `Sp_afterSave_sPiv`. + +**What it does:** Initialises `sCode=1`, defaults `iFlag` to 0, clears `sReturn`, opens a `top:` block, and immediately calls `Sp_afterSave_sPiv(sGuid, sBrId, sSuId, sCode, sReturn)`. No table touch or validation logic of its own — the entire enforcement lives in the peer after-save proc. + +**Invocation:** Bound to `gdsmodule.sSaveProName` on `采购发票` (`19211681019715782883617940`). Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. Pre-save peer is `Sp_beforeSave_sPiv` (bound on `sSaveProNameBefore`). xly-src has no install script for this exact stub — only the peers ship under `script/标版/30100101/`. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sPkg.md b/en/docs/auto-catalog/procedures/Sp_Check_sPkg.md index f58b184..c4e4160 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sPkg.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sPkg.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 → 物料采购流程 → 采购对账 — post-save validator on `purpurchasecheckingmaster`/`purpurchasecheckingslave`/`purpurchasecheckingdetail`. Reconciles a purchase invoice (对账单) against its source purchase orders before the after-save hook fires: enforces 烟包/非烟包 cannot be mixed, runs the 正算/反算 material-quantity formulas, and rolls auxiliary-quantity slave totals back into the detail rows so invoiced money/qty stays consistent with PO qty. + +**What it does:** Sets `sCode=1`, `iFlag=0`, clears `sReturn`. Reads `NetMoney`/`NetPrice` precisions from `SysSystemSettings`. Aborts with `sYbNybCantReconciled` ("烟包和非烟包类型的单据不能同步进行对账") if both 烟包 and non-烟包 lines are present. Opens a nested cursor over `purpurchasecheckingslave` × `purpurchasecheckingdetail` joined to the source `purpurchaseorderslave`, dispatches each row to either `Sp_System_ReplaceField(... iComputeType=0)` (forward formula) or the reverse-formula branch using `eleformula.sComputeId`/`sReComputeId`, recomputes `dMaterialsQty`/`dAuxiliaryQty` and the derived money columns (`dProductMoney`, `dProductNoTaxMoney`, `dProductTaxMoney`, `dProductForeignMoney`), updates the slave/detail rows, and finally calls `Sp_afterSave_sPkg`. Aborts with localised messages (`sPcaMaterialInOrder`, `sPuaDzQtyUpPurQty`, `sPuaDzJJQtyUpPurQty`, `sPuaDzJJDzQtyUpPurQty`, `sMatrialNameInInvoice`) when invoice qty exceeds the underlying PO qty. + +**Invocation:** Bound to `gdsmodule.sSaveProName` on `采购对账` (`192116810113315220489243410`) — 采购管理 → 物料采购流程 (KPI流程操作菜单). Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. Pre-save peer is `Sp_beforeSave_sPkg`. xly-src ships `script/标版/30100101/Sp_Check_sPkg.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sPmd.md b/en/docs/auto-catalog/procedures/Sp_Check_sPmd.md index 955f294..1421f5b 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sPmd.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sPmd.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 物料领用流程 → 生产领料 / 生产补料 / 生产退料 — post-save validator on `MitProductionMaterialsMaster`/`Slave` (`sPmd` = production-materials-dispatch). Enforces the over-issue limits a customer sets via the `MaterialsStockLimit` switch in `SysSystemSettings`: requested qty vs. plan qty, picked qty vs. requested qty, returned qty vs. previously-issued qty — branching on which form (领料 / 补料 / 退料 / 发外补料) raised the save. + +**What it does:** Sets `sCode=1`, `iFlag=0`, clears `sReturn`. Reads `NetMoney`/`NetPrice` precisions. Branches on `sFormGuid` — for 生产领料 (`192116810113315226492535760`), 1/1 新增生产补料 (`192116810113315222184074940`), 发外补料, and two additional forms, opens cursors over `MitProductionMaterialsSlave` joined to upstream `mftproductionmaterialsapply` / `mftworkordermaterialsslave` / `mitproductionmaterialswastebookmaster`, computes the overrun, calls `Sp_Sis_GetConst('MaterialsStockLimit', ...)` to decide whether to abort, and on overrun raises `sMwhMaterialInOrder`, `sMwhCkQtyUpOrderMaterial`, `sMwhCkJjQtyUpOrderMaterial`, `sMaterialCkQtyUp`, `sMaterialJjQtyUp`, `sMwhJjQtyUpLlsq`, `sMwhCkQtyUpLlsq`, `sMwhCkJjQtyLlsq`, `sMwhMaterialInClck`, `sMwhMaterialInLlrk`, etc. For 生产退料 (`192116810113315226622476570`) the equivalent over-return check is applied. Finally calls `Sp_afterSave_sPmd`. The 红冲 (reverse-charge) branch is commented out. + +**Invocation:** Bound to `gdsmodule.sSaveProName` on `生产领料单据` (`192116810113315226492535760`), `1/1 新增生产补料` (`192116810113315222184074940`), and `生产退料单据` (`192116810113315226622476570`) — all under 生产管理 → 物料领用流程 (KPI流程操作菜单). Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. Pre-save peer is `Sp_beforeSave_sPmd`. xly-src ships `script/标版/30100101/Sp_Check_sPmd.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sPmt.md b/en/docs/auto-catalog/procedures/Sp_Check_sPmt.md index b186250..028378b 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sPmt.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sPmt.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 财务收付款 → 付款单 — post-save validator on `cahpaymentmaster`. Thin wrapper that delegates the heavy lifting (write-back, source-bill update, etc.) to `Sp_afterSave_sPmt` and re-flags `sCode=-1` if that call sets a non-empty `sReturn`. + +**What it does:** Sets `sCode=1`, defaults `iFlag` to 0, clears `sReturn`. After local-variable declarations (left-over scaffolding from the family template — billno/srcId/etc. are declared but unused), it short-circuits to `sCode=-1` if `sReturn` is already populated, then calls `Sp_afterSave_sPmt(sGuid, sBrId, sSuId, sCode, sReturn)` and flips `sCode=-1` again if that returns a message. + +**Invocation:** Bound to `gdsmodule.sSaveProName` on `付款单` (`192116810113315233387186220`) — 财务管理 → 财务收付款 (KPI流程操作菜单). Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. Pre-save peer is `Sp_beforeSave_sPmt`. xly-src ships `script/标版/30100101/Sp_Check_sPmt.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sPod.md b/en/docs/auto-catalog/procedures/Sp_Check_sPod.md index eeb2053..bbfc63d 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sPod.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sPod.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 → 物料采购流程 → 采购订单 — post-save validator on `purpurchaseordermaster`/`purpurchaseorderslave`/`purpurchaseorderdetail`. Recomputes 正算/反算 material quantities from the source 采购申请/工单 lines, enforces the 反算公式物料 rule, and prevents a single PO row from pulling from material plans that span different work-orders. Calls a dedicated checker `Sp_PurpurchaseOrder_CheckUpdate` for the heavy module-specific rules. + +**What it does:** Sets `sCode=1`, `iFlag=0`, clears `sReturn`. Reads `NetMoney`/`NetPrice` precisions. First barrier: for slave rows with `iHandIn=1` whose `eleproduct.bInverse=0`, abort with `sMaterialNotFsgs` ("物料不是反算公式物料,请输入采购数量进行计算"). Opens nested cursors over `purpurchaseorderslave` × `purpurchaseorderdetail` joined to source apply/work-order rows, dispatches to forward (`Sp_System_ReplaceField`, `iComputeType=0`) or reverse formula based on `eleformula.sComputeId`/`sReComputeId`, recomputes `dMaterialsQty`/`dAuxiliaryQty` and the derived money columns, and updates the slave/detail rows. On per-row overruns vs. material need or vs. source plan, raises `sCgQtyUpMaterialNeed`/`sCgJjQtyUpMaterialNeed`/`sJjQtyUpMaterialNeed`/`sPcaCgQtyUpCg`/`sPcaCgJjQtyUpCg`/`sPcaJjQtyUpCg`/`sPcaMaterialInOrder`/`sPcaMaterialInCgOrder`. Enforces `sMaterialNoSameWorkOrder`/`sQtyNoSameWorkOrder` (one slave row cannot mix work-orders / qty must match work-order qty). Then `CALL Sp_PurpurchaseOrder_CheckUpdate(sGuid, sFormGuid, sLoginId, sBrId, sSuId, @sCode, @sReturn)` for the module-specific extra rules. Finally calls `Sp_afterSave_sPod`. Old-system 旧采购订单号 rule is commented out. + +**Invocation:** Bound to `gdsmodule.sSaveProName` on `采购订单` (`192116810113315217757747140`) — 采购管理 → 物料采购流程 (KPI流程操作菜单). Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. Pre-save peer is `Sp_beforeSave_sPod`. xly-src ships `script/标版/30100101/Sp_Check_sPod.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sPpa.md b/en/docs/auto-catalog/procedures/Sp_Check_sPpa.md index 2096e1b..459956b 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sPpa.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sPpa.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 → 采购明细 → 采购申请单据 — post-save validator on `purpurchaseapplymaster`/`purpurchaseapplyslave`/`purpurchaseapplydetail`. Same shape as `Sp_Check_sPod` but for the upstream purchase-requisition: re-runs 正算/反算 quantity formulas, enforces 反算公式物料 and 烟包类型 rules, and caps the requested qty against the originating sales-order need. + +**What it does:** Sets `sCode=1`, `iFlag=0`, clears `sReturn`. Reads `NetMoney`/`NetPrice` precisions. Barriers up front: `iHandIn=1` rows whose `eleproduct.bInverse=0` abort with `sMaterialNotFsgsSq` ("物料不是反算公式物料,请输入申请数量进行计算"); 客服-channel requests with no 烟包类 selected abort with `sTypeSelectCiggrate`. Opens nested cursors over `purpurchaseapplyslave` × `purpurchaseapplydetail` joined to the upstream sales-order / forecast row, dispatches to `Sp_System_ReplaceField` forward formula or the reverse-formula branch (`eleformula.sComputeId`/`sReComputeId`), recomputes `dMaterialsQty`/`dAuxiliaryQty` and the money columns, updates the slave/detail rows. On overruns raises `sPpaSqQtyUpNeed`/`sPpaHsQtyUpNeed`/`sPpaHsSqQtyUpNeed`/`sHsQtyUpSaleOrder`/`sHsSqQtyUpSaleOrder`/`sSqQtyUpSaleOrder`/`sPcaMaterialInOrder`/`sPcaMaterialInCgOrder`. Finally calls `Sp_afterSave_sPpa`. + +**Invocation:** Status: appears orphaned. The module `采购申请单据` (`192116810113315217105813660`, 采购管理 → 采购明细) binds `Sp_Calc_sPpa` on `sProcName` and the newer `采购申请(新)` (`192116811110216195779824320`) binds `Sp_Calc_sPpa1`, but `Sp_Check_sPpa` itself is not wired as `sSaveProName`/`sSaveProNameBefore` on any module. No other routine references it. xly-src ships `script/标版/30100101/Sp_Check_sPpa.sql` as the install body — the script is in the codebase but the hook is unbound — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sPpr.md b/en/docs/auto-catalog/procedures/Sp_Check_sPpr.md index e635f6c..7902c92 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sPpr.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sPpr.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 订单生产流程 → 产量上报 — post-save validator on `mftproductionreportmaster`/`mftproductionreportslave`. Enforces that the reported processed quantity does not exceed the underlying 生产计划 plan quantity or the 工序 process quantity (summed across all non-invalid production-report records for the same source slave). + +**What it does:** Sets `sCode=1`, `iFlag=0`, clears `sReturn`. Reads `NetMoney`/`NetPrice` precisions (unused — template scaffolding). When `sFormGuid` is set, opens a cursor over `mftproductionreportslave` filtered by `sParentId=sGuid`, and for each row with a non-empty `sSrcSlaveId` runs two over-report checks: (1) plan: `mftproductionplanslave.dProcessQty - SUM(mftproductionreportslave.dProcessQty)` joined back through master and `eleproduct` — if negative, appends `产品名称在产量上报明细单据号中上报数已超过计划数量;`. (2) process: same calculation against `mftworkorderprocess.dProcessQty` — if negative, appends `上报数已超过工序数量;`. Sets `sCode=-1` and exits if `sReturn` ended up non-empty. The trailing `Sp_afterSave_sPpr` call is commented out. + +**Invocation:** Bound to `gdsmodule.sSaveProName` on `产量上报` (`19211681019715476042694840`) — 生产管理 → 订单生产流程 (KPI流程操作菜单). Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. Pre-save peer is `Sp_beforeSave_sPpr`. xly-src ships `script/标版/30100101/Sp_Check_sPpr.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sPrj.md b/en/docs/auto-catalog/procedures/Sp_Check_sPrj.md index 1e9b025..73c030c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sPrj.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sPrj.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 → 物料采购流程 → 采购退货 — post-save validator on `purpurchaserejectmaster`/`purpurchaserejectslave`. Guards two invariants: 反算 (reverse-formula) materials must have a 采购数量, and once a 红冲 (reverse-charge) record exists for the source bill, no further duplicate 红冲 is allowed. + +**What it does:** Sets `sCode=1`, `iFlag=0`, clears `sReturn`. (1) Counts `purpurchaserejectslave` rows with `iHandIn=1` whose `elematerials.bInverse=0` — if any, aborts with `sCode=-8` and `sMaterialNotFsgs` ("物料不是反算公式物料,请输入采购数量进行计算") concatenated with the offending material names. (2) Reads `sMinusSrcId` from the master; if set, counts mis-matched 红冲 rows by comparing the original slave's `dAuxiliaryQty` against the sum of `dAuxiliaryQty` on matching `sMinusSrcSlaveId` rows — if any imbalance, aborts with `sCcprkHaveRedData` ("已存在红冲数据,不允许重复提交"). Finally calls `Sp_afterSave_sPrj`. + +**Invocation:** Bound to `gdsmodule.sSaveProName` on `2/4 新增采购退货` (`192116810113315221425660510`) — 采购管理 → 物料采购流程 (KPI流程操作菜单). Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. Pre-save peer is `Sp_beforeSave_sPrj`. xly-src ships `script/标版/30100101/Sp_Check_sPrj.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sPsra.md b/en/docs/auto-catalog/procedures/Sp_Check_sPsra.md index 3ce52c5..6a9cdf9 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sPsra.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sPsra.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Inferred from the name and routine comment: 销售管理 → 销售退货 → 销售退货申请 — would-be post-save validator on `salrejectgoodsapplymaster`/`salrejectgoodsapplyslave`. Guards 退货走账/无实物退货 mutual exclusion, recomputes line money against tax rate, and ensures the requested return qty does not exceed the actual 出库 qty in the originating delivery note. + +**What it does:** Sets `sCode=1`, `iFlag=0`, clears `sReturn`. Aborts with `sChooseThzz` ("勾选了退货走账,不能勾选无实物退货") when any slave row has both `bNoObject=1` and the master's `bNotAccident=1`. Then `UPDATE salrejectgoodsapplyslave INNER JOIN sistax` recomputes `dProductMoney`, `dProductForeignMoney`, `dProductNoTaxPrice`/`Money`, `dProductTaxMoney`, `dNProductPrice`/`Money` per the joined tax rate. Opens a cursor over the slave rows and, for each `sSrcNo`+`sProductId`+`sDefineNo`, sums the matching `saldelivergoodsslavechildren.dProductQty` (joined via `saldelivergoodsmaster.sBillNo`) and aborts with a concatenated `sChooseThzz`/`sOutStoreQtyLessReturn` ("在出库单中的出库数量少于退货申请数量;请重新选择批次,出库单号") when the requested qty exceeds the delivered qty. + +**Invocation:** Status: appears orphaned. No `gdsmodule` row binds this proc on `sSaveProName`/`sSaveProNameBefore`. No `Sp_Calc_sPsra` exists either. No other routine references it, no `xly-src` hit (no install script). The body is substantive and clearly intended for a 销售退货申请 form, but the dispatch wire is missing — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sPst.md b/en/docs/auto-catalog/procedures/Sp_Check_sPst.md index 93621b9..920b295 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sPst.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sPst.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售送货流程 → 成品入库 — post-save validator on `pitproductinstoremaster`/`pitproductinstoreslave`. Two-part enforcement: (1) the 入库 qty cannot exceed the 检验合格数 from QC, and (2) overflow across the per-work-order plan qty is auto-shunted into a 余数仓库 by inserting a split-row when the system setting `CkxNoRemainderWarehouse` is on. Handles 红冲 deduplication as well. + +**What it does:** Sets `sCode=1`, `iFlag=0`, clears `sReturn`. Numbers slave rows via a session variable, reads `pitproductinstoremaster.sInstoreType`. Detects a 红冲 master and aborts with `sCcprkHaveRedData` if existing 红冲 rows don't balance. For `sInstoreType=1` (normal inbound), aborts with `sProductInStoreQtyUpQualified` ("产品入库数已超检验合格数,请核查是否重复入库") when the summed `dProductQty` per `sSrcSlaveId` exceeds the matching `qlyproducttestmaster.dQualifyQty`. Reads `NetMoney`/`CkxNoRemainderWarehouse`/`NetPrice` precisions. When `CkxNoRemainderWarehouse=1`, opens a cursor over slave rows whose warehouse has `bRemainder=1`; for each row, looks up `siswarehouse.sRemainWareHouseId` (aborts with `sNoRemindWareHouse` if not set), then computes overflow against `mftworkorderslave.dProductQty (+dReturnProductQty)` minus the sum of all in-store rows; on overflow, reduces the original row's qty and `INSERT INTO pitproductinstoreslave` a new row in the 余数仓库 carrying `ABS(overflow)`. Deletes any `dProductQty=0` slave rows, then calls `Sp_afterSave_sPst`. If the master is a 红冲, also calls `Sp_Calc_sPst(1, 0, ...)` to immediately drive the audit. + +**Invocation:** Bound to `gdsmodule.sSaveProName` on `成品入库` (`192116810113315228246447250`) — 销售管理 → 销售送货流程 (KPI流程操作菜单). Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. Pre-save peer is `Sp_beforeSave_sPst`. xly-src ships `script/标版/30100101/Sp_Check_sPst.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sPtr.md b/en/docs/auto-catalog/procedures/Sp_Check_sPtr.md index f47e325..b213aff 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sPtr.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sPtr.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 库存管理 → 成品库存 → 出库管理 → 成品领用单据 — post-save validator on `pitproductrejectmaster`/`pitproductrejectslave` (`sPtr` = product-takeout/reject). Despite the name, the proc backs the 成品领用 (and report-scrap) flow: ensures 红冲 records don't double-submit and that the out-store qty per row does not exceed either the source 计划 qty or the 质量事故 报废 qty. + +**What it does:** Sets `sCode=1`, `iFlag=0`, clears `sReturn`. Reads `pitproductrejectmaster.sMinusSrcId`; if set, counts `pitproductrejectslave` rows whose original `dProductQty` plus summed reverse-charge `dProductQty` is non-zero — if any, aborts with `sCcprkHaveRedData` ("已存在红冲数据,不允许重复提交"). The commented 余数仓库 enforcement block is preserved. With a non-empty `sFormGuid`, opens a cursor over `pitproductrejectslave` and for each `sSrcSlaveId` checks two channels: (1) `mftproductionplanbillslave.dProcessQty - SUM(pitproductrejectslave.dProductQty)` and (2) `mftqualityaccidentmaster.dScarpQty - SUM(...)`. On negative result, concatenates either `sOdtInOrder` (same bill) or `sDataInScrapOrDispatch` (other bill numbers) with `sOutStockExceed` ("出库数量已超量"). Aborts with `sCode=-1` if `sReturn` is non-empty, otherwise calls `Sp_afterSave_sPtr`. + +**Invocation:** Bound to `gdsmodule.sSaveProName` on `成品领用单据` (`101251240115015920999005840`) — 库存管理 → 成品库存 → 出库管理. Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. No `sSaveProNameBefore` peer on this module. xly-src ships `script/标版/30100101/Sp_Check_sPtr.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sQtt.md b/en/docs/auto-catalog/procedures/Sp_Check_sQtt.md index f4b8a33..ad86c8f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sQtt.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sQtt.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 估价管理流程 → 新报价单 — post-save validator on the quotation form (`SalQuotationMaster`). Pure pass-through to `Sp_afterSave_sQtt`: the after-save peer carries the actual write-back into source enquiries / product cost lines; this stub exists only to honour the save-validator slot in the dispatcher. + +**What it does:** Sets `sCode=1`, defaults `iFlag` to 0, clears `sReturn`, and immediately calls `Sp_afterSave_sQtt(sGuid, sBrId, sSuId, sCode, sReturn)`. No validation, no table touch. + +**Invocation:** Bound to `gdsmodule.sSaveProName` on `01/04【新增】新报价单` (`101251240115016076506222050`) — 销售管理 → 估价管理流程 (KPI流程操作菜单). Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. Pre-save peer is `Sp_beforeSave_sQtt`. xly-src ships `script/标版/30100101/Sp_Check_sQtt.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sRct.md b/en/docs/auto-catalog/procedures/Sp_Check_sRct.md index 4435e80..21d2a0e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sRct.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sRct.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 财务收付款 → 收款单 — post-save validator on `cahreceiptmaster`. Carries one inline fix-up (rounding the foreign-currency product total) before delegating to the after-save peer for the real write-back into upstream receivables. + +**What it does:** Sets `sCode=1`, defaults `iFlag` to 0, clears `sReturn`. Short-circuits to `sCode=-1` if `sReturn` is already populated. Then `UPDATE cahreceiptmaster SET dProductForeignMoney = ROUND(ROUND(dTotalMoney/dCurrencyRate, 3), 2) WHERE sId=sGuid` keeps the foreign-currency product money in sync with the converted total. Finally calls `Sp_afterSave_sRct(sGuid, sBrId, sSuId, sCode, sReturn)` and flips `sCode=-1` if that returns a message. + +**Invocation:** Bound to `gdsmodule.sSaveProName` on `收款单` (`192116810113315231731646200`) — 财务管理 → 财务收付款 (KPI流程操作菜单). Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. Pre-save peer is `Sp_beforeSave_sRct`. xly-src ships `script/标版/30100101/Sp_Check_sRct.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sRct_copy1.md b/en/docs/auto-catalog/procedures/Sp_Check_sRct_copy1.md index 8c9a82a..e44eef9 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sRct_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sRct_copy1.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_Check_sRct` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_Check_sRct` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sRcts.md b/en/docs/auto-catalog/procedures/Sp_Check_sRcts.md index f8a555a..e2b4d29 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sRcts.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sRcts.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Inferred from the name and routine comment: 财务管理 → 财务收付款 → 收款单(汇总) — would-be post-save validator on `cahreceiptmaster` with `cahreceiptslave`/`cahreceiptsumslave` allocation. Distributes the master's total receipt money and rounding money across the matched slave invoice lines (ordered by remaining `dBalanceMoney`) so each line consumes only up to its outstanding balance, then rolls the per-condition slave totals back into the summary table. + +**What it does:** Sets `sCode=1`, `iFlag=0`, clears `sReturn`. Reads master `dTotalMoney`/`dRoundingMoney` into running counters. Opens a cursor over `cahreceiptslave` joined to `cahreceiptsumslave` by `sSqlConditionId`, ordered ascending by `dBalanceMoney`. For each slave row: if remaining `p_dTotalMoneySum > ABS(dBalanceMoney)`, subtracts the balance from the counter (the totalMoney UPDATE is commented out — only the running balance is tracked); otherwise zeros the counter. The rounding-money branch still writes: `UPDATE cahreceiptslave SET dRoundingMoney = ` to spread the rounding to fit each slave's balance. After the cursor, rolls per-condition `SUM(dTotalMoney)`/`SUM(dRoundingMoney)` back into `cahreceiptsumslave`. Finally calls `Sp_afterSave_sRcts`. The 超额生成新单据 branch (creating a new `cahreceiptmaster` for the overflow) is fully commented out. + +**Invocation:** Status: appears orphaned. No `gdsmodule` row binds this proc on `sSaveProName`/`sSaveProNameBefore`; the peer `Sp_Calc_sRcts` is also unbound. No other routine references it. xly-src ships `script/标版/30100101/Sp_Check_sRcts.sql` as the install body — the script is in the codebase but no 收款单(汇总) form-master row currently wires it — candidate for maintainer audit (the family is set up but disabled). diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sRgd.md b/en/docs/auto-catalog/procedures/Sp_Check_sRgd.md index c9c4da7..3410028 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sRgd.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sRgd.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售送货流程 → 新增销售退货 — post-save validator on `salrejectgoodsmaster`/`salrejectgoodsslave` (`sRgd` = sales-reject-goods despite the comment calling out 材料销售退货). Two business rules: deny duplicate 红冲 submissions for the same source bill, and forbid mixing different `sSlaveType` (退货类型) within one return note. Also bridges to `Sp_Check_dOraQtyTs` for over-quantity guard. + +**What it does:** Sets `sCode=1`, `iFlag=0`, clears `sReturn`. Reads `pitproductrejectmaster.sMinusSrcId` (red-charge source). If set, joins original slave rows with summed reverse-charge `dProductQty` per `sMinusSrcSlaveId` (only against non-invalid masters) and aborts with `sCcprkHaveRedData` ("已存在红冲数据,不允许重复提交") when any imbalance survives. Then `SELECT COUNT(DISTINCT sSlaveType) FROM salrejectgoodsslave WHERE sParentId=sGuid` — if >1, aborts with `sReturnOrderCantDiffrentType` ("不同退货类型的退货申请单不能做在同一个退货单上"). Opens a cursor over `viw_salrejectgoods` (the large block of further per-slave 余数库 reconciliation and auto-inserting split rows is fully commented out). Calls `Sp_Check_dOraQtyTs('salrejectgoodsslave', 'dProductQty', ...)` for the family-shared over-qty check, then `Sp_afterSave_sRgd`. + +**Invocation:** Bound to `gdsmodule.sSaveProName` on `2/4 新增销售退货` (`11811781131121915179924871530`) — 销售管理 → 销售送货流程 (KPI流程操作菜单). Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. Pre-save peer is `Sp_beforeSave_sRgd`. xly-src ships `script/标版/30100101/Sp_Check_sRgd.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sScd.md b/en/docs/auto-catalog/procedures/Sp_Check_sScd.md index 01c2ebf..968659a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sScd.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sScd.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Inferred from the name and routine comment: 销售管理 → 长期合同 — placeholder post-save validator for the long-term-contract form pair (`长期合同单据` / `长期合同明细`, masters at sId `16033546780009409151975037702000` / `16033543010008296913785356518000`). The body is a no-op stub that delegates to `Sp_afterSave_sScd` and returns immediately. + +**What it does:** Initialises `sCode=1`, defaults `iFlag` to 0, clears `sReturn`, opens an empty `top:` block, and calls `Sp_afterSave_sScd(sGuid, sBrId, sSuId, sCode, sReturn)`. No table touch, no validation. + +**Invocation:** Status: appears orphaned. The peer `Sp_Calc_sScd` is bound on both 长期合同 modules' `sProcName`, but `Sp_Check_sScd` itself is not wired as `sSaveProName`/`sSaveProNameBefore` on any module. No other routine references it, no `xly-src` hit (no install script). Effectively a stub awaiting a rule — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sSck.md b/en/docs/auto-catalog/procedures/Sp_Check_sSck.md index 8869b4c..d9ce590 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sSck.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sSck.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售送货流程 → 销售对账&开票 — post-save validator on `salsalescheckingmaster`/`salsalescheckingslave`/`salsalescheckingchild`. Ensures the reconciliation qty (`dProductQty`+`dGiveQty`) on each line does not exceed the corresponding 送货单 (delivery note) qty, then recomputes the per-line money columns from the foreign-currency total at the configured precision. + +**What it does:** Sets `sCode=1`, `iFlag=0`, clears `sReturn`. Reads `NetMoney`/`NetPrice` precisions. When `sFormGuid` is set, opens a cursor over `salsalescheckingslave` rows for `sParentId=sGuid`. For each row with a non-empty `sSrcSlaveId`: aggregates summed `dProductQty+dGiveQty` per `sSrcSlaveId` and joins to `SalDeliverGoodsSlave` — if the summed reconciliation qty exceeds the delivery qty (`Q.dProductQty + Q.dGiveQty`), aborts with concatenated `对账数量已超过送货单数量;` plus the offending bill number. A symmetric overrun guard runs again against the quotation/order qty (the same group concat / count idiom). Then recomputes `dProductMoney = ROUND(dProductForeignMoney * dCurrencyRate, p_NetMoney)`, `dProductNoTaxMoney = ROUND(dProductMoney / (1 + dRate/100), p_NetMoney)`, `dProductTaxMoney = dProductMoney - dProductNoTaxMoney` per row and writes them back via a dynamic `UPDATE salsalescheckingslave`. Finally calls `Sp_afterSave_sSck`. + +**Invocation:** Bound to `gdsmodule.sSaveProName` on `销售对账单据` (`11811781131121915184849572550`) — 销售管理 → 销售送货流程 (KPI流程操作菜单). Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. Pre-save peer is `Sp_beforeSave_sSck`. xly-src ships `script/标版/30100101/Sp_Check_sSck.sql` as the install body. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sScr.md b/en/docs/auto-catalog/procedures/Sp_Check_sScr.md index 4b5ee0b..e2e9e3a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sScr.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sScr.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Inferred from the name and routine comment: 物流管理 → 10.物流单据 → 派车单 — would-be post-save validator on `salsendcarmaster`/`salsendcarslave`. Caps each dispatch line's quantity against the originating 送货单 line, so a single 派车单 cannot over-allocate against the source delivery. + +**What it does:** Sets `sCode=1`, `iFlag=0`, clears `sReturn`. Reads `NetMoney`/`NetPrice` precisions (unused — template scaffolding). When `sFormGuid` is set, opens a cursor over `salsendcarslave` rows for `sParentId=sGuid`. For each row with a non-empty `sSrcSlaveId`, joins to `saldelivergoodsslave` (source 送货单 line) and the summed `dProductQty` from `salsendcarslave` (non-invalid masters only) and `eleproduct`, computing `(Q.dProductQty - SUM(S.dProductQty))`. When the result is negative, concatenates either `sProductInPcd` ("产品名称在当前派车单中") or `sProductInPcdNo` ("产品名称在派车单中,单号") with `sScrDeliveryQtyUpProduct` ("送货数已超过产品数量") into `sReturn`. Sets `sCode=-1` and exits if `sReturn` is non-empty, otherwise calls `Sp_afterSave_sScr`. + +**Invocation:** Status: appears orphaned. The module `派车单单据` (`15839936170002427227633635401000`, 物流管理 → 10.物流单据) binds `Sp_Calc_sScr` on `sProcName`, but `Sp_Check_sScr` itself is not wired as `sSaveProName`/`sSaveProNameBefore` on that module or any other. No other routine references it. xly-src ships `script/标版/30100101/Sp_Check_sScr.sql` as the install body — the script is in the codebase but the hook is unbound — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sSdp.md b/en/docs/auto-catalog/procedures/Sp_Check_sSdp.md index 04772c7..476298e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sSdp.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sSdp.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Inferred from the name and routine comment: PLM管理 → PLM单据 → 开发计划 / 印前任务计划 / 项目立项 — placeholder post-save validator for the project/development-planning form family. The body is a no-op stub that delegates to `Sp_afterSave_sSdp` and returns immediately. + +**What it does:** Initialises `sCode=1`, defaults `iFlag` to 0, clears `sReturn`, opens an empty `top:` block, and calls `Sp_afterSave_sSdp(sGuid, sBrId, sSuId, sCode, sReturn)`. No table touch, no validation. + +**Invocation:** Status: appears orphaned. The peer `Sp_Calc_sSdp` is bound on `开发计划` (`101251240115016044841089590`), `印前任务计划` (`101251240115016054411974580`) and `项目立项单据` (`101251240115016147549171140`) — all under PLM管理 → PLM单据 — via `sProcName`, but `Sp_Check_sSdp` itself is not wired as `sSaveProName`/`sSaveProNameBefore` on any of them. No other routine references it, no `xly-src` hit (no install script). Effectively a stub awaiting a rule — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sSfu.md b/en/docs/auto-catalog/procedures/Sp_Check_sSfu.md index 8f8f274..7e1cbd1 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sSfu.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sSfu.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Inferred from the name and routine comment: 销售管理 → 销售单据 → 商机跟进 — placeholder post-save validator for the opportunity-follow-up form (`商机跟进单据`, sId `101251240115016035948853880`). The body is a no-op stub that delegates to `Sp_afterSave_sSfu` and returns immediately. + +**What it does:** Initialises `sCode=1`, defaults `iFlag` to 0, clears `sReturn`. After a block of local-variable declarations (left-over scaffolding from the family template — billno/srcId/etc., all unused), calls `Sp_afterSave_sSfu(sGuid, sBrId, sSuId, sCode, sReturn)` and flips `sCode=-1` if it returns a message. + +**Invocation:** Status: appears orphaned. The peer `Sp_Calc_sSfu` is bound on `商机跟进单据` via `sProcName`, but `Sp_Check_sSfu` itself is not wired as `sSaveProName`/`sSaveProNameBefore` on that module or any other. No other routine references it. xly-src ships `script/标版/30100101/Sp_Check_sSfu.sql` as the install body — the script is in the codebase but the hook is not bound — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sSiv.md b/en/docs/auto-catalog/procedures/Sp_Check_sSiv.md index c31844b..4ab1888 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sSiv.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sSiv.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售送货流程 → 销售发票单据 — post-save validator on `salsalesinvoicemaster`/`salsalesinvoiceslave`. Enforces that one invoice cannot mix 材料销售 (CLDD-prefixed) and 成品销售 orders, classifies `sBussinessType` from the source order, recomputes 不含税/税额 from `sistax`, converts foreign-currency totals via `siscurrency`, and re-derives `tGetPayDate` from the customer's 收款条件 (`sispayment.iAfterDeliverDay`). + +**What it does:** Counts distinct `sFormId` across the slave's source orders — aborts with `sMaterialSaleProductCantInvoice` if >1. Updates `sBussinessType` based on `sOrderNo` prefix, rewrites slave `dProductNoTaxMoney`/`dProductTaxMoney` via `sistax.dRate`, recomputes `dProductMoney` from qty×price when drift >0.1, copies `sBillType` from `salsalesorderslave`, refreshes `dProductForeignMoney` from `dCurrencyRate`. On form `1691254111217011538642820` (manual-entry variant) cross-checks `dTotalMoney = dProductNoTaxMoney + dProductTaxMoney` per slave and aborts with `sProductTaxNotSame` if any product mismatches. Computes `tGetPayDate = tInvoiceDate + sispayment.iAfterDeliverDay`. Recomputes `dRemainderQty`/`dCostQty` for partial returns. When `bAdvance=1`, derives master 税额/不含税/外币 from `dAdvanceMoney`. Builds a temp table to validate that total invoiced qty per `sSrcSlaveId` does not exceed the upstream 对账 qty (`salsalescheckingslave`). + +**Invocation:** Bound to `gdsmodule.sSaveProName` on `销售发票单据` (sId `15780358080007074056281633539000`) — 销售管理 → 销售送货流程 (KPI流程操作菜单). Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. Pre-save peer is `Sp_beforeSave_sSiv`. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sSmi.md b/en/docs/auto-catalog/procedures/Sp_Check_sSmi.md index f144548..46eda91 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sSmi.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sSmi.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 半成品入库 (semi-goods inbound) post-save validator on `sgdsemigoodsinstoremaster`/`sgdsemigoodsinstoreslave`. Two-part enforcement: (1) 红冲 (red-strike reversal) entries must net to zero against the source bill, and (2) the inbound qty per `sSrcSlaveId` cannot exceed the upstream 半成品入库申请 (`sgdsemigoodsinstoreapplyslave.dProcessQty`). + +**What it does:** Sets defaults. Reads `sMinusSrcId` from the master; if set, sums all linked reversal-slave `dProcessQty` against the original — non-zero net triggers `sCcprkHaveRedData` ("已存在红冲数据,不允许重复提交"). Opens a cursor over slave rows; for each `sSrcSlaveId` joins `sgdsemigoodsinstoreapplyslave` and accumulates over-quantity with bill numbers, emits localized `sSmiProductNameInBcp[Order]` + `sSmiQtyUpApply` ("数量已超过申请数量") on overage. Aborts with `sCode=-1` if `sReturn` non-empty, otherwise chains `Sp_afterSave_sSmi`. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName`/`sSaveProNameBefore` hook, no `gdsconfigformmaster` binding, no other-routine caller in the live DB. The matching `Sp_beforeSave_sSmi`, `Sp_afterSave_sSmi`, `Sp_Calc_sSmi` siblings are all present (full family registered) and xly-src ships `script/标版/30100101/Sp_Check_sSmi.sql` as the install body — likely a 半成品入库 module wired only in deployments where the semi-goods workflow is enabled. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sSmia.md b/en/docs/auto-catalog/procedures/Sp_Check_sSmia.md index ccb46c5..3625cc9 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sSmia.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sSmia.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 半成品入库申请 (semi-goods inbound application) post-save validator on `sgdsemigoodsinstoreapplymaster`/`sgdsemigoodsinstoreapplyslave`. The proc's stored `COMMENT` (`'生产工单单据保存之前数据校验'`) is a copy-paste from the sWod template — the real body operates on the inbound-apply tables and joins `mftworkorderprocess` to cap the apply qty by the work-order's per-process plan. + +**What it does:** Iterates a cursor over the apply slave rows. For each row with non-empty `sSrcSlaveId`, joins `mftworkorderprocess` and sums the existing applied `dProcessQty` against the work-order's `dProcessQty`; over-quantity produces `sSmiaQtyUpWorkOrderQty` ("申请数量已超过工单数量") combined with the offending product name and either `sProductInHalfGoods` (single bill) or `sProductInHalfGoodsNo` (multiple bills) localizers. Aborts with `sCode=-1` if `sReturn` non-empty, otherwise chains `Sp_afterSave_sSmia`. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName` hook, no `gdsconfigformmaster` binding, no other-routine caller. Family siblings `Sp_beforeSave_sSmia`, `Sp_afterSave_sSmia`, `Sp_Calc_sSmia` all exist in the live DB. Candidate for maintainer audit on which deployments wire the 半成品入库申请 module to this validator. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sSmo.md b/en/docs/auto-catalog/procedures/Sp_Check_sSmo.md index 825e986..5765d5f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sSmo.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sSmo.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 半成品出库 (semi-goods outbound) post-save validator on `sgdsemigoodsoutstoremaster`/`sgdsemigoodsoutstoreslave`. Mirror of `Sp_Check_sSmi`: enforces 红冲 netting against the source bill, then caps the outbound qty per `sSrcSlaveId` by the upstream 半成品出库申请 (`sgdsemigoodsoutstoreapplyslave.dProcessQty`). + +**What it does:** Reads `sMinusSrcId`; if set, sums all linked reversal-slave `dProcessQty` and aborts with `sCcprkHaveRedData` ("已存在红冲数据,不允许重复提交") on non-zero net. Opens a cursor over slave rows; for each `sSrcSlaveId` joins `sgdsemigoodsoutstoreapplyslave` and accumulates the over-quantity with bill numbers, emits `sProductInBcpOut`/`sProductInBcpOutNo` plus `sQuantityShippedExceed` ("出库数量已超过申请数量") on overage. Aborts with `sCode=-1` if `sReturn` non-empty, otherwise chains `Sp_afterSave_sSmo`. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName` hook, no `gdsconfigformmaster` binding, no other-routine caller. Family siblings `Sp_beforeSave_sSmo`, `Sp_afterSave_sSmo`, `Sp_Calc_sSmo` all exist (full family registered) and xly-src ships `script/标版/30100101/Sp_Check_sSmo.sql` as the install body. Candidate for maintainer audit on whether any tenant still uses the 半成品出库 module. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sSmoa.md b/en/docs/auto-catalog/procedures/Sp_Check_sSmoa.md index c42a68b..85bb5a5 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sSmoa.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sSmoa.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 半成品出库申请 (semi-goods outbound application) post-save validator on `sgdsemigoodsoutstoreapplymaster`/`sgdsemigoodsoutstoreapplyslave`. Mirror of `Sp_Check_sSmia`: caps the outbound-apply qty per `sSrcSlaveId` by the work-order's per-process plan (`mftworkorderprocess.dProcessQty`). + +**What it does:** Iterates a cursor over the apply slave rows. For each row with non-empty `sSrcSlaveId`, joins `mftworkorderprocess` and sums the existing applied `dProcessQty` against the work-order's `dProcessQty`; over-quantity produces `sSmiaQtyUpWorkOrderQty` ("申请数量已超过工单数量") combined with the product name and either `sProductInHalfOutStore` (single bill) or `sProductInHalfOutStoreNo` (multiple bills) localizers. Aborts with `sCode=-1` if `sReturn` non-empty, otherwise chains `Sp_afterSave_sSmoa`. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName` hook, no `gdsconfigformmaster` binding, no other-routine caller. Family siblings `Sp_afterSave_sSmoa`, `Sp_Calc_sSmoa` exist (no `Sp_beforeSave_sSmoa`). Candidate for maintainer audit on which deployments wire the 半成品出库申请 module to this validator. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sSod.md b/en/docs/auto-catalog/procedures/Sp_Check_sSod.md index ed2ccd2..9d2a2b6 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sSod.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sSod.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 订单生产流程 → 1/3 新增销售订单 / 1/3 新增轮转销售订单 — post-save validator on `salsalesordermaster`/`salsalesorderslave`. Caps the order qty per source quotation slave (`quoquotationslave.dProductQty`), then re-derives money fields per row from foreign-currency × exchange rate, recomputing 不含税金额, 税额 and 净价 (`dNProductMoney`/`dNProductPrice`) after subtracting 打样费/版费/刀模费 (`dProofingMoney`/`dPlateMoney`/`dKnifeMouldMoney`). + +**What it does:** Reads `NetMoney`/`NetPrice` precisions and the master `dCurrencyRate`. Opens a cursor over `salsalesorderslave` joined on `sistax`. For each slave with a non-empty `sSrcSlaveId`, joins `quoquotationslave` and emits `sOrderQtyUpQuo` ("订单数已超过报价数量") with the offending product + bill numbers when the cumulative ordered qty exceeds the quotation qty. Then for every row: recomputes `dProductMoney = dProductForeignMoney * dCurrencyRate` (rounded to `p_NetMoney`), `dProductPrice = dProductMoney / dProductQty`, `dNProductMoney = dProductMoney - dProofingMoney - dPlateMoney - dKnifeMouldMoney`, `dNProductPrice = dNProductMoney / dProductQty`, `dProductNoTaxMoney = dProductMoney / (1 + dRate/100)`, `dProductTaxMoney = dProductMoney - dProductNoTaxMoney`. Builds a dynamic `Update salsalesorderslave` statement per row to persist the recalculated fields. + +**Invocation:** Bound to `gdsmodule.sSaveProName` on `1/3 新增销售订单` (sId `101251240115016086186007360`) and `1/3 新增轮转销售订单` (sId `101251240115015878710737470`) — 订单生产流程 (KPI流程操作菜单). Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. Additionally re-invoked by `Sp_SalSalesOrder_CheckUpdate` (the 销售订单保存插入工艺卡 chain) so the recalculations stay in sync when the 工艺卡 generator runs. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sSodbecome.md b/en/docs/auto-catalog/procedures/Sp_Check_sSodbecome.md index b620144..b8e2273 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sSodbecome.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sSodbecome.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 订单变更单据 (sales-order change) post-save validator on `salsalesorderbecomemaster`/`salsalesorderbecomeslave`. Cross-checks the chosen 变更类型 (`iBecome`: 0=订单取消, 1=数量变更, 2=数量单价同时变更, 3=单价变更) and 取消子类型 (`iCancel`: 0/1/2/3/4 — controls cost responsibility) against what has already happened on the original order — purchases, work orders, outsourced ops, deliveries, material applications — and refuses combinations that would orphan downstream documents. + +**What it does:** Reads `iBecome`/`iCancel` from `salsalesorderbecomemaster`. Aborts with `sTypeNeedCancel` when both are non-zero. For `iBecome=0` (order cancel) + `iCancel=1` (取消-无成本), counts existing rows in `purpurchaseorderdetail`, `mftworkorderslave`, `opsoutsideprocessmaster` (both `192116810113315234963208090` 外购 and `101801153119616594919790770` 工序发外 forms), and `mitproductionapplymaster` joined back via `salsalesorderbecomeslave.sOrderSlaveId`; any hit triggers `sOrderAlreadyPurchased`/`sOrderHaveWorkOrder`/`sOrderHaveWg`/`sOrderHaveFw`/`sOrderHaveLl`. `iCancel=2` checks `saldelivergoodsslave` (`sOrderHaveDelivery`). `iCancel=3` (半成品收费) requires non-zero price and matching qty (`sCancelCost`). `iCancel=4` (质量事故) requires `sSlaveAccidentNo` set (`sCanelNeedQualityNo`). `iBecome=1` requires non-zero qty and untouched price (`sChangeQtyNotZero`). `iBecome=2` requires both non-zero (`sChangePriceNotZero`). `iBecome=3` requires non-zero price and untouched qty (`sChangeProductPriceNotZero`). + +**Invocation:** Status: appears orphaned. The module `订单变更单据` (sId `101251240115016233151134120`) is bound to `Sp_Calc_sOrderBgd` for audit but has no `sSaveProName`/`sSaveProNameBefore` hook in the current DB snapshot. No form-master or other-routine caller found. xly-src ships no `Sp_Check_sSodbecome.sql` either. Candidate for maintainer audit on whether the validator was deprecated when the 订单变更 workflow moved to `Sp_Calc_sOrderBgd`. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sStl.md b/en/docs/auto-catalog/procedures/Sp_Check_sStl.md index dc91a17..40f258a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sStl.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sStl.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Empty stub for the `Sp_Check_s` post-save-validator family. The proc declares the standard 9-parameter signature with `COMMENT '保存之前数据校验'` and a `top:BEGIN ... END;` block but contains no logic — it sets `sCode=1`, `sReturn=''` and returns. + +**What it does:** Nothing — placeholder body. Likely scaffolded for a future 销售提单/结算 (sStl = Sal-Settlement?) module that was never implemented, or generated by the system-administration "create new Save validator" template. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName`/`sSaveProNameBefore` hook, no `gdsconfigformmaster` binding, no other-routine caller, no xly-src reference. Safe to ignore but a candidate for cleanup. The fact that the proc exists at all (and follows the standard signature) suggests the developer reserved the slot then never filled it. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sUdf.md b/en/docs/auto-catalog/procedures/Sp_Check_sUdf.md index 4fdf525..9fe9b6e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sUdf.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sUdf.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务凭证单据 (accounting voucher) post-save validator on `udfvouchermaster`/`udfvoucherslave`. Enforces three accounting rules — (1) 费用类科目 (`sAccountNo` `6601`/`6602`) entries must have both 部门 (`sFflex5`) and 费用科目代码 (`sFflex9`) set, (2) total debit (`dDebitMoney`) must equal total credit (`dCreditMoney`) per voucher, (3) the assistant-accounting expense code (`sFflex9`) must contain the row's `sAccountNo` — then post-processes the voucher (fills 部门第三方编号, derives `sVoucherType`/`iVoucherYear`/`iVoucherMonth`/`iEntryNumber`, assigns the next `sVoucherNo`). + +**What it does:** Sets `sCode=1`. Aborts (without LEAVE — the proc continues so multiple errors can accumulate the same `sReturn`) with `sExpenseNeedDepartAndCode` on expense rows missing dept/code, with `sDebitBp` on unbalanced totals, with `sFzhsNoInThis` on mismatched assistant accounts. Joins `udfvoucherslave` to `sissubject` to refresh `sFflex5` from the dept's `sThirdNo`. Defaults empty `sVoucherType` to '记'. Updates `iVoucherMonth`/`iVoucherYear` from `tVoucherDate`. Refreshes `iEntryNumber` to the actual slave row count. Calls `SP_Sis_GetMaxNo('udfVoucherMaster', ..., '15928127560001382627511178461700', ..., '{"tVoucherDate":""}', ...)` to fetch the next sequence number and applies it to empty `sVoucherNo`, also stamping `tVoucherDate=NOW()`. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName`/`sSaveProNameBefore` hook on `财务凭证单据` (sId `15928127560001382627511178461700`) or any other 凭证 module in the current DB snapshot, no form-master binding, no other-routine caller, no xly-src reference. Candidate for maintainer audit on whether the 凭证 save path bypasses validators or wires this differently (the `SP_Sis_GetMaxNo` call inside hard-codes the form sId so the proc is clearly intended for that module). diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sWare.md b/en/docs/auto-catalog/procedures/Sp_Check_sWare.md index 96a0dcb..9873552 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sWare.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sWare.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础设置 → 仓库与库位 → 仓库设置 — empty stub for the warehouse-master delete validator. The proc declares the standard 9-parameter signature with `COMMENT '仓库校验'` and a `top:BEGIN ... END;` block but contains no logic — it sets `sCode=1`, `sReturn=''` and returns. + +**What it does:** Nothing — placeholder body. Was scaffolded as the pre-delete check for the `siswarehouse` (or equivalent) master but never filled in, so delete operations on 仓库设置 proceed unconditionally through this hook. + +**Invocation:** Bound to `gdsmodule.sDeleteProName` on `仓库设置` (sId `192116810113315228291507110`) — 基础设置 → 仓库与库位. Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sDeleteProName")` (via the `Sp_delete_backwriting` chain) before the delete batch commits. Because the body is empty, the hook is effectively a no-op. Candidate for maintainer audit on whether validation logic (e.g., refusing to delete a warehouse with stock) belongs here. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sWod.md b/en/docs/auto-catalog/procedures/Sp_Check_sWod.md index 6c5092e..59bb8f1 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sWod.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sWod.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 订单生产流程 → 轮转工单 / 生产工单 / 2/3 新增生产补单 — heavyweight post-save validator on `mftworkordermaster`/`mftworkorderslave`/`mftworkordermaterials`/`mftworkorderprocess`. Refuses saves that would leave the work order in an inconsistent state with already-issued purchase orders, material applications or production reports, then re-derives money fields across the slave rows the same way `Sp_Check_sSod` does for sales orders. + +**What it does:** Refuses save with `sMaterialQtyZero` when any `mftworkordermaterials.dMaterialsKQty=0`; with `sProcessScZero` when any `mftworkorderprocess.dProcessQty=0`; with `sMaterialPurDeleted` when a `purpurchaseorderdetail` row still references a material the work order has since dropped (`A.sSrcSlaveId not in (Select sId From mftworkordermaterials …)`); with `sMaterialLlsq` when the reduced material qty drops below the already-applied `viw_mitproductionapply` qty (form `101251240115016056026128440` 领料申请); with `sMaterialPurCantChange` when a row that has been purchased now disagrees with `purpurchaseorderdetail.sMaterialsStyle`/`sMaterialsId`. Then reads `NetMoney`/`NetPrice`, opens a cursor over the slave rows and runs the same per-row money recalc as `Sp_Check_sSod` — recomputing `dProductMoney`/`dProductPrice`/`dNProductMoney`/`dNProductPrice`/`dProductNoTaxMoney`/`dProductTaxMoney` from foreign currency × `dCurrencyRate` minus 打样/版/刀模 surcharges. + +**Invocation:** Bound to `gdsmodule.sSaveProName` on three modules — `轮转工单` (sId `101251240115015840916341460`), `生产工单` (sId `101251240115016002469445380`), and `2/3 新增生产补单` (sId `101251240115016098136660960`) — all under 订单生产流程 (KPI流程操作菜单). Dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` after the save batch commits. xly-src ships `script/标版/30100101/Sp_Check_sWod.sql` as the install body. `sGuid` is declared `LONGTEXT` (not the usual `varchar(100)`) because the dispatcher passes multi-row save batches concatenated. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sYstb.md b/en/docs/auto-catalog/procedures/Sp_Check_sYstb.md index d5930d6..a8ff70d 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sYstb.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sYstb.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 预算填报 (departmental budget entry) post-save validator on `departmentalBudgetMaster`. Enforces uniqueness — one department may only file one budget bill per calendar year — so a second 填报 attempt for the same `sDepartId` + `sYear` is rejected. + +**What it does:** Reads `NetMoney`/`NetPrice` precisions (declared but unused after the existence check). Pulls `sYear`, `DATE_FORMAT(tCreateDate,'%m')` and `sDepartId` from the current `departmentalBudgetMaster` into local vars. Aborts with `sDepartCompleteBudget` ("该部门已填写今年的预算填报单,请重新检查后输入") if any other `departmentalBudgetMaster` row exists for the same year+department under the same brand/subsidiary. The chained `Sp_afterSave_sDgn` call at the end is commented out. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName`/`sSaveProNameBefore` hook on any 预算 module in the current DB snapshot (the only matching module — `年度费用预算KPI设定(暂不开放)`, sId `16310732640001916514361957702100` — is explicitly marked 暂不开放 "not yet open"), no form-master binding, no other-routine caller, no xly-src reference. The 预算填报 feature itself appears to be staged but not yet wired into the live UI. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sYstz.md b/en/docs/auto-catalog/procedures/Sp_Check_sYstz.md index 11c7210..7277f31 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sYstz.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sYstz.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 预算调整 (budget adjustment) post-save validator on `budgetAdjustmentCheckMaster`/`budgetadjustmentcheckslave`. Enforces three budget-arithmetic rules: (1) the 调整前细项 ("from" line item) must have enough year-to-date remaining budget in the matching `departmentalBudgetMaster` to cover the adjustment amount for the current month; (2) the 调整前细项 must actually exist in the approved `departmentalBudgetslave` for that dept/year; (3) the 调整后细项 ("to" line item) for a 新增 adjustment must NOT already exist in the approved budget (avoid duplicate line creation). + +**What it does:** Reads `NetMoney`/`NetPrice`, then resolves `sYear`/`sMonth`/`sMasterDepartId` from the current `budgetAdjustmentCheckMaster`. Joins each slave row to `departmentalBudgetslave` (filtered by approved master `bCheck=1`, matching dept and year) and computes the running 累计预算 through the current month minus `dSumUseMoney`; rows where this remainder is less than `A.dMaterialsMoney` are concatenated into `p_sBeforeExpenseDetail` and reported with `sAgainSelectDetail` ("所剩余额不足本单据调整金额"). For `iAdjustmentType=1` (新增-type adjustments), checks both that the 调整前 detail exists in the approved budget (`sBeforeExpenseDetail` not found → `sAgainSelectDetail`) and that the 调整后 detail is NOT already there. Each branch aborts with `sCode=-1` if its check fails. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName`/`sSaveProNameBefore` hook in the current DB snapshot, no form-master binding, no other-routine caller, no xly-src reference. As with `Sp_Check_sYstb` and `Sp_Check_sYzfy`, the 预算 (budget) module family is staged but not wired into the live UI — the only 预算 module in `gdsmodule` is the disabled `年度费用预算KPI设定(暂不开放)`. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Check_sYzfy.md b/en/docs/auto-catalog/procedures/Sp_Check_sYzfy.md index e7052b9..ecaaefe 100644 --- a/en/docs/auto-catalog/procedures/Sp_Check_sYzfy.md +++ b/en/docs/auto-catalog/procedures/Sp_Check_sYzfy.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 预支费用 (advance-cost claim) post-save validator on `advanceCostCheckMaster`/`advanceCostCheckslave`. Recomputes the remaining budget (`dLimit`) and the full-year budget (`dBudgetYearAmount`) for each claim line by joining `departmentalBudgetslave` of the approved `departmentalbudgetmaster` for the claim's dept + year, then computing the cumulative monthly budget through the current month minus `dSumUseMoney`. + +**What it does:** Reads `NetMoney`/`NetPrice`, resolves `sYear`/`sMonth`/`sMasterDepartId` from `advanceCostCheckMaster`. Zeroes `dLimit` and `dBudgetYearAmount` on all slave rows. Re-updates them by joining `departmentalBudgetslave` (filtered by the dept's approved budget master, matching `sExpenseDetailId`) — sets `dLimit` to the running `dJanuaryBudget+...+dBudget - dSumUseMoney` matching the master's month (via a 12-branch CASE), and `dBudgetYearAmount` to the corresponding cumulative. Acts as a refresh-only hook — no abort branch on overspend is wired in the snapshot, so the proc never actually rejects a claim. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName`/`sSaveProNameBefore` hook in the current DB snapshot, no form-master binding, no other-routine caller, no xly-src reference. The 预算 (budget) module family is staged but not wired into the live UI — the only 预算 module in `gdsmodule` is `年度费用预算KPI设定(暂不开放)` (marked "not yet open"). Candidate for maintainer audit on whether 预支费用 was meant to ship alongside `Sp_Check_sYstb` and `Sp_Check_sYstz`. diff --git a/en/docs/auto-catalog/procedures/Sp_ChooseSupply.md b/en/docs/auto-catalog/procedures/Sp_ChooseSupply.md index 23a2a38..8b35ee0 100644 --- a/en/docs/auto-catalog/procedures/Sp_ChooseSupply.md +++ b/en/docs/auto-catalog/procedures/Sp_ChooseSupply.md @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 选择供应商 (supplier picker) paged data source — enumerates the suppliers that have transacted in a given date window across `purpurchaseordermaster` (采购订单) and `opsoutsideprocessmaster` (外购/发外), then joins `elesupply` to surface name/no/type. Designed as the data provider for a 选择供应商 popup. The header comment notes "没有根据[系统设置]-- >[未对账印件清单来源]中的设置取相关单据" so the source-table set is hard-coded here rather than driven by `SysSystemSettings`. + +**What it does:** Defaults `tStartDate`/`tEndDate` to the current month if blank (`tEndDate` is exclusive — `+1 day` then `+1 month`). Parses `bFilter` (JSON → SQL via `Fun_bFilter_toWhere`). Creates temp table `TmpChooseSupply`. Inserts distinct `sSupplyId` from `purpurchaseordermaster` filtered by `tCreateDate` window + brand/subsidiary + filter; repeats the insert from `opsoutsideprocessmaster`. Joins `elesupply` to fill `sSupplyName`/`sSupplyNo`/`sSupplyType`. Finally selects the distinct page (`SELECT DISTINCT sId,sSlaveId,sSupplyId,sSupplyNo,sSupplyName,sSupplyType FROM TmpChooseSupply`). Note: the `pageNum`/`pageSize` parameters are accepted but the live `SELECT` does not apply `LIMIT` — `pageSize` is locally overridden to 500 and `p_sLimit` is built only for the temp-table insert, so the final result is capped at ~1000 rows regardless of the requested page. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName`/`sSaveProName` hook on `选择供应商` (sId `192116810113315232543913910`), no `gdsconfigformmaster` binding (the matching form-master uses a plain `select sId as sSlaveId,#sRelationAll# from elesupply`), no other-routine caller, no xly-src reference. The proc's signature matches the paged-report pattern (`pageNum`/`pageSize`/`totalCount`/`countMapJson`/`bFilter`) used by `Sp_Outstanding_Query` and friends, suggesting it is the data source for a custom 选择 popup that is wired in Java rather than via the standard form-master. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_CombinedOrderList_BtnEventGetOrder.md b/en/docs/auto-catalog/procedures/Sp_CombinedOrderList_BtnEventGetOrder.md index 324afd1..03ae84a 100644 --- a/en/docs/auto-catalog/procedures/Sp_CombinedOrderList_BtnEventGetOrder.md +++ b/en/docs/auto-catalog/procedures/Sp_CombinedOrderList_BtnEventGetOrder.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售订单 — operator "取单/定稿" (pick-up / lock) action on a 组合订单列表 (combined sales-order list) view. Marks one or more 销售订单 as currently being finalized by a specific person so other operators can see the row is locked. + +**What it does:** Validates `sProInParam` (a delimited list of `salsalesordermaster.sId` values, rejected with `Sp_Sis_GetConst('paramsErro', …)` when shorter than 5 chars). Then `UPDATE salsalesordermaster SET sRipTrue = '人工定稿中', sLockPerson = sMakePerson, bLock = 1 WHERE INSTR(sProInParam, sId) > 0` scoped by `sBrandsId`/`sSubsidiaryId`. Pair with `Sp_CombinedOrderList_BtnEventRestart` (release back to "未处理") and `Sp_CombinedOrderList_BtnEventRetGetOrder` (release lock without clearing status). + +**Invocation:** Dispatched generically by `GenericProcedureCallController.doGenericProcedureCall()` → `GenericProcedureCallServiceImpl` — i.e. the front-end button posts the proc name directly. Not bound through `gdsmodule.sProcName`, not referenced by any form-master. xly-src ships only the install script `script/标版/30100101/Sp_CombinedOrderList_BtnEventGetOrder.sql`; the calling button definition lives in the front-end (`xlyFront`), not in the database. diff --git a/en/docs/auto-catalog/procedures/Sp_CombinedOrderList_BtnEventRestart.md b/en/docs/auto-catalog/procedures/Sp_CombinedOrderList_BtnEventRestart.md index cd64dd5..208b41c 100644 --- a/en/docs/auto-catalog/procedures/Sp_CombinedOrderList_BtnEventRestart.md +++ b/en/docs/auto-catalog/procedures/Sp_CombinedOrderList_BtnEventRestart.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售订单 — operator "重新开始/还原" action on a 组合订单列表 view. Resets the finalize-progress flag on the chosen 销售订单 rows back to the "未处理" (untouched) state so the order can be re-picked. + +**What it does:** Validates `sProInParam` (delimited `salsalesordermaster.sId` list, returns `Sp_Sis_GetConst('paramsErro', …)` when shorter than 5 chars). Then `UPDATE salsalesordermaster SET sRipTrue = '未处理' WHERE INSTR(sProInParam, sId) > 0` scoped by `sBrandsId`/`sSubsidiaryId`. Note it leaves `bLock`/`sLockPerson` alone — pair with `Sp_CombinedOrderList_BtnEventRetGetOrder` to also release the lock. + +**Invocation:** Dispatched generically by `GenericProcedureCallController.doGenericProcedureCall()` → `GenericProcedureCallServiceImpl` — the front-end posts the proc name directly. No `gdsmodule` hook, no form-master binding. xly-src ships only the install script `script/标版/30100101/Sp_CombinedOrderList_BtnEventRestart.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_CombinedOrderList_BtnEventRetGetOrder.md b/en/docs/auto-catalog/procedures/Sp_CombinedOrderList_BtnEventRetGetOrder.md index f9c17b5..a649722 100644 --- a/en/docs/auto-catalog/procedures/Sp_CombinedOrderList_BtnEventRetGetOrder.md +++ b/en/docs/auto-catalog/procedures/Sp_CombinedOrderList_BtnEventRetGetOrder.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售订单 — operator "退单/解锁" action on a 组合订单列表 view. Releases the row-lock that `Sp_CombinedOrderList_BtnEventGetOrder` took so other operators can pick up the order again; the `sRipTrue` status is left untouched. + +**What it does:** Validates `sProInParam` (delimited `salsalesordermaster.sId` list, returns `Sp_Sis_GetConst('paramsErro', …)` when shorter than 5 chars). Then `UPDATE salsalesordermaster SET sLockPerson = '', bLock = 0 WHERE INSTR(sProInParam, sId) > 0` scoped by `sBrandsId`/`sSubsidiaryId`. + +**Invocation:** Dispatched generically by `GenericProcedureCallController.doGenericProcedureCall()` → `GenericProcedureCallServiceImpl` — the front-end posts the proc name directly. No `gdsmodule` hook, no form-master binding. xly-src ships only the install script `script/标版/30100101/Sp_CombinedOrderList_BtnEventRetGetOrder.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_ComematerialsInspection_BtnRepair.md b/en/docs/auto-catalog/procedures/Sp_ComematerialsInspection_BtnRepair.md index 2632d55..c93667f 100644 --- a/en/docs/auto-catalog/procedures/Sp_ComematerialsInspection_BtnRepair.md +++ b/en/docs/auto-catalog/procedures/Sp_ComematerialsInspection_BtnRepair.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量管理 → 采购进料检验(IQC) — "异常/不合格" button on the 来料检验 (incoming-materials inspection) list. Stamps the selected `qlycomematerialstestmaster` rows as failed inspection (`iTestResult = 2`) and writes the operator-provided exception memo onto each one, optionally merging in extra column changes from the same dialog. + +**What it does:** Validates JSON parameter `sProInParam` (rejected with `Sp_Sis_GetConst('paramsErro', …)` when shorter than 5 chars), then extracts `.params` (the selected-row list with `sId` values) and `.changeValue` (the column-change payload, including `textareaValue` for the exception memo and a `valueKey` list of extra columns to also update). For each `valueKey` it builds a `SET col = value, …` fragment, then unconditionally appends `iTestResult = 2, sExceptionMemo = `. For each selected row it `PREPARE`s a dynamic `UPDATE qlycomematerialstestmaster SET WHERE sId = '' AND sBrandsId = … AND sSubsidiaryId = …` and executes it. Builds the SQL via raw string concatenation — relies on the dialog producing pre-quoted JSON values, so any unescaped quote in the memo would break the prepared statement. + +**Invocation:** Dispatched generically by `GenericProcedureCallController.doGenericProcedureCall()` → `GenericProcedureCallServiceImpl` — the front-end "btnRepair" button posts the proc name with the JSON payload. No `gdsmodule` hook, no form-master binding, no other proc references this one, no install script ships in xly-src — the body lives only in the live DB. diff --git a/en/docs/auto-catalog/procedures/Sp_CommonList_BtnEventCheck.md b/en/docs/auto-catalog/procedures/Sp_CommonList_BtnEventCheck.md index 5b82b33..5ce7bc3 100644 --- a/en/docs/auto-catalog/procedures/Sp_CommonList_BtnEventCheck.md +++ b/en/docs/auto-catalog/procedures/Sp_CommonList_BtnEventCheck.md @@ -1,7 +1,7 @@ # `Sp_CommonList_BtnEventCheck` (procedure) -> @author:杨恒林 - @date:20210616 封存 +> @author:杨恒林 + @date:20210616 封存 @describe: 全月加权方式计算本期间的入库材料价格, (期初金额+入库金额)/(期初数量+入库数量), 材料存货核算界面 调用 @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本管理 → 材料存货核算 — whole-month weighted-average price recalc trigger. Body comment marks it as "封存" (sealed/archived since 20210616) — wraps `Sp_System_CalcMaterialsPrice` for the current open period so the materials-stock-accounting screen can refresh `(期初金额+入库金额)/(期初数量+入库数量)` averages on demand. + +**What it does:** Resolves the currently-open period from `sysaccountperiod` (the row whose `tStartDate ≤ now ≤ tEndDate` for the given brand/subsidiary), then `CALL Sp_System_CalcMaterialsPrice(p_tStart, p_tEnd, 0, ...)` and `CALL Sp_System_CalcMaterialsPrice(p_tStart, p_tEnd, 1, ...)` — once for material flow type 0 and once for type 1. No JSON-param processing despite the standard `sProInParam` signature. + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, `gdsconfigformmaster` reference, or other-routine caller; xly-src only ships the install script `script/标版/30100101/cost/Sp_CommonList_BtnEventCheck.sql`. Author comment explicitly marks it as sealed/封存 — replaced by direct calls to `Sp_System_CalcMaterialsPrice` from newer routines. Candidate for maintainer audit before deletion. diff --git a/en/docs/auto-catalog/procedures/Sp_Con_FormsReset.md b/en/docs/auto-catalog/procedures/Sp_Con_FormsReset.md index a99cd03..39cd40d 100644 --- a/en/docs/auto-catalog/procedures/Sp_Con_FormsReset.md +++ b/en/docs/auto-catalog/procedures/Sp_Con_FormsReset.md @@ -19,4 +19,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 系统平台 → 表单配置 — 配置还原 ("config restore") helper for a single parent form. Wipes the bill-check-result child config under a given parent form-guid and re-inserts the canonical 审批信息 (approval-info) layout — the same definition shipped with the standard form templates — so a damaged or customized approval-tab config can be reset on one form at a time. + +**What it does:** When `sFormGuid` is non-empty, `INSERT INTO gdsconfigformmaster` a fresh `sysbillcheckresult`-bound child row (table-type=`table`, the standard `biz_todo_item` × `biz_flow` join SQL that pulls audit info from the workflow engine), then `INSERT INTO gdsconfigformslave` a full set of column definitions (`sItemName`, `sNodeName`, `bView`, `bHandle`, `tToDate`, `tHandleDate`, etc.) under the new master. + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, `gdsconfigformmaster.sSqlStr` self-reference, or other-routine caller; xly-src only ships the install script `script/标版/30100101/Sp_Con_FormsReset.sql`. Per-form variant of `Sp_Con_Reset`; intended for maintenance/seeding (one-shot dev-tool), not normal runtime traffic. diff --git a/en/docs/auto-catalog/procedures/Sp_Con_Reset.md b/en/docs/auto-catalog/procedures/Sp_Con_Reset.md index 0bf00d0..7d4be68 100644 --- a/en/docs/auto-catalog/procedures/Sp_Con_Reset.md +++ b/en/docs/auto-catalog/procedures/Sp_Con_Reset.md @@ -17,4 +17,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 系统平台 → 表单配置 — 配置还原 ("config restore") for every approval-info config row in the tenant. Walks all `sysbillcheckresult`-bound `gdsconfigformmaster` rows under brand/subsidiary `1111111111/1111111111` and resets each one's `sSqlStr`/`sOrder`/slave columns back to the canonical 审批信息 layout, so a tenant-wide layout corruption can be undone in one shot. + +**What it does:** Counts the `gdsconfigformmaster` rows whose `sTbName='sysbillcheckresult'` for the hardcoded standard-tenant id, then cursors over each `sId`: `DELETE FROM gdsconfigformslave WHERE sParentId=p_sParentId`, `UPDATE gdsconfigformmaster` to restore the standard `biz_todo_item × biz_flow` data-source SQL, and `INSERT INTO gdsconfigformslave` the full canonical column set (`sItemName`, `sNodeName`, `bView`, `bHandle`, `tToDate`, `tHandleDate`, …). + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, `gdsconfigformmaster` reference, or other-routine caller; xly-src only ships the install script `script/标版/30100101/Sp_Con_Reset.sql`. Tenant-wide variant of `Sp_Con_FormsReset`; intended as a maintenance/seeding tool, not normal runtime traffic. diff --git a/en/docs/auto-catalog/procedures/Sp_Confirm_Zg.md b/en/docs/auto-catalog/procedures/Sp_Confirm_Zg.md index 6cc39ae..0cd8b2f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Confirm_Zg.md +++ b/en/docs/auto-catalog/procedures/Sp_Confirm_Zg.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售订单 — 主管确认:通过 ("supervisor confirm: approved") button handler on the sales-order list. Used when an order needs an extra in-line supervisor sign-off (separate from the formal 审核 workflow) — pushes the selected `salsalesordermaster` rows into the confirmed-by-supervisor state and notifies the original maker. + +**What it does:** Parses the `sProInParam` JSON envelope, refusing with `请选择数据` ("please select data") when empty. For each selected slave-id, looks up the matching `salsalesordermaster` row (joining `salsalesorderslave`) to resolve the maker, bill-no and master sId via `Fun_GetLoginUser`, then writes the confirmation flags onto the master and prepares the in-app message payload for the original maker. + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, `gdsconfigformmaster` reference, or other-routine caller; xly-src only ships the install script `script/标版/30100101/Sp_Confirm_Zg.sql` plus the symmetric `Sp_UnConfirm_Zg.sql`. Naming and signature match the `sp_btn_action*` dispatcher contract but no current binding was found. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_CopyTableToTable.md b/en/docs/auto-catalog/procedures/Sp_CopyTableToTable.md index 4d1987e..5a08717 100644 --- a/en/docs/auto-catalog/procedures/Sp_CopyTableToTable.md +++ b/en/docs/auto-catalog/procedures/Sp_CopyTableToTable.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 系统平台 → 数据维护工具 — generic "copy one table's rows into another table" helper. Aligns the column lists by name (only the columns that exist in both `sTableName` and `sSrcTableName` under schema `sDbName` are copied), so it can mirror data across upgraded or branched tables without breaking on schema drift. + +**What it does:** Counts columns of the target `sTableName` from `information_schema.COLUMNS`, opens a cursor over them, and for each column checks whether the same name exists on `sSrcTableName`; if so, appends it to `p_sColumnsList`. Then builds and `PREPARE`/`EXECUTE`s `INSERT INTO sTableName() SELECT FROM sSrcTableName`. No filter, no transaction — full table copy. + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, `gdsconfigformmaster` reference, or other-routine caller; xly-src only ships the install script `script/标版/30100101/Sp_CopyTableToTable.sql`. Generic data-tool intended to be called interactively during migrations/maintenance, not from runtime traffic. diff --git a/en/docs/auto-catalog/procedures/Sp_CostAccount_CostCarryForward.md b/en/docs/auto-catalog/procedures/Sp_CostAccount_CostCarryForward.md index 413b5cb..a11d3ec 100644 --- a/en/docs/auto-catalog/procedures/Sp_CostAccount_CostCarryForward.md +++ b/en/docs/auto-catalog/procedures/Sp_CostAccount_CostCarryForward.md @@ -34,4 +34,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本管理 → 成本结转 (cost carry-forward) — paged report listing each work-order/装配单 row with its accumulated cost figures for the chosen `sCostPeriod`. Despite the legacy `印刷机台汇总达成统计` COMMENT inherited from a sibling, the param shape (`sCostPeriod`, `sCustomerName`, `sWorkOrderNo`, brand/subsidiary, plus the full paging/group-by/count contract) is the standard report-proc signature for the cost carry-forward grid. + +**What it does:** Builds the dynamic show-column config via `Fun_get_show_config_basic`, then drops/recreates the temporary `Sp_CostCarryForward_Table` with the work-order cost shape (key fields, customer, expenses, qty/money columns). Populates it by joining `accordercostanalysis` against `elecostframe` for the selected period; assembles `p_sSqlSumZ`/`p_sSql` dynamic SQL and finally hands off to the standard pagination wrapper through `p_sSql` so the grid gets `totalCount` + `countMapJson`. + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, `gdsconfigformmaster.sSqlStr` binding, or other-routine caller; xly-src only ships the install script `script/标版/30100101/schedule/Sp_CostAccount_CostCarryForward.sql`. Signature matches the form-master report-proc contract used by report grids — likely intended as the 成本结转 grid data source but the form-master row is not present. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_CostAccount_WorkCenterToOperation.md b/en/docs/auto-catalog/procedures/Sp_CostAccount_WorkCenterToOperation.md index 5d6cdb1..6db733b 100644 --- a/en/docs/auto-catalog/procedures/Sp_CostAccount_WorkCenterToOperation.md +++ b/en/docs/auto-catalog/procedures/Sp_CostAccount_WorkCenterToOperation.md @@ -35,4 +35,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本管理 → 印刷机台汇总达成统计 (work-centre → operation cost roll-up) — paged report joining `accordercostanalysis` × `elecostframe` and rolling per-cost-frame columns onto each work-centre row for the chosen period, optionally filtered by customer, work-centre and work-order number. + +**What it does:** Builds the dynamic show-column config (`bConfirm`, `sWorkCenterName`, `sCostPeriod`, `sWorkOrderNo`, …) via `Fun_get_show_config_basic`, then drops/recreates `Sp_EquipmentOutput_Machine_Table` with one row per work-order × work-centre. Reads each cost frame from `elecostframe`, dynamically appends a money column for it via `p_sALTERSql`, populates rows from `accordercostanalysis` (filtered by `sCostPeriod`/`sCustomerName`/`sWorkCenterName`/`sWorkOrderNo`), and runs the per-cost-frame `p_sUpdate1Sql`/`p_sUpdate2Sql` updates that fan expense amounts onto the matching column. Final SELECT hands off to the standard pagination wrapper. + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, `gdsconfigformmaster.sSqlStr` binding, or other-routine caller; xly-src only ships the install script `script/标版/30100101/schedule/Sp_CostAccount_WorkCenterToOperation.sql`. Signature matches the form-master report-proc contract; presumably wired to a 印刷机台汇总 report screen but the binding row is absent. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_CostAccount_WorkCenterToOperation_Event.md b/en/docs/auto-catalog/procedures/Sp_CostAccount_WorkCenterToOperation_Event.md index 82407f2..088401e 100644 --- a/en/docs/auto-catalog/procedures/Sp_CostAccount_WorkCenterToOperation_Event.md +++ b/en/docs/auto-catalog/procedures/Sp_CostAccount_WorkCenterToOperation_Event.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本管理 → 印刷机台汇总达成统计 — "confirm" button-event sibling of `Sp_CostAccount_WorkCenterToOperation`. Promotes the period's confirmed `accordercostanalysis` rows into the persistent `accordercostanalysisoperation` table so the work-centre × operation totals are frozen and can be reported on later without re-running the full join. + +**What it does:** Pulls `sCostPeriod` out of `sProInParam` (validates with `Sp_Sis_GetConst('paramsErro', ...)`), deletes any prior `accordercostanalysisoperation` rows for that period, then `INSERT INTO accordercostanalysisoperation` from `accordercostanalysis` filtered by brand/subsidiary, `sCostPeriod`, `bConfirm=1` and `iType=2` (work-centre level). Then cursors over `elecostframe` and runs per-frame updates that fan each cost frame's amount onto the matching column of the just-inserted rows. + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, `gdsconfigformmaster` reference, other-routine caller, or xly-src hit. Signature matches the `sp_btn_action*` dispatcher contract — paired with the `_WorkCenterToOperation` report proc as its confirm/save button — but the binding row is absent. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Cost_CheckBusinessData.md b/en/docs/auto-catalog/procedures/Sp_Cost_CheckBusinessData.md index 2774b58..a81e9a1 100644 --- a/en/docs/auto-catalog/procedures/Sp_Cost_CheckBusinessData.md +++ b/en/docs/auto-catalog/procedures/Sp_Cost_CheckBusinessData.md @@ -1,7 +1,7 @@ # `Sp_Cost_CheckBusinessData` (procedure) -> @author:zhucx - @date:20210521 +> @author:zhucx + @date:20210521 @describe: @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本管理 → 期间账务 — pre-checks for the period-close cost flow. Refuses the selection (with localized errors via `Sp_Sis_GetConst`) when the chosen `sysaccountperiod` row is already frozen, when the param payload is malformed, or when the period window does not span "now" — and runs an `Sp_System_AccountSquareCheck` integrity probe when the period is closed but cost-square hasn't been run. + +**What it does:** Counts `sysaccountperiod` rows whose `sId` appears inside `sProInParam`, returning `selectedRowKeysNo` if zero; rejects payloads shorter than 13 chars with `paramsErro`; reads the picked period's `bFrozen`, `tStartDate`, `tEndDate` and aborts with `AlreadySettleAccounts` if already settled; finally calls `Sp_System_AccountSquareCheck(0, ...)` when the period sits in the past, surfacing any imbalance into `sReturn`/`sCode`. + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, `gdsconfigformmaster` reference, other-routine caller, or xly-src hit. Author tag (zhucx, 2021-05-21) and the standard `sp_btn_action*` signature suggest it was intended as a pre-flight button-event for the period-close screen but no current binding was found. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Cost_OrderCostAnalysis.md b/en/docs/auto-catalog/procedures/Sp_Cost_OrderCostAnalysis.md index ac0dcfa..d622746 100644 --- a/en/docs/auto-catalog/procedures/Sp_Cost_OrderCostAnalysis.md +++ b/en/docs/auto-catalog/procedures/Sp_Cost_OrderCostAnalysis.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本管理 → 订单成本分析 — order-level cost-analysis report builder. Aggregates a chosen period's product money totals and the cost-centre × expense-item matrix into a single dynamic SQL that feeds the 订单成本分析 dataset, including the prior-period snapshot when the current period is frozen. + +**What it does:** Reads the period sId out of `sProInParam`, resolves `tStartDate`/`tEndDate`/`bFrozen` from `sysaccountperiod`, accumulates the comma-joined cost-centre list and expense-item list, sums product money across the period, then assembles `p_sSql`/`p_sSumSql`/`p_sSumSqlBl*`/`p_sSetSql` dynamic SQL fragments that pivot expense rows into columns and write totals back into the order-cost-analysis tables. Uses `Sp_Sis_GetConst`-sourced material memos when materials cost cannot be confirmed. + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, `gdsconfigformmaster` reference, or other-routine caller; xly-src only ships the install script `script/标版/30100101/cost/Sp_Cost_OrderCostAnalysis.sql`. Naming and signature match the `sp_btn_action*` dispatcher contract — likely intended as the "刷新/重算" button handler for the 订单成本分析 screen but the binding row is absent. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTable.md b/en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTable.md index 13e4d59..dfad261 100644 --- a/en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTable.md +++ b/en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTable.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 排版/拼版 (printing imposition layout) — entry point of the 控版面名 (`sControlFaceName`) splitter. Parses a printer's signature/imposition string such as `A`, `A+B`, `A+B,C+D` or `1+2-9+10` into a row-per-signature temp table that downstream 排程/拼版 code reads when generating per-fold signature plans. + +**What it does:** Drops and recreates the `sControlFaceName_tmp` TEMPORARY TABLE (columns: `iIndex`, `sControlFaceNameNum`, `sControlFacesChar`, `sId`, `dSumPQtyBs`), normalises punctuation (`_`/`——` → `-`, `、`/`,` → `,`, `(`/`)` → `[`/`]`, drops the `贴` suffix, rewrites `+2P粘页` → `~2P粘页`), then branches on `p_iArrangeSrcValue` (3/4/2 take the multi-signature path) and delegates to `Sp_Create_sControlFaceNameTableOne`…`Five` for the `A`, `A,B`, `A+B`, `A+B-C+D`, `A+B,C+D` shapes, accumulating rows into `sControlFaceName_tmp`. + +**Invocation:** Called by `Sp_Create_sControlFaceNameTableFour` and `Sp_Manufacture_InsertMftPlanSlave` — i.e. it is the public entry point used during 制造计划 slave creation to materialise the signature breakdown for each plan row. diff --git a/en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableFive.md b/en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableFive.md index 2eef857..a8424d5 100644 --- a/en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableFive.md +++ b/en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableFive.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 排版/拼版 — case 5 of the 控版面名 (`sControlFaceName`) splitter: the compound shape `A+B-C+D` (印刷合版 with a numeric range, e.g. `1+2-9+10` or `2A+2B-31A+31B`). Body comment documents the rule: "1+2-9+10 拆成 1+2 3+4 5+6 7+8 9+10 合版印刷" — printed in groups of two; 印后 then unrolls each into the individual signatures. + +**What it does:** Guards on `INSTR(...,'-')>0 AND INSTR(...,'+')>0 AND INSTR(...,',')<1`. Resolves the title (from `Fn_split_string(..., ':', 1)` or `Fun_GetCh`, overridden by `p_sControlFacesTitleFirst` when set), then parses the four signature components (`p_sControlFaceNameTestOne`…`Four` numeric + `*Char` alpha-suffix), iterates the numeric range generating `p_sControlFacesStar` → `p_sControlFacesEnd` rows into `sControlFaceName_tmp`, and writes the produced row-count to `p_iOut`. + +**Invocation:** Called by `Sp_Create_sControlFaceNameTableThree` — itself a dispatch branch of `Sp_Create_sControlFaceNameTable` for the comma-separated shapes. diff --git a/en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableFour.md b/en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableFour.md index dc6034c..7d68e96 100644 --- a/en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableFour.md +++ b/en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableFour.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 排版/拼版 — case 4 of the 控版面名 (`sControlFaceName`) splitter: the "拥有加号" shape `A+B` (no `-`, no `,`). Branches on `p_iArrangeSrcValue=2` (折页/fold) vs other (印版付数/plate copies) so that fold signatures get one row per signature while plate-count cases get expanded by the leading number. + +**What it does:** Guards on `INSTR(...,'-')=0 AND INSTR(...,'+')>0 AND INSTR(...,',')=0`. Resolves the title-first override (`p_sControlFacesTitleFirst`) when set. For `p_iArrangeSrcValue=2`: parses the leading number with `Fun_GetNum(Fn_split_string(... , '+', 1))`, inserts one `sControlFaceName_tmp` row carrying `iIndex=p_i`, the concatenated title+`贴` label and a fresh `NewId()`, and returns that number via `p_iOut`. For other arrange-source values: loops `p_sControlFacesJhSum` times and emits one row per plate copy. + +**Invocation:** Called by `Sp_Create_sControlFaceNameTable` as one of its dispatch branches. diff --git a/en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableOne.md b/en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableOne.md index 04fc0b1..e1fd419 100644 --- a/en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableOne.md +++ b/en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableOne.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 排版/拼版 — case 1 of the 控版面名 (`sControlFaceName`) splitter: the simple single-signature shape `A` with no `+`, `-`, or `,`. Inserts a single canonical row into `sControlFaceName_tmp` so the downstream 制造计划 slave generator can iterate signatures uniformly even for the trivial case. + +**What it does:** Guards on `INSTR(p_sControlFaceName,'-')=0 AND INSTR(...,'+')=0 AND INSTR(...,',')=0`. Resolves the title-first override (`p_sControlFacesTitleFirst`) when supplied, applies `Fun_GetGb` for char-class normalisation via `Fn_split_string`/`Fn_spit_length`, then `INSERT INTO sControlFaceName_tmp(iIndex, sControlFacesChar, sId)` one row with the cleaned name plus a fresh `NewId()`, and copies `p_i` to `p_iOut`. + +**Invocation:** Called by `Sp_Create_sControlFaceNameTable` (the public entry point) as the first dispatch branch in the signature-shape ladder. diff --git a/en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableThree.md b/en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableThree.md index c8eaa42..7d663ae 100644 --- a/en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableThree.md +++ b/en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableThree.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产排程 → 印刷拼版/折页清单展开 — variant 3 of the `Sp_Create_sControlFaceNameTable` dispatcher family that materialises the temp table `sControlFaceName_tmp` from a 控面 (control-face) descriptor string. This variant handles the `【A+B-C+D】` pattern — a 合版 (gang-up) print spec where pairs of pages run together and 折页 splits them into separate 贴 entries. + +**What it does:** Parses `p_sControlFaceName` (e.g. `1+2-9+10`) into start/end + `+`-count, computes the per-iteration title (e.g. `贴` suffix logic via `Fun_GetGb`/`Fun_GetNum`/`Fn_split_string`), then loops inserting one row per 贴 into `sControlFaceName_tmp(iIndex, sControlFaceNameNum, sControlFacesChar, sId)`. Two branches: `p_iArrangeSrcValue=2` (折页) emits concatenated multi-page rows (`1+2`, `3+4`, ...); otherwise emits one row per individual page. Edge case: if the `+` pair before the `-` is symmetric (e.g. `2A+2B`), it delegates to `Sp_Create_sControlFaceNameTableFive` and leaves the loop. + +**Invocation:** Called by `Sp_Create_sControlFaceNameTable` (the dispatcher) when the control-face descriptor contains both `-` and `+` and no `,`. The dispatcher chain is reached from `Sp_Manufacture_InsertMftPlanSlave` during 生产计划/排程 row-creation. No form-master, gdsmodule hook, or Java caller — purely an internal helper. diff --git a/en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableTwo.md b/en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableTwo.md index 74e977f..bf6b226 100644 --- a/en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableTwo.md +++ b/en/docs/auto-catalog/procedures/Sp_Create_sControlFaceNameTableTwo.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产排程 → 印刷拼版/折页清单展开 — variant 2 of the `Sp_Create_sControlFaceNameTable` dispatcher family that fills `sControlFaceName_tmp` from a 控面 (control-face) descriptor. This variant handles the simple `A-B` range pattern (no `+`, no `,`), e.g. `1-16` expanded into 16 sequential 贴 rows. + +**What it does:** Splits `p_sControlFaceName` on `-` to obtain start (`Fun_GetNum` of part 1) and end (part 2), takes the trailing 中文 suffix via `Fun_GetGb` as `sControlFacesChar` (defaulting to `p_sControlFacesCharDefalut`, typically `贴`). Then while-loops from start to end, inserting one row per index into `sControlFaceName_tmp(iIndex, sControlFaceNameNum, sControlFacesChar, sId)` with title concatenation logic (avoids double-`贴` suffix). `p_iOut` is advanced past the last index. + +**Invocation:** Called by `Sp_Create_sControlFaceNameTable` (the dispatcher) when the control-face descriptor has only a `-`, no `+` and no `,`. The dispatcher chain is reached from `Sp_Manufacture_InsertMftPlanSlave` during 生产计划/排程 row-creation. No form-master, gdsmodule hook, or Java caller — internal helper only. diff --git a/en/docs/auto-catalog/procedures/Sp_CustomerComplaints_BtnRepair.md b/en/docs/auto-catalog/procedures/Sp_CustomerComplaints_BtnRepair.md index 21623f6..2671bb4 100644 --- a/en/docs/auto-catalog/procedures/Sp_CustomerComplaints_BtnRepair.md +++ b/en/docs/auto-catalog/procedures/Sp_CustomerComplaints_BtnRepair.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 客户投诉 / 质量管理 → 内部质量投诉 — button-repair handler that flips a `mftqualityaccidentMaster` (质量事故/客户投诉) row to "修复" status. Sets `sType=3` (a status enum value meaning 已处理/修复) and records the operator's textarea comment into `sCheckMemo`, plus any extra change fields the front-end included. + +**What it does:** Validates `sProInParam`, parses `$.params[].value[].sId` plus the front-end `changeValue` envelope. Walks `changeValue[0].valueKey` (a comma-separated list of column names that were edited) and builds a dynamic SET clause `col1=val1, col2=val2`, then appends `sType=3, sCheckMemo=`. The whole UPDATE is `PREPARE`/`EXECUTE`-d against `mftqualityaccidentMaster` for the target id with tenant guards. The original `bCheck` early-out for `sCurrStatus='startWorking'` is commented out. + +**Invocation:** `Sp_BtnRepair_*` family — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` when the 报修/修复 button on a 客户投诉 / 内部质量投诉 form fires. xly-src ships `script/标版/30100101/Sp_CustomerComplaints_BtnRepair.sql` as the install body. No `gdsmodule` hook nor `gdsconfigformmaster` data-source reference — binding is in the form's button configuration. Naming mismatch worth flagging: the proc name says CustomerComplaints but it writes to `mftqualityaccidentMaster`. diff --git a/en/docs/auto-catalog/procedures/Sp_Customer_BtnEventCancelInvalid.md b/en/docs/auto-catalog/procedures/Sp_Customer_BtnEventCancelInvalid.md index fb7538e..5cc6dc8 100644 --- a/en/docs/auto-catalog/procedures/Sp_Customer_BtnEventCancelInvalid.md +++ b/en/docs/auto-catalog/procedures/Sp_Customer_BtnEventCancelInvalid.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础资料 → 客户 (`elecustomer`) — symmetric inverse of `Sp_Customer_BtnEventInvalid`. Reactivates a soft-deleted customer (`bInvalid=0`) and logs the action as `'取消作废客户'` against the customer form (`sFormId='192116810111915048607109671'`). + +**What it does:** Same JSON-batch shape as the invalidate sibling: validates `sProInParam`, parses `$.params[].value[].sId`, splits on `-` for multi-id payloads, then per `sIdOne` reads the customer name, runs `UPDATE elecustomer SET bInvalid=0 ...`, and `INSERT INTO syslog` with `sLog='取消作废客户:'+sCustomerName` and `sOperationType='取消作废客户'`. + +**Invocation:** `sp_btn_action*`-style — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` when the 取消作废 button on the 客户 form fires. No `gdsmodule` hook reference; the binding lives in the form's button configuration. Not in xly-src 30100101 install scripts — DB-only. diff --git a/en/docs/auto-catalog/procedures/Sp_Customer_BtnEventInvalid.md b/en/docs/auto-catalog/procedures/Sp_Customer_BtnEventInvalid.md index 86f08dd..bd5e48d 100644 --- a/en/docs/auto-catalog/procedures/Sp_Customer_BtnEventInvalid.md +++ b/en/docs/auto-catalog/procedures/Sp_Customer_BtnEventInvalid.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础资料 → 客户 (`elecustomer`) — button handler for "客户作废". Soft-deletes the selected customer rows (`bInvalid=1`) and writes one `syslog` audit row per customer with `sOperationType='作废客户'` and the customer name, keyed back to the customer form (`sFormId='192116810111915048607109671'`). + +**What it does:** Validates `sProInParam`, parses `$.params[].value[].sId` from the JSON payload. The `sId` field may be a `-`-separated list, so it explodes it via `SUBSTRING_INDEX`. For each `sIdOne`: reads `sCustomerName` to build the log message (`'作废客户:' + sCustomerName`), runs `UPDATE elecustomer SET bInvalid=1 WHERE sId=p_sIdOne AND sBrandsId AND sSubsidiaryId`, then `INSERT INTO syslog` with the audit trail. Empty selection raises `chooseData` ("请选择数据") via `Fun_Sis_GetConstNew`. + +**Invocation:** `sp_btn_action*`-style — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` when the 作废 button on the 客户 form fires. No `gdsmodule` hook reference; the button binding lives in the form's button configuration. No xly-src install script ships with this routine in the standard 30100101 bundle — the proc is live in the DB only. diff --git a/en/docs/auto-catalog/procedures/Sp_Customerlist_BtnEventCheck1.md b/en/docs/auto-catalog/procedures/Sp_Customerlist_BtnEventCheck1.md index 2d4aee9..6e2929b 100644 --- a/en/docs/auto-catalog/procedures/Sp_Customerlist_BtnEventCheck1.md +++ b/en/docs/auto-catalog/procedures/Sp_Customerlist_BtnEventCheck1.md @@ -1,7 +1,7 @@ # `Sp_Customerlist_BtnEventCheck1` (procedure) -> @author:zhucx - @date:20210521 封存 +> @author:zhucx + @date:20210521 封存 @describe:客户审核界面 1级审核 @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础资料 → 客户审核 (Customerlist) — author-comment header says "封存 (deprecated/archived) 2021-05-21, 客户审核界面 1级审核 (level-1 audit of customer-list)". The proc flips `elecustomer.bCheck=1` for the selected rows — i.e. marks the customer as 已审核 in the first-tier review step. + +**What it does:** Validates `sProInParam`, parses `$.params[].value[].sId` from the JSON payload, and for each `sId` runs `UPDATE elecustomer SET bCheck=1 WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. No syslog, no flow, no name-lookup — minimal compared to the `Sp_Customer_BtnEvent*` siblings. + +**Invocation:** Status: appears orphaned and **封存 by author note** dated 2021-05-21. No caller found in any channel — no form-master binding, no `gdsmodule` hook, no other routine references this name, no xly-src reference. The replacement is the audit workflow standard (`Sp_Check_*` / `gdsmoduleflow`) — this proc is leftover from a removed UI button. Safe to ignore in production. diff --git a/en/docs/auto-catalog/procedures/Sp_Customerlist_BtnEventUnCheck1.md b/en/docs/auto-catalog/procedures/Sp_Customerlist_BtnEventUnCheck1.md index a4da8e7..d91c9a3 100644 --- a/en/docs/auto-catalog/procedures/Sp_Customerlist_BtnEventUnCheck1.md +++ b/en/docs/auto-catalog/procedures/Sp_Customerlist_BtnEventUnCheck1.md @@ -1,7 +1,7 @@ # `Sp_Customerlist_BtnEventUnCheck1` (procedure) -> @author:zhucx - @date:20210521 封存 +> @author:zhucx + @date:20210521 封存 @describe:客户审核界面 1级消审 @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础资料 → 客户审核 (Customerlist) — author-comment header says "封存 (deprecated/archived) 2021-05-21, 客户审核界面 1级消审 (level-1 un-audit of customer-list)". Inverse of `Sp_Customerlist_BtnEventCheck1`: flips `elecustomer.bCheck=0` for selected rows. + +**What it does:** Validates `sProInParam`, parses `$.params[].value[].sId` from the JSON payload, and for each `sId` runs `UPDATE elecustomer SET bCheck=0 WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. No syslog, no flow. + +**Invocation:** Status: appears orphaned and **封存 by author note** dated 2021-05-21. No caller in any channel — no form-master binding, no `gdsmodule` hook, no other routine references, no xly-src reference. Replaced by the standard 反审核 workflow. Safe to ignore in production. diff --git a/en/docs/auto-catalog/procedures/Sp_DailyStatisticalReport.md b/en/docs/auto-catalog/procedures/Sp_DailyStatisticalReport.md index 478b545..bb2470f 100644 --- a/en/docs/auto-catalog/procedures/Sp_DailyStatisticalReport.md +++ b/en/docs/auto-catalog/procedures/Sp_DailyStatisticalReport.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 产量日汇总报表 — daily-summary aggregator for production reports. Rebuilds `mftDaySumReport` for a chosen date range by re-aggregating `mftproductionreportslave` × `mftproductionreportemployee` per `(tVestingDate, sTeamType, sMachineId, sTeamId, sEmployeeId)`, then back-writes the new summary id onto each contributing employee row. + +**What it does:** Validates `sProInParam`, extracts `$.changeValue.pChooseDate` (a `[start,end]` array), parses both ends into `p_tStartDate`/`p_tEndDate`. Deletes existing `mftDaySumReport` rows in that window for the tenant, then `INSERT INTO mftDaySumReport SELECT ...` summing `dProcessQty/dConversionQty/dHour/dQualifiedProductionQty/...` from the joined slave+employee tables grouped by date+team+machine+employee. Final `UPDATE mftproductionreportemployee` joins back to set `sDaySumReportId` on each employee row and stamps the slave's `sConfirmDayInfo='2'`. Empty params returns `paramsErro`. + +**Invocation:** Status: appears orphaned. No caller in any channel — no `gdsconfigformmaster` binding, no `gdsmodule` hook, no other routine references, no Java reference in xly-src (only the install script `script/标版/30100101/Sp_DailyStatisticalReport.sql`). The JSON-param shape with `$.changeValue.pChooseDate` matches the standard sp_btn_action button signature, so the binding probably lives on a form button that's been removed; the monthly counterpart `Sp_MonthlyStatisticalReport` exists alongside it. Candidate for maintainer audit before reliance. diff --git a/en/docs/auto-catalog/procedures/Sp_DailyStatisticalSalary.md b/en/docs/auto-catalog/procedures/Sp_DailyStatisticalSalary.md index 8134909..e2af344 100644 --- a/en/docs/auto-catalog/procedures/Sp_DailyStatisticalSalary.md +++ b/en/docs/auto-catalog/procedures/Sp_DailyStatisticalSalary.md @@ -22,4 +22,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 工资结算 / 计件工资 — month-scope salary computation driver. For the chosen 年月 (`tYearMonth`), walks every active 日统计 row in `sissalarystructureplan` (`sCycle='1'`) and applies its `sFormulaId` to roll wage figures from `mftproductionreportslave` (and its employee split table) into per-row `dWageMoney` columns, materialising a snapshot in `mftpayrollstatementcalc` and back-writing into `mftDaySumReport`. + +**What it does:** Validates `sProInParam`, parses `tYearMonth` from `$.changeValue[0].tYearMonth`. Cursors `sissalarystructureplan` rows for the tenant where `sCycle='1'` ordered by `iOrder`; for each plan: +1. If `bCalcType=0` (per-team), inserts a grouped snapshot into `mftpayrollstatementcalc` from `mftproductionreportslave` for the year-month, decorates with machine/team names, then cursors back through and for each row calls `Sp_System_ReplaceField(sId, 'mftpayrollstatementcalc', 'billSlave', p_sFormulaId, @awardMoney, …)` to evaluate the formula. The dynamic UPDATE then writes the resulting money into `mftProductionReportSlave.dWageMoney` proportional to `dProcessQty`, splits it to `mftproductionreportemployee.dWageMoney` by `dProportion`, and finally rolls a per-employee total into `mftDaySumReport.dWageMoney`. +2. If `bCalcType=1` (per-employee/direct), copies the rows from `mftDaySumReport` straight into `mftpayrollstatementcalc` and updates `mftDaySumReport.dWageMoney` directly with the formula output. Any `Sp_System_ReplaceField` failure aborts via `LEAVE top` with `sCode=-1`. + +**Invocation:** Status: appears orphaned in production hooks. No caller in any channel — no form-master, no `gdsmodule` hook, no other routine. xly-src has install scripts at `script/标版/30100101/Sp_DailyStatisticalSalary.sql`, the doubled-name `Sp_Sp_DailyStatisticalSalary.sql`, and a customer override `script/客户/金九/Sp_DailyStatisticalSalary.sql` — confirming it has a customer-side use history (金九 印务) but no live button binding in the standard 30100101 deployment. The JSON `$.changeValue[0].tYearMonth` shape is sp_btn_action-style, so binding probably lived on a removed wage-calc button. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_DaysaleSalesMan.md b/en/docs/auto-catalog/procedures/Sp_DaysaleSalesMan.md index 1e4850d..0039b93 100644 --- a/en/docs/auto-catalog/procedures/Sp_DaysaleSalesMan.md +++ b/en/docs/auto-catalog/procedures/Sp_DaysaleSalesMan.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售分析(人员角度) — paged daily-sales pivot keyed by sales rep. Twin of `Sp_Daysalecustomer` but groups by `sSalesManId` instead of `sCustomerId`; returns one row per 销售员 with the monthly total `dProductMoney` plus 31 day-buckets `d1..d31` for the month. + +**What it does:** Formats the month-key `%Y%m` from `tStartDate`, builds a dynamic SQL that `SELECT sId, sSlaveId, sCustomerId, sSalesManId, (SELECT sName FROM SisSalesMan WHERE sId=T.sSalesManId) AS sSalesManName, SUM(dProductMoney), COUNT(1), SUM(CASE WHEN DAY(tCreateDate)=N THEN dProductMoney ELSE 0 END) AS dN`-style for N=1..31, from `viw_salsalesorder` filtered to the seven 销售订单 `sFormId`s and `bInvalid=0`, grouped by `sSalesManId`. The dynamic SQL is handed to `Sp_Outstanding_Query` for paging, total-count, and `bFilter` condition splicing. + +**Invocation:** Bound as the data-source of the 销售人员日销售额统计 form `gfm.sId=101801153119616636370835770` via `gdsconfigformmaster.sSqlStr` — under module 销售分析(人员角度) (`sId 16342518750008161923333768442000`) inside 销售管理. Loaded when the user opens the report. Not in xly-src 30100101 install scripts — DB-only. diff --git a/en/docs/auto-catalog/procedures/Sp_Daysalecustomer.md b/en/docs/auto-catalog/procedures/Sp_Daysalecustomer.md index 5e0bbb5..5df19d3 100644 --- a/en/docs/auto-catalog/procedures/Sp_Daysalecustomer.md +++ b/en/docs/auto-catalog/procedures/Sp_Daysalecustomer.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售分析(客户角度) — paged daily-sales pivot keyed by customer. For the month containing `tStartDate`, returns one row per customer with the monthly total `dProductMoney` plus 31 day-buckets `d1..d31` showing each day's revenue from `viw_salsalesorder` (the consolidated sales-order view). + +**What it does:** Formats the month-key `%Y%m` from `tStartDate`, then builds a dynamic SQL that `SELECT sId, sSlaveId, sCustomerId, sSalesManId, sCustomerName, SUM(dProductMoney) AS dTotalMoney, COUNT(1) AS dSum, SUM(CASE WHEN DAY(tCreateDate)=N THEN dProductMoney ELSE 0 END) AS dN`-style for N=1..31. Pulls from `viw_salsalesorder` filtered to `bInvalid=0` and the seven `sFormId`s representing the standard 销售订单 form variants. Groups by `sCustomerId`. The dynamic SQL is handed to `Sp_Outstanding_Query` for paging, total-count, group-by extension, and `bFilter` user-condition splicing. + +**Invocation:** Bound as the data-source of the 销售分析(按日累计) form `gfm.sId=192116811011016400861831491` via `gdsconfigformmaster.sSqlStr` — under module 销售分析(客户角度) (`sId 16316212900007840201152805231000`) inside 销售管理. Loaded when the user opens the report; the form-binding dispatcher fetches the proc name from the form-master row and passes the page/filter params. Not in xly-src 30100101 install scripts — DB-only. diff --git a/en/docs/auto-catalog/procedures/Sp_DelMasterSlave_Pro.md b/en/docs/auto-catalog/procedures/Sp_DelMasterSlave_Pro.md index 5bb915f..f882e1e 100644 --- a/en/docs/auto-catalog/procedures/Sp_DelMasterSlave_Pro.md +++ b/en/docs/auto-catalog/procedures/Sp_DelMasterSlave_Pro.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Cross-module delete pipeline — the central proc that the Java side dispatches to whenever a user deletes a master+slave document (sales order, purchase order, work order, etc.). Wraps the delete in a savepoint, runs the pre-delete checks, the back-write reversal, and cascades through every dependent slave table for the given master. + +**What it does:** Sets a `SQLEXCEPTION` continuation handler that flags `t_error=1`, opens a transaction (if none already), creates `SAVEPOINT DelPro`. Calls `Sp_UpdateAdd_Check` with `sType='check'` to confirm the user is allowed to delete (制单人/审核状态/etc.); calls `Sp_GetMasterSlave` to resolve `(masterTableName, saveTableNames, delMasterId, delSlaveId, sUpdateCloumn)` from `sTableName`. If the master ends in `master` (and isn't a `gds*` config table), it short-circuits the delete with "请刷新单据,消审后删除" when any row has `bCheck=1`. Calls `Sp_delete_backwriting` to reverse upstream reservations, then for every slave table issues a dynamic `DELETE ... WHERE FIND_IN_SET(, sGuids) AND sBrandsId=…`, then deletes the master rows. On `t_error=1`, rolls back to `DelPro` and surfaces the localized SQLEXCEPTION message via `SP_Sis_GetConst`; otherwise releases the savepoint and commits. + +**Invocation:** Called by `BusinessBaseServiceImpl.delMethodPro()` — the central document-delete entrypoint. Java builds `searMap` via `procedureService.getDoProMap("Sp_DelMasterSlave_Pro", …)`, populates `sGuids/sTableName/sLoginId/sBrId/sSuId/sFormGuid/iFlag/sType`, runs the form-level `sDeleteProName` pre-hooks via `checkUpdate(..., "sDeleteProName")`, then `procedureService.getCallProByMap(searMap, "Sp_DelMasterSlave_Pro")`. xly-src install body: `script/标版/30100101/Sp_DelMasterSlave_Pro.sql`. Sibling of `Sp_DelMasterSlave_Pro2` (a savepoint-only variant without `Sp_delete_backwriting`). diff --git a/en/docs/auto-catalog/procedures/Sp_DelMasterSlave_Pro2.md b/en/docs/auto-catalog/procedures/Sp_DelMasterSlave_Pro2.md index 66ddf5f..7bc8b8d 100644 --- a/en/docs/auto-catalog/procedures/Sp_DelMasterSlave_Pro2.md +++ b/en/docs/auto-catalog/procedures/Sp_DelMasterSlave_Pro2.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Older / alternate variant of `Sp_DelMasterSlave_Pro`. Same core idea — delete a master+slave document with a transaction savepoint — but without the back-write reversal (`Sp_delete_backwriting`) step and without the form-level pre-delete checks. Kept for callers that just need a transactional master+slave drop. + +**What it does:** Opens (or joins) a transaction and creates `SAVEPOINT DelPro`. Calls `Sp_UpdateAdd_Check(sGuids, sTableName, sLoginId, sBrId, sSuId, sType='check', @sCode, @sReturn)` and aborts on `<0`. Calls `Sp_GetMasterSlave` to find the master / slave-table set / `delMasterId` / `delSlaveId`. Iterates the slave-table list, special-cases `eleproductstock` to use `sProductId` as the link, and issues dynamic `DELETE FROM WHERE FIND_IN_SET(, sGuids)` and finally `DELETE FROM WHERE FIND_IN_SET(, sGuids)`. A `SQLEXCEPTION` handler sets `t_error=1`; on error, rolls back to the savepoint and surfaces the SQLEXCEPTION message via `SP_Sis_GetConst`. Otherwise releases the savepoint and commits. + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, no `gdsconfigformmaster` data-source, no other routine references it, no xly-src grep hits beyond this file itself. Production deletes route through `Sp_DelMasterSlave_Pro` instead — this variant looks like a stale alternate; candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Del_ACT_Flow_Data.md b/en/docs/auto-catalog/procedures/Sp_Del_ACT_Flow_Data.md index 9f0f99c..628f89b 100644 --- a/en/docs/auto-catalog/procedures/Sp_Del_ACT_Flow_Data.md +++ b/en/docs/auto-catalog/procedures/Sp_Del_ACT_Flow_Data.md @@ -17,4 +17,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Installation / data-purge tool — wipes Activiti workflow tables and system-message logs. Used during initial environment setup or when a tenant is being rebuilt from scratch; not part of any user-facing menu. + +**What it does:** Truncates message and log tables (`sys_msg`, `sys_login_log`, `sys_job_log`, `syslog`, `syslogdetail`, `syssendedingtalkmsg`, `syssendewxmsg`), ERP flow tables (`biz_flow`, `biz_todo_item`, `biz_todo_copyto`), the Activiti event log, all `act_hi_*` history tables, and the Activiti runtime tables (`act_ru_*`, `act_re_procdef`, `act_procdef_info`), bracketing the runtime truncates with `SET FOREIGN_KEY_CHECKS=0/1` so dependent FKs do not block the wipe. Preserves `act_ge_property`, `act_ge_bytearray`, `act_re_model`, `act_re_deployment` (commented out). + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, no `gdsconfigformmaster` data-source, no other routine references it, and xly-src ships only the install script `script/del/Sp_Del_ACT_Flow_Data.sql`. Part of the `script/del/` reset family — operators invoke it manually via SQL when rebuilding ACT / log state. diff --git a/en/docs/auto-catalog/procedures/Sp_Del_AllTable_Data.md b/en/docs/auto-catalog/procedures/Sp_Del_AllTable_Data.md index 438238e..aedda35 100644 --- a/en/docs/auto-catalog/procedures/Sp_Del_AllTable_Data.md +++ b/en/docs/auto-catalog/procedures/Sp_Del_AllTable_Data.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Installation / data-purge tool — wipes every business and basic-data table in the tenant. Used when rebuilding a tenant from scratch (test / demo / fresh deployment); not part of any user-facing menu. + +**What it does:** Validates that `sBrandNo` is not already present in `sysbrands` (aborts with `sBrandNoUnique` if it is, surfacing the message via `SP_Sis_GetConst`). Then `TRUNCATE`s the full set of cashier, customer, supplier, employee, machine, materials, process, product, sales, purchase, manufacturing, inventory, quality, finance, KPI and account-period tables — both basic-data (`ele*`, `sis*`, `sys*`) and transactional (`cah*`, `mft*`, `mit*`, `pit*`, `sal*`, `pur*`, `acc*`, `kpi*`, `qly*`, `out*`, `ops*`). Resets `hibernate_sequence` and tenant-scoped staging tables (`alltb`, `erpmerge*`). + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, no `gdsconfigformmaster` data-source, no other routine references it. xly-src ships `script/del/Sp_Del_AllTable_Data.sql` as part of the `script/del/` family; operators are expected to invoke it manually before re-seeding a tenant. Sibling of `Sp_Del_BasicsTable_Data` (basic-data only) and `Sp_Del_BusinessTable_Data` (transactional only). diff --git a/en/docs/auto-catalog/procedures/Sp_Del_BasicsTable_Data.md b/en/docs/auto-catalog/procedures/Sp_Del_BasicsTable_Data.md index 6fba30f..b85072f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Del_BasicsTable_Data.md +++ b/en/docs/auto-catalog/procedures/Sp_Del_BasicsTable_Data.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Installation / data-purge tool — wipes only the basic-data (master-data) tables: customers, suppliers, employees, products, materials, machines, processes, knife-moulds, plus their classifications and the related `sis*` lookup tables. Sibling of `Sp_Del_BusinessTable_Data` (transactional only) and `Sp_Del_AllTable_Data` (everything). + +**What it does:** Sets `sCode=1`/`sReturn=''`, then `TRUNCATE`s the basic-data set: `eleworkcenter`, `elecustomer*`, `siscustomerclassify`, `siscustomerproperty`, `sftlogininfo*` group-binding tables, `eleknifemould*`, `elemachine`, `elematerials*`, `eleprocess*`, `sisprocessclassify*`, `eleproduct*`, `sisproductclassify*`, `elesupply*`, `sissupplyclassify`, `eleteam*`, `eleemployee`, plus `sisbank`, `sisdeliver`, `sisexchangerates`, `sislevel`, `sislosstype`, `sismaterialsclassify`, `sisposition`, `sisproperty`, `sissalesman`, `sisdepart`, `sismerchandiser`, `sischeckphaselogininfo`. Does not touch transactional `mft*`/`pit*`/`cah*`/`sal*` tables. + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, no `gdsconfigformmaster` data-source, no other routine references it. xly-src ships `script/del/Sp_Del_BasicsTable_Data.sql` as part of the `script/del/` reset family — operators invoke it manually when reseeding only basic data. diff --git a/en/docs/auto-catalog/procedures/Sp_Del_BasicsTable_DataByCompany.md b/en/docs/auto-catalog/procedures/Sp_Del_BasicsTable_DataByCompany.md index f5c9034..174d2b1 100644 --- a/en/docs/auto-catalog/procedures/Sp_Del_BasicsTable_DataByCompany.md +++ b/en/docs/auto-catalog/procedures/Sp_Del_BasicsTable_DataByCompany.md @@ -19,4 +19,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Tenant-scoped basic-data purge — deletes a single company's master data plus its `sysbrands` row, so a brand can be removed without affecting other tenants on the same database. Sibling of `Sp_Del_BasicsTable_Data` (which truncates everything) and `Sp_Del_BusinessTable_DataCompany` (the transactional twin). + +**What it does:** Resolves `(sBrId, sSuId)` from `sysbrands` by `sName LIKE concat('%', sCompanyName, '%')`, deletes the matching `sysbrands` row, then runs `DELETE ... WHERE sBrandsId=sBrId AND sSubsidiaryId=sSuId` against the form/chart/permissions tables (`gdsconfigcharmaster/slave`, `gdsmoduleshow`, `gdsconfigformpersonalize`, `kpimodule`, `syssearch`, `sischeckphase*`, `eleteststandard`) and the same basic-data set as `Sp_Del_BasicsTable_Data` — `eleworkcenter`, `elecustomer*`, `sftlogininfo`, `siscustomer*`, `eleknifemould*`, `elemachine`, `elematerials*`, `eleprocess*`, `eleproduct*`, `elesupply*`, `eleteam*`, `eleemployee`, plus the `sis*` lookups (`sisbank`, `sisdeliver`, `sisdepart`, `sisexchangerates`, `sislevel`, `sislosstype`, `sismaterialsclassify`, `sispayment`, `sisposition`, `sisproperty`, `sissalesman`, `sissettlement`, `sistax`, `sisunit`, `siswarehouse`, `sisworkcenter`). + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, no `gdsconfigformmaster` data-source, no other routine references it. xly-src ships `script/del/Sp_Del_BasicsTable_DataByCompany.sql` — operators invoke it manually when retiring a single company. diff --git a/en/docs/auto-catalog/procedures/Sp_Del_BusinessTable_Data.md b/en/docs/auto-catalog/procedures/Sp_Del_BusinessTable_Data.md index 808d19c..ef6d18a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Del_BusinessTable_Data.md +++ b/en/docs/auto-catalog/procedures/Sp_Del_BusinessTable_Data.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Installation / data-purge tool — wipes only the transactional (单据) tables. Used when an environment needs its cashier, manufacturing, inventory, sales, purchasing and outsourcing history reset while keeping basic data (customers, products, materials, employees) intact. Sibling of `Sp_Del_BasicsTable_Data`. + +**What it does:** Sets `sCode=1`/`sReturn=''`, then `TRUNCATE`s the transactional set: cashier (`cah*`), account opening (`accmaterialsinit*`), production-apply (`mitproductionapply*`), manufacturing (`mftqualityaccident*`, `mftworkorder*` master/slave + materials + process + control + param + combine + their `_tmp` shadows, `mftproductionplan*`, `mftproductionreport*`), materials inventory (`mitcheckprofitloss`, `mitmaterialsadjust*`, `mitmaterialscheck*`, `mitmaterialscut*`, `mitmaterialsstore`, `mitmaterialsstorevirtual`, `elematerialsstock` and its month/cost shadows, `mitmaterialsstoreadjustment*`, `mitproductionmaterials*`), outsourcing (`opsoutside*`, `opsqualityabnormal*`), and product-in-store (`pit*` family). Resets `erpmerge*` queues. + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, no `gdsconfigformmaster` data-source, no other routine references it. xly-src ships both `script/标版/30100101/Sp_Del_BusinessTable_Data.sql` and `script/del/Sp_Del_BusinessTable_Data.sql` — the former is the standard 30100101-version installer, the latter is the maintenance variant. Verify which is currently deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Del_BusinessTable_DataCompany.md b/en/docs/auto-catalog/procedures/Sp_Del_BusinessTable_DataCompany.md index 879c803..0d1e642 100644 --- a/en/docs/auto-catalog/procedures/Sp_Del_BusinessTable_DataCompany.md +++ b/en/docs/auto-catalog/procedures/Sp_Del_BusinessTable_DataCompany.md @@ -19,4 +19,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Tenant-scoped transactional purge — deletes a single company's documents (cashier, manufacturing, inventory, purchase, sales, outsourcing, quality) while leaving other tenants on the same database untouched. Sibling of `Sp_Del_BusinessTable_Data` (which truncates everything) and `Sp_Del_BasicsTable_DataByCompany` (the basic-data twin). + +**What it does:** Resolves `(sBrId, sSuId)` from `sysbrands` by `sName LIKE concat('%', sCompanyName, '%')`, then runs `DELETE ... WHERE sBrandsId=sBrId AND sSubsidiaryId=sSuId` over the transactional set: cashier (`cah*`), `erpmerge*` queues, quality-accident (`mftqualityaccident*`), manufacturing work-orders (`mftworkorder*` master/slave + materials/process/control/tmp variants), production plan and report (`mftproductionplan*`, `mftproductionreport*`), materials inventory (`mitcheckprofitloss`, `mitmaterialsadjust*`, `mitmaterialscheck*`, …), pit-side product-in-store tables, outsourcing, and any other doc tables tagged with the company keys. Leaves master-data (`ele*`, `sis*`) intact. + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, no `gdsconfigformmaster` data-source, no other routine references it. xly-src ships `script/del/Sp_Del_BusinessTable_DataByCompany.sql` and `script/标版/30100101/Sp_Del_BusinessTable_DataCompany.sql` (note name skew — `By` vs no-`By` — verify which is deployed). Operators invoke it manually when retiring a single company's documents. diff --git a/en/docs/auto-catalog/procedures/Sp_Del_gdsconfigformuserslave.md b/en/docs/auto-catalog/procedures/Sp_Del_gdsconfigformuserslave.md index 97f2dc2..80b169c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Del_gdsconfigformuserslave.md +++ b/en/docs/auto-catalog/procedures/Sp_Del_gdsconfigformuserslave.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 显示界面恢复出厂设置 — clears per-user form-column customizations (the "restore factory display" action). Drops rows in `gdsconfigformuserslave` whose owning jurisdiction-classify has been flagged invisible to standard operator profiles, so the next form open shows the platform-default column layout. + +**What it does:** Single `DELETE FROM gdsconfigformuserslave WHERE sJurisdictionClassifyId IN (SELECT sId FROM sisjurisdictionclassify WHERE bLogininfoShow = 0)`. + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, no `gdsconfigformmaster` data-source, no other routine references it. xly-src ships only the install script `script/标版/30100101/Sp_Del_gdsconfigformuserslave.sql`. The Chinese title implies an admin "restore factory display" button, but no dispatcher is wired up; candidate for maintainer audit or expected to be triggered manually. diff --git a/en/docs/auto-catalog/procedures/Sp_DieCut_BtnEventReceive.md b/en/docs/auto-catalog/procedures/Sp_DieCut_BtnEventReceive.md index 57b18aa..062233d 100644 --- a/en/docs/auto-catalog/procedures/Sp_DieCut_BtnEventReceive.md +++ b/en/docs/auto-catalog/procedures/Sp_DieCut_BtnEventReceive.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 移动端管理 → 现场 → 功能操作 → 领用模具 — die-cut / knife-mould checkout button on the mobile shopfloor app. The worker scans the knife-mould product on a machine; this proc flips the mould's state to "in use", stamps the recipient, and logs a store-out history row. + +**What it does:** Validates `sProInParam` as JSON (aborts with localized "paramsErro" if not), extracts `$.params[0].value` (the slave array, "请选择数据" if empty). For each row: resolves the knife-mould master `sParentId` from `eleknifemouldproduct.sId = p_sSlaveId`; `UPDATE eleknifemould SET sState=2 (领用中), sRecipientPerson=sMakePerson, tRecipientPerson=NOW()`; reads `elemachine.sMachineName` for the destination; computes next `iOrder` from `eleknifemouldproductstore`; `INSERT INTO eleknifemouldproductstore` a history row carrying the product/customer/technology-ver/recipient/machine/state(=领用)/knife-mould-id/`sSrcFormId`. + +**Invocation:** Parameter shape matches the `GenericProcedureCallServiceImpl.doGenericProcedureCall` toolbar-button contract (`Sp__BtnEvent*`). No live `gdsmodule` hook, no `gdsconfigformmaster` data-source, no other routine references it, and the only xly-src hit is the install script `script/标版/30100101/Sp_DieCut_BtnEventReceive.sql`. Wired up via a `sysbtn`/toolbar action descriptor in the mobile shopfloor `领用模具` page (sId `101251240115015902879009710`) — verify in BACK that the binding is still attached. Paired with `Sp_DieCut_BtnEventReturn` for the mould return. diff --git a/en/docs/auto-catalog/procedures/Sp_DieCut_BtnEventReturn.md b/en/docs/auto-catalog/procedures/Sp_DieCut_BtnEventReturn.md index 900fcf6..b740661 100644 --- a/en/docs/auto-catalog/procedures/Sp_DieCut_BtnEventReturn.md +++ b/en/docs/auto-catalog/procedures/Sp_DieCut_BtnEventReturn.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 移动端管理 → 现场 → 功能操作 → 归还模具 — die-cut / knife-mould return button on the mobile shopfloor app. Symmetric counterpart to `Sp_DieCut_BtnEventReceive`: when the operator returns a mould, this proc flips its state back to "归还", stamps the returner, and logs a store-in history row. + +**What it does:** Validates `sProInParam` as JSON (aborts with localized "paramsErro" / "chooseData" otherwise). For each slave row: resolves the master `sParentId` from `eleknifemouldproduct.sId = p_sSlaveId`; `UPDATE eleknifemould SET sState=3 (归还), sRecipientReturnPerson=sMakePerson, tRecipientReturnPerson=NOW()`; reads `elemachine.sMachineName` for the source-machine label; computes next `iOrder` from `eleknifemouldproductstore`; `INSERT INTO eleknifemouldproductstore` a paired return-history row with product/customer/technology-ver/return-person/state(=归还). + +**Invocation:** Parameter shape matches the `GenericProcedureCallServiceImpl.doGenericProcedureCall` toolbar-button contract. No live `gdsmodule` hook, no `gdsconfigformmaster` data-source, no other routine references it; only xly-src hit is `script/标版/30100101/Sp_DieCut_BtnEventReturn.sql`. Wired up via a `sysbtn`/toolbar action descriptor on 归还模具 (sId `101251240115015902879048590`); paired with `Sp_DieCut_BtnEventReceive` for the checkout. diff --git a/en/docs/auto-catalog/procedures/Sp_Do_Flow_Update_Materials.md b/en/docs/auto-catalog/procedures/Sp_Do_Flow_Update_Materials.md index 3b33175..2f0e0f5 100644 --- a/en/docs/auto-catalog/procedures/Sp_Do_Flow_Update_Materials.md +++ b/en/docs/auto-catalog/procedures/Sp_Do_Flow_Update_Materials.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Workflow custom-action **template** — shipped as the "审批自定义过程模板" sample under `script/标版/upgrade/定时器/`. Demonstrates the parameter shape an approval-flow custom proc must adopt (full ACT/Activiti context: `sData`, `sInstanceId`, `sTaskId`, `iPproved`, `sTaskIdNow`, etc.) so tenant developers can copy it as a starting point for "未完工研发材料工单审核" or similar material-update flows. + +**What it does:** Coerces every input to a non-NULL default. Decodes `Fn_json_extract(sData, '$.bSucceed_Edit')` into `p_bSucceed`. If `sGuid` is itself a JSON envelope (`{"params":[{"value":[{"sSlaveId":…}]}]}`), drills down to the inner `sSlaveId`. The rest of the body is intentionally empty — comments mark `-- 操作update yuju` as the spot where the tenant adds the real update logic. As-shipped it is a no-op aside from the parameter-normalization. + +**Invocation:** Status: appears orphaned. No `gdsmoduleflow.sApplyProName` / `sCalcProName` binding, no other routine references it, and the only xly-src hit is the template file itself. Per the dispatcher convention, when a tenant copies the template into a real flow action, the proc is dispatched by `CheckExamineFlowDataServiceImpl` against `gdsmoduleflow.sApplyProName`. Body holds extensive comments and a worked example call to guide implementers — treat it as documentation, not a live runtime callee. diff --git a/en/docs/auto-catalog/procedures/Sp_Do_ProcedurePageTree.md b/en/docs/auto-catalog/procedures/Sp_Do_ProcedurePageTree.md index 2b40a9d..ee48c04 100644 --- a/en/docs/auto-catalog/procedures/Sp_Do_ProcedurePageTree.md +++ b/en/docs/auto-catalog/procedures/Sp_Do_ProcedurePageTree.md @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Reporting infrastructure helper — the standard "page + total + column-sums" finisher invoked at the end of report procs that build their result-set inside a temporary table. Reports such as 销售管理 → 未发货明细 (`Sp_Sales_NotDeliverGoodList`), 生产管理 → 生产排程 (`Sp_Manufacture_ProductionArrange2`, `Sp_Manufacture_MftPlanPhase_product`) and 销售业绩 (`Sp_Sales_SalesAnalysiseOfSalesperson_copy1`) call it to honour the BACK grid's pagination, total-row and per-column aggregate UI. + +**What it does:** Given a base temp table (`p_sTmpTableName`), an optional `p_sSumTableName`, a `WHERE` clause, a `LIMIT` clause, a per-table-bm prefix, a comma-list of `countCloumn`s and a JSON map `p_sumCloumn` of override SQLs, it: (1) for each requested aggregate column either uses the override SQL (running it via prepared statement when it contains `@sum`) or falls back to `SUM()` over the table, building `p_sumJson` as a `JSON_OBJECT`; (2) counts `totalCount` from the temp table after applying the WHERE; (3) builds the final paged SELECT (with `p_sLimit`) into the OUT param `p_sSumSql`; (4) returns the aggregate JSON in `countMapJson`. Stays generic so any report proc can plug in its result-set. + +**Invocation:** Other-routine callers found in the live DB: `Sp_BillOfNoPicking_copy1`, `Sp_Manufacture_ProductionArrange2`, `Sp_Sales_NotDeliverGoodList`, `Sp_Sales_NotDeliverGoodListNew`, `Sp_Sales_SalesAnalysiseOfSalesperson_copy1`. xly-src additionally ships customer-override variants under `script/客户/无锡中江/`, `script/客户/千彩/` and `script/客户/朝阳/` that call it. Install body: `script/标版/30100101/Sp_Do_ProcedurePageTree.sql`. No direct Java caller — reports invoke it from inside their bodies. diff --git a/en/docs/auto-catalog/procedures/Sp_Do_UpdateByPageSizeBefore.md b/en/docs/auto-catalog/procedures/Sp_Do_UpdateByPageSizeBefore.md index 86f85c8..45877db 100644 --- a/en/docs/auto-catalog/procedures/Sp_Do_UpdateByPageSizeBefore.md +++ b/en/docs/auto-catalog/procedures/Sp_Do_UpdateByPageSizeBefore.md @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Shared pagination helper used by report-style procedures (未清过程插入临时表后,更新前只保留20条数据). Sits one layer below `Sp_Outstanding_Query`: report procs build a temp table of all rows, then call this proc to compute totalCount, the summary JSON (`countMapJson`), and the page of rows the front-end will receive. + +**What it does:** Wraps the caller's filter (`bFilter`) with `WHERE 1=1` and `A.` aliasing, defaults `sFilterOrderBy` to `ORDER BY tCreateDate DESC`, and if `countCloumn` is supplied dynamically builds a `SELECT ... SUM(...) INTO @countMapJson,@totalCount FROM A ` to compute aggregates. It then assembles a `CREATE TEMPORARY TABLE _` keyed by `pageNum/pageSize` for the actual page slice, executing everything via `PREPARE`/`EXECUTE`. Special handling for column names prefixed `tree_` swaps `SUM(...)` for `GROUP_CONCAT(...)` so tree-rollup columns return a delimited list. + +**Invocation:** Called by ~10 sibling report procs in the live DB (e.g. `Sp_BillOfNoPicking`, `Sp_Cashier_SumJournal`, `Sp_MachinePoweranalysis`, `Sp_MachineSpeedanalysis`, `Sp_Manufacture_ProductionArrange`, `Sp_mes_TeamQtyReported`, `Sp_Sales_SalesAnalysiseOfSalesperson`, `Sp_Manufacture_ProductionWorkCenter`, etc.) and ships in many `script/标版/30100101/Sp_*.sql` install scripts plus `script/标版/optimize/` patches. Not directly bound to any form-master row or gdsmodule hook — the front-end reaches it indirectly through whichever report proc loads the form's data source. diff --git a/en/docs/auto-catalog/procedures/Sp_Element_ProduceReportSum.md b/en/docs/auto-catalog/procedures/Sp_Element_ProduceReportSum.md index 2377a60..dd2ef05 100644 --- a/en/docs/auto-catalog/procedures/Sp_Element_ProduceReportSum.md +++ b/en/docs/auto-catalog/procedures/Sp_Element_ProduceReportSum.md @@ -39,4 +39,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → OEE管理 → 工资查询 — wage/output rollup over `mftproductionreportslave` joined with `MftWorkOrderControl` and `mftProductionReportEmployee`. Drives the 工资查询 form by aggregating production-report slaves into one of four grouping levels (machine / process / team / employee) and converting raw print-qty into area-equivalents using the system's `CbxMaterialsUnit` (mm, cm, inch) for unit-coherent reporting. + +**What it does:** Resolves `sLoginId` to `eleemployee.sId`, reads `CbxMaterialsUnit` to pick a `p_sCoefficient` (1e6 for mm, 1e4 for cm, formula involving `NetConversionRate` for inch). Creates two temp tables (`p_TMP_ProduceReportSum`, `p_TMP_tmp`). When `bSum=1`, dispatches by `iType`: 1=`sMachineId`, 2=`sProcessId`, 3=`sTeamId` — builds dynamic SQL that aggregates `dConversionQty`, `dProcessQty`, `dQualifiedProductionQty`, `dNoQualifiedProductQty`, `dWasteProductionQty`, `dOtherMoney`, `dMakeReadyQty`, `dAllMoney`, `dTimeMoney`, `dMakeReadyMoney`, `dWageMoney`, plus area = `Σ dProcessQty × dMachineWidth × dMachineLength / coefficient`, special-color count, `dAdjustableQty`, `dEquivalentQty`, `dSumPlateQty`. Otherwise (employee mode) joins `mftProductionReportEmployee`, weights costs by `dProportion / dSumProportion` per slave, then groups by `sEmployeeId`. Detail mode (bSum=0) selects `viw_mftproductionreport` rows joined to product/process/team/machine/customer/workordercontrol for tabular display. Final delivery routes through `CALL Sp_Outstanding_Query` for pagination/totals. + +**Invocation:** Bound to `gdsmodule.sProcName` on `工资查询` (sId `16082796220003580567226691758000`) — module path 生产管理 → OEE管理 → 工资查询. Form-master sId `16082800570009887812625827110000` references the proc in its data-source SQL. Dispatched by `BusinessBaseServiceImpl.getPrcName(...)` when the 工资查询 query button fires. xly-src ships `script/标版/30100101/Sp_Element_ProduceReportSum.sql`; the proc name is also embedded in `Fun_getInitColumnByProName` for column-config lookup. diff --git a/en/docs/auto-catalog/procedures/Sp_EquipmentOutput_Machine.md b/en/docs/auto-catalog/procedures/Sp_EquipmentOutput_Machine.md index 6be4473..2b615ea 100644 --- a/en/docs/auto-catalog/procedures/Sp_EquipmentOutput_Machine.md +++ b/en/docs/auto-catalog/procedures/Sp_EquipmentOutput_Machine.md @@ -36,4 +36,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产运营报表 → 印刷产量达标率 — 印刷机台汇总达成统计. Per-printing-machine shift-by-shift report comparing planned vs actual production output across `mftworkorderslave` planning, `mftworkordercontrolslave` 排程, and `mftproductionreportslave` actuals over a date window. The companion `Sp_EquipmentOutput_Machine_YH` runs the same logic for 印后 (post-press) machines. + +**What it does:** Defaults `tStartDate` to NOW-2 days and `tEndDate` to NOW. Builds temp table `Sp_EquipmentOutput_Machine_Table` populated from `elemachine WHERE sMachineType=1` (印刷机) split by `sWorkType` (1=single-shift 白班, 2=two-shift 白班+晚班), filtered by `sMachineName`/`sAttribute` LIKE. Builds `Sp_EquipmentOutput_Plan_Table` aggregating `dPlanQty` and `dProcessQty` per machine/shift from the planning slave tables. Assembles dynamic column-config strings via `Fun_get_show_config_hb` / `Fun_get_show_config_ys40` (paints the "合计" row pink-on-green). Per-day expands across the date range so each column is `_白班/_晚班`. Final paginated rowset is delivered through `CALL Sp_Outstanding_Query` / `Sp_Do_UpdateByPageSizeBefore` and the column metadata is returned via OUT `sColumnNameConfig`. + +**Invocation:** Bound as the data source of the 印刷产量达标率 form (sId `1921168137117916508517550840`) under module 生产管理 → 生产运营报表 → 印刷产量达标率 (gdsmodule sId `1921168137117916508517546250`). Loaded when the user opens the report; the form-binding dispatcher reads the proc name from `gdsconfigformmaster`. Other DB callers: `Sp_CostAccount_WorkCenterToOperation` reuses the temp-table shape, and `Sp_EquipmentOutput_Machine_YH` is the 印后 counterpart. xly-src ships `script/标版/30100101/schedule/Sp_EquipmentOutput_Machine.sql` (alongside its `_YH` and `Sp_CostAccount_WorkCenterToOperation.sql` peers in the same `schedule/` directory). diff --git a/en/docs/auto-catalog/procedures/Sp_EquipmentOutput_Machine_YH.md b/en/docs/auto-catalog/procedures/Sp_EquipmentOutput_Machine_YH.md index 813a5ff..f0b4c22 100644 --- a/en/docs/auto-catalog/procedures/Sp_EquipmentOutput_Machine_YH.md +++ b/en/docs/auto-catalog/procedures/Sp_EquipmentOutput_Machine_YH.md @@ -36,4 +36,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产运营报表 → 印后产量达标率 — 印后机台汇总达成统计. Post-press (印后) twin of `Sp_EquipmentOutput_Machine` — same per-machine shift-by-shift planned-vs-actual production rollup, but scoped to non-printing machines (`elemachine.sMachineType<>1`). + +**What it does:** Same control flow as the 印刷 sibling: defaults the date window to NOW-2..NOW, populates `Sp_EquipmentOutput_Machine_Table` from `elemachine` filtered by `sMachineType<>1` and `sWorkType` (1 or 2 shift), builds the plan-aggregate temp table from `mftworkorderslave`/`mftworkordercontrolslave`, joins production actuals from `mftproductionreportslave`. Assembles the column-config via `Fun_get_show_config_*`, expands columns per day × shift, and pages the result through `Sp_Outstanding_Query`/`Sp_Do_UpdateByPageSizeBefore`. Returns column metadata in OUT `sColumnNameConfig`. + +**Invocation:** Bound as the data source of the 印后产量达标率 form (sId `1921168137117916508752666030`) under module 生产管理 → 生产运营报表 → 印后产量达标率 (gdsmodule sId `1921168137117916508752658120`). Loaded when the user opens the report. xly-src ships `script/标版/30100101/schedule/Sp_EquipmentOutput_Machine_YH.sql`. Differs from `Sp_EquipmentOutput_Machine` only in the `sMachineType` filter direction; same comment header "印刷机台汇总达成统计" is reused (likely a copy-paste oversight from the 印刷 version — actual scope per binding is 印后). diff --git a/en/docs/auto-catalog/procedures/Sp_Excu_Pro_RetOut.md b/en/docs/auto-catalog/procedures/Sp_Excu_Pro_RetOut.md index 8a625ba..0cef344 100644 --- a/en/docs/auto-catalog/procedures/Sp_Excu_Pro_RetOut.md +++ b/en/docs/auto-catalog/procedures/Sp_Excu_Pro_RetOut.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 调用存储过程获取返回参数 — generic two-statement dynamic-SQL executor. Takes a `callSql` (intended for the actual `CALL …` statement) and an `outSql` (intended to be a `SELECT @out1, @out2, …` to read back OUT params). The `callSql` half is currently commented out, so the body only executes `outSql`. Effectively a debug/dev helper for inspecting the result of a previously-prepared `CALL`. + +**What it does:** Sets `@sSqlStmt = callSql` (no PREPARE/EXECUTE — commented out), then sets `@sSqlStmt = outSql`, emits a `SELECT callSql, outSql` for debug visibility, and `PREPARE`/`EXECUTE`/`DEALLOCATE` on `outSql`. + +**Invocation:** Status: appears orphaned. Not bound to any gdsmodule hook, no form-master reference, no other routine references it, no xly-src reference. The leading "调用存储过程获取返回参数" comment and the commented-out CALL half identify this as a developer scratch utility — likely was used interactively during proc development and never wired into production. Candidate for removal. diff --git a/en/docs/auto-catalog/procedures/Sp_Exec_sOutProcess.md b/en/docs/auto-catalog/procedures/Sp_Exec_sOutProcess.md index e3c633b..6ef60e6 100644 --- a/en/docs/auto-catalog/procedures/Sp_Exec_sOutProcess.md +++ b/en/docs/auto-catalog/procedures/Sp_Exec_sOutProcess.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Intended to back the 补模具发外 (mould-rework outsourcing) audit on `mftoutprocessslave` — when an outsourcing row references a work-order/process pair that already exists in `mftworkorderprocess` it bumps `dOutsideQty` on that row; otherwise it inserts a new `mftworkorderprocess` row carrying the outsource qty. + +**What it does:** Cursors over `mftoutprocessslave WHERE sParentId=sGuid`, looks up the matching `mftworkorderprocess` row by `(sControlId, sProcessId)`. If found, stamps `sWorkOrderProcessTbId` back on the slave row and adds `iOutsideQty` to `dOutsideQty` (with `bOutside=1, bOutSideComplete=0`). If not found, generates a new id and `INSERT INTO mftworkorderprocess` populating the full column set so the rework process exists in the plan. + +**Invocation:** Called only by `Sp_Calc_sOutProcess`, which is itself orphaned — no `gdsmodule.sProcName`/`sSaveProName` binding, no form-master reference, no xly-src caller beyond the install script `script/标版/30100101/Sp_Calc_sOutProcess.sql`. Status: appears orphaned via its only caller — candidate for maintainer audit (likely a half-wired feature for mould rework that never reached production). diff --git a/en/docs/auto-catalog/procedures/Sp_GET_OeeFistOneDataByMachineId.md b/en/docs/auto-catalog/procedures/Sp_GET_OeeFistOneDataByMachineId.md index ac50ca7..249e2dd 100644 --- a/en/docs/auto-catalog/procedures/Sp_GET_OeeFistOneDataByMachineId.md +++ b/en/docs/auto-catalog/procedures/Sp_GET_OeeFistOneDataByMachineId.md @@ -24,4 +24,12 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** OEE 看板 / 报工 (Overall Equipment Effectiveness, shopfloor terminal). Header banner `OEE获取第一条数据`. Returns the latest `plc_machinedata` row for a machine plus the rolling adjust/produce/abnormal-time totals since the last production-report tCreateDate — used by the OEE terminal to bootstrap the screen and by the 上报 button to compute the time deltas it will write back. + +**What it does:** With `sReportTag='1'` (the 上报按钮 path): looks up the latest `plc_machinedata` row for `sMachineId` to get `p_sPlcDateId, p_sPlanSlaveId`; reads `viw_mftproductionreport` for the last report `tCreateDate` (`p_tlastreportDate`). Then aggregates `plc_machinedata` per machine + plan-slave between `p_tlastreportDate` and now into three totals: `p_dAdjustHour, p_dAdjustQty` from rows with `sStatus='adjustment'` and `dHour*60 > 1`; `p_dHour` from `sStatus IN ('startWorking','waitingWork','doWorkEnd')`; `p_dAbnormalHour` from stops over 15 minutes. Returns these alongside the latest PLC snapshot. + +**Invocation:** Called from Java by three call sites — all use `procedureService.getDoProMap("Sp_GET_OeeFistOneDataByMachineId", …)` + `procedureService.getCallPro(…)`: +- `LoginController.userOeelogin(...)` (`/userOeelogin/{sBrandsId}/{sSubsidiaryId}/{sTeamId}/{sMachineId}`) — bootstrap when the operator logs in at the machine terminal. +- `OeeServiceImpl` (~line 459) — main OEE service refresh. +- `OeeHandleServiceImpl` (~line 1022) — used by the 上报 handler. +xly-src ships `script/标版/30100101/schedule/Sp_GET_OeeFistOneDataByMachineId.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Gb2Big_ChineseToBig.md b/en/docs/auto-catalog/procedures/Sp_Gb2Big_ChineseToBig.md index 866bd76..20d1500 100644 --- a/en/docs/auto-catalog/procedures/Sp_Gb2Big_ChineseToBig.md +++ b/en/docs/auto-catalog/procedures/Sp_Gb2Big_ChineseToBig.md @@ -15,4 +15,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Localisation backfill. Sweeps all UI-label columns across `gdsmodule`, `gdsconfigformmaster`, `gdsconfigcharmaster`, `gdsconfigformslave`, `gdsformconst`, `gdsjurisdiction` and converts each `sChinese*` (Simplified GB) value into its Traditional-Chinese (Big5) counterpart in the parallel `sBig5*` column via `F_Gb2Big(sChinese, 1)`. Drives the Traditional-Chinese UI swap for HK/TW deployments without any per-row trigger. + +**What it does:** Bulk UPDATE: `gdsmodule.sBig5/sBig5Depart/sBig5UnMemo/sBig5WorkFruit`, `gdsconfigformmaster.sBig5`, `gdsconfigcharmaster.sBig5`, `gdsformconst.sBig5`, `gdsjurisdiction.sBig5`. The slave-column table `gdsconfigformslave` is the big one — it pages through `iIncrement DESC` 1,000 rows at a time using a cursor; for each `sId` it sets `sBig5 = F_Gb2Big(sChinese, 1)` and `sBig5DropDown = F_Gb2Big(sChineseDropDown, 1)`. No parameters; affects the whole tenant. + +**Invocation:** Status: appears orphaned. No caller found in any channel — no `gdsmodule` hook, no `gdsconfigformmaster` reference, no other proc CALLs it, no xly-src Java grep hit (only the install scripts `script/标版/30100101/Sp_Gb2Big_ChineseToBig.sql` and the underlying `F_Gb2Big` / `Fun_Gb2Big_ChineseToBig` definitions appear). Intended as a manual DBA tool run after Simplified-Chinese metadata edits, before deploying a Big5 tenant. `F_Gb2Big` itself is referenced once in `GdsconfigformMapper.xml` for column-comment formatting — that's a column-level reference, not a call into this proc. diff --git a/en/docs/auto-catalog/procedures/Sp_Generic_Procedure_Call.md b/en/docs/auto-catalog/procedures/Sp_Generic_Procedure_Call.md index a48367e..edeb8b7 100644 --- a/en/docs/auto-catalog/procedures/Sp_Generic_Procedure_Call.md +++ b/en/docs/auto-catalog/procedures/Sp_Generic_Procedure_Call.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Header banner `通用存储过程` ("generic procedure"). A skeleton/template that mirrors the standard `BtnEvent` signature (`sProInParam, sLoginId, sBrId, sSuId, sCode, sReturn`) for developers to copy when authoring a new generic-dispatch procedure. Body is empty apart from `paramsErro` guard. + +**What it does:** IFNULL-normalises all six parameters. If `sProInParam = ''` it calls `Sp_Sis_GetConst('paramsErro', p_sReturn, '', sBrId, sSuId)`, sets `sCode = -1` and leaves the `top:` block. The remainder of the body is intentionally blank — the file just commits a `BEGIN/END` shell so developers can `CREATE OR REPLACE` over it with real logic. + +**Invocation:** Status: appears orphaned. No caller found in any channel — no `gdsmodule` hook, no `gdsconfigformmaster` reference, no other proc CALLs it, no xly-src Java grep hit (only the install script `script/标版/30100101/Sp_Generic_Procedure_Call.sql`). Note: this is NOT the runtime generic-dispatch endpoint — that endpoint is the Java `GenericProcedureCallServiceImpl.doGenericProcedureCall()`. This proc is a template, not the dispatcher. diff --git a/en/docs/auto-catalog/procedures/Sp_GetMachineByApsRule-luc.md b/en/docs/auto-catalog/procedures/Sp_GetMachineByApsRule-luc.md index 3ce0f2a..0da7d1e 100644 --- a/en/docs/auto-catalog/procedures/Sp_GetMachineByApsRule-luc.md +++ b/en/docs/auto-catalog/procedures/Sp_GetMachineByApsRule-luc.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Developer-suffixed variant of `Sp_GetMachineByApsRule` (主计划:自定义排程规则) — APS rule-based machine picker for a work-order process. The `-luc` suffix follows the xly convention of developer-initials backup tags (cf. session-history pattern). + +**What it does:** Same shape as the live sibling — picks `eleprocessmachine.bDefault` row when `p_sMachineid` is blank else excludes the current machine; falls through to a `Machine_Tmp` rule search over `eleprocessmachineapsrule` keyed by 印刷颜色/重量/长宽/工艺/材料/产品分类/客户备注 with three APS-quantity caps (`dAPSProcQtyMax`/`dAPSQtyMax`/`dAPSZQtyMax`). Carries newer APS-quantity columns the unsuffixed version uses but is half the size (no `sReturnInfo` trace). + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep across all extensions). Live caller path is `BtnCalculationServiceImpl.doSetTimeCalcMachineHour()` → `Sp_GetMachineByApsRule` (the unsuffixed 109K body). diff --git a/en/docs/auto-catalog/procedures/Sp_GetMachineByApsRule.md b/en/docs/auto-catalog/procedures/Sp_GetMachineByApsRule.md index 25701ab..7dbc520 100644 --- a/en/docs/auto-catalog/procedures/Sp_GetMachineByApsRule.md +++ b/en/docs/auto-catalog/procedures/Sp_GetMachineByApsRule.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 主计划 → 自动排程 → APS规则 — picks the 最合适 (best-fit) machine for a single work-order process row by scoring `eleprocessmachineapsrule` rules against the work-order's printing-color count, weight, length/width, 工艺/材料/产品分类/客户备注, and bill-type (一类单/二类单/.../打样单 from `mftworkordermaster.sManualNo`). Sets the chosen machine into `mftproductionplanslave.sMachineId` (the call site loops over the plan-slave rows). + +**What it does:** When `p_sMachineid` is blank picks `eleprocessmachine.bDefault=1`; otherwise excludes that machine. Falls through to a `Machine_Tmp` rule-table search keyed by the seven dimensions above plus three APS-quantity caps (`dAPSProcQtyMax`/`dAPSQtyMax`/`dAPSZQtyMax`). Returns the choice in `sReturnMachineId` and the human-readable trace ("rule matched / fallback to default / no match") in `sReturnInfo`. + +**Invocation:** Called per-row by Java `BtnCalculationServiceImpl.doSetTimeCalcMachineHour()` — invoked over `mftproductionplanslave` rows in a fixed-thread-pool batch of 100, after which the controller writes a `mftproductionplancalc` row. Also `CALL`-chained from `Sp_unifiedPlanning_BtnCalculation` and the `Sp_Manufacture_InsertMftPlan*` insertion family. Reachable only via the dispatch, not via any form or gdsmodule hook. diff --git a/en/docs/auto-catalog/procedures/Sp_GetMachineByApsRule_copy1.md b/en/docs/auto-catalog/procedures/Sp_GetMachineByApsRule_copy1.md index 36d3335..dcc6928 100644 --- a/en/docs/auto-catalog/procedures/Sp_GetMachineByApsRule_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_GetMachineByApsRule_copy1.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_GetMachineByApsRule` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_GetMachineByApsRule` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_GetMachineByApsRule_排程直接下达_.md b/en/docs/auto-catalog/procedures/Sp_GetMachineByApsRule_排程直接下达_.md index ab4cee2..d1b0ffc 100644 --- a/en/docs/auto-catalog/procedures/Sp_GetMachineByApsRule_排程直接下达_.md +++ b/en/docs/auto-catalog/procedures/Sp_GetMachineByApsRule_排程直接下达_.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Early/simpler variant of the live `Sp_GetMachineByApsRule` (主计划:自定义排程规则) — APS rule-based machine picker for a work-order process. Returns the chosen 机台 (sReturnMachineId) but lacks the `sReturnInfo` reason-trace OUT param the live version carries. + +**What it does:** Picks `eleprocessmachine` default-rebound when `p_sMachineid` is blank, else excludes the current machine; falls through to a `Machine_Tmp` rule-table search keyed by 印刷颜色/重量/长宽/工艺/材料/产品分类/客户备注 from `eleprocessmachineapsrule`. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep across all extensions). Superseded by `Sp_GetMachineByApsRule` (109K body, called per-row by `BtnCalculationServiceImpl.doSetTimeCalcMachineHour()` over `mftproductionplanslave`). Chinese suffix `(排程直接下达)` suggests this was the "直接下达" path variant before the unified version subsumed it. diff --git a/en/docs/auto-catalog/procedures/Sp_GetMasterSlave.md b/en/docs/auto-catalog/procedures/Sp_GetMasterSlave.md index b44c3b9..c1aa49e 100644 --- a/en/docs/auto-catalog/procedures/Sp_GetMasterSlave.md +++ b/en/docs/auto-catalog/procedures/Sp_GetMasterSlave.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Master-slave table-config lookup — given a table name, returns the canonical master-table name + comma-joined slave-table list + master/slave/update key columns out of `masterslavetableconfig`. Used by the universal save/delete/invalidate plumbing to know which slave tables to cascade an action across. + +**What it does:** Trims the input, does a `LIKE '%name%'` lookup against `masterslavetableconfig`, and writes the five OUT params; when no row matches, treats the input as the master table itself (`sMasterColumn='sId'`, no slaves). + +**Invocation:** Called by `Sp_DelMasterSlave_Pro`, `Sp_DelMasterSlave_Pro2`, `Sp_Invalidation`, `Sp_UpdateAdd_Check`, `Sp_UpdateAdd_Check_NEW` — all of which are themselves dispatched by Java `BusinessBaseServiceImpl` / `BusinessCheckServiceImpl` / `CheckmodelServiceImpl` during the universal add-update / invalidate / delete CRUD pipeline. Catalog header `根据模块sId删除模块(包含子模块)` is mis-copied from a different routine; body is a config-lookup, not a delete. diff --git a/en/docs/auto-catalog/procedures/Sp_GetOrder_Process.md b/en/docs/auto-catalog/procedures/Sp_GetOrder_Process.md index 55fb84e..a73f6fe 100644 --- a/en/docs/auto-catalog/procedures/Sp_GetOrder_Process.md +++ b/en/docs/auto-catalog/procedures/Sp_GetOrder_Process.md @@ -1,11 +1,11 @@ # `Sp_GetOrder_Process` (procedure) -> @author: qmj - - @date:20210714 封存 - - @describe : 以工单号关联,各阶段插入一条数据,显示各阶段是否完成 - 订单-> 工单-> 工序-> 上报-> 成品入库-> 送货-> 收款 +> @author: qmj + + @date:20210714 封存 + + @describe : 以工单号关联,各阶段插入一条数据,显示各阶段是否完成 + 订单-> 工单-> 工序-> 上报-> 成品入库-> 送货-> 收款 发外-> 发外入库 @@ -39,4 +39,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 进度相关查询 → 订单生产进度查询 (form `生产进度查询明细`, sId `19211681019715708441995850`) and 常用报表 → 订单进度 (form `订单生产进度`, sId `101251240115015897738521350`) — per-工单号 stage tracker showing whether each downstream phase (订单 → 工单 → 工序 → 上报 → 成品入库 → 送货 → 收款; outsourcing branch: 发外 → 发外入库) has been reached/completed. Supports paging, group-by, filter, and total-count aggregation in one call. + +**What it does:** Builds a `p_tmp_T` temp table with an `iOrder`/`sType` row per stage; for each stage SELECTs the corresponding bill row out of `salsalesordermaster`/`mftworkorder*`/`opsoutsideprocess*`/`mit*storein`/`saldeliver*`/`salrct*` keyed by 工单号, joining `mftworkorderslave` for parts breakdown. Honors `Fun_GetLookCustomer` for data-scope, dynamically composes the OFFSET/LIMIT + ORDER BY + `sGroupby_group_sql`/`sGroupby_select_sql` fragments, and returns the result set + paging metadata in `totalCount`/`countMapJson`. + +**Invocation:** Form-master `sSqlStr` binding on two forms (above). Proc header is marked `@date:20210714 封存` (sealed) by author qmj, but the form binding remains active in production — the seal is informational. diff --git a/en/docs/auto-catalog/procedures/Sp_GetWorkorderChildProductData.md b/en/docs/auto-catalog/procedures/Sp_GetWorkorderChildProductData.md index 8330401..767ce88 100644 --- a/en/docs/auto-catalog/procedures/Sp_GetWorkorderChildProductData.md +++ b/en/docs/auto-catalog/procedures/Sp_GetWorkorderChildProductData.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Production work-order child-product money/material denormalizer — for a given work-order (`sGuid`) + parent slave (`sSlaveId_s`) + intended save target (`sSaveSlaveId_s`), copies each child row's 15 money columns (`dProductMoney`, `dProductNoTaxMoney`, `dProductTaxMoney`, `dPrintBeforeMoney`/`dPrintMoney`/`dPrintAfterMoney`, master/auxiliary 材料 totals, 印刷成品 amount, etc.) from `mftworkorderslave_tmp` into the staging `mftworkorderslave_tmp_tmp` table, then recurses one level deeper via `Sp_GetMftWorkorderChildProductData`. + +**What it does:** Counts child rows in `mftworkorderslave_tmp` keyed by `sParentId=sGuid AND sFatherSlaveId=sSlaveId_s` scoped to the make-person + tenant; iterates them via cursor; for each one INSERTs the money columns into `mftworkorderslave_tmp_tmp` then calls `Sp_GetMftWorkorderChildProductData(sGuid, p_sSlaveId, sSaveSlaveId_s, ...)` to descend further. Used as part of the BS-product packed-data recalc pipeline. + +**Invocation:** Status: appears orphaned in the current DB. The install-script copy at `xly-src/script/标版/30100101/Sp_WorkOrder_CalcDataPackLastStd.sql` does have a `CALL Sp_GetWorkorderChildProductData(...)` line, but the in-DB `Sp_WorkOrder_CalcDataPackLastStd` body no longer contains that call — the chain has been refactored out. Its callee `Sp_GetMftWorkorderChildProductData` is also missing from the DB. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Graphic_Report_Analysis_Data.md b/en/docs/auto-catalog/procedures/Sp_Graphic_Report_Analysis_Data.md index a98c125..d37236f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Graphic_Report_Analysis_Data.md +++ b/en/docs/auto-catalog/procedures/Sp_Graphic_Report_Analysis_Data.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Demo-data emitter for an early graphical-report Analysis chart. The body builds five hardcoded JSON literals (sample machine-Gantt + month-money series with literal x/y values like `"11-24"/"SM74"`, `"1"/245`, etc.) — no real database reads. Intended as a placeholder while the actual chart pipeline was being designed. + +**What it does:** Sets `@jsonString` through `@jsonString5` to concatenated literal JSON strings (machine-name Gantt strip, monthly revenue line, etc.) and returns one via `sReturn`. The IN params `sGdsconfigCharMasterId` / `sSqlCondition` / `sLoginId` are unused. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines). The only xly-src reference is a commented-out block in `CharServiceImpl` (the `getDataByCode` chart-data path) — the live chart pipeline uses `getConfigZx(code, sSqlConditionMap)` instead, with this CALL block left as dead code. Zero rows in `gdsconfigcharmaster.sProcedureName` reference this name. Candidate for removal once a maintainer confirms no chart-master row points at it. diff --git a/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_Customer.md b/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_Customer.md index 8fdc874..4907d50 100644 --- a/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_Customer.md +++ b/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_Customer.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务 → 凭证 → 辅助核算 (sissubject) seeding — back-populates the `sissubject` accounting-subject table with one row per `elecustomer` row that doesn't yet have an associated subject. `sFormId='1'` is the subject-type code for 客户 (customer) within `sissubject`. Part of the 凭证生成 (voucher-generation) installation bundle. + +**What it does:** Reads the current `MAX(iOrder)` for `sFormId='1'` scoped to brand/subsidiary, then INSERTs into `sissubject` (`sId=newId()`, `sSrcId=E.sId`, `sFormId='1'`, monotonically-incremented `iOrder`, `sThirdNo=E.sCustomerNo`) for every `elecustomer` row whose `sId` is not already linked. Idempotent — repeated runs add only newly-created customers. + +**Invocation:** Status: appears orphaned in production runtime. Defined in install scripts `xly-src/script/标版/upgrade/20211115生成凭证/Sp_ImportSubjectAssociate_Customer.sql` and `xly-src/script/标版/30100101/Sp_ImportSubjectAssociate_Customer.sql` — a one-shot 凭证生成 DBA seeding bundle that's run during tenant provisioning, not wired to any form/button/gdsmodule hook or Java service. Family siblings (`_depart` sFormId=7, `_materials` sFormId=6, `_materialsclassify` sFormId=5, `_Supply` sFormId=4, `_Product` sFormId=3, `_ProductClassify` sFormId=2, `_WareHouse`) follow the same pattern. diff --git a/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_Product.md b/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_Product.md index 34df0b9..d6594e4 100644 --- a/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_Product.md +++ b/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_Product.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务 → 凭证 → 辅助核算 (sissubject) seeding — 成品 (`eleproduct`) variant of the `Sp_ImportSubjectAssociate_*` family. `sFormId='3'` is the subject-type code for product within `sissubject`. + +**What it does:** Reads `MAX(iOrder)` for `sFormId='3'`, then INSERTs into `sissubject` (`sId=newId()`, `sSrcId=E.sId`, `sFormId='3'`, incremented `iOrder`) for every `eleproduct` row whose `sId` is not already a `sissubject.sSrcId`. Idempotent. + +**Invocation:** Status: appears orphaned in production runtime. Defined in `xly-src/script/标版/upgrade/20211115生成凭证/Sp_ImportSubjectAssociate_Product.sql` (one-shot 凭证生成 DBA seeding bundle, run during tenant provisioning). No form/button/gdsmodule hook references it. See `Sp_ImportSubjectAssociate_Customer` for the family mapping. diff --git a/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_ProductClassify.md b/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_ProductClassify.md index e50c3c8..18e9d16 100644 --- a/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_ProductClassify.md +++ b/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_ProductClassify.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务 → 凭证 → 辅助核算 (sissubject) seeding — 成品分类 (`sisproductclassify`) variant of the `Sp_ImportSubjectAssociate_*` family. `sFormId='2'` is the subject-type code for product-classify within `sissubject`. Carries an extra `sFormGuid` IN param (unused in current body) compared to siblings — leftover from the generic-button calling convention. + +**What it does:** Reads `MAX(iOrder)` for `sFormId='2'`, then INSERTs into `sissubject` (`sId=newId()`, `sSrcId=E.sId`, `sFormId='2'`, incremented `iOrder`) for every `sisproductclassify` row whose `sId` is not already a `sissubject.sSrcId`. Idempotent. + +**Invocation:** Status: appears orphaned in production runtime. Defined in `xly-src/script/标版/upgrade/20211115生成凭证/Sp_ImportSubjectAssociate_ProductClassify.sql` (one-shot 凭证生成 DBA seeding bundle, run during tenant provisioning). No form/button/gdsmodule hook references it. See `Sp_ImportSubjectAssociate_Customer` for the family mapping. diff --git a/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_Supply.md b/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_Supply.md index 634d911..8b77c12 100644 --- a/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_Supply.md +++ b/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_Supply.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务 → 凭证 → 辅助核算 (sissubject) seeding — 供应商 (`elesupply`) variant of the `Sp_ImportSubjectAssociate_*` family. `sFormId='4'` is the subject-type code for supplier within `sissubject`. Unlike most siblings, also persists `sThirdNo=sSupplyNo` and `sSupplyName` directly into the subject row. + +**What it does:** Reads `MAX(iOrder)` for `sFormId='4'`, then INSERTs into `sissubject` (`sId=newId()`, `sSrcId=E.sId`, `sFormId='4'`, incremented `iOrder`, `sThirdNo=E.sSupplyNo`, `sSupplyName=sSupplyName`) for every `elesupply` row whose `sId` is not already a `sissubject.sSrcId`. Idempotent. Note: `sSupplyName` is referenced bare (not `E.sSupplyName`) — it relies on column ambiguity preserving the supplier's name from the source table, which works in MySQL with the current FROM-list shape but is fragile if the alias `E` is later required. + +**Invocation:** Status: appears orphaned in production runtime. Defined in `xly-src/script/标版/upgrade/20211115生成凭证/Sp_ImportSubjectAssociate_Supply.sql` (one-shot 凭证生成 DBA seeding bundle, run during tenant provisioning). No form/button/gdsmodule hook references it. See `Sp_ImportSubjectAssociate_Customer` for the family mapping. diff --git a/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_WareHouse.md b/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_WareHouse.md index 816dec4..5e58334 100644 --- a/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_WareHouse.md +++ b/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_WareHouse.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 系统初始化 / 科目-辅助核算关联导入 — bulk-seeds the 仓库 (warehouse) auxiliary-accounting (辅助核算) association rows for accounting subject `sFormId='8'` into `sissubject`. Run once after warehouses are set up so the GL can post by warehouse dimension. + +**What it does:** Reads the current max `iOrder` from `sissubject WHERE sFormId='8'` for the (`sBrId`,`sSuId`) tenant, then `INSERT INTO sissubject` one row per `SisWareHouse` that isn't already associated (`NOT EXISTS sissubject.sSrcId=E.sId`), filling `sSrcId=warehouse.sId`, incrementing `iOrder` via a SQL session variable. Idempotent. + +**Invocation:** Status: appears orphaned. Not bound to any form-master, `gdsmodule` save/proc hook, `gdsmoduleflow` workflow, or other DB routine. xly-src ships only the install scripts (`script/标版/upgrade/20211115生成凭证/Sp_ImportSubjectAssociate_WareHouse.sql` and `script/标版/30100101/Sp_ImportSubjectAssociate_WareHouse.sql`) — no Java caller found. Candidate for maintainer audit; likely intended as a manual DBA seed step alongside the rest of the `Sp_ImportSubjectAssociate_*` family. diff --git a/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_depart.md b/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_depart.md index cfe7784..da25277 100644 --- a/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_depart.md +++ b/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_depart.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务 → 凭证 → 辅助核算 (sissubject) seeding — 部门 (`sisdepart`) variant of the `Sp_ImportSubjectAssociate_*` family. `sFormId='7'` is the subject-type code for department within `sissubject`. Back-populates one row per `sisdepart` not yet linked. + +**What it does:** Reads `MAX(iOrder)` for `sFormId='7'`, then INSERTs into `sissubject` (`sId=newId()`, `sSrcId=E.sId`, `sFormId='7'`, incremented `iOrder`) for every `sisdepart` row whose `sId` is not already a `sissubject.sSrcId`. Idempotent. + +**Invocation:** Status: appears orphaned in production runtime. Defined in `xly-src/script/标版/upgrade/20211115生成凭证/Sp_ImportSubjectAssociate_depart.sql` (one-shot 凭证生成 DBA seeding bundle, run during tenant provisioning). No form/button/gdsmodule hook references it. See `Sp_ImportSubjectAssociate_Customer` for the family mapping. diff --git a/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_materials.md b/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_materials.md index 1c67913..2adc3b7 100644 --- a/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_materials.md +++ b/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_materials.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务 → 凭证 → 辅助核算 (sissubject) seeding — 材料 (`elematerials`) variant of the `Sp_ImportSubjectAssociate_*` family. `sFormId='6'` is the subject-type code for material within `sissubject`. Back-populates one row per `elematerials` not yet linked. + +**What it does:** Reads `MAX(iOrder)` for `sFormId='6'`, then INSERTs into `sissubject` (`sId=newId()`, `sSrcId=E.sId`, `sFormId='6'`, incremented `iOrder`) for every `elematerials` row whose `sId` is not already a `sissubject.sSrcId`. Idempotent. + +**Invocation:** Status: appears orphaned in production runtime. Defined in `xly-src/script/标版/upgrade/20211115生成凭证/Sp_ImportSubjectAssociate_materials.sql` (one-shot 凭证生成 DBA seeding bundle, run during tenant provisioning). No form/button/gdsmodule hook references it. See `Sp_ImportSubjectAssociate_Customer` for the family mapping. diff --git a/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_materialsclassify.md b/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_materialsclassify.md index b602dae..27e815f 100644 --- a/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_materialsclassify.md +++ b/en/docs/auto-catalog/procedures/Sp_ImportSubjectAssociate_materialsclassify.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务 → 凭证 → 辅助核算 (sissubject) seeding — 材料分类 (`sismaterialsclassify`) variant of the `Sp_ImportSubjectAssociate_*` family. `sFormId='5'` is the subject-type code for material-classify within `sissubject`. + +**What it does:** Reads `MAX(iOrder)` for `sFormId='5'`, then INSERTs into `sissubject` (`sId=newId()`, `sSrcId=E.sId`, `sFormId='5'`, incremented `iOrder`) for every `sismaterialsclassify` row whose `sId` is not already a `sissubject.sSrcId`. Idempotent. + +**Invocation:** Status: appears orphaned in production runtime. Defined in `xly-src/script/标版/upgrade/20211115生成凭证/Sp_ImportSubjectAssociate_materialsclassify.sql` (one-shot 凭证生成 DBA seeding bundle, run during tenant provisioning). No form/button/gdsmodule hook references it. See `Sp_ImportSubjectAssociate_Customer` for the family mapping. diff --git a/en/docs/auto-catalog/procedures/Sp_InsertVoucher.md b/en/docs/auto-catalog/procedures/Sp_InsertVoucher.md index b6f6c9b..558ef54 100644 --- a/en/docs/auto-catalog/procedures/Sp_InsertVoucher.md +++ b/en/docs/auto-catalog/procedures/Sp_InsertVoucher.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 财务凭证 — legacy hard-coded voucher generator for 销售发票 (`salsalesinvoicemaster`). Predecessor of the `Sp_InsertVoucher_Universals*` template-driven family. Loops the month's `bCheck=1` sales invoices grouped by `dCurrencyRate, sAccountNo, sCustomerId, sMReserve1` and writes one `udfvouchermaster`/`udfvoucherslave` per group, with the account routing 国内 vs 国外 invoices to different `sAccountNo` lines (`5102.04`, etc.) according to hand-coded if-branches. + +**What it does:** Bails out if any `udfvouchermaster` row already exists for the current `YEAR(SYSDATE())/MONTH(SYSDATE())` — the proc is single-run-per-month. Otherwise opens cursor over `salsalesinvoicemaster` between `tStartDate..tEndDate`, calls `Sp_Sis_GetConst` for localised constants and `SP_Sis_GetMaxNo` for the voucher number, then `Insert Into udfvouchermaster`/`udfvoucherslave` for each rate-account-customer-MReserve1 group. Does not back-write to the source invoice. + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, no `gdsconfigformmaster` reference, no Java grep hit anywhere in `xly-src/`, and the modern path runs through `Sp_InsertVoucher_Universals_Pro` (dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()`). One DB caller — `Sp_InsertVoucher_salsaleschecking` — references the name but is itself a per-form variant in the same legacy family. Candidate for maintainer audit / removal once retention rules confirm no scheduled job calls it. diff --git a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Cahpayment.md b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Cahpayment.md index c8373a2..f43bf56 100644 --- a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Cahpayment.md +++ b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Cahpayment.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务 / 自动凭证 — generates accounting vouchers (`udfvouchermaster` + `udfvoucherslave`) for bank 付款单 (cash-payment) bills `cahpaymentmaster` of `sSettlementId='bank'` over a chosen date range. Per-supplier × bank-account × currency-rate aggregation; flips each consumed row's `iVouchermark=1` so it won't re-post. + +**What it does:** Reads the date range from `$.changeValue[0].pChooseDate` of `sProInParam`. Cursors over `cahpaymentmaster GROUP BY sSupplyId, sBankId, dCurrencyRate WHERE bCheck=1 AND tCreateDate IN [start,end) AND sSettlementId='bank' AND iVouchermark=0`. For the first row per group, allocates a new voucher number via `SP_Sis_GetMaxNo('udfvouchermaster',…,'1012512401150…')` and inserts the voucher master with `sVoucherType='记'`. Then inserts voucher-slave debit/credit entries summing the payment-detail money by accounting subject and stamps each consumed `cahpaymentmaster` with `iVouchermark=1`. + +**Invocation:** Status: appears orphaned. Signature is the standard `GenericProcedureCallServiceImpl.doGenericProcedureCall()` voucher-button shape, but no form-master/`gdsmodule`/workflow/other-routine reference and no xly-src match besides the install script `script/标版/30100101/Sp_InsertVoucher_Cahpayment.sql`. Sibling of `Sp_InsertVoucher_Cahreceipt` (收款单 counterpart); superseded by the template-driven `Sp_InsertVoucher_Universal`/`Sp_InsertVoucher_Universals_All`. Candidate for maintainer audit — may be dead code retained for the legacy workbench. diff --git a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Cahreceipt.md b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Cahreceipt.md index bc0a6ec..2e7715f 100644 --- a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Cahreceipt.md +++ b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Cahreceipt.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务 / 自动凭证 — generates accounting vouchers (`udfvouchermaster` + `udfvoucherslave`) for bank 收款单 (cash-receipt) bills `cahreceiptmaster` of `sSettlementId='bank'` over a chosen date range. Cash-receipt counterpart of `Sp_InsertVoucher_Cahpayment`. + +**What it does:** Up-front guard: if `udfvouchermaster` already has a same-day voucher with `bCheck=0`, refuses with the localised `sCahreceiptNeedCheck` message ("当日已生成凭证单据,请先审核再做此操作") from `Fun_Sis_GetConst`. Parses the date range from `$.changeValue[0].pChooseDate`. Cursors over `cahreceiptmaster GROUP BY sCustomerId, sBankId, dCurrencyRate WHERE bCheck=1 AND tCreateDate IN [start,end) AND sSettlementId='bank' AND iVouchermark=0`. Per group allocates a voucher number via `SP_Sis_GetMaxNo`, inserts master + debit/credit slave rows, sets `iVouchermark=1` on the consumed receipts. + +**Invocation:** Status: appears orphaned. Signature matches the `GenericProcedureCallServiceImpl.doGenericProcedureCall()` voucher-button shape but no form-master/`gdsmodule`/workflow/other-routine reference and no xly-src match besides install script `script/标版/30100101/Sp_InsertVoucher_Cahreceipt.sql`. Sibling: `Sp_InsertVoucher_Cahreceipt1` (variant). Likely superseded by `Sp_InsertVoucher_Universal*`; candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Cahreceipt1.md b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Cahreceipt1.md index abf1124..c27b1bc 100644 --- a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Cahreceipt1.md +++ b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Cahreceipt1.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务 / 自动凭证 — variant of `Sp_InsertVoucher_Cahreceipt` (note the `1` suffix). Same 收款单 → 凭证 (cash-receipt → voucher) shape but groups on `cahreceiptmaster.sBankId1` (the second bank-account column) instead of `sBankId`, and extends `tEndDate` by one day so receipts dated on the end-date itself are included. Likely a parallel branch for a customer running dual-bank-account receipts. + +**What it does:** Parses the date range from `$.changeValue[0].pChooseDate`, then `tEndDate = DATE_ADD(tEndDate, INTERVAL 1 DAY)`. Cursors over `cahreceiptmaster GROUP BY sCustomerId, sBankId1, dCurrencyRate WHERE bCheck=1 AND tCreateDate IN [start,end) AND sSettlementId='bank' AND iVouchermark=0`. Per group allocates a voucher number via `SP_Sis_GetMaxNo`, inserts `udfvouchermaster` + per-debit/credit `udfvoucherslave` rows, stamps each consumed receipt with `iVouchermark=1`. + +**Invocation:** Status: appears orphaned. No form-master/`gdsmodule`/workflow/other-routine reference and no xly-src match at all (not even an install script — the only existing copy is in the live DB). Almost certainly a one-off branch for a specific customer that never got mainlined; candidate for maintainer audit / removal. diff --git a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_PitProductReject.md b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_PitProductReject.md index 337d287..361883c 100644 --- a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_PitProductReject.md +++ b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_PitProductReject.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务 / 自动凭证 — generates accounting vouchers for 成品报废出库 (finished-product scrap-out) bills `PitProductRejectMaster` of `sMReserve2=2` (the "loss" disposition) over a chosen date range. Books the loss against `5601.05 营业外支出 - 财产损失` (Non-operating Income / property loss). + +**What it does:** Parses date range from `$.changeValue[0].pChooseDate`. Allocates a voucher number via `SP_Sis_GetMaxNo`, inserts `udfvouchermaster` (`sVoucherType='记'`). Builds `p_sInvoiceNo='报废出库+'+group_concat(sBillNo)` for the period. Inserts a single `udfvoucherslave` debit line summing `A.dCost` for `PitProductRejectMaster WHERE bCheck=1 AND iVouchermark=0 AND sMReserve2=2 AND tCreateDate IN [start,end)`, hardcoded to account `5601.05 营业外支出 Non_operating Income-财产损失`. (Credit-side and `iVouchermark=1` flip are presumably in the remainder of the body.) + +**Invocation:** Status: appears orphaned. No form-master/`gdsmodule`/workflow/other-routine reference and no xly-src match besides install script `script/标版/30100101/Sp_InsertVoucher_PitProductReject.sql`. Signature matches the `GenericProcedureCallServiceImpl.doGenericProcedureCall()` voucher-button shape; likely superseded by `Sp_InsertVoucher_Universal*`. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universal.md b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universal.md index b375807..3a1b46f 100644 --- a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universal.md +++ b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universal.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务 / 凭证模板 / 自动凭证 (通用) — template-driven generic voucher generator. Replaces the per-source `Sp_InsertVoucher_` family with one parametric proc that takes a `sVoucherId` (pointing at `udfvouchertemplatemaster`) and assembles a voucher from whichever source table the template names. The companion `Sp_InsertVoucher_Universals_All` is the bulk version (no `sVoucherId` — picks the default template per `sFormId`). + +**What it does:** Extracts `sTemplateGuid` from `$.changeValue.sVoucherId` (returns `'未选择凭证模板,请选择后操作'` with `sCode=-1` if empty). Looks up template metadata (`sVoucherFormId`, `sSumType`, `sVoucherOrder`) from `udfvouchertemplatemaster` and the source-table name + label from `gdsconfigformmaster`. Derives `p_sVoucherTableName` by stripping `master`/`slave` suffix and prepending `viw_` so it always reads the view. Reads already-posted `sSrcSlaveId` from `viw_udfvoucher` to skip already-posted source rows; then for the remaining source rows uses `sSumType` (sCustomerId / sSupplyId / sBillNo / sFormId) as the grouping key and `sVoucherOrder` to drive the debit/credit ordering. Allocates voucher numbers via `SP_Sis_GetMaxNo` and inserts `udfvouchermaster` + `udfvoucherslave`. Also tracks per-column flags (`b_sWareHouseId`, `b_sMaterialsId`, `b_sCustomerId`, `b_sSupplyId`, `b_sProductId`) so the template can opt-in to auxiliary-accounting dimensions. + +**Invocation:** Status: appears orphaned. Signature matches the `GenericProcedureCallServiceImpl.doGenericProcedureCall()` voucher-button shape; no form-master/`gdsmodule`/workflow reference and no xly-src match besides install scripts (`script/标版/30100101/Sp_InsertVoucher_Universals.sql` and `script/标版/upgrade/20211115生成凭证/Sp_InsertVoucher_Universal_month.sql`). Likely the "single-bill" entry point for the template engine, invoked from a 生成凭证 button on the 凭证模板 module that didn't survive into the current form-master definitions. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universals.md b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universals.md index 5e8b8fa..dee8acc 100644 --- a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universals.md +++ b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universals.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 财务凭证 — generic per-bill voucher generator (legacy/v1). Earlier sibling of `Sp_InsertVoucher_Universals_Pro` with the same goal: turn user-selected source-bill ids plus a `udfvouchertemplatemaster` template into rows in `udfvouchermaster`/`udfvoucherslave`. Differs from the `_Pro` variant in its parameter shape (per-row `{sId, sVoucherId, sMemo}` only, no `sSlaveId`) and in its WHILE-loop driver instead of the `_Pro` set-based INSERT. + +**What it does:** Reads `$.params[0].value[*]` JSON; for each entry validates `sId` and `sVoucherId` (returns `chooseData` / `sInsertVoucherNoPzTemplate` localised via `Fun_Sis_GetConst` if missing) then inserts into temp table `p_voucherId_TableId`. Builds `p_voucherUniversal` from the template-mapped source rows across `accopsoutsideinstoremaster`, `accpurchaseinstoremaster`, `cahpaymentmaster`, `cahreceiptmaster`, `opsoutsideinstoremaster`, `purpurchaseinstoremaster`, `saldelivergoodsslave`. `CALL SP_Sis_GetMaxNo` to issue a `sVoucherNo`, then `Insert Into udfVoucherMaster`/`udfVoucherSlave` and back-write the voucher number on the source rows. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — same toolbar surface as `Sp_InsertVoucher_Universals_Pro` ("生成凭证" on the 应收/应付/出纳/成本相关转财务凭证 modules). Shipped twice in xly-src: `script/标版/upgrade/20211115生成凭证/Sp_InsertVoucher_Universals.sql` (initial) and `script/标版/30100101/Sp_InsertVoucher_Universals.sql` (current). Variants: `_Pro` (newer per-bill), `_All` (one voucher for everything), `_ByMounth` (monthly aggregate). diff --git a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universals_All.md b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universals_All.md index b0d7b62..32cd940 100644 --- a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universals_All.md +++ b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universals_All.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务 / 凭证模板 / 自动凭证 (通用-批量) — bulk-variant of `Sp_InsertVoucher_Universal`. Drives off the default template (`udfvouchertemplatemaster.bDefault=1`) for a given source `sFormId` instead of a user-picked `sVoucherId`, and supports both 正向 (`b_bMinus=false`) and 红字 (`b_bMinus=true`) voucher generation in one call. Used for the "process every checked row" workflow on a 凭证模板 grid. + +**What it does:** Looks up the default template for `sFormId` (`sSumType`, `sVoucherOrder`, `bMinus`, `sId`) from `udfvouchertemplatemaster`. Resolves the source table name + label from `gdsconfigformmaster` for the form's master child. Calls `Sp_SplicingTableSql(sFormId, sTemplateGuid, …, p_sLoginId, …)` to populate the per-session work-table `mftVoucherUniversalTmp` with all rows ready to post. Cursors that work-table `GROUP BY sSumType`; per group allocates voucher number(s) via `SP_Sis_GetMaxNo`, inserts `udfvouchermaster` (with `p_sVoucherMinusNo` for the offsetting 红字 entry when `bMinus=1`) + `udfvoucherslave` debit/credit rows aggregated from the work-table. + +**Invocation:** Status: appears orphaned. Signature (note the extra `sFormId` param) matches the `GenericProcedureCallServiceImpl.doGenericProcedureCall()` voucher-button shape; no form-master/`gdsmodule`/workflow reference and no xly-src match besides install script `script/标版/30100101/Sp_InsertVoucher_Universals_All.sql`. Companion procs: `Sp_InsertVoucher_Universal` (single-template), `Sp_InsertVoucher_Universals` (legacy), `Sp_InsertVoucher_Universals_Pro` (extended), `Sp_InsertVoucher_Universals_ByMounth` (monthly). Candidate for maintainer audit — the proper end-to-end caller chain for the template engine should be verified before relying on this. diff --git a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universals_ByMounth.md b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universals_ByMounth.md index fd54709..cddfdf3 100644 --- a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universals_ByMounth.md +++ b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universals_ByMounth.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 财务凭证 — month-end voucher batch generator for the 财务凭证 (`udfvouchermaster`/`udfvoucherslave`) feed. Variant of `Sp_InsertVoucher_Universals` / `Sp_InsertVoucher_Universals_Pro` that aggregates an entire month's source bills (sales/purchase deliveries, cash receipt/payment, outsourcing in-store, production materials, etc.) into one voucher per template rather than per source bill. + +**What it does:** Reads the default `udfvouchertemplatemaster` row (`bDefault=1`) for `sVoucherFormId=sFormId` to obtain `sSumType`, `sVoucherOrder`, `bMinus`. Builds temp table `p_voucherUniversal` and copies the month's qualifying source rows from `accopsoutsideinstoremaster`, `accpurchaseinstoremaster`, `cahpaymentmaster`, `cahreceiptmaster`, `opsoutsideinstoremaster`, `purpurchaseinstoremaster`, `saldelivergoodsslave`, `mitproductionmaterialsslave` according to the template's mapping rules. `CALL SP_Sis_GetMaxNo` to issue a `sVoucherNo`, then `Insert Into udfVoucherMaster`/`udfVoucherSlave` and back-write `sVoucherId` onto the source rows so they aren't re-billed next run. + +**Invocation:** Dispatched dynamically via `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the toolbar button on the 财务凭证模板 / 财务凭证 grid that produces the month's vouchers names this proc as the action. Status: appears orphaned in xly-src — no install script under `script/标版/30100101/`, no Java reference, and the per-bill `Sp_InsertVoucher_Universals_Pro` is the path actually shipped today. Verify before relying on the by-month variant. diff --git a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universals_Pro.md b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universals_Pro.md index 04165fa..0bb8149 100644 --- a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universals_Pro.md +++ b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_Universals_Pro.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 财务凭证 — per-bill voucher generator. Given a user-selected set of source-bill ids and a `udfvouchertemplatemaster` template, builds one `udfvouchermaster`/`udfvoucherslave` voucher per source bill following the template's main/slave mapping (`sSumType`, `sVoucherOrder`). This is the modernised replacement for `Sp_InsertVoucher_Universals` — same idea but driven by an explicit selection passed as JSON in `sProInParam`. + +**What it does:** Parses `$.params[0].value[*].{sId, sSlaveId, sVoucherId, sMemo}` from `sProInParam`. Drops/recreates temp table `p_voucherId_TableId` and inserts the per-bill selections via dynamic `INSERT INTO p_voucherId_TableId` built with `CONCAT`. Returns `-1 / chooseData` if nothing chosen, `sInsertVoucherProNoValidData` if no valid ids, or `sInsertVoucherProNoValidTemplate` if no template id (messages localised via `Fun_Sis_GetConst`). For each selected bill: `call Sp_SplicingTableSql` to build the mapped column SELECT, `CALL SP_Sis_GetMaxNo` to issue `sVoucherNo`, then `Insert Into udfVoucherMaster`/`udfVoucherSlave` and stage rows in `mftVoucherUniversalTmp`. Final `Update udfvouchermaster` writes back the issued voucher number on the source. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the "生成凭证" toolbar button on per-source modules (销售对账→凭证, 采购对账→凭证, 收款单→凭证, 付款单→凭证, 生产领料→凭证, 应收/应付/出纳/成本相关转财务凭证) names this proc as the action. Install script `script/标版/30100101/Sp_InsertVoucher_Universals_Pro.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_mitproductionmaterials.md b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_mitproductionmaterials.md index ffe9f5d..9d194fa 100644 --- a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_mitproductionmaterials.md +++ b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_mitproductionmaterials.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务 / 自动凭证 — generates accounting vouchers for 生产领料 (production material-issue) bills `mitproductionmaterialsmaster` (via `viw_mitproductionmaterials`) over a chosen date range. Companion `Sp_InsertVoucher_mitproductionmaterialsBF` covers the 报废出库 (scrap-out) branch (`sFormId='192116810113315268872698730'`) which this proc deliberately excludes. + +**What it does:** Parses date range from `$.changeValue[0].pChooseDate`. Pre-flight `SELECT EXISTS` on `viw_mitproductionmaterials WHERE bCheck=1 AND sSReserve4<>'' AND iVouchermark=0 AND sFormId<>'' AND tCreateDate IN (start,end)`. Cursors `GROUP BY sSReserve4` (the cost-allocation key on the issue slip); per group allocates a voucher number with `SP_Sis_GetMaxNo`, inserts master + debit/credit slave rows summing the material costs and flips `iVouchermark=1` on the consumed issue rows. + +**Invocation:** Status: appears orphaned. No form-master/`gdsmodule`/workflow/other-routine reference and no xly-src match besides install script `script/标版/30100101/Sp_InsertVoucher_mitproductionmaterials.sql`. Signature matches the `GenericProcedureCallServiceImpl.doGenericProcedureCall()` voucher-button shape; likely superseded by `Sp_InsertVoucher_Universal*`. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_mitproductionmaterialsBF.md b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_mitproductionmaterialsBF.md index 8790cf2..0cf7d71 100644 --- a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_mitproductionmaterialsBF.md +++ b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_mitproductionmaterialsBF.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务 / 自动凭证 — 报废出库 (scrap-out, "BF" = 报废) branch of the production-materials voucher generator. Counterpart to `Sp_InsertVoucher_mitproductionmaterials`: this proc handles only the rows of `mitproductionmaterialsmaster` with `sFormId='192116810113315268872698730'` (the dedicated scrap-out form), generating the `营业外支出-财产损失` style voucher for material write-offs. + +**What it does:** Parses date range from `$.changeValue[0].pChooseDate`. Builds `p_sInvoiceNo = CONCAT('报废出库+', group_concat(sBillNo))` from `mitproductionmaterialsmaster WHERE bCheck=1 AND sFormId='' AND iVouchermark=0 AND tCreateDate IN (start,end)`. If any rows exist, allocates a voucher number via `SP_Sis_GetMaxNo`, inserts `udfvouchermaster` (`sVoucherType='记'`) and `udfvoucherslave` debit/credit lines summing the scrapped-cost amounts, then flips `iVouchermark=1`. + +**Invocation:** Status: appears orphaned. No form-master/`gdsmodule`/workflow/other-routine reference and no xly-src match besides install script `script/标版/30100101/Sp_InsertVoucher_mitproductionmaterialsBF.sql`. Signature matches the `GenericProcedureCallServiceImpl.doGenericProcedureCall()` voucher-button shape; likely superseded by `Sp_InsertVoucher_Universal*` template-driven generator. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_opsoutsidechecking.md b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_opsoutsidechecking.md index 631229c..90eed41 100644 --- a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_opsoutsidechecking.md +++ b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_opsoutsidechecking.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务 / 自动凭证 — generates accounting vouchers for 委外加工对账 (outsource-processing reconciliation) bills via `Viw_opsoutsidechecking`. Posts the period's outsourced-process settlements as `生产成本 / 应付账款` style entries grouped by (currency-rate × supplier × material-classify-subject). + +**What it does:** Reads `p_sSrcInvoiceNo` from `udfvoucherslave.sMemo` over the period to skip already-posted bills (`INSTR(p_sSrcInvoiceNo, sInvoiceNo)<=0`). Refreshes `opsoutsidecheckingmaster.sMreserve1` from `sisproductclassify.sAccountNo` via the product → product-classify chain so each row carries the correct cost-account. Cursors `viw_opsoutsidechecking GROUP BY dCurrencyRate, sSupplyId, sMReserve1 WHERE bCheck=1 AND iVouchermark=0 AND sProcessId=''`. Per group: allocates `SP_Sis_GetMaxNo` voucher number, inserts master + debit/credit slave rows from the slave detail summing money, stamps `iVouchermark=1`. + +**Invocation:** Status: appears orphaned. No form-master/`gdsmodule`/workflow/other-routine reference and no xly-src match besides install script `script/标版/30100101/Sp_InsertVoucher_opsoutsidechecking.sql`. Sibling: `Sp_InsertVoucher_opsoutsideinvoice` (委外发票 counterpart). Signature matches the `GenericProcedureCallServiceImpl.doGenericProcedureCall()` voucher-button shape; likely superseded by `Sp_InsertVoucher_Universal*`. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_opsoutsideinvoice.md b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_opsoutsideinvoice.md index b352959..d19d848 100644 --- a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_opsoutsideinvoice.md +++ b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_opsoutsideinvoice.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务 / 自动凭证 — generates accounting vouchers for 委外发票 (outsource-processing invoice) bills via `viw_opsoutsideinvoice`. Companion to `Sp_InsertVoucher_opsoutsidechecking` (对账 side); this one posts the invoice/payable leg. + +**What it does:** Parses date range from `$.changeValue[0].pChooseDate`. Reads `p_sSrcInvoiceNo` from already-posted `udfvoucherslave.sMemo` over the period to skip duplicates (`INSTR(p_sSrcInvoiceNo, sInvoiceNo)<=0`). Cursors `viw_opsoutsideinvoice GROUP BY dCurrencyRate, sSupplyId WHERE bCheck=1 AND iVouchermark=0 AND tCreateDate IN [start,end)`. Per group: allocates a voucher number via `SP_Sis_GetMaxNo`, inserts `udfvouchermaster` (`sVoucherType='记'`) + `udfvoucherslave` debit/credit rows summing money for the supplier/rate pair, and flips `iVouchermark=1` on the consumed invoices. + +**Invocation:** Status: appears orphaned. No form-master/`gdsmodule`/workflow/other-routine reference and no xly-src match besides install script `script/标版/30100101/Sp_InsertVoucher_opsoutsideinvoice.sql`. Signature matches the `GenericProcedureCallServiceImpl.doGenericProcedureCall()` voucher-button shape; likely superseded by `Sp_InsertVoucher_Universal*`. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_purpurchaseinvoice.md b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_purpurchaseinvoice.md index d190218..7c35706 100644 --- a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_purpurchaseinvoice.md +++ b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_purpurchaseinvoice.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务 / 自动凭证 — generates accounting vouchers for 采购对账 (purchase-reconciliation) bills `purpurchasecheckingmaster` (the proc despite its name actually drives off `purpurchasechecking*`, not the invoice tables) over a chosen date range. Posts the period's purchase-receivable accounts grouped by (currency-rate × supplier × material-classify-subject). + +**What it does:** Parses date range from `$.changeValue[0].pChooseDate`. Refreshes `purpurchasecheckingmaster.sMreserve1` from `sismaterialsclassify.sAccountNo` via the materials → materials-classify chain so each row carries the correct subject. Cursors `Viw_purpurchasechecking GROUP BY dCurrencyRate, sSupplyId, sMReserve1 WHERE bCheck=1 AND iVouchermark=0`. Per group: allocates a voucher number via `SP_Sis_GetMaxNo`, inserts `udfvouchermaster` + `udfvoucherslave` debit/credit rows summing the slave detail money, stamps `iVouchermark=1` on the consumed reconciliation rows. + +**Invocation:** Status: appears orphaned. No form-master/`gdsmodule`/workflow/other-routine reference and no xly-src match besides install script `script/标版/30100101/Sp_InsertVoucher_purpurchaseinvoice.sql`. Signature matches the `GenericProcedureCallServiceImpl.doGenericProcedureCall()` voucher-button shape; likely superseded by `Sp_InsertVoucher_Universal*`. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_salsaleschecking.md b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_salsaleschecking.md index 673db70..3d4d821 100644 --- a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_salsaleschecking.md +++ b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_salsaleschecking.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务 / 自动凭证 — generates accounting vouchers for 销售对账 (sales-reconciliation) bills `salsalescheckingmaster` over a chosen date range. Sales counterpart to `Sp_InsertVoucher_purpurchaseinvoice`. Tail-calls `Sp_InsertVoucher_salsalescheckingGW` to cover the 港外 / 港外特殊 (overseas/special) branch. + +**What it does:** Parses date range from `$.changeValue[0].pChooseDate`. Reads `p_sSrcInvoiceNo` from already-posted `udfvoucherslave.sMemo` over the period for dedup. Cursors `viw_salsaleschecking GROUP BY dCurrencyRate, sCustomerId, sMReserve1 WHERE bCheck=1 AND iVouchermark=0` (subject is propagated from `sisproductclassify.sAccountNo` similarly to the purchase variant). Per group allocates a voucher number via `SP_Sis_GetMaxNo`, inserts `udfvouchermaster` + `udfvoucherslave` debit/credit rows summing money for the customer/rate/subject tuple, and stamps `iVouchermark=1`. After the main loop, `CALL Sp_InsertVoucher_salsalescheckingGW(sProInParam, …)` to handle the GW branch in the same run. + +**Invocation:** Status: appears orphaned at the dispatcher level. No form-master/`gdsmodule`/workflow reference and no xly-src match besides install script `script/标版/30100101/Sp_InsertVoucher_salsaleschecking.sql`. Signature matches the `GenericProcedureCallServiceImpl.doGenericProcedureCall()` voucher-button shape; likely superseded by `Sp_InsertVoucher_Universal*`. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_salsalescheckingGW.md b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_salsalescheckingGW.md index f56f4ea..8113dc2 100644 --- a/en/docs/auto-catalog/procedures/Sp_InsertVoucher_salsalescheckingGW.md +++ b/en/docs/auto-catalog/procedures/Sp_InsertVoucher_salsalescheckingGW.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务 / 自动凭证 — GW (港外, "off-port"/overseas) variant of the 销售对账 voucher generator. Identical mechanics to `Sp_InsertVoucher_salsaleschecking` but covers the subset of sales-reconciliation rows that the parent skips, so that overseas sales post into their own subject set (typically the 5102.04 / foreign-currency branch). + +**What it does:** Parses date range from `$.changeValue[0].pChooseDate`. Reads `p_sSrcInvoiceNo` from already-posted `udfvoucherslave.sMemo` to dedup. Cursors `viw_salsaleschecking GROUP BY dCurrencyRate, sCustomerId, sMReserve1 WHERE bCheck=1 AND iVouchermark=0 AND `, tracking the previous customer (`p_sOldCustomerId`) to start a new voucher when it changes. Per group: allocates a voucher number via `SP_Sis_GetMaxNo`, inserts `udfvouchermaster` + `udfvoucherslave` debit/credit rows summing money, stamps `iVouchermark=1`. + +**Invocation:** Called by DB proc `Sp_InsertVoucher_salsaleschecking` at the end of its main loop (`call Sp_InsertVoucher_salsalescheckingGW(sProInParam, …)`). xly-src ships install scripts for both as siblings in `script/标版/30100101/`. No direct form-master/`gdsmodule`/workflow/Java caller — only reachable via the parent. diff --git a/en/docs/auto-catalog/procedures/Sp_Insert_EstimateInstore.md b/en/docs/auto-catalog/procedures/Sp_Insert_EstimateInstore.md index d68ed3d..a5f0d2a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Insert_EstimateInstore.md +++ b/en/docs/auto-catalog/procedures/Sp_Insert_EstimateInstore.md @@ -19,4 +19,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 月结 / 暂估入库生成 — month-end "estimated receipt" (暂估入库) generator. After 财务月结 (financial period-close) runs, this proc rolls every `viw_purpurchaseinstore` row whose source 采购入库 (purchase-into-store) has no matching 采购发票 (purchase invoice) into the period's estimated-receipt accrual so that the cost can be booked even though the invoice hasn't yet arrived. Reversed automatically next period. + +**What it does:** Resolves `p_sPriorPeriod` and `p_sNextPeriod` from `sysaccountperiod` (the periods immediately before / after `p_sPeriod`). Builds temp table `accpurchaseinstoremasterTmp` mirroring the `accpurchaseinstoremaster` shape (~30 columns) and seeds it from `viw_purpurchaseinstore` with `bInvalid=0 AND bcheck=1 AND date_format(tCreateDate,'%Y%m')=p_sPeriod`, stamping `sCostPeriod=p_sPeriod`, `sCostNextPeriod=p_sNextPeriod`. The temp table then drives the actual `accpurchaseinstoremaster`/`accpurchaseinstoreslave` insert (plus the offsetting next-period reversal rows) and links each accrual back to the source via `sSrcId`/`sSrcSlaveId`. + +**Invocation:** Called by DB proc `Sp_financialClosing_BtnEventCheckout` (财务月结 → 结账 button-event handler) during the month-end-close pipeline alongside `Sp_financialClosing_BtnEventCalcMaterialPrice` and `Sp_plan_mftproductionplanBak`. xly-src ships the install script `script/标版/30100101/Sp_Insert_EstimateInstore.sql` and a copy inside the bundled `Sp_financialClosing_BtnEventCheckout.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Insert_fixedassetsprovision.md b/en/docs/auto-catalog/procedures/Sp_Insert_fixedassetsprovision.md index 3373b91..d1fc788 100644 --- a/en/docs/auto-catalog/procedures/Sp_Insert_fixedassetsprovision.md +++ b/en/docs/auto-catalog/procedures/Sp_Insert_fixedassetsprovision.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 固定资产 / 折旧计提 — generates the period's 固定资产折旧计提 (fixed-asset depreciation provision) rows by snapshotting equipment masters into `elefixedassetsprovision`. The target period is derived from the latest 固定资产→凭证 voucher in `udfvouchermaster`, so it always lines up with the next month after the most-recent depreciation voucher. + +**What it does:** Parses `$.params` from `sProInParam` (count is read but currently ignored — the commented-out early-return shows an intended "no rows selected" guard). Reads `MAX(tVoucherDate)+1 month` from `udfvouchermaster WHERE sType='固定资产->凭证'` into `p_sCostPeriod`. `DELETE FROM elefixedassetsprovision WHERE sCostPeriod=p_sCostPeriod` to keep it idempotent, then `INSERT INTO elefixedassetsprovision` copying the machine master columns from `elemachine` / `elefixedassets` (machine no/name/style/type/property, work-type/calendar, APS rules, all `sMReserve*`/`dMReserve*`/`iMReserve*` reserves), stamped with the new period. + +**Invocation:** Status: appears orphaned at the dispatcher level. The signature matches the `GenericProcedureCallServiceImpl.doGenericProcedureCall()` button-event contract (`sProInParam` + `sFormId` + OUT `sReturn`/`sCode`), suggesting it's meant to be wired to a 折旧计提 button on the 固定资产 module, but no form-master/gdsmodule/workflow binding currently references it and no xly-src match exists. Candidate for maintainer audit before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Invalid_backwriting.md b/en/docs/auto-catalog/procedures/Sp_Invalid_backwriting.md index 439e484..8883a7d 100644 --- a/en/docs/auto-catalog/procedures/Sp_Invalid_backwriting.md +++ b/en/docs/auto-catalog/procedures/Sp_Invalid_backwriting.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Per-form 作废 / 取消作废 back-write dispatcher. Chained from `Sp_Invalidation` after the `bInvalid` flag flip succeeds — translates the generic "void this row" intent into the form-specific upstream/downstream reversal by routing to the right `Sp_afterSave_s` / `Sp_beforeSave_s` handler based on the form's `sFormGuid`. Without this hop, a void on a 销售订单 would not roll back the qty written on its source 销售订单需求 (Sod), a void on a 采购订单 would not roll back the qty on `purpurchaseplanmaster` (Pod), etc. + +**What it does:** Strips a leading comma from `sGuid`. Then a long if/elseif ladder matches `sFormGuid` against a dozen-plus form ids (销售订单 family Sod, 采购订单 Pod, 送货通知 Dgn, …). For each match, when `bInvalid=0` (取消作废 / unvoid) it `call Sp_beforeSave_s(sGuid, sBrId, sSuId, sCode, sReturn)` to re-apply the row's effects upstream; when `bInvalid=1` (作废) it `call Sp_afterSave_s(...)` to reverse them. The pre/after naming is reversed relative to ordinary save semantics — `Sp_afterSave` is the "now that the row is gone, undo what it did" handler. + +**Invocation:** Called only by `Sp_Invalidation` — see that proc's narrative for the Java entry point (`CheckmodelServiceImpl.invalidationCheckModel()`). The 6-step search finds the install script at `script/标版/30100101/Sp_Invalid_backwriting.sql` and one DB caller (`Sp_Invalidation`). Maintenance note: adding a new form that needs void/unvoid back-write requires extending the ladder here as well as supplying the matching `Sp_beforeSave_*` / `Sp_afterSave_*` pair. diff --git a/en/docs/auto-catalog/procedures/Sp_Invalidation.md b/en/docs/auto-catalog/procedures/Sp_Invalidation.md index 8ecc3c0..34c36a6 100644 --- a/en/docs/auto-catalog/procedures/Sp_Invalidation.md +++ b/en/docs/auto-catalog/procedures/Sp_Invalidation.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Generic 作废 / 取消作废 (void / unvoid) engine. Sits behind every "作废" toolbar button across the ERP — drives the row-level flag flip on `bInvalid` for any master/slave table, then chains the per-form back-write via `Sp_Invalid_backwriting`. Effectively the cross-module counterpart of `Sp_Sis_Delete` for the soft-delete path. + +**What it does:** Validates `sGuids` / `sTableName` / `sBrId` / `sSuId` / `sHandleType` (returns the localised `paramsErro` from `Sp_Sis_GetConst` if any is empty). `CALL Sp_GetMasterSlave(sTableName, …)` to resolve master/slave table names, save-table list, master/slave delete-id columns. Sets `bInvalid=1` when `sHandleType<>'cancel'`, else `0`. Updates the master rows' `bInvalid` flag and propagates to the slave tables. Finally `call Sp_Invalid_backwriting(sGuid, sFormGuid, sTableName, bInvalid, …)` to dispatch the per-form upstream/downstream reversal logic. + +**Invocation:** Called by `CheckmodelServiceImpl.invalidationCheckModel()` (xly-src `xlyBusinessService/.../CheckmodelServiceImpl.java`) — the constant `String Sp_Invalidation = "Sp_Invalidation"` is dispatched via `procedureService.getDoProMap()` + `getCallPro()` whenever the user clicks 作废 / 取消作废 on any module. Java-side pre-check `checkCanbInvalid()` filters out the master-data tables (`elecustomer`/`elematerials`/`eleproduct`/`elemachine`/`elesupply`/`eleworkcenter`/`eleprocess`) before the call. Install script `script/标版/30100101/Sp_Invalidation.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_InOutStore.md b/en/docs/auto-catalog/procedures/Sp_Inventory_InOutStore.md index 278239f..6ad0223 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_InOutStore.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_InOutStore.md @@ -37,4 +37,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 分析报表 → 材料存货核算 — material inventory in/out report. Per-material opening + in + out + closing summary over a date window scoped by warehouse / location / business-tenant, with optional cost view via `iViewOperation`. The 财务 view that lets accounting reconcile the warehouse moves against the cost ledger before period-close. + +**What it does:** Defaults `tStartDate` to NOW-1 month and `tEndDate` to NOW. Reads `SysSystemSettings.CbxLanguage` for the active locale and the materials-cost-mode (`plannedpurchase` default). Builds temp tables `p_TmpInOutStore` (movement detail), `p_Tmp_LastStore` (opening stock) and `p_Tmp_LastInitStore` (period-initial baseline), plus `TmpMitMaterialsStore` for the per-material rollup. Aggregates moves from the 入库 / 出库 transaction tables filtered by `sMaterialsGuid` / `sParentGuid` / `sWarehouseGuid` / `sLocationGuid` / `sWarehouseLocationGuid`. Calls `Sp_Sis_GetConst` for localised constants, `Sp_Sis_GetMertialsInventoryFormGuid` to resolve which 入库/出库 form-guids belong to inventory, and finally `CALL Sp_Outstanding_Query` to apply `bFilter` / `sFilterOrderBy` / paging / `countCloumn` summing and return the report rowset and `countMapJson`. + +**Invocation:** Bound as the data source of the 材料存货核算 report form (sId `101251240115016213194820420`) under 财务管理 → 分析报表 → 材料存货核算 (gdsmodule sId `101251240115016213194819340`). Dispatched by the form-binding service when the user opens the report. Install scripts: `script/标版/30100101/Sp_Inventory_InOutStore.sql` and a performance/lock variant `script/标版/optimize/Sp_Inventory_InOutStore.sql` — verify which is deployed. Variants: `Sp_Inventory_InOutStoreCost` (cost-only), `Sp_Inventory_InOutStoreNew` (newer rewrite with period-start handling). diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_InOutStoreCost.md b/en/docs/auto-catalog/procedures/Sp_Inventory_InOutStoreCost.md index 79ad203..c292f5e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_InOutStoreCost.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_InOutStoreCost.md @@ -37,4 +37,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 分析报表 → 材料存货核算 (cost view) — cost-side cut of the 材料存货核算 report. Same temp-table shape as `Sp_Inventory_InOutStore` but stripped down to the columns and joins needed for the financial cost reconciliation (no language switching, no inventory-form lookup) — produces opening / movement / closing **amounts** rather than full audit-trail detail. + +**What it does:** Defaults `tStartDate` to NOW-1 month and `tEndDate` to NOW. Builds `p_TmpInOutStore` and `p_Tmp_LastInitStore` temp tables and populates them from the 入库 / 出库 transaction tables filtered by `sMaterialsGuid` / `sParentGuid` / `sWarehouseGuid` / `sLocationGuid` / `sWarehouseLocationGuid`. Updates the rollups with cost calculations. Finally `CALL Sp_Outstanding_Query` to apply `bFilter` / `sFilterOrderBy` / paging / `countCloumn` summing and return the report rowset and `countMapJson`. + +**Invocation:** Bound to the cost-side data source of the 材料存货核算 report (same module 财务管理 → 分析报表 → 材料存货核算). Dispatched by the form-binding service when the user opens the cost view of the report. Install scripts: `script/标版/optimize/Sp_Inventory_InOutStoreCost.sql` and `script/标版/30100101/cost/Sp_Inventory_InOutStoreCost.sql` — verify which is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_InOutStoreNew.md b/en/docs/auto-catalog/procedures/Sp_Inventory_InOutStoreNew.md index b56b783..b22c070 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_InOutStoreNew.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_InOutStoreNew.md @@ -37,4 +37,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 分析报表 → 材料存货核算 — newer rewrite of `Sp_Inventory_InOutStore`. Adds `p_tPeriodStartDate` period-start handling so the opening balance is anchored to the 期初 baseline (`mitmaterialsinitmaster`) rather than recomputed from move history each time, and clamps `tEndDate` to NOW so future dates do not skew the report. + +**What it does:** Defaults `tStartDate` to NOW-1 month, clamps `tEndDate` to MIN(tEndDate, NOW()), and reads `SysSystemSettings.CbxLanguage` for the active locale and the materials-cost-mode. Builds `p_TmpInOutStore` movement-detail, `p_Tmp_LastStore` opening-stock, `p_Tmp_LastInitStore` period-initial-baseline (sourced via `FROM mitmaterialsinitmaster`) and `TmpMitMaterialsStore` per-material rollup temp tables. Filters by `sMaterialsGuid` / `sParentGuid` / `sWarehouseGuid` / `sLocationGuid` / `sWarehouseLocationGuid`. Calls `Sp_Sis_GetConst` for localised constants and `Sp_Sis_GetMertialsInventoryFormGuid` to resolve inventory form-guids, then `CALL Sp_Outstanding_Query` for paging and column-config emission. + +**Invocation:** Same module as the legacy `Sp_Inventory_InOutStore` (财务管理 → 分析报表 → 材料存货核算, gdsmodule sId `101251240115016213194819340`). Status: present in DB but no install script in xly-src and no `gdsconfigformmaster.sSqlStr` match (the form binding still points at `Sp_Inventory_InOutStore`). Appears to be a forward-staged rewrite not yet promoted to the form binding; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_InOutStoreNew1.md b/en/docs/auto-catalog/procedures/Sp_Inventory_InOutStoreNew1.md index 67f25a5..11990f9 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_InOutStoreNew1.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_InOutStoreNew1.md @@ -37,4 +37,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料库存 → 材料进销存 — abandoned/experimental variant of the material in-out-store (进销存) report driver. The naming (`*New1`) sits alongside `Sp_Inventory_InOutStoreNewTotal` and the production-side `Sp_Inventory_MaterialsInOutStoreDoing` as parallel iterations of the same opening-balance + movement + closing-balance computation against `mitmaterialsstore`, `elematerialsstockmonth`, `mitmaterialsinitmaster`. + +**What it does:** Defaults the window to the last month, builds temp tables `p_Tmp_LastInitStore`, `p_Tmp_LastStore`, `p_TmpInOutStore`, and `TmpMitMaterialsStore` to gather initial stock, period-start stock, and per-period in/out movements per material/warehouse/location. Resolves the period via `sysaccountperiod`, fetches form-config constants via `Sp_Sis_GetMertialsInventoryFormGuid` + `Sp_Sis_GetConst`, and emits the paginated rowset through `CALL Sp_Outstanding_Query`. + +**Invocation:** Status: appears orphaned. No caller found in any channel — no `gdsconfigformmaster` binding, no `gdsmodule` hook, no proc/function reference, and no `xly-src` grep hit. Looks like an in-progress fork of the live report (the `1` suffix suggests an iteration); candidate for maintainer audit before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_InOutStoreNewTotal.md b/en/docs/auto-catalog/procedures/Sp_Inventory_InOutStoreNewTotal.md index 2be63b7..91ee375 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_InOutStoreNewTotal.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_InOutStoreNewTotal.md @@ -37,4 +37,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料库存 → 材料进销存 — totals variant of the material in-out-store (进销存) report driver. Sibling of `Sp_Inventory_InOutStoreNew1`; both are detached forks of the live `Sp_Inventory_MaterialsInOutStoreDoing` that powers the 材料进销存报表 form. + +**What it does:** Same opening-balance + period-movement + closing-balance computation as `Sp_Inventory_InOutStoreNew1` over `mitmaterialsstore`, `EleMaterialsStock`, `elematerialsstockmonth`, `mitmaterialsinitmaster`. Builds the same temp-table chain (`p_Tmp_LastInitStore` / `p_Tmp_LastStore` / `p_TmpInOutStore` / `TmpMitMaterialsStore`), pulls account period from `sysaccountperiod`, calls `Sp_Sis_GetMertialsInventoryFormGuid` + `Sp_Sis_GetConst` for form-config, and ships the paginated rowset via `Sp_Outstanding_Query`. The `Total` suffix collapses to per-material aggregates rather than per-warehouse/location detail. + +**Invocation:** Status: appears orphaned. No caller in any channel — no form binding, no module hook, no proc/function reference, no `xly-src` reference. Looks like a detached experimental fork; candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_Machine_MaterialsInventory.md b/en/docs/auto-catalog/procedures/Sp_Inventory_Machine_MaterialsInventory.md index 9953441..c4ffdd8 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_Machine_MaterialsInventory.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_Machine_MaterialsInventory.md @@ -45,4 +45,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 / 机台终端 — machine-side material inventory lookup, intended for the shop-floor / 机台 (machine terminal) UI. The leading comment in the body literally says `-- 材料库存`. Parallel to `Sp_Inventory_MaterialsInventoryV56` (the general 材料可用库存查询 report) but parameterised for per-machine queries with `iDetailStock` / `iAdditionalMaterialInfo` toggles. + +**What it does:** Builds `p_TmpMaterialsStoreList` / `p_TmpMaterialsStoreList_sMaterial` from `MitMaterialsStore`, `MitMaterialsStoreVirtual`, `EleMaterialsStock`, joined to `EleMaterials`. Reads decimal precision from `SysSystemSettings`, supports per-material/style/warehouse/location filters and `bFilter` dynamic where clauses, and ships the paginated rowset through `Sp_Outstanding_Query`. + +**Invocation:** Status: appears orphaned in the live DB — no `gdsconfigformmaster` binding, no `gdsmodule` hook, no other-routine reference. xly-src ships install script `script/标版/30100101/schedule/Sp_Inventory_Machine_MaterialsInventory.sql` (sibling of `Sp_Inventory_Machine_MaterialsWarning.sql` and the printing-machine output reports under the same `schedule/` folder), so it's part of the optional 机台 add-on bundle; binding likely arrives only when that bundle's forms are installed. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_Machine_MaterialsWarning.md b/en/docs/auto-catalog/procedures/Sp_Inventory_Machine_MaterialsWarning.md index 06cc417..71f8a2e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_Machine_MaterialsWarning.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_Machine_MaterialsWarning.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 / 机台终端 — machine-side material shortage/over-stock warning lookup, the 机台 (machine terminal) counterpart of the desk-side `Sp_Inventory_MaterialsWarning`. Returns the rows that breach min/max safety thresholds, ready to be displayed on the shop-floor screen next to the running machine. + +**What it does:** Populates temp table `p_TMP_MaterialsWarning` from `elematerials` + `elematerialsstock` + `mitmaterialsstorevirtual` joined to `siswarehouse`, applies dynamic `bFilter`, and paginates through `Sp_Outstanding_Query`. Lighter than its desk-side sibling — no `elematerialssafe` reference, no _2 secondary working set, so the threshold source comes from the material card directly. + +**Invocation:** Status: appears orphaned in the live DB — no `gdsconfigformmaster` binding, no `gdsmodule` hook, no other-routine reference. xly-src ships install script `script/标版/30100101/schedule/Sp_Inventory_Machine_MaterialsWarning.sql` next to `Sp_Inventory_Machine_MaterialsInventory.sql` under the optional 机台 add-on bundle; binding likely arrives only when that bundle's forms are installed. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInOutStoreDoing.md b/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInOutStoreDoing.md index 89f7916..b746cf5 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInOutStoreDoing.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInOutStoreDoing.md @@ -36,4 +36,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料库存 → 材料库存查询 → 材料进销存报表 — current implementation of the material in-out-store (进销存) report. Per material/warehouse, shows opening balance, every in/out movement type aggregated, and closing balance over the user's date window. Replaces the earlier `SP_Inventory_InOutWareHouseAll` (now bound only to the "(旧)" legacy form) and the abandoned `Sp_Inventory_InOutStoreNew1` / `Sp_Inventory_InOutStoreNewTotal` forks. + +**What it does:** Builds working set `p_TmpInOutStore` (and uniqueness helper `p_TmpInOutStore_uniq`) from `mitmaterialsstore`, `elematerialsstockmonth`, `eleproductstockmonth`, `elematerials`, joined to `siswarehouse`. Resolves form-config via `Sp_Sis_GetMertialsInventoryFormGuid`, supports per-material/style/warehouse/location filtering and dynamic `bFilter` predicates, and paginates via the standard report-tail pattern. + +**Invocation:** Bound as the data source of form 材料进销存报表 (sId `192116810113315311950986680`) under 材料库存 → 材料库存查询 → 材料进销存报表 — loaded when the user opens the report; the form-binding dispatcher reads the proc name from `gdsconfigformmaster.sSqlStr`. No other DB or `xly-src` callers. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56.md b/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56.md index 65ec25d..2ddb09e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56.md @@ -45,4 +45,13 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料库存 → 材料库存查询 → 材料可用库存查询 — the live V56-revision available-stock query for materials. Also drives the 材料库存 widget on the 工作台 → 常用报表 dashboard and the 材料实际库存查询 form under the same module group. Answers "for each material, how much can I actually allocate right now?" by netting physical stock against locked/virtual reservations. + +**What it does:** Builds `p_TmpMaterialsStoreList` and the per-material auxiliary set `p_TmpMaterialsStoreList_sMaterial` from `MitMaterialsStore` (physical lots) + `MitMaterialsStoreVirtual` (locked/reserved) + `EleMaterialsStock` (rolling totals), joined to `EleMaterials` and `siswarehouse`. Reads decimal precision from `SysSystemSettings`. Supports per-material/style/warehouse/location/classification filters, `iHasZero` (include zero-stock rows), `iSumQty`, `iSales`, `iDetailStock`, `iAdditionalMaterialInfo`, dynamic `bFilter`, then paginates via `Sp_Outstanding_Query`. + +**Invocation:** Bound as the data source of three forms via `gdsconfigformmaster.sSqlStr`: +- 材料可用库存查询 (sId `192116810113315275580988560`) — 材料库存 → 材料库存查询 +- 材料库存 (sId `192116810113315275746226950`) — 移动端管理 → 工作台 → 常用报表 +- 材料实际库存查询 (sId `101251240115015897740323900`) — 材料库存 → 材料库存查询 + +Also referenced by `Fun_getInitColumnByProName` (the metadata function that maps proc name → returned column list). xly-src ships install script `script/标版/30100101/Sp_Inventory_MaterialsInventoryV56.sql` plus a customer-override at `script/客户/千彩/Sp_Inventory_MaterialsInventoryV56.sql` (tenant 千彩 carries a forked version — verify which is deployed for that customer). diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56Price.md b/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56Price.md index 56a0732..68b060e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56Price.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56Price.md @@ -45,4 +45,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Price-detail variant of `Sp_Inventory_MaterialsInventoryV56` — the available-stock query with extra cost/price columns surfaced. Sibling of `_Line` (per-lot) and `_Total` (aggregated) in the V56 family. + +**What it does:** Same `p_TmpMaterialsStoreList` + `p_TmpMaterialsStoreList_sMaterial` build over `MitMaterialsStore`, `MitMaterialsStoreVirtual`, `EleMaterialsStock`, `EleMaterials`. Reads decimal precision from `SysSystemSettings` and paginates via `Sp_Outstanding_Query`, with the projection extended to include per-lot `dMaterialsPrice`-derived columns. + +**Invocation:** Status: appears orphaned in the live DB — no `gdsconfigformmaster` binding, no `gdsmodule` hook, no other-routine reference. xly-src ships it under `script/标版/optimize/Sp_Inventory_MaterialsInventoryV56Price.sql` (the `optimize/` directory holds performance/lock-tuning patches), suggesting it was developed as an opt-in price-aware variant. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56_Line.md b/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56_Line.md index 64da822..6ec6b50 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56_Line.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56_Line.md @@ -45,4 +45,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Per-line (按行) variant of `Sp_Inventory_MaterialsInventoryV56` — returns one row per warehouse/location lot rather than aggregating to per-material. Sits alongside `Sp_Inventory_MaterialsInventoryV56_Total` (aggregated) and `Sp_Inventory_MaterialsInventoryV56Price` (price-detail variant) as the line-detail flavour of the 材料可用库存查询 family. + +**What it does:** Same `p_TmpMaterialsStoreList` + `p_TmpMaterialsStoreList_sMaterial` build from `MitMaterialsStore`, `MitMaterialsStoreVirtual`, `EleMaterialsStock`, `EleMaterials` joined to `siswarehouse`. Reads decimal precision from `SysSystemSettings`, paginates via `Sp_Outstanding_Query`. + +**Invocation:** Status: appears orphaned. No `gdsconfigformmaster` binding, no `gdsmodule` hook, no other-routine reference, no `xly-src` reference. The forms in the V56 family all bind to `Sp_Inventory_MaterialsInventoryV56` directly; this `_Line` variant looks like a detached intermediate fork. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56_Total.md b/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56_Total.md index ede0176..7d75464 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56_Total.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56_Total.md @@ -45,4 +45,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Aggregated (合计) variant of `Sp_Inventory_MaterialsInventoryV56` — collapses the available-stock query to one row per material across warehouses/locations. Sits alongside `Sp_Inventory_MaterialsInventoryV56_Line` (per-lot detail) and `Sp_Inventory_MaterialsInventoryV56Price` (price detail) as the totals flavour of the 材料可用库存查询 family. + +**What it does:** Same `p_TmpMaterialsStoreList` + `p_TmpMaterialsStoreList_sMaterial` build over `MitMaterialsStore`, `MitMaterialsStoreVirtual`, `EleMaterialsStock`, `EleMaterials`, `siswarehouse`. Sums `dAuxiliaryQty`, `dMaterialsQty`, weighted `dMaterialsPrice` per material, returning the aggregates both as the paginated rowset and via OUT scalars (signature still carries pagination params — likely a hybrid totaliser/list shape). + +**Invocation:** Status: appears orphaned. No `gdsconfigformmaster` binding, no `gdsmodule` hook, no other-routine reference, no `xly-src` reference. The live V56-family forms call `Sp_Inventory_MaterialsInventoryV56` directly; this `_Total` variant looks like a detached intermediate fork. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56_bakup.md b/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56_bakup.md index 5ff3e74..4d2c9cd 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56_bakup.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56_bakup.md @@ -45,4 +45,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup variant of `Sp_Inventory_MaterialsInventoryV56` (`_bakup` suffix — note the typo, not `_backup`). Per wiki convention, backup objects are not narrated. + +**What it does:** Same as `Sp_Inventory_MaterialsInventoryV56` at the time of copy — drives the 材料可用库存查询 / 材料库存 / 材料实际库存查询 reports, building `p_TmpMaterialsStoreList` from `MitMaterialsStore`, `MitMaterialsStoreVirtual`, `EleMaterialsStock` joined to `EleMaterials`. This earlier snapshot lacks the `p_TmpMaterialsStoreList_sMaterial` per-material auxiliary set that the live version uses. + +**Invocation:** Not expected to be called from production; verify before relying on it. No form binding, no module hook, no other-routine reference, no `xly-src` reference. The live forms call the un-suffixed `Sp_Inventory_MaterialsInventoryV56`. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56_bf_12_26.md b/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56_bf_12_26.md index b9f50eb..ea8d0eb 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56_bf_12_26.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventoryV56_bf_12_26.md @@ -45,4 +45,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup variant of `Sp_Inventory_MaterialsInventoryV56` (`_bf_12_26` suffix = "before 12-26" snapshot). Per wiki convention, backup objects are not narrated. + +**What it does:** Same as `Sp_Inventory_MaterialsInventoryV56` at the time of copy — drives the 材料可用库存查询 / 材料库存 / 材料实际库存查询 reports, building `p_TmpMaterialsStoreList` + `p_TmpMaterialsStoreList_sMaterial` from `MitMaterialsStore`, `MitMaterialsStoreVirtual`, `EleMaterialsStock`. Captures the proc body before a refactor on 12-26 of some year (snapshot does not preserve which year). + +**Invocation:** Not expected to be called from production; verify before relying on it. No form binding, no module hook, no other-routine reference, no `xly-src` reference. The live forms call the un-suffixed `Sp_Inventory_MaterialsInventoryV56`. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventory_Outdated.md b/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventory_Outdated.md index 66eb03b..fe453cc 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventory_Outdated.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsInventory_Outdated.md @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料库存 → 材料库存查询 → 库存呆滞料分析表 (material slow-moving / dead-stock analysis — "材料库龄分析详情表" per the page header). Buckets materials by how long the stock has been sitting in the warehouse (库龄 / inventory age), highlighting items that have not turned over within the threshold so purchasing/production can decide on consumption or write-down. + +**What it does:** Builds working tables `p_elematerialsstock_table`, `sp_mitmaterialsstore`, `sp_mitmaterialsstore_iRowNum`, `sp_mitmaterialsstore_sy` from `elematerialsstock` + `mitmaterialsstore`, ranks per-material lots by row number to identify the oldest residual quantities, computes their age vs. the reference date, then paginates the aging report. Form-config constants come from `Sp_Sis_GetMertialsInventoryFormGuid`. + +**Invocation:** Bound as the data source of form 库存呆滞料分析表 (sId `101801153119616611588427900`) under 材料库存 → 材料库存查询 → 库存呆滞料分析表 — loaded when the user opens the report. No other DB or `xly-src` callers. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsWarning.md b/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsWarning.md index f7e0c8f..00e8559 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsWarning.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_MaterialsWarning.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料库存 → 分析报表 — material stock-level alert driver. Powers both the over-stock alarm (材料库存超量预警表) and the under-stock alarm (材料库存不足预警表) by listing materials whose current stock breaches the upper or lower threshold from `elematerialssafe`. + +**What it does:** Builds working table `p_TMP_MaterialsWarning` (and secondary `p_TMP_MaterialsWarning_2` / `p_TMP_MaterialsWarning_` for per-material/per-style breakdowns) by joining `elematerials` to `elematerialssafe` (the per-material 安全库存 thresholds) and netting against `elematerialsstock` + `mitmaterialsstorevirtual` (locked stock). Joined to `siswarehouse` for per-warehouse splits. Form switches between over- and under-stock predicates based on `bFilter`. Final rowset paginated via `Sp_Outstanding_Query`. + +**Invocation:** Bound as the data source of both 材料库存超量预警表 (sId `19211681015115282648096630`) and 材料库存不足预警表 (sId `19211681015115282651657340`) under 材料库存 → 分析报表 via `gdsconfigformmaster.sSqlStr`. Also referenced by `Fun_getInitColumnByProName` (returned-column metadata). xly-src ships both `script/标版/30100101/Sp_Inventory_MaterialsWarning.sql` (install) and `script/标版/optimize/Sp_Inventory_MaterialsWarning.sql` (performance patch) — verify which is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStore.md b/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStore.md index 07172f5..a7a349a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStore.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStore.md @@ -37,4 +37,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成品库存 → 库存查询 → 成品进销存报表 / 成本管理 → 产品存货分析 → 产品存货核算 / 财务管理 → 分析报表 → 库存产品价值 — finished-product 进销存 (opening + in + out + closing) ledger across a date range. The same proc backs all three forms because they read the same `pitproductstore` movement table and only differ in column slicing. + +**What it does:** Defaults NULL inputs to `''`, sets `tStartDate`/`tEndDate` to current period bounds if missing, builds a temp ledger that (a) sums opening qty/money from `pitproductstore` rows before `tStartDate`, (b) inserts in-window receipts and dispatches grouped by product / 自定义项 / warehouse / location, then (c) joins `eleproduct`, `elecustomer`, `elewarehouse`, `elewarehouseLocation` for display columns. Final rowset/pagination flow via `Sp_Outstanding_Query` (filter, page, group-by, count-column JSON). `iViewOperation` toggles per-row drill-down vs. summary mode. + +**Invocation:** Bound as the data source on three form-masters: `19211681015115285230704000` (成品进销存报表 — 库存查询), `101251240115016213196171340` (产品存货核算 — 成本管理 → 产品存货分析), and `101251240115016215062363140` (库存产品价值 — 财务管理 → 分析报表). Form-binding dispatcher reads the proc name from `gdsconfigformmaster.sSqlStr`. Function `Fun_getInitColumnByProName` references it for column-config metadata. xly-src ships `script/标版/30100101/Sp_Inventory_ProductInOutStore.sql`; `script/客户/千彩/Sp_Inventory_ProductInOutStore.sql` is the 千彩 customer override. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStoreCost.md b/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStoreCost.md index 7c70fea..fb4b418 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStoreCost.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStoreCost.md @@ -38,4 +38,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Cost-focused split of the finished-product 进销存 ledger family (`Sp_Inventory_ProductInOutStore*`) — surfaces unit costs and cost-money columns rather than qty/sales-money, intended for the 成本管理 → 产品存货分析 cost-only view. The trailing `sCode`/`sReturn` OUT params follow the standard error-channel convention. + +**What it does:** Same temp-table pattern as `Sp_Inventory_ProductInOutStore`: aggregates `pitproductstore` rows into opening/in/out/closing across a date range per product / 自定义项 / warehouse / location, joins `eleproduct` etc. for display, but selects the `dCostPrice` / `dCostMoney` / `dProductPrice` columns. Delivered through `Sp_Outstanding_Query` for paging and count-JSON. + +**Invocation:** Status: appears orphaned. No form-master binding, no `gdsmodule` hook, no other DB caller, only the two install / optimize SQL files in xly-src (`script/标版/30100101/cost/Sp_Inventory_ProductInOutStoreCost.sql`, `script/标版/optimize/Sp_Inventory_ProductInOutStoreCost.sql`). Kept as a sibling of `Sp_Inventory_ProductInOutStore` but appears not wired into a live form-master row — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStoreDoing.md b/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStoreDoing.md index e72816f..ebd326a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStoreDoing.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStoreDoing.md @@ -37,4 +37,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成品库存 → 库存查询 → 成品进销存报表 / 成本管理 → 产品存货分析 → 产品存货核算 — in-progress / current-period (进行中) variant of `Sp_Inventory_ProductInOutStore`. Same ledger but truncated to the live period so users see the unposted current month's movements. + +**What it does:** Mirrors the structure of `Sp_Inventory_ProductInOutStore` (opening from `pitproductstore` before `tStartDate`, in-window receipts and dispatches, joins to `eleproduct`/`elecustomer`/`elewarehouse`, pagination via `Sp_Outstanding_Query`) but with date-range defaulting biased to the open period and without finalisation locks. `bFilter` is widened to `longtext` for the larger interactive filter payload the live-period view tends to carry. + +**Invocation:** Bound as the data source on form-masters `19211681015115285230704000` (成品进销存报表 — 库存查询) and `101251240115016213196171340` (产品存货核算 — 成本管理) — same two forms host the doing-period view selectable at runtime. xly-src ships `script/标版/30100101/cost/Sp_Inventory_ProductInOutStoreDoing.sql`; `script/客户/千彩/Sp_Inventory_ProductInOutStoreDoing.sql` is the 千彩 customer override. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStoreMoney.md b/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStoreMoney.md index 3aeaddd..3e85122 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStoreMoney.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStoreMoney.md @@ -1,9 +1,9 @@ # `Sp_Inventory_ProductInOutStoreMoney` (procedure) -> @author:杨恒林 - @date:20210521 封存 - @describe: 计算库存产品商品价值并存入月结表 主要思路如下: - 从本月月末之前最近一次订单取价格,如果取不到 从 产品客户表中取 ,再取不到 从产品表中取,再取不到,从最近取对帐 +> @author:杨恒林 + @date:20210521 封存 + @describe: 计算库存产品商品价值并存入月结表 主要思路如下: + 从本月月末之前最近一次订单取价格,如果取不到 从 产品客户表中取 ,再取不到 从产品表中取,再取不到,从最近取对帐 bUpdate = 1 时,表示月末结帐时调用,0:在库存商品价值表界面 调用 @@ -44,4 +44,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 库存商品价值 — month-end finished-product value posting (sealed). Per the proc header (`@author:杨恒林 @date:20210521 封存`): "computes inventory product value and writes it into the month-end ledger". Price source falls back through (1) most recent order before month-end, (2) `eleproductcustomer`, (3) `eleproduct`, then (4) most recent reconciliation. `bUpdate=1` is the month-end-close call site; `bUpdate=0` is the 库存商品价值 screen. + +**What it does:** Resolves a price per product/customer/warehouse via the four-step fallback chain (delegating to `Sp_System_CalcProductPrice`), multiplies it against current on-hand from `pitproductstore` / `eleproductstock`, and either returns the rowset (read-only mode) or writes the month-end posting back to the value ledger. Final rowset paginates through `Sp_Outstanding_Query`; the `sCode`/`sReturn` OUT params carry the standard error-channel on failure. + +**Invocation:** Status: appears orphaned — header explicitly marks the routine 封存 (sealed) on 20210521. No form-master binding, no `gdsmodule` hook, no other DB caller in the live schema. Only present in xly-src as `script/标版/optimize/Sp_Inventory_ProductInOutStoreMoney.sql` and `script/标版/30100101/cost/Sp_Inventory_ProductInOutStoreMoney.sql`. The live 库存产品价值 form binds to `Sp_Inventory_ProductInOutStore`, not this sealed variant. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStoreStock.md b/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStoreStock.md index b50cc05..a940b15 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStoreStock.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStoreStock.md @@ -1,8 +1,8 @@ # `Sp_Inventory_ProductInOutStoreStock` (procedure) -> @author:杨恒林 - @date:20210521 封存 - @describe: 库存商品价值:查询当前库存商品的价值,产品价格来源为 Sp_System_CalcProductPrice 这个过程 +> @author:杨恒林 + @date:20210521 封存 + @describe: 库存商品价值:查询当前库存商品的价值,产品价格来源为 Sp_System_CalcProductPrice 这个过程 从最近订单,产品客户表,产品表 三个地方取价格 @@ -41,4 +41,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 库存商品价值 — current finished-product inventory-value query (sealed). Per the proc header (`@author:杨恒林 @date:20210521 封存`): "library inventory value: queries current value with product price sourced via `Sp_System_CalcProductPrice` falling back from latest order → 产品客户表 → 产品表". Live 财务管理 → 分析报表 → 库存产品价值 form binding is the value-view side of the finished-product ledger family. + +**What it does:** Calls `Sp_System_CalcProductPrice` per product/customer to resolve a unit price (latest sales-order → `eleproductcustomer` → `eleproduct` fallback chain), aggregates `pitproductstore` per product / 自定义项 / warehouse / location to the current closing qty, multiplies into product value, and joins `eleproduct`/`elewarehouse`/`elecustomer` for display columns. Paginates / counts through `Sp_Outstanding_Query`. + +**Invocation:** Bound as the data source of form-master `101251240115016215062363140` (库存产品价值 — 财务管理 → 分析报表). Note the 封存 header indicates the proc was sealed in 2021 — the live form may instead dispatch to `Sp_Inventory_ProductInOutStore`; flag for maintainer verification of the actual runtime binding. xly-src ships `script/标版/30100101/cost/Sp_Inventory_ProductInOutStoreStock.sql` and `script/标版/optimize/Sp_Inventory_ProductInOutStoreStock.sql`; `script/客户/千彩/Sp_Inventory_ProductInOutStoreStock.sql` is the 千彩 customer override. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStore_new.md b/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStore_new.md index 79682e2..dcf7466 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStore_new.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInOutStore_new.md @@ -37,4 +37,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Newer-variant of `Sp_Inventory_ProductInOutStore` — finished-product 出入库流水账 / 进销存 report builder. The original is bound to the 成品进销存报表 (库存查询) and 产品存货核算 (成本管理) forms; this `_new` copy is a side-by-side replacement candidate retained for cutover. + +**What it does:** Same parameter contract as `Sp_Inventory_ProductInOutStore` (customer / product / 自定义项 / warehouse / date-range / page / filter inputs, OUT rowset + `totalCount` + `countMapJson`) with an extra `sLoginId` parameter early in the signature. Builds a temp ledger from `pitproductstore`, joins `eleproduct` / `elecustomer` / `elewarehouse` for display fields, paginates via `Sp_Outstanding_Query` and emits column-aggregation JSON. Diverges from the original mainly in opening-balance window handling and column lineup. + +**Invocation:** Status: appears orphaned. No form-master binding, no `gdsmodule` hook, no DB caller, no xly-src reference — kept as a parallel working copy of the production `Sp_Inventory_ProductInOutStore` while the rewrite was in flight. Candidate for maintainer audit before delete. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInventoryV56.md b/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInventoryV56.md index 09ae02b..a5b5931 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInventoryV56.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInventoryV56.md @@ -45,4 +45,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成品库存 → 库存查询 → 成品可用库存查询 / 移动端管理 → 工作台 → 常用报表 → 成品库存 — finished-product available-stock query. Shows current on-hand qty net of reservations, sliced by warehouse / location / 自定义项, used on both the desktop available-stock screen and the mobile workbench finished-stock card. + +**What it does:** Builds a temp ledger from `pitproductstore` plus `eleproductstock` aggregated per product / 自定义项 / warehouse / location, subtracting outstanding 送货 reservations and frozen-stock flags, then joins `eleproduct` / `elecustomer` / `elewarehouse` for display columns. Returns paginated rowset and count-aggregation JSON through `Sp_Outstanding_Query`. Switches: `iHasZero` keep/drop zero rows, `iGetQty` qty-only mode, `iSumQty` collapse to aggregates, `iDetailStock` detail mode, `iGetAvailableQty` toggle reservation netting. + +**Invocation:** Bound as the data source on form-masters `19211681015115285140931300` (成品可用库存查询 — 库存查询) and `101251240115015897741046460` (成品库存 — 移动端 → 工作台 → 常用报表). Function `Fun_getInitColumnByProName` references it for column metadata. xly-src ships `script/标版/30100101/Sp_Inventory_ProductInventoryV56.sql` and `script/标版/optimize/Sp_Inventory_ProductInventoryV56.sql`; `script/客户/千彩/Sp_Inventory_ProductInventoryV56_qc.sql` is the 千彩 override. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInventoryV56New.md b/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInventoryV56New.md index a7494aa..584e5c5 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInventoryV56New.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInventoryV56New.md @@ -44,4 +44,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Newer-variant of `Sp_Inventory_ProductInventoryV56` (finished-product available-stock query). Side-by-side replacement candidate retained for cutover testing — the live forms still bind to the `V56` proc, not this `V56New` copy. Parameter list omits the standard `sLoginId` second slot present on the base proc, matching the customer-override `_qc` shape. + +**What it does:** Same parameter shape and report contract as `Sp_Inventory_ProductInventoryV56`: aggregates `pitproductstore` / `eleproductstock` per product / 自定义项 / warehouse / location with reservation netting, joins display fields, paginates via `Sp_Outstanding_Query`. Likely diverges in the open-period boundary handling or in the join chain for reservation deductions. + +**Invocation:** Status: appears orphaned. No form-master binding, no `gdsmodule` hook, no other DB caller, no xly-src reference. Parallel working copy kept while a rewrite was in flight — candidate for maintainer audit before delete. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInventoryV56_qc.md b/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInventoryV56_qc.md index ffab689..dc7b8b7 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInventoryV56_qc.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInventoryV56_qc.md @@ -44,4 +44,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Customer-specific (千彩 / 全彩) override of `Sp_Inventory_ProductInventoryV56` — finished-product available-stock query. The `_qc` suffix is the 千彩 customer branch; the standard proc serves 成品库存 → 库存查询 → 成品可用库存查询. Parameter list omits the standard `sLoginId` second slot present on the base proc. + +**What it does:** Same parameter shape and table model as the standard `Sp_Inventory_ProductInventoryV56` (aggregates `pitproductstore` / `eleproductstock` per product / 自定义项 / warehouse / location across a date window, computes available qty, joins display fields, paginates through `Sp_Outstanding_Query`) but with customer-tailored column lineup and joins specific to 千彩's workflow. + +**Invocation:** Status: appears orphaned in the standard catalog. No form-master binding, no `gdsmodule` hook, no other DB caller in the live schema. Sole xly-src reference is the customer override file `script/客户/千彩/Sp_Inventory_ProductInventoryV56_qc.sql` — installed on the 千彩 tenant only. Candidate for maintainer audit when reconciling this dump against the 千彩 deployment. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInventory_Outdated.md b/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInventory_Outdated.md index 5a836c3..ccd89df 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInventory_Outdated.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_ProductInventory_Outdated.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成品库存 → 预警报表 → 产品库存呆滞预警表 — slow-moving / outdated (呆滞) finished-product warning report. Surfaces finished goods with on-hand qty above zero that have not moved for the configured period; sibling procs `_Customer` and `_Salesman` re-slice the same data by customer and salesperson dimensions. + +**What it does:** Defaults `iType=0` and clears NULLs. Builds temp table `TMP_TmpDatedProducts` mirroring `eleproductstock` (sId, product / 自定义项 / warehouse / location, qty, price, money, inventory/created/checked/production dates, work-order and order linkage, `bFrozen`, customer and product display fields). Populates it from `eleproductstock` joined to recent movement signals, computes the staleness window per `iType`, and emits the rowset paginated via `Sp_Outstanding_Query` with count-aggregation JSON. + +**Invocation:** Bound as the data source of form-master `19211681015115285256391940` (产品库存呆滞预警表 — 成品库存 → 预警报表). Function `Fun_getInitColumnByProName` references it for column metadata. xly-src ships `script/标版/30100101/Sp_Inventory_ProductInventory_Outdated.sql` plus `_Customer` and `_Salesman` companion procs for the dimension-sliced views, and `script/标版/optimize/Sp_Inventory_ProductInventory_Outdated.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_ProductWarning.md b/en/docs/auto-catalog/procedures/Sp_Inventory_ProductWarning.md index dbbed3c..ac628b2 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_ProductWarning.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_ProductWarning.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成品库存 → 预警报表 → 成品库存不足预警表 / 成品库存超量预警表 — finished-product stock-out and over-stock warning report. `iType` switches between the two views: low-stock (qty below `dMinStock`) and over-stock (qty above `dMaxStock`). + +**What it does:** Defaults `tEndDate` to NOW (+ 1 day) and zero-clears NULLs. Builds temp table `p_TMP_ProductWarning` shaped like `eleproductstock` extended with `dMinStock` / `dMaxStock` / `iProductioning` / display columns. Populates from `eleproductstock` joined to `eleproduct` for the min/max thresholds, computes in-production qty (`iProductioning`) from work-order tables, and selects the rowset filtered by `iType` (0 = 库存不足, 1 = 库存超量). Paginates / counts through `Sp_Outstanding_Query`. + +**Invocation:** Bound as the data source of two form-masters under 成品库存 → 预警报表: `19211681015115285244387250` (成品库存不足预警表) and `19211681015115285246087340` (成品库存超量预警表) — the same proc backs both with `iType` differentiating. Function `Fun_getInitColumnByProName` references it for column metadata. xly-src ships `script/标版/30100101/Sp_Inventory_ProductWarning.sql` and `script/标版/optimize/Sp_Inventory_ProductWarning.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Inventory_SemigoodsInOutStore.md b/en/docs/auto-catalog/procedures/Sp_Inventory_SemigoodsInOutStore.md index 37902d8..6a30894 100644 --- a/en/docs/auto-catalog/procedures/Sp_Inventory_SemigoodsInOutStore.md +++ b/en/docs/auto-catalog/procedures/Sp_Inventory_SemigoodsInOutStore.md @@ -39,4 +39,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Semi-finished-goods (半成品) counterpart of `Sp_Inventory_ProductInOutStore` — semi-goods 进销存 / 出入库流水账 report keyed by product / 半成品零件 / 工序 / 版本 / 自定义项 / warehouse. Mirrors the finished-product variant but reads the semi-goods ledger tables. + +**What it does:** Builds a temp ledger of opening qty/money (semi-goods stock rows before `tStartDate`) plus in-window receipts and dispatches grouped by semi-product / 自定义项 / warehouse / location, joins `elesemgoods` / `elewarehouse` / `elecustomer` for display, then paginates / counts through `Sp_Outstanding_Query`. + +**Invocation:** Status: appears orphaned in the standard catalog. No form-master binding, no `gdsmodule` hook, no other DB caller. xly-src ships `script/标版/30100101/Sp_Inventory_SemigoodsInOutStore.sql` and `script/标版/optimize/Sp_Inventory_SemigoodsInOutStore.sql`. Likely installed for a semi-goods cost view that has not been wired into a form on this deployment — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_KPI_DetailByEmployee.md b/en/docs/auto-catalog/procedures/Sp_KPI_DetailByEmployee.md index 7b67de5..db44e73 100644 --- a/en/docs/auto-catalog/procedures/Sp_KPI_DetailByEmployee.md +++ b/en/docs/auto-catalog/procedures/Sp_KPI_DetailByEmployee.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 人事行政 → KPI设置 → 今日KPI完成情况(暂不开放) — per-day KPI detail view for one employee. Wiki form-label flags 暂不开放 (not currently released to users), so the report is staged-but-disabled in this build. + +**What it does:** Defaults `tStartDate` to NOW minus one month and `tEndDate` to NOW (`+1` day for inclusive). Builds a `SELECT ... FROM viw_kpimaster` filtered by `sBrandsId` / `sSubsidiaryId` / `tCreateDate` window / `sUserName=sStatistics`, projecting daily KPI fields (`iTodayOk`, `iTodayNo`, `iTodayTotal`, `iTodayStandard`, `iStandardRate`, `dCompRate`, `drewardMoney`, `dpunishmentMoney`, `sUnTaskFromId`). Hands off to `Sp_Outstanding_Query` for paging, count-JSON, and group-by overrides. + +**Invocation:** Bound as the data source of form-master `101251240115015986085696180` (今日KPI完成情况(暂不开放) — 人事行政 → KPI设置). Form is gated off in the UI per the 暂不开放 marker; the proc lives in the catalog but is not currently exposed to end users. diff --git a/en/docs/auto-catalog/procedures/Sp_KPI_SumByEmployee.md b/en/docs/auto-catalog/procedures/Sp_KPI_SumByEmployee.md index 2339b98..ed31d52 100644 --- a/en/docs/auto-catalog/procedures/Sp_KPI_SumByEmployee.md +++ b/en/docs/auto-catalog/procedures/Sp_KPI_SumByEmployee.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 人事行政 → KPI设置 → 员工KPI执行汇总(暂不开放) — aggregated KPI summary per employee over a date window. Sibling of `Sp_KPI_DetailByEmployee`; this view rolls the daily KPI rows up to per-employee totals. Wiki form-label flags 暂不开放 (not released). + +**What it does:** Defaults `tStartDate` to NOW minus one month and `tEndDate` to NOW (`+1` day). Builds a `SELECT sUserName, SUM(iTodayOk), SUM(iTodayNo), SUM(iTodayTotal), SUM(iTodayStandard), AVG(iStandardRate), AVG(dCompRate), SUM(drewardMoney), SUM(dpunishmentMoney) FROM viw_kpimaster ... GROUP BY sUserName`. If `sStatistics` is supplied the WHERE adds `sUserName=sStatistics` for a single-employee summary. Hands off to `Sp_Outstanding_Query` for paging and count-JSON. + +**Invocation:** Bound as the data source of form-master `15985934370006289064162987570000` (员工KPI执行汇总(暂不开放) — 人事行政 → KPI设置). Form is gated off per the 暂不开放 marker; not currently exposed to end users. diff --git a/en/docs/auto-catalog/procedures/Sp_MacRepClaimCancel_BtnEventClaimCancel.md b/en/docs/auto-catalog/procedures/Sp_MacRepClaimCancel_BtnEventClaimCancel.md index 30e4cf5..66d8a30 100644 --- a/en/docs/auto-catalog/procedures/Sp_MacRepClaimCancel_BtnEventClaimCancel.md +++ b/en/docs/auto-catalog/procedures/Sp_MacRepClaimCancel_BtnEventClaimCancel.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 设备管理 → 设备维修 — 设备维修任务取消认领 button on the 设备报修 grid. Releases a previously-claimed 维修任务 so another 维修员 (or the dispatcher) can re-assign it. Inverse of `Sp_MacRepClaim_BtnEventClaim`. + +**What it does:** Parses `$.params[0].value[0].sId` from `sProInParam` (operates on the first selected row — single-row design despite the `$.params` shape). Reads `sClaimPerson` from `EptMachineRepairFixMaster` for the target row, then `UPDATE EptMachineRepairFixMaster` clears the claim: `bClaimed=0`, `sClaimPerson=''`, `tClaimDate=NULL`, `sClaimPersonId=''`. The textarea memo from `$.changeValue.textareaValue` is captured but not always persisted. + +**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 设备报修 grid's 取消认领 toolbar button names this proc by string. Inverse: `Sp_MacRepClaim_BtnEventClaim` (claim), `Sp_MacRepClaim_BtnEventClaimZP` (dispatcher 指派). diff --git a/en/docs/auto-catalog/procedures/Sp_MacRepClaim_BtnEventClaim.md b/en/docs/auto-catalog/procedures/Sp_MacRepClaim_BtnEventClaim.md index 5e82369..b9981db 100644 --- a/en/docs/auto-catalog/procedures/Sp_MacRepClaim_BtnEventClaim.md +++ b/en/docs/auto-catalog/procedures/Sp_MacRepClaim_BtnEventClaim.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 设备管理 → 设备维修 — 设备维修任务认领 button on the 设备报修 grid. A 维修员 claims an open 报修 task; once claimed it can't be re-claimed until released. + +**What it does:** Parses `$.params[0].value[*].sId` from `sProInParam`. For each id, reads `EptMachineRepairFixMaster.bClaimed` — if already 1, returns `sCode=-1` with `sTaskClaimed` ("该任务已被认领") via `Fun_Sis_GetConst` and exits. Otherwise `UPDATE EptMachineRepairFixMaster` sets `bClaimed=1`, `sClaimPerson=sMakePerson`, `tClaimDate=NOW()`, `sClaimPersonId=(SELECT sEmployeeId FROM sftlogininfo WHERE sUserName=sMakePerson)` for each selected row. + +**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 设备报修 grid's 认领 toolbar button names this proc by string. Inverse: `Sp_MacRepClaimCancel_BtnEventClaimCancel`. Re-assignment variant: `Sp_MacRepClaim_BtnEventClaimZP` (指派, the dispatcher reassigns to a chosen 维修员 instead of self-claim). diff --git a/en/docs/auto-catalog/procedures/Sp_MacRepClaim_BtnEventClaimZP.md b/en/docs/auto-catalog/procedures/Sp_MacRepClaim_BtnEventClaimZP.md index 802cd55..16718a6 100644 --- a/en/docs/auto-catalog/procedures/Sp_MacRepClaim_BtnEventClaimZP.md +++ b/en/docs/auto-catalog/procedures/Sp_MacRepClaim_BtnEventClaimZP.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 设备管理 → 设备维修 — 指派维修单 button on the 设备报修 grid. Dispatcher-side reassignment: instead of the operator self-claiming, a 调度员 (dispatcher / 指派人) picks which 维修员 to assign to each selected 报修 task; the dispatcher's own login goes into `sZPPerson`. + +**What it does:** Parses `$.params[*].value[*].sId` and reads `$.changeValue.sClaimPerson` (the picked 维修员) and `$.changeValue.textareaValue` (optional memo) from `sProInParam`. For each id, when `sClaimPerson` is non-blank, `UPDATE EptMachineRepairFixMaster` sets `bClaimed=1`, `sClaimPerson=`, `tClaimDate=NOW()`, `sZPPerson=sMakePerson` (the dispatcher). The textarea memo is appended where applicable. + +**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 设备报修 grid's 指派 toolbar button names this proc. Inverse: `Sp_MacRepClaimCancel_BtnEventClaimCancel`. Self-claim variant: `Sp_MacRepClaim_BtnEventClaim` (no 指派 chooser — operator claims own tasks). Sibling assigners on other slave tables: `Sp_MacRepClaim_BtnEventGroupLaderZP` (salsalesorderslave.sGroupLeader), `Sp_MacRepClaim_BtnEventMaterialsZP` (mftworkordermaterials.sClaimPerson). diff --git a/en/docs/auto-catalog/procedures/Sp_MacRepClaim_BtnEventGroupLaderZP.md b/en/docs/auto-catalog/procedures/Sp_MacRepClaim_BtnEventGroupLaderZP.md index bb84ade..b68c047 100644 --- a/en/docs/auto-catalog/procedures/Sp_MacRepClaim_BtnEventGroupLaderZP.md +++ b/en/docs/auto-catalog/procedures/Sp_MacRepClaim_BtnEventGroupLaderZP.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 — 指派设计单 button on a 销售订单从表 grid view. A dispatcher assigns a 组长 (`sGroupLeader`) to selected order-slave lines; despite the `Sp_MacRepClaim_*` prefix the proc writes to `salsalesorderslave`, not the repair table — likely co-located with the dispatcher-style ZP family on a custom 设计任务认领 / 组长指派 toolbar. + +**What it does:** Parses `$.params[*].value[*].sSlaveId` and `$.changeValue.sGroupLeader` + `$.changeValue.textareaValue` from `sProInParam`. For each sSlaveId, when `sGroupLeader` is non-blank, `UPDATE salsalesorderslave` sets `bClaim=1`, `sGroupLeader=`, `tClaimDate=NOW()` for matching rows under `sBrandsId/sSubsidiaryId`. + +**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 销售订单 从表 (or a 设计任务派工) grid's 指派组长 toolbar button names this proc by string. Companion ZP-family procs: `Sp_MacRepClaim_BtnEventClaimZP` (EptMachineRepairFixMaster), `Sp_MacRepClaim_BtnEventMaterialsZP` (mftworkordermaterials). diff --git a/en/docs/auto-catalog/procedures/Sp_MacRepClaim_BtnEventMaterialsZP.md b/en/docs/auto-catalog/procedures/Sp_MacRepClaim_BtnEventMaterialsZP.md index 4cb3ad1..7b5b6ee 100644 --- a/en/docs/auto-catalog/procedures/Sp_MacRepClaim_BtnEventMaterialsZP.md +++ b/en/docs/auto-catalog/procedures/Sp_MacRepClaim_BtnEventMaterialsZP.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 工单材料 — 指派测试材料部门 button on a 工单材料 (`mftworkordermaterials`) grid. A dispatcher assigns a 认领人 (`sClaimPerson`) to selected material lines; mirrors the `*ZP` (指派) pattern on the materials side rather than the repair side. + +**What it does:** Parses `$.params[*].value[*].sSlaveId` and `$.changeValue.sClaimPerson` + `$.changeValue.textareaValue` from `sProInParam`. For each sSlaveId, when `sClaimPerson` is non-blank, `UPDATE mftworkordermaterials` sets `bClaim=1`, `sClaimPerson=`, `tClaimDate=NOW()` filtered by `sBrandsId/sSubsidiaryId`. + +**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 工单材料 grid's 指派 toolbar button names this proc by string. Companion ZP-family procs: `Sp_MacRepClaim_BtnEventClaimZP` (EptMachineRepairFixMaster), `Sp_MacRepClaim_BtnEventGroupLaderZP` (salsalesorderslave.sGroupLeader). diff --git a/en/docs/auto-catalog/procedures/Sp_MachinePlanList_BtnEventRestoreRow.md b/en/docs/auto-catalog/procedures/Sp_MachinePlanList_BtnEventRestoreRow.md index eb20667..5635eca 100644 --- a/en/docs/auto-catalog/procedures/Sp_MachinePlanList_BtnEventRestoreRow.md +++ b/en/docs/auto-catalog/procedures/Sp_MachinePlanList_BtnEventRestoreRow.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划 → 机台计划 — button handler that returns a row from the backup table back into the live 机台计划 (`mftproductionplanslave`). Used when a planner accidentally removed a task and needs to restore it from the auxiliary `mftproductionplanbillslave` ledger. + +**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam`. For each id, checks `mftproductionplanslave` for existence — if already present, returns `sCode=-1` with localised message `sMachinePlanExist` ("机台计划已存在") via `Fun_Sis_GetConst` and exits. Otherwise it `INSERT INTO mftproductionplanslave` a full row built from `mftproductionplanbillslave` (the bill/backup table), copying customer/工单/工序/机台/数量/工时/起止时间 and reset flags, then `UPDATE mftproductionplanbillslave` to flag the source row as restored. + +**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 机台计划 grid's restore-row toolbar button names this proc by string. Install script: `script/标版/30100101/schedule/Sp_MachinePlanList_BtnEventRestoreRow.sql` (comment: 机台全部任务-从备份表返回到机台计划正式表). Sibling: `Sp_MachinePlanList_BtnEventRestoreRowBill` (also requires 机台 selection). diff --git a/en/docs/auto-catalog/procedures/Sp_MachinePlanList_BtnEventRestoreRowBill.md b/en/docs/auto-catalog/procedures/Sp_MachinePlanList_BtnEventRestoreRowBill.md index 139ef6c..ba2dd41 100644 --- a/en/docs/auto-catalog/procedures/Sp_MachinePlanList_BtnEventRestoreRowBill.md +++ b/en/docs/auto-catalog/procedures/Sp_MachinePlanList_BtnEventRestoreRowBill.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划 → 机台计划 — restore-row sibling of `Sp_MachinePlanList_BtnEventRestoreRow` that also requires the planner to pick a 机台 (`sMachineName`) and rebinds the restored row to the chosen 机台 / 工作中心. + +**What it does:** Parses `$.params[*].value[*].sId` + `$.changeValue.sMachineName` from `sProInParam`. If `sMachineName` is blank, aborts with `sSelectProcessMachine` ("请选择该工序的机台"). For each id, checks `mftproductionplanslave` for existing row, otherwise reads the chosen machine from `elemachine` (sId, sMachineNo, sCostCenterId) and `INSERT INTO mftproductionplanslave` a full row from `mftproductionplanbillslave` overriding `sMachineId/sMachineNo/sWorkCenterId` with the picked machine, then `UPDATE mftproductionplanbillslave` to flag the source row. + +**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 机台计划 grid's "restore row (assign machine)" toolbar button. Install script: `script/标版/30100101/schedule/Sp_MachinePlanList_BtnEventRestoreRowBill.sql` (same comment as RestoreRow). Sibling: `Sp_MachinePlanList_BtnEventRestoreRow` (uses the original 机台 from the backup row). diff --git a/en/docs/auto-catalog/procedures/Sp_MachinePoweranalysis.md b/en/docs/auto-catalog/procedures/Sp_MachinePoweranalysis.md index 391a51f..ca6f72c 100644 --- a/en/docs/auto-catalog/procedures/Sp_MachinePoweranalysis.md +++ b/en/docs/auto-catalog/procedures/Sp_MachinePoweranalysis.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 设备用电分析 — paged-grid 设备能耗 report. Lists every PLC-tracked machine (`elemachine` with `iPlcNo > 0`) and rolls up 待机能耗 (`sStatus <> 'startWorking'`) vs 运行能耗 (`sStatus = 'startWorking'`) plus 度/分钟 averages over a date window, sourced from `plc_machinedata`. + +**What it does:** Defaults `tStartDate` to `today 08:00:00` and `tEndDate` to NOW. Drops/creates `Tmp_elemachine_1` populated from `elemachine` (filtered by `iPlcNo > 0` and `bInvalid = 0`), then aggregates `plc_machinedata` into `p_bd_EqStatus_1` by 机台 (sum of `dElectricityQty` split by status; sum of `dProduceHour/3600`). `UPDATE` joins the temp by `sMachineId` to copy 度数 and 时间 columns, computes 度/分钟 ratios, then `CALL Sp_Do_UpdateByPageSizeBefore` to paginate via the standard report-paging helper. + +**Invocation:** Status: appears orphaned by formal channels. No `gdsmodule.sProcName`/`sSaveProName*` hook, no `gdsconfigformmaster.sSqlStr/sConfigSqlStr/sSqlCondition` binding, no other-routine reference, no install script in xly-src. The paged-report signature implies it was intended as a form data-source — candidate for maintainer audit. Drill-in dashboards: `Sp_MachinePoweranalysis_1` (per-machine pie of 设备状态 能耗), `Sp_MachinePoweranalysis_2` (per-machine ~25-hour line). diff --git a/en/docs/auto-catalog/procedures/Sp_MachinePoweranalysis_1.md b/en/docs/auto-catalog/procedures/Sp_MachinePoweranalysis_1.md index beb8878..638b625 100644 --- a/en/docs/auto-catalog/procedures/Sp_MachinePoweranalysis_1.md +++ b/en/docs/auto-catalog/procedures/Sp_MachinePoweranalysis_1.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 设备能耗看板 — single-machine dashboard chart returning the 设备状态-bucketed 能耗 pie/donut data (sName=`sStatus`, sValue=度数 sum). Drill-in companion of `Sp_MachinePoweranalysis` (the paged grid). + +**What it does:** Reads `elemachine.sOffWork`/`sShiftsWork` for the given `p_sMachineId` (defaults `8:00`/`17:30`), shifts `tStartDate`/`tEndDate` to those shift boundaries, drops/creates `p_bd_EqStatus(sName, sValue)`, and `INSERT … SELECT P.sStatus, SUM(dElectricityQty) FROM plc_machinedata` filtered by `sMachineId` (and optionally `sTeamId` when provided) within the shift window. Returns `sReturn` as a `{"data": [{"x": …, "y": …}, …]}` JSON via `GROUP_CONCAT` over the temp. + +**Invocation:** Status: appears orphaned. The proc body has a commented-out hint `-- Call Sp_Bd_bi20_2_nomes(7,…)` suggesting it was intended for the BI dashboard family. No `gdsconfigcharmaster.sProcedureName` binding, no `gdsmodule.sProcName`, no caller in xly-src or other routines, no install script. The `{"data":[{x,y}]}` JSON output shape matches chart-master conventions — candidate for maintainer audit to confirm which dashboard tile owns it. diff --git a/en/docs/auto-catalog/procedures/Sp_MachinePoweranalysis_2.md b/en/docs/auto-catalog/procedures/Sp_MachinePoweranalysis_2.md index aa9d98c..04d5cff 100644 --- a/en/docs/auto-catalog/procedures/Sp_MachinePoweranalysis_2.md +++ b/en/docs/auto-catalog/procedures/Sp_MachinePoweranalysis_2.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 设备能耗看板 — single-machine 折线 dashboard chart returning the last ~25 hours of 度数 (`dElectricityQty`) on a 10-minute grid from `plc_machinedata`. Companion of `Sp_MachinePoweranalysis_1` (pie). + +**What it does:** Treats `tEndDate` as "now" (truncated to the minute), seeds a 150-row `p_index` temp filled with 10-minute slots back to `tEndDate - 1500 min` (~25h). Walks `plc_machinedata` rows for `p_sMachineId` in the window via a cursor and distributes each row's `dElectricityQty` across the overlapping `p_index` slots (the proc reuses `Sp_MachineSpeedanalysis_2`-prefixed temp-table names — sibling layout, no CALL). Returns `sReturn` as a chart-master `{"data":[{x:tCreateDate, y:dRate}, …]}` JSON via `GROUP_CONCAT`. + +**Invocation:** Status: appears orphaned. No `gdsconfigcharmaster.sProcedureName` binding, no `gdsmodule.sProcName`, not referenced by any other routine (only sibling temp-table name re-use), not present in xly-src. Output shape matches dashboard chart conventions — candidate for maintainer audit to confirm which chart tile owns it. diff --git a/en/docs/auto-catalog/procedures/Sp_MachineSpeedanalysis.md b/en/docs/auto-catalog/procedures/Sp_MachineSpeedanalysis.md index 30279d6..52b95c2 100644 --- a/en/docs/auto-catalog/procedures/Sp_MachineSpeedanalysis.md +++ b/en/docs/auto-catalog/procedures/Sp_MachineSpeedanalysis.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 设备速度分析 — paged-grid 设备速度 report. Lists every active `elemachine` (`bInvalid = 0`) and rolls up 运行时长 from `plc_machinedata` over a date window grouped by 机型 (`sFilterOrderBy` defaults to `ORDER BY sMachineType`). + +**What it does:** Defaults `tStartDate` to one month ago, `tEndDate` to NOW. Drops/creates `Tmp_elemachine_1` populated from `elemachine`, then aggregates `plc_machinedata` into `p_bd_EqStatus_1` (sum of `dProduceHour/3600` per machine). `UPDATE Tmp_elemachine_1` joins by `sMachineId` to copy `dTotalTime`, then `CALL Sp_Do_UpdateByPageSizeBefore` to paginate. + +**Invocation:** Status: appears orphaned by formal channels. No `gdsmodule.sProcName`/`sSaveProName*` hook, no `gdsconfigformmaster.sSqlStr` binding, no other-routine reference, no install script in xly-src. The paged-report signature implies it was intended as a form data-source — candidate for maintainer audit. Drill-in dashboards: `Sp_MachineSpeedanalysis_1` (per-machine 时间-状态 breakdown), `Sp_MachineSpeedanalysis_2` (per-machine 折线 of dRate over time). diff --git a/en/docs/auto-catalog/procedures/Sp_MachineSpeedanalysis_1.md b/en/docs/auto-catalog/procedures/Sp_MachineSpeedanalysis_1.md index 2d3b4cc..e161c93 100644 --- a/en/docs/auto-catalog/procedures/Sp_MachineSpeedanalysis_1.md +++ b/en/docs/auto-catalog/procedures/Sp_MachineSpeedanalysis_1.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 设备速度看板 — single-machine 时间分析 dashboard pie/donut tile keyed by 设备状态. Drill-in companion of `Sp_MachineSpeedanalysis` (the paged grid). Near-identical sibling of `Sp_MachinePoweranalysis_1` (same shape, but the 能耗 variant aggregates `dElectricityQty`). + +**What it does:** Reads `elemachine.sOffWork`/`sShiftsWork` for `p_sMachineId` (defaults `8:00`/`17:30`), shifts `tStartDate`/`tEndDate` to those shift boundaries, drops/creates `p_bd_EqStatus(sName, sValue)`. The active aggregation block in the body is commented-out — the live shape is set up identically to `Sp_MachinePoweranalysis_1` but the population SELECT is disabled. Returns `sReturn` as a chart-master `{"data":[{x,y}]}` JSON. + +**Invocation:** Status: appears orphaned. No `gdsconfigcharmaster.sProcedureName` binding, no `gdsmodule.sProcName`, no caller in xly-src or other routines, no install script. Body's main SELECT is commented out — proc may be in a partially-disabled state. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_MachineSpeedanalysis_2.md b/en/docs/auto-catalog/procedures/Sp_MachineSpeedanalysis_2.md index 604ea19..9bbf01b 100644 --- a/en/docs/auto-catalog/procedures/Sp_MachineSpeedanalysis_2.md +++ b/en/docs/auto-catalog/procedures/Sp_MachineSpeedanalysis_2.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 设备速度看板 — single-machine 折线 dashboard chart of 速度/小时 over a date window, sourced from `plc_oeeupdate`. Companion of `Sp_MachineSpeedanalysis_1` (pie). + +**What it does:** Reads the machine's average rate `dAvgRate` from `elemachine` (defaults 15000 if zero). Drops/creates temp `Sp_MachineSpeedanalysis_2`, then `INSERT … SELECT … AVG(dRate)` from `plc_oeeupdate` bucketed by 5-minute slots, filtered by `sMachineId = p_sMachineId`, `tCreateDate BETWEEN p_tStartDate AND p_tEndDate`, and `dRate <= dAvgRate × 1.5` plus `dRate > 10` (clips outliers). Returns `sReturn` as a chart-master `{"data":[{x:tCreateDate, y:dRate}, …]}` JSON. + +**Invocation:** Status: appears orphaned. The only DB reference is sibling `Sp_MachinePoweranalysis_2` which reuses the `Sp_MachineSpeedanalysis_2`-prefixed temp-table names — no CALL relationship. No `gdsconfigcharmaster.sProcedureName` binding, no caller in xly-src. The variant `Sp_MachineSpeedanalysis_2_new` switches the lookup key from `p_sMachineId` to `p_iPlcNo` (PLC number) and adds 状态-aware zero-out logic. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_MachineSpeedanalysis_2_new.md b/en/docs/auto-catalog/procedures/Sp_MachineSpeedanalysis_2_new.md index 8667651..25a24b2 100644 --- a/en/docs/auto-catalog/procedures/Sp_MachineSpeedanalysis_2_new.md +++ b/en/docs/auto-catalog/procedures/Sp_MachineSpeedanalysis_2_new.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 设备速度看板 — newer variant of `Sp_MachineSpeedanalysis_2`. Returns a per-机台 折线 of 速度/小时 keyed by PLC number rather than machine sId, scoped to the current shift window (`FUN_GET_DATE_BC_STARTDATE_NEW(NOW(), sOffWork, sShiftsWork)` → NOW), and zeroes out `dRate` for non-running states. + +**What it does:** Resolves the machine from `elemachine` by `iPlcNo = p_iPlcNo` (loads `sId, sOffWork, sShiftsWork, sWorkType, dAvgRate`), computes `p_tStartDate` as the shift's start via `FUN_GET_DATE_BC_STARTDATE_NEW`, drops/creates the same `Sp_MachineSpeedanalysis_2` temp shape. `INSERT … SELECT` from `plc_oeeupdate` AVG'd per-minute, but `dRate` is forced to 0 when `sCurState NOT IN ('startWorking', 'adjustment', 'adjustment2')` — i.e. the line drops to zero during stops/idles, distinguishing operating speed from downtime. Result is shaped into `{"data":[{x:tCreateDate, y:dRate}, …]}` JSON via `Sp_MachineSpeedanalysis_data` / `Sp_MachineSpeedanalysis_return` temps. + +**Invocation:** Status: appears orphaned. No `gdsconfigcharmaster.sProcedureName` binding, no caller in xly-src, no other routine references it (sibling `Sp_MachinePoweranalysis_2` only reuses the prefixed temp-table name). The parameter shift to `p_iPlcNo` suggests it's intended as the line-side / kiosk dashboard variant of `Sp_MachineSpeedanalysis_2`. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Machine_ReportAll.md b/en/docs/auto-catalog/procedures/Sp_Machine_ReportAll.md index abba886..a19e133 100644 --- a/en/docs/auto-catalog/procedures/Sp_Machine_ReportAll.md +++ b/en/docs/auto-catalog/procedures/Sp_Machine_ReportAll.md @@ -33,4 +33,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Machine / shift production-report aggregator over a month-bounded window — produces a per-machine triple-shift (1=白班, 2=中班, 3=晚班) roll-up of qualified output qty, setup time (调机时间), other time, manhours, secondary-setup time, paper-error time, file-error time, maintenance time, abnormal time, and supervisor-confirmed manhours. Intended as the data-source for an "all machines" production-output report. + +**What it does:** Defaults `tStartDate` to first-of-current-month at 00:00 and `tEndDate` to start-of-next-month. Drops/creates temp table `p_TempTable` keyed by machine / dept / team and three shift-suffixed columns each (`dProcessQty1/2/3`, `dAdjustableHour1/2/3`, etc.). Populates from `mftproductionreportmaster`/`...slave` filtered by `sMachineName` / `sTeamName` / `sDeptName` LIKE, joins `elemachine` and dept/team tables for display, then exposes the rowset paginated through `Sp_Outstanding_Query`. + +**Invocation:** Status: appears orphaned. No form-master binding, no `gdsmodule` hook, no other DB caller, no xly-src reference. Self-contained machine-report variant not wired into any live form — candidate for maintainer audit; the production-report family uses `Sp_EquipmentOutput_Machine` (printing) and `Sp_EquipmentOutput_Machine_YH` (post-press) instead. diff --git a/en/docs/auto-catalog/procedures/Sp_Machine_ReportNew.md b/en/docs/auto-catalog/procedures/Sp_Machine_ReportNew.md index 19c5833..b8f5f5b 100644 --- a/en/docs/auto-catalog/procedures/Sp_Machine_ReportNew.md +++ b/en/docs/auto-catalog/procedures/Sp_Machine_ReportNew.md @@ -33,4 +33,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 — paged per-machine production-report aggregation, three-shift (班次1/2/3) layout. Carries report-proc parameters (`pageNum/pageSize/bFilter/countCloumn/countMapJson/sGroupby_*`) and date-range + 设备名/班组名/部门名 filters; produces per-机台 stats by shift: 合格数, 调机时间, 工时, 二次调机时间, 纸张异常时间, 文件异常时间, 设备保养时间, 设备异常时间, 主管确认工时, 确认后人工总工时, 效率. + +**What it does:** Defaults `tStartDate/tEndDate` to the current month, drops/creates `p_TempTable` with one row per 设备 and 30+ stat columns per shift suffix (`_1/_2/_3`), populates the temp from production-report sources, then `UPDATE p_TempTable` to compute 效率 per shift and the dynamic SQL is paginated for the grid. + +**Invocation:** Status: appears orphaned. No caller found in any channel — not in `gdsmodule.sProcName`/`sSaveProName*`, not in `gdsconfigformmaster.sSqlStr/sConfigSqlStr/sSqlCondition`, not referenced by any other routine, no view/trigger, not in xly-src (install script absent — DB-only). The paged-report signature implies it was intended as a form data-source but the binding is missing — candidate for maintainer audit. Sibling: `Sp_Machine_ReportNewNo`, `Sp_Machine_TeamNew`. diff --git a/en/docs/auto-catalog/procedures/Sp_Machine_ReportNewNo.md b/en/docs/auto-catalog/procedures/Sp_Machine_ReportNewNo.md index 1d19e0a..d7a9649 100644 --- a/en/docs/auto-catalog/procedures/Sp_Machine_ReportNewNo.md +++ b/en/docs/auto-catalog/procedures/Sp_Machine_ReportNewNo.md @@ -33,4 +33,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 — variant of `Sp_Machine_ReportNew` for the per-machine production-report grid. Same signature (paged-report) and same three-shift layout; the `No` suffix conventionally indicates a 不分班次 / 数据缺失 variant in the xly catalog. + +**What it does:** Same shape as `Sp_Machine_ReportNew`: defaults the date range to the current month, builds `p_TempTable` keyed by 设备, fills per-shift stats (合格数, 调机时间, 工时, 二次调机时间, 纸张异常时间, 文件异常时间, 设备保养/异常时间, 主管确认工时, 确认后人工总工时), and computes 效率. Body is near-identical — diff this against `Sp_Machine_ReportNew` to confirm the intended semantic difference. + +**Invocation:** Status: appears orphaned. No caller found in any channel — no `gdsmodule.sProcName` hook, no form-master `sSqlStr` binding, no other-routine reference, no install script in xly-src. Likely an unwired sibling / WIP variant of `Sp_Machine_ReportNew` — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Machine_TeamNew.md b/en/docs/auto-catalog/procedures/Sp_Machine_TeamNew.md index 43459d7..60ca07a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Machine_TeamNew.md +++ b/en/docs/auto-catalog/procedures/Sp_Machine_TeamNew.md @@ -33,4 +33,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 班组产量报表 (`gdsmodule sId 19211681019715780368511470`) — paged per-machine × 班组 production statistics. Carries the standard report-proc signature with date range + `sMachineName/sTeamName/sDeptName` filters and the page/group OUT params; output adds `dProcessQty`(合格数), `dAjustReportPlanQty`(确认上报数), `dColorNum`(色数), `dCalculateMoney`(产值计算金额), `dAllHour`(总工时) and a breakdown 调机/二次调机/纸张异常/文件异常/设备保养/设备异常/用户看色 hours. + +**What it does:** Defaults `tStartDate/tEndDate` to the current month, drops/creates `p_TempTable` keyed by (设备, 班组, 部门), pulls aggregated stats from production-report sources into the temp, then re-paginates the temp via a dynamic SQL applying `bFilter`/`sFilterOrderBy` and groupby splice. + +**Invocation:** Status: appears orphaned by formal channels. The 班组产量报表 module exists at `gdsmodule.sId 19211681019715780368511470` (parent `19211681019715323325710100` 机台作业任务执行 → `11811781131121915216205010990` 生产管理) but no `gdsconfigformmaster.sSqlStr` row binds this proc, and no other routine, view, trigger, or xly-src file references it. The intended report form-master sId is unidentified — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_BillComplete.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_BillComplete.md index c649a00..09781c3 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_BillComplete.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_BillComplete.md @@ -1,7 +1,7 @@ # `Sp_Manufacture_BillComplete` (procedure) -> @author:qmj - @date:20210607 封存 +> @author:qmj + @date:20210607 封存 @describe iFlag 标志,1 完工,0 取消完工 @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划 → 主计划 — 整单完工 / 取消整单完工 toggle. Marks an entire 主计划 (`mftproductionplan`) as complete and cascades to its 机台计划从表 and the parent 工单. Author comment marks the proc 封存 (sealed / archived) as of 2021-06-07. + +**What it does:** With `iFlag=1` (完工): `UPDATE mftproductionplanslave` set `sState='5'`, `iComplete=1` for all rows under the same `sWorkOrderId` as the main plan `sGuid`; `UPDATE mftproductionplan` set `sState='6'` on `sId=sGuid`; `UPDATE mftworkordermaster.bBillComplete=1` for the linked 工单 via `INNER JOIN mftproductionplan`. With `iFlag=0` (取消完工): re-evaluates `mftworkordermaster.bBillComplete` against `viw_mftworkorder` aggregates (`dProductQty` vs `dProductInStoreQty` and vs `dDeliverQty`) and only clears it when actuals fall short of plan, writing an audit trail into `sCompletePerson`. + +**Invocation:** Status: appears orphaned. Author comment marks it 封存. No `gdsmodule.sProcName` hook, no form-master binding, no other-routine reference. xly-src ships `script/标版/30100101/Sp_Manufacture_BillComplete.sql` (install script) — preserved for reference but the live UI presumably uses a successor flow. Calc-style signature `(sGuid, sMakePerson, iFlag, sLoginId, sBrId, sSuId, OUT sReturn, OUT sCode)` would normally bind via `gdsmodule.sProcName` on the 主计划 form's 审核 slot — that binding is absent. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_BtnEventCopyPlanSlave.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_BtnEventCopyPlanSlave.md index ff3ec28..18fa7a8 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_BtnEventCopyPlanSlave.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_BtnEventCopyPlanSlave.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划 → 机台计划 — 复制一条计划 button. Duplicates a selected 机台计划 row (`mftproductionplanslave`) with optionally rebound 工序 / 机台 / 班组 (taken from `$.changeValue` overrides); used to clone a similar plan line and quickly retarget it. + +**What it does:** Parses `$.params[*].value[*].sId` for source rows and `$.changeValue.sProcessName / sMachineName / sTeamName` for overrides. Resolves the chosen 工序 from `eleprocess` (sId, sProcessNo) by `sProcessName`. For each source `sId`, reads the existing row's 工单/工序/机台/起止时间/排序 from `mftproductionplanslave`, computes a new `iOrder` and `tStartDate` (MAX in same team/group + 1) when 班组 override is provided, then `INSERT INTO MftProductionPlanSlave` a new row copying the source with overrides applied and a fresh sId. + +**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 机台计划 grid's 复制 toolbar button names this proc by string. Install script: `script/标版/30100101/schedule/Sp_Manufacture_BtnEventCopyPlanSlave.sql` (comment: 复制一条计划). diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_BtnRepairExplain.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_BtnRepairExplain.md index e438ae7..03f198c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_BtnRepairExplain.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_BtnRepairExplain.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划 / 产量上报 — 偏离原因 button (despite the `Repair` token, the install-script comment is 偏离原因 / deviation reason). A 主管 confirms an adjusted plan qty / hours against the actual 产量上报 row and records a free-text deviation memo against the locked 机台计划 slave. + +**What it does:** Parses `$.params[*].value[*].sId` plus `$.changeValue.dAjustReportPlanQty` (主管确认数量), `$.changeValue.sAjustReportPlanHour` (主管确认工时), and `$.changeValue.textareaValue` (memo) from `sProInParam`. For each plan-slave id, looks up the corresponding `mftproductionreportslave.sId` by `sSrcSlaveId`, and when found, `UPDATE mftproductionreportslave` writes `dAjustReportPlanQty`, `dAjustReportPlanHour` (only overwriting when override is non-blank) and sets `bAffirm=1`; then `UPDATE mftproductionplanslavelock.sPlannerMemo` with the textarea memo. + +**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 机台计划 / 产量上报 grid's 偏离原因 toolbar button names this proc by string. Install script: `script/标版/30100101/schedule/Sp_Manufacture_BtnRepairExplain.sql` (comment: 偏离原因). diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_CapacityStatistics.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_CapacityStatistics.md index 3d939b9..6b4e4e3 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_CapacityStatistics.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_CapacityStatistics.md @@ -1,11 +1,11 @@ # `Sp_Manufacture_CapacityStatistics` (procedure) -> @author: qmj - - @date:20210714 封存 - - @describe : 机台负荷 - +> @author: qmj + + @date:20210714 封存 + + @describe : 机台负荷 + 各机台后推14天展示排产工时,并显示机台负荷状态 @@ -44,4 +44,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产运营报表 → 设备排单负荷分析 (机台负荷) — paged 14-day machine-load forecast. Per-machine workload (排产工时) for the next 14 days plus a load-status indicator, sliced by attribute / machine / process / workcenter / type. + +**What it does:** Resolves `iType` (1: full per-machine view) and computes the 14-day window from `tStartDate`. Builds a temporary `p_tmp_plan` from `MftProductionPlanSlave` and `mftProductionPlan` filtered by `sBrId/sSuId`, then aggregates per machine into `p_tmp_T` (14 day-bucket columns) using prepared dynamic SQL — paged via `pageNum/pageSize` and `bFilter` spliced in, with `sColumnNameConfig` returned to drive the front-end's dynamic-column rendering. + +**Invocation:** Bound as the data-source of the 机台负荷 / 设备排单负荷分析 form `gfm.sId=192116811110616262623708530` via `gdsconfigformmaster.sSqlStr` — loaded when the user opens that report. Install: xly-src `script/标版/30100101/schedule/Sp_Manufacture_CapacityStatistics.sql` (plus a 福雅 customer-override under `script/客户/福雅/optimizeprocedure.sql`). diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_GetAPSState.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_GetAPSState.md index 8bbd4ef..80e21b0 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_GetAPSState.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_GetAPSState.md @@ -1,7 +1,7 @@ # `Sp_Manufacture_GetAPSState` (procedure) -> @author: - @date:20210521 封存 +> @author: + @date:20210521 封存 @describe: 排程工艺流程、材料准备情况 @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 (APS 排程) — pre-pass that drives "排程工艺流程、材料准备情况" before the per-machine OEE pass: refreshes material-check flags on the work-order then delegates to `Sp_Manufacture_GetAPSStateOee` to compute the actual machine-level state, finally calls `planScriptTmp()` to materialise the planning temp table. + +**What it does:** Parses the `bFilter` JSON array into `sMachineId`/`sProcessId`. Sweeps `MftWorkOrderMaterials` joined against `purpurchaseorderslave`: rows where a purchase order already exists are auto-marked `bPlanMaterialCheck=1`, with `bPlanMaterialCheckResult` set from the inbound qty. Then `CALL Sp_Manufacture_GetAPSStateOee(bFilter, p_sMachineId, sLoginId, sBrId, sSuId, sReturn, sCode)`; on `sCode<0` sets `sCode=-1` and leaves. Always finishes with `CALL planScriptTmp()`. + +**Invocation:** Chained from `Sp_productionPlan_BtnEventAutoOrder10` (the 印刷计划 自动排序 button — generic-dispatch toolbar action). Not bound directly to any form-master or `gdsmodule` hook. Install: xly-src `script/标版/30100101/schedule/Sp_Manufacture_GetAPSstate.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_GetAPSStateOee.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_GetAPSStateOee.md index 684bd53..ecc96cb 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_GetAPSStateOee.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_GetAPSStateOee.md @@ -1,9 +1,9 @@ # `Sp_Manufacture_GetAPSStateOee` (procedure) -> @author: - - @date:20210521 封存 - +> @author: + + @date:20210521 封存 + @describe: 排程工艺流程、材料准备情况 @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 (APS 排程) — per-machine engine behind `Sp_Manufacture_GetAPSState`: walks each machine's planning queue, fills work-order process flow + material-readiness signals into `mftproductionplanslave`, and snapshots data into `plc_machinedata_tmp` for the PLC/board dashboard. + +**What it does:** Recognises three filter shapes: `未排程传入工序` (resort by process), `未排程传入设备` (per-machine), or the JSON `bFilter` array of `sMachineId`/`sProcessId`. Builds the temporary `p_MftWorkOrderProcess` from `MftProductionPlanSlave`/`mftproductionmeans`, runs upstream-process and plate-readiness checks per row, then `UPDATE MftProductionPlanSlave` to set `sPriorProcess`/`sPriorPlate`/state flags, `INSERT INTO plc_processId` and `plc_machinedata_tmp` for downstream PLC consumption. + +**Invocation:** Chained from `Sp_Manufacture_GetAPSState` (the standard pre-pass) and from `Sp_productionPlan_BtnEventAutoOrder10` (印刷计划 自动排序 button). Not bound directly to any form-master or `gdsmodule` hook. Install: xly-src `script/标版/30100101/schedule/Sp_Manufacture_GetAPSStateOee.sql`; customer variant under `script/客户/无锡中江/Sp_Manufacture_GetAPSStateOee.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_GetPlanAPSstate.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_GetPlanAPSstate.md index eba5dc1..5d444f7 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_GetPlanAPSstate.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_GetPlanAPSstate.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 主计划 — kit-completeness audit (齐套稽查) for the master plan. Per the body's COMMENT ("主计划:齐套稽查(材料准备、工艺流程)"), it inspects every active master-plan row and refreshes the `sPartNameStatus` / `sMaterialsStatus` summary on `MftProductionPlan` based on whether the upstream parts and material checks are satisfied. + +**What it does:** Resets `sPartNameStatus` and `sMaterialsStatus` to empty for all `MftProductionPlan` rows with `sState<>'6'` for the brand/subsidiary. Materialises a temporary `p_MftWorkOrderProcess` and `p_MftWorkOrder_Materials/_Group` from the work-order side, then `CALL Sp_MaterialCheck_BtnEventMaterialCheck` per master row to compute readiness, finally `UPDATE MftProductionPlan` with the resolved status strings. + +**Invocation:** Status: appears orphaned — no form-master binding, no `gdsmodule` hook (no row has `sProcName='Sp_Manufacture_GetPlanAPSstate'`), no other routine references it, and the only xly-src hits are the install script `script/标版/30100101/schedule/Sp_Manufacture_GetPlanAPSstate.sql` and a 无锡中江 customer override. Likely scheduled externally (cron / 计划任务) or invoked via metadata not yet surveyed — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlan.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlan.md index 51d206f..72e311d 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlan.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlan.md @@ -1,9 +1,9 @@ # `Sp_Manufacture_InsertMftPlan` (procedure) -> @author:钱豹 - @date:20210711 封存 - @describe: 生产计划:插入计划(工单审核,重新投入规划调用),主要功能: - 1、根据工序中设定的 拆单方式 按贴,按付... 插入到机台计划表中 +> @author:钱豹 + @date:20210711 封存 + @describe: 生产计划:插入计划(工单审核,重新投入规划调用),主要功能: + 1、根据工序中设定的 拆单方式 按贴,按付... 插入到机台计划表中 2、根据工单工序从表ID汇总数量 反写工单工序的已排程数 @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 — work-order (工单) plan-explosion engine. On work-order audit (审核) or re-plan (重新投入规划), it expands each work-order process row into `MftProductionPlanSlave` per the process's 拆单方式 (按贴/按付/...), then writes back the scheduled qty (`已排程数`) on the work-order process side. Per the COMMENT, owned by 钱豹, 封存 20210711. + +**What it does:** Iterates work-order processes for the given `sWorkOrderGuid` (or by `sWorkOrderBillNo`). `DELETE FROM MftProductionPlanSlave` for stale rows, `CALL Sp_GetMachineByApsRule` to pick the candidate machine per process, then re-inserts plan-slaves via the per-process detail helpers (the slave-level `Sp_Manufacture_InsertMftPlanSlave` is invoked indirectly). `UPDATE MftProductionPlanSlave` aggregations roll back to the work-order to refresh the `已排程数`. + +**Invocation:** Chained — called from `Sp_Calc_sSmb` (生产排单单审核), `Sp_Calc_sWod` (工单审核), `Sp_PLC_ScanInsertToERP`, `Sp_productionMainPlan_BtnEventPlanning`, `Sp_productionMainPlan_BtnEventworkorder`, `Sp_productionMainPlan_Process_BtnEventUnOutProcessing`, `Sp_commonList_BtnEventBillReturn`, and the dynamic `sp_btn_action` dispatcher. No direct form-master / `gdsmodule` hook binding. Install: xly-src `script/标版/30100101/schedule/Sp_Manufacture_InsertMftPlan.sql` plus several upgrade patches. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlanBook.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlanBook.md index 1d37071..e26e67f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlanBook.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlanBook.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 — book-mode variant of `Sp_Manufacture_InsertMftPlan`. Same signature, same role (explode work-order into `mftproductionplanmaster` + `MftProductionPlanSlave` rows on audit / re-plan), but tuned for the 书刊 / 装订 (book) production flow rather than the standard 平装 path. + +**What it does:** For the given `sWorkOrderGuid` (or `sWorkOrderBillNo`), `INSERT INTO mftproductionplanmaster` + `INSERT INTO MftProductionPlanSlave` per process per the book-side 拆单方式, then `UPDATE MftProductionPlanSlave` to reconcile state. Mirror of the standard variant — same parameter list, same outputs. + +**Invocation:** Status: appears orphaned in current metadata. No `gdsmodule` hook, no form-master binding, no in-DB caller, and the only xly-src hit is the install script `script/标版/30100101/Sp_Manufacture_InsertMftPlanBook.sql`. Likely called dynamically (e.g., via `sp_btn_action` dispatching on a book-specific module) or via metadata not yet surveyed — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlanProcess.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlanProcess.md index 5f05876..dd5384e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlanProcess.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlanProcess.md @@ -1,9 +1,9 @@ # `Sp_Manufacture_InsertMftPlanProcess` (procedure) -> @author:钱豹 - @date:20210711 封存 - @describe: 发外工序,返回重排过程中调用:插入计划(工单审核,重新投入规划调用),主要功能: - 1、根据工序中设定的 拆单方式 按贴,按付... 插入到机台计划表中 +> @author:钱豹 + @date:20210711 封存 + @describe: 发外工序,返回重排过程中调用:插入计划(工单审核,重新投入规划调用),主要功能: + 1、根据工序中设定的 拆单方式 按贴,按付... 插入到机台计划表中 2、根据工单工序从表ID汇总数量 反写工单工序的已排程数 @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 — per-process variant of `Sp_Manufacture_InsertMftPlan`. Used by the outside-process (发外工序) return / re-plan flow: when a 发外 process comes back and needs re-scheduling, this re-explodes a single work-order process row (not the whole work-order) into `mftProductionPlanSlave`. Per the COMMENT, owned by 钱豹, 封存 20210711. + +**What it does:** For the single `p_sWorkOrderProcessGuid`, `CALL Sp_GetMachineByApsRule` to pick the machine per ApsRule, splits the qty per the process's 拆单方式 (按贴/按付/...), inserts the resulting plan-slaves and `UPDATE mftProductionPlanSlave` to refresh the work-order process row's 已排程数 (writes the aggregate back to `mftworkorderprocessslave`). + +**Invocation:** Chained from `Sp_commonList_BtnEventBillReturn` (the 撤单/return-to-process button on the common bill grid) and `Sp_productionMainPlan_Process_BtnEventUnOutProcessing` (the 取消发外 button on the 主计划 process grid). Both dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()`. Install: xly-src `script/标版/30100101/schedule/Sp_Manufacture_InsertMftPlanProcess.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlanSlave.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlanSlave.md index 0f212f6..10570f2 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlanSlave.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlanSlave.md @@ -103,4 +103,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 — the row-level workhorse that materialises a single 机台计划 (`MftProductionPlanSlave`) row from a single work-order process. The auto-catalog header is explicit: "生产计划从:插入计划(Sp_Manufacture_InsertMftPlan调用)". Takes the full per-row context (machine, process, plates, qty, colour, materials, reserves, control-face, dual-side colour) and writes one slave row. + +**What it does:** Validates the inputs, `DELETE FROM MftProductionPlanSlave` for any stale row at `p_uPlanSlaveGuid`, `CALL Sp_CalcPlan_dHour` to compute the planned duration, `CALL Sp_Create_sControlFaceNameTable` to expand the control-face metadata, then `INSERT INTO MftProductionPlanSlave` with the full denormalised row (work-order denorms, order denorms, customer denorms, colour fields, ~20 reserve columns). Final `UPDATE MftProductionPlanSlave` pass fixes derived columns. + +**Invocation:** Chained — called from `Sp_Manufacture_InsertMftPlan`, `Sp_Manufacture_InsertMftPlanProcess`, `Sp_Manufacture_InsertMftPlanToErp`, and the dynamic `sp_btn_action` dispatcher. Not bound to any form-master or `gdsmodule` hook directly. Install: xly-src `script/标版/30100101/schedule/Sp_Manufacture_InsertMftPlanSlave.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlanToErp.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlanToErp.md index 693647d..508324f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlanToErp.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_InsertMftPlanToErp.md @@ -1,9 +1,9 @@ # `Sp_Manufacture_InsertMftPlanToErp` (procedure) -> @author:钱豹 - @date:20210711 封存 - @describe: 发外工序,返回重排过程中调用:插入计划(工单审核,重新投入规划调用),主要功能: - 1、根据工序中设定的 拆单方式 按贴,按付... 插入到机台计划表中 +> @author:钱豹 + @date:20210711 封存 + @describe: 发外工序,返回重排过程中调用:插入计划(工单审核,重新投入规划调用),主要功能: + 1、根据工序中设定的 拆单方式 按贴,按付... 插入到机台计划表中 2、根据工单工序从表ID汇总数量 反写工单工序的已排程数 @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 — ERP-side variant of `Sp_Manufacture_InsertMftPlanProcess`. Pushes a work-order-process row into ERP-tracked `mftproductionplanmaster` with the chosen ERP machine (`sErpMachineGuid`) and state (`p_sState`). Per the COMMENT, owned by 钱豹, 封存 20210711, "发外工序,返回重排过程中调用". + +**What it does:** For the given `sWorkOrderProcessGuid`, `CALL Sp_Sis_GetMaxNo` to mint a plan bill number, builds the master-row column-list dynamically, and `INSERT INTO mftproductionplanmaster` with the resolved 拆单方式 split (按贴/按付/...). Writes back the scheduled qty to the work-order process row. + +**Invocation:** Chained from `Sp_PLC_ScanInsertToERP` (the PLC scan → ERP push flow) — invoked when PLC-side data needs a corresponding ERP-side plan-master row. No form-master or `gdsmodule` hook binding. Install: xly-src `script/标版/30100101/schedule/Sp_Manufacture_InsertMftPlanToErp.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_InsertWorkOrder.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_InsertWorkOrder.md index d3ea100..a5b404f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_InsertWorkOrder.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_InsertWorkOrder.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 工单 (work-order creation pipeline) — bulk-insert helper that turns a parsed file payload (filename + multi-order JSON in `p_sInfo`/`p_sAllInfo` + print-mode) into work-order header + slave rows. Likely consumed by an import / scan flow that hands over already-parsed bill data. + +**What it does:** Parses `p_sInfo` to split multi-order strings, walks each `sAllOrderNo`, `CALL SP_Sis_GetMaxNo` to mint a 工单 bill-no, then inserts header data into work-order master + slave from `p_sAllInfo`. Builds intermediate tables (`sAllOrderNoTable`, `T`) to stage the per-order rows, with the print-mode (`p_iPrintMode`), file (`p_sFileName`) and qty (`p_dQty`) used to size the plan. + +**Invocation:** Status: appears orphaned — no `gdsmodule` hook, no form-master binding, no in-DB caller, and the only xly-src hit is the install script `script/标版/30100101/Sp_Manufacture_InsertWorkOrder.sql`. Likely invoked dynamically (filename-driven import / external integration / `sp_btn_action` with metadata-stored proc name) — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_MftPlanPhase.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_MftPlanPhase.md index 6cd1f43..ca678ca 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_MftPlanPhase.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_MftPlanPhase.md @@ -1,11 +1,11 @@ # `Sp_Manufacture_MftPlanPhase` (procedure) -> @author: zhucx - @date:20220308 封存 - - @describe : - 生产计划跟进(成品) - 1.从计算表中取数据 +> @author: zhucx + @date:20220308 封存 + + @describe : + 生产计划跟进(成品) + 1.从计算表中取数据 2.按成品数据汇总,每个阶段取最后工序作为完结条件并显示 @@ -46,4 +46,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生产计划跟进表 — paged stage-tracking report. Per the COMMENT (@author zhucx, 封存 20220308): "生产计划跟进(成品) 1.从计算表中取数据 2.按成品数据汇总,每个阶段取最后工序作为完结条件并显示". The form shows one row per 部件 work-order with N dynamic per-phase column groups (锁定/计划/实际, three columns each). + +**What it does:** Builds the paged dataset from `CalcProductContralsPhase` (or `CalcProductContralsPhase_complete` when `sComplete='1'`) into temp `p_TempTable`. Filters by date range, `sWorkOrderNos`, `iType` (0 normal / 1 backup-plan via `bPlanB`), customer-scope (`Fun_GetLookCustomer`), and `bFilter`. Walks `eleprocessphase` to dynamically create three columns per phase (`s_-锁定`, `s_-计划_json`, `s_-实际_json`), with `sPhase`/`sPhaseplanDate` further filtering rows by stage. Returns total count + bill count + the paged result. + +**Invocation:** Bound as the data-source of four 生产计划跟进表 forms via `gdsconfigformmaster.sSqlStr` — `常用生产计划跟进(部件)` `2022030816063744384745643800279`, `常用生产计划跟进(成品)` `2022031217382686385844770892856`, `备用生产计划跟进(部件)` `2022031916390448749618987764232`, `备用生产计划跟进(成品)` `2022031916395365310062706616416` (each under its own module in 生产计划管理). Loaded when the user opens the report; the row-side calc table is pre-computed by `Sp_Manufacture_MftPlanPhase_BtnEventCalc` / `_product` (the 计算 buttons). diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_MftPlanPhase_BtnEventCalc.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_MftPlanPhase_BtnEventCalc.md index 4ee49e7..cacfd79 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_MftPlanPhase_BtnEventCalc.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_MftPlanPhase_BtnEventCalc.md @@ -1,8 +1,8 @@ # `Sp_Manufacture_MftPlanPhase_BtnEventCalc` (procedure) -> @author: - @date:20220321 封存 - @describe : 生产计划跟进(成品) +> @author: + @date:20220321 封存 + @describe : 生产计划跟进(成品) 1.根据跟进阶段 印刷之后的阶段,创建表CalcProductsPhase,以备快速查询 @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生产计划跟进表 — refresh-button for 生产计划跟进(部件) (printed parts side of the stage-tracking report). Per the COMMENT (@date 20220321 封存): "根据跟进阶段 印刷之后的阶段,创建表CalcProductsPhase,以备快速查询". Pre-computes the per-part-by-phase aggregate (`CalcProductContralsPhase`) so that the slow stage roll-up does not run on every page-load of the report. + +**What it does:** Parses `$.params[*]` from `sProInParam` (`{"key":"slave","value":[{"sId":"..."}]}`). Builds temp `p_MftWorkOrderProcess` and `p_MftWorkOrder_Materials` from the work-order side, runs the post-印刷 phase aggregation per `eleprocessphase` order, and `UPDATE CalcProductContralsPhase` (and via `p_TempTable` / `mftproductionplan`) to refresh the cached stage rows. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 生产计划跟进(部件) report toolbar `计算` button names `Sp_Manufacture_MftPlanPhase_BtnEventCalc` as the action (`Sp__BtnEvent*` pattern). Companion: `Sp_Manufacture_MftPlanPhase_productBtnEventCalc` does the 成品 variant. Install: xly-src `script/标版/30100101/schedule/Sp_Manufacture_MftPlanPhase_BtnEventCalc.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_MftPlanPhase_product.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_MftPlanPhase_product.md index daf7241..be40513 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_MftPlanPhase_product.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_MftPlanPhase_product.md @@ -1,11 +1,11 @@ # `Sp_Manufacture_MftPlanPhase_product` (procedure) -> @author: zhucx - @date:20220308 封存 - - @describe : - 生产计划跟进 - 1.创建临时表,工单部件为单位,投入规划的所有工单 +> @author: zhucx + @date:20220308 封存 + + @describe : + 生产计划跟进 + 1.创建临时表,工单部件为单位,投入规划的所有工单 2.按工序跟进阶段进行数据汇总,每个阶段取最后工序作为完结条件并显示 @@ -42,4 +42,12 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生产计划跟进表(成品) — finished-product variant of the work-order phase-progress report. Aggregates each open `mftworkorder` slave to the latest completed `eleprocessphase` step (1st工序/印刷/印后/出货 etc.) and pivots planned vs. actual dates for finished goods. Header `@date:20220308 封存` flags the proc as frozen since 2022-03; the live form may now point at a newer variant. + +**What it does:** Builds temp tables `p_TempTable`, `p_MftWorkOrderProcess`, `p_MftWorkOrder_Materials` keyed by 工单+部件. Reads `mftworkorderprocess`, `mftworkorderslave`, `mftworkordermaterials`, `mftproductionreportslave`, `mftprocesschangemaster`, `sgdsemigoodsmatchbillslave/process`, `mftworkordercontrolcombine`, `eleprocessphase`, `optimizeprocedure` to roll process records up to phase, then computes the date / qty per phase. Filters by `sCustomerName`, date window `tStartDate..tEndDate`, work-order number list `sWorkOrderNos`, `sPhase` and `sPhaseplanDate`. Final result is selected back through the standard paging block (`bFilter`, `pageNum`, `pageSize`, `totalCount`, `countMapJson`, `sGroupby_*`). + +**Invocation:** Bound as the data-source of two 生产计划跟进表(成品) forms: +- `gfm.sId=2022031217382686385844770892856` +- `gfm.sId=2022031916395365310062706616416` + +Loaded via `gdsconfigformmaster.sSqlStr` when the user opens the report. Install script ships in `xly-src/script/标版/30100101/schedule/`; sibling `Sp_Manufacture_MftPlanPhase_BtnEventCalc` and `Sp_Manufacture_MftPlanPhase_productBtnEventCalc` refer to it for the recalc-button companion. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_MftPlanPhase_productBtnEventCalc.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_MftPlanPhase_productBtnEventCalc.md index c25f486..fceec87 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_MftPlanPhase_productBtnEventCalc.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_MftPlanPhase_productBtnEventCalc.md @@ -1,10 +1,10 @@ # `Sp_Manufacture_MftPlanPhase_productBtnEventCalc` (procedure) -> @author: zhucx - @date:20220321 封存 - - @describe : - 生产Plan跟进(成品) +> @author: zhucx + @date:20220321 封存 + + @describe : + 生产Plan跟进(成品) 1.根据跟进阶段 印刷之后的阶段,创建表CalcProductsPhase,以备快速查询 @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生产计划跟进表(成品) — `BtnEvent` recalc handler for the finished-product phase-progress report. Header comments describe building a `CalcProductsPhase` snapshot for "印刷之后的阶段" (post-press phases) so the report side can return quickly. Header `@date:20220321 封存` flags it as frozen — sits beside `Sp_Manufacture_MftPlanPhase_product` (the read proc). + +**What it does:** Standard generic-button signature (`sProInParam`, `sMakePerson`, `sBrId`, `sSuId`, `sReturn`, `sCode`). Rebuilds the same `p_TempTable` / `p_MftWorkOrderProcess` / `p_MftWorkOrder_Materials` rollup from `mftworkorderprocess`, `mftworkorderslave`, `mftworkordermaterials`, `mftproductionplan`, `mftproductionreportslave`, `mftworkordercontrolcombine`, `sgdsemigoodsmatchbillslave/process`, `eleprocessphase` and persists the per-phase totals so subsequent report queries can skip the recompute. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from the 重算 toolbar button on the 生产计划跟进表(成品) form (`Sp_BtnEvent_*` family signature). No `gdsmodule` hook and no form-master sSqlStr — referenced only by its own install script `xly-src/script/标版/30100101/schedule/Sp_Manufacture_MftPlanPhase_productBtnEventCalc.sql`. Frozen — verify the form's recalc button still targets this name before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_MftWorkOrderAround.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_MftWorkOrderAround.md index e8b037b..13840fc 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_MftWorkOrderAround.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_MftWorkOrderAround.md @@ -34,4 +34,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 — 订单(工单)执行情况 cross-document tracking report. One row per work-order (or related sales-order, per `iType` / `sStatistics`), with companion columns showing what has happened around it: quotation, sales order, production report, semi-good in-store, delivery notify, delivery, reject, sales-checking, invoice, receipt. Lets planners see, for a 工单, whether the order has been quoted, reported, delivered, billed and paid. + +**What it does:** Allocates temp table `p_Tmp_Viw_MftWorkOrderRound`, then `INSERT INTO` it from `Viw_MftWorkOrder` (the base work-order list) filtered by `tStartDate..tEndDate` and `sLoginId` permissions. For each row it left-joins / updates the cross-flow totals using `MftProductionPlanSlave`, `Viw_MftProductionReport`, `Viw_PitProductInStore`/`PitProductInStoreSlave`, `SalDeliverNotifySlave`, `SalDeliverGoodsSlave`, `SalRejectGoodsSlave`, `Viw_SalSalesChecking`/`SalSalesCheckingSlave`, `Viw_SalSalesInvoice`/`SalSalesInvoiceSlave`, `CahReceiptSlave`, `QuoQuotationMaster`, `Viw_SalSalesOrder`. `iType` switches the document axis. Pages out via `CALL Sp_Outstanding_Query` with `bFilter`/`pageNum`/`pageSize`/`countCloumn`/`sGroupby_*`. + +**Invocation:** Standard form-master report-proc signature, but no `gdsconfigformmaster.sSqlStr` row in the live DB currently binds it. Install script is `xly-src/script/标版/30100101/Sp_Manufacture_MftWorkOrderAround.sql` plus a customer-override `xly-src/script/客户/千彩/Sp_Manufacture_MftWorkOrderAround.sql`. Likely loaded by a 订单(工单)执行情况 report form whose sSqlStr was migrated out — verify the matching form's binding before assuming the proc is dead. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_PlanReport.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_PlanReport.md index 0740941..a922101 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_PlanReport.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_PlanReport.md @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 — machine-keyed plan-vs-report dashboard proc. Sibling of `Sp_Manufacture_ProcessReport`: where that one summarises by 工序, this one summarises by 机台/计划. Pulls each machine's planned work-orders and overlays the latest production-report figures so a planner / 班组长 can see, per machine, the open plan and what has already been reported. + +**What it does:** Allocates temp `p_Tmp_ProductionReport`, inserts the machine's planned rows joined out of `mftworkordermaster` / `sgdsemigoodsmatchbillmaster` filtered by `sMachineId_s` (single or `sProceeAllMachine='1'`-style all-machine flag), `sLoginId`, `sBrId`, `sSuId`. Then `UPDATE`s the temp set with reject totals from `SalRejectGoodsSlave`, login info from `SftLoginInfo`, system setting flags from `SysSystemSettings`, and machine-process metadata from `eleprocessmachine`. `sUnTaskFormId` lets the caller scope by which task type the report is presented in. + +**Invocation:** Standard form-master report signature, but no `gdsconfigformmaster.sSqlStr` row in the live DB currently references `Sp_Manufacture_PlanReport` — appears unbound in this snapshot. No xly-src install script either (likely DB-only or migrated). Candidate for a maintainer audit: confirm whether a 生产计划/机台报工 form's data-source has been rewired elsewhere or whether the routine is now dormant. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_PlanStatusSet.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_PlanStatusSet.md index deb3f07..ea8e4e0 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_PlanStatusSet.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_PlanStatusSet.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 — name suggests a 计划状态设置 stub (set production-plan status by GUID). The signature `(sGuid, sStatusValue, sCode, sReturn)` matches a status-toggle button handler, but the live body is a 97-char placeholder: a `SELECT * FROM elecustomer LIMIT 0,1`, then `sReturn='oppr'`, `sCode=1`. Effectively a no-op shell — never received a real implementation. + +**What it does:** Runs one throwaway `SELECT` from `elecustomer` (ignored), then sets `sReturn='oppr'` and `sCode=1`. No update to any plan row, no validation, no side effects. + +**Invocation:** No `gdsmodule` hook, no `gdsconfigformmaster` binding, no other routine in `xlyweberp_saas_ai` references it, no caller in xly-src outside its own install script `xly-src/script/标版/30100101/Sp_Manufacture_PlanStatusSet.sql`. Status: appears orphaned / stub — candidate for maintainer audit (either wire to a real 计划状态 button or drop). diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProcessReport.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProcessReport.md index 74d31cd..29b7441 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProcessReport.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProcessReport.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 — process-level production-report dashboard. Counterpart of `Sp_Manufacture_PlanReport`: groups by 工序 instead of by 计划, so a planner can see, for each machine and state (`iState`), what process steps were reported and what plc/machine-data telemetry was captured. + +**What it does:** Allocates temp `p_Tmp_ProductionReport`, inserts the process-report rows filtered by `iState` (报工状态), `sMachineId_s` (single or all-machine via `sProceeAllMachine`), `sBrId`, `sSuId`, `sLoginId`. `UPDATE`s the temp set with `eleprocessmachine` join data (process metadata per machine), `plc_machinedata` (live PLC telemetry), `SalRejectGoodsSlave` (reject totals), `SftLoginInfo` and `SysSystemSettings`. Returns the paged dataset via the standard `bFilter` / `pageNum` / `pageSize` / `countMapJson` / `sGroupby_*` block. + +**Invocation:** Standard report-proc signature, but no `gdsconfigformmaster.sSqlStr` in the live snapshot references `Sp_Manufacture_ProcessReport` and no other routine in `xlyweberp_saas_ai` calls it. No xly-src install script either. Status: appears orphaned in this snapshot — likely once bound to a 报工/工序日报 form whose data-source was rewired; candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionArrange.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionArrange.md index 33f1bc8..0aed23f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionArrange.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionArrange.md @@ -34,4 +34,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生产计划看板 (无排程 variant — the un-scheduled board). One-row-per-工单 list filtered by customer / date / work-order numbers, used as the customer-and-due-date board on the 生产看板. Header label "生产计划看板(无排程)" distinguishes it from `Sp_Manufacture_ProductionArrange2` which is the page-tree-driven scheduled version. + +**What it does:** Builds temp tables `p_TempTable`, `p_MftWorkOrderProcess`, `p_TempTable_work`, `p_viw_mftproductionreport`. Inserts work-orders from `MftWorkOrderSlave` joined with `mftworkorderprocess` / `viw_mitproductionmaterials` / `mftproductionreportmaster`, filtered by `sCustomerName`, `tStartDate..tEndDate`, `sWorkOrderNos`, `sLoginId`. Computes per-工单 progress (planned vs. reported), rolls process status up, then `CALL Sp_Do_UpdateByPageSizeBefore` to apply standard paging and returns the rows via `bFilter` / `pageNum` / `pageSize` / `countMapJson` / `sGroupby_*`. + +**Invocation:** Bound as the data-source of 生产看板 and 大屏看板 forms via `gdsconfigformmaster.sSqlStr` — including `15905732950005954209191860345000` (生产看板, under 生产管理 → 生产计划管理 → 生产计划看板) and a fleet of `101251240115016087744...` 大屏看板 variants. Also `gfm 101251240115016111296520860` (生产计划甘特图). Loaded when the user opens any of those boards. Install script: `xly-src/script/标版/30100101/Sp_Manufacture_ProductionArrange.sql` plus upgrade and customer-specific overrides (千彩, 嘉诚). diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionArrange2.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionArrange2.md index 2308a74..b661611 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionArrange2.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionArrange2.md @@ -1,10 +1,10 @@ # `Sp_Manufacture_ProductionArrange2` (procedure) -> @author: qmj - @date:20210714 封存 - @describe : 生产计划看板 - 1.创建临时表,工单部件为单位创建若干条数据,并筛选分页条数 - 2.生产工单状态,按印前、印刷、印后、成品顺序拼接工序完工状态 +> @author: qmj + @date:20210714 封存 + @describe : 生产计划看板 + 1.创建临时表,工单部件为单位创建若干条数据,并筛选分页条数 + 2.生产工单状态,按印前、印刷、印后、成品顺序拼接工序完工状态 3.稽查部件材料状态 @@ -39,4 +39,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生产计划看板 / 大屏看板 / 生产计划甘特图 — page-tree variant of `Sp_Manufacture_ProductionArrange`. Header (`@author qmj @date 20210714 封存 @describe 生产计划看板`) describes building 工单+部件 rows, concatenating per-stage status (印前/印刷/印后/成品), and auditing 部件 material status. Marked 封存 (sealed) since 2021-07 — may have a successor in production. + +**What it does:** Builds temp `p_TempTable`, `p_MftWorkOrderProcess`, `p_MftWorkOrder_Materials`. For each open `MftWorkOrderSlave` joined with `mftworkorderprocess` / `mftworkordermaterials` / `mftproductionreportslave` / `sgdsemigoodsmatchbillslave` / `sgdsemigoodsmatchbillprocess`, computes per-stage completion (印前→印刷→印后→成品 concatenated state string) and material-status flags. Calls `Sp_Do_ProcedurePageTree` to apply the page-tree grouping (parent 工单 → 部件 children) and emits rows through the standard `bFilter` / `pageNum` / `pageSize` / `countMapJson` / `sGroupby_*` block. + +**Invocation:** Bound as data-source of 生产看板 / 大屏看板 / 生产计划甘特图 forms via `gdsconfigformmaster.sSqlStr` — `gfm.sId` `15905732950005954209191860345000`, `101251240115016033608492850`, `101251240115016076722376990`, `101251240115016111296520860`, and the `101251240115016087744...` 大屏看板 series. Loaded when the user opens any of those screens. Install scripts: `xly-src/script/标版/30100101/schedule/Sp_Manufacture_ProductionArrange2.sql` and customer-specific `xly-src/script/客户/无锡中江/Sp_Manufacture_ProductionArrange2.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionArrangePro.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionArrangePro.md index 02a14b5..f29f579 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionArrangePro.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionArrangePro.md @@ -34,4 +34,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生产计划看板 — "Pro" variant of `Sp_Manufacture_ProductionArrange`. Same calling signature (`sCustomerName`, date window, `sWorkOrderNos`, paging block) and same business header (生产计划看板); the implementation is a leaner rebuild — fewer joins, smaller body — likely an attempt at a faster look-up board. + +**What it does:** Builds temp `p_TempTable` from `MftWorkOrderSlave` joined with `viw_mftworkorderprocess` and `mftproductionreportslave`, filtered by `sCustomerName`, `tStartDate..tEndDate`, `sWorkOrderNos`, `sLoginId`, `sBrId`, `sSuId`. Updates per-工单 progress columns, then `CALL Sp_Do_UpdateByPageSizeBefore` to apply standard paging and emits results via `bFilter` / `pageNum` / `pageSize` / `countMapJson` / `sGroupby_*`. + +**Invocation:** No `gdsconfigformmaster.sSqlStr` row in the live snapshot references `Sp_Manufacture_ProductionArrangePro`, no `gdsmodule` hook binds it, and no other routine in `xlyweberp_saas_ai` calls it. No xly-src install script either. Status: appears orphaned — looks like a "Pro" rewrite that never replaced the canonical `Sp_Manufacture_ProductionArrange` in any form binding; candidate for maintainer audit (promote-to-canonical or drop). diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo.md index 82fb241..c04663f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生产排程 — header label "点击机台获取排程数据". Loads the per-machine 排程从表 list (the rows under the machine card) when the planner clicks a machine on the scheduling board. Anchor data-source of the 机台排程 view's middle pane. + +**What it does:** Parses `bFilter` for `sMachineId`, `sProcessId`, `sWorkCenterId`, `sState`, `sId`, `tStartDate` (special-cases "所有"). Builds a temp set off `MftProductionPlanSlave` filtered by those facets and tenant, then projects the standard schedule columns (`sWorkOrderId`, `sCustomerId`, `sProductId`, `sProcessId`, `sMachineId`, qty/time fields, status flags) for the requested machine + state. Pages out via `bFilter` / `pageNum` / `pageSize` / `countMapJson` / `sGroupby_*`. + +**Invocation:** Bound as data-source of 排程从表 / 从表分贴信息 / 机台班组信息 forms via `gdsconfigformmaster.sSqlStr` — `gfm.sId` `15813214130002729874796826202000`, `15813919750004894187658775812000`, `101251240115016110217766930`, `101251240115016110217770120`, `101251240115016221814786810`, `2022042422052580722848452054923`, `2022042422070075250247809950228`, etc. Also referenced by `WorkOrderPlanServiceImpl` and sister-routines `Sp_Manufacture_ProductionPlanInfoTree`, `..._TC`, `..._YH`, `..._YS`. Install scripts in `xly-src/script/标版/30100101/schedule/` plus customer overrides (远传, 千彩, 金宣发). diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo1.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo1.md index 7a83d74..8ae29f4 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo1.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo1.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生产排程 — earlier numbered variant of `Sp_Manufacture_ProductionPlanInfo` (the 点击机台获取排程数据 data-source). Same signature except `countMapJson varchar(5000)` (vs. the canonical `longtext`); body extracts only `sMachineId` from `bFilter` (no `sProcessId` / `sWorkCenterId` / `sId` / `tStartDate` parsing), suggesting an older revision of the same proc. + +**What it does:** When `bFilter` contains "所有", rewrites it to `sMachineId = `, then builds temp `PlanInfo` from `MftProductionPlanSlave` joined with customer/product/process lookups for that machine. `Update PlanInfo` to overlay derived fields and pages out via `CALL Sp_Outstanding_Query` honouring `bFilter` / `pageNum` / `pageSize` / `countCloumn` / `sGroupby_*`. + +**Invocation:** No `gdsconfigformmaster.sSqlStr`, `gdsmodule` hook, other-routine, or xly-src caller references this name. Status: appears orphaned — looks like a retired numbered checkpoint left behind during the rewrite of `Sp_Manufacture_ProductionPlanInfo`; candidate for maintainer audit before deleting. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo12.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo12.md index cc467b5..576089f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo12.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo12.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生产排程 — checkpoint copy of `Sp_Manufacture_ProductionPlanInfo` (header label 点击机台获取排程数据). Same signature, same `bFilter`-parsing logic, same `MftProductionPlanSlave` source. Looks like a numbered snapshot kept beside the canonical proc. + +**What it does:** Same flow as `Sp_Manufacture_ProductionPlanInfo`: parses `bFilter` into `sMachineId`/`sProcessId`/`sWorkCenterId`/`sState`/`sId`/`tStartDate`, builds temp `PlanInfo` (via `Insert Into PlanInfo` + `Update PlanInfo`) from `MftProductionPlanSlave` filtered to the chosen machine and tenant, optionally updates `MftProductionPlanSlave` itself with derived fields, and returns the paged rows. + +**Invocation:** No `gdsconfigformmaster.sSqlStr`, `gdsmodule` hook, other-routine, or xly-src caller references this name. Status: appears orphaned — a numbered checkpoint of `Sp_Manufacture_ProductionPlanInfo`; candidate for maintainer audit before deleting. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoLock_detail.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoLock_detail.md index 9bdcb09..c301a5a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoLock_detail.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoLock_detail.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生产排程 — header label 机台排程:排程从表(点击排程+号调取). Lock variant of `Sp_Manufacture_ProductionPlanInfo_detail`: returns the same 排程从表 child-row payload for one parent 排程 id, but the body is laid out for use under the locked-row code path (the version planners hit when a row is currently being scheduled / frozen). + +**What it does:** Takes parent ids in `p_sId` (longtext) and `CONCAT`s a dynamic `SELECT` over `mftproductionplanslave` projecting the same schedule child columns as `Sp_Manufacture_ProductionPlanInfo_detail` (`sWorkOrderId`, `sCustomerId`, `sProductId`, `sProcessId`, `sMachineId`, qty/time fields, status flags, ordering). Executes the prepared SQL and returns the result set. + +**Invocation:** No `gdsconfigformmaster.sSqlStr`, `gdsmodule` hook, other-routine, or Java caller references it directly — only the install script `xly-src/script/标版/30100101/schedule/Sp_Manufacture_ProductionPlanInfoLock_detail.sql`. Likely called dynamically by the same lock-path code that wraps `Sp_Manufacture_ProductionPlanInfo_detail`, or kept as a fallback for the row-lock UI. Status: candidate for maintainer audit — confirm which code path still resolves this name. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoNew.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoNew.md index 3019c9a..22ce95a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoNew.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoNew.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 — refreshed (`New`) variant of the machine-clicked tree-grid data source for the 生产排程 boards. Was intended as a replacement for the per-machine plan listing under the 排程 forms. + +**What it does:** Accepts the standard pageable report shape (`bFilter`, `pageNum`/`pageSize`, `sFilterOrderBy`, `sGroupby_*`, `countCloumn`/`countMapJson` for footer totals). The `bFilter` parser that splits rows per `sHandlType` is commented out; the surviving path just defers paging/grouping/total-count to the outstanding-query helper. Comment is `点击机台获取排程数据(树形结构带不固定查询)`. + +**Invocation:** No form-master binding, no `gdsmodule` hook, no caller in `information_schema.ROUTINES`, no xly-src reference. Status: appears orphaned — the live 排程 forms bind to `Sp_Manufacture_ProductionPlanInfoTree*` instead. Candidate for maintainer audit (likely a parallel draft superseded by the `_Tree_Base*` family). diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree.md index 93c5330..7e1344d 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree.md @@ -33,4 +33,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生产排程(Tree) — data source for the production-scheduling tree-grid that opens when a planner clicks a machine. The proc is a thin entry point on top of `Sp_Manufacture_ProductionPlanInfoTree_Base`; siblings `_TC`, `_YH`, `_YS` re-dispatch into the same base with different mode tags (`'TC'`, `'YH'`, `'YS'`) for sub-variants of the board. + +**What it does:** Body is just `CALL Sp_Manufacture_ProductionPlanInfoTree_Base(sFlag, sLoginId, iBillOutside, sState, sBrId, sSuId, bFilter, pageNum, pageSize, totalCount, countCloumn, countMapJson, sFilterOrderBy, sGroupby_select_sql, sGroupby_group_sql, 'TREE')` — passes the standard pageable-report inputs through and tags `sTypeSear='TREE'` so the base proc builds the tree-shaped result. + +**Invocation:** Bound as `gdsconfigformmaster.sSqlStr` of the 生产排程(Tree) form `sId 101251240115016221814783940` under module 生产计划管理 (`sId 19211681019715501158184690`) inside 生产管理. Loaded when the user opens the tree-view scheduling board. Customer overrides exist in `script/客户/远传/`, `script/客户/千彩/`, `script/客户/金宣发/` — verify which override is live. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_Base.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_Base.md index f8fe1a0..fa65670 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_Base.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_Base.md @@ -34,4 +34,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生产排程(Tree) — shared base for the production-scheduling tree-grid. `sTypeSear` selects the dialect: `'TREE'` for the generic 排程(Tree) form. `_YH` (印后) and `_YS` (印刷) variants delegate here too in older deployments, though the current `Sp_Manufacture_ProductionPlanInfoTree_YH/_YS` actually call the `_TC` companion — see those pages. + +**What it does:** Materialises `MftProductionPlanSlave_Tmp` and `MftProductionPlanSlave_Tmp_div` from `MftProductionPlanSlave`, joins with `eleprocess` to attach the prior-process name, and refines per-machine ordering with window-style row numbering (`@ROWNUM`, `@GROUP_NAME`). Then funnels the result through the outstanding-query helper for paging, `countCloumn`/`countMapJson` footer totals, and `bFilter` splicing. ~14K body — see `SHOW CREATE PROCEDURE`. + +**Invocation:** Reached indirectly: dispatched by `Sp_Manufacture_ProductionPlanInfoTree` (the form-master entry) and historically by `_TC`/`_YH`/`_YS`. No direct form-master binding, no `gdsmodule` hook, no Java caller. Shipped as `script/标版/30100101/schedule/Sp_Manufacture_ProductionPlanInfoTree_Base.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_Base_TC.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_Base_TC.md index f6e1566..a1b0e3c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_Base_TC.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_Base_TC.md @@ -34,4 +34,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 印刷日计划 / 印后日计划 — `TC` ("套餐"/typed-card) base for the production-tree variants used by the dated 印刷日计划 and 印后日计划 boards. Dispatched into with `sTypeSear` in `{'TC','YH','YS'}` so a single body serves three look-alike boards. + +**What it does:** Larger sibling of `_Tree_Base` (~30K body). Same scratch-table pipeline — `MftProductionPlanSlave_Tmp` / `MftProductionPlanSlave_Tmp_div` materialised from `MftProductionPlanSlave`, joined with `eleprocess` and overlaid with `mftproductionplanslavelock` to flag locked rows. Adds material-status filtering (`bYs=0 WHERE LOCATE('未核实', sMaterialsStatus)>0`) for the 印刷/印后 dialects. Final result goes through the outstanding-query helper for paging/totals. + +**Invocation:** Reached indirectly: `Sp_Manufacture_ProductionPlanInfoTree_TC`, `_YH`, and `_YS` each `CALL` this proc with their tag (`sFlag`/`'YH'`/`'YS'`). Each of those is the `sSqlStr` of a different form — 生产排程(Tree), 印后日计划 form `2022042422070062930346682786757`, 印刷日计划 form `2022042422052518162677975419910`. No direct form-master binding for the `_Base_TC` proc itself. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_TC.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_TC.md index 8053fe4..fa0ad78 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_TC.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_TC.md @@ -33,4 +33,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生产排程(Tree) (印刷/印后 TC dialect) — thin dispatcher to `Sp_Manufacture_ProductionPlanInfoTree_Base_TC`. The `TC` ("套餐") tag is one of three production-tree dialects (TC / YH / YS) that share the same base body. + +**What it does:** Body is just `CALL Sp_Manufacture_ProductionPlanInfoTree_Base_TC(...sFilterOrderBy, sGroupby_select_sql, sGroupby_group_sql, sFlag)` — forwards every standard pageable-report argument and passes its caller-supplied `sFlag` as the `sTypeSear` tag, so the base proc can switch behaviour per dialect. + +**Invocation:** No direct form-master binding, no `gdsmodule` hook, no Java caller, no xly-src install script. Other-routine references in `information_schema.ROUTINES` are only the sibling base/`_YH`/`_YS` (which don't actually call this proc — they call `_Base_TC` directly). Status: appears orphaned — superseded by direct `_Base_TC` calls from the dialect forms. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_YH.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_YH.md index 0ac222c..589b005 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_YH.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_YH.md @@ -33,4 +33,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 印后日计划 — `YH` (印后, post-press) dispatcher for the production-tree board. The 印后日计划 form binds this proc; the post-press planner clicks a machine and sees a tree of plan rows refined for post-press operations. + +**What it does:** Body is just `CALL Sp_Manufacture_ProductionPlanInfoTree_Base_TC(sFlag, sLoginId, iBillOutside, sState, sBrId, sSuId, bFilter, pageNum, pageSize, totalCount, countCloumn, countMapJson, sFilterOrderBy, sGroupby_select_sql, sGroupby_group_sql, 'YH')` — same shape as the `_TC`/`_YS` siblings, but hard-codes `sTypeSear='YH'` so the base proc applies the post-press dialect. + +**Invocation:** Bound as `gdsconfigformmaster.sSqlStr` of the 印后日计划 form `sId 2022042422070062930346682786757` under module 印后日计划 (`sId 16508092060001068718031474516000`) → 生产计划管理 → 生产管理. Loaded when the user opens that day-plan board. Shipped as `script/标版/30100101/schedule/Sp_Manufacture_ProductionPlanInfoTree_YH.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_YS.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_YS.md index 81fc099..60c90b5 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_YS.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_YS.md @@ -33,4 +33,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 印刷日计划 — `YS` (印刷, press) dispatcher for the production-tree board. The 印刷日计划 form binds this proc; the press planner clicks a machine and sees a tree of plan rows refined for press operations. + +**What it does:** Body is just `CALL Sp_Manufacture_ProductionPlanInfoTree_Base_TC(sFlag, sLoginId, iBillOutside, sState, sBrId, sSuId, bFilter, pageNum, pageSize, totalCount, countCloumn, countMapJson, sFilterOrderBy, sGroupby_select_sql, sGroupby_group_sql, 'YS')` — same shape as `_TC`/`_YH` siblings, hard-coding `sTypeSear='YS'` so the base proc applies the press dialect. + +**Invocation:** Bound as `gdsconfigformmaster.sSqlStr` of the 印刷日计划 form `sId 2022042422052518162677975419910` under module 印刷日计划 (`sId 16508090850002295893127095467000`) → 生产计划管理 → 生产管理. Loaded when the user opens that day-plan board. Shipped as `script/标版/30100101/schedule/Sp_Manufacture_ProductionPlanInfoTree_YS.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_copy1.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_copy1.md index c2072e6..45744dc 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfoTree_copy1.md @@ -33,4 +33,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_Manufacture_ProductionPlanInfoTree` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_Manufacture_ProductionPlanInfoTree` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_ChangeMachine.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_ChangeMachine.md index e5ad307..636b93e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_ChangeMachine.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_ChangeMachine.md @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生产排程 — header label 机台计划:更换机台. The scheduler-board action that moves planned `mftproductionplanslave` rows from one machine to another (or splits across teams), recalculating start/end dates inside the new machine's calendar. Used when a planner re-allocates a job from a busy machine to a spare, or splits a job into batches across machines. + +**What it does:** Parses `sProInParam` (the JSON list of selected plan rows) plus the target `sMachineId`, `sTeamId`, `sWorkCenterId`, the optional `bSplit` / `iSplitNum` (batch split), and date window `tStartDate..tEndDate`. `CALL Sp_Sis_GetConst` to load localised messages, reads `elemachine`, `mftproductionplanslave`, `syssystemsettings` to validate the target machine. Then `UPDATE mftproductionplanslave` to switch `sMachineId`, `sTeamId`, `sWorkCenterId`, planned dates; when splitting, `INSERT INTO mftproductionplanslave` new child rows. Mirrors back into `UPDATE mftworkorderprocess` so the work-order side stays in sync, and `INSERT into syslog` for audit. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 更换机台 toolbar button on the 生产排程 board names this proc. No `gdsmodule.sProcName` / form-master `sSqlStr` binding (it's an action proc, not a data-source). Install scripts: `xly-src/script/标版/30100101/schedule/Sp_Manufacture_ProductionPlanInfo_ChangeMachine.sql` and customer override `xly-src/script/客户/千彩/Sp_Manufacture_ProductionPlanInfo_ChangeMachine.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_OutSideWorkCenter.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_OutSideWorkCenter.md index 214c309..bd8d59c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_OutSideWorkCenter.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_OutSideWorkCenter.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生产排程 — outsourced-process variant of `Sp_Manufacture_ProductionPlanInfo_WorkCenter`. Drives the 顶部机台卡片 (top machine-card strip) for 工作中心 entries that represent 委外工序 (`Viw_OpsOutsideProcess`) — vendor-handled steps that still need to be tracked on the scheduling board. + +**What it does:** Builds temp `p_TmpWorkCenter` rows by `INSERT INTO p_TmpWorkCenter SELECT O.sId, '1', P.sWorkCenterId, '已下达', W.sName, 0, O.iOrder FROM Viw_OpsOutsideProcess O JOIN eleprocess P ON O.sProcessId=P.sId JOIN sisworkcenter W ON P.sWorkCenterId=W.sId WHERE O.bCopyLimit=0 AND O.bCheck=1 AND O.bInstoreComplete=0 AND O.bInvalid=0 AND Abs(O.dAuxiliaryQty)-Abs(O.dInStoreAuxiliaryQty)>0` and tenant match. Then selects each card with a synthetic `sId` like `__` (special-cases 全部/未排/null) and per-card totals (`dHour`). Pages out through `bFilter` / `pageNum` / `pageSize` / `countMapJson` / `sGroupby_*`. + +**Invocation:** No `gdsconfigformmaster.sSqlStr` row in the live snapshot binds it, no other routine in `xlyweberp_saas_ai` calls it, no Java caller found. Install script: `xly-src/script/标版/30100101/schedule/Sp_Manufacture_ProductionPlanInfo_OutSideWorkCenter.sql`. Status: appears orphaned in this DB — likely an outsourcing extension to the 顶部机台卡片 strip that was wired up per tenant or pending activation; candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_WorkCenter.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_WorkCenter.md index 7669a0d..d900d5d 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_WorkCenter.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_WorkCenter.md @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生产排程 — header label 机台排程:排程获取机台(小卡片). Drives the 顶部机台卡片 (top machine-card strip) and 机台班组信息 (machine/team panel) on the scheduling board: one card per machine inside the selected 工作中心, with workload aggregates (planned hours, "全部 / 未排" buckets, dispatched). + +**What it does:** Builds temp `p_TmpWorkCenter` for the chosen `sWorkCenterId`, populating one row per machine plus the synthetic "全部" / "未排" buckets. Filters `mftproductionplanslave` by `sWorkCenterId` and tenant, joins `elemachine` for machine names. Honours user-permission flags (`p_iProcessFilter`, `p_iViewAllMachine`, `p_sSuper`, `p_sUserId`, `p_sProcessFilter`). Selects each card with a synthetic `sId` like `__` (special-cases 全部/未排/null) and the per-card `dHour`. Pages out through `bFilter` / `pageNum` / `pageSize` / `countMapJson` / `sGroupby_*`. + +**Invocation:** Bound as data-source of 机台班组信息 / 顶部机台卡片 forms via `gdsconfigformmaster.sSqlStr` — `gfm.sId` `15812505560004852289206660178000`, `101251240115016110217766080`, `101251240115016221814783730`, `2022042422052548412969553934358`, `2022042422070056807157450658649` (multi-process scheduler variants). Loaded when the user opens the 生产排程 board. Install scripts in `xly-src/script/标版/30100101/schedule/` and `xly-src/script/标版/20210323/gdsconfigformmaster.sql` (the form-binding seed). diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_WorkCenter1.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_WorkCenter1.md index 201cd4c..9e5222a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_WorkCenter1.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_WorkCenter1.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生产排程 — earlier / variant version of `Sp_Manufacture_ProductionPlanInfo_WorkCenter` (the 机台排程 顶部机台卡片 data-source). Same signature; the body is a leaner build that groups by 工序 first (`eleprocess.sProcessName`) rather than by 机台 — likely the predecessor before the unified WorkCenter rewrite. + +**What it does:** Builds temp `p_TmpWorkCenter` with three buckets per `sWorkCenterId`: `iOrder=0` "全部单据" placeholder, `iOrder=1` "未排" (per `eleprocess`, summing `mftproductionplanslave.dHour` where `sState=0`), `iOrder=2` "所有" per machine (joining `elemachine`, summing scheduled hours / 60). Filters by `sWorkCenterId` when provided. Pages out via `bFilter` / `pageNum` / `pageSize` / `countMapJson`. + +**Invocation:** Referenced only by `xly-src/script/标版/20210323/gdsconfigformmaster.sql` — the 2021-03 form-binding seed listing the form-master rows that *used* to point at this proc. The live `gdsconfigformmaster` snapshot no longer binds it (current 机台班组信息 forms target `Sp_Manufacture_ProductionPlanInfo_WorkCenter` instead). Status: appears retired in favour of the canonical WorkCenter proc; candidate for maintainer audit before deleting. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_WorkCenter2.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_WorkCenter2.md index 08431fd..6a58128 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_WorkCenter2.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_WorkCenter2.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生产排程 — second variant of `Sp_Manufacture_ProductionPlanInfo_WorkCenter` (机台排程 顶部机台卡片 / 机台班组信息 data-source). Body is near-identical to `Sp_Manufacture_ProductionPlanInfo_OutSideWorkCenter`: bootstraps cards from `Viw_OpsOutsideProcess` joined with `eleprocess`/`sisworkcenter`, intended for tenants whose machine-strip needs to include 委外工序 alongside the in-house machines. + +**What it does:** Builds temp `p_TmpWorkCenter` by `INSERT INTO p_TmpWorkCenter SELECT O.sId, '1', P.sWorkCenterId, '已下达', W.sName, 0, O.iOrder FROM Viw_OpsOutsideProcess O JOIN eleprocess P ON O.sProcessId=P.sId JOIN sisworkcenter W ON P.sWorkCenterId=W.sId WHERE O.bCopyLimit=0 AND O.bCheck=1 AND O.bInstoreComplete=0 AND O.bInvalid=0 AND Abs(O.dAuxiliaryQty)-Abs(O.dInStoreAuxiliaryQty)>0` and tenant match, grouped by `sWorkCenterId`. Emits each card with a synthetic `__` id and per-card `dHour`. Pages out via the standard paging block. + +**Invocation:** Bound as data-source of 机台班组信息 form `gfm.sId=101251240115016197477619210` via `gdsconfigformmaster.sSqlStr` — the only live binding. No xly-src install script (DB-only). Status: looks like a per-form override for tenants needing outsourcing cards on the 机台班组信息 panel. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_copy1.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_copy1.md index 64a2730..28d72e9 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_copy1.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_Manufacture_ProductionPlanInfo` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_Manufacture_ProductionPlanInfo` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_detail.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_detail.md index 2474700..873e6cc 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_detail.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_detail.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生产排程 — header label 机台排程:排程从表(点击排程+号调取). Returns the child-row list (排程从表 / 从表分贴信息) for one parent 排程 master id when the user clicks the `+` expand control on the scheduler board. Drives every "expand" interaction on the 机台排程 view. + +**What it does:** Takes a list of parent ids in `p_sId` (longtext, comma/dash-split client-side) and `CONCAT`s a dynamic `SELECT` over `mftproductionplanslave` projecting the full schedule child columns (`sWorkOrderId`, `sCustomerId`, `sProductId`, `sProcessId`, `sMachineId`, `sWorkCenterId`, `sTeamId`, qty fields `dProductQty/dProductionReportQty/dProcessQty`, time fields `dHour/dCalcHour1/dAdjustHour/tStartDate/tEndDate`, status flags `bCut/bMat/bPublish/bMakeup/bFrozen`, etc.) joined with related dimension tables; the SQL is prepared and executed via `EXECUTE`. + +**Invocation:** Called from Java by `WorkOrderPlanServiceImpl.getProductionPlanInfoList()` — which builds `"call Sp_Manufacture_ProductionPlanInfo_detail(...)"` against `businessBaseDao.getByMap(...)` whenever the scheduler board needs to expand a master row. Also bound as data-source of 排程从表 / 从表分贴信息 forms via `gdsconfigformmaster.sSqlStr` — `gfm.sId` `101251240115016110217766930`, `101251240115016110217770120`, `101251240115016221814786810`, `2022042422052580722848452054923`, `2022042422070075250247809950228`, `15813919750004894187658775812000`. Install scripts: `xly-src/script/标版/30100101/schedule/` and `xly-src/script/客户/千彩/`. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_gant.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_gant.md index e8d57c6..b4ebbf6 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_gant.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionPlanInfo_gant.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生产计划甘特图 — Gantt-flavour data-source for the 排程 board. Same signature as `Sp_Manufacture_ProductionPlanInfo` (`sFlag`, `sLoginId`, `sState`, `bFilter`, paging block) and same `bFilter` machine/process/state parsing logic, but groups the rows by `sSrcNo` and iterates them by cursor — the shape the Gantt component needs (one bar per source order across machines). + +**What it does:** Parses `bFilter` to pull out `sMachineId`, `sProcessId`, `sWorkCenterId`, `sState`, `sId`, `tStartDate`. Builds temp `ptable_PlanInfo` from `MftProductionPlanSlave` for the matching machine/process and state, then opens cursor `Cur_row` over `SELECT DISTINCT(sSrcNo) FROM ptable_PlanInfo ORDER BY iIncrement` and per-source aggregates `dConter`, `dAdjustConter`, `dAdjustHour`, `dAbnormalHour`, `dHour`. Pages out via the standard `pageNum` / `pageSize` / `totalCount` / `countMapJson` block. + +**Invocation:** No `gdsconfigformmaster.sSqlStr` row in the live snapshot binds it, no other routine references it, no xly-src caller found. Status: appears orphaned in this DB — the 生产计划甘特图 form `gfm.sId=101251240115016111296520860` currently binds `Sp_Manufacture_ProductionArrange2` instead. Looks like an earlier Gantt-specific implementation that was retired in favour of the unified Arrange2 path; candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionProcess.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionProcess.md index 57d3c47..a0035e4 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionProcess.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionProcess.md @@ -33,4 +33,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 — work-order production-progress (生产进度排程) report. For each 工单 filtered by work-no / manual-no / order-no / customer / sales-rep / date range, the proc assembles a per-process progress matrix: planned qty vs. reported qty vs. delivered qty, plus material-availability tags ("需采购"/"库存料"/"已采购"), so the production controller can see at-a-glance which orders are ready, blocked, or running. + +**What it does:** Builds scratch table `TMP_ProductionArrange` from `Viw_MftWorkOrder` filtered by the bill-no/customer/date inputs, then layers progress from `Viw_MftProductionPlan`, `viw_mftproductionreport`, `mftproductionreportslave`, `MftProductionPlanSlave` joined to `eleMachine`, and outside-process state from `Viw_OpsOutsideProcess`. Material status comes from `MftWorkOrderMaterials` joined against `Viw_PurPurchaseOrder` / `Viw_PurPurchaseInStore`, with the language constants resolved out of `SysSystemSettings (CbxLanguage, CbxProductioning, CbxProductionReport)`. Computes `dRatio = 100 * dProductionReportQty / dProductQty` (or vs. `dPriorReportQty`). Result paged via `Sp_Outstanding_Query`. + +**Invocation:** Referenced from `Fun_getInitColumnByProName` (column-init helper that introspects procs by name). No direct form-master binding, no `gdsmodule` hook found. Shipped as `script/标版/30100101/Sp_Manufacture_ProductionProcess.sql`. Most likely bound to a 生产进度 report form via dynamic dispatch (column-init metadata) rather than a literal `sSqlStr` — verify the active form binding before relying on it. Status: likely live but channel not confirmed. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionReport.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionReport.md index 82df201..d600fa8 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionReport.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionReport.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 移动端管理 → 现场 → 功能操作 → 内部报工 / 成品发外 — and KPI流程操作菜单 → 订单生产流程 → 3/3 生产工单->产量上报. Data source for the operator-facing production-report grid that lists work-order rows pending or completed reporting for a given machine / process / state. Filters by `iState` (pending vs. reported), the operator's machine list (`sMachineId_s`), and a `bFilter` JSON. + +**What it does:** Materialises scratch `p_Tmp_ProductionReport` with order/process/machine columns plus `sFactCapacityId/Name` and `sPayrollCalculate` (实际产能 metadata). Seeds from `mftworkorderprocess` joined with `eleprocessmachine` to filter to machines the operator owns, layers reject/quality stats from `SalRejectGoodsSlave`, and tags rows with the language-aware status strings from `SysSystemSettings`. Final result paged via the standard outstanding-query helper. ~34K body — see `SHOW CREATE PROCEDURE`. + +**Invocation:** Bound as `gdsconfigformmaster.sSqlStr` on three forms — 3/3 生产工单->产量上报 (`19211681019715326710140550`, under KPI流程操作菜单 → 订单生产流程), 内部报工 (`101251240115015881530120280`, under 移动端管理 → 现场 → 功能操作), and 成品发外(单据) (`101251240115015903880377400`, same parent). Also referenced from `Fun_getInitColumnByProName` for column-init. Shipped as `script/标版/30100101/Sp_Manufacture_ProductionReport.sql`. Companion non-mobile/legacy variant: `Sp_Manufacture_Report`. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionWorkCenter.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionWorkCenter.md index fa4fcfc..1a8102a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionWorkCenter.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProductionWorkCenter.md @@ -36,4 +36,14 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Cross-module — bound by four 分析 forms: 采购管理 → 采购分析报表 → 采购大数据分析, PLM管理 → 研发数据管理(雅昌), 生产实效分析 → 工单效率分析(暂不开放), and 采购管理 → 询价比价 → 采购价格分析查询. Despite the name "WorkCenter", the proc is reused as a generic work-order pivot — filters by 工单号 / 手单号 / 订单号 / 客户名 / 业务员 / 日期 / `iType` and returns a per-工单中心 (work-center) progress + cost/qty pivot. + +**What it does:** Materialises scratch `P_TMP_MftWorkCenter` (and a `_tmp` companion) from `sisworkcenter` joined with `MftWorkOrderMaster/Slave`, then layers reports from `Viw_MftProductionReport`, outside-process state from `Viw_OpsOutsideProcess`, inbound store from `Viw_PitProductInStore`, and delivery from `Viw_SalDeliverGoods` keyed by `eleproduct`. Switches behaviour on `SysSystemSettings.CbxProductionReport` and applies the cut-paper/check tags. Final paging via `Sp_Outstanding_Query`. ~22K body. + +**Invocation:** Bound as `gdsconfigformmaster.sSqlStr` on: +- 采购大数据分析 form `19211681019715708471874930` — 采购管理 → 采购分析报表 +- 研发数据管理(雅昌) form `19211681019715708719759210` — PLM管理 +- 工单效率分析(暂不开放) form `19211681019715708722218530` — 生产实效分析 +- 采购价格分析查询 form `101251240115015889205266110` — 采购管理 → 询价比价 + +Also referenced by `Fun_getInitColumnByProName` for grid-column metadata. Shipped as `script/标版/30100101/Sp_Manufacture_ProductionWorkCenter.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProducttionPlan_List.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProducttionPlan_List.md index 820f16f..2d941b6 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ProducttionPlan_List.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ProducttionPlan_List.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生成排程 — proc is named with the typo `Producttion`. Used by 生成排程 (generate-plan) screens to drive the left-side list/summary panel: given a state/operation filter plus a work-center / machine / team / SQL-condition / id-set, returns the aggregated rows for the planner to select rows to schedule. COMMENT is `生成排程`. + +**What it does:** Branches on `iOperType` (0 = list-summary mode). For `iStates=8` (a special status) groups rows from `mftproductionplanslave` joined to `sisworkcenter` by `(s.sId, s.sName)` summing `dHour` and `dProcessQty`; otherwise the same group but filtered by `iState = iStates`. The dynamic SQL is built via `CONCAT` with `sBrId`/`sSuId`/`sSqlCondition` interpolated and then `PREPARE`/`EXECUTE`d. Other `iOperType` branches handle by-machine and by-team summaries. + +**Invocation:** No form-master binding, no `gdsmodule` hook, no other-routine caller in `information_schema.ROUTINES`. xly-src only ships the install script `script/标版/30100101/Sp_Manufacture_ProducttionPlan_List.sql` — no Java/XML reference. Status: appears orphaned in the metadata channels — probably dispatched as a button via the generic procedure-call endpoint (typical for `sCode`/`sReturn`-shaped procs), but the caller wasn't located. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_PurPurchaseChecking.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_PurPurchaseChecking.md index ff2d180..6726478 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_PurPurchaseChecking.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_PurPurchaseChecking.md @@ -42,4 +42,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 / 采购管理 — `工单到采购计划` (work-order to purchase-plan) pivot. For a selected set of work-orders / styles / customers, returns the consolidated materials list that the purchaser needs to procure: per (sMaterialsId, sCustomerId) accumulating product qty / money / min/max stock so the buyer can decide whether to issue a purchase plan. + +**What it does:** Builds scratch `Tmp1` keyed by `(sMaterialsId, sMaterialsNo, sMaterialsName, sMaterialsStyle, sCustomerId, …)` from `Viw_PurPurchaseChecking` filtered by the comma-list inputs (`sId_s`, `sStyle_s`, `sWorkId_s`, `sWorkOrderNo_s`, `sCustomerName_s`, `sProductName_s`, `iPurchase_s`, `bViewAll_s`, `bSlaveAll_s`). A second pass `update Tmp1 t1` enriches each row, then `UPDATE tmp AS TMP_Viw_PurPurchaseChecking_BFla …` applies the `bFilter` overlay. Final paging via `Sp_Outstanding_Query`. COMMENT is `工单到采购计划`. + +**Invocation:** No form-master binding, no `gdsmodule` hook, no other-routine caller. xly-src only ships the install script `script/标版/30100101/Sp_Manufacture_PurPurchaseChecking.sql`. Status: appears orphaned in the metadata channels — sibling `Sp_Manufacture_SalSalesChecking` (same `工单到采购计划` comment) is also unbound, suggesting both have been retired in favour of view-driven flows. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ReplaceContent.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ReplaceContent.md index a80078f..644c588 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ReplaceContent.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ReplaceContent.md @@ -1,7 +1,7 @@ # `Sp_Manufacture_ReplaceContent` (procedure) -> @author:qmj - @date:20210706 封存 +> @author:qmj + @date:20210706 封存 @describe: 工艺卡批量修改色标 @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 工艺管理 — `工艺卡批量修改色标` (process-card batch-replace of color-mark). The proc's own COMMENT marks it `封存` (sealed/archived) on 2021-07-06 by author qmj. Pre-archival use case: on a selected set of `mftproductslave` rows, replace `sCReserve1` (the color-mark field on the related `mftproductcontrol`) from one value to another. + +**What it does:** Parses the standard generic-dispatch payload `sProInParam` (`$.params[*].value[*].sSlaveId` plus `$.changeValue.sSReserve1` / `$.sSReserve2`). For every passed `sSlaveId`, joins `mftproductslave` → `mftproductcontrol` by `sParentId` filtered on `sBrandsId`/`sSubsidiaryId`, then `UPDATE mftproductcontrol SET sCReserve1 = p_sSReserve2 WHERE … LIKE concat('%', p_sSReserve1, '%')`. Each change is logged into `syslog`. + +**Invocation:** Status: appears orphaned and self-marked `封存`. No form-master binding, no `gdsmodule` hook, no other-routine caller, no xly-src reference beyond the install script `script/标版/30100101/Sp_Manufacture_ReplaceContent.sql`. The `sProInParam`/`sReturn`/`sCode` signature suggests it was once a generic-dispatch button handler. Candidate for maintainer cleanup. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_Report.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_Report.md index e5b508a..6f05d52 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_Report.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_Report.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 — predecessor of `Sp_Manufacture_ProductionReport` (same parameter list, almost identical body but with many sections commented out). Was the data source for the production-report grid before the live `Sp_Manufacture_ProductionReport` superseded it. + +**What it does:** Same shape as `Sp_Manufacture_ProductionReport` — populates `p_Tmp_ProductionReport` from `mftworkordermaster` and `eleprocessmachine`, with reject/quality columns from `SalRejectGoodsSlave`. Most update steps that exist in `ProductionReport` are commented out here (`-- update p_Tmp_ProductionReport`), so this version essentially seeds the scratch table without the enrichment passes. ~25K body, mostly comments. + +**Invocation:** No form-master binding in `gdsconfigformmaster` matches this proc directly — the three forms that used the literal `Sp_Manufacture_Report` token (per `script/标版/20210323/gdsconfigformmaster.sql`) now bind `Sp_Manufacture_ProductionReport`. No `gdsmodule` hook, no other-routine caller. Status: appears orphaned — superseded by `Sp_Manufacture_ProductionReport`. The sibling `Sp_Manufacture_ReportProgress` (`机台计划,主计划:工序进度查看`) is a different proc and is still bound to 生产进度(弹窗). Candidate for maintainer cleanup. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ReportProgress.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ReportProgress.md index ac54447..d74a7f5 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ReportProgress.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ReportProgress.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 常用模块 → 常用设置 → 生产进度(弹窗) — `机台计划,主计划:工序进度查看`. Pop-up dialog data source that shows the per-process progress for one selected work-order (passed as `p_sWorkOrderId` for the master and `s_sWorkOrderId` for the slave/specific phase). Operators on the machine-plan or master-plan board double-click a row to see how far each process has progressed. + +**What it does:** Builds scratch `p_TempTable` from `mftworkorderprocess` and `mftproductionplan`, joined back to `MftProductionPlanSlave` for plan-vs.-actual rows. Two enrichment passes (`UPDATE p_TempTable P` / `UPDATE p_TempTable t`) layer reported qty and progress per-process. Final result paged via `Sp_Outstanding_Query`. ~12K body, comments include `机台计划,主计划:工序进度查看`. + +**Invocation:** Bound as `gdsconfigformmaster.sSqlStr` of the 生产进度(弹窗) form `sId 101251240115016209138719510` under module 常用设置 (`sId 19211681019715652613160550`) → 常用模块. Loaded when the user opens the progress pop-up. Shipped as `script/标版/30100101/schedule/Sp_Manufacture_ReportProgress.sql`; customer override exists in `script/客户/无锡中江/`. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ReportProgress_copy1.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ReportProgress_copy1.md index 55dc554..d5c8b95 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ReportProgress_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ReportProgress_copy1.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_Manufacture_ReportProgress` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_Manufacture_ReportProgress` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_ReportQty_BtnEventCalc.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_ReportQty_BtnEventCalc.md index f307513..83cac5f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_ReportQty_BtnEventCalc.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_ReportQty_BtnEventCalc.md @@ -1,11 +1,11 @@ # `Sp_Manufacture_ReportQty_BtnEventCalc` (procedure) -> @author: - - @date:20220321 封存 - - @describe : 生产数量统计 - +> @author: + + @date:20220321 封存 + + @describe : 生产数量统计 + 1.统计工单所有工序计划数与实际上报数,创建表Manufacture_CalcReportQty,以备快速查询 @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 — `生产数量统计` button-event calc. Self-marked `封存` (sealed/archived) on 2022-03-21 in the proc COMMENT. Pre-archival use case: for the work-orders selected on the grid, count all phase plan-qty vs. actual-report-qty and persist a per-工单/工序 snapshot into helper table `Manufacture_CalcReportQty` plus dynamic columns on form `gdsconfigformslave sParentId='20221120093809227887221363776979'` so a fast-query report can read it back. + +**What it does:** Parses the standard generic-dispatch payload `sProInParam` (`$.params[0].value[*].sId` = slave ids). Enumerates `eleprocessphase` rows via a cursor to size up dynamic columns; rebuilds `p_TempTable` and `p_MftWorkOrderProcess` from `MftWorkOrderProcess` joined to `elecustomer`. Refreshes `gdsconfigformslave` for that fixed `sParentId` — `DELETE` + `INSERT INTO gdsconfigformslave (…) VALUES (…)` per-phase to materialise dynamic columns shaped like `decimal(18,0) default 0 comment ''`. Self-test snippet in the comments shows the form_sId is `20221120093809227887221363776979`. + +**Invocation:** Status: appears orphaned and self-marked `封存`. No form-master binding, no `gdsmodule` hook, no other-routine caller, no xly-src reference. The `sProInParam`/`sReturn`/`sCode` signature is the generic-dispatch button-event shape (would have been called via `GenericProcedureCallServiceImpl.doGenericProcedureCall()`). Candidate for maintainer cleanup. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_SalSalesChecking.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_SalSalesChecking.md index 86082bd..5d4735e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_SalSalesChecking.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_SalSalesChecking.md @@ -42,4 +42,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 / 销售管理 — sales-side mirror of `Sp_Manufacture_PurPurchaseChecking`. COMMENT is `工单到采购计划` (likely mis-labelled — the body operates on `Viw_SalSalesChecking`). Pivots sales-order line items by product for a selected set of work-orders / customers, so a sales operator can decide whether the order is ready to ship. + +**What it does:** Builds scratch `Tmp1` keyed on product (`sProductId, sParentId, sProductNo, sProductName, sProductStyle, sProductUnit, sCustomerId, sCustomerProductNo`) with totals `dTotalProductQty / dTotalProductPrice / dTotalProductMoney`, and `dMaxStock`/`dMinStock` from inventory. Source is `Viw_SalSalesChecking` filtered by the comma-list inputs. Two enrichment passes (`UPDATE Tmp AS t` and `update Tmp1 t1`) refresh aggregates, then `Sp_Outstanding_Query` handles paging and the `bFilter` overlay. + +**Invocation:** No form-master binding, no `gdsmodule` hook, no other-routine caller in `information_schema.ROUTINES`. xly-src only ships the install script `script/标版/30100101/Sp_Manufacture_sSalSalesChecking.sql` (note typo `sSal`). Status: appears orphaned in the metadata channels — paired with `Sp_Manufacture_PurPurchaseChecking` (also unbound). Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_SalSalesOrderReport.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_SalSalesOrderReport.md index 386d877..24fbfab 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_SalSalesOrderReport.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_SalSalesOrderReport.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 / 销售管理 — `MES产量统计表` (MES output-statistics report). Per `eleprocess` × `sisproductclassify`, returns current-month and YTD sales money plus 平印 (lithography) and 轮印 (rotary) transfer counts, with a four-bucket sales-money classification (≤3000 / 3000–5000 / 5000–10000 / >10000). + +**What it does:** Creates temp `SalSalesOrderReport` with columns `sProductId, sProductclassifyId, dSalesMoneyMonth, dSalesMoneyYear, dLithographyMonthQyt, dLithographyYearQyt, dRotateMonthQyt, dRotateYearQyt, dSalesClassificat_1..4`. Seeds rows from `eleprocess` joined to `sisproductclassify`. Calls `Sp_Do_UpdateByPageSizeBefore` to set up paging, then enriches the temp from sales-order and production-report sources (full body via `SHOW CREATE PROCEDURE` — ~4.5K). + +**Invocation:** No form-master binding, no `gdsmodule` hook, no other-routine caller in `information_schema.ROUTINES`. xly-src only ships the install script `script/标版/30100101/Sp_Manufacture_SalSalesOrderReport.sql`. Status: appears orphaned in the metadata channels — likely registered under a customer-specific form not present in 标版. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime.md index 0a86fec..5616995 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime.md @@ -1,8 +1,8 @@ # `Sp_Manufacture_SetTime` (procedure) -> @author:钱豹 - @date:20210530 封存 - @describe: 按当前机台的排单次序,重算开始时间,耗时,结束时间,考虑因素有 单双休,工作时间 +> @author:钱豹 + @date:20210530 封存 + @describe: 按当前机台的排单次序,重算开始时间,耗时,结束时间,考虑因素有 单双休,工作时间 条件为: 已排程 或 已下达 的未撤单记录 @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 机台作业任务执行 — scheduling-side recompute for the per-machine 排单 sequence. After a user re-sorts or re-targets work-order rows on a machine, this proc walks the machine's pending 排程/已下达 (未撤单) rows in `mftproductionplanslave`, recomputes each row's `tCStartTime / dHour / tCEndTime` taking single/double-shift, working hours and off-time into account, and back-writes the new schedule. + +**What it does:** Reads `sMachineId / iOrder / tCStartTime / sWorkCenterId` from `$.params[0].value[0]` of `sProInParam`. Per row it calls `Sp_CalcPlan_dHour` to get the per-row duration, then `UPDATE mftproductionplanslave` with new start/end/hour; iterates downstream rows in `iOrder` order, propagating end-time → next-row start-time. Also `update elemachine` for the machine's current state and `CALL Sp_productionPlan_BtnEventAutoOrderSettime` plus `Sp_Sis_GetConst` for localised error text. Author 钱豹, marked 封存 (frozen) 2021-05-30. + +**Invocation:** Dispatched dynamically by Java `WorkOrderPlanServiceImpl.doSetTime(...)` via `procedureService.getDoProMap("Sp_Manufacture_SetTime", setTime)` + `getCallProByMap(setTime, "Sp_Manufacture_SetTime")` — the 机台排程 calculation entry-point declared in `BtnCalculationService` ("机台、统一规划 调用 Sp_unifiedPlanning_BtnCalculation,Sp_Manufacture_SetTime时候执行"). Also called from `Sp_unifiedPlanning_BtnCalculation`, `Sp_BtnCalculation_Machine_time_byMachineType`, `Sp_productionPlan_BtnEventAutoOrder10`, `Sp_productionPlan_BtnEventCnl`, and the per-employee variant `Sp_Manufacture_SetTime_Employ`. No gdsmodule or form-master binding — purely Java/proc-chain dispatched. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime2.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime2.md index 82b6807..2392de7 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime2.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime2.md @@ -1,8 +1,8 @@ # `Sp_Manufacture_SetTime2` (procedure) -> @author:钱豹 - @date:20210530 封存 - @describe: 按当前机台的排单次序,重算开始时间,耗时,结束时间,考虑因素有 单双休,工作时间 +> @author:钱豹 + @date:20210530 封存 + @describe: 按当前机台的排单次序,重算开始时间,耗时,结束时间,考虑因素有 单双休,工作时间 条件为: 已排程 或 已下达 的未撤单记录 @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 机台作业任务执行 — second-generation variant of `Sp_Manufacture_SetTime` for the same per-machine 排单 recompute. Shares the comment header ("按当前机台的排单次序,重算开始时间..."), differs in how the per-row update is composed: this one drives `Sp_System_ReplaceField` for templatable field updates and also writes `mftworkordermaterials` (material side of the work-order) in addition to `mftproductionplanslave` and `elemachine`. + +**What it does:** Same outer JSON-param contract as `Sp_Manufacture_SetTime`, but the inner loop uses `call Sp_System_ReplaceField` to splice dynamic column assignments into `UPDATE mftproductionplanslave` and `UPDATE mftworkordermaterials`, then `update elemachine` for machine state. No direct call to `Sp_CalcPlan_dHour` — duration logic is inlined. + +**Invocation:** No caller found in any channel — no gdsmodule hook, no form-master binding, no other-routine `CALL Sp_Manufacture_SetTime2`, and no xly-src reference. Author 钱豹, comment marks it 封存 (frozen). Status: appears orphaned — kept alongside `Sp_Manufacture_SetTime` as an alternative implementation; candidate for maintainer audit before deletion. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTimeDivRow.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTimeDivRow.md index a5aa496..632f0a5 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTimeDivRow.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTimeDivRow.md @@ -1,8 +1,8 @@ # `Sp_Manufacture_SetTimeDivRow` (procedure) -> @author:钱豹 - @date:20210530 封存 - @describe: 按当前机台的排单次序,重算开始时间,耗时,结束时间,考虑因素有 单双休,工作时间 +> @author:钱豹 + @date:20210530 封存 + @describe: 按当前机台的排单次序,重算开始时间,耗时,结束时间,考虑因素有 单双休,工作时间 条件为: 已排程 或 已下达 的未撤单记录 @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 机台作业任务执行 — row-splitting variant in the SetTime family. When a work-order row exceeds a single shift's worth of work, this proc splits one `mftproductionplanslave` row into multiple sub-rows so each fits within the machine's shift window, then writes the recomputed start/end/hour for each piece. + +**What it does:** For machine `p_sMachineId` starting at `p_tCStartTime`, walks pending 排程/已下达 rows; on each row computes the per-shift slice using the same single/double-shift calendar as `Sp_Manufacture_SetTime`, and issues `UPDATE mftproductionplanslave` per slice with new `tCStartTime / dHour / tCEndTime`. Only DML target is `mftproductionplanslave` (no machine-state or material-side writes). + +**Invocation:** No caller found in any channel — no gdsmodule binding, no form-master ref, no other proc CALLing it, no Java reference. Install script ships at `script/标版/30100101/schedule/Sp_Manufacture_SetTimeDivRow.sql`. Status: appears orphaned — kept as an alternative row-split implementation; candidate for maintainer audit. Author 钱豹, 封存. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime_BB.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime_BB.md index 7a90e76..d6ce819 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime_BB.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime_BB.md @@ -1,8 +1,8 @@ # `Sp_Manufacture_SetTime_BB` (procedure) -> @author:钱豹 - @date:20210530 封存 - @describe: 按当前机台的排单次序,重算开始时间,耗时,结束时间,考虑因素有 单双休,工作时间 +> @author:钱豹 + @date:20210530 封存 + @describe: 按当前机台的排单次序,重算开始时间,耗时,结束时间,考虑因素有 单双休,工作时间 条件为: 已排程 或 已下达 的未撤单记录 @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 机台作业任务执行 — third variant in the `Sp_Manufacture_SetTime*` family (the "_BB" suffix is the author's working copy). Same intent as `Sp_Manufacture_SetTime` — per-machine 排单次序 schedule recompute — but populates an additional staging table `MftProductionPlanSlave_Tmp_div` while running, suggesting it was a step toward the splitting/sub-row logic that `Sp_Manufacture_SetTimeDivRow` later isolated. + +**What it does:** Same JSON-param contract. Loops the machine's 排程/已下达 (未撤单) rows in `mftproductionplanslave`, calls `Sp_System_ReplaceField` for dynamic column updates, `INSERT INTO MftProductionPlanSlave_Tmp_div` for the per-row decomposition, then `UPDATE mftproductionplanslave`, `UPDATE mftworkordermaterials`, and `update elemachine` to commit machine state. + +**Invocation:** No caller found in any channel — no gdsmodule binding, no form-master ref, no other proc CALLing it, no xly-src reference. Author 钱豹, marked 封存. Status: appears orphaned — an in-progress branch of the SetTime family superseded by the production `Sp_Manufacture_SetTime` and the row-split `Sp_Manufacture_SetTimeDivRow`. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime_Employ.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime_Employ.md index f4b7d3e..29726f1 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime_Employ.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime_Employ.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 机台作业任务执行 — per-employee variant of the schedule recompute (header: "计算时间,计算锁定数据时间"). Walks the locked rows for one operator/machine, calls the per-process worker for each, and returns the running end-time so the outer scheduler can chain rows. + +**What it does:** Truncates the helper staging `DELETE FROM p_mftproductionplanslave_Employ`, then for each row associated with `p_sMachineId` calls `Sp_Manufacture_SetTime_process` to recompute the one work-step, advancing `p_tEndDateOut` and `p_tPriorDateOut` along the way. INOUT `p_calPlanOrder` tracks the in-place sort cursor. Also `CALL Sp_Manufacture_SetTime_Employ` recursively for nested dependent rows. + +**Invocation:** Called by `Sp_Manufacture_SetTime` (the main scheduler) — appears in its CALL graph. No direct gdsmodule hook, no form-master binding, no Java reference; install script ships at `script/标版/30100101/schedule/Sp_Manufacture_SetTime_Employ.sql`. Internal helper inside the SetTime family. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime_process.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime_process.md index 4347c43..d9aa577 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime_process.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime_process.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 机台作业任务执行 — single-process worker (header: "单条工序的计算") inside the SetTime family. Recomputes one work-step row of `mftproductionplanslave` for a given `p_sPlanslaveId / p_tCStartTime / p_sMachineId`: applies the shift/work-time/off-day calendar via `Sp_Manufacture_SetTime_tDate`, returns the new `p_tEndtDate` and the advanced cursor `p_tPriorDateOut / p_calPlanOrder` so the caller can chain to the next row. + +**What it does:** Calls `Sp_System_ReplaceField` to splice templatable column assignments, then `UPDATE mftproductionplanslave` with the recomputed `tCStartTime / dHour / tCEndTime` for the single row. Honours the upstream `p_tPriorDateIN` so dependent rows don't start before their predecessor finished. INOUT `p_calPlanOrder` is incremented per processed step. + +**Invocation:** Called by `Sp_Manufacture_SetTime_Employ` (per-employee recompute) and by `Sp_Manufacture_SetTime` (the main per-machine scheduler) — internal helper for the SetTime family. No gdsmodule hook, no form-master binding, no Java reference. Install script ships at `script/标版/30100101/schedule/Sp_Manufacture_SetTime_process.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime_tDate.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime_tDate.md index b78811a..20f7bcc 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime_tDate.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_SetTime_tDate.md @@ -1,8 +1,8 @@ # `Sp_Manufacture_SetTime_tDate` (procedure) -> @author:钱豹 - @date:20210530 封存 - @describe: 按当前机台的排单次序,重算开始时间,耗时,结束时间,考虑因素有 单双休,工作时间 +> @author:钱豹 + @date:20210530 封存 + @describe: 按当前机台的排单次序,重算开始时间,耗时,结束时间,考虑因素有 单双休,工作时间 条件为: 已排程 或 已下达 的未撤单记录 @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 机台作业任务执行 — calendar helper inside the SetTime family. Given a candidate start instant `p_tCStartTime`, a daily work-minutes budget `p_dWorkTimesum`, the shift/off-shift boundaries `p_sShiftsWork / p_sWorkOff`, and the shift-style flag `p_sWorkType` (1=single 白班, 2=double 白/晚), it snaps the start to the next valid working window and returns the adjusted datetime in `tDate` plus the "skipped minutes" gap in `sDayxx`. + +**What it does:** Pure compute, no DML. Inspects the `%H:%i` part of `p_tCStartTime`, classifies it as `sShiftsWork` (off-shift gap) or `sOffWork` (on-shift), and for two-shift mode (`p_sWorkType=2`) shifts the start forward to the next shift opening; for single-shift mode advances by a day when past the off-time. The minute gap to the next opening is returned in `sDayxx` so the caller can add it to the row's `dHour`. + +**Invocation:** No direct caller found in any channel — neither in gdsmodule, form-master, other routines (no `CALL Sp_Manufacture_SetTime_tDate` in the DB), nor xly-src. Status: appears orphaned. The `_tDate` name and comment header place it firmly in the `Sp_Manufacture_SetTime*` family; likely an in-progress calendar helper for the (封存) re-scheduler that was inlined into the production scheduler before this helper was wired up. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_TeamEmployee.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_TeamEmployee.md index f6915df..c5ce4c9 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_TeamEmployee.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_TeamEmployee.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 — utility lookup that returns the per-machine 班组 (team) + 员工 (employee) + 岗位 (position) roster for currently-scheduled production-plan rows. Used to drive a dropdown / picker for "who is at this machine right now" in the manufacturing UI. + +**What it does:** Drops and re-creates the temp table `TeamEmployeeTmp`, then `Insert into TeamEmployeeTmp` rows from `mftproductionplanslave A JOIN eleteamemployee B ON A.sTeamId = B.sParentId` restricted to `sMachineId<>'' and sState NOT IN (0,5)` (skip 撤单 / 未排程). Several `UPDATE TeamEmployeeTmp ... JOIN elemachine / eleteam / eleemployee / sisposition` calls back-fill the display names. Final `SELECT * FROM TeamEmployeeTmp` returns the result set to the caller. + +**Invocation:** No caller found in any channel — no gdsmodule hook, no form-master binding, no other proc CALLing it, no xly-src reference. Status: appears orphaned. Probably an unused lookup helper kept from an earlier UI iteration; candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_WorkOrderStatistics.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_WorkOrderStatistics.md index bce08ae..e47ff6b 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_WorkOrderStatistics.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_WorkOrderStatistics.md @@ -1,8 +1,8 @@ # `Sp_Manufacture_WorkOrderStatistics` (procedure) -> @author: qmj - @date:20210714 封存 - @describe : 工单统计报表 +> @author: qmj + @date:20210714 封存 + @describe : 工单统计报表 以工单部件为单位,显示成品,材料数量状态 @@ -33,4 +33,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 机台作业任务执行 → 产量汇总 — paged 工单统计报表 (header: "以工单部件为单位,显示成品,材料数量状态"). One row per 工单部件 (work-order component) showing 委印单位 / 印刷品名称 / 部件 / order numbers (册 / 令 / 封面 / 张数 / 吨数) so 生产管理 can monitor whether each component's finished-goods qty and material qty are tracking the order. + +**What it does:** Creates the temp table `p_TempTable` with the wide column set (`iOrder, sId, sCustomerId, sCustomerName, sWorkOrderNo, sProductName, sPartsName, dPartsQty, dOrderNumQyt, dCoverQty, dSheetsInfactoryQty, dSheetsSelffactoryQty, dTonnesQyt, dPrintSheetsQyt, ...`), `insert Into p_TempTable` from the work-order / control / parts joins, then several `update p_TempTable` passes that join in the production-report and material totals. Final paged result is returned via `CALL Sp_Outstanding_Query` with `bFilter / sFilterOrderBy / sGroupby_*` splicing. Author qmj, 2021-07-14 封存. + +**Invocation:** Bound as the data-source of the 产量汇总 form `gfm.sId 192116811110916275265126420` under 机台作业任务执行 → 产量汇总 (`gdsmodule.sId 192116811110916275265124110`) via `gdsconfigformmaster.sSqlStr`. Loaded when the user opens the report. Ships at `script/标版/30100101/schedule/Sp_Manufacture_WorkOrderStatistics.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_sSodPurchareMaterials.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_sSodPurchareMaterials.md index 5a7e734..6215ab3 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_sSodPurchareMaterials.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_sSodPurchareMaterials.md @@ -42,4 +42,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 / 物料采购流程 — sister of `Sp_Manufacture_sWodPurchareMaterials`, but driven from the sales-order side (header: 根据销售订单采购物料 — "purchase materials from sales orders"). Takes selected 销售订单 rows, rolls up their material demand, nets against on-hand and on-order, and returns the gridded purchase-suggestion lines via the standard `Sp_Outstanding_Query` paging contract. + +**What it does:** Builds the staging table `Tmp` with the sales-order material breakdown (`Insert INTO Tmp` / `Insert into TmpMaterials`), iterates `delete from TmpMaterials`/`Update Tmp` for net-out logic, then `INSERT INTO sWodMaterialsStoreList` and `Update sWodMaterialsStoreList` for the output staging that the report grid renders. Final paged select runs through `CALL Sp_Outstanding_Query` with `bFilter / sFilterOrderBy / sGroupby_*` splicing. + +**Invocation:** No form-master binding, no gdsmodule hook, no other-routine reference, and no Java caller — install script ships at `script/标版/30100101/schedule/Sp_Manufacture_sSodPurchareMaterials.sql`. Status: appears orphaned — present in the install tree but not wired to a form. Likely the legacy sales-order counterpart to the work-order-driven `Sp_Manufacture_sWodPurchareMaterials` that is the active version. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_sWodPurchareMaterials.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_sWodPurchareMaterials.md index afff05c..46d11cc 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_sWodPurchareMaterials.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_sWodPurchareMaterials.md @@ -42,4 +42,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 物料采购流程 → 1/4 物料需求计划->采购订单 — paged report that turns work-order material rollups into a purchase-plan grid (header: 工单到采购计划). For the selected 工单 rows, sums required material against on-hand and reservation virtual stock, splits the residual into purchase-suggestion lines per supplier, and returns the gridded result with the standard `Sp_Outstanding_Query` paging contract. + +**What it does:** Builds working tables: `Tmp` (work-order material breakdown joined from `MftWorkOrderMaterials`, `purpurchaseordermaster` for already-on-order, `elematerialsstock` for warehouse, `MitMaterialsStoreVirtual` for the reservation pool), `p_work` for the per-work-order pivot, `p_sSupplyId_table` for supplier shortlists, and `sWodMaterialsStoreList` as the output staging — populated by `INSERT INTO ... / UPDATE ...` against each helper, then the final SELECT through `Sp_Outstanding_Query` for filter/page/total/groupby splicing. + +**Invocation:** Bound as the data-source of two form-masters under 物料采购流程 → 1/4 物料需求计划->采购订单 (`gdsmodule.sId 19211681019715620563907770`): 物料需求计划 (`gfm.sId 19211681019715620563909010`) and 物料需求计划详情 (`gfm.sId 19211681019715622273398481`) via `gdsconfigformmaster.sSqlStr`. Also referenced by `Fun_getInitColumnByProName` for grid-init metadata. Ships at `script/标版/30100101/Sp_Manufacture_sWodPurchareMaterials.sql` (production) and `script/客户/千彩/Sp_Manufacture_sWodPurchareMaterials.sql` (千彩 customer override). diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_sWodPurchareMaterials_copy1.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_sWodPurchareMaterials_copy1.md index a97e3b7..63a37e4 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_sWodPurchareMaterials_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_sWodPurchareMaterials_copy1.md @@ -42,4 +42,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_Manufacture_sWodPurchareMaterials` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_Manufacture_sWodPurchareMaterials` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Manufacture_sWodPurchareMaterials_new.md b/en/docs/auto-catalog/procedures/Sp_Manufacture_sWodPurchareMaterials_new.md index 68a363f..4076980 100644 --- a/en/docs/auto-catalog/procedures/Sp_Manufacture_sWodPurchareMaterials_new.md +++ b/en/docs/auto-catalog/procedures/Sp_Manufacture_sWodPurchareMaterials_new.md @@ -42,4 +42,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 物料采购流程 → 1/4 物料需求计划->采购订单 — staged rewrite of `Sp_Manufacture_sWodPurchareMaterials` (header: 工单到采购计划). Same input contract and same output (work-order → purchase-plan grid), but reorganises the staging-table layout. Ships as a `_new` candidate under `script/标版/20250616/` ahead of swapping production over. + +**What it does:** Reads from `MftWorkOrderMaterials`, `purpurchaseordermaster`, `elematerialsstock`, `MitMaterialsStoreVirtual`, and `SysSystemSettings`, fills the same `Tmp / p_work / p_sSupplyId_table / sWodMaterialsStoreList` staging tables that the production version uses, and returns the page through `Sp_Outstanding_Query`. Differences from the live version include refactored stock-aggregation joins and additional reservation handling. + +**Invocation:** No form-master binding, no gdsmodule hook, no other-routine `CALL Sp_Manufacture_sWodPurchareMaterials_new`, and not currently wired into any Java caller. Only DB artefact present is the install file at `script/标版/20250616/Sp_Manufacture_sWodPurchareMaterials_new.sql`. Status: appears orphaned — pre-production candidate not yet swapped in. Compare against `Sp_Manufacture_sWodPurchareMaterials` before promoting. diff --git a/en/docs/auto-catalog/procedures/Sp_MaterialAgingAnalysis.md b/en/docs/auto-catalog/procedures/Sp_MaterialAgingAnalysis.md index d597b2d..2803456 100644 --- a/en/docs/auto-catalog/procedures/Sp_MaterialAgingAnalysis.md +++ b/en/docs/auto-catalog/procedures/Sp_MaterialAgingAnalysis.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料库存 — paged 材料库龄分析表 (material aging analysis). Buckets every on-hand material row by how long it has sat in stock, grouped against a fixed allow-list of inventory `sFormId`s (raw-material, finished-stock, virtual-store, etc.) so the user can see what is "stuck" in the warehouse. + +**What it does:** Builds the temp `P_Tmp_sFromId` with a hard-coded list of inventory `sFormId` values (`'192116810113315220315711060'`, `'192116810113315226622476570'`, `'101251168116315839165634020'`, ...). Populates `P_Tmp_Materials_List` from `elematerialsstock` / `mitmaterialsstore` / `PitMaterialsStore` filtered by those forms, rolls up into `P_Tmp_Materials_List_Group` (per material × style with aging buckets), and finally `P_Tmp_Materials_List_return` is the output staging picked up by the report grid through the standard `bFilter / sFilterOrderBy / sGroupby_*` paging contract. + +**Invocation:** No form-master binding, no gdsmodule hook, no other-routine reference, no Java caller — install script ships at `script/标版/30100101/Sp_MaterialAgingAnalysis.sql` plus a performance patch at `script/标版/optimize/Sp_MaterialAgingAnalysis.sql`. Status: appears orphaned in this database. Likely the production data-source for an aging-analysis report that has not been wired to a form-master in the current `xlyweberp_saas_ai` instance; candidate for maintainer audit / form-master verification. diff --git a/en/docs/auto-catalog/procedures/Sp_MaterialAgingAnalysis_YM.md b/en/docs/auto-catalog/procedures/Sp_MaterialAgingAnalysis_YM.md index bbb21dd..a82ca8c 100644 --- a/en/docs/auto-catalog/procedures/Sp_MaterialAgingAnalysis_YM.md +++ b/en/docs/auto-catalog/procedures/Sp_MaterialAgingAnalysis_YM.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料库存 — month-end variant (header: 材料库龄月末分析表) of `Sp_MaterialAgingAnalysis`. Same aging-bucket logic but constrained to a `tStartDate / tEndDate` month range, so finance can pull a closing-month snapshot of stuck inventory rather than the live position. + +**What it does:** Same staging-table layout as the live aging proc — `P_Tmp_sFromId` for the inventory form-list, `P_Tmp_Materials_List` populated from the inventory form-bound tables filtered to the month boundary, `P_Tmp_Materials_List_Group` for the per-material aggregation with aging buckets, `P_Tmp_Materials_List_return` as the paged-output staging. The `tStartDate / tEndDate` parameters narrow the underlying-transaction window before the same `bFilter / sFilterOrderBy / sGroupby_*` paging contract is applied. + +**Invocation:** No form-master binding, no gdsmodule hook, no other-routine reference, no Java caller, no xly-src install script. Status: appears orphaned. Likely the planned month-end counterpart to `Sp_MaterialAgingAnalysis` that was authored but not yet attached to a 月末报表 form-master; candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_MaterialAgingAnalysis_detail.md b/en/docs/auto-catalog/procedures/Sp_MaterialAgingAnalysis_detail.md index 5a2b689..4cfb3b2 100644 --- a/en/docs/auto-catalog/procedures/Sp_MaterialAgingAnalysis_detail.md +++ b/en/docs/auto-catalog/procedures/Sp_MaterialAgingAnalysis_detail.md @@ -38,4 +38,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料库存 — drill-down detail variant (header: 材料库龄分析详情表) of `Sp_MaterialAgingAnalysis`. Given one aging row (`iType`, `sMaterialsId`, `sMaterialsStyle`, `sWareHouseId`, `sLocationId`, `sDefineNo`, `sDefineNo2`), returns the underlying inventory rows that contributed to that bucket so the user can see exactly which 入库 / 调拨 entries are aging. + +**What it does:** Reuses the `P_Tmp_sFromId` form-allow-list helper (populated via `INSERT into P_Tmp_sFromId`) and routes through `CALL Sp_Sis_GetMertialsInventoryFormGuid` to translate the inventory-type into the correct form GUID set, then builds `P_Tmp_Materials_List_Group` filtered to the requested material/style/location/define-nos. The output staging `P_Tmp_Materials_List_return` is paged via the standard `bFilter / sFilterOrderBy / sGroupby_*` contract. + +**Invocation:** No form-master binding, no gdsmodule hook, no other-routine reference, no Java caller, no xly-src install script. Status: appears orphaned in this database — companion drill-down for the orphaned `Sp_MaterialAgingAnalysis`; would normally be wired to a detail-view popup off the parent report's row click. diff --git a/en/docs/auto-catalog/procedures/Sp_MaterialCheck_BtnEventMaterialCheck.md b/en/docs/auto-catalog/procedures/Sp_MaterialCheck_BtnEventMaterialCheck.md index e81e5bf..7a30e8d 100644 --- a/en/docs/auto-catalog/procedures/Sp_MaterialCheck_BtnEventMaterialCheck.md +++ b/en/docs/auto-catalog/procedures/Sp_MaterialCheck_BtnEventMaterialCheck.md @@ -1,9 +1,9 @@ # `Sp_MaterialCheck_BtnEventMaterialCheck` (procedure) -> @author:钱豹 - @date:20210602 封存 - @describe:按主计划中的 规划中 次序,列出相应工单对应的材料,进行材料核实 - 1.先做库存匹配 +> @author:钱豹 + @date:20210602 封存 + @describe:按主计划中的 规划中 次序,列出相应工单对应的材料,进行材料核实 + 1.先做库存匹配 2.逐条核实库存,如果需要采购,需要注明到料日期 @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 — 主辅料稽查 (material check) entry-point. For the 主计划 → 规划中 work-order rows selected by the user, this proc lists the materials each work-order needs, matches them against on-hand `elematerialsstock`, marks rows that can be fulfilled from stock, and flags the rest as needing a purchase with a 到料日期 placeholder. The header notes "1.先做库存匹配 2.逐条核实库存,如果需要采购,需要注明到料日期" (author 钱豹, 2021-06-02 封存). + +**What it does:** Reads the operator-selected ids from `sProInParam`. Looks up the warehouse-allow-list constant `ComMaterialsWareHouse` from `gdsformconst`. Builds `Materials_Tmp` (required) and `Materials_Tmp_Check` (with diff text) plus `elematerialsstock_Tmp_Check` (live stock snapshot). For each row, compares required `dQty` vs stock `dAuxiliaryQty`; on a match writes `bPlanMaterialCheck=1, bPlanMaterialCheckResult=1` to `mftworkordermaterials`; on a shortfall sets `bPlanMaterialCheck=1, bPlanMaterialCheckResult=0` with the diff text in `sMaterial / sMaterialDiff` so the user can resolve via 稽查通过 / 稽查失败. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 主辅料稽查 toolbar button names `Sp_MaterialCheck_BtnEventMaterialCheck` as the action (`Sp__BtnEvent*` pattern). Also `CALL`-ed inline by the APS-state procs `Sp_Manufacture_GetAPSStateOee` and `Sp_Manufacture_GetPlanAPSstate` (which reuse the check logic when refreshing APS planning state). Companions: `Sp_MaterialCheck_BtnEventMaterialCheckPass` and `Sp_MaterialCheck_BtnEventMaterialCheckFail`. Install script ships at `script/标版/30100101/schedule/Sp_MaterialCheck_BtnEventMaterialCheck.sql` (plus a dated variant `*MaterialCheck230511.sql`). diff --git a/en/docs/auto-catalog/procedures/Sp_MaterialCheck_BtnEventMaterialCheckFail.md b/en/docs/auto-catalog/procedures/Sp_MaterialCheck_BtnEventMaterialCheckFail.md index f2ff345..13397b6 100644 --- a/en/docs/auto-catalog/procedures/Sp_MaterialCheck_BtnEventMaterialCheckFail.md +++ b/en/docs/auto-catalog/procedures/Sp_MaterialCheck_BtnEventMaterialCheckFail.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 — 主辅料稽查:稽查失败 (mark material-check fail). Per-row negative-disposition button: when stock cannot satisfy the line, the user clicks 稽查失败, optionally edits per-row fields (purchase ETA, supplier, memo) in the inline dialog, and this proc records the failure on each selected `mftworkordermaterials` row along with the captured fields. + +**What it does:** Parses `sProInParam`. Reads `$.changeValue` (the dialog's edited cells) into `p_changeValue`, expands `$[*].valueKey` (the comma-separated list of edited column names) into a dynamic `SET col=val, col=val ...` clause `p_updatefields`. Appends the `sMCMemo` textarea if present. Then for each selected `sId` issues `Update mftworkordermaterials` with `bPlanMaterialCheck=1, bPlanMaterialCheckResult=0` plus the dynamic field set. Empty payload returns the localised `paramsErro` message via `Sp_Sis_GetConst` and `sCode=-1`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 稽查失败 button on the 主辅料稽查 form names `Sp_MaterialCheck_BtnEventMaterialCheckFail` (`Sp__BtnEvent*` pattern). Companion to `Sp_MaterialCheck_BtnEventMaterialCheckPass` and the parent enumerator `Sp_MaterialCheck_BtnEventMaterialCheck`. Install script ships at `script/标版/30100101/schedule/Sp_MaterialCheck_BtnEventMaterialCheckFail.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_MaterialCheck_BtnEventMaterialCheckPass.md b/en/docs/auto-catalog/procedures/Sp_MaterialCheck_BtnEventMaterialCheckPass.md index 4c10793..840355f 100644 --- a/en/docs/auto-catalog/procedures/Sp_MaterialCheck_BtnEventMaterialCheckPass.md +++ b/en/docs/auto-catalog/procedures/Sp_MaterialCheck_BtnEventMaterialCheckPass.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 — 主辅料稽查:稽查通过 (mark material-check pass). Per-row positive-disposition button: after `Sp_MaterialCheck_BtnEventMaterialCheck` has computed which work-order materials match stock, the user clicks 稽查通过 on a row to record that material as confirmed-available. + +**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam`. For each `sId` runs `UPDATE mftworkordermaterials SET bPlanMaterialCheck=1, bPlanMaterialCheckResult=1 WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. Empty payload returns the localised `paramsErro` message from `Sp_Sis_GetConst` and `sCode=-1`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 稽查通过 toolbar/row-action button on the 主辅料稽查 form names `Sp_MaterialCheck_BtnEventMaterialCheckPass` (`Sp__BtnEvent*` pattern). Companion to `Sp_MaterialCheck_BtnEventMaterialCheckFail` and the parent enumerator `Sp_MaterialCheck_BtnEventMaterialCheck`. Install script ships at `script/标版/30100101/schedule/Sp_MaterialCheck_BtnEventMaterialCheckPass.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_MaterialHistoricalComparison.md b/en/docs/auto-catalog/procedures/Sp_MaterialHistoricalComparison.md index f1b250e..bd1ed99 100644 --- a/en/docs/auto-catalog/procedures/Sp_MaterialHistoricalComparison.md +++ b/en/docs/auto-catalog/procedures/Sp_MaterialHistoricalComparison.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 → 分析报表 → 主材历史数据对比报表 — month-over-month price/quantity comparison for non-paper materials. Pulls two month-buckets of audited production-material consumption (`viw_mitproductionmaterials` with `bCheck=1`, excluding `sMaterialsType='纸张'`), computes per-material average price and total qty/money for each side, and reports the price delta — used by procurement to surface materials whose unit cost has drifted between two months. + +**What it does:** Creates temp `MaterialHistorical` (one row per material × style per month) and `MaterialHistoricalComparison` (the comparison grid). `insert into MaterialHistorical` from `viw_mitproductionmaterials LEFT JOIN elematerials` keyed on `date_format(tCheckDate,'%Y-%m') IN (sStartDate, sEndDate)`. Two `update MaterialHistoricalComparison` passes splice each side's `dDosage / dMoney / dPrice` into `dBeforeDosage / dBeforeMoney / dBeforeAveragePrice` and `dEnd*`. Final update sets `dTotalPriceDifference = (dEndAveragePrice - dBeforeAveragePrice) * dBeforeDosage`. Returns the comparison grid as the result-set. Note: the proc takes `sBrId / sSuId` and defaults them to `'1111111111'` but never filters by tenant downstream — every tenant's data is mixed in the comparison. + +**Invocation:** Bound as the data-source of two report forms via `gdsconfigformmaster.sSqlStr`: 采购主材价格浮动表 (`gfm.sId 16147620210008611994372989400000`, under 物料采购流程 → 采购主材价格浮动表 module `101251240115016147537123820`) and 主材历史数据对比报表 (`gfm.sId 101251240115016204642443080`, under 采购管理 → 主材历史数据对比报表 module `101251240115016204642442770`). Install script ships at `script/标版/30100101/Sp_MaterialHistoricalComparison.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_MaterialsCarryforward.md b/en/docs/auto-catalog/procedures/Sp_MaterialsCarryforward.md index 19ebf3c..164ca6e 100644 --- a/en/docs/auto-catalog/procedures/Sp_MaterialsCarryforward.md +++ b/en/docs/auto-catalog/procedures/Sp_MaterialsCarryforward.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本管理 → 材料成本结转 — period-by-period reconciliation report contrasting business-side and finance-side material stock numbers for the supplied 会计期间 (`sCostPeriod`). Helps a cost accountant confirm that the carry-forward (`结转`) totals tie out before closing the period. + +**What it does:** Builds temporary table `TmpMaterialsCarryforward` keyed by `sPeriodId` (filtered against `sysaccountperiod`, frozen-period guard, lower-bound `>=202209`); for each period it derives 14 totals — 上期暂估总数量/金额, 本期抵消总数量/金额, 业务系统登记发票总数量/金额, 本期财务结转发票总数量/金额, 本期业务系统/财务结转材料总出库数量, 上/本期初末结存数量/金额 — by summing `viw_accmaterialsinit`, `accmaterialsstore` (filtered by 物料结转 `sFormId`s), `viw_purpurchasechecking`, `mitmaterialsstore`, and `elematerialsstockmonthcost`. Returns the whole tmp table ordered by `tStartDate`. + +**Invocation:** Called from inside `Sp_System_MaterialsCost` during the 全月加权 cost-allocation run; that parent proc is itself a 按钮事件 dispatched on the 成本结转 button. xly-src ships `script/标版/30100101/cost/Sp_MaterialsCarryforward.sql` (install). Read-only — no writes outside the temp table. diff --git a/en/docs/auto-catalog/procedures/Sp_MaterialsPurchaseStoreVirtual.md b/en/docs/auto-catalog/procedures/Sp_MaterialsPurchaseStoreVirtual.md index b337da8..47c054c 100644 --- a/en/docs/auto-catalog/procedures/Sp_MaterialsPurchaseStoreVirtual.md +++ b/en/docs/auto-catalog/procedures/Sp_MaterialsPurchaseStoreVirtual.md @@ -19,4 +19,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 → 采购订单 / 仓库管理 → 虚拟库存 — refreshes the on-order (虚拟入库) projection that `mitmaterialsstorevirtual` maintains for a purchase order. The virtual store tracks "已下单未入库" quantities so MRP/stock checks can reserve against the still-open purchase commitment. + +**What it does:** Takes a comma-delimited `sGuid` of `PurPurchaseOrderMaster.sId` values, materialises them into temp table `p_t_sId`, deletes the existing `mitmaterialsstorevirtual` rows for those bill ids (scoped by `sBrId`/`sSuId`), then re-inserts one row per `purpurchaseorderslave` where `bInStoreComplete=0`, carrying the outstanding `dAuxiliaryQty - dInStoreAuxiliaryQty` and `dMaterialsQty - dInStoreQty` from the slave plus master metadata (`sBillNo`, `sFormId`). Effectively a "delete + rebuild" for one purchase order. + +**Invocation:** Chained from `Sp_Calc_sPod` (采购订单 审核/反审核), `Sp_Calc_sPis` (采购入库 calc), `Sp_Bill_Force_Complete` (强制完结), and `Sp_Bill_Force_Complete_copy1`. xly-src ships `script/标版/30100101/Sp_MaterialsPurchaseStoreVirtual.sql` as the install script. No direct UI button — always invoked as a side-effect of upstream PO/入库 lifecycle events. diff --git a/en/docs/auto-catalog/procedures/Sp_MaterialsStoreVirtual.md b/en/docs/auto-catalog/procedures/Sp_MaterialsStoreVirtual.md index 04bc1c5..bc83804 100644 --- a/en/docs/auto-catalog/procedures/Sp_MaterialsStoreVirtual.md +++ b/en/docs/auto-catalog/procedures/Sp_MaterialsStoreVirtual.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 仓库管理 → 虚拟库存 — single-工单 rebuild of `MitMaterialsStoreVirtual`, the "实际库存 + 已下单/已计划" projection used by MRP and领料 checks. Called whenever a 工单 (`mftworkordermaster`) is audited or its consumption changes so the virtual stock view stays in sync. + +**What it does:** Materialises the comma-delimited `sGuid` list into temp table `p_t_sId`, looks up the work-order's `sMaterialsUnit` and 卷筒纸 (`CkxReelPaper`) switch from `SysSystemSettings`, deletes the existing `MitMaterialsStoreVirtual` rows for those bill ids, then re-inserts virtual-store rows by joining `mftworkorder*`, `elematerials`, and store views — emitting one row per (材料, 单据) carrying the projected on-hand qty after accounting for unfinished consumption. Branch/subsidiary scoped throughout. + +**Invocation:** Chained from a wide set of lifecycle hooks: `Sp_Calc_sMaterialsBgd`, `Sp_Calc_sPmd`, `Sp_Calc_sSmb`, `Sp_Calc_sWod`, `Sp_Bill_Force_Complete`, and `Sp_System_UpdateWorkCl`; also driven in bulk by `Sp_MaterialsStoreVirtual_refresh`. xly-src ships `script/标版/30100101/Sp_MaterialsStoreVirtual.sql` (install). No direct UI binding — purely side-effect. diff --git a/en/docs/auto-catalog/procedures/Sp_MaterialsStoreVirtual_refresh.md b/en/docs/auto-catalog/procedures/Sp_MaterialsStoreVirtual_refresh.md index 936a45d..0036e37 100644 --- a/en/docs/auto-catalog/procedures/Sp_MaterialsStoreVirtual_refresh.md +++ b/en/docs/auto-catalog/procedures/Sp_MaterialsStoreVirtual_refresh.md @@ -17,4 +17,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 仓库管理 → 虚拟库存 — 材料虚拟库存刷新, the batch utility that walks every active 工单 (`mftworkordermaster`) and rebuilds its virtual-stock projection. Used to repair the `mitmaterialsstorevirtual` table after upstream changes (calc errors, mass imports) so that planning views reflect what is really committed. + +**What it does:** Opens a cursor over `mftworkordermaster` rows where `bInvalid=0 AND bCheck=1`, then for each row calls `Sp_MaterialsStoreVirtual(sId, sBrandsId, sSubsidiaryId)` — the single-order rebuild proc. No filtering by branch or subsidiary at the cursor level (the sub-call handles tenant scoping). + +**Invocation:** Status: appears orphaned. No `gdsmodule`/`gdsconfigformmaster` row references it, no other procedure calls it, and the only xly-src hit is the install script `script/标版/材料库存/Sp_MaterialsStoreVirtual_refresh.sql`. Likely a manual maintenance utility — operators run it from a DB console or as a scheduled job not registered in the wiki's scope. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Materials_BtnEventCancelInvalid.md b/en/docs/auto-catalog/procedures/Sp_Materials_BtnEventCancelInvalid.md index f87b43e..ff4ec79 100644 --- a/en/docs/auto-catalog/procedures/Sp_Materials_BtnEventCancelInvalid.md +++ b/en/docs/auto-catalog/procedures/Sp_Materials_BtnEventCancelInvalid.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础数据 / 物料信息 — toolbar button-event "取消物料作废": un-invalidate one or more `elematerials` rows that had previously been marked obsolete. The complementary "作废物料" action sets `bInvalid=1`; this proc clears it so the material rejoins active master-data. + +**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam` (with the standard "请选择数据" guard via `Fun_Sis_GetConst('chooseData',...)` when empty). The selected `sId` may be a `-`-joined batch; the proc splits it on `-` and for each `sIdOne`: composes a "取消作废物料:" `syslog` audit row (`INSERT into syslog`) and `UPDATE elematerials` clearing `bInvalid` for that material in the current `sBrandsId / sSubsidiaryId` scope. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 取消作废 button on the 物料 grid names `Sp_Materials_BtnEventCancelInvalid` as the action (`Sp__BtnEvent*` pattern). No gdsmodule hook, no form-master binding, no xly-src install script — DB-only. diff --git a/en/docs/auto-catalog/procedures/Sp_Materials_BtnEventInvalid.md b/en/docs/auto-catalog/procedures/Sp_Materials_BtnEventInvalid.md index 6bbe3cc..30bd944 100644 --- a/en/docs/auto-catalog/procedures/Sp_Materials_BtnEventInvalid.md +++ b/en/docs/auto-catalog/procedures/Sp_Materials_BtnEventInvalid.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础资料 → 物料档案 — bulk-invalidate handler for the 物料档案 (`elematerials`) grid's 作废 toolbar button. Soft-deletes the selected material rows by flagging `bInvalid=1` while keeping the record for historical references. + +**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam`, splits the hyphen-joined id list one segment at a time, reads each material's `sMaterialsName` from `elematerials`, sets `bInvalid=1` on the row (scoped by `sBrandsId=sBrId` / `sSubsidiaryId=sSuId`), and writes one `syslog` audit row per material with `sLog=CONCAT('作废物料:', sMaterialsName)` tagging the operation. Short-circuits with the localised 请选择数据 message from `Fun_Sis_GetConst` when `sProInParam` is empty. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — wired to the 物料档案 grid's 作废 toolbar button via `gdsmodule.sBtnContent` carrying `{"sproName":"Sp_Materials_BtnEventInvalid",...}`. No `gdsmodule`/`gdsconfigformmaster` row references the name explicitly and no xly-src install script ships it — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Mes_EventReport.md b/en/docs/auto-catalog/procedures/Sp_Mes_EventReport.md index 56e48f6..57976c8 100644 --- a/en/docs/auto-catalog/procedures/Sp_Mes_EventReport.md +++ b/en/docs/auto-catalog/procedures/Sp_Mes_EventReport.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产执行 → 数据采集与设备控制 — mes-异常事件提报: for a given machine + team + shift, returns the production-report slave (`mftproductionreportslave`) rows belonging to the current shift window so the MES operator can pick which PLC events still need a manual 异常 (abnormal) explanation. + +**What it does:** Reads `sOffWork`, `sShiftsWork`, `sWorkType` from `elemachine` to find the machine's shift definition; locates the latest non-manual report end-date for the machine, falling back to the earliest `plc_machinedata.tStartDate` (TIMESTAMPDIFF>6 min) when no prior report exists; computes the current shift's `p_tStartDate`/`p_tEndDate` based on `sShift` (1=白班, 2=夜班) versus `NOW()`; finally calls `FUN_GET_DATE_BC_STARTDATE_NEWTYPE` to lock the shift start and `SELECT` the matching `mftproductionreportslave` rows. Read-only — no writes. + +**Invocation:** Status: appears orphaned. No `gdsmodule`/`gdsconfigformmaster` row references it, no other routine calls it, and no xly-src file mentions the name. The newer 异常事件提报 path likely goes through a different proc; this is a candidate for maintainer audit (and `Sp_Mes_EventReportOld` is the prior body kept as backup). diff --git a/en/docs/auto-catalog/procedures/Sp_Mes_EventReportOld.md b/en/docs/auto-catalog/procedures/Sp_Mes_EventReportOld.md index c2d8cc9..5faf4b0 100644 --- a/en/docs/auto-catalog/procedures/Sp_Mes_EventReportOld.md +++ b/en/docs/auto-catalog/procedures/Sp_Mes_EventReportOld.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Prior version of `Sp_Mes_EventReport` (same signature, same mes-异常事件提报 contract) kept under the `Old` suffix during the proc refresh. Per wiki convention, `*Old` objects are not narrated in depth — see `Sp_Mes_EventReport.md` for what the current body does. + +**What it does:** Same shape as the current `Sp_Mes_EventReport` at the time of copy: derives the current shift window from `elemachine`, finds the most recent `mftproductionreportslave.tEndDate` (or earliest `plc_machinedata.tStartDate`) and returns the matching slave rows for the operator to annotate. Read-only. + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, no form-master reference, no proc caller, no xly-src hit. Not expected to be called from production — kept as a rollback target. Verify before relying on it; the live path uses `Sp_Mes_EventReport` or its successor. diff --git a/en/docs/auto-catalog/procedures/Sp_MftPlanPhaseProduct_BtnEventConvertPlanA.md b/en/docs/auto-catalog/procedures/Sp_MftPlanPhaseProduct_BtnEventConvertPlanA.md index 845b75f..66054c1 100644 --- a/en/docs/auto-catalog/procedures/Sp_MftPlanPhaseProduct_BtnEventConvertPlanA.md +++ b/en/docs/auto-catalog/procedures/Sp_MftPlanPhaseProduct_BtnEventConvertPlanA.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 备用生产计划跟进(成品) — toolbar action that moves a selected work-order line from the "备用" (alternate / standby) pool back into the regular production plan. The 备用 mechanism lets planners park lower-priority work-order lines outside the active 跟进 view; this proc undoes that parking on the 成品 (finished-product) side. Procedure comment says 产品 but it targets the 成品 跟进 grid. + +**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam`. For each id, `UPDATE mftworkorderslave SET bPlanB = 0 WHERE sId = p_sId AND sBrandsId = sBrId AND sSubsidiaryId = sSuId` and `UPDATE CalcProductsPhase SET bPlanB = 0 WHERE sId = p_sId`. Setting `bPlanB = 0` reclassifies the row from 备用 to 常规. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 转入常规计划 button on the 备用生产计划跟进(成品) grid (`gdsmodule.sId 16476791850003258044449836560000`) names `Sp_MftPlanPhaseProduct_BtnEventConvertPlanA` as the action. Inverse: `Sp_MftPlanPhaseProduct_BtnEventConvertPlanB`. xly-src ships `script/标版/30100101/schedule/Sp_MftPlanPhaseProduct_BtnEventConvertPlanA.sql` (install script). diff --git a/en/docs/auto-catalog/procedures/Sp_MftPlanPhaseProduct_BtnEventConvertPlanB.md b/en/docs/auto-catalog/procedures/Sp_MftPlanPhaseProduct_BtnEventConvertPlanB.md index d9c542d..5ce152d 100644 --- a/en/docs/auto-catalog/procedures/Sp_MftPlanPhaseProduct_BtnEventConvertPlanB.md +++ b/en/docs/auto-catalog/procedures/Sp_MftPlanPhaseProduct_BtnEventConvertPlanB.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生产计划跟进 → 备用计划 — toolbar action that pushes a selected work-order line out of the regular 跟进 plan and into the 备用 (alternate / standby) pool. Used when a planner wants to deprioritise a line without invalidating it. Inverse of `Sp_MftPlanPhaseProduct_BtnEventConvertPlanA`. + +**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam`. For each id, `UPDATE mftworkorderslave SET bPlanB = 1 WHERE sId = p_sId AND sBrandsId = sBrId AND sSubsidiaryId = sSuId` and `UPDATE CalcProductsPhase SET bPlanB = 1 WHERE sId = p_sId`. Setting `bPlanB = 1` reclassifies the row from 常规 to 备用 — it disappears from the active 跟进 view and surfaces in 备用生产计划跟进. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 转入备用计划 button on the 常用生产计划跟进 grid names `Sp_MftPlanPhaseProduct_BtnEventConvertPlanB` as the action. xly-src ships `script/标版/30100101/schedule/Sp_MftPlanPhaseProduct_BtnEventConvertPlanB.sql` (install script). diff --git a/en/docs/auto-catalog/procedures/Sp_MftPlanPhaseProduct_BtnEventSave.md b/en/docs/auto-catalog/procedures/Sp_MftPlanPhaseProduct_BtnEventSave.md index 0934f91..87f0204 100644 --- a/en/docs/auto-catalog/procedures/Sp_MftPlanPhaseProduct_BtnEventSave.md +++ b/en/docs/auto-catalog/procedures/Sp_MftPlanPhaseProduct_BtnEventSave.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生产计划跟进(成品) — twin of `Sp_MftPlanPhase_BtnEventSave` for the 成品 (finished-product) 跟进 grid. Commits the planner-memo / planner-set-date grid-cell edits back to both `mftworkorderslave` (work-order parts) and `CalcProductsPhase` (the computed phase-plan staging table). + +**What it does:** Parses `$.params[*].value[*]` from `sProInParam`, pulling `sId`, `sWorkSlaveId`, `sPlannerMemo`, `tPlannerSet`. When `tPlannerSet` arrives as `mm-dd` (length < 10) the proc prefixes the current year. For each row it `UPDATE mftworkorderslave SET sPlannerMemo, tPlannerSet WHERE sId = p_sWorkSlaveId` and `UPDATE CalcProductsPhase SET sPlannerMemo, tPlannerSet WHERE sId = p_sId`. Note the asymmetric key: `sWorkSlaveId` targets the work-order, `sId` targets the calc row. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 保存所选数据 button on the 生产计划跟进(成品) grid names `Sp_MftPlanPhaseProduct_BtnEventSave` as the action. xly-src ships `script/标版/30100101/schedule/Sp_MftPlanPhaseProduct_BtnEventSave.sql` (install script). Twin: `Sp_MftPlanPhase_BtnEventSave` for the 部件 grid. diff --git a/en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventConvertPlanA.md b/en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventConvertPlanA.md index b5c5686..125bfa2 100644 --- a/en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventConvertPlanA.md +++ b/en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventConvertPlanA.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划 → 备用生产计划跟进(部件) — "转入常规计划" button: flips the selected backup-plan rows back to the regular (常规) plan track by clearing the `bPlanB` flag on `mftworkordercontrol` and the denormalised `CalcProductContralsPhase`. Inverse of `Sp_MftPlanPhase_BtnEventConvertPlanB`. + +**What it does:** Validates `sProInParam` length, parses `$.params[*].value[*].sId`, and for each id sets `bPlanB=0` on both `mftworkordercontrol` and `CalcProductContralsPhase` (scoped by `sBrandsId=sBrId` / `sSubsidiaryId=sSuId`). Returns the standard `sReturn`/`sCode` pair (`paramsErro` short-circuit when input is empty). + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` on the 备用生产计划跟进(部件) grid's 转入常规计划 toolbar button. xly-src ships `script/标版/30100101/schedule/Sp_MftPlanPhase_BtnEventConvertPlanA.sql` (install). No `gdsmodule.sProcName` / `gdsconfigformmaster.sSqlStr` reference — the binding lives in the grid's `sBtnContent` JSON. diff --git a/en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventConvertPlanB.md b/en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventConvertPlanB.md index 702dfa2..623db76 100644 --- a/en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventConvertPlanB.md +++ b/en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventConvertPlanB.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划 → 常用生产计划跟进(部件) — "转入备用计划" button: moves the selected regular-plan rows onto the backup (备用) track by setting `bPlanB=1` on `mftworkordercontrol` and the denormalised `CalcProductContralsPhase`. Mirror of `Sp_MftPlanPhase_BtnEventConvertPlanA`. + +**What it does:** Validates `sProInParam` length, parses `$.params[*].value[*].sId`, and for each id sets `bPlanB=1` on both `mftworkordercontrol` and `CalcProductContralsPhase` (scoped by `sBrandsId=sBrId` / `sSubsidiaryId=sSuId`). Standard `sReturn`/`sCode` contract with `paramsErro` short-circuit. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` on the 常用生产计划跟进(部件) grid's 转入备用计划 toolbar button. xly-src ships `script/标版/30100101/schedule/Sp_MftPlanPhase_BtnEventConvertPlanB.sql` (install). No `gdsmodule`/`gdsconfigformmaster` registration — the wiring lives in `sBtnContent`. diff --git a/en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventLockAll.md b/en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventLockAll.md index 8a49678..7c22ab1 100644 --- a/en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventLockAll.md +++ b/en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventLockAll.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划跟进 — "锁定全部" button: freezes every unlocked production-plan slave row across all machines so the planner can subsequently compare the locked baseline against actual execution. + +**What it does:** Single mass `UPDATE mftproductionplanslave SET bLock=1, tlock=tStartDate, sLock=p_sMakePerson WHERE bLock=0 AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. No input parsing — `sProInParam` is ignored. Standard `sReturn`/`sCode` out parameters but the body never sets them on success, leaving them as their default `sCode=1`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` on the 生产计划跟进 grid's 锁定全部 toolbar button. The Java `SqlServiceImpl.getSqlTemple()` source file carries a literal comment `{"sproName":"Sp_MftPlanPhase_BtnEventLockAll","inMap":"slave.sId"}` documenting the `sBtnContent` JSON shape — actual wiring lives in `gdsmodule.sBtnContent`. xly-src ships `script/标版/30100101/schedule/Sp_MftPlanPhase_BtnEventLockAll.sql` (install). diff --git a/en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventLockRow.md b/en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventLockRow.md index 925e5b5..bbe8513 100644 --- a/en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventLockRow.md +++ b/en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventLockRow.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划跟进 — "锁定本行" / dynamic per-阶段 lock button: locks (or relocks at a new date) the specific 工序阶段 cells the user just edited. Sibling of `Sp_MftPlanPhase_BtnEventLockAll` but row-scoped and with per-phase dates parsed from the grid's dynamic columns. + +**What it does:** Validates `sProInParam`, walks `$.params[*].value[*]` rows where each value carries dynamic keys like `s_印刷阶段-锁定_23` → `3.17`. Stages the parsed `(sId, sValue)` pairs into temp table `p_TempDel`, then opens a cursor over `eleprocessphase` (`sName` ordered by `iOrder`) — for each phase name found inside the row's value string, extracts the date string after `:`, formats it as `YYYY-MM-DD`, and `UPDATE`s `mftproductionplanslave` joined to `eleprocess` (`e.sProcessPhase = p_sName`) setting `bLock=1`, `tLock=p_s1`, `sLock=sMakePerson`. So one row + one phase ⇒ one slave update per matching machine. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` on the 生产计划跟进 grid. The header comment shows the `sBtnContent` JSON: `{"sproName":"Sp_MftPlanPhase_BtnEventLockRow","inMap":"slave.sId,slave.s_蓝纸确认-锁定_20,slave.s_印刷阶段-锁定_23"}` — the `inMap` lists which dynamic columns to ship in `sProInParam`. xly-src ships `script/标版/30100101/schedule/Sp_MftPlanPhase_BtnEventLockRow.sql` (install). diff --git a/en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventSave.md b/en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventSave.md index c007440..6c81e58 100644 --- a/en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventSave.md +++ b/en/docs/auto-catalog/procedures/Sp_MftPlanPhase_BtnEventSave.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划管理 → 生产计划跟进(部件) — toolbar save for the planner-memo / planner-set-date fields on `mftworkordercontrol` rows. Planners use the 跟进 grid to annotate which work-order parts they have scheduled; this proc commits those grid-cell edits back to the source row in one click. + +**What it does:** Parses `$.params[*].value[*]` from `sProInParam`, pulling `sId`, `sPlannerMemo`, `tPlannerSet` for each selected part. When `tPlannerSet` arrives in `mm-dd` short form (length < 10) the proc prefixes the current year. For each id it `UPDATE mftworkordercontrol SET sPlannerMemo = ..., tPlannerSet = ... WHERE sId = p_sId AND sBrandsId = sBrId AND sSubsidiaryId = sSuId`. No status flag toggled — pure memo-write. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 保存所选数据 button on the 生产计划跟进(部件) grid names `Sp_MftPlanPhase_BtnEventSave` as the action. xly-src ships `script/标版/30100101/schedule/Sp_MftPlanPhase_BtnEventSave.sql` (install script). Twin: `Sp_MftPlanPhaseProduct_BtnEventSave` for the 成品 grid. diff --git a/en/docs/auto-catalog/procedures/Sp_MftPlan_MachineProcessLodading.md b/en/docs/auto-catalog/procedures/Sp_MftPlan_MachineProcessLodading.md index 34c3882..92b8ac2 100644 --- a/en/docs/auto-catalog/procedures/Sp_MftPlan_MachineProcessLodading.md +++ b/en/docs/auto-catalog/procedures/Sp_MftPlan_MachineProcessLodading.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产运营报表 → 整厂实际负荷分析 — paged 工序LOADing report. For a 设备属性 (`sAttribute`), returns one row per machine grouping with daily/weekly load columns spanning the previous week through the end of "now + 2 months", so a planner can see where每 process step is over-/under-loaded across the planning horizon. + +**What it does:** Computes `tStartDate` = the Monday of the previous week and `tEndDate` = last day of the month two months out. Builds temp table `Sp_MftPlan_MachineProcessLodading` (sId, sAttribute, sMachineQty, dBzcn=平均产能/小时/台, dZcn=总产能, plus a wide row to be filled in). Loops `p_iDayHanle` through every day in the window, dynamically `ALTER`s the temp table to add per-day load columns and `UPDATE`s them from `mftproductionplan*` joined to `elemachine`/`eleprocess`. Accumulates `sColumnNameConfig` (via the standard `Fun_get_show_config_*` helper) so the grid renders the date columns. Returns the temp table plus the JSON column-config. + +**Invocation:** Bound as the data-source of the 整厂实际负荷分析 form (`sParentId 1921168137117916509801164270`) via `gdsconfigformmaster.sSqlStr` — under 生产运营报表 inside 生产管理. xly-src ships `script/标版/30100101/schedule/Sp_MftPlan_MachineProcessLodading.sql` (install). No customer overrides found. diff --git a/en/docs/auto-catalog/procedures/Sp_MobileAdjust_BtnEventFinished.md b/en/docs/auto-catalog/procedures/Sp_MobileAdjust_BtnEventFinished.md index 4820b9a..61ef595 100644 --- a/en/docs/auto-catalog/procedures/Sp_MobileAdjust_BtnEventFinished.md +++ b/en/docs/auto-catalog/procedures/Sp_MobileAdjust_BtnEventFinished.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划 → 调机完成 (mobile) — machine-side "调机完成" (machine-setup finished) action on the mobile app. After the operator presses 开工 (`Sp_MobileStart_BtnEventFinished`) and runs setup, this button marks the setup phase as done on the matching `mftproductionplanslave` row, capturing how long setup took. + +**What it does:** Parses `$.params[*].value[*].sSlaveId` from `sProInParam`. For each plan-slave id, `UPDATE mftproductionplanslave SET tAdjustMachineDate = SYSDATE(), bAdjustMachineComplete = 1, dAdjustHour = TIMESTAMPDIFF(MINUTE, tStartDate, NOW()) WHERE sId = p_sId AND sBrandsId = sBrId AND sSubsidiaryId = sSuId`. `dAdjustHour` is wall-clock minutes between 开工 (`tStartDate`) and now — the setup-duration KPI. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 调机完成 button on the mobile app's machine task list names `Sp_MobileAdjust_BtnEventFinished` as the action. xly-src ships `script/标版/30100101/Sp_MobileAdjust_BtnEventFinished.sql` (install script). Predecessor: `Sp_MobileStart_BtnEventFinished` (开工). diff --git a/en/docs/auto-catalog/procedures/Sp_MobileStart_BtnEventFinished.md b/en/docs/auto-catalog/procedures/Sp_MobileStart_BtnEventFinished.md index 3a73863..f926751 100644 --- a/en/docs/auto-catalog/procedures/Sp_MobileStart_BtnEventFinished.md +++ b/en/docs/auto-catalog/procedures/Sp_MobileStart_BtnEventFinished.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划 → 开工 (mobile) — machine-side "开工" (start-work) action on the mobile app. The operator at a machine starts the job by tapping a plan-slave row. The proc enforces single-job-per-machine: a machine can only have one started-but-not-reported job at a time. + +**What it does:** Parses `$.params[*].value[*].sSlaveId` from `sProInParam`. For each plan-slave id, reads `sMachineId` from `mftproductionplanslave`; counts other rows on that machine where `bStartComplete=1 AND bProductionReportComplete=0 AND dProductionReportQty<=0`. If any exist, returns the localised `sMobileStartWorkStart` ("已开工,请勿重复开工") via `Fun_Sis_GetConst` — without aborting (it just sets `sReturn`, the loop still iterates). Otherwise `UPDATE mftproductionplanslave SET bStartComplete = 1, tStartDate = NOW() WHERE sId = p_sId AND sBrandsId = sBrId AND sSubsidiaryId = sSuId`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 开工 button on the mobile app's machine task list names `Sp_MobileStart_BtnEventFinished` as the action. xly-src ships `script/标版/30100101/Sp_MobileStart_BtnEventFinished.sql` (install script). Successor: `Sp_MobileAdjust_BtnEventFinished` (调机完成), which uses the `tStartDate` written here to compute setup duration. diff --git a/en/docs/auto-catalog/procedures/Sp_Mobile_PatrolInspection.md b/en/docs/auto-catalog/procedures/Sp_Mobile_PatrolInspection.md index 0e28a76..c5c2c58 100644 --- a/en/docs/auto-catalog/procedures/Sp_Mobile_PatrolInspection.md +++ b/en/docs/auto-catalog/procedures/Sp_Mobile_PatrolInspection.md @@ -1,7 +1,7 @@ # `Sp_Mobile_PatrolInspection` (procedure) -> @author:zhucx - @date:20211108 封存 +> @author:zhucx + @date:20211108 封存 @describe: 移动端 品质巡检 @@ -36,4 +36,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 过程质量控制(PQC) → 首检巡检 — paged mobile patrol-inspection task list bound to the 品检任务 form. After 首检 (first-piece inspection) is signed off, machines must be revisited at the test-standard's `dQualifyRate` interval (minutes). This proc lists machines that are due, overdue, or coming up for the next patrol. Header comment says 封存 (archived) dated 20211108 — superseded by newer mobile-PQC procs but still bound. + +**What it does:** Reads `SysSystemSettings.CkxProcessFilter`; if 1 and the user isn't sysadmin, restricts by `Fun_GetLookProcess`. Builds a dynamic INSERT into temporary `p_Tmp_ProductionReport` selecting from `mftProductionPlanSlave A WHERE A.bFirst1Inspection=1 AND A.bFirst2Inspection=1 AND A.bFirst3Inspection=1 AND A.dProcessQty - A.dProductionReportQty > 0` (only lines that finished 首检 and still have remaining quantity). Computes `tFirstInspectionTime` = max of the three 首检 timestamps. Denormalises process names from `eleprocess`. Joins `EleTestStandard` (form `12012615914116371204913630`) by `sProcessId` to pull `sTestName`, `sTestStandardId`, `dQualifyRate`; derives `tThisPatrolInspection = max(tFirstInspectionTime, tPatrolInspection) + dQualifyRate minutes`. Final paged SELECT computes `sFirstInspectionTime` as `HH:mm` and `sPatrolInspection` text like `超期N分 未巡检` / `N分内执行巡检`. + +**Invocation:** Bound as the data-source of the 品检任务 form `gfm.sId 12012615914116373917917930` via `gdsconfigformmaster.sSqlStr` — under module 首检巡检 (`sId 12012615914116373917917620`) → 功能操作 (subtree of mobile-app procedures). xly-src ships `script/标版/30100101/Sp_Mobile_PatrolInspection.sql` (install script) and `script/标版/20210323/optimizeprocedure.sql` (optimize patch). Sibling: `Sp_Mobile_Inspection`. diff --git a/en/docs/auto-catalog/procedures/Sp_MonthlyStatisticalReport.md b/en/docs/auto-catalog/procedures/Sp_MonthlyStatisticalReport.md index b53f33d..404c39e 100644 --- a/en/docs/auto-catalog/procedures/Sp_MonthlyStatisticalReport.md +++ b/en/docs/auto-catalog/procedures/Sp_MonthlyStatisticalReport.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 计件工资 — month-end roll-up button that condenses `mftDaySumReport` (daily piecework totals per employee) into one row per employee per month in `mftMonthSumReport`. Operators run this after closing all the daily-sum entries for a 凭证月 (accounting month). Companion to `Sp_MonthlyStatisticalSalary`, which then applies the salary-plan formulas to those monthly rows. + +**What it does:** Extracts `tYearMonth` from `$.changeValue[0].tYearMonth` in `sProInParam`; if missing, returns `sCode=-1` with the localised `sMonthlyStatisticalReportNotChooseMonth` ("未选择凭证月,请选择后操作") from `Fun_Sis_GetConstNew`. `DELETE FROM mftMonthSumReport WHERE sBrandsId=sBrId AND sSubsidiaryId=sSuId AND DATE_FORMAT(tVestingDate,'%Y-%m')=DATE_FORMAT(tYearMonth,'%Y-%m')` to discard the previous run. Then `INSERT INTO mftMonthSumReport SELECT newId(), … SUM(dProcessQty), SUM(dHour), SUM(dQualifiedProductionQty), …, SUM(dAllMoney), NOW(), tVestingDate, sEmployeeId FROM mftDaySumReport WHERE … GROUP BY YYYYMM, sEmployeeId`. Finally back-writes `mftDaySumReport.sMonthSumReportId = B.sId` joining on `(YYYYMM, sEmployeeId, sBrandsId, sSubsidiaryId)` so each day row knows which monthly summary it belongs to. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — a 月度汇总 button on a payroll-style form names `Sp_MonthlyStatisticalReport` as the action. xly-src ships `script/标版/30100101/Sp_MonthlyStatisticalReport.sql` (install script). Successor: `Sp_MonthlyStatisticalSalary` (apply salary plan). diff --git a/en/docs/auto-catalog/procedures/Sp_MonthlyStatisticalSalary.md b/en/docs/auto-catalog/procedures/Sp_MonthlyStatisticalSalary.md index 68194d4..9fc8633 100644 --- a/en/docs/auto-catalog/procedures/Sp_MonthlyStatisticalSalary.md +++ b/en/docs/auto-catalog/procedures/Sp_MonthlyStatisticalSalary.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 计件工资 — month-end salary calculator that walks each row of `mftMonthSumReport` (already populated by `Sp_MonthlyStatisticalReport`) and applies every monthly salary-structure plan in `sissalarystructureplan`. Each plan provides a 公式 (formula) that produces one wage component; the proc writes each component into a numbered column `dWageMoney1, dWageMoney2, …` so the form can display per-component pay. + +**What it does:** Extracts `tYearMonth` from `$.changeValue[0].tYearMonth`; missing returns `sCode=-1` with `sMonthlyStatisticalReportNotChooseMonth`. Opens cursor `curPlan` over `sissalarystructureplan WHERE sCycle='2'` (monthly-cycle plans) ordered by `iOrder`. For each plan row reads `sId, sSalaryItem, sFormulaId, sCycle, sTeamType, iOrder`. Then inner cursor over `mftMonthSumReport WHERE …YYYYMM = tYearMonth`. For each employee row builds `p_sTmpId = sId,sEmployeeId`, `p_sAllTbName = 'mftMonthSumReport,eleemployee'`, `p_sAllType = 'billSlave,billemployee'`, then `CALL Sp_System_ReplaceField(...)` to evaluate the plan's formula against those tables — yielding `p_dAwardMoney`. Dynamically `UPDATE mftMonthSumReport A SET A.dWageMoney{iOrder} = IFNULL(p_dAwardMoney,0) WHERE A.sId = ''`. Formula failure (`sCode < 0`) aborts the whole batch and bubbles up `@sDetail` via `Sp_System_ReplaceField`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 月度工资计算 button on a payroll form names `Sp_MonthlyStatisticalSalary` as the action. xly-src ships `script/标版/30100101/Sp_MonthlyStatisticalSalary.sql` (install script). Predecessor: `Sp_MonthlyStatisticalReport`. Daily-cycle equivalent operates on `sCycle='1'` plans via a separate proc. diff --git a/en/docs/auto-catalog/procedures/Sp_Monthlysalecustomer.md b/en/docs/auto-catalog/procedures/Sp_Monthlysalecustomer.md index 8db3129..128aa2f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Monthlysalecustomer.md +++ b/en/docs/auto-catalog/procedures/Sp_Monthlysalecustomer.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售分析(按月累计) — paged annual-sales pivot keyed by customer with one column per calendar month. Twin of `Sp_Monthlysalesman` but groups by `sCustomerId`; returns one row per 客户 with `dTotalMoney` plus `dJan..dDece` for the year inferred from `tStartDate`. + +**What it does:** Sets the year filter to `YEAR(tStartDate)`. Builds a dynamic SQL `SELECT sId, sSlaveId, sCustomerId, sSalesManId, SUM(dProductMoney) AS dTotalMoney, SUM(CASE WHEN MONTH(tCreateDate)=N THEN dProductMoney ELSE 0 END) AS d{Mon} for N=1..12 FROM viw_salsalesorder AS T WHERE sFormId IN (the seven 销售订单 sFormIds) AND bInvalid=0 AND YEAR(tCreateDate) = GROUP BY sCustomerId`. Hands the dynamic SQL to `Sp_Outstanding_Query` for paging, total-count, and `bFilter` condition splicing. + +**Invocation:** Bound as the data-source of the 销售分析(按月累计) form `gfm.sId 19211681219916400715457930` via `gdsconfigformmaster.sSqlStr` — under module 销售分析(按月累计) (`sId 19211681219916400715457370`) → 销售分析(客户角度) → 销售管理. Loaded when the user opens the report. diff --git a/en/docs/auto-catalog/procedures/Sp_Monthlysalesman.md b/en/docs/auto-catalog/procedures/Sp_Monthlysalesman.md index 425a855..db57c49 100644 --- a/en/docs/auto-catalog/procedures/Sp_Monthlysalesman.md +++ b/en/docs/auto-catalog/procedures/Sp_Monthlysalesman.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售分析(人员角度) → 销售人员月销售额统计 — paged annual-sales pivot keyed by sales rep with one column per calendar month. Twin of `Sp_Monthlysalecustomer` but groups by `sSalesManId`; returns one row per 销售员 with `dTotalMoney` plus `dJan..dDece` for the year inferred from `tStartDate`. + +**What it does:** Sets the year filter to `YEAR(tStartDate)`. Builds a dynamic SQL `SELECT sId, sSlaveId, sSalesManId, SUM(dProductMoney) AS dTotalMoney, SUM(CASE WHEN MONTH(tCreateDate)=N THEN dProductMoney ELSE 0 END) AS d{Mon} for N=1..12 FROM viw_salsalesorder AS T WHERE sFormId IN (the seven 销售订单 sFormIds) AND bInvalid=0 AND YEAR(tCreateDate) = GROUP BY sSalesManId`. Hands the dynamic SQL to `Sp_Outstanding_Query` for paging, total-count, and `bFilter` condition splicing. + +**Invocation:** Bound as the data-source of the 销售人员月销售额统计 form `gfm.sId 101801153119616634989456840` via `gdsconfigformmaster.sSqlStr` — under module 销售人员月销售额统计 (`sId 101801153119616634989456610`) → 销售分析(人员角度) → 销售管理. Loaded when the user opens the report. Daily-bucket twin: `Sp_DaysaleSalesMan` (per-day instead of per-month). diff --git a/en/docs/auto-catalog/procedures/Sp_Msg_SendMsg.md b/en/docs/auto-catalog/procedures/Sp_Msg_SendMsg.md index 739264d..4dc508b 100644 --- a/en/docs/auto-catalog/procedures/Sp_Msg_SendMsg.md +++ b/en/docs/auto-catalog/procedures/Sp_Msg_SendMsg.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 消息管理 → 发送消息 — toolbar 发送 (send) handler on the 发送消息 form. Composes a message defined in `sys_msg_send` (subject, body, attachments, recipients) and fans it out to PC in-app inbox, WeChat, and/or email channels per the message's flags. Drives the platform's manual-broadcast flow; workflow-generated messages take other paths. + +**What it does:** Parses `$.params[*].value[*].sId` (the `sys_msg_send` row ids). For each id loads `bSendEmail, bSendWechat, bSendDingTaik, bSendPhone, sTitle, sAbstract, sTemplateFullMemo, sBillNo` into locals. Aggregates recipient lists from `viw_msguser JOIN sys_msg_send_receiveuser` (where `sParentId = p_sId`) into `p_sWxUserName` (JSON array of WeChat ids), `p_sEmail` (JSON array), and `p_iCountUser`; missing recipients return `sCode=-1` with "请先选择接收人". Pulls attachments from `sys_msg_send_file` into a JSON array `p_sFilesAdressees`. If `bSendWechat=1` inserts a row into `syssendewxmsg` (the queue scraped by the WeChat sender worker). If `bSendEmail=1` inserts into `syssendemail` (the email queue). Always inserts one PC-inbox row per recipient into `sys_msg` joining `viw_msguser` to `sys_msg_send_receiveuser`. Finally `UPDATE sys_msg_send SET bSend = 1 WHERE sId = p_sId`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 发送 button on the 发送消息单据 form (`gdsmodule.sId 101801153119616753489024570`, parent 消息管理) names `Sp_Msg_SendMsg` as the action. xly-src ships `script/标版/upgrade/更新WAR脚本/20230210_消息、工作流、定时 模块/消息、工作流、定时 模块_20230210.sql` (install patch). diff --git a/en/docs/auto-catalog/procedures/Sp_NotPayAbles.md b/en/docs/auto-catalog/procedures/Sp_NotPayAbles.md index 8bdfe39..0803aff 100644 --- a/en/docs/auto-catalog/procedures/Sp_NotPayAbles.md +++ b/en/docs/auto-catalog/procedures/Sp_NotPayAbles.md @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** KPI流程操作菜单 → 财务收付款 → 1/1 对账( 采购&外协)->付款 — paged supplier-payables warning list. Aggregates everything the company still owes a supplier per `saldelivergoods`-side bill (procurement, sub-contract, expense, advance, financial-adjust, receipt) into one window so AP can prioritise payments. + +**What it does:** Reads `SysAccountPeriod.tAPDate` for the cutoff, then `Sp_Sis_GetConst` to load language-specific labels for `PayInit/Advance/FinancialAdjust/Receipt`. Builds `p_tmp_PayablesWarning` (supplier, materials, money, currency, invoice, purchase-man, due-date, reserves), assembles a UNION across each AP source view filtered by `sBrId/sSuId` and `tCreateDate >= tAPDate`, then hands the resulting SQL to `Sp_Outstanding_Query` for paging, `bFilter` splicing, `countCloumn` totals, and `sGroupby_*` rollups. + +**Invocation:** Bound as the data-source of form `gfm.sId=192116810113315318265589290` (1/1 对账( 采购&外协)->付款) via `gdsconfigformmaster.sSqlStr` — loaded when the user opens the supplier-payables console. Install script at `script/标版/30100101/Sp_NotPayables.sql` (note the case-mismatch — DB stores `Sp_NotPayAbles` while the file uses `Sp_NotPayables`). diff --git a/en/docs/auto-catalog/procedures/Sp_NotPayAbles_HZ.md b/en/docs/auto-catalog/procedures/Sp_NotPayAbles_HZ.md index bd08c9a..393c542 100644 --- a/en/docs/auto-catalog/procedures/Sp_NotPayAbles_HZ.md +++ b/en/docs/auto-catalog/procedures/Sp_NotPayAbles_HZ.md @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Summary (汇总) variant of `Sp_NotPayAbles` — same supplier-payables intent under 1/1 对账( 采购&外协)->付款, but rolls each supplier's many bills into a single per-supplier row (汇总) rather than per-bill detail. Intended for an AP overview report. + +**What it does:** Same `SysAccountPeriod.tAPDate` cutoff, `Sp_Sis_GetConst` lookups, and `p_tmp_PayablesWarning` shape as `Sp_NotPayAbles`. Diverges in the final SQL — collapses the per-bill UNION result by `sSupplyId` so `dMaterialsMoney/dPayMoney/dNoPayMoney` are summed per supplier before paging through `Sp_Outstanding_Query`. + +**Invocation:** Status: appears orphaned. No `gdsconfigformmaster` binding, no `gdsmodule` hook, no other-routine call, no xly-src caller — the per-bill `Sp_NotPayAbles` is the procedure actually wired to the deployed form. Candidate for maintainer audit; if the 汇总 view is needed, the form needs updating to call this proc. diff --git a/en/docs/auto-catalog/procedures/Sp_NotPayAbles_HZ_new.md b/en/docs/auto-catalog/procedures/Sp_NotPayAbles_HZ_new.md index 19b45ba..2c6e656 100644 --- a/en/docs/auto-catalog/procedures/Sp_NotPayAbles_HZ_new.md +++ b/en/docs/auto-catalog/procedures/Sp_NotPayAbles_HZ_new.md @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Newer (`_new`) rewrite of `Sp_NotPayAbles_HZ` — supplier-payables summary (汇总) under 1/1 对账( 采购&外协)->付款. Same per-supplier rollup intent, refactored to assemble its data via a single explicit `p_sInsertSql/p_sSelectSql/p_sFromSql/p_sWhereSql` builder instead of the older inline UNION. + +**What it does:** Same `SysAccountPeriod.tAPDate` cutoff and `Sp_Sis_GetConst` constant lookup as the rest of the family. Builds `p_tmp_PayablesWarning` then materialises a single dynamic `INSERT … SELECT … FROM … WHERE …` query that joins purchase/expense/advance/financial-adjust/receipt sources together, groups by `sSupplyId`, and pages through `Sp_Outstanding_Query`. + +**Invocation:** Status: appears orphaned. Not bound to any `gdsconfigformmaster`, no `gdsmodule` hook, no other procedure or function calls it, and no xly-src caller (Java, MyBatis, install script) — looks like a pending replacement for `Sp_NotPayAbles_HZ` that was never wired up. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_NotPayAbles_expen.md b/en/docs/auto-catalog/procedures/Sp_NotPayAbles_expen.md index ad9f98e..915aa23 100644 --- a/en/docs/auto-catalog/procedures/Sp_NotPayAbles_expen.md +++ b/en/docs/auto-catalog/procedures/Sp_NotPayAbles_expen.md @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Variant of `Sp_NotPayAbles` (1/1 对账( 采购&外协)->付款 — supplier-payables warning) — the smaller-scope "expense" variant: same parameter list and same `p_tmp_PayablesWarning` shape, but its UNION drops the procurement/material-receipt sources and feeds the temp table only from the expense (费用) payables track. Likely an internal split kept for an "费用付款" branch that never made it to a deployed form. + +**What it does:** Same overall mechanism as `Sp_NotPayAbles` — `SysAccountPeriod.tAPDate` cutoff, `Sp_Sis_GetConst` for `PayInit/Advance/FinancialAdjust/Receipt` labels, `p_tmp_PayablesWarning` build, then hand-off to `Sp_Outstanding_Query` for paging/filter/total — minus the procurement leg. + +**Invocation:** Status: appears orphaned. No `gdsconfigformmaster` binding, no `gdsmodule` hook, no other proc/function references the name, no xly-src caller (Java, MyBatis, install script) — candidate for maintainer audit; the deployed form uses `Sp_NotPayAbles` instead. diff --git a/en/docs/auto-catalog/procedures/Sp_NotPayAbles_list.md b/en/docs/auto-catalog/procedures/Sp_NotPayAbles_list.md index 78ded7c..393a889 100644 --- a/en/docs/auto-catalog/procedures/Sp_NotPayAbles_list.md +++ b/en/docs/auto-catalog/procedures/Sp_NotPayAbles_list.md @@ -19,4 +19,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Companion to `Sp_NotPayAbles` (1/1 对账( 采购&外协)->付款) — takes a comma-separated list of supplier-payable bill ids (`sId`) and returns the per-bill detail rows. Intended to back the "drill-down/print/选择" sub-panel where the user opens the supplier-payables console, ticks specific bills, and asks for their full breakdown. + +**What it does:** Splits the inbound CSV `sId` into a `p_t_sId` temp table (`sBillIdCr` indexed), then builds the same `p_tmp_PayablesWarning` shape as `Sp_NotPayAbles` but filters every source-leg join through `p_t_sId.sBillIdCr` to keep only the bills the caller picked. Returns the detail set directly (no `Sp_Outstanding_Query` paging — small selection). + +**Invocation:** Status: appears orphaned. No `gdsconfigformmaster` binding, no `gdsmodule` hook, no other proc/function references it, and no xly-src caller — only the install script `script/标版/30100101/Sp_NotReceivables_list.sql` mentions the name (because the AR-side `Sp_NotReceivables_list` is the sibling). Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_NotReceivables.md b/en/docs/auto-catalog/procedures/Sp_NotReceivables.md index 3104b8d..6463dcc 100644 --- a/en/docs/auto-catalog/procedures/Sp_NotReceivables.md +++ b/en/docs/auto-catalog/procedures/Sp_NotReceivables.md @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** KPI流程操作菜单 → 财务收付款 → 1/1 销售对账->收款 — AR-side counterpart of `Sp_NotPayAbles`. Paged customer-receivables warning list: pulls every still-unreceived sales bill (delivery, advance, financial-adjust, payment, AR-init) into one window so the credit/collections desk can prioritise follow-ups. + +**What it does:** Reads `SysAccountPeriod.tAPDate` as the AR cutoff, calls `Sp_Sis_GetConst` for `ReceiptInit/Advance/FinancialAdjust/Payment` language labels, builds `ReceivablesWarning` (customer, product, qty, money, currency, due-date, reserves) by UNION-ing across the AR source views filtered to `sBrId/sSuId` and `tCreateDate >= tAPDate`, then forwards the final SQL to `Sp_Outstanding_Query` for paging, `bFilter`/`sFilterOrderBy` splicing, `countCloumn` totals, and `sGroupby_*` rollups. + +**Invocation:** Bound as the data-source of form `gfm.sId=19211681015115285266337740` (1/1 销售对账->收款) via `gdsconfigformmaster.sSqlStr`. Also referenced by the helper `Fun_getInitColumnByProName` (column-discovery for the dynamic-grid layer). Install script ships at `script/标版/30100101/Sp_NotReceivables.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_NotReceivables_HZ_new.md b/en/docs/auto-catalog/procedures/Sp_NotReceivables_HZ_new.md index b2ab526..27d7108 100644 --- a/en/docs/auto-catalog/procedures/Sp_NotReceivables_HZ_new.md +++ b/en/docs/auto-catalog/procedures/Sp_NotReceivables_HZ_new.md @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Newer (`_new`) rewrite of `Sp_NotReceivables_hz` — customer-receivables summary (汇总) under 1/1 销售对账->收款. Same per-customer rollup intent, refactored to assemble its data via explicit `p_sInsertSql/p_sSelectSql/p_sFromSql/p_sWhereSql` parts (plus pre-declared decimal accumulators for `dProductMoney/dReceiptMoney/dProductQty/dNoReceiptMoney/dProductForeignMoney`) instead of the older inline UNION. + +**What it does:** Same overall flow as the rest of the family — `SysAccountPeriod.tAPDate` cutoff, `Sp_Sis_GetConst` constant resolution, `ReceivablesWarning` temp table — but materialises results through a single composed `INSERT … SELECT … FROM … WHERE …` joining delivery/advance/financial-adjust/payment/AR-init sources, grouped by `sCustomerId`, then paged via `Sp_Outstanding_Query`. + +**Invocation:** Status: appears orphaned. Not bound to any `gdsconfigformmaster`, no `gdsmodule` hook, no other-routine reference, no xly-src caller — looks like a staged replacement for `Sp_NotReceivables_hz` that was never wired up. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_NotReceivables_hz.md b/en/docs/auto-catalog/procedures/Sp_NotReceivables_hz.md index 8fbfe61..4ceb94e 100644 --- a/en/docs/auto-catalog/procedures/Sp_NotReceivables_hz.md +++ b/en/docs/auto-catalog/procedures/Sp_NotReceivables_hz.md @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Summary (汇总) variant of `Sp_NotReceivables` under 1/1 销售对账->收款 — per-customer rollup of unreceived sales bills instead of per-bill detail. Intended for an AR overview view where the user wants one row per customer with totals only. + +**What it does:** Same `SysAccountPeriod.tAPDate` cutoff and `Sp_Sis_GetConst` constant lookups as `Sp_NotReceivables`; populates the same `ReceivablesWarning` shape; final dynamic SQL collapses the per-bill UNION by `sCustomerId` so `dProductMoney/dReceiptMoney/dNoReceiptMoney` are pre-summed before paging through `Sp_Outstanding_Query`. + +**Invocation:** Status: appears orphaned. No `gdsconfigformmaster` binding, no `gdsmodule` hook, no other proc/function references the name — only the install script `script/标版/30100101/Sp_NotReceivables_hz.sql`. The deployed form 1/1 销售对账->收款 uses `Sp_NotReceivables` (detail), not this 汇总 variant. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_NotReceivables_list.md b/en/docs/auto-catalog/procedures/Sp_NotReceivables_list.md index a795ba6..0032bc2 100644 --- a/en/docs/auto-catalog/procedures/Sp_NotReceivables_list.md +++ b/en/docs/auto-catalog/procedures/Sp_NotReceivables_list.md @@ -19,4 +19,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Companion to `Sp_NotReceivables` (1/1 销售对账->收款) — takes a CSV list of AR bill ids and returns per-bill detail. Intended to back a drill-down/selection panel where the user ticks specific receivable bills from the warning grid and asks for their full breakdown. + +**What it does:** Builds the same `ReceivablesWarning` temp table as `Sp_NotReceivables`, but rather than scanning all customers it splits the inbound CSV `sId` into a per-row filter and joins each AR source-leg through that filter. Returns the detail rows directly — no paging hand-off — since the caller has already narrowed to a small selection. + +**Invocation:** Status: appears orphaned. No `gdsconfigformmaster` binding, no `gdsmodule` hook, no other proc/function references it. Install script ships at `script/标版/30100101/Sp_NotReceivables_list.sql`. Candidate for maintainer audit; the deployed form 1/1 销售对账->收款 only uses `Sp_NotReceivables`. diff --git a/en/docs/auto-catalog/procedures/Sp_OEE_ConvertThisMachine.md b/en/docs/auto-catalog/procedures/Sp_OEE_ConvertThisMachine.md index 0fc7545..6b22baf 100644 --- a/en/docs/auto-catalog/procedures/Sp_OEE_ConvertThisMachine.md +++ b/en/docs/auto-catalog/procedures/Sp_OEE_ConvertThisMachine.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** OEE管理 — toolbar "转本机台" (move-to-this-machine) button on an OEE production-task grid. Lets the foreman reassign selected `mftproductionplanslave` rows from their original machine to the OEE workstation that's currently in front of the user, so an idle machine can pick up another machine's queued work. + +**What it does:** Parses `$.params[*].value[*].sSlaveId` from `sProInParam` and walks each entry: looks up the slave's `sWorkOrderNo / sPartsName / sProcessName / sDecompose / sWorkOrderId / sMachineName` from `mftproductionplanslave`, joins to `elemachine` by `sMachineId` to read the new machine's `sMachineName / sCostCenterId / sCostCenterName`, then updates the slave to point at the new machine (and propagates the cost-center change). Validates with `Sp_Sis_GetConst('paramsErro', …)` if the JSON payload is too short. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — standard `Sp__BtnEvent*` action slot. Install scripts at `script/标版/30100101/Sp_OEE_ConvertThisMachine.sql` and a 30100101/schedule sibling. No `gdsconfigformmaster`/`gdsmodule` row in the current DB names the proc, so its toolbar wiring lives only in the form-config payloads that ship the OEE screens. diff --git a/en/docs/auto-catalog/procedures/Sp_OEE_MachineStatus_ChangeStatus.md b/en/docs/auto-catalog/procedures/Sp_OEE_MachineStatus_ChangeStatus.md index 53b608b..1d0df94 100644 --- a/en/docs/auto-catalog/procedures/Sp_OEE_MachineStatus_ChangeStatus.md +++ b/en/docs/auto-catalog/procedures/Sp_OEE_MachineStatus_ChangeStatus.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** OEE管理 — toolbar action that lets the foreman change the running status of one or more selected machines from the OEE 机台状态 (machine-status) grid: bulk-update the current state, optionally annotate with a textarea memo, and write back whichever extra columns the form's `valueKey` lists. + +**What it does:** Parses `$.params[*].value[*]` (the selected machine rows) and `$.changeValue` (the form's set-value spec) from `sProInParam`; pulls `$.changeValue.textareaValue` for the optional memo. Reads `valueKey` (a CSV of column names) and composes a `p_where` SET clause by pulling each column's value from `$.changeValue[0].`. Then walks the selected machine ids and applies the composed update, scoping by `sBrId/sSuId`. Errors short-circuit via `Sp_Sis_GetConst('paramsErro', …)` when the JSON is too short. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — standard `Sp__BtnEvent*` action slot. Install script at `script/标版/30100101/schedule/Sp_OEE_MachineStatus_ChangeStatus.sql`. No `gdsconfigformmaster`/`gdsmodule` row in the current DB names this proc, so the toolbar wiring lives in the OEE form-config payload that ships with the shop-floor screen. diff --git a/en/docs/auto-catalog/procedures/Sp_OEE_PlanByProcess.md b/en/docs/auto-catalog/procedures/Sp_OEE_PlanByProcess.md index 7e7faac..97abb4c 100644 --- a/en/docs/auto-catalog/procedures/Sp_OEE_PlanByProcess.md +++ b/en/docs/auto-catalog/procedures/Sp_OEE_PlanByProcess.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** OEE管理 — paged plan-by-process feed: given a machine (or "all-machine" override) and a force-finish flag, returns the production tasks queued for that machine as one row per 工序 (process step), including parts/colour/plate counts, materials, reserves, customer, team, and the up-/down-stream work-order linkage. + +**What it does:** Builds the large `p_Tmp_ProductionReport` temp table (~80 columns of plan/process/material/colour data), branches on `iState` (`0` normal, `1` force-finish) and `sProceeAllMachine` (process-level vs. machine-level filter). Populates the temp from `mftproductionplanslave` joined to work-order / process / material / customer / look-customer scopes, then runs a paging-shaped final `SELECT` through the `pageNum/pageSize/totalCount/countCloumn/sFilterOrderBy/sGroupby_*` parameters typical of the form-master report contract — same signature as the sibling `Sp_OEE_ProductionReport`, so a paging wrapper is expected. + +**Invocation:** Status: appears orphaned. No `gdsconfigformmaster` binding, no `gdsmodule` hook, no other proc/function call, and no xly-src caller (Java, MyBatis, install script) reference this name. Looks like a sibling/precursor of `Sp_OEE_ProductionReport` that was never wired to a form. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_OEE_ProductionReport.md b/en/docs/auto-catalog/procedures/Sp_OEE_ProductionReport.md index 2037bce..9145ed2 100644 --- a/en/docs/auto-catalog/procedures/Sp_OEE_ProductionReport.md +++ b/en/docs/auto-catalog/procedures/Sp_OEE_ProductionReport.md @@ -34,4 +34,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** OEE管理 → OEE本设备生产任务 / OEE本设备对应工序任务 — paged "上报列表获取" (production-report task list) feed for an OEE machine workstation. Returns the production-task rows the operator at the given `sMachineId_s` (or "all machines" override) is expected to report against — one row per 工序 with derived qtys, colour counts, plate counts, customer, team, and work-order linkage. Comment header: `OEE:上报列表获取`. + +**What it does:** Drops/recreates `p_Tmp_ProductionReport` (~80-column staging table holding plan/process/material/colour/parts/customer/team/reserves data), then branches on `iState` (normal vs. force-finish), `sProceeAllMachine` (process- vs. machine-scope) and the look-customer permission. Populates the staging table by joining `mftproductionplanslave` to its work-order, process, material, parts and customer scopes, then assembles a paging-shaped final SELECT and hands it to the form-master paging contract (`pageNum/pageSize/totalCount/countCloumn/countMapJson/sFilterOrderBy/sGroupby_*`) — typically through `Sp_Outstanding_Query`. + +**Invocation:** Bound as the data-source of two forms via `gdsconfigformmaster.sSqlStr`: `gfm.sId=101251240115016087809801980` (OEE本设备对应工序任务) and `gfm.sId=101251240115016040215304930` (OEE本设备生产任务) — both under module OEE管理. Install scripts at `script/标版/20250616/Sp_OEE_ProductionReport.sql` (current) and `Sp_OEE_ProductionReport(old).sql` (previous); `Sp_OEE_ProductionReportAll.sql` ships an "all-machine" sibling. diff --git a/en/docs/auto-catalog/procedures/Sp_OEE_ProductionReportAll.md b/en/docs/auto-catalog/procedures/Sp_OEE_ProductionReportAll.md index a311f77..49f5a87 100644 --- a/en/docs/auto-catalog/procedures/Sp_OEE_ProductionReportAll.md +++ b/en/docs/auto-catalog/procedures/Sp_OEE_ProductionReportAll.md @@ -34,4 +34,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** OEE管理 → OEE本设备对应工序任务 — paged data source for the OEE production-reporting screen that lists every active process task (`mftproductionplanslave`) tied to a given machine, so operators can pick which task to log a 上报 (production report) against. + +**What it does:** Builds a temporary `p_Tmp_ProductionReport` table mirroring the rich `mftproductionplanslave` column set (machine, work order, process, customer, plate-count, reserves, first-inspection times, etc.), runs the OEE process-permission filter from `SysSystemSettings.CkxProcessFilter` + `Fun_GetLookProcess`, applies `Fun_bFilter_toWhere` translation of the front-end `bFilter`, paginates by `pageNum`/`pageSize`, and selects the final set joined back to `eleprocess`, `elemachine`, etc. Filters keep only rows where `dProcessQty - dProductionReportQty > 0` and `sState = 2` (in-progress). + +**Invocation:** Bound as the data-source of the OEE本设备对应工序任务 form `gfm.sId=101251240115016087809801980` via `gdsconfigformmaster.sSqlStr` — the report under OEE管理. Loaded when the OEE 上报 client opens the task list. Install script ships at `script/标版/30100101/schedule/Sp_OEE_ProductionReportAll.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_OEE_ScanInsertToERP.md b/en/docs/auto-catalog/procedures/Sp_OEE_ScanInsertToERP.md index d118efc..9336774 100644 --- a/en/docs/auto-catalog/procedures/Sp_OEE_ScanInsertToERP.md +++ b/en/docs/auto-catalog/procedures/Sp_OEE_ScanInsertToERP.md @@ -1,7 +1,7 @@ # `Sp_OEE_ScanInsertToERP` (procedure) -> @author:zhucx - @date:20210817 封存 +> @author:zhucx + @date:20210817 封存 @describe:PLC服务器调用 @@ -26,4 +26,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** OEE / PLC integration — sealed (封存) PLC-to-ERP scan ingester. The procedure's own COMMENT marks it `20210817 封存`; production traffic now flows through `Sp_OEE_ScanInsertToERP2013`, which is the procedure that calls this one. Historically: parses PLC address/value pair strings (`sPlcAddr`, `sValues`) into machine + counter readings and writes them back to ERP production tables. + +**What it does:** Accepts `sPlcAddr` and `sValues` blobs from the xlyPlc Java service (Siemens PLC reader), tokenises the per-channel values, locates the matching `elemachine`/work-order rows, and inserts/updates ERP-side counters and event rows. Sealed body is preserved for back-compat but the `2013` variant supersedes it. + +**Invocation:** Called by Java `PlcToErpServiceImpl` in `xlyPlc` (assigns `String splc = "Sp_OEE_ScanInsertToERP";` then `call splc(...)`) — Siemens S7 scheduler reads PLC blocks then synchronously executes the proc per machine. Also referenced as a dispatched-call literal by `Sp_OEE_ScanInsertToERP2013`. Install scripts: `script/标版/30100101/schedule/Sp_OEE_ScanInsertToERP.sql` and the PLC variant under `plcNew/`. + +Status caveat: marked sealed in body COMMENT — current deployments may route through the `2013` successor instead. diff --git a/en/docs/auto-catalog/procedures/Sp_OEE_ScanInsertToERP2013.md b/en/docs/auto-catalog/procedures/Sp_OEE_ScanInsertToERP2013.md index 71fe33b..d365691 100644 --- a/en/docs/auto-catalog/procedures/Sp_OEE_ScanInsertToERP2013.md +++ b/en/docs/auto-catalog/procedures/Sp_OEE_ScanInsertToERP2013.md @@ -1,7 +1,7 @@ # `Sp_OEE_ScanInsertToERP2013` (procedure) -> @author:zhucx - @date:20210817 封存 +> @author:zhucx + @date:20210817 封存 @describe:PLC服务器调用 @@ -24,4 +24,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** OEE / PLC integration — variant of `Sp_OEE_ScanInsertToERP` retained alongside the sealed 2021 base; the header COMMENT carries the same `20210817 封存` marker. Receives PLC scan data (`sPlcAddr` / `sValues` blobs) from the Siemens-reader scheduler and writes machine counters / states back to ERP production tables. + +**What it does:** Tokenises the pipe-delimited `sPlcAddr`/`sValues` payload into per-channel readings, looks up the matching `elemachine` and active work-order rows, and either invokes `Sp_OEE_ScanInsertToERP` (the predecessor) as a delegate or runs the equivalent insert/update path directly to update OEE counters on the ERP side. + +**Invocation:** Called from xlyPlc when the deployment is pinned to the 2013-line variant — same call site as `Sp_OEE_ScanInsertToERP` (`PlcToErpServiceImpl`, configured by `splc` literal). No `gdsmodule` or form-master binding (PLC scheduler is the only caller). + +Status caveat: header still says 封存 — surviving in DB because customers' PLC fleets reference it; verify which of the two procedures is actually dispatched by checking the deployed `xlyPlc` config. diff --git a/en/docs/auto-catalog/procedures/Sp_OEE_SearchProductionReport.md b/en/docs/auto-catalog/procedures/Sp_OEE_SearchProductionReport.md index c46f35a..8e9b82e 100644 --- a/en/docs/auto-catalog/procedures/Sp_OEE_SearchProductionReport.md +++ b/en/docs/auto-catalog/procedures/Sp_OEE_SearchProductionReport.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** OEE management — quick lookup of the most recent 上报 (production-report) rows for a single machine. Returns up to 100 rows from `viw_mftproductionreport` sorted descending by `iIncrement`, intended for an OEE client to display "latest reports" against a chosen machine. + +**What it does:** Translates the optional front-end `bFilter` via `Fun_bFilter_toWhere(... 'P')`, splices it into a dynamic `SELECT * FROM viw_mftproductionreport P WHERE P.sMachineId = ORDER BY P.iIncrement DESC LIMIT 100`, and prepares/executes the statement. No writes. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep across all extensions, dynamic-dispatch search) — candidate for maintainer audit. Body is small and self-contained; the COMMENT `获取上报信息` suggests it was authored for an OEE client widget that never shipped or has since been replaced. diff --git a/en/docs/auto-catalog/procedures/Sp_Oee_BtnEventFinished.md b/en/docs/auto-catalog/procedures/Sp_Oee_BtnEventFinished.md index 6a09817..34a746c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Oee_BtnEventFinished.md +++ b/en/docs/auto-catalog/procedures/Sp_Oee_BtnEventFinished.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** OEE管理 — toolbar "完工" (mark-finished) button on an OEE production-task grid. Lets the foreman flag selected `mftproductionplanslave` rows as finished from the OEE UI without going through the full production-report flow. + +**What it does:** Parses `$.params[*].value[*]` from `sProInParam` (selected slave ids), and `$.changeValue` for the field-update spec (`valueKey` lists column names; their values are in `$[0].`) — builds a `p_where` SET clause from those pairs. For each slave id it then derives related `sWorkOrderSlaveId / sWorkOrderControlId / sWorkOrderProcessTbId / sProductionReportId / sPlanId / sSrcSlaveId` and uses the composed update to mark the plan slave (and its work-order companions) finished. Returns errors via `Sp_Sis_GetConst('paramsErro', …)` if the param JSON is too short. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the standard `Sp__BtnEvent*` slot for OEE buttons (the install script ships at `script/标版/30100101/schedule/Sp_Oee_BtnEventFinished.sql`). No `gdsconfigformmaster`/`gdsmodule` row in the current DB references this name, so the deployed binding is set only when the corresponding OEE form is loaded with this proc as its toolbar action. diff --git a/en/docs/auto-catalog/procedures/Sp_OneDatePlan_Machine.md b/en/docs/auto-catalog/procedures/Sp_OneDatePlan_Machine.md index 0788c38..c6741e7 100644 --- a/en/docs/auto-catalog/procedures/Sp_OneDatePlan_Machine.md +++ b/en/docs/auto-catalog/procedures/Sp_OneDatePlan_Machine.md @@ -34,4 +34,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产运营报表 → 机台计划达成日报 — daily plan-vs-actual statistics per machine, split by 班别 (白班/晚班) and rolled up to a 合计 (total) row, for the workshop daily-target dashboard. + +**What it does:** For the given date and brand/subsidiary, seeds `Sp_OneDatePlan_Machine_Table` with one 白班 and one 晚班 row per matching `elemachine` (filtered by `sAttribute` / `sId`), then joins to `mftproductionplanslave` grouped on `sDivRowGroupBy` (` <班别>`) via `Fun_GetGb` to fold in 计划产量/转版数/上班时间 plus 实际产量/转版数; computes `dWccl = dSjcl + dSjzbs*iSheetQty` and totals (`dSjjhdcl` 达成率, `dSbkjl` 开机率, `dUph`). Adds a 合计 sub-table per machine, rewires `sWorkCenterId`/`sWorkCenterName` from in-flight orders, and finally `PREPARE`/`EXECUTE` a dynamic `SELECT NewId() AS sSlaveId, A.* FROM Sp_OneDatePlan_Machine_Table ORDER BY sMachineName LIMIT pageNum,pageSize` (note: hard-coded `pageSize = 18`). + +**Invocation:** Bound as the data-source of the 机台计划达成日报 form `gfm.sId=1921168137117916508762815480` via `gdsconfigformmaster.sSqlStr` — module 机台计划达成日报 under 生产运营报表 → 生产管理. Loaded when the user opens the report. Install script: `script/标版/30100101/schedule/Sp_OneDatePlan_Machine.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_OpsOutSideProcess_BtnEventFinished.md b/en/docs/auto-catalog/procedures/Sp_OpsOutSideProcess_BtnEventFinished.md index 47ce853..7cb489d 100644 --- a/en/docs/auto-catalog/procedures/Sp_OpsOutSideProcess_BtnEventFinished.md +++ b/en/docs/auto-catalog/procedures/Sp_OpsOutSideProcess_BtnEventFinished.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 外协管理 / 工序外发 — toolbar-button handler that marks selected 工序外发 lines as 完工/审核 (finished/examined) on `mftworkorderprocess`, with an optional free-text memo carried in the dialog's `textareaValue`. + +**What it does:** Validates `sProInParam` length, then parses `$.params[*].value[*].sSlaveId` and `$.changeValue.textareaValue`. For each slave id runs `UPDATE mftworkorderprocess SET bExamine=1, sExaminePerson=sMakePerson, tExamineDate=NOW() WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. On empty input it returns `sCode=-1` with the localised `paramsErro` message from `Sp_Sis_GetConst`. (The captured `textareaValue` is parsed but not currently persisted by this version of the body.) + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep across all extensions, dynamic-dispatch search). JSON-input shape matches the generic `Sp_BtnEvent_*` contract dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — would have been wired to a 完工 / 审核 toolbar button on the 工序外发 grid; verify with maintainers before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_OpsOutside_Customer.md b/en/docs/auto-catalog/procedures/Sp_OpsOutside_Customer.md index efc1cf1..54e7f36 100644 --- a/en/docs/auto-catalog/procedures/Sp_OpsOutside_Customer.md +++ b/en/docs/auto-catalog/procedures/Sp_OpsOutside_Customer.md @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 外协管理 / 外发加工 — per-customer 外发加工 (`opsoutsideprocess*`) money summary for a date range. Pivots material-cost spending by `sCustomerId` so a report can rank customers by outsourced spend in the window. + +**What it does:** Defaults `tStartDate` to the first of the current month and `tEndDate` to one month forward; populates a temp table from `opsoutsideprocessslave` joined to `opsoutsideprocessmaster` and `elecustomer`, filtered on `sCustomerName LIKE %sCustomerName%` and master `tCreateDate BETWEEN tStartDate AND tEndDate`. A second temp table aggregates per customer and prepares output rows for paging (`pageNum`/`pageSize`/`totalCount`). + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep across all extensions, dynamic-dispatch search) — candidate for maintainer audit. Body shape matches the 外发-by-客户 reports under 外协管理 but no `gdsconfigformmaster` binding currently references it; likely a draft variant superseded by a sibling proc. diff --git a/en/docs/auto-catalog/procedures/Sp_OpsOutsideprocess_CheckUpdate.md b/en/docs/auto-catalog/procedures/Sp_OpsOutsideprocess_CheckUpdate.md index 44892f4..3de0b4f 100644 --- a/en/docs/auto-catalog/procedures/Sp_OpsOutsideprocess_CheckUpdate.md +++ b/en/docs/auto-catalog/procedures/Sp_OpsOutsideprocess_CheckUpdate.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 外协管理 / 工序发外 (variant: 成品外购) — pre-save validator/recompute for the 成品外购 master record. Aggregates 其它费用 onto each product line, recomputes 单价/金额 and tax-decomposition columns, and refuses to save when the same product appears at multiple prices on one master. + +**What it does:** For the master `sGuid`: zeros `dOldMaterialsPrice` on rows where `dMaterialsPrice=0`, snapshots `dMaterialsPrice → dOldMaterialsPrice`, recomputes `dOldMaterialsMoney`. If any slaves exist on the master, aggregates per (`sParentId,sProductId,sId`) summing `dOldMaterialsMoney + dOtherMoney` into a new `dMaterialsMoney`, then derives `dMaterialsPrice = ROUND(dMaterialsMoney/dMaterialsQty,6)`. Joins `sistax` to refresh `dMaterialsNoTaxPrice/dMaterialsNoTaxMoney/dMaterialsTaxMoney`. Aborts with `sCode=-1` and `'该订单存在相同产品,单价不一致数据,请检查修改后重新保存!'` when the same `sProductId` ends up with multiple distinct `dMaterialsPrice` values. Finally clears the `dOld*` snapshot columns when `iCheckCount=0`. + +**Invocation:** Called by sibling check-routines `Sp_Check_sOpc` and `Sp_Check_sOpp` — i.e. wired into the pre-save validator chain (`gdsmodule.sSaveProName`/`sSaveProNameBefore`) of the 成品外购 / 工序发外 forms, dispatched by `BusinessBaseServiceImpl` during the save flow. diff --git a/en/docs/auto-catalog/procedures/Sp_OpsOutsideprocess_CheckUpdate_ZF.md b/en/docs/auto-catalog/procedures/Sp_OpsOutsideprocess_CheckUpdate_ZF.md index dda3c9e..65228fa 100644 --- a/en/docs/auto-catalog/procedures/Sp_OpsOutsideprocess_CheckUpdate_ZF.md +++ b/en/docs/auto-catalog/procedures/Sp_OpsOutsideprocess_CheckUpdate_ZF.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 外协管理 / 工序发外 — "工序发外单据其它费用保存" variant. Recomputes 工序发外 (`opsoutsideprocessslave`) prices after the user enters 其它费用 (`dOtherMoney`), folding the surcharge into 单价/金额 and refreshing the tax-decomposition columns. The `_ZF` suffix marks the 转发/拆分 variant of the cost-update routine. + +**What it does:** Within the master `sGuid` scope: backs up `dMaterialsPrice → dOldMaterialsPrice`, recomputes `dOldMaterialsMoney = ROUND(dOldMaterialsPrice*dMaterialsQty,2)`; if any slave has `dOtherMoney<>0`, distributes it to `dMaterialsPrice = ROUND((dOldMaterialsMoney+dOtherMoney)/dMaterialsQty,3)` and refreshes tax-decomposed columns (`dMaterialsNoTaxPrice`, `dMaterialsNoTaxMoney`, `dMaterialsTaxMoney`) joined to `sistax`. Refuses with `sCode=-1` and `'该订单存在相同产品,单价不一致数据,请检查修改后重新保存!'` when the same `sProductId` ends up with multiple `dMaterialsPrice` values. Resets the `dOld*` backup columns to zero when the master hasn't been audited yet (`iCheckCount=0`). + +**Invocation:** Pre-save validator. Called from `Sp_Check_sOpc` (the gdsmodule `sSaveProName` hook for the 工序发外 form) — i.e. dispatched by `BusinessBaseServiceImpl` during the save chain (`Sp_Check_s*` family). No xly-src refs. diff --git a/en/docs/auto-catalog/procedures/Sp_Opsoutsideprocess_BtnEventConfirm.md b/en/docs/auto-catalog/procedures/Sp_Opsoutsideprocess_BtnEventConfirm.md index a816360..b86f33c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Opsoutsideprocess_BtnEventConfirm.md +++ b/en/docs/auto-catalog/procedures/Sp_Opsoutsideprocess_BtnEventConfirm.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 外协管理 / 工序外发 — toolbar-button handler that flips the 确认 (confirm) flag on selected 工序外发 (`opsoutsideprocessslave`) lines and propagates the same confirmation onto the upstream work-order-process record (`mftworkorderprocess`), marking the outsourced step as accepted by ops. + +**What it does:** Parses `$.params[*].value[*].sSlaveId` from `sProInParam`. For each slave id, runs `UPDATE mftworkorderprocess P INNER JOIN opsoutsideprocessslave S ON P.sId = S.sWorkOrderProcessTbId SET P.bConfirm=1, P.tConfirmDate=NOW(), P.sConfirmPerson=sMakePerson, S.bConfirm=1, S.tConfirmDate=NOW(), S.sConfirmPerson=sMakePerson WHERE S.sId = p_sId AND S.sBrandsId=sBrId AND S.sSubsidiaryId=sSuId`. Pure tenant-scoped flag update; no validation, no inverse. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep across all extensions, dynamic-dispatch search). Naming and `$.params` JSON shape match the `Sp_BtnEvent_*` button-click contract dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()`, so it would have been wired to a 确认 toolbar button on the 工序外发 grid — likely renamed or replaced; verify with maintainers before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Order_Scrap_Confirm_Flow.md b/en/docs/auto-catalog/procedures/Sp_Order_Scrap_Confirm_Flow.md index 40d8338..f75dada 100644 --- a/en/docs/auto-catalog/procedures/Sp_Order_Scrap_Confirm_Flow.md +++ b/en/docs/auto-catalog/procedures/Sp_Order_Scrap_Confirm_Flow.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 / 工单废品确认 — pre-flow gate for the OrderScrapConfirm (订单废品确认) approval workflow. Stamps the 废品审核 marker on `mftworkordermaster`, hard-deletes any stale draft approval rows for the order, and computes the runtime 会签 participant list (车间班组 foreman + 外发废 supervisor) handed to the workflow engine as routing parameters. + +**What it does:** Refuses with `sCode=-1` when `sGuid=''` or when any 核检废 detail (`mftproductproductionplanbxfpdetail` joined via `mftproductproductionplanbxfpmaster`) is unaudited. Sets `bBfCheck=1, tBfCheckDate=NOW(), sBfCheckPerson=sLoginId` on `mftworkordermaster` for `sGuid`. Deletes existing `biz_flow` rows (and the matching `biz_todo_item` instances) of `type='OrderScrapConfirm'` for any work-order with `bBfCheck=0 AND tBfCheckDate IS NOT NULL` to clear stale runs. Builds `p_OneFlow` by GROUP_CONCAT(`eleemployee.sEmployeeName`) for the foremen of every team that owns a 核检废 detail on this order, and appends the 外发废 supervisor (`sisdepart`-resolved) when `mftproductproductionplanbxfpdetailsum.dWastesQty6 > 0`. The list flows out via the OUT params (`sTableParamsValue`) for the flow engine. + +**Invocation:** Status: appears orphaned by the standard channels (no form-master / gdsmodule hook / other-routine caller / xly-src grep). The body COMMENT `流程启动前调用` plus the JSON-style OUT params strongly indicate this is wired as the pre-flow hook of an `OrderScrapConfirm` workflow definition (typically `gdsmoduleflow.sApplyProName` or a flow-instance binding read by `CheckExamineFlowDataServiceImpl`) — verify the runtime workflow row references this proc. diff --git a/en/docs/auto-catalog/procedures/Sp_OutSideProcess_ProgressOfImplementation.md b/en/docs/auto-catalog/procedures/Sp_OutSideProcess_ProgressOfImplementation.md index 09fd208..02bc66a 100644 --- a/en/docs/auto-catalog/procedures/Sp_OutSideProcess_ProgressOfImplementation.md +++ b/en/docs/auto-catalog/procedures/Sp_OutSideProcess_ProgressOfImplementation.md @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 外协管理 → 分析报表 → 外加工执行情况 — paged execution-progress report that, for each outsourced 工序 line, lists the master bill, customer, supplier, work-order, process, the quantities, costs and the 到货 (arrival) timestamps + receiver, so ops can audit how each outsourced step is progressing. + +**What it does:** Builds the temp table `P_tmpTable` with the full reporting shape (bill no, dates, supplier, customer, product, order/work-order, process, quantities, prices, money, arrival columns, etc.), populates it from the outsourcing slave tables joined to customers/products/processes, applies `Fun_bFilter_toWhere` translation of `bFilter`, paginates with `pageNum`/`pageSize`, and feeds the standard `countCloumn`/`sGroupby_*` framework so the front-end gets paged rows plus per-column totals via `countMapJson`. + +**Invocation:** Bound as the data-source of the 外加工执行情况 form `gfm.sId=19211681019715708477023400` via `gdsconfigformmaster.sSqlStr` — module 外加工执行情况 under 分析报表 → 外协管理. Loaded when the user opens the report. Install scripts ship at `script/标版/30100101/Sp_OutSideProcess_ProgressOfImplementation.sql` and a perf patch under `script/标版/20210323/optimizeprocedure.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_OutsideInspection_BtnRepair.md b/en/docs/auto-catalog/procedures/Sp_OutsideInspection_BtnRepair.md index 04e667d..01eb959 100644 --- a/en/docs/auto-catalog/procedures/Sp_OutsideInspection_BtnRepair.md +++ b/en/docs/auto-catalog/procedures/Sp_OutsideInspection_BtnRepair.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量管理 / 外协检验 — `Sp_BtnRepair_*` family handler that marks selected 外协检验 lines as 返修 (rework / `iTestResult=2`) and writes the operator's exception memo back, optionally applying any other column edits captured in the dialog's `valueKey` list. + +**What it does:** Validates `sProInParam` length (`paramsErro` from `Sp_Sis_GetConst` on failure). Parses `$.params[*].value[*].sId` and `$.changeValue` JSON. From `$.changeValue.valueKey` (a comma list of column names) builds a dynamic `SET col=$.changeValue[0].col, ...` fragment by walking the list. For each selected `sId` runs an UPDATE that always sets `iTestResult=2, sExceptionMemo=` and adds the dynamic SET fragment when present. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep across all extensions, dynamic-dispatch search). Naming and JSON-shape match the generic `Sp_BtnRepair_*` contract dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` for a 返修 toolbar button on a 外协检验 grid — likely either renamed (current outside-process inspection flows use `Sp_OutSideInspection_*`) or wired through a customer override; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Outstanding_Query.md b/en/docs/auto-catalog/procedures/Sp_Outstanding_Query.md index 15d602d..1b5be84 100644 --- a/en/docs/auto-catalog/procedures/Sp_Outstanding_Query.md +++ b/en/docs/auto-catalog/procedures/Sp_Outstanding_Query.md @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Cross-module reporting helper — generic pager/aggregator that wraps a caller-built `SELECT` and returns the paged rows, the total row count and per-column totals as `countMapJson`. The COMMENT `未清存储过程查询、汇总、分页` (open-balance query, aggregation, pagination) describes its original purpose for 未清/未结 reports, but it is now the standard back-end of most paginated business reports. + +**What it does:** Translates `b_filter` to a WHERE fragment via `Fun_bFilter_toWhere(b_filter, sTable_alias)` (default alias `A`); detects whether `s_sql` already contains a `WHERE` and either wraps it as `select * from (s_sql sGroup_by) where 1=1 ` or appends the filter directly; optionally re-wraps with `sGroupby_select_sql ... sGroupby_group_sql` for grouped reports. Runs `SELECT COUNT(1) INTO @totalCountTmp FROM (...)` into `totalCount`. For every column in the comma-separated `count_cloumn` list it builds a SUM/aggregation into `countMapJson`, with a separate code path for `tree_*` columns that need tree-aware rollups. Finally re-emits the full SQL into `sOutSql` for the caller to PREPARE/EXECUTE. + +**Invocation:** Called by ~96 sibling routines — most paginated report procs (e.g. `Sp_Daysalecustomer`, `Sp_DaysaleSalesMan`, `Sp_Inventory_*`, `Sp_Sales_*`, `Sp_Payables_*`, `Sp_Receivables_*`, `Sp_OverdueNo*`, `Sp_OneDatePlan_Machine`, etc.) hand their dynamic SQL string + paging/grouping inputs to this proc and use the OUT `sOutSql`. No xly-src Java caller — it is purely chained from other procedures. diff --git a/en/docs/auto-catalog/procedures/Sp_OverdueNoCheck.md b/en/docs/auto-catalog/procedures/Sp_OverdueNoCheck.md index a1d3f59..20030e6 100644 --- a/en/docs/auto-catalog/procedures/Sp_OverdueNoCheck.md +++ b/en/docs/auto-catalog/procedures/Sp_OverdueNoCheck.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 客户对账管理 → 超期未对账预警表 — overdue-no-reconciliation early-warning report. Lists customer-level delivery / billing amounts that have passed the configured reconciliation grace window without an issued 对账单 (statement), so AR can chase the missing reconciliations. + +**What it does:** Builds the temp table `OverdueNoCheck` with the dollar columns (`dProductMoney`, etc.), pulls candidate bills from delivery / billing tables filtered to `sCustomerId` (optional), `sBrandsId`, `sSubsidiaryId`, plus the data-permission `p_sLookCustomer` filter; computes per-row "overdue" by comparing today's date against the customer's reconciliation cycle / 对账日 from the bills' metadata. Hands the resulting dynamic SQL plus paging/grouping inputs to the generic `Sp_Outstanding_Query` helper for pagination, total-count and `countMapJson` totals. + +**Invocation:** Bound as the data-source of the 超期未对账预警表 form `gfm.sId=19211681019715708437112060` via `gdsconfigformmaster.sSqlStr` — module 超期未对账预警表 under 客户对账管理 → 销售管理. Loaded when the user opens the report. Install script: `script/标版/30100101/Sp_OverdueNoCheck.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_OverdueNotReceivables.md b/en/docs/auto-catalog/procedures/Sp_OverdueNotReceivables.md index a6d0309..c797462 100644 --- a/en/docs/auto-catalog/procedures/Sp_OverdueNotReceivables.md +++ b/en/docs/auto-catalog/procedures/Sp_OverdueNotReceivables.md @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 开票&回款 → 超期未收款预警表 — overdue-uncollected AR early-warning report. Lists per-customer outstanding balances (未收款) along with their 应收/订单/单据 contexts, flagging the ones past the configured 收款期限 so AR can chase collection. + +**What it does:** Builds the working set from receivable + advance-receipt + 票据 (invoice) sources scoped to `sBrId`/`sSuId` (and `sCustomerGuid` when provided), folds in `p_sLookCustomer` from the data-permission framework, computes `dNoReceiveMoney` per customer/bill, evaluates overdue by comparing today against the customer's 收款期限 set on `elecustomer` / system parameters, and forwards the assembled SQL plus paging / grouping / `countCloumn` inputs to the generic `Sp_Outstanding_Query` helper for paging, total-count and `countMapJson` totals. + +**Invocation:** Bound as the data-source of the 超期未收款预警表 form `gfm.sId=101251240115015879457139790` via `gdsconfigformmaster.sSqlStr` — module 超期未收款预警表 under 开票&回款 → 销售管理. Loaded when the user opens the report. Install script: `script/标版/30100101/Sp_OverdueNotReceivables.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_PC_FirstInspection.md b/en/docs/auto-catalog/procedures/Sp_PC_FirstInspection.md index 02b88dd..9aea996 100644 --- a/en/docs/auto-catalog/procedures/Sp_PC_FirstInspection.md +++ b/en/docs/auto-catalog/procedures/Sp_PC_FirstInspection.md @@ -1,9 +1,9 @@ # `Sp_PC_FirstInspection` (procedure) -> @author:zhucx - - @date:20211108 封存 - +> @author:zhucx + + @date:20211108 封存 + @describe: PC 质量管理-过程检验PQC-首检任务列表/ 移动端 - 过程首检 @@ -38,4 +38,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量管理 → 过程质量控制(PQC) → 首检任务列表 and 移动端管理 → 现场 → 功能操作 → 过程首检 / 印刷大检 — paged data source for the 首检 (first-article inspection) task list, both desktop and mobile. The body COMMENT marks the routine `20211108 封存` (sealed) — surviving in DB to back legacy form bindings but flagged for retirement. + +**What it does:** Builds `p_Tmp_ProductionReport` with the work-order/process/machine/customer/product columns plus the three 首检 timestamps (`tFirst1/2/3Inspection`). Reads `SysSystemSettings.CkxProcessFilter` and, when active and `sLoginId` is not sysadmin, calls `Fun_GetLookProcess` to scope to the user's allowed processes. Restricts to `mftProductionPlanSlave A WHERE A.dProcessQty - A.dProductionReportQty > 0 AND A.sState = 2 AND A.bFirst3Inspection = 0` and to processes that own a 首检 test-standard (`EleTestStandard.sFormId='12012615914116370215408310'`). Computes `tFirstInspectionTime` as the latest non-empty first-inspection timestamp via nested `CASE WHEN TIMESTAMPDIFF(MINUTE,...) > 0`. Enriches with `eleprocess.sProcessName` and the matching `EleTestStandard.sTestName`/`sId`, then orders by `iSort,iOrder` and pages with `LIMIT 0,pageSize`. + +**Invocation:** Bound as the data-source of three forms via `gdsconfigformmaster.sSqlStr` — 首检任务列表 `gfm.sId=12012615914116372413380860` under 过程质量控制(PQC) → 质量管理, plus 过程首检 `12012615914116373903372280` and 印刷大检 `101801153119616509369924030` under 移动端管理 → 现场 → 功能操作. Install scripts: `script/标版/30100101/Sp_PC_FirstInspection.sql` and a perf patch at `script/标版/20210323/optimizeprocedure.sql`. + +Status caveat: header `封存` flag — verify whether the active forms still resolve to this proc or to a successor before relying on changes. diff --git a/en/docs/auto-catalog/procedures/Sp_PC_PatrolInspection.md b/en/docs/auto-catalog/procedures/Sp_PC_PatrolInspection.md index 1ff711c..df91e4f 100644 --- a/en/docs/auto-catalog/procedures/Sp_PC_PatrolInspection.md +++ b/en/docs/auto-catalog/procedures/Sp_PC_PatrolInspection.md @@ -1,9 +1,9 @@ # `Sp_PC_PatrolInspection` (procedure) -> @author:zhucx - - @date:20211108 封存 - +> @author:zhucx + + @date:20211108 封存 + @describe: PC 质量管理-过程检验PQC-巡检任务列表 / 移动端-过程巡检 @@ -38,4 +38,12 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量管理 → 过程质量控制(PQC) → 巡检任务列表 (and 移动端管理 → 现场 → 过程巡检) — paged worklist of machines/orders currently awaiting an in-process patrol inspection (巡检). The PC desktop and mobile clients both feed off this result. Body comment is dated `20211108 封存` (sealed/legacy) but the form binding is still live. + +**What it does:** Builds a temp table `p_Tmp_ProductionReport` from `mftProductionPlanSlave` rows that have started (`sState in (1,2)`), still have qty remaining (`dProcessQty > dProductionReportQty`), and intersect `plc_machinedata`. Joins `EleTestStandard` + `eleteststandardobject` (form `12012615914116374914703890`) to attach the test-standard name and the patrol interval `dQualifyRate`; computes `tThisPatrolInspection` (= last-first-inspection-or-patrol + interval minutes) and a 状态 label `已首检 / 未首检 / 超期未巡检 / N分内巡检 / 未到巡检时间`. Honours `SysSystemSettings.CkxProcessFilter` + `Fun_GetLookProcess` for process-level row-level security. + +**Invocation:** Bound as the data-source on two `gdsconfigformmaster` forms via `sSqlStr`: +- `过程巡检` (sId `12012615914116371305494760`) under 移动端管理 → 现场 +- `巡检任务列表` (sId `12012615914116372379422240`) under 质量管理 → 过程质量控制(PQC) + +Loaded when either form opens. Install script: `script/标版/30100101/Sp_PC_PatrolInspection.sql`; an older variant lives in `script/标版/20210323/optimizeprocedure.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_PLC_ScanInsertToERP.md b/en/docs/auto-catalog/procedures/Sp_PLC_ScanInsertToERP.md index e7f6b9c..61ad555 100644 --- a/en/docs/auto-catalog/procedures/Sp_PLC_ScanInsertToERP.md +++ b/en/docs/auto-catalog/procedures/Sp_PLC_ScanInsertToERP.md @@ -1,7 +1,7 @@ # `Sp_PLC_ScanInsertToERP` (procedure) -> @author:zhucx - @date:20210817 封存 +> @author:zhucx + @date:20210817 封存 @describe:PLC服务器调用 @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 设备 / PLC 信号采集 — main entry called by the external PLC server to push a tick of raw signal data into ERP (proc COMMENT: "PLC服务器调用", dated 20210817 封存 / sealed). Decodes a pipe/comma-delimited address+value payload per 西门子 controller, reconciles it against the ERP-side state in `plc_currentmachinevalue`, and detects work-order/shift changes, alarm conditions, and production-count deltas to keep `mftproductionplanslave` / `mftproductionreport` in sync with the physical machines. + +**What it does:** Outer loop splits `sPlcAddr` / `sValues` by `|` (one segment per controller); for each segment the first comma-separated token is `iSemens`, and the rest is address/value pairs. For each address, looks up `viw_plc_machine` (joining `plc_currentmachinevalue` to `elemachine`) to find the matching `sPlcsStatusName` slot, then updates `plc_currentmachinevalue.sPlcsStatusValue`. Branches on `sPlcsStatusName`: 合格数 sets ERP/PLC counters; 当前工单号 / 当前班组 compare PLC vs ERP value, set `p_bBill`/`p_bShift` flags, and look up the corresponding `mftproductionplanslave` row by `sSrcNo`+`sMachineId`; 当前设备状态 captures the device state; PH值 / 电导率 / 酒精 range-check against `dMin/dMax` and write `'ERP警报'` codes 5/4/7 when out of range. The result is a partially reconciled snapshot that downstream procs use to drive production-report writes. + +**Invocation:** Status: appears orphaned at the DB layer — no `gdsmodule.sProcName` binding, no form-master sSqlStr reference, no other-routine caller, no callable Java reference. The commented-out `-- CALL Sp_PLC_ScanInsertToERP('','')` lines inside many `Sp_bd_*.sql` / `Sp_chart_*.sql` source files in `xly-src/script/标版/30100101/` are dead invocation hints, not live callers. The proc header marks it 封存 (sealed) and a customer override exists at `xly-src/script/客户/亚明威/Sp_PLC_ScanInsertToERP.sql`. The historical caller was an external PLC service hitting the DB directly — verify with operations before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Payables_AP.md b/en/docs/auto-catalog/procedures/Sp_Payables_AP.md index 3c27e27..88402d0 100644 --- a/en/docs/auto-catalog/procedures/Sp_Payables_AP.md +++ b/en/docs/auto-catalog/procedures/Sp_Payables_AP.md @@ -36,4 +36,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 应付账款 → 应付账款 — paged AP-ledger report for a supplier window: per-supplier outstanding payable (`dNoPayMoney`) plus due-payable (`dDuePayMoney`) on top of the bill-by-bill 采购/外协/调整 transactions, with the optional `sStatistics`/`sZero` switches to control the summary vs. detail mode and zero-balance filtering. The COMMENT marks the body as a 2025-12-30 rewrite. + +**What it does:** Builds the full AP working set by aggregating purchase-instore bills (`p_iPayType='purchaseinstore'`), outsourcing bills (`p_iOutSidePayType='outsideprocess'`), return/adjust/payment streams (`p_sReturnType`, `p_sAdjustType`, `p_sPaymentType`, `p_sPaysType`), and initial-balance carry-over (`p_sInitType`), all scoped to `sBrId`/`sSuId` and the supplier/date window. Computes per-supplier 已付 / 未付 / 到期 columns into the temp working table, writes the totals into the `INOUT dNoPayMoney` and `dDuePayMoney` outputs, and forwards the assembled SQL + paging / grouping inputs to `Sp_Outstanding_Query` for pagination, total-count and `countMapJson` totals. + +**Invocation:** Bound as the data-source of the 应付账款 form `gfm.sId=192116810113315319067607260` via `gdsconfigformmaster.sSqlStr` — module 应付账款 under 应付账款 → 财务管理. Also bound to several 订单-付款明细表 sub-forms (采购/付款/调整金额/调整票据/退款/开票) and 供应商流水账 under 常用模块 → 常用设置 and 财务管理 → 应付账款. Called as a delegate by sibling `Sp_Payables_APAccount` and read by `Fun_getInitColumnByProName` for column-init metadata. Install script: `script/标版/30100101/Sp_Payables_AP.sql` plus a customer override under `script/客户/湛江新澳/`. diff --git a/en/docs/auto-catalog/procedures/Sp_Payables_APAccount.md b/en/docs/auto-catalog/procedures/Sp_Payables_APAccount.md index c1a3fb4..9e3ff9d 100644 --- a/en/docs/auto-catalog/procedures/Sp_Payables_APAccount.md +++ b/en/docs/auto-catalog/procedures/Sp_Payables_APAccount.md @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 应付账款 → 供应商流水账 — supplier ledger / AP reconciliation report. For each supplier in the date window it lists every AP-affecting bill (purchase-in, outsourcing, adjustment, return, payment, invoice) plus the running 余额, switchable between detail (`iSum=0`) and per-supplier 汇总 mode (`iSum=1`). + +**What it does:** Sets the bill-type tag families (`p_iPayType='purchaseinstore'`, `p_iOutSidePayType='outsideprocess'`, plus return/payment/adjust/pays/init types) and assembles the streaming working set across the AP-relevant tables for `sBrId`/`sSuId` and the date window. Aggregates per supplier or per bill depending on `iSum`, derives 已付/未付 amounts, and forwards the dynamic SQL + paging/`countCloumn`/`sGroupby_*` to `Sp_Outstanding_Query` for pagination, total-count and `countMapJson` totals. Internally it also delegates to the new `Sp_Payables_AP` body for the unified AP working table. + +**Invocation:** Bound as the data-source of the 供应商流水账 form `gfm.sId=192116810113315319144212730` via `gdsconfigformmaster.sSqlStr` — module 供应商流水账 under 应付账款 → 财务管理. Also referenced by `Fun_getInitColumnByProName` for column-init metadata. Install script: `script/标版/30100101/Sp_Payables_APAccount.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Payables_APDetail.md b/en/docs/auto-catalog/procedures/Sp_Payables_APDetail.md index c151c6f..cb82735 100644 --- a/en/docs/auto-catalog/procedures/Sp_Payables_APDetail.md +++ b/en/docs/auto-catalog/procedures/Sp_Payables_APDetail.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 常用模块 → 常用设置 / 订单-付款明细表 — per-bill AP-by-purchase-order detail report. `iSelect`+`iType` select which payment-event variant to render (采购、付款、调整金额、调整票据、退款、开票); the same procedure backs each of the 订单-付款明细表 sub-forms by switching its `p_iPayType` / `p_sTable` / `p_iOutSide` family of locals. + +**What it does:** Defaults `tStartDate` to NOW()-1 month and `tEndDate` to NOW(), routes to one of the AP-event sources by `iSelect`/`iType`, builds the dynamic `p_sSql` for that source scoped to `sBrId`/`sSuId` plus the date window, joins to elesupplier / order tables to enrich the rows, and forwards the assembled SQL + paging / grouping inputs to `Sp_Outstanding_Query` for paging, total-count and `countMapJson` totals. + +**Invocation:** Bound as the data-source of six 订单-付款明细表 forms via `gdsconfigformmaster.sSqlStr` — 订单-付款明细表(采购) `gfm.sId=192116810113315319128813950`, (付款) `192116810113315319134212800`, (调整金额) `192116810113315319135996200`, (调整票据) `192116810113315319138829320`, (退款) `192116810113315319140301650`, (开票) `192116810113315319141949790` — all under 常用设置 → 常用模块. Also referenced by `Fun_getInitColumnByProName` for column-init metadata. Install script: `script/标版/30100101/Sp_Payables_APDetail.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Payables_AP_copy1.md b/en/docs/auto-catalog/procedures/Sp_Payables_AP_copy1.md index 27004bd..82295a3 100644 --- a/en/docs/auto-catalog/procedures/Sp_Payables_AP_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_Payables_AP_copy1.md @@ -33,4 +33,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_Payables_AP` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_Payables_AP` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnEventFinished.md b/en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnEventFinished.md index e78a303..7585bb4 100644 --- a/en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnEventFinished.md +++ b/en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnEventFinished.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 计划、排程 → 计划列表 — toolbar button on the production-plan slave grid that flags 出版/CTP completion for the selected plan rows. Drives the print-prep CTP stage handoff into the press process. Four narrower variants exist for specific sub-cases: `_Control` (per-workorder publish-qty), `_Qty` (publish qty + use qty + plate-style), `_UseQty` (use-qty only); `Sp_PlanListCTP_BtnRepair` reverses/repairs the same fields. + +**What it does:** Parses `$.params[*].value[*].sId` for the selected `mftproductionplanslave` rows and `$.changeValue.valueKey` for the comma-separated list of fields to mutate. Builds a dynamic `UPDATE mftproductionplanslave SET =, =, … WHERE sId IN (…)` — `Sp_System_ReplaceField` resolves the typed values; the standard finished-fields are `bCTP=1`, `tCTPDate=NOW()`, `sCTPPerson=sMakePerson`. Validates `sProInParam` length up front; on bad JSON returns `sCode=-1` with the `paramsErro` localised message from `Sp_Sis_GetConst`. + +**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 出版完工 toolbar button on the 计划列表 grid names this proc. Install script: `script/标版/30100101/Sp_PlanListCTP_BtnEventFinished.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnEventFinished_Control.md b/en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnEventFinished_Control.md index 56b3670..00b8579 100644 --- a/en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnEventFinished_Control.md +++ b/en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnEventFinished_Control.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 计划、排程 → 计划列表 — variant of `Sp_PlanListCTP_BtnEventFinished` that confirms 出版/CTP completion at the **workorder** (mftworkorderslave) layer instead of the plan layer. Body comment 出版完成,后改为按照工单拼版 indicates this version implements the "per-workorder makeup" model after the policy switch. Used when the shop arranges CTP plates per workorder rather than per plan row. + +**What it does:** Requires the user to enter `iPublishQty` (number of plates) and `textareaValue` (the 出版文件编号 list). For each plan row in `$.params[*].value[*]`, dereferences `sSlaveId` (the workorder-slave id) and `UPDATE mftworkorderslave SET bPublish=1, tPublishDate=NOW(), sPublishPerson=sMakePerson, iPublishQty=p_iPublishQty WHERE sId=p_sId AND sBrandsId/sSubsidiaryId match`. Aborts with `sCode=-1` and the localised `sEnterPublishNo` ("请输入出版文件编号") message if the file-no is empty. + +**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 出版完工(按工单) toolbar button on the 计划列表 grid names this proc. Selected at deploy time by `gdsmodule`/前端配置 instead of the per-plan-row variant. DB-only; not in xly-src `30100101`. diff --git a/en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnEventFinished_Qty.md b/en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnEventFinished_Qty.md index 9d697c7..aad8125 100644 --- a/en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnEventFinished_Qty.md +++ b/en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnEventFinished_Qty.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 计划、排程 → 计划列表 — CTP completion variant that records plate quantities, use quantities, and CTP plate style on the plan row. Sibling of `Sp_PlanListCTP_BtnEventFinished` (basic toggle) and `_UseQty` (use-qty only). Picked when the shop tracks CTP output and consumption metrics, not just the finished flag. + +**What it does:** Parses `$.changeValue` for `iPublishQty` (output plate qty, alt key `dSumPlateQty`), `iUsePublishQty` (plates actually used), `sUsePublishType` (consumption type), and `iCTPStyle` (plate style code), then `UPDATE mftproductionplanslave` for each `$.params[*].value[*].sId` setting those four columns plus the standard finished tuple `bCTP=1, tCTPDate, sCTPPerson`. Uses the `valueKey`-driven dynamic builder identical to other PlanList BtnEvent procs. Aborts with `paramsErro` on a malformed `sProInParam`. + +**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — bound to the 出版完工 toolbar button on the 计划列表 grid when the form is configured with the per-row qty inputs. DB-only; not shipped in xly-src `30100101`. diff --git a/en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnEventFinished_UseQty.md b/en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnEventFinished_UseQty.md index 99988e8..a7e8416 100644 --- a/en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnEventFinished_UseQty.md +++ b/en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnEventFinished_UseQty.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 计划、排程 → 计划列表 — CTP completion variant that requires the user to enter only the 出版数量 `iPublishQty`. The narrowest of the `Sp_PlanListCTP_BtnEventFinished*` family — picked when the shop just needs to confirm CTP done plus the plate count, without recording use-qty or plate-style. + +**What it does:** Parses `$.changeValue.iPublishQty`; refuses with `sCode=-1, sReturn='请输入出版数量!'` if empty. For each `$.params[*].value[*].sId` row, runs the `valueKey`-driven dynamic `UPDATE mftproductionplanslave SET =…` builder (same shape as the basic variant) plus `iPublishQty=p_iPublishQty`. Sets the standard finished tuple `bCTP=1, tCTPDate=NOW(), sCTPPerson=sMakePerson`. + +**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 出版完工 toolbar button on the 计划列表 grid names this proc when the form is configured for the publish-qty-only flow. DB-only; not in xly-src `30100101`. diff --git a/en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnRepair.md b/en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnRepair.md index 1402155..cf5d0df 100644 --- a/en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnRepair.md +++ b/en/docs/auto-catalog/procedures/Sp_PlanListCTP_BtnRepair.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 计划、排程 → 计划列表 — repair/inline-edit handler for CTP-related columns on `mftproductionplanslave`. The 修补 (BtnRepair) family is the standard counterpart to BtnEventFinished: it lets the user back-fill or correct CTP fields after the row has already been touched, without going through the finished button again. + +**What it does:** Mirrors the BtnEventFinished shape — parses `$.params[*].value[*].sId` and the JSON-encoded `$.changeValue.valueKey` (comma-list of column names) plus per-column values. Builds a dynamic `UPDATE mftproductionplanslave SET =, … WHERE sId IN (…)` from the typed values via `Sp_System_ReplaceField`. No qty/cost math — strict field-edit only. Validates `sProInParam` length; emits `sCode=-1` with the `paramsErro` localised message from `Sp_Sis_GetConst` on bad input. + +**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — bound to a CTP-related cell-edit / repair button on the 计划列表 grid. Install script: `script/标版/30100101/Sp_PlanListCTP_BtnRepair.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_PlanListCUT_BtnEventFinished.md b/en/docs/auto-catalog/procedures/Sp_PlanListCUT_BtnEventFinished.md index 4edbde7..6d90b9a 100644 --- a/en/docs/auto-catalog/procedures/Sp_PlanListCUT_BtnEventFinished.md +++ b/en/docs/auto-catalog/procedures/Sp_PlanListCUT_BtnEventFinished.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 计划、排程 → 计划列表 — toolbar button on the production-plan slave grid that flags 模切/裁切 (CUT — cutting/die-cut) completion for the selected plan rows. Mirrors `Sp_PlanList_BtnEventMouldFinished` / `Sp_PlanListCTP_BtnEventFinished` for the cut stage. Counterpart un-check: `Sp_PlanListCUT_BtnEventFinishedFHQZ`. + +**What it does:** Parses `$.params[*].value[*].sId` for the picked `mftproductionplanslave` rows; for each, `Update mftproductionplanslave SET bCut=1, tCutDate=now(), sCutPerson=sMakePerson, …` via the valueKey-driven dynamic builder (so the front end controls which adjacent columns also get written). Calls `Sp_Sis_GetConst('paramsErro', …)` to localise a bad-input error and `Sp_System_ReplaceField` for typed value resolution. Returns `sCode=-1` on JSON parse failure. + +**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 模切完工 toolbar button on the 计划列表 grid names this proc. Install script: `script/标版/30100101/Sp_PlanListCUT_BtnEventFinished.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_PlanListCUT_BtnEventFinishedFHQZ.md b/en/docs/auto-catalog/procedures/Sp_PlanListCUT_BtnEventFinishedFHQZ.md index 1748342..8a4ffe3 100644 --- a/en/docs/auto-catalog/procedures/Sp_PlanListCUT_BtnEventFinishedFHQZ.md +++ b/en/docs/auto-catalog/procedures/Sp_PlanListCUT_BtnEventFinishedFHQZ.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 计划、排程 → 计划列表 — 反核签字 (FHQZ) un-check for the cut stage; reverses `Sp_PlanListCUT_BtnEventFinished` after an operator marked a plan row as cut by mistake. Allows the shop to restore an in-progress 模切 status without deleting the plan row. + +**What it does:** Parses `$.params[*].value[*].sId` for the picked `mftproductionplanslave` rows; for each, `UPDATE mftproductionplanslave SET tCutDate=null, sCutPerson=null, bCut=0 WHERE sId=p_sId AND sBrandsId/sSubsidiaryId match`. No JSON-driven dynamic builder, no auxiliary writes — strict clear-flag handler. + +**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 模切反完工 / 撤销模切完工 toolbar button on the 计划列表 grid names this proc. Install script: `script/标版/30100101/Sp_PlanListCUT_BtnEventFinishedFHQZ.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_PlanListMakeup_BtnEventFinished.md b/en/docs/auto-catalog/procedures/Sp_PlanListMakeup_BtnEventFinished.md index 7a9ac84..b8dbaf6 100644 --- a/en/docs/auto-catalog/procedures/Sp_PlanListMakeup_BtnEventFinished.md +++ b/en/docs/auto-catalog/procedures/Sp_PlanListMakeup_BtnEventFinished.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 计划、排程 → 计划列表 — toolbar button on the production-plan slave grid that flags 拼版 (makeup / plate imposition) completion for the selected plan rows. Mirrors `Sp_PlanList_BtnEventMouldFinished` and `Sp_PlanListCTP_BtnEventFinished` for the makeup stage. Counterpart un-check: `Sp_PlanListMakeup_BtnEventFinishedfhpb`. + +**What it does:** Parses `$.params[*].value[*].sId` for the picked `mftproductionplanslave` rows. For each, `UPDATE mftproductionplanslave SET tMakeup=NOW(), bMakeup=1, sMakeupPerson=sMakePerson`. Also computes a `p_dMoney` cost figure from `$.changeValue` and runs `Update mftproductionplanslave Set dMakeupMoney=p_dMoney` through the `valueKey`-driven dynamic builder so the front-end can pass per-column overrides via `Sp_System_ReplaceField`. + +**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 拼版完工 toolbar button on the 计划列表 grid names this proc. Install script: `script/标版/30100101/Sp_PlanListMakeup_BtnEventFinished.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_PlanListMakeup_BtnEventFinishedfhpb.md b/en/docs/auto-catalog/procedures/Sp_PlanListMakeup_BtnEventFinishedfhpb.md index 1b2ae12..f10fa76 100644 --- a/en/docs/auto-catalog/procedures/Sp_PlanListMakeup_BtnEventFinishedfhpb.md +++ b/en/docs/auto-catalog/procedures/Sp_PlanListMakeup_BtnEventFinishedfhpb.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 计划、排程 → 计划列表 — fhpb (反核拼版 / un-makeup) handler that reverses `Sp_PlanListMakeup_BtnEventFinished`. Used when an operator marked a plan row as makeup-finished by mistake and the shop wants to clear the flag plus the cost figure without deleting the row. + +**What it does:** Parses `$.params[*].value[*].sId` for the picked `mftproductionplanslave` rows; for each, `UPDATE mftproductionplanslave SET tMakeup=NULL, bMakeup=0, sMakeupPerson=NULL`. Also runs the `valueKey`-driven dynamic clear `Update mftproductionplanslave Set dMakeupMoney=NULL` so the cost is voided. JSON-shape and error handling identical to its forward counterpart. + +**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 撤销拼版完工 / 反核拼版 toolbar button on the 计划列表 grid names this proc. DB-only; no install script in xly-src `30100101`. diff --git a/en/docs/auto-catalog/procedures/Sp_PlanListMasterials_BtnEventCheck.md b/en/docs/auto-catalog/procedures/Sp_PlanListMasterials_BtnEventCheck.md index d5adc47..b57c130 100644 --- a/en/docs/auto-catalog/procedures/Sp_PlanListMasterials_BtnEventCheck.md +++ b/en/docs/auto-catalog/procedures/Sp_PlanListMasterials_BtnEventCheck.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 计划、排程 → 计划列表 — materials-side (材料) audit confirmation triggered from the plan list. Despite "PlanList" in the name, it audits the upstream 销售开发计划 (`salsalesdevplanmaster`) row that the plan derives from — recording that materials are ready/confirmed at the dev-plan layer. Mirrored by `Sp_PlanListMasterials_BtnEventUnCheck`. + +**What it does:** Parses `$.params[*].value[*].sId` (these are `sSlaveId`s on the plan grid). For each, resolves the dev-plan master id via `SELECT sId INTO @p_sIdTmp FROM viw_salsalesdevplan WHERE sSlaveId=p_sId`, then `UPDATE salsalesdevplanmaster SET bCheck1=1, tCheckDate1=now(), sCheckPerson1=sMakePerson WHERE sId=@p_sIdTmp`. The `bCheck1/tCheckDate1/sCheckPerson1` triplet is the secondary materials-side audit slot, distinct from the primary `bCheck/…`. Also supports the `valueKey`-driven dynamic side-write but only `bCheck1` is hard-set. + +**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 材料审核 (or 材料确认) toolbar button on the 计划列表 grid names this proc. DB-only. diff --git a/en/docs/auto-catalog/procedures/Sp_PlanListMasterials_BtnEventUnCheck.md b/en/docs/auto-catalog/procedures/Sp_PlanListMasterials_BtnEventUnCheck.md index 50de50e..9073905 100644 --- a/en/docs/auto-catalog/procedures/Sp_PlanListMasterials_BtnEventUnCheck.md +++ b/en/docs/auto-catalog/procedures/Sp_PlanListMasterials_BtnEventUnCheck.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 计划、排程 → 计划列表 — materials-side (材料) un-audit, the reverse of `Sp_PlanListMasterials_BtnEventCheck`. Lets the operator pull back the materials confirmation on the upstream 销售开发计划 row when the materials picture changes after the first audit. + +**What it does:** Parses `$.params[*].value[*].sId` (plan slave ids). For each, resolves the dev-plan master via `SELECT sId INTO @p_sIdTmp FROM viw_salsalesdevplan WHERE sSlaveId=p_sId AND bCheck=0`. If no row matches (because 品质部 has already audited and the primary `bCheck` is now 1), aborts with `sCode=-1, sReturn='品质部已审核,请先通知消审'` (forces the user to unwind the quality audit first). Otherwise `UPDATE salsalesdevplanmaster SET bCheck1=0, tCheckDate1=null, sCheckPerson1=null WHERE sId=@p_sIdTmp`. + +**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 撤销材料审核 (反核) toolbar button on the 计划列表 grid names this proc. DB-only. diff --git a/en/docs/auto-catalog/procedures/Sp_PlanListMemo_BtnRepair.md b/en/docs/auto-catalog/procedures/Sp_PlanListMemo_BtnRepair.md index 421515e..f4d8550 100644 --- a/en/docs/auto-catalog/procedures/Sp_PlanListMemo_BtnRepair.md +++ b/en/docs/auto-catalog/procedures/Sp_PlanListMemo_BtnRepair.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 计划、排程 → 计划列表 — inline-edit/repair handler for the 备注 (memo) and 拆分 (decompose / split) text fields on the production-plan slave grid. Lets the operator amend `sManualNo` and `sDecompose` on the plan row from the grid without opening the master form. Sister of the stage-specific repair procs (`Sp_PlanListCTP_BtnRepair`, etc.). + +**What it does:** Pulls `$.changeValue.sManualNo` and `$.changeValue.sDecompose` from `sProInParam`, strips JSON quotes, then walks each `$.params[*].value[*].sId` (a `mftproductionplanslave.sId`) and conditionally runs `UPDATE mftproductionplanslave SET sManualNo=p_sManualNo WHERE sId=p_sPlanId AND p_sManualNo<>''` and the parallel `Update … Set sDecompose=p_sDecompose …` — each guarded so empty inputs are no-ops, allowing the front end to update one field without clobbering the other. + +**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 备注修改 / 拆分修改 cell-edit button on the 计划列表 grid names this proc. DB-only. diff --git a/en/docs/auto-catalog/procedures/Sp_PlanListQualificat_BtnEventCheck.md b/en/docs/auto-catalog/procedures/Sp_PlanListQualificat_BtnEventCheck.md index fce761c..9300781 100644 --- a/en/docs/auto-catalog/procedures/Sp_PlanListQualificat_BtnEventCheck.md +++ b/en/docs/auto-catalog/procedures/Sp_PlanListQualificat_BtnEventCheck.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 计划、排程 → 计划列表 — qualification (合格证 / 合格审核) audit handler. Records that the 销售订单 (sales-order) backing this plan row has passed the 资质/合格 review. The "Qualificat" in the name is `Qualification` truncated; the audited field is `bCheckQualificat` on `salsalesordermaster`. + +**What it does:** Parses `$.params[*].value[*].sId` (the front-end passes the `salsalesordermaster.sId` here). For each, `UPDATE salsalesordermaster SET bCheckQualificat=1, tCheckQualificatDate=now(), sCheckQualificatPerson=sMakePerson WHERE sId=p_sId`. The body also runs `SELECT sId INTO @p_sIdTmp FROM viw_salsalesdevplan WHERE sSlaveId=p_sId` but never uses `@p_sIdTmp` — vestigial, since the UPDATE keys directly off `p_sId`. Validates `sProInParam` length; emits `sCode=-1` + localised `paramsErro` from `Sp_Sis_GetConst` on bad input. + +**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 合格审核 toolbar button on the 计划列表 grid names this proc. DB-only. diff --git a/en/docs/auto-catalog/procedures/Sp_PlanListQualificat_BtnEventUnCheck.md b/en/docs/auto-catalog/procedures/Sp_PlanListQualificat_BtnEventUnCheck.md index 04d7656..1b2e473 100644 --- a/en/docs/auto-catalog/procedures/Sp_PlanListQualificat_BtnEventUnCheck.md +++ b/en/docs/auto-catalog/procedures/Sp_PlanListQualificat_BtnEventUnCheck.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售订单 — main-plan grid uncheck (反审核) handler for the 资质审核 column `bCheckQualificat` on `salsalesordermaster`. Lets the operator roll back a qualification-audit decision on a sales-order row without invalidating the order itself. + +**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam`. For each `sId` it looks up `viw_salsalesdevplan.sSlaveId` (to verify the row is reachable from the plan view) and then `UPDATE salsalesordermaster SET bCheckQualificat=0, tCheckQualificatDate=NULL, sCheckQualificatPerson=NULL`. Supports an optional `changeValue.valueKey` payload, splitting it by comma to compose extra `SET col = JSON_EXTRACT(...)` clauses (the dynamic-set scaffold is built but `p_where` is not actually applied in the final update — the standard plan-grid uncheck behaviour ignores those extras). + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from the 主计划 grid's 反资质审核 toolbar button. Not bound on `gdsmodule.sProcName` or any form-master sSqlStr — name resolved from the grid action config. No xly-src install script located. diff --git a/en/docs/auto-catalog/procedures/Sp_PlanList_BtnEventInkingFinished.md b/en/docs/auto-catalog/procedures/Sp_PlanList_BtnEventInkingFinished.md index c38240f..abe94a8 100644 --- a/en/docs/auto-catalog/procedures/Sp_PlanList_BtnEventInkingFinished.md +++ b/en/docs/auto-catalog/procedures/Sp_PlanList_BtnEventInkingFinished.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 计划、排程 → 计划列表 — toolbar button on the production-plan slave grid that records 印油 (ink) completion for the selected plan rows. Sister handlers: `Sp_PlanList_BtnEventMouldFinished` (覆膜/模具), `Sp_PlanListCTP_BtnEventFinished` (CTP出版), etc. + +**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam` for the picked `mftproductionplanslave` rows, computes `p_dMoney` from `$.changeValue` (the ink-cost figure), then `UPDATE mftproductionplanslave SET dInkingMoney = p_dMoney`, and runs the bMagic-string driven `Sp_System_ReplaceField` to flip an `bInkingFinish`-style boolean plus timestamp/operator columns whose names are passed in `$.valueKey`. Returns `sCode=-1` + localised paramsErro (via `Sp_Sis_GetConst`) if `sProInParam` is invalid. + +**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 计划列表 toolbar's 印油完工 button names this proc as its action. No xly-src install script ships it; it lives only in the DB. diff --git a/en/docs/auto-catalog/procedures/Sp_PlanList_BtnEventMouldFinished.md b/en/docs/auto-catalog/procedures/Sp_PlanList_BtnEventMouldFinished.md index a9e2f87..42e6583 100644 --- a/en/docs/auto-catalog/procedures/Sp_PlanList_BtnEventMouldFinished.md +++ b/en/docs/auto-catalog/procedures/Sp_PlanList_BtnEventMouldFinished.md @@ -1,7 +1,7 @@ # `Sp_PlanList_BtnEventMouldFinished` (procedure) -> @author:zhucx - @date: +> @author:zhucx + @date: @describe: @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 计划、排程 → 计划列表 — toolbar button on the production-plan slave grid that flags 模具/覆膜 (mould / lamination) completion for the selected plan rows. Sister handlers: `Sp_PlanList_BtnEventInkingFinished` (印油), `Sp_PlanListCTP_BtnEventFinished` (出版), `Sp_PlanListMakeup_BtnEventFinished` (拼版). + +**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam` for the selected `mftproductionplanslave` rows and `UPDATE mftproductionplanslave SET bMould=1, tMouldDate=SYSDATE(), sMouldPerson=sMakePerson` for each. Validates `sProInParam` length; on bad input emits `sCode=-1` with the `paramsErro` message from `Sp_Sis_GetConst`. No accompanying cost/qty math — purely the mould-finished flag. + +**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 模具完工 toolbar button on the 计划列表 grid names this proc. Install script: `script/标版/30100101/Sp_PlanList_BtnEventMouldFinished.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_PlanListtDeliverDate_BtnRepair.md b/en/docs/auto-catalog/procedures/Sp_PlanListtDeliverDate_BtnRepair.md index 8e8b21b..44f45e3 100644 --- a/en/docs/auto-catalog/procedures/Sp_PlanListtDeliverDate_BtnRepair.md +++ b/en/docs/auto-catalog/procedures/Sp_PlanListtDeliverDate_BtnRepair.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划 → 主计划 — bulk delivery-date adjust handler (proc COMMENT: "调整交期,主计划页面调用"). Operator picks rows in the 主计划 (`mftproductionplan`) grid, types a new `tDeliverDate`, and this proc cascades that date through every downstream entity tied to the work-order so the new commitment is visible across sales/work-order/plan/notify chains. + +**What it does:** Parses `$.params[*].value[*].sId` and `$.changeValue.tDeliverDate` from `sProInParam`. For each `sId` it cursors `mftproductionplan` (filtered by `sBrandsId/sSubsidiaryId`) to fetch the `sWorkOrderId` plus the old delivery date, then runs five updates: `salsalesorderslave`, `mftworkorderslave` (slave on `sParentId`), `mftproductionplanslave`, `mftproductionplan` (also sets `sMaterialsCheckResult = '偏离交期'/'满足交期'` by comparing `tLastDeliverDate` vs new date), and `saldelivernotifyslave`. Finally inserts a `syslog` row tagged `sOperationType='调整交期'`, `sFormId='19211681019715708440774010'`, with the old/new dates in `sLog`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 主计划 grid's 调整交期 toolbar button names this proc. Install script `xly-src/script/标版/30100101/schedule/Sp_PlanListtDeliverDate_BtnRepair.sql` is the source of truth. Twin `Sp_PlanListtDeliverDate_BtnRepair_memo` is an identical-body memo/snapshot copy. diff --git a/en/docs/auto-catalog/procedures/Sp_PlanListtDeliverDate_BtnRepair_memo.md b/en/docs/auto-catalog/procedures/Sp_PlanListtDeliverDate_BtnRepair_memo.md index 1cbca38..2b288a8 100644 --- a/en/docs/auto-catalog/procedures/Sp_PlanListtDeliverDate_BtnRepair_memo.md +++ b/en/docs/auto-catalog/procedures/Sp_PlanListtDeliverDate_BtnRepair_memo.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Snapshot/memo copy of `Sp_PlanListtDeliverDate_BtnRepair` (生产计划 → 主计划 delivery-date adjust). Body is byte-identical to the active proc — kept as a `_memo` rollback variant per the convention that backs up a routine before a destructive edit. Per wiki convention, snapshot copies are not narrated separately; see `Sp_PlanListtDeliverDate_BtnRepair` for the substantive narrative. + +**What it does:** Same as `Sp_PlanListtDeliverDate_BtnRepair` at the time of copy — cascades a new `tDeliverDate` from `$.params[*].value[*].sId` rows of `mftproductionplan` into `salsalesorderslave`, `mftworkorderslave`, `mftproductionplanslave`, `mftproductionplan` (with 偏离/满足 flag), `saldelivernotifyslave`; writes a 调整交期 `syslog` row. + +**Invocation:** Not expected to be called from production. No `gdsmodule.sProcName` binding, no form-master sSqlStr reference, no xly-src install script. Status: snapshot — verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_PlanSlave_BtnEventCBReturn.md b/en/docs/auto-catalog/procedures/Sp_PlanSlave_BtnEventCBReturn.md index 799d3cf..afb5d6f 100644 --- a/en/docs/auto-catalog/procedures/Sp_PlanSlave_BtnEventCBReturn.md +++ b/en/docs/auto-catalog/procedures/Sp_PlanSlave_BtnEventCBReturn.md @@ -1,7 +1,7 @@ # `Sp_PlanSlave_BtnEventCBReturn` (procedure) -> @author:zhucx - @date: +> @author:zhucx + @date: @describe: @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产计划 → 计划明细 — 撤销无需出版 (revert "no plate-making needed" mark) button handler. Inline comment: "撤销无需出版". After a planner had previously flagged a plan-slave row as 无需出版 (skip plate-making, sets `bPublishComplete=1`), this proc lets them undo that mark so the row re-enters the plate-making queue. + +**What it does:** Parses `$.params[*].value[*].sSlaveId` from `sProInParam` (note: reads `sSlaveId`, not `sId` — the calling grid is slave-keyed). For each id runs `UPDATE mftproductionplanslave SET bPublishComplete=0 WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId AND bPublishComplete=1`. The `bPublishComplete=1` guard makes it a no-op on rows that aren't currently marked. No syslog write. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 计划明细 grid's 撤销无需出版 toolbar button names this proc. Inverse of the proc that originally sets `bPublishComplete=1`. No `gdsmodule` hook, no form-master sSqlStr, no xly-src install script. diff --git a/en/docs/auto-catalog/procedures/Sp_Post_sModule.md b/en/docs/auto-catalog/procedures/Sp_Post_sModule.md index 83666ec..c05ecf5 100644 --- a/en/docs/auto-catalog/procedures/Sp_Post_sModule.md +++ b/en/docs/auto-catalog/procedures/Sp_Post_sModule.md @@ -1,8 +1,8 @@ # `Sp_Post_sModule` (procedure) -> @author:zhucx - @date:2022.01.02 - @describe: +> @author:zhucx + @date:2022.01.02 + @describe: 1.PC端-系统设定-开发平台-系统模块-保存之后自动调用本过程 @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 开发平台 → 系统功能模块设置单据 — post-save hook on the 系统模块 (`gdsmodule`) record. Two jobs: (1) maintain the materialised tree path `sAllId` (`-grandparent-parent-self`) whenever the module's parent chain changes, and (2) when the operator copied a template module by setting `sSrcSlaveId` on the new record, clone the template's form-master/slave/jurisdiction/formconst rows into the new module so the copied module is functional immediately. + +**What it does:** Reads `sAllId` for `sGuid`. If empty, climbs `sParentId` up to two levels and recomputes `sAllId = -p1-p2-self` (or shorter when the chain is shallower). Then reads `sSrcSlaveId`; if set, opens a cursor over `gdsconfigformmaster WHERE sParentId = sSrcSlaveId` and per source form-master: generates a new `p_sParentId1`, INSERTs the matching `gdsconfigformslave` rows pointing at the new id (preserving all 50+ field-config columns), then INSERTs a new `gdsconfigformmaster` row with `sId=p_sParentId1`, `sParentId=sGuid`, copying everything else; finally clones `gdsjurisdiction` and `gdsformconst` rows from the template's `sParentId = sSrcSlaveId` to the new module. Finishes with `UPDATE gdsmodule SET sAllId = p_sAllId WHERE sId = sGuid`. + +**Invocation:** Bound on `gdsmodule.sSaveProName = 'Sp_Post_sModule'` for `系统功能模块设置单据` (`sId 12012615914116409277657460`) under 开发平台 (`sId 16409269700002288019597983792400`). Runs after any save of a 系统模块 record. Java path: `BusinessBaseServiceImpl` consults `gdsmodule.sSaveProName` post-save. Install scripts ship in `xly-src/script/标版/30100101/Sp_Post_sModule.sql` and an `upgrade/20220119业务界面复制模块后处理/` variant. diff --git a/en/docs/auto-catalog/procedures/Sp_Procedure_Templet.md b/en/docs/auto-catalog/procedures/Sp_Procedure_Templet.md index ac2859b..91f9851 100644 --- a/en/docs/auto-catalog/procedures/Sp_Procedure_Templet.md +++ b/en/docs/auto-catalog/procedures/Sp_Procedure_Templet.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Boilerplate template ("Templet" — typo for "Template") — not a business routine. Comment header is mojibake (originally `生产排程`, garbled by encoding mismatch). The body is the scaffolding every transactional proc copies from: parameter null-coalesce defaults, transaction-savepoint setup, `top: BEGIN … END` block, and an `SQLEXCEPTION` rollback handler. Maintainers duplicate this file as the starting point when writing a new `Sp_*` proc. + +**What it does:** `IFNULL`s every parameter, counts in-flight `INNODB_TRX` for the connection, opens a `START TRANSACTION` only if there isn't one, sets `SAVEPOINT sInsertMftPlan`, and runs a single placeholder statement `SELECT * FROM gdsconfigcharmaster LIMIT 0,1` inside the `top:` block. The error handler rolls back to the savepoint and emits the `SQLEXCEPTION` localised message via `SP_Sis_GetConst`; success path `COMMIT`s. The `sWorkOrderGuid`/`bCheck` parameter list reflects the audit-button family it was copied for. + +**Invocation:** Status: appears orphaned by design. No `gdsmodule.sProcName` binding, no form-master sSqlStr reference, no other-routine caller, no xly-src reference. Kept in the catalog as a developer template — not intended to be invoked from production. diff --git a/en/docs/auto-catalog/procedures/Sp_ProcessInspection_BtnRepair.md b/en/docs/auto-catalog/procedures/Sp_ProcessInspection_BtnRepair.md index 07f0ac0..c797ecf 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProcessInspection_BtnRepair.md +++ b/en/docs/auto-catalog/procedures/Sp_ProcessInspection_BtnRepair.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 品质管理 → 工序检验 — bulk-edit handler for `qlyprocesstestmaster` (工序检验单). When the inspector marks one or more inspection rows as 异常 from the grid and types a memo in the popup textarea, this proc updates the selected rows with `iTestResult=2` (异常) and writes the memo into `sExceptionMemo`, plus any extra columns the grid passes via `changeValue.valueKey`. + +**What it does:** Parses `$.params[*].value[*].sId` and `$.changeValue.{valueKey,textareaValue,...}` from `sProInParam`. Splits `valueKey` (comma-separated field-name list) and composes a dynamic `SET col1=val1, col2=val2 …` clause by extracting each named field out of `changeValue`. For every selected `sId` appends `iTestResult=2, sExceptionMemo=p_textareaValue` to the SET clause, then `PREPARE`/`EXECUTE` an `UPDATE qlyprocesstestmaster SET … WHERE sId=p_sTmpId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. Defaults `p_textareaValue` to `''''` when missing. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — `qlyprocesstestmaster` 工序检验 grid's 标异常 (or similarly-named bulk-edit) toolbar button names this proc. No `gdsmodule.sProcName` binding, no form-master sSqlStr reference, no xly-src install script located. diff --git a/en/docs/auto-catalog/procedures/Sp_Process_BtnEventCancelInvalid.md b/en/docs/auto-catalog/procedures/Sp_Process_BtnEventCancelInvalid.md index 6422b5e..2698dff 100644 --- a/en/docs/auto-catalog/procedures/Sp_Process_BtnEventCancelInvalid.md +++ b/en/docs/auto-catalog/procedures/Sp_Process_BtnEventCancelInvalid.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础资料 → 工艺 (`eleprocess`) — 取消作废 (un-invalidate) handler for the 工序 list. Proc COMMENT: "取消供应商作废" (mislabeled — it operates on `eleprocess` 工序 records, not 供应商; the `syslog.sFormId='11811781131121915166036411380'` is the 工序 form). Inverse of `Sp_Process_BtnEventInvalid`. + +**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam`. Each `sId` can be hyphen-joined (`p_sId.split('-')`) — loops on every sub-id. For each, reads `eleprocess.sProcessName` (filtered by branch/subsidiary), runs `UPDATE eleprocess SET bInvalid=0 WHERE sId=p_sIdOne`, then writes a `syslog` row with `sLog=CONCAT('取消作废工序:',sProcessName)`, `sOperationType='取消作废工序'`, `sFormId='11811781131121915166036411380'`. Returns the `chooseData` localised error when the input is empty. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — 工序 (`eleprocess`) grid's 取消作废 toolbar button names this proc. Install script `xly-src/script/标版/30100101/Sp_Process_BtnEventCancelInvalid.sql`. Twin: `Sp_Process_BtnEventInvalid` (the 作废 side). diff --git a/en/docs/auto-catalog/procedures/Sp_Process_BtnEventInvalid.md b/en/docs/auto-catalog/procedures/Sp_Process_BtnEventInvalid.md index 54ba4db..398d309 100644 --- a/en/docs/auto-catalog/procedures/Sp_Process_BtnEventInvalid.md +++ b/en/docs/auto-catalog/procedures/Sp_Process_BtnEventInvalid.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础资料 → 工艺 (`eleprocess`) — 作废 (invalidate) handler for the 工序 list. Proc COMMENT: "供应商作废" (mislabeled — the body actually operates on `eleprocess` 工序 records; the `syslog.sFormId='11811781131121915166036411380'` is the 工序 form). Lets the operator mark obsolete process steps as void so they no longer appear in selection dropdowns or routing. + +**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam`. Each `sId` may be hyphen-joined; loops on every sub-id. For each, reads `eleprocess.sProcessName`, runs `UPDATE eleprocess SET bInvalid=1 WHERE sId=p_sIdOne`, then writes a `syslog` row with `sLog=CONCAT('作废工序:',sProcessName)`, `sOperationType='作废工序'`, `sFormId='11811781131121915166036411380'`. Returns the `chooseData` localised error when the input is empty. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — 工序 grid's 作废 toolbar button names this proc. Install script `xly-src/script/标版/30100101/Sp_Process_BtnEventInvalid.sql`. Inverse: `Sp_Process_BtnEventCancelInvalid`. diff --git a/en/docs/auto-catalog/procedures/Sp_Process_CommonGtChar.md b/en/docs/auto-catalog/procedures/Sp_Process_CommonGtChar.md index fadb19b..ce3da08 100644 --- a/en/docs/auto-catalog/procedures/Sp_Process_CommonGtChar.md +++ b/en/docs/auto-catalog/procedures/Sp_Process_CommonGtChar.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 排程 → 机台计划 — Gantt-chart data builder for the per-machine scheduling view (proc COMMENT: "机台计划:排程甘特图"). Returns a JSON payload `{zoom, data, links}` consumed directly by the front-end Gantt component (dhtmlx-style task/dependency model). + +**What it does:** Splits the front-end `bFilter` JSON array into individual `bFilterName`/`bFilterValue` json objects via `Fn_json_extract`, harvesting `sMachineId`, `sProcessId`, `sWorkCenterId`, `tStartDate` selectors. Aborts with `sCode=-1, sReturn='请先选择机台'` when no machine. Counts `MftProductionPlanSlave` rows for that machine where `sState<>'5' AND dProcessQty-dProductionReportQty>0 AND bProductionReportComplete=0`; cursors each plan-slave row ordered by `iOrder`, building a JSON task per row (`id, text=sSrcNo+sPartsName+sDecompose, start_date, end_date=start+dHour min, duration=dHour, progress=dProductionReportQty/dProcessQty, sWorkOrderId, sMachineId, sWorkCenterId, sTable='MftProductionPlanSlave', iOrder, dHour, sHandleType='GT'`) appended to `p_dataArray`. Between adjacent rows it emits a `links` edge (`source=prev_id, target=this_id, type='0'`). Wraps in `{zoom:{scale:'Minutes',step:30}, data, links}`, runs the `"{` / `}"` un-escape passes, returns via `sReturn`. + +**Invocation:** Status: appears orphaned at the wiring level — no `gdsmodule.sProcName` binding, no `gdsconfigformmaster.sSqlStr/sConfigSqlStr` binding, no `gdsconfigcharmaster.sProcedureName` binding, no other-routine caller. Only install script `xly-src/script/标版/30100101/schedule/Sp_Process_CommonGtChar.sql` ships it. The signature (`bFilter`, `sGroupby_*_sql`) plus the JSON return shape suggests it was called from a Java controller assembling the Gantt page; the call site isn't reachable by name grep — verify with the front-end module config. diff --git a/en/docs/auto-catalog/procedures/Sp_ProductAgingAnalysis.md b/en/docs/auto-catalog/procedures/Sp_ProductAgingAnalysis.md index 7bb0139..c9f8e26 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductAgingAnalysis.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductAgingAnalysis.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 / 库存 → 产品账龄分析 — paged report that ages on-hand finished-goods inventory by how long each `eleproduct` × `siswarehouse` lot has been sitting in stock, with the customer/sales-rep affiliation pulled from the originating sales-order chain. The header dates `tStartDate=2024-01-01` and `tEndDate=NOW()` are currently hard-coded — the report ignores user-supplied period bounds. + +**What it does:** Builds temp tables `P_Tmp_sFromId`, `P_Tmp_product_List`, `P_Tmp_product_List_Group`, `P_Tmp_product_List_return` by `CALL Sp_Sis_GetProductInventoryFormGuid` to enumerate the relevant inventory-form ids, then aggregates `eleproductstock`, `PitProductStore`, and joins `viw_salsalesorder`, `elecustomer`, `eleproductcustomer`, `eleproduct`, `sislocation`, `siswarehouse`, `SisCurrency`, `SisSalesMan`, `sisproductclassify`. `Fun_GetLookCustomer(sLoginId, sBrId, sSuId)` enforces per-user customer-visibility scope. Final paging and dynamic `bFilter` splicing delegated to the standard outstanding-query helper. + +**Invocation:** No form-master, gdsmodule hook, or other-routine caller references the name. Sister variants exist: `Sp_ProductAgingAnalysis_detail` (drill-down), `Sp_ProductAgingAnalysis_new` (rep/order-maker filter overload), `Sp_ProductAgingAnalysis_YM` (month-end snapshot off `eleproductstockmonth`). xly-src ships `script/标版/optimize/Sp_ProductAgingAnalysis.sql` only. The report appears wired through a `gdsconfigformmaster` row whose `sSqlStr` is not on the live `xlyweberp_saas_ai` instance — likely registered only in customer-specific deployments. Audit candidate on stock builds. diff --git a/en/docs/auto-catalog/procedures/Sp_ProductAgingAnalysis_YM.md b/en/docs/auto-catalog/procedures/Sp_ProductAgingAnalysis_YM.md index 16fc1e7..3de158a 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductAgingAnalysis_YM.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductAgingAnalysis_YM.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 / 库存 → 产品月末账龄分析 — month-end snapshot variant of `Sp_ProductAgingAnalysis`. Same aging logic but reads the period-closed inventory snapshot table `eleproductstockmonth` instead of the live `eleproductstock`, scoped to `(tStartDate..tEndDate)` so a user can ask "what did the aging picture look like at the end of month X". + +**What it does:** `CALL Sp_Sis_GetProductInventoryFormGuid` to fill `P_Tmp_sFromId`, then `INSERT INTO P_Tmp_product_List`, `P_Tmp_product_List_Group`, `P_Tmp_product_List_return` aggregating `eleproductstockmonth` and `PitProductStore` rows joined to `salsalesordermaster`/`salsalesorderslave`, `elecustomer`, `eleproductcustomer`, `eleproduct`, `sislocation`, `siswarehouse`, `SisCurrency`, `SisSalesMan`, `sisproductclassify`. Period bounds are pushed into the predicate; paging/groupby/orderBy delegated to the standard helper. + +**Invocation:** No live caller in any channel (form-master, gdsmodule hooks, other procs, xly-src grep, dynamic-dispatch search). One of the four `Sp_ProductAgingAnalysis*` siblings; the YM variant's grid binding is not registered in `xlyweberp_saas_ai` — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_ProductAgingAnalysis_detail.md b/en/docs/auto-catalog/procedures/Sp_ProductAgingAnalysis_detail.md index c233d03..06ddfb9 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductAgingAnalysis_detail.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductAgingAnalysis_detail.md @@ -37,4 +37,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 / 库存 → 产品账龄分析 — drill-down variant of `Sp_ProductAgingAnalysis` that returns the row-level detail for a single product/warehouse/location/lot from the summary grid. Accepts `iType`, `sProductId`, `sWareHouseId`, `sLocationId`, `sWareHouseLocationId`, `sDefineNo`, `sDefineNo2` so the drill is scoped to whichever cell the user clicked. + +**What it does:** Same scaffolding as the summary proc — `CALL Sp_Sis_GetProductInventoryFormGuid` into `P_Tmp_sFromId`, builds `P_Tmp_product_List_detail` and `P_Tmp_product_List_return` joining `eleproductstock`, `viw_salsalesorder`, `elecustomer`, `eleproductcustomer`, `eleproduct`, `sislocation`, `siswarehouse`, `SisCurrency`, `SisSalesMan`. Filters on the drill-down keys, then hands the dynamic SQL to the standard paging/order-by/groupby helper that flushes `totalCount` and `countMapJson`. + +**Invocation:** No live form-master / gdsmodule / other-proc binding for this name in `xlyweberp_saas_ai`. Typical deployment registers it as the dataSource of a hidden drill-detail form_sId opened from the `Sp_ProductAgingAnalysis` grid; that wiring is customer-specific and not in 30100101. Audit candidate. diff --git a/en/docs/auto-catalog/procedures/Sp_ProductAgingAnalysis_new.md b/en/docs/auto-catalog/procedures/Sp_ProductAgingAnalysis_new.md index a1cad70..4bf8148 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductAgingAnalysis_new.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductAgingAnalysis_new.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 / 库存 → 产品账龄分析 — revised variant of `Sp_ProductAgingAnalysis` adding two extra IN parameters `sSalesManNameParam` and `sOrderMakePersonParam` so the same aging grid can be filtered to a single 销售员/制单人 directly, bypassing the dynamic `bFilter` plumbing. Replaces the original for tenants that want the rep-scoped variant by default. + +**What it does:** Same structure as the original — `CALL Sp_Sis_GetProductInventoryFormGuid` into `P_Tmp_sFromId`, populates `P_Tmp_product_List`, `P_Tmp_product_List_Group`, `P_Tmp_product_List_return` from `eleproductstock`, `PitProductStore` and the same `viw_salsalesorder` / `elecustomer` / `eleproductcustomer` / `eleproduct` / `sislocation` / `siswarehouse` / `SisCurrency` / `SisSalesMan` / `sisproductclassify` joins. Adds equality predicates on the two new params before pushing to the paging helper. + +**Invocation:** No live caller in form-master, gdsmodule hooks, other routines, or xly-src grep. Lives alongside `Sp_ProductAgingAnalysis` and `Sp_ProductAgingAnalysis_detail` / `_YM`; likely staged for a tenant report rewrite that did not land in the standard 30100101 install. Audit candidate. diff --git a/en/docs/auto-catalog/procedures/Sp_ProductCardAddMaterials_calc.md b/en/docs/auto-catalog/procedures/Sp_ProductCardAddMaterials_calc.md index 369e1dd..888f58a 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductCardAddMaterials_calc.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductCardAddMaterials_calc.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 产品资料 / 生产工艺卡 — custom-calc handler invoked when the user adds materials to a product process card; the front-end posts the grid data, the proc materialises it into a temp table, applies cross-row roll-ups (pack/mounted-style material consolidation, machine vs. process linkage), and returns the recalculated rows for the UI to repaint. + +**What it does:** Drops/recreates `mftproductmaterials_calc_tmp` from `sCreateTableSql`/`sDropTableSql`, inserts the posted `sData` rows, then joins to `elemachine`, `elematerials`, `eleprocess`, `mftproductcontrol_calc_tmp`, `mftproductprocess_calc_tmp`, `mftproductslave_calc_tmp`, `p_sMaterialsStyle_table`, `p_sPackMaterialsTb_table`. Routes through `CALL Sp_calc_addData_toTable` for the row-insert helper and `CALL Sp_Sis_GetConst` for localised error messages. Final `EXECUTE selectSql` ships the recalculated dataset back via the cursor (no OUT-table return). + +**Invocation:** Dispatched by Java `CalcProcedureServiceImpl.calc()` (in `xlyBusinessService`) when the request body's `sProName=Sp_ProductCardAddMaterials_calc` — the standard custom-calc bridge that funnels frontend grid edits through user-defined SQL procs. The companion proc `Sp_ProductCardMaterials_calc` (without `Add`) handles the same form's full reload. No gdsmodule hook or form-master binding — the proc name lives on the form's calc-button definition and is shipped from the frontend. diff --git a/en/docs/auto-catalog/procedures/Sp_ProductCarryforward.md b/en/docs/auto-catalog/procedures/Sp_ProductCarryforward.md index 0f25d71..36a4c03 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductCarryforward.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductCarryforward.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本管理 → 产成品成本结转 — period-close reconciliation report comparing the cost-side production output (`accproductstore`) against the business-side sales/delivery/invoice/freight numbers for one or more accounting periods. The single result set drives the manager-facing 结转校对 view that flags discrepancies before the period is frozen. + +**What it does:** Builds temp `TmpProductCarryforward` keyed by `sCostPeriod` (loops `sysaccountperiod` rows ≥ 202209 and ≤ the earliest unfrozen period), then back-fills ~20 measures per period: cost-output money, instore money, business delivery/return qty, finished-goods consumption, current-out qty, freight totals, invoice qty/no-tax money on both business and cost sides, opening/closing balances on both `eleproductstockmonthcost` and `eleproductstockmonthmoney`. Also issues `CALL Sp_SalSalesCheck1` for a side-effect refresh of sales-check totals. Returns `SELECT * FROM TmpProductCarryforward ORDER BY tStartDate`. + +**Invocation:** Chained from `Sp_System_ProductCost` (`CALL Sp_ProductCarryforward(p_sPeriod, sBrId, sSuId, @sReturn, @totalQty, @countMapJson, @sCode)` after the cost engine writes its own carryforward rows) — that engine in turn runs from the cost-period button family (`Sp_BtnEventProductInStoreSure_New`, `Sp_financialClosing_BtnEventProductStock_New`). xly-src ships `script/标版/30100101/cost/Sp_ProductCarryforward.sql`. No standalone form/UI dispatcher — strictly a downstream of cost-closing. diff --git a/en/docs/auto-catalog/procedures/Sp_ProductDelivergoods.md b/en/docs/auto-catalog/procedures/Sp_ProductDelivergoods.md index da74212..91fb371 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductDelivergoods.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductDelivergoods.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 / 销售订单 — toolbar handler that marks selected sales-order rows as "stocked / handed off to delivery". Used on the 销售订单 grid to flip the order from "open" to "ready-to-deliver" status in bulk before the actual delivery note is created. + +**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam`. For each id, `UPDATE Salsalesordermaster SET sStockup='2', sSend=sMakePerson, tSend=SYSDATE() WHERE sId=p_sSrcNo AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. No status validation, no slave-row touch — purely a master-level stockup flag bump. + +**Invocation:** Standard `Sp__BtnEvent*` slot — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` when the 销售订单 grid's stockup button names this procedure. xly-src ships `script/标版/30100101/Sp_ProductDelivergoods.sql`. No form-master, gdsmodule hook, or other-proc reference — name carried in the button definition only. diff --git a/en/docs/auto-catalog/procedures/Sp_ProductInspection_BtnRepair.md b/en/docs/auto-catalog/procedures/Sp_ProductInspection_BtnRepair.md index ffdcc63..2dedc33 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductInspection_BtnRepair.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductInspection_BtnRepair.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 品质管理 / 产品检验 — grid-row "mark as exception/repair" button handler on `qlyproducttestmaster`. The QC operator picks failing rows, optionally edits inline grid cells plus an exception-memo textarea, clicks Repair, and this proc batch-flags those test rows with `iTestResult=2` (exception) plus the memo, applying any inline edits in the same UPDATE. + +**What it does:** Parses `$.params` (selected row sIds) and `$.changeValue` (textareaValue + per-column edits keyed by `valueKey`). Walks `valueKey` (comma-separated column list) to splice a dynamic `SET col1=$[0].col1, col2=$[0].col2, ...` clause, then appends `iTestResult=2, sExceptionMemo=`. For each selected `sId`, runs `PREPARE` + `EXECUTE` on `Update qlyproducttestmaster Set ... Where sId=? AND sBrandsId=? AND sSubsidiaryId=?`. + +**Invocation:** Standard `Sp__BtnRepair*` slot — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` when the 产品检验 grid's Repair button names this procedure. xly-src ships `script/标版/30100101/Sp_ProductInspection_BtnRepair.sql`. No form-master, gdsmodule hook, or other-proc reference — name lives on the button definition. diff --git a/en/docs/auto-catalog/procedures/Sp_ProductProcess.md b/en/docs/auto-catalog/procedures/Sp_ProductProcess.md index 4141e52..b51a164 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductProcess.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductProcess.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 — sales-side helper that resolves a 销售订单 by `sBillNo` and flags every slave line as stock-up complete. Signature (`sSrcNo, sBrId, sSuId, …`) does not match the generic `BtnEvent` dispatch shape (it lacks `sProInParam`/`sMakePerson`), so it has to be called from another stored proc, not directly from the BtnEvent generic-dispatcher. + +**What it does:** `SELECT sId INTO p_sId FROM salsalesordermaster WHERE sBillNo=sSrcNo AND sBrandsId=sBrId AND sSubsidiaryId=sSuId; UPDATE salsalesorderslave SET bStockupComplete=1 WHERE sParentId=p_sId AND tenant matches`. No state checks, no syslog row, no return code logic beyond the initial `IFNULL` guards. + +**Invocation:** Status: appears orphaned. No caller in `gdsmodule` hooks, `gdsconfigformmaster` form-master columns, other stored procs/functions, or the xly-src tree (only its own install script `script/标版/30100101/Sp_ProductProcess.sql` references the name). The companion `Sp_ProductProcess_BtnEventProductProcess` duplicates the same body in BtnEvent-compatible packaging. Candidate for maintainer audit — likely superseded. diff --git a/en/docs/auto-catalog/procedures/Sp_ProductProcessPack.md b/en/docs/auto-catalog/procedures/Sp_ProductProcessPack.md index fdaf327..6147758 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductProcessPack.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductProcessPack.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 / 备货流程 — increments the per-package "已备货" counter on a sales-order line (`salsalesorderslave`), one click per package. Used by warehouse pickers when a sales-order line is packed in trunks/packages and progress is logged package-by-package rather than marked complete in one shot. + +**What it does:** Parses `$.params[*].value[*].sSlaveId` from `sProInParam`. Per slave id, if `dReturnTrunkQty + 1 > dTrunkQty` it ignores the click; otherwise it `UPDATE salsalesorderslave SET dReturnTrunkQty = dReturnTrunkQty + 1`, then returns a status string `总共N包,剩余M包` in `sReturn`. After incrementing, if the remaining count reaches 0 it sets `bStockupComplete = 1` to mark the line fully prepared. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — bound to a per-package "+1" toolbar/grid button on the 备货 (stockup) flow of the sales-order grid. Bulk-complete sibling: `Sp_ProductProcessPackAll`. xly-src ships `script/标版/30100101/Sp_ProductProcessPack.sql` (install script). diff --git a/en/docs/auto-catalog/procedures/Sp_ProductProcessPackAll.md b/en/docs/auto-catalog/procedures/Sp_ProductProcessPackAll.md index 1a4fd8e..e19edc5 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductProcessPackAll.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductProcessPackAll.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 / 备货流程 — bulk-finishes the 备货 (stockup) tally for one or more sales-order lines, marking each as fully prepared in a single click. Sibling of the per-package `Sp_ProductProcessPack`: where that proc increments package-by-package, this one is the "mark all packages done" shortcut. + +**What it does:** Parses `$.params[*].value[*].sSlaveId` from `sProInParam`. For each slave id, executes `UPDATE salsalesorderslave SET dReturnTrunkQty = dTrunkQty, bStockupComplete = 1` scoped to the current brand/subsidiary. No validation or message. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — bound to a "全部备货" / "标记完成" button on the sales-order 备货 grid. Paired with the per-package counter `Sp_ProductProcessPack`. Install script ships at `script/标版/30100101/Sp_ProductProcessPackAll.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_ProductProcessWorkOrder.md b/en/docs/auto-catalog/procedures/Sp_ProductProcessWorkOrder.md index e9f300c..00e547b 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductProcessWorkOrder.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductProcessWorkOrder.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 / 备货流程 — promotes the stockup state on a 印刷工单 (`mftworkordermaster`) to "已备货" and back-writes the same flag onto every sales-order line (`SalSalesOrderSlave`) that drove the work-order's slave rows. Used when packaging the printed product against a work-order rather than directly against a sales-order line. + +**What it does:** Parses `$.params[*].value[*].sSlaveId` from `sProInParam` (each value here is a work-order master sId). Per id: `UPDATE mftworkordermaster SET sStockup = '1'`, then `UPDATE SalSalesOrderSlave A SET bStockupComplete = 1 WHERE EXISTS (SELECT 1 FROM MftWorkOrderSlave B WHERE B.sSrcSlaveId = A.sId AND B.sParentId = p_sId)` — so every sales-order line that this work-order consumed is flipped to "备货完成" in one shot. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — bound to a "备货完成" toolbar button on the 印刷工单 备货 grid. Install script ships at `script/标版/30100101/Sp_ProductProcessWorkOrder.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_ProductProcess_BtnEventProductProcess.md b/en/docs/auto-catalog/procedures/Sp_ProductProcess_BtnEventProductProcess.md index ebc1d57..62c6220 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductProcess_BtnEventProductProcess.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductProcess_BtnEventProductProcess.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 — sales-side helper that marks every line of a 销售订单 as stock-up complete given the order's `sBillNo`. The `_BtnEvent_` naming suggests intent to wire it to a toolbar button, but the parameter signature (`sSrcNo, sBrId, sSuId, …`) keeps `sSrcNo` rather than the generic `sProInParam`/`sMakePerson` shape, so the standard `GenericProcedureCallServiceImpl` dispatch path does not apply. + +**What it does:** `SELECT sId INTO p_sId FROM salsalesordermaster WHERE sBillNo=sSrcNo AND sBrandsId=sBrId AND sSubsidiaryId=sSuId; UPDATE salsalesorderslave SET bStockupComplete=1 WHERE sParentId=p_sId AND tenant matches`. Identical body to `Sp_ProductProcess`. + +**Invocation:** Status: appears orphaned. No caller in `gdsmodule` hooks, `gdsconfigformmaster` form-master columns, other stored routines, or the xly-src tree. Companion: `Sp_ProductProcess` (identical body, no install script for this variant). Candidate for maintainer audit — looks like an aborted rename/refactor. diff --git a/en/docs/auto-catalog/procedures/Sp_ProductReceipt.md b/en/docs/auto-catalog/procedures/Sp_ProductReceipt.md index 1e72167..23e0130 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductReceipt.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductReceipt.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 / 备货流程 — marks a sales-order master (`Salsalesordermaster`) as 已发货 (or "出厂受理") and stamps the dispatcher's name and timestamp. The "shipment received by dispatcher" gate on the sales-order: typically clicked when the stockup is complete and the goods are handed off to logistics. + +**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam`. For each master id: `UPDATE Salsalesordermaster SET sStockup = '3', sSend = sMakePerson, tSend = SYSDATE()`. No back-write to the slave rows or notification chain — purely a master-row state flip. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — bound to a "发出/确认收货" button on the sales-order 备货 grid. Install script ships at `script/标版/30100101/Sp_ProductReceipt.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_ProductStoreVirtual.md b/en/docs/auto-catalog/procedures/Sp_ProductStoreVirtual.md index a170b5b..471d146 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductStoreVirtual.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductStoreVirtual.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 印件 / 虚拟库存 — rebuilds the virtual-stock projection table `PitProductStoreVirtual` for the bills passed in `sGuid` (comma-separated). "Virtual stock" is the qty that *will* be available once the upstream bill (sales order, work order, in-store, or delivery-notify) is delivered/completed. Used by the 印件 delivery flow to show planners "how much do we owe customers vs. how much is on its way". + +**What it does:** Reads `CbxDeliverGoods` and `CbxDeliverGoodsNotify` from `SysSystemSettings` to pick the source mode. Splits `sGuid` into a temp `p_t_sId`. Deletes prior `PitProductStoreVirtual` rows for those bills. Depending on the source (`salesorder` / `workorder` / `productinstore` / `delivernotify` with sub-mode `salesorder` or work-order-joined), inserts new rows computed as `dProductQty + dGiveQty - dDeliverQty` (or the corresponding delivered/in-store sum) joined to `SalSalesOrderSlave` and `salsalesordermaster`, skipping rows already `bDeliverComplete=1`. Finally deletes virtual rows with `dProductQty <= 0`. + +**Invocation:** Called from at least eight other procs in the audit/calc family: `Sp_Calc_sDevApply`, `Sp_Calc_sDgd` (送货单), `Sp_Calc_sDgdCL`, `Sp_Calc_sDgd_1226`, `Sp_Calc_sDgd_20250612`, `Sp_Calc_sDYDgd`, `Sp_Calc_sScd`, `Sp_Calc_sSod` (销售订单) — i.e. every audit/un-audit of an order/work-order/delivery refreshes the virtual stock for the affected bills. Install script ships at `script/标版/30100101/Sp_ProductStoreVirtual.sql` plus a 高旺-customer variant `script/客户/高旺/20211101成品库存多单位/Sp_ProductStoreVirtual.sql` — verify which is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Product_BeforeUpdate.md b/en/docs/auto-catalog/procedures/Sp_Product_BeforeUpdate.md index fc4fef1..2b6332c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Product_BeforeUpdate.md +++ b/en/docs/auto-catalog/procedures/Sp_Product_BeforeUpdate.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 产品管理 → 产品档案及SOP → 产品信息 (`eleproduct`) — save hook on the 产品信息 record (proc COMMENT: "产品保存前过程", but bound on `sSaveProName` which fires post-save). When a product is created from a quotation (`quoquotationslave.sId` lives in `eleproduct.sSrcSlaveId`), this proc back-stitches the new product into the source quotation rows and patches a few defaults so the product is internally consistent. + +**What it does:** Reads `sSrcSlaveId` and `sProductNo` for the saved product. Updates `quoquotationslave` (joined to `eleproduct` on `sSrcSlaveId`) — rewrites `sProductId`, `sProductName`, `sProductClassifyId=sParentId`, clears `sProductInfo` for every slave that points at this product. Then updates `quoquotationcontrol` (joined transitively): `REPLACE(sCombinedMemo, oldProductNo, newProductNo)` so the combined-memo text still refers to the right product code. Sets `eleproduct.sParentProductId=1` when an `eleproductchild` row exists for this id (marks composite parents), and back-fills `sProductVer='V01'` when blank. + +**Invocation:** Bound on `gdsmodule.sSaveProName = 'Sp_Product_BeforeUpdate'` for `产品信息` (`sId 11811781131121915159873080990`) under 产品档案及SOP → 产品管理 — runs after every save of an `eleproduct` row. Java path: `BusinessBaseServiceImpl` consults `gdsmodule.sSaveProName` post-save. Install script `xly-src/script/标版/30100101/Sp_Product_BeforeUpdate.sql` is the source of truth. Note the name says "BeforeUpdate" but the binding is post-save — the proc is named for intent, not for the hook column. diff --git a/en/docs/auto-catalog/procedures/Sp_Product_BtnEventCheck.md b/en/docs/auto-catalog/procedures/Sp_Product_BtnEventCheck.md index e347b6c..5b302a1 100644 --- a/en/docs/auto-catalog/procedures/Sp_Product_BtnEventCheck.md +++ b/en/docs/auto-catalog/procedures/Sp_Product_BtnEventCheck.md @@ -1,7 +1,7 @@ # `Sp_Product_BtnEventCheck` (procedure) -> @author:杨恒林 - @date:20210521 封存 +> @author:杨恒林 + @date:20210521 封存 @describe: 在库存商品价值表界面,计算当前库存价格 @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本管理 — legacy 在库存商品价值表 "calculate current inventory price" button. Header comment marks it `@date:20210521 封存` (sealed/deprecated 2021-05-21); modern flows use `Sp_System_CalcProductPrice` directly through the cost-period closing pages. + +**What it does:** Looks up the current open `sysaccountperiod` row for `(sBrId, sSuId)` whose `tStartDate..tEndDate` window covers today, then `CALL Sp_System_CalcProductPrice(p_tStart, p_tEnd, 0, sMakePerson, sBrId, sSuId, @sReturn, @sCode)` to recompute moving-average product prices for that month. No JSON-row iteration — it ignores `sProInParam`. + +**Invocation:** Standard `Sp__BtnEvent*` slot — would have been dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()`. xly-src ships `script/标版/30100101/cost/Sp_Product_BtnEventCheck.sql`; no surviving form-master, gdsmodule hook, or other proc references the name today — effectively orphaned after the 2021-05 sealing. Maintainer audit candidate. diff --git a/en/docs/auto-catalog/procedures/Sp_ProductionDepartmentsReports.md b/en/docs/auto-catalog/procedures/Sp_ProductionDepartmentsReports.md index be009b6..8bb2787 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductionDepartmentsReports.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductionDepartmentsReports.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 / 生产报表 — production output report grouped by 工序分类 / 工序 (process classification / process), showing today's and the current month's output qty, edition count, and machine-hours per process. The page header carries the unrelated label "现金日记帐" — a copy-paste leftover; the body and joins are entirely production-side, not finance. + +**What it does:** Builds temp table `SAS` keyed by `(sProcessClassifyId, sProcessId)`, seeded from `viw_mftproductionreport` joined to `eleprocess` and `sisprocessclassify`. Calls `Sp_Do_UpdateByPageSizeBefore` for paging/filter/groupby plumbing. Two follow-up updates: today's totals (`DATE_FORMAT(tCheckDate,'%m-%d-%Y')=NOW()`) and this month's totals (`'%m-%Y'`) — each summing `dProductQty`, `iStick` (edition qty from `mftproductionplanslave`), and `dHour` per `sProcessId`. Returns `SELECT * FROM SAS`. + +**Invocation:** Customer-specific report — xly-src ships only `script/客户/千彩/Sp_ProductionDepartmentsReports.sql` (the 千彩 tenant variant). No live form-master, gdsmodule hook, or other-proc reference in `xlyweberp_saas_ai`. The standard form-data-source binding would live on a tenant `gdsconfigformmaster.sSqlStr` — verify on the 千彩 deployment before relying on it on a standard install. Note the spurious `select * from xlyweberp.sisprocessclassify;` mid-body which leaks a cross-schema reference. diff --git a/en/docs/auto-catalog/procedures/Sp_ProductionMaterials_BtnEventConfirm.md b/en/docs/auto-catalog/procedures/Sp_ProductionMaterials_BtnEventConfirm.md index 22d861f..aae284d 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductionMaterials_BtnEventConfirm.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductionMaterials_BtnEventConfirm.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 作业工单管理 — line-level "确认 / Confirm" on the work-order material requirements (`mftworkordermaterials`). Marks individual BOM/raw-material lines as confirmed by the operator so downstream picking and outsourcing flows can rely on them. + +**What it does:** Walks `$.params[*].value[*].sSlaveId` from `sProInParam`. For each slave id: `UPDATE mftworkordermaterials SET bConfirm=1, tConfirmDate=NOW(), sConfirmPerson=sMakePerson WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. No validation, no back-write — pure flag flip. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — wired as the 确认 toolbar button on the 生产工单 material-detail grid. No xly-src install script ships for this proc; DB-only — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_ProductionOrder_CancelRransmit.md b/en/docs/auto-catalog/procedures/Sp_ProductionOrder_CancelRransmit.md index f4c3310..7c73b6d 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductionOrder_CancelRransmit.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductionOrder_CancelRransmit.md @@ -1,7 +1,7 @@ # `Sp_ProductionOrder_CancelRransmit` (procedure) -> @author:zhucx - @date: 2022/12/02 +> @author:zhucx + @date: 2022/12/02 @describe: 生产订单明细-取消生产订单 @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 订单生产流程 → 销售订单->生产工单 — 生产订单明细 toolbar action 取消生产订单 ("cancel transmit"). Reverses a 下达 (release-to-production) on a sales-order slave row, freeing the released qty back to the pool — but only when no work-order has been generated yet. + +**What it does:** Walks `$.params[*].value[*].sSlaveId`. For each `salsalesorderslave.sId`, looks up `viw_mftworkorder.sBillNo` filtered to `bInvalid=0 AND sSrcSlaveId=p_sId`; if a non-invalidated work order exists, aborts with `Fun_Sis_GetConst('sWorkOrderExistNeedZf')` plus the bill number. Otherwise: if no `mftworkorderslave` rows reference the slave, resets `iFlowState=1, bProductionOrder=0, bNotProductionOrder=0`; then resets `dThisUseStockQty=0, dThisReleaseQty=0, dReleaseQty=dWorkOrderQty, dUseStockQty=0`; finally `DELETE FROM salsalesproductionordervirtual WHERE sBillSlaveId=p_sId` to clear the virtual stock reservation. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — toolbar button on the 销售订单->生产工单 detail grid. xly-src ships `script/标版/30100101/schedule/Sp_ProductionOrder_CancelRransmit.sql` (install script only). diff --git a/en/docs/auto-catalog/procedures/Sp_ProductionOrder_NoRransmit.md b/en/docs/auto-catalog/procedures/Sp_ProductionOrder_NoRransmit.md index e27110e..f14623a 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductionOrder_NoRransmit.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductionOrder_NoRransmit.md @@ -1,7 +1,7 @@ # `Sp_ProductionOrder_NoRransmit` (procedure) -> @author:zhucx - @date:2022-11-30 +> @author:zhucx + @date:2022-11-30 @describe: 销售订单-生产订单, 无需生产 @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 订单生产流程 → 销售订单->生产工单 — 无需生产 toolbar action. Marks a sales-order slave row as "no production needed" (typically because the item is supplied from stock or as a service-only line) so it gets skipped by 排程/工单 generation. + +**What it does:** Walks `$.params[*].value[*].sSlaveId`. For each `salsalesorderslave.sId`, joins `viw_salsalesorder` to fetch `sMakePerson`; if `sMakePerson <> sMakePerson` input, aborts with `Fun_Sis_GetConst('sNotMakePerson')` (非制单人不能进行操作). Otherwise `UPDATE salsalesorderslave SET bNotProductionOrder=1, tProductionOrder=SYSDATE(), sProductionOrder=sMakePerson, dAuxiliaryQty=0 WHERE sId=p_sId`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — toolbar button on the 销售订单->生产工单 detail grid (paired with `Sp_ProductionOrder_NoRransmitReturn` for undo). xly-src ships `script/标版/30100101/schedule/Sp_ProductionOrder_NoRransmit.sql` (install script only). diff --git a/en/docs/auto-catalog/procedures/Sp_ProductionOrder_NoRransmitReturn.md b/en/docs/auto-catalog/procedures/Sp_ProductionOrder_NoRransmitReturn.md index 93d6c47..73c43b0 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductionOrder_NoRransmitReturn.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductionOrder_NoRransmitReturn.md @@ -1,7 +1,7 @@ # `Sp_ProductionOrder_NoRransmitReturn` (procedure) -> @author:zhucx - @date:2022-11-30 +> @author:zhucx + @date:2022-11-30 @describe: 销售订单-生产订单, 无需生产返还 @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 订单生产流程 → 销售订单->生产工单 — 无需生产返还 toolbar action. Inverse of `Sp_ProductionOrder_NoRransmit`: re-enrols a sales-order slave row back into the production flow after it was previously marked "no production needed". + +**What it does:** Walks `$.params[*].value[*].sSlaveId`. For each `salsalesorderslave.sId`, `UPDATE salsalesorderslave SET bProductionOrder=0, bNotProductionOrder=0, tProductionOrder=SYSDATE(), sProductionOrder=sMakePerson, dAuxiliaryQty=0 WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. No validation — straight flag clear. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — toolbar button on 销售订单->生产工单, paired with `Sp_ProductionOrder_NoRransmit`. No xly-src install script under this name; DB-only — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_ProductionOrder_OutSide.md b/en/docs/auto-catalog/procedures/Sp_ProductionOrder_OutSide.md index ee386b6..f5a13b0 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductionOrder_OutSide.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductionOrder_OutSide.md @@ -1,7 +1,7 @@ # `Sp_ProductionOrder_OutSide` (procedure) -> @author:zhucx - @date: 2022/12/02 +> @author:zhucx + @date: 2022/12/02 @describe: 销售订单-生产订单,发外加工按钮 @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 订单生产流程 → 销售订单->生产工单 — 发外加工 toolbar action. Flags a sales-order slave row for outsourced production (whole-bill outsourcing, not per-process), which lets the downstream 发外加工流程 pick it up instead of generating an in-house 生产工单. + +**What it does:** Walks `$.params[*].value[*].sSlaveId`/`dRequiredQty`. For each `salsalesorderslave.sId`, `UPDATE salsalesorderslave SET bOutside=1, bProductionOrder=1, tProductionOrder=SYSDATE(), sProductionOrder=sMakePerson, dAuxiliaryQty=p_dRequireQty, dReleaseQty=dProductQty WHERE sId=p_sId`. (The commented-out block earlier in the body — checking 生产工单已经生成 — is disabled, so it does NOT refuse when a work order already exists.) + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — 发外加工 toolbar button on 销售订单->生产工单. Inverse: `Sp_ProductionOrder_ReturnOutSide`. No xly-src install script under this name; DB-only — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_ProductionOrder_PrepareMaterials.md b/en/docs/auto-catalog/procedures/Sp_ProductionOrder_PrepareMaterials.md index 94d4a2d..b326eab 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductionOrder_PrepareMaterials.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductionOrder_PrepareMaterials.md @@ -1,7 +1,7 @@ # `Sp_ProductionOrder_PrepareMaterials` (procedure) -> @author:zhucx - @date: +> @author:zhucx + @date: @describe: @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 订单生产流程 → 销售订单->生产工单 — 备料 ("prepare materials") toolbar action. Marks selected sales-order slave rows as already material-prepared so picking/issuing flows can skip the upstream readiness check. + +**What it does:** Walks `$.params[*].value[*].sSlaveId`. For each `salsalesorderslave.sId`, `UPDATE salsalesorderslave SET bPrepareMaterials=1 WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. Single-flag write — no validation, no inverse handler in this proc, no back-write to BOM/stock. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — 备料 toolbar button on 销售订单->生产工单. xly-src ships `script/标版/30100101/schedule/Sp_ProductionOrder_PrepareMaterials.sql` (install script only; no Java caller). diff --git a/en/docs/auto-catalog/procedures/Sp_ProductionOrder_ReturnOutSide.md b/en/docs/auto-catalog/procedures/Sp_ProductionOrder_ReturnOutSide.md index 86a4734..0c25180 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductionOrder_ReturnOutSide.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductionOrder_ReturnOutSide.md @@ -1,7 +1,7 @@ # `Sp_ProductionOrder_ReturnOutSide` (procedure) -> @author:zhucx - @date: 2022/12/02 +> @author:zhucx + @date: 2022/12/02 @describe: 生产订单-成品外购,返回重排按钮 @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 订单生产流程 → 销售订单->生产工单 — 返回重排 ("return / re-schedule") toolbar action for whole-bill outsourcing rows. Reverses `Sp_ProductionOrder_OutSide`, sending the slave row back into in-house production scheduling — but refuses to do so for products whose master record (`eleproduct.iOutSide=1`) is configured as inherently outsourced. + +**What it does:** Walks `$.params[*].value[*].sSlaveId`. For each `salsalesorderslave.sId`, checks `EXISTS (SELECT 1 FROM salsalesorderslave a JOIN eleproduct b ON a.sProductId=b.sId WHERE a.sId=p_sId AND b.iOutSide=1)`; if so, aborts with `Fun_Sis_GetConst('sProductionOrderProductHaveData')` (产品内置属性,无需返回重排). Otherwise `UPDATE salsalesorderslave a LEFT JOIN eleproduct b ON a.sProductId=b.sId SET a.bOutside=0, a.bProductionOrder=0, a.tProductionOrder=SYSDATE(), a.sProductionOrder=sMakePerson, a.dAuxiliaryQty=0 WHERE b.iOutSide=0 AND a.sId=p_sId`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — 返回重排 toolbar button on 销售订单->生产工单. xly-src ships `script/标版/30100101/Sp_ProductionOrder_ReturnOutSide.sql` (install script only; no Java caller). diff --git a/en/docs/auto-catalog/procedures/Sp_ProductionOrder_Rransmit.md b/en/docs/auto-catalog/procedures/Sp_ProductionOrder_Rransmit.md index 443a98d..d261838 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductionOrder_Rransmit.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductionOrder_Rransmit.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 订单生产流程 → 销售订单->生产工单 — 下达 ("transmit / release-to-production") toolbar action with use-stock and partial-release semantics. The most loaded action in the production-order family: splits a sales-order line into "use from stock" + "release for production" amounts, validates each against the 余数库 buffer, and updates the virtual reservation. + +**What it does:** Reads `$.params[*].value[*].sSlaveId/dRequiredQty` plus `$.changeValue[*].dThisReleaseQty/dThisUseStockQty/valueKey`. For each row: refuses with `Fun_Sis_GetConst('sNotMakePerson')` when `viw_salsalesorder.sMakePerson <> sMakePerson`; refuses with `sRemainStockCantExceedXd` when `dThisUseStockQty > dThisReleaseQty + dGiveQty`; computes `dStockProductQty` from `eleproductstock` JOIN `siswarehouse WHERE bRemainder=1` minus `salsalesproductionordervirtual.dProductQty` and refuses (`sYsStockCantUpYsStore`) if exceeded; refuses (`sTotalXdCantUpOrderNum`) when total release exceeds order qty. Then `UPDATE salsalesorderslave SET dUseStockQty+=dThisUseStockQty, dReleaseQty+=dThisReleaseQty, dThisUseStockQty/dThisReleaseQty=new, tProductionOrder=SYSDATE(), sProductionOrder=sMakePerson`, then `iFlowState=2, bProductionOrder=1` where still not released, finally `CALL Sp_salsalesorderVirtual(p_sId, sBrId, sSuId)` to refresh the virtual-reservation table. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — 下达 toolbar button on 销售订单->生产工单. Inverse: `Sp_ProductionOrder_CancelRransmit`. xly-src ships `script/标版/30100101/schedule/Sp_ProductionOrder_Rransmit.sql` (install script only; no Java caller). diff --git a/en/docs/auto-catalog/procedures/Sp_ProductionReport_BtnEventComplete.md b/en/docs/auto-catalog/procedures/Sp_ProductionReport_BtnEventComplete.md index 795c0b8..bbeeaed 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductionReport_BtnEventComplete.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductionReport_BtnEventComplete.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 移动端管理 → 现场 → 功能操作 → 内部报工 (and 发外报工) — "强制完工" (force-complete) toolbar handler on production-report rows. Lets a supervisor close a `mftworkorderprocess` or `mftproductionplanslave` row when the operator hasn't (or can't) submit further `mftproductionreport*` qty, with a permanent `syscomplete` audit row recording who, when, and why. + +**What it does:** Walks `sProInParam.params[*].value[*].sSlaveId`. Reads `SysSystemSettings.CbxProductionReport` into `@p_sType`. Branch (a) — if `'workorder'` (生产工单 mode): `Update mftworkorderprocess SET bProductionReportComplete=1` for the slave id and `INSERT INTO syscomplete(... 'mftworkorderprocess','bProductionReportComplete')` via `viw_mftworkorderprocess`. Branch (b) — otherwise (生产排程 mode): updates `mftproductionplanslave SET bProductionReportComplete=1, tProductionReportDate=NOW(), sProductionReportPerson=sMakePerson`, propagates the same flag to `mftworkorderprocess` via `sSrcSlaveId`, and writes two `syscomplete` rows (plan-slave and work-order-process) keyed by `Fun_Sis_GetConstNew(...,'sForceComplete',...)` operation type. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — 报工 form's "强制完工" button names this proc as `sproName`. xly-src ships `script/标版/30100101/Sp_ProductionReport_BtnEventComplete.sql`. The sample JSON `{"sproName":"Sp_ProductionReport_BtnEventComplete","inMap":"slave.sSlaveId","orderBy":"{'gdsconfigformslave':'ORDER BY iOrder ASC '}"}` appears as a doc-comment in `CalcProcedureServiceImpl.getAddSql()` illustrating the button-param shape. diff --git a/en/docs/auto-catalog/procedures/Sp_ProductionReport_BtnEventConfirm.md b/en/docs/auto-catalog/procedures/Sp_ProductionReport_BtnEventConfirm.md index 0cb9746..ae6c5db 100644 --- a/en/docs/auto-catalog/procedures/Sp_ProductionReport_BtnEventConfirm.md +++ b/en/docs/auto-catalog/procedures/Sp_ProductionReport_BtnEventConfirm.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 移动端管理 → 现场 → 功能操作 → 内部报工 (and 发外报工) — "确认" (confirm) toolbar handler that signs off a production-report slave row. Stamps `bConfirm=1`, `tConfirmDate`, and `sConfirmPerson` on both the work-order process row and the matching production-plan slave row so downstream reports treat the data as supervisor-approved. + +**What it does:** Walks `sProInParam.params[*].value[*].sSlaveId`. For each `p_sId`: `Update mftworkorderprocess P INNER JOIN mftproductionplanslave S ON P.sId=S.sSrcSlaveId SET P.bConfirm=1, P.tConfirmDate=NOW(), P.sConfirmPerson=sMakePerson, S.bConfirm=1, S.tConfirmDate=NOW(), S.sConfirmPerson=sMakePerson WHERE S.sId=p_sId AND tenant matches`, then a follow-up `Update mftproductionplanslave SET bConfirm=1, tConfirmDate=NOW(), sConfirmPerson=sMakePerson WHERE sId=p_sId` to cover the case where no `mftworkorderprocess` join row exists. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — 报工 form's "确认" button. No xly-src install file found. Companion: `Sp_ProductionReport_BtnEventComplete` (force-complete on the same form). diff --git a/en/docs/auto-catalog/procedures/Sp_Productionplan_Pie_Char.md b/en/docs/auto-catalog/procedures/Sp_Productionplan_Pie_Char.md index d8accac..ff0f994 100644 --- a/en/docs/auto-catalog/procedures/Sp_Productionplan_Pie_Char.md +++ b/en/docs/auto-catalog/procedures/Sp_Productionplan_Pie_Char.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产计划管理 → 生管主计划 — 生成计划:卡片图 (per the COMMENT). Dashboard data-source for the per-工作中心 load-card chart on the 生产计划 page: each 工作中心 returns its planned-quantity sum, current hours, next-day hours, capacity baseline, and a normalised load ratio used to colour the card. + +**What it does:** Resolves `SysSystemSettings.CkxProcessFilter` and (if enabled) the user's `Fun_GetLookProcess(...)` 工序 whitelist via `SftLoginInfo`. Builds `Productionplan_Pie_Char_Tmp` (sWorkCenterId, iPlanSum, dHourSum, d2HourSum, dStdWorkCenterHour, sLimitDate, iLimitColor, dRate). Composes a dynamic INSERT from `mftproductionplanslave P` with the active-state and frozen filters, GROUPed by `P.sWorkCenterId`. Then joins `elemachine` + `sisworkcenter` to derive each 工作中心's standard `dStdWorkCenterHour`, computes `sLimitDate` via `DATE_ADD(SYSDATE, INTERVAL dHourSum/std DAY)` and `dRate = d2HourSum / std`. Picks the highest-load 工作中心 as the warning row (`iLimitColor=1`) and returns JSON `{ data: [...], subTitle, yUnit }` in `sReturn`. + +**Invocation:** No live `gdsconfigcharmaster` binding for this name and only the install-script reference in xly-src — Status: appears orphaned. Currently superseded by `Sp_Productionplan_Pie_Char_V10.1` (same purpose, refactored body) which itself is also unbound in the live config tables. Both candidates for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Productionplan_Pie_Char_V10.1.md b/en/docs/auto-catalog/procedures/Sp_Productionplan_Pie_Char_V10.1.md index 4c1ce9e..3064c8f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Productionplan_Pie_Char_V10.1.md +++ b/en/docs/auto-catalog/procedures/Sp_Productionplan_Pie_Char_V10.1.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产计划管理 → 生管主计划 — 生成计划:卡片图 (per the COMMENT). V10.1 successor of `Sp_Productionplan_Pie_Char`: per-工作中心 load-card data-source. Adds an extra "发外" pseudo-row built from `Viw_OpsOutsideProcess` to surface outsourced work as its own card in the dashboard. + +**What it does:** Same setup as the V10 sibling — read `CkxProcessFilter`, resolve user via `SftLoginInfo`, apply `Fun_GetLookProcess` whitelist. Builds `Productionplan_Pie_Char_Tmp` and inserts the dynamic GROUP-by-`sWorkCenterId` aggregation over `mftproductionplanslave` (planned qty, dHourSum, d2HourSum for today/tomorrow window). Joins `elemachine`+`sisworkcenter` for the `dStdWorkCenterHour` baseline, computes `sLimitDate`/`dRate`, flags the most-loaded 工作中心 as warning. Emits the JSON `{ data, subTitle:'工时', yUnit }` then `INSERT` an additional "发外" row aggregating `Viw_OpsOutsideProcess.dAuxiliaryQty` (where `bCopyLimit=0, bCheck=1, bInstoreComplete=0, bInvalid=0`) and orders by `sisworkcenter.iOrder`. Returns the table via final `SELECT * FROM Productionplan_Pie_Char_Tmp ORDER BY iOrder`. + +**Invocation:** Not bound in `gdsconfigcharmaster`/`gdsconfigcharmaster0302`; no xly-src caller — Status: appears orphaned. Likely the staged replacement for `Sp_Productionplan_Pie_Char` not yet wired into the dashboard config. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Productionplan_Pie_Char_old.md b/en/docs/auto-catalog/procedures/Sp_Productionplan_Pie_Char_old.md index de90454..844a9fb 100644 --- a/en/docs/auto-catalog/procedures/Sp_Productionplan_Pie_Char_old.md +++ b/en/docs/auto-catalog/procedures/Sp_Productionplan_Pie_Char_old.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_Productionplan_Pie_Char` (`_old` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_Productionplan_Pie_Char` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Productionplan_sColumnarStack_Char.md b/en/docs/auto-catalog/procedures/Sp_Productionplan_sColumnarStack_Char.md index cf5e257..d2517c4 100644 --- a/en/docs/auto-catalog/procedures/Sp_Productionplan_sColumnarStack_Char.md +++ b/en/docs/auto-catalog/procedures/Sp_Productionplan_sColumnarStack_Char.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产计划管理 → 生管主计划 — 生成计划:叠状柱形图 (per the COMMENT). Dashboard data-source for the stacked-column chart showing each 机台 / 工作中心's planned-hour load split by state (已下达 / 已排程 / 已暂停 / 未排程). Handles a special "0000000000" filter token to switch to a 发外 (outsourced) view sourced from `opsoutsideprocessslave`. + +**What it does:** Builds `Productionplan_sColumnarStack_Char_Tmp` (sMachineId, sFormId, sMachineName, dHourSum, sState, sStateName, iOrder). If `bFilter` contains `0000000000`: inserts a single 发外 series from `opsoutsideprocessslave O JOIN eleprocess P JOIN sisworkcenter W` grouped by `P.sWorkCenterId`. Otherwise resolves a 未排程机台 sFormId by joining `eleprocess`/`sisprocessclassify`/`sisworkcenter`/`eleprocessmachine`/`elemachine`, then inserts the 未排程 series from `mftproductionplanslave WHERE sState=0 AND sMachineId=''` and the 已排程/已下达/已暂停 series grouped by `(PL.sMachineId, PL.sState)`. Applies the machine's standard work-hour basis (`b.dWeek * sWorkType`) to normalise dHourSum, then iterates the state cursor (5/4/3/1) to compose the JSON `{ data:[{name, sState, , sMachineId}], fields:[...], xName:'机台名称', yName:'总时间' }`. + +**Invocation:** Not bound in `gdsconfigcharmaster`/`gdsconfigcharmaster0302`; only the install script in xly-src — Status: appears orphaned. Superseded by `Sp_Productionplan_sColumnarStack_Char_V10.1` which is also unbound. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Productionplan_sColumnarStack_Char_V10.1.md b/en/docs/auto-catalog/procedures/Sp_Productionplan_sColumnarStack_Char_V10.1.md index b43132c..40d03ba 100644 --- a/en/docs/auto-catalog/procedures/Sp_Productionplan_sColumnarStack_Char_V10.1.md +++ b/en/docs/auto-catalog/procedures/Sp_Productionplan_sColumnarStack_Char_V10.1.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产计划管理 → 生管主计划 — 生成计划:叠状柱形图 (per the COMMENT). V10.1 successor of `Sp_Productionplan_sColumnarStack_Char`: same per-机台 load-by-state stacked-column data-source. Includes the `bFilter='0000000000'` switch that surfaces outsourced work via `opsoutsideprocessslave`. + +**What it does:** Builds `Productionplan_sColumnarStack_Char_Tmp` (slightly slimmer schema than the V10 sibling — no `sFormId`). If `0000000000` filter: inserts the 发外 series joining `opsoutsideprocessslave/eleprocess/sisworkcenter` grouped by `sWorkCenterId`. Otherwise inserts the 未排程 row (`sState='5'`, `sMachineId='00000000'`) and the 已排程/已下达/已暂停 rows from `mftproductionplanslave` grouped by `(sMachineId, sState)`. Normalises dHourSum by `(b.dWeek * sWorkType)` from `elemachine`, picks up `iOrder` from `elemachine.iOrder`, then iterates state codes 1–5 building the same JSON `{ data, fields, xName, yName }` payload — with the `sType:'opsOutSide'` marker added when the outsourced filter was active. Returns via `SELECT p_sReturn AS sCharData`. + +**Invocation:** Not bound in `gdsconfigcharmaster`/`gdsconfigcharmaster0302`; no xly-src caller — Status: appears orphaned. Likely a staged replacement waiting on dashboard re-wiring. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Productionplan_sColumnarStack_Char_old.md b/en/docs/auto-catalog/procedures/Sp_Productionplan_sColumnarStack_Char_old.md index 7f28e2c..c3706be 100644 --- a/en/docs/auto-catalog/procedures/Sp_Productionplan_sColumnarStack_Char_old.md +++ b/en/docs/auto-catalog/procedures/Sp_Productionplan_sColumnarStack_Char_old.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_Productionplan_sColumnarStack_Char` (`_old` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_Productionplan_sColumnarStack_Char` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_PurchasePrice.md b/en/docs/auto-catalog/procedures/Sp_PurchasePrice.md index 948fe67..3f22ebc 100644 --- a/en/docs/auto-catalog/procedures/Sp_PurchasePrice.md +++ b/en/docs/auto-catalog/procedures/Sp_PurchasePrice.md @@ -23,4 +23,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 → 采购分析报表 → 采购主材比例浮动报表 (form `101251240115016204641682560`) — paper-material price trend pivot. Returns one row per (`sMaterialsId`, `sParentId`) with one dynamically-added column per purchase-order date in the window, holding that day's `dMaterialsPrice`. Used to watch paper-price fluctuations. + +**What it does:** Builds temp `T` of `viw_purpurchaseorder` rows joined to `elematerials`/`sismaterialsclassify`, filtered to `bCheck=1 AND sMaterialsType='paper' AND tCreateDate ∈ (tStartDate, tEndDate)`. Distincts (`sMaterialsId`, `sParentId`) into temp `DT`. Then opens nested cursors: outer over materials, inner over the per-date price rows; for each date not yet seen, dynamic `ALTER TABLE DT ADD COLUMN 日期MMDD numeric(18,6)`, then `UPDATE DT SET 日期MMDD = price WHERE …`. Finally `SELECT * FROM DT` returns the wide pivot. + +**Invocation:** Bound as the data-source for form `101251240115016204641682560` (采购主材比例浮动报表) under 采购管理 → 采购分析报表 via `gdsconfigformmaster.sSqlStr`. Loaded when the user opens the report. Install script ships at `script/标版/30100101/Sp_PurchasePrice.sql`. + +Note: dynamic-column pivoting in MySQL is fragile; the proc fails silently if `DT` is concurrently used or if a date column already exists with a different type. Charting siblings: `Sp_PurchasePriceChar`, `Sp_PurchasePriceChart`. diff --git a/en/docs/auto-catalog/procedures/Sp_PurchasePriceChar.md b/en/docs/auto-catalog/procedures/Sp_PurchasePriceChar.md index ec9a9b3..f93b18d 100644 --- a/en/docs/auto-catalog/procedures/Sp_PurchasePriceChar.md +++ b/en/docs/auto-catalog/procedures/Sp_PurchasePriceChar.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 → 采购分析 — chart-side JSON producer for the paper-material price trend (sibling of `Sp_PurchasePrice` which returns a table). Emits an ECharts-style `{"data":[{"type":..., "x":..., "y":...}, ...], "xUnit":"", "yUnit":""}` payload in `sReturn`, one point per (material × purchase date), feeding a line-chart widget on the 采购分析 dashboard. + +**What it does:** Same paper-price filter as `Sp_PurchasePrice` — builds temp `T` from `viw_purpurchaseorder` joined to `elematerials`/`sismaterialsclassify` (`bCheck=1 AND sMaterialsType='paper'` in window). Distincts materials into `DT`, then nested cursors walk each material's (`tCreateDate`, `dMaterialsPrice`) tuples, dynamically ALTERing `DT` to add per-date columns *and* concatenating each `{type, x, y}` JSON object into `p_sText`. Wraps `p_sText` with the outer `data/xUnit/yUnit` envelope and returns it as `sReturn`. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep across all extensions). Likely the `Sp_Bd_*` dashboard variant of `Sp_PurchasePrice` referenced via `gdsconfigcharmaster.sProcedureName` for a chart slot, but no such row exists in the live DB — candidate for maintainer audit. Sibling: the slightly newer `Sp_PurchasePriceChart` which loops over `DT` without populating that temp table first (likely a bug). diff --git a/en/docs/auto-catalog/procedures/Sp_PurchasePriceChart.md b/en/docs/auto-catalog/procedures/Sp_PurchasePriceChart.md index 98e291f..3f5d6b7 100644 --- a/en/docs/auto-catalog/procedures/Sp_PurchasePriceChart.md +++ b/en/docs/auto-catalog/procedures/Sp_PurchasePriceChart.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 → 采购分析 — paper-material price trend chart procedure. Same intent as `Sp_PurchasePriceChar` but written before the JSON envelope was wired up: builds the wide pivot table `DT` for chart consumption without returning JSON in `sReturn`. + +**What it does:** Builds temp `T` from `viw_purpurchaseorder` joined to `elematerials`/`sismaterialsclassify` filtered to `bCheck=1 AND sMaterialsType='paper'` in the date window. Then opens a cursor over `DT` — but `DT` is never populated from `T` (the `CREATE TEMPORARY TABLE DT Select Distinct …` line present in the sibling `Sp_PurchasePriceChar` is missing here), so the cursor reads from an undeclared/empty `DT`. The nested loop dynamically ALTERs `DT` with per-date columns `t MMDD` and writes per-material prices, but with no rows the work is wasted. `sReturn` is left empty. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep across all extensions) — candidate for maintainer audit. The missing `DT` population makes this look like a broken/half-rewritten alternative to `Sp_PurchasePriceChar`; flag for deletion or repair. diff --git a/en/docs/auto-catalog/procedures/Sp_PurpurchaseOrder_CheckUpdate.md b/en/docs/auto-catalog/procedures/Sp_PurpurchaseOrder_CheckUpdate.md index a55c32d..036d520 100644 --- a/en/docs/auto-catalog/procedures/Sp_PurpurchaseOrder_CheckUpdate.md +++ b/en/docs/auto-catalog/procedures/Sp_PurpurchaseOrder_CheckUpdate.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 / 物料采购流程 → 采购订单 (module `192116810113315217757747140`) — pre-save helper that snapshots the original purchase price into `dOldMaterialsPrice` / `dOldMaterialsMoney` on every `purpurchaseorderslave` row of the order being saved, so downstream procs (and the user-visible "原价" column) keep the pre-edit price for audit. Despite the `_CheckUpdate` suffix and `COMMENT '采购订单保存校验'`, the body is back-write rather than validation. + +**What it does:** `UPDATE purpurchaseorderslave SET dOldMaterialsPrice = dMaterialsPrice WHERE sParentId = sGuid`, then `UPDATE purpurchaseorderslave SET dOldMaterialsMoney = ROUND(dOldMaterialsPrice * dMaterialsQty, 2) WHERE sParentId = sGuid`. Further blocks in the body handle approval-flow message dispatch (`p_sMsgId`, `p_sMakePersonGroupName`) — see body for the rest. + +**Invocation:** Called by `Sp_Check_sPod` (the audit check proc bound to the 采购订单 module via `gdsmodule.sSaveProName='Sp_Check_sPod'`, sId `192116810113315217757747140`). So this proc fires indirectly during save of a 采购订单 (`sFormId` matches the order form) via the standard POST-save Check chain dispatched by `BusinessBaseServiceImpl`. Not present in xly-src 30100101 install scripts — DB-only. diff --git a/en/docs/auto-catalog/procedures/Sp_QlyComeMaterialsJudge.md b/en/docs/auto-catalog/procedures/Sp_QlyComeMaterialsJudge.md index bda4e0e..51fb9c2 100644 --- a/en/docs/auto-catalog/procedures/Sp_QlyComeMaterialsJudge.md +++ b/en/docs/auto-catalog/procedures/Sp_QlyComeMaterialsJudge.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量管理 / 来料检验 — auto-evaluates a 材料检验 record (`QlyComeMaterialsTestMaster` / `QlyComeMaterialsTestSlave`) against the AQL sampling standard: pulls the standard's sample/accept/reject thresholds from `EleTestStandardItem`, marks each inspection line 合格/不合格, and rolls up to a master-level `iTestResult` pass/fail. Signature (`sFormGuid, sGuid, sTableName, sLoginId, sReturn, sBrId, sSuId, sCode`) matches the standard button-action contract. + +**What it does:** Counts `QlyComeMaterialsTestSlave` rows where `sAqlstandardId` joins `EleTestStandardItem`; if any: (1) `UPDATE` the slave's `dSampleQty / iAcQty / iReQty` from the standard band where `dAuxiliaryQty BETWEEN iQuantityFrom AND iQuantityTo`; (2) `UPDATE` each slave's `sActValue = CASE WHEN dNoQualifyQty >= iReQty THEN '不合格' ELSE '合格' END`; (3) sets master `dSampleQty` to the max slave `dSampleQty`. Then opens a cursor over `(sAqlstandardId, iAcQty, iAcQty2)` summing `dNoQualifyQty`/`dNoQualifyQty2` per standard and flagging master `iTestResult = (Case WHEN p_iResult > 0 THEN 1 ELSE 0 END)`. Finally fills `sTestPersonId` from `eleemployee` and `CALL Sp_afterSave_sCmt` to chain the standard after-save hook for the 来料检验 form code `sCmt`. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule sSaveProName/sCalcProName, other routines, xly-src grep across all extensions). The signature and the `Sp_afterSave_sCmt` call strongly suggest this is meant to be the calc/judge hook for the 来料检验 form (`sCmt`) — likely invoked dynamically by name from a Java button-action handler not present in xly-src, or bound through a tenant-specific config column; candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_QlyOutSideJudge.md b/en/docs/auto-catalog/procedures/Sp_QlyOutSideJudge.md index b6e665f..c8577a7 100644 --- a/en/docs/auto-catalog/procedures/Sp_QlyOutSideJudge.md +++ b/en/docs/auto-catalog/procedures/Sp_QlyOutSideJudge.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量管理 / 发外检验 — auto-evaluates a 发外检验 record (`qlyoutsideproducttestmaster` / `QlyOutSideProductTestSlave`) against the AQL sampling standard. Twin of `Sp_QlyComeMaterialsJudge` but for the outsourced-processing inspection flow rather than incoming-material. + +**What it does:** A single `UPDATE QlyOutSideProductTestSlave A INNER JOIN EleTestStandardItem B ON A.sAqlstandardId = B.sParentId INNER JOIN qlyoutsideproducttestmaster C ON A.sParentId = C.sId SET A.dSampleQty = B.iSample, A.iAcQty = B.iAccept, A.iReQty = B.iReject WHERE A.sParentId = sGuid AND C.dSampleQty BETWEEN B.iQuantityFrom AND B.iQuantityTo` — populates the slave's sample/accept/reject from the standard band keyed by the master's `dSampleQty`. All further per-line pass/fail and master rollup logic is commented out in the current body, so this implementation only fills in sampling thresholds without auto-judging. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule sSaveProName/sCalcProName, other routines, xly-src grep across all extensions). Signature matches the standard button-action contract (`sFormGuid, sGuid, sTableName, sLoginId, sReturn, sBrId, sSuId, sCode`) — likely intended as the 自动判断 button hook on 发外检验 (`sQod`/`sOod` form code), invoked dynamically by name from a Java handler not present in xly-src; candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_QlyProcessTestJudge.md b/en/docs/auto-catalog/procedures/Sp_QlyProcessTestJudge.md index 6fb540f..071cebb 100644 --- a/en/docs/auto-catalog/procedures/Sp_QlyProcessTestJudge.md +++ b/en/docs/auto-catalog/procedures/Sp_QlyProcessTestJudge.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量管理 / 工序检验 — meant to be the auto-judge button hook for the 工序检验 (`QlyProcessTestMaster` / `QlyProcessTestSlave`) form: roll a per-line pass/fail based on `dSReserve3` quantity and roll up to master `iTestResult`. Twin of `Sp_QlyComeMaterialsJudge` / `Sp_QlyProductJudge` / `Sp_QlyOutSideJudge` for the in-process inspection flow. + +**What it does:** The active body is empty — every UPDATE statement (slave `sActValue` set from `dSReserve3>0`, master `iTestResult` rolled up from slave `不合格` count, and the "请选择实测值" validation) is commented out. The proc declares `p_sTestItem` and returns immediately without touching any table. Effectively a no-op skeleton. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule sSaveProName/sCalcProName, other routines, xly-src grep across all extensions). Signature matches the standard 自动判断 button-action contract (`sFormGuid, sGuid, sTableName, sLoginId, sReturn, sBrId, sSuId, sCode`) and the name pattern follows the Judge family — likely a stub left during a feature pause; candidate for maintainer audit or deletion. diff --git a/en/docs/auto-catalog/procedures/Sp_QlyProductJudge.md b/en/docs/auto-catalog/procedures/Sp_QlyProductJudge.md index 4a4c9ee..a64a9d6 100644 --- a/en/docs/auto-catalog/procedures/Sp_QlyProductJudge.md +++ b/en/docs/auto-catalog/procedures/Sp_QlyProductJudge.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量管理 / 成品检验 — auto-evaluates a 成品检验 record (`qlyproducttestmaster` / `QlyProductTestSlave`) against the AQL sampling standard, marks each line 合格/不合格, and rolls a master-level `iTestResult` pass/fail. Single-row variant; the toolbar-button equivalent is `Sp_QlyProduct_BtnCalculate`. + +**What it does:** Three sequential updates: (1) `UPDATE QlyProductTestSlave A INNER JOIN EleTestStandardItem B INNER JOIN qlyproducttestmaster C SET A.dSampleQty=B.iSample, A.iAcQty=B.iAccept, A.iReQty=B.iReject WHERE A.sParentId=sGuid AND C.dProductQty BETWEEN B.iQuantityFrom AND B.iQuantityTo` — fills the AQL sample/accept/reject from the standard band keyed by the master's `dProductQty`. (2) `UPDATE QlyProductTestSlave SET sActValue = CASE WHEN dNoQualifyQty >= iReQty THEN '不合格' ELSE '合格' END WHERE sParentId=sGuid`. (3) Master roll-up: `iTestResult = (COUNT slave 不合格 > 0 ? 1 : 0)` and `dSampleQty = MAX(slave.dSampleQty)`. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule sSaveProName/sCalcProName, other routines, xly-src grep across all extensions). Signature matches the standard 自动判断 button hook (`sFormGuid, sGuid, sTableName, sLoginId, sReturn, sBrId, sSuId, sCode`) for the 成品检验 form — likely invoked dynamically by name from a Java handler not present in xly-src; candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_QlyProduct_BtnCalculate.md b/en/docs/auto-catalog/procedures/Sp_QlyProduct_BtnCalculate.md index 8a0ee6e..4eb37be 100644 --- a/en/docs/auto-catalog/procedures/Sp_QlyProduct_BtnCalculate.md +++ b/en/docs/auto-catalog/procedures/Sp_QlyProduct_BtnCalculate.md @@ -22,4 +22,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量管理 / 成品检验 — toolbar-button variant of `Sp_QlyProductJudge`: takes the selected grid row(s) via `sProInParam` JSON (rather than a single `sGuid`), then runs the standard "fill sample thresholds + roll up pass/fail" sequence on `QlyProductTestSlave` / `qlyproducttestmaster`. + +**What it does:** Validates `sProInParam` is valid JSON and has params (returns localised `paramsErro` / `chooseData` errors via `Fun_Sis_GetConst` otherwise). Extracts the first row's `sId` and `sSlaveId` from `$.params[0].value[0]`. `UPDATE QlyProductTestSlave A INNER JOIN EleTestStandardItem B INNER JOIN qlyproducttestmaster C SET A.dSampleQty=B.iSample, A.iAcQty=B.iAccept, A.iReQty=B.iReject WHERE A.sParentId=p_sId AND C.dProductQty BETWEEN B.iQuantityFrom AND B.iQuantityTo`. Then rolls master `iTestResult = (COUNT slave sActValue='不合格' > 0 ? 1 : 0)` and `dSampleQty = MAX(slave.dSampleQty)`. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep across all extensions). The `sProInParam`-shaped signature is the standard `GenericProcedureCallServiceImpl.doGenericProcedureCall()` button-handler contract, so this is intended for a 自动判断 toolbar button on the 成品检验 grid — currently with no DB-level binding found; candidate for maintainer audit. Sibling: `Sp_QlyProductJudge` (single-row, `sSaveProNameBefore`-shaped signature). + +Bug note: leaves a stray `SELECT p_sId, p_sSlaveId;` in the body, which is returned to the caller as a result set — likely debug residue. diff --git a/en/docs/auto-catalog/procedures/Sp_QlyTest.md b/en/docs/auto-catalog/procedures/Sp_QlyTest.md index bca1e2b..783d8b0 100644 --- a/en/docs/auto-catalog/procedures/Sp_QlyTest.md +++ b/en/docs/auto-catalog/procedures/Sp_QlyTest.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量管理 — would serve a per-工单 quality-test detail report combining all five test types (材料检验, 发外检验, 工序检验, 首检, 成品检验) into one flat row set keyed by `sWorkOrderId`. Designed as the slave drill-through of `Sp_QlyTestWorkOrder`. + +**What it does:** Builds temp table `P_QlyTest` (sId, sBillNo, tCreateDate, sWorkOrderId, sTestType, sTestitemId, sTestStandardId, dSampleQty/dNoQualifyQty/dQualifyQty, sTestResult). Five `INSERT...SELECT` blocks pull from `QlyComeMaterialsTestMaster` (joined to `purpurchaseorderslave`/`purpurchaseorderDetail` for the materials side), `Qlyoutsideproducttestmaster` (发外), `QlyProcessTestMaster` (巡检/首检, with `sFormId='12012615914116373957014740'` overriding to '首检'), and `QlyProductTestMaster` (成品). Each row is filtered to `bCheck=1 AND bInvalid=0 AND sWorkOrderId/sSrcId = sWorkOrderGuid`. After population it joins `EleTestStandard`, `elematerials`, `eleprocess`, `eleproduct` to denormalise the item/standard names. + +**Invocation:** No `gdsconfigformmaster` data-source binding, no `gdsmodule` hook, no other routine references it, and `grep -rln` on xly-src returns nothing. Signature matches the form-master report family (pageNum/pageSize/totalCount/countMapJson/bFilter/sFilterOrderBy) — the screen was likely planned but never wired, or the binding was deleted while the proc body stayed. Status: appears orphaned; candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_QlyTestWorkOrder.md b/en/docs/auto-catalog/procedures/Sp_QlyTestWorkOrder.md index e6ea7b7..75b0c19 100644 --- a/en/docs/auto-catalog/procedures/Sp_QlyTestWorkOrder.md +++ b/en/docs/auto-catalog/procedures/Sp_QlyTestWorkOrder.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量管理 — would serve a master quality-test summary keyed by 生产工单, with one row per `viw_mftworkorder` showing five inspection-pass-rate pairs (材料/发外/工序/首检/成品 = inspection count + qualified count). Master of the drill-down handled by `Sp_QlyTest`. + +**What it does:** Splices `bFilter` JSON via `Fun_bFilter_toWhere`, rewrites alias prefixes on `sCustomerName`/`sProductName`, then builds dynamic-SQL `INSERT INTO P_QlyTestWorkOrder` from `viw_mftworkorder` joined to `elecustomer` and `eleproduct` (`bCheck=1 AND bInvalid=0`, grouped by `sId`). After populating the work-order rows it fans out ten correlated `UPDATE` joins, each counting matching test-master rows on `bCheck=1 AND bInvalid=0` and (for the "Result" columns) `iTestResult=0`: materials from `QlyComeMaterialsTestMaster` linked through `purpurchaseorderslave`/`purpurchaseorderDetail.sWorkOrderId`; outside-product from `Qlyoutsideproducttestmaster`; first/process inspections from `QlyProcessTestMaster` filtered by 首检 vs 工序检验 form-ids; final-product from `QlyProductTestMaster`. + +**Invocation:** No `gdsconfigformmaster.sSqlStr` binding, no `gdsmodule` hook, no other routine references it, and `grep -rln` on xly-src returns nothing. Same form-report signature as `Sp_QlyTest`. Status: appears orphaned; candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_QualityAccident_Reason.md b/en/docs/auto-catalog/procedures/Sp_QualityAccident_Reason.md index 23b6e65..cfeed2c 100644 --- a/en/docs/auto-catalog/procedures/Sp_QualityAccident_Reason.md +++ b/en/docs/auto-catalog/procedures/Sp_QualityAccident_Reason.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 制造管理 → 质量事故报告 (mftqualityaccidentslave) — toolbar/button handler that lets the user fill in 原因分析 (cause analysis) and 短期/长期/临时改善对策 once and apply the four strings to every selected slave row. + +**What it does:** Parses `sProInParam` as the standard generic-dispatch JSON (`$.params[*].value[*].sId` for selection, `$.changeValue` for the form values). On empty payload calls `Sp_Sis_GetConst('paramsErro', …)` to localise the error. For each `sId`, runs `UPDATE mftqualityaccidentslave SET sShortTermImproveStrategy, sLongTermImproveStrategy, sCauseAnalysis, sTmpImproveStrategy` scoped by `sBrandsId`/`sSubsidiaryId`. No status flip and no master touch. + +**Invocation:** Signature is the canonical `Sp_BtnEvent_*` shape (`sProInParam, sMakePerson, sBrId, sSuId, OUT sReturn, OUT sCode`) dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()`. No DB hook (`gdsmodule.sSaveProName`/`sProcName` empty), no other routine references it, and `grep -rln` on xly-src returns nothing. Status: appears orphaned in the live config — the button likely existed in an older 质量事故 grid and was retired. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Quality_Materials.md b/en/docs/auto-catalog/procedures/Sp_Quality_Materials.md index 3317902..eaf0c25 100644 --- a/en/docs/auto-catalog/procedures/Sp_Quality_Materials.md +++ b/en/docs/auto-catalog/procedures/Sp_Quality_Materials.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量管理 — would serve a materials-inspection pass-rate report grouped by 材料分类 (`sismaterialsclassify`), with one row per material category plus a 总计 grand-total row. Date-window driven (tStartDate/tEndDate), scoped to the two 来料检验单 form-ids `15827054010002527067474512475000` and `12012615914116374731613080`. + +**What it does:** Counts batches in `qlycomematerialstestmaster` (filtered by sBrId/sSuId/sFormId/tCreateDate window), joined to `elematerials` to roll up by `sParentId`. Builds temp `p_TempTable` (sSlaveId, sMaterialsClassifyId, sMaterialsClassifyName, iCount, iDisqualified, sRate, sMemo); a parallel temp `p_TempTable1` re-runs the same scan filtered to `iTestResult=1` for the disqualified count, then `UPDATE`-joins to merge. `sRate = ROUND((iCount-iDisqualified)/iCount*100,2) || '%'`. Appends a synthetic 总计 row with `sMaterialsClassifyId='111111'`. Returns via dynamic `SELECT * FROM p_TempTable` — note the proc never calls a paging helper despite declaring `page_num`/`page_size`/`totalCount`/`countMapJson` parameters. + +**Invocation:** No `gdsconfigformmaster.sSqlStr` binding, no `gdsmodule` hook, no other routine references it, and `grep -rln` on xly-src returns nothing. Status: appears orphaned; candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Qualityaccident_CheckUpdate.md b/en/docs/auto-catalog/procedures/Sp_Qualityaccident_CheckUpdate.md index a286da2..3f125ce 100644 --- a/en/docs/auto-catalog/procedures/Sp_Qualityaccident_CheckUpdate.md +++ b/en/docs/auto-catalog/procedures/Sp_Qualityaccident_CheckUpdate.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 制造管理 → 质量事故报告 (mftqualityaccidentMaster). Pre-check / pre-save recompute that reconciles `dMaterialsLossMoney`, `dLoseMoney`, `dReplenishmentQty` and per-责任人 `dResponsibleMoney` on the master + slave rows before the bill is committed. The DB COMMENT just reads "质量事故报告". + +**What it does:** Validates `sData` as JSON; pulls `sWorkOrderId` from `mftqualityaccidentMaster` for `sGuid`. Then: (1) where `dMaterialsLossMoney=0`, computes it from `mftworkordermaterials` ÷ `mftworkordercontrol.dSumMachineAllQty` × this slave's `dReplenishmentQty/dPartsQty/1.13`; (2) recomputes `dLoseMoney = dMaterialsLossMoney + dPrintLossMoney + dOtherMoney`; (3) syncs master `dReplenishmentQty` from `SUM(slave.dReplenishmentQty)` if they disagree; (4) prorates each slave's `dResponsibleMoney` against `dLoseMoney`. Master+slave updates are scoped by `sBrandsId/sSubsidiaryId`. + +**Invocation:** No `gdsmodule.sSaveProName`/`sSaveProNameBefore`/`sCalcProName` binding, no other routine references it, and `grep -rln` on xly-src returns one hit — `script/标版/30100101/Sp_Qualityaccident_CheckUpdate.sql` (the install script). Signature `(sGuid, sData, sAllData, sFormGuid, sLoginId, sBrId, sSuId, OUT sCode, OUT sReturn)` matches the `Sp_Check_s` POST-save validator slot dispatched via `gdsmodule.sSaveProName`. Status: appears orphaned in the live config; candidate for maintainer audit — likely the binding was dropped while the proc body stayed. diff --git a/en/docs/auto-catalog/procedures/Sp_Quantity_PatrolDailyPaper.md b/en/docs/auto-catalog/procedures/Sp_Quantity_PatrolDailyPaper.md index b8f32a5..c709b84 100644 --- a/en/docs/auto-catalog/procedures/Sp_Quantity_PatrolDailyPaper.md +++ b/en/docs/auto-catalog/procedures/Sp_Quantity_PatrolDailyPaper.md @@ -1,7 +1,7 @@ # `Sp_Quantity_PatrolDailyPaper` (procedure) -> @author:杨恒林 - @date:20210523 封存 +> @author:杨恒林 + @date:20210523 封存 @describe: 巡检日报主管审批过程 质量管理-过程管理-巡检日报-主管审核按钮: @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量管理 → 过程管理 → 巡检日报 — supervisor (主管) approval button on the 巡检日报 daily-inspection summary. The DB COMMENT explicitly marks the proc as `20210523 封存` (sealed/deprecated 2021-05-23) and authored by 杨恒林. + +**What it does:** Parses `sProInParam` for `$.params[*].value[*]` and `$.changeValue.textareaValue` (the supervisor's remark). For each row it reads `tCreateDate` + `sMakePerson` and runs `UPDATE QlyProcessTestMaster SET bCheck=1, sStatus=1, sCheckPerson=sMakePerson, tCheckDate=NOW() WHERE sMakePerson=p_sMakePerson AND DATE_FORMAT(tCreateDate,'%Y-%m-%d') = LEFT(p_tCreateDate,10)` scoped by sBrId/sSuId — i.e. it stamps every patrol-test record that the named operator created on that day. Each row also writes a `syslog` audit entry with `sFormId='12012615914116371204913630'` (巡检日报 form id) and `sOperationType='巡检日报审批'`. + +**Invocation:** Signature is the standard `Sp_BtnEvent_*` generic-dispatch shape, but no live binding: `gdsmodule.sSaveProName`/`sProcName` empty, no other routine references it, and `grep -rln` on xly-src returns one hit — `script/标版/30100101/Sp_Quantity_PatrolDailyPaper.sql` (install script only). Status: deprecated by COMMENT, orphaned in the live config; the replacement is the per-row approval on `QlyProcessTestMaster` directly. Candidate for maintainer audit / removal. diff --git a/en/docs/auto-catalog/procedures/Sp_QuoquotationOrderMonth.md b/en/docs/auto-catalog/procedures/Sp_QuoquotationOrderMonth.md index dff5beb..bafb27d 100644 --- a/en/docs/auto-catalog/procedures/Sp_QuoquotationOrderMonth.md +++ b/en/docs/auto-catalog/procedures/Sp_QuoquotationOrderMonth.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 报价&估计管理 → 客户估价分析 — period-windowed customer-level quote-vs-order conversion report. One row per `sCustomerId` summarising 报价单数/报价金额/总数量 (counts and money of quotes filed) against 成单单数/成单金额 (the subset that linked to a sales order via `quoquotation.sOrderId`), with a 成单率 ratio. + +**What it does:** Defaults `tStartDate`/`tEndDate` to the last month if null, then builds temp `Tmp_QuoquotationOrder` from `viw_quoquotation` filtered by `sBrandsId`/`sSubsidiaryId`/`bInvalid=0`/`tCreateDate` window, grouped by `sCustomerId` (counts, `SUM(dProductQty)`, `SUM(dProductMoney)`). A second `UPDATE JOIN` over the same view restricted to `IFNULL(sOrderId,'') <> ''` fills `dSucceedCount` and `dSucceedMoney`. A join to `elecustomer` denormalises `sCustomerName`; a final `SET dRate = ROUND(dSucceedCount/dCount*100, 2)`. The temp table is fed to `Sp_Do_UpdateByPageSizeBefore` for paging + `bFilter` splicing, then returned via dynamic `SELECT * FROM Tmp_QuoquotationOrder`. + +**Invocation:** Bound as the data-source of the 客户估价分析 form `gfm.sId=101801153119616739487098840` via `gdsconfigformmaster.sSqlStr` — under module 客户估价分析 (sId `101801153119616739487098580`) inside 销售管理 → 报价&估计管理. Loaded when the user opens the report. `xly-src/script/标版/optimize/Sp_QuoquotationOrderMonth.sql` ships a performance/lock patch — verify which body is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_QuotationStatistics.md b/en/docs/auto-catalog/procedures/Sp_QuotationStatistics.md index 383463d..950662d 100644 --- a/en/docs/auto-catalog/procedures/Sp_QuotationStatistics.md +++ b/en/docs/auto-catalog/procedures/Sp_QuotationStatistics.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 报价&估计管理 → 估价丢单原因统计 — paged "lost-quote reason" pivot. Groups approved quotations into reason buckets: every `sType` lost-reason that didn't become a sales order, plus a fixed bucket "已成交订单" (turned into a sales order) and the unconfigured "未走客户确认流程直接下单" (booked without customer confirmation). + +**What it does:** Builds temp table `Tmp_EleProduct` from `quoquotationmaster` (filter: `bCheck=1` and date range). First pass counts/sums quotes not in `viw_salsalesorder.sSrcId` grouped by `sType`; empty `sType` rows get re-labelled via `Fun_Sis_GetConstNew('sNotCustomerConfirm', …)`. Second pass inserts the "已成交订单" row from quotes that *do* match `viw_salsalesorder`. Computes `dPercentageQty = dQuotationMoney / sum * 100`. Hands the result to `Sp_Outstanding_Query` for paging/`bFilter` splicing/total-count. + +**Invocation:** Bound as data-source of form `gfm.sId=15936608930005133957219822193000` via `gdsconfigformmaster.sSqlStr` — module 估价丢单原因统计 (`sId 101251240115015878880530950`). Install/optimize script `script/标版/optimize/Sp_QuotationStatistics.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataBookStd.md b/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataBookStd.md index 322902b..2ab7c90 100644 --- a/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataBookStd.md +++ b/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataBookStd.md @@ -23,4 +23,12 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 报价&估计管理 → 书刊产品报价 / 书刊产品报价单据 — top-level quote-cost calculator dedicated to the 书刊 (book/journal) product family. Standard entry-point for the book-style quote (signature wider/longer formats, parts split between cover / inner / insert) that the user invokes from the quote edit screen. + +**What it does:** Walks the master quote `quoquotationmaster_tmp` and its slaves `quoquotationslave_tmp`/`QuoQuotationcontrol_tmp`/`QuoQuotationmaterials_tmp`/`QuoQuotationprocess_tmp`/`QuoQuotationControlCombine_tmp`. Per slave it derives `dSumProductQty`, `dSumGiveQty`, sample/standard-page flags, then opens cursors over Control, Materials, PrintProcess, Slave, and update-Slave temps. For each control it computes process in/out quantities, accumulates rate adjustments, applies the customer's book-quote paper formula (`sQuotationPaperFormulaId`) and capacity formula (`sCapacityFormulaId`), and writes back into the same `_tmp` set. `Sp_System_ReplaceField` localises the merged messages; `Sp_Sis_GetConst` fetches localized constants. Reads `gdsmodule`, `SysSystemSettings`, `sysformsetting` for branch/feature flags. + +**Invocation:** Bound to two production modules via `gdsmodule.sCalcProName`: +- `书刊产品报价` (sId `101251240115016197744846010`) under 报价&估计管理 +- `书刊产品报价单据` (sId `101251240115016197744514350`) under 销售单据 + +Also enumerated in `CaclProNameEnum.SP_QUOTATION_CALCDATABOOKSTD` (java `xlyBusinessService/contant/enumeration/CaclProNameEnum.java`); the proc name is passed to `ManyQuoServiceImpl.addQuotationsheetManyThread(params, userInfo, sProName)` for multi-quantity calculation paths, and `QuoquotationServiceImpl.isQuoquotationMany()` reads `gdsmodule.sCalcProName` to decide the calc strategy. xly-src ships `script/标版/30100101/Sp_Quotation_CalcDataBookStd.sql` (install). diff --git a/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataFlex.md b/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataFlex.md index 1d511d8..e090fd4 100644 --- a/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataFlex.md +++ b/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataFlex.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 报价&估计管理 — top-level quote-cost calculator for the 柔印 / 柔性 (flex / flexible-substrate) product family. Sibling of `Sp_Quotation_CalcDataBookStd` (书刊), `Sp_Quotation_CalcDataPack` (包装), `Sp_Quotation_CalcDataSetStd` (套装) and `Sp_Quotation_CalcDataStd` (general). Adds paper-rate (`dPaperRate`) and per-process paper input/output (`dProcessPaperInQty`/`dProcessPaperOutQty`) variables for the flex-print paper-handling model. + +**What it does:** Same shape as the rest of the family — walks `quoquotationmaster_tmp` and slave/control/materials/process/control-combine `_tmp` snapshots populated by the front-end submission, opens cursors over the temp tables, and per control row computes `dProcessInQty`/`dProcessOutQty`, `dPaperRate`, `dAdjustRate`, `dPartsQty`, then writes back via `Update QuoQuotationControl_Tmp` / `QuoQuotationMaterials_Tmp` / `QuoQuotationProcess_Tmp` / `QuoQuotationSlave_Tmp` / `QuoQuotationParam_tmp` / `quoquotationmaster_tmp`. Calls `Sp_Sis_GetConst` for localized constants and `Sp_System_ReplaceField` for the localized return strings. + +**Invocation:** Enumerated in `CaclProNameEnum.SP_QUOTATION_CALCDATAFLEX` (java `xlyBusinessService/contant/enumeration/CaclProNameEnum.java`). The proc name is passed to `ManyQuoServiceImpl.addQuotationsheetManyThread(params, userInfo, sProName)` for the multi-quantity quote flow and is the dispatch target read from `gdsmodule.sCalcProName` for the single-quantity save path. No live `gdsmodule` row has `sCalcProName='Sp_Quotation_CalcDataFlex'` in the queried tenant — the binding is present in the enum constants and tenant-specific module config; xly-src ships the install body at `script/标版/30100101/Sp_Quotation_CalcDataFlex.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataPack.md b/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataPack.md index 0bd022c..de141d5 100644 --- a/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataPack.md +++ b/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataPack.md @@ -23,4 +23,12 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 报价&估计管理 → 01/04【新增】新报价单 (gdsmodule sId `101251240115016076506222050`) — top-level quote-cost calculator for the packaging-product (包装) family on the "new quote" form. Orchestrates the pack-quote pipeline that distributes work across the parts/last-process/std sub-routines and records progress per slave. + +**What it does:** From `quoquotationmaster_tmp` + slave/control/materials/process/control-combine `_tmp` snapshots, fills two working temp tables (`p_controlTable`, `p_controlCombineTable`) and reports lifecycle status to `quoquotation_progress` (one row per slave). For each control row it dispatches to one of three sub-routines depending on context: `CALL Sp_Quotation__CalcDataPackLastStd(...)` for the final/last-process control, `CALL Sp_Quotation__CalcDataPackPartsStd(...)` for parts roll-up, `CALL Sp_Quotation_CalcDataPackProductStd(...)` for the product-level pass, and `CALL Sp_Quotation_CalcDataStd(...)` as fallback. Localizes outputs via `Sp_Sis_GetConst` + `Sp_System_ReplaceField` and writes back to `quoquotationcontrol_tmp` / `quoquotationControlCombine_Tmp`. + +**Invocation:** Two invocation paths converge here: +1. Bound as `gdsmodule.sCalcProName='Sp_Quotation_CalcDataPack'` for the 01/04【新增】新报价单 module — the standard single-quantity save fires this from the form-level calc dispatcher. +2. Multi-quantity quote flow: `QuoquotationController.addQuotationsheetMany()` (xly-src `xlyEntry/web/businessweb/QuoquotationController.java`) calls `this.manyQuoService.addQuotationsheetManyThread(params, userInfo, "Sp_Quotation_CalcDataPack")` — the proc name is hard-coded as the third arg and `ManyQuoServiceImpl.addQuotationsheetManyThread()` spawns a thread per quantity tier each calling this proc. + +Also enumerated as `CaclProNameEnum.SP_QUOTATION_PACKSTD`. xly-src ships the install body at `script/标版/30100101/Sp_Quotation_CalcDataPack.sql` and a customer override at `script/客户/上海亚峰/报价单计算/Sp_Quotation_CalcDataPack.sql` — verify which is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataPackProductStd.md b/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataPackProductStd.md index 4eb1dbc..3adf549 100644 --- a/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataPackProductStd.md +++ b/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataPackProductStd.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售单据 — per-product helper for the pack-quotation (`Sp_Quotation_CalcDataPack`) calculator. Drives the per-slave material/process roll-up for a *single product* inside a 包装 (packaging) quote, where one quote line groups multiple component products. + +**What it does:** Iterates slaves in `quoquotationslave_tmp` and aggregates each product's element charges from `eleproduct` and the staging tables `QuoQuotationMaterials_Tmp`, `QuoQuotationProcess_Tmp`, `QuoQuotationParam_Tmp`. Resolves the percentage/rate fields (`p_dRate`, `p_dAdjustRate`, `p_sSumRate`), applies last-process / product-first-process flags, and writes per-product money into the temp tables `p_quoquotationslave_tmp` and `p_SlaveMoneyTable`. Also calls `Sp_Sis_GetConst` for localised constants and `DELETE FROM quoquotationcalc_tmp` to clear prior calc rows. Updates `quoquotationcontrol_tmp`, `quoquotationmaster_tmp`, `quoquotationprocess_tmp`. + +**Invocation:** Called only from `Sp_Quotation_CalcDataPack` (the umbrella pack-quote calculator). Install: `script/标版/30100101/Sp_Quotation_CalcDataPackProductStd.sql`. A customer override exists at `script/客户/上海亚峰/报价单计算/Sp_Quotation_CalcDataPackProductStd.sql` — verify which version is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataPackStd.md b/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataPackStd.md index 2787e28..54b3f65 100644 --- a/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataPackStd.md +++ b/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataPackStd.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售单据 — standard packaging-quotation price calculator. The packaging variant of `Sp_Quotation_CalcDataStd`: same staging-table contract (`QuoQuotationmaster_Tmp` / slave / control / material / process / param), additional 包装控件 (pack-control) tables, and adjustments for multi-product packs. + +**What it does:** Walks slave/control/material/process/print-process cursors against the Quo*_Tmp staging set. Reads element rates from `eleproduct`, `EleMaterials`, `EleProcess`, applies form-level overrides from `sysformsetting`, system toggles from `SysSystemSettings`, and constants via `Sp_Sis_GetConst`/`Sp_System_ReplaceField`. Writes the computed per-row money/qty into `QuoQuotationMaterials_Tmp`, `QuoQuotationProcess_Tmp`, `QuoQuotationControl_Tmp`, `QuoQuotationSlave_Tmp`; rolls up totals into `quoquotationmaster_tmp`. Includes a pack-rate handling block (`p_bRateTransformSet`) absent from `_CalcDataStd`. + +**Invocation:** Registered in `CaclProNameEnum.SP_QUOTATION_PACKSTD`/`SP_QUOTATION_CALCDATASETSTD` family. Dispatched by `BusinessBaseServiceImpl` when a form's `gdsmodule.sCalcProName='Sp_Quotation_CalcDataPackStd'`. No current `sCalcProName` row binds to this name — the live pack-quote form (新报价单, `101251240115016076506222050`) routes through `Sp_Quotation_CalcDataPack`, which calls this proc indirectly via `workOrderCalcDataPackService.doCalcDataPackStd`. Install: `script/标版/30100101/Sp_Quotation_CalcDataPackStd.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataSetStd.md b/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataSetStd.md index f2b2ee2..1fdf781 100644 --- a/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataSetStd.md +++ b/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataSetStd.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售单据 — quotation calculator for the 套装产品 (product-set) form variant 报价单单据(通用)(兼容停用). Companion to `Sp_Quotation_CalcDataStd` but adds combine-control handling (`quoquotationcontrolcombine_tmp`) so a single slave can carry several bundled control groups. + +**What it does:** Mirrors the standard calc loop — walks slave/control/material/process/print-process cursors against the Quo*_Tmp staging set, reads element rates from `eleproduct`/`EleProcess`, system toggles from `SysSystemSettings`/`sysformsetting`, expands formulas via `Sp_System_ReplaceField`/`Sp_Sis_GetConst`, and writes back into the staging tables. The set-specific block additionally updates `quoquotationControlCombine_Tmp` and uses `p_SlaveMoneyTable` / `p_TmpWorkOrderSlave` temp tables to aggregate per-combine totals before rolling them into `quoquotationmaster_tmp`. + +**Invocation:** Dispatched by `BusinessBaseServiceImpl` via `CaclProNameEnum.SP_QUOTATION_CALCDATASETSTD` — selected when a form's `gdsmodule.sCalcProName='Sp_Quotation_CalcDataSetStd'`. Currently bound to 报价单单据(通用)(兼容停用) `101251240115016244276286330` (the bundled-product quote form). Install: `script/标版/30100101/Sp_Quotation_CalcDataSetStd.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataStd.md b/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataStd.md index ac4c269..52ce66e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataStd.md +++ b/en/docs/auto-catalog/procedures/Sp_Quotation_CalcDataStd.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售单据 — standard quotation-form price calculator. Runs the full quote-cost pipeline against the temp staging tables (`QuoQuotationmaster_Tmp` / `_slave_tmp` / `_control_tmp` / `_material_tmp` / `_process_tmp` / `_param_tmp`) populated during the form's edit session. Used by the legacy 报价单单据(兼容停用), 卷筒产品报价单据, 报价单单据(膜类), 套装产品报价单据 forms. + +**What it does:** Iterates per-slave (`QuoQuotationSlave_Tmp`) and walks materials/process/control cursors. Reads element rates from `EleMaterials`, `EleProcess`, `eleproduct`, plus form-level overrides in `sysformsetting` and global toggles in `SysSystemSettings`. Resolves dynamic field formulas via `Sp_System_ReplaceField` and consts via `Sp_Sis_GetConst`. Writes back per-row money/qty into `QuoQuotationMaterials_Tmp`, `QuoQuotationProcess_Tmp`, `QuoQuotationControl_Tmp`, `QuoQuotationSlave_Tmp`; finally rolls slave totals into `QuoQuotationmaster_tmp` (`dAllMoney`, etc.). + +**Invocation:** Dispatched by `BusinessBaseServiceImpl` via the `CaclProNameEnum.SP_QUOTATION_CALCDATASTD` mapping — selected when the form's `gdsmodule.sCalcProName='Sp_Quotation_CalcDataStd'` (modules 报价单单据(兼容停用) `19211681019715780306452560`, 卷筒产品报价单据 `101251240115016002356125200`, 报价单单据(膜类) `101251240115016036175782700`, 套装产品报价单据 `12012615914116361104593880`). Install: `script/标版/30100101/Sp_Quotation_CalcDataStd.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Quotation_CopyToQuotationData.md b/en/docs/auto-catalog/procedures/Sp_Quotation_CopyToQuotationData.md index a18f9f1..5ab701a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Quotation_CopyToQuotationData.md +++ b/en/docs/auto-catalog/procedures/Sp_Quotation_CopyToQuotationData.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售单据 → 报价单 — "copy product technology/process card data into the quotation" helper. When the user picks a customer+product pair on a quote line, this proc finds the latest matching `mftproduct` 工艺卡 (process card) and copies its material/process/control hierarchy into the quote's `QuoQuotationslave_tmp` staging tree so the cost calculator can run against it. + +**What it does:** For each row in `QuoQuotationslave_tmp` (filtered by `sParentId=sGuid, sMakePerson=sLoginId, sBrandsId, sSubsidiaryId`), runs windowed prepared SQL over `viw_mftproduct` (`bCheck=1`) to pick the most recent process card per `(sCustomerId, sProductId)`, and writes its `sId` into `QuoQuotationslave_tmp.sProductTechnologyId`. Then iterates `mftproductmaterials` for those cards and inserts/copies materials, parts, processes, and controls into the corresponding `QuoQuotation{Materials,Process,Control}_Tmp` rows. + +**Invocation:** Java caller: `BusinessBaseServiceImpl` builds the `call Sp_Quotation_CopyToQuotationData(sGuid, sConfigId, sControlName, sMakePerson, sBrandsId, sSubsidiaryId)` SQL string when the quote form's CopyTo (复制) action fires — a generic-dispatch entry tied to the form's `sControlName`. Install: `script/标版/30100101/Sp_Quotation_CopyToQuotationData.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Quotation__CalcDataPackLastStd.md b/en/docs/auto-catalog/procedures/Sp_Quotation__CalcDataPackLastStd.md index 3d9af19..d6ef6d1 100644 --- a/en/docs/auto-catalog/procedures/Sp_Quotation__CalcDataPackLastStd.md +++ b/en/docs/auto-catalog/procedures/Sp_Quotation__CalcDataPackLastStd.md @@ -34,4 +34,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 报价&估计管理 → 新报价单 (gdsmodule sId `101251240115016076506222050`) — final-control / last-process stage of the packaging-product (包装) quote-cost engine. Receives the temp-table snapshot built by `Sp_Quotation_CalcDataPack` and finishes the per-工艺 quantity/rate/loss math for the terminal process where `bLastProcess=1`, then writes results back to `QuoQuotationControl_Tmp` / `QuoQuotationMaterials_Tmp` / `QuoQuotationProcess_Tmp` for return to the front-end. + +**What it does:** Reads quote master/slave/control/materials/process/control-combine `*_tmp` tables. For each control row it determines `bLastProcess`/`bProductProcess`/`bSameControl`, walks the process cursor to compute `dProcessInQty`/`dProcessOutQty`/`dAdjustLossQty` against materials and prior process rates, applies the `p_sCorrugateWidth/Length`/`p_dMinusLength/Width` deductions, and consolidates by `sControlParentId`/`sFirstProcessId`. Writes `dPartsQty`, `dArrangeQty`, `dAdjustRate` back per row. The `Sp_System_ReplaceField` call (and the parallel `Sp_Sis_GetConst`) localise error messages. + +**Invocation:** Called by `Sp_Quotation_CalcDataPack` (`CALL Sp_Quotation__CalcDataPackLastStd(...)`) inside the packaging-quote calculation chain. The outer entry point — `Sp_Quotation_CalcDataPack` — is invoked from `ManyQuoServiceImpl.addQuotationsheetManyThread(params, userInfo, "Sp_Quotation_CalcDataPack")` (called by `QuoquotationController` for the multi-quantity quote flow); the standard single-quantity flow reaches the same proc via `gdsmodule.sCalcProName='Sp_Quotation_CalcDataPack'`. xly-src ships customer-specific overrides for this proc at `script/客户/高旺/20211108成本计算/` and `script/客户/上海亚峰/报价单计算/` — verify which body is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Quotation__CalcDataPackLastStd_zr.md b/en/docs/auto-catalog/procedures/Sp_Quotation__CalcDataPackLastStd_zr.md index 9051355..1446dac 100644 --- a/en/docs/auto-catalog/procedures/Sp_Quotation__CalcDataPackLastStd_zr.md +++ b/en/docs/auto-catalog/procedures/Sp_Quotation__CalcDataPackLastStd_zr.md @@ -34,4 +34,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 报价&估计管理 — variant of `Sp_Quotation__CalcDataPackLastStd` for the packaging-product (包装) quote-cost calculation, with extra `_zr` parameter list adding corrugate-board geometry inputs (`p_sCorrugateWidth`, `p_sCorrugateLength`, `p_dMinusLength`, `p_dMinusWidth`) and pre-computed net-price/net-money carriers. Final-control / last-process step of the pack quote pipeline. + +**What it does:** Like its standard sibling: reads the quote master + slave + control + materials + process temp tables (quoquotation*_tmp population is done by `Sp_Quotation_CalcDataPack`), then computes per-control quantities — `dSumProductQty`, `dSumGiveQty`, `dSumStockUpQty`, rate transforms, public-plate flags — and writes back `dProcessOutQty`, `dProcessInQty`, `dAdjustRate` etc. on `QuoQuotationControl_Tmp`/`QuoQuotationMaterials_Tmp`/`QuoQuotationProcess_Tmp` for the last process row. The `_zr` build incorporates the corrugate-board specifics into the size-deduction math (length/width minus values, public-plate sharing). + +**Invocation:** Same `gdsmodule.sCalcProName` slot as the rest of the family, but no live module binds this `_zr` name (queried `gdsmodule.sCalcProName='Sp_Quotation__CalcDataPackLastStd_zr'` → empty), no other DB routine references it, and the only xly-src hit is the install script `script/标版/30100101/Sp_Quotation__CalcDataPackLastStd_zr.sql`. Status: appears orphaned — customer-specific (`_zr` likely a customer/initials suffix) variant kept alongside the standard for ad-hoc deployment. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Quotation__CalcDataPackPartsStd.md b/en/docs/auto-catalog/procedures/Sp_Quotation__CalcDataPackPartsStd.md index d0af1c0..889603b 100644 --- a/en/docs/auto-catalog/procedures/Sp_Quotation__CalcDataPackPartsStd.md +++ b/en/docs/auto-catalog/procedures/Sp_Quotation__CalcDataPackPartsStd.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 报价&估计管理 → 新报价单 — parts-roll-up stage of the packaging-product (包装) quote-cost engine. Sits between `Sp_Quotation__CalcDataPackLastStd` (per-control / last-process math) and the master-summary phase in `Sp_Quotation_CalcDataPack`: aggregates per-`sControlId` parts quantities (`dPartsQty`), per-product distribution (`p_iPage` running counter, `p_sCombinedMemo` accumulator) and applies `sAllGuid` (the CSV of slave ids participating in the combined-control set) to drive the multi-parts arithmetic. + +**What it does:** For the given `p_sControlId` row of `QuoQuotationControl_Tmp`, sums materials & process input/output quantities across the parts identified by `sAllGuid`, divides totals by `dSumPQtyS` to derive per-unit parts share, and writes results back into `QuoQuotationControl_Tmp`/`QuoQuotationMaterials_Tmp`/`QuoQuotationProcess_Tmp` (same temp set the front-end will render). Net money is propagated via `p_NetMoney`, page index via `p_iPage`. Localises error/result strings via `Sp_Sis_GetConst` and `Sp_System_ReplaceField`. + +**Invocation:** Called by `Sp_Quotation_CalcDataPack` (`CALL Sp_Quotation__CalcDataPackPartsStd(...)`) inside the packaging-quote calculation chain. The outer entry point — `Sp_Quotation_CalcDataPack` — is invoked from `ManyQuoServiceImpl.addQuotationsheetManyThread(params, userInfo, "Sp_Quotation_CalcDataPack")` (called by `QuoquotationController` for the multi-quantity quote flow) or via `gdsmodule.sCalcProName='Sp_Quotation_CalcDataPack'` for the standard single-quantity save path. xly-src ships a 上海亚峰 customer-override at `script/客户/上海亚峰/报价单计算/Sp_Quotation__CalcDataPackPartsStd.sql` — verify which body is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Quotion_CheckFlow_BH1.md b/en/docs/auto-catalog/procedures/Sp_Quotion_CheckFlow_BH1.md index 921dba9..0db947f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Quotion_CheckFlow_BH1.md +++ b/en/docs/auto-catalog/procedures/Sp_Quotion_CheckFlow_BH1.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 报价&估计管理 → 报价单 — 报价单撤回流程 (quotation flow-withdraw) variant. `_BH1` is a customer/branch override of base `Sp_Quotion_CheckFlow`. Cancels an in-flight Activiti workflow that was started for a quote, marks it 已撤销 (revoked), drops todos, and resets the parent quote's `sStatus` to 0. + +**What it does:** Parses `$.params[0].value[0].sId` and `$.changeValue.textareaValue` from `sProInParam`. Looks up the latest `biz_flow` row by `sSrcId = sId` (the quote master id); if absent, returns `sCode=-1` with localised "未查询到发起的流程". Otherwise `UPDATE biz_flow SET type='已撤销', end_time=NOW(), update_by=Fun_GetLoginUserName(...)`, builds a dynamic `UPDATE {sMasterTableName} SET sStatus=0 WHERE sId=...` on the master table named in `biz_flow.sMasterTableName`, and `DELETE FROM biz_todo_item WHERE instance_id=p_instanceId AND is_handle=0`. Leaves Activiti `act_ru_task`/`act_hi_taskinst` rows alone (a deliberate, commented-out cleanup). + +**Invocation:** No bindings found. Not referenced by any `gdsmoduleflow.sApplyProName`, no `gdsmodule` hook, no other routine calls it, and no xly-src match. Status: appears orphaned — customer-specific variant retained without a live registration. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Reachingrate_Machine.md b/en/docs/auto-catalog/procedures/Sp_Reachingrate_Machine.md index 324c70a..80e04ef 100644 --- a/en/docs/auto-catalog/procedures/Sp_Reachingrate_Machine.md +++ b/en/docs/auto-catalog/procedures/Sp_Reachingrate_Machine.md @@ -1,9 +1,9 @@ # `Sp_Reachingrate_Machine` (procedure) -> @author:zhucx - - @date:20210621 封存 - +> @author:zhucx + + @date:20210621 封存 + @describe: 班组-机器计划达标率分析 @@ -40,4 +40,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产运营报表 → 计划执行力度分析 — paged "plan-execution rate" pivot by machine/process/work-center. Body header self-marks `@date:20210621 封存` (sealed/deprecated). Three pivots discriminated by `sType`: `1`=机台, `2`=工序, `3`=工作中心. The current week's plan vs actual is compared per machine to compute a 达标率 (achievement rate). + +**What it does:** Computes the week window (Mon–Sun) shifted by `-7 days` (last week by default) or parsed from `tBetweenDate`. Builds temp table `p_tmp_T` (`sId, sSlaveId, iPlcNo, sMachineName, dAgvRate, iSumCount`) and aggregates per-machine PLC counts vs plan from the production tables, with off-work handling via `p_sOffWork`. Outputs a per-machine `dAgvRate` and hands the final SQL to `Sp_Outstanding_Query` for paging/`bFilter`/`countMapJson` splicing. + +**Invocation:** Bound as data-source of form 计划执行力度分析 (`gfm.sId=19211681019715708754570950`, module `19211681019715708754570630` under 生产运营报表 → 生产管理). Install: `script/标版/30100101/schedule/Sp_Reachingrate_Machine.sql`. The 封存 marker in the body header signals the report is retained for compatibility but newer replacements likely exist. diff --git a/en/docs/auto-catalog/procedures/Sp_Receivables_AR.md b/en/docs/auto-catalog/procedures/Sp_Receivables_AR.md index e080402..23e6340 100644 --- a/en/docs/auto-catalog/procedures/Sp_Receivables_AR.md +++ b/en/docs/auto-catalog/procedures/Sp_Receivables_AR.md @@ -35,4 +35,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 应收账款 → 应收账款 — paged accounts-receivable report. Computes per-customer outstanding balance by combining 期初 (opening balance from `CahCustomerInit`), 销售本期 (period sales from `viw_salsalescheckingmaster`/`SalSalesCheckingSlave`/`saldelivergoodsslave`), 收款 (receipts from `CahReceiptMaster`), 应开票/已开票 invoice rows from `SalSalesInvoiceMaster`, plus payment offsets/adjustments from `CahPaymentMaster` and `CahFinancialAdjust`. + +**What it does:** Resolves the report mode from `iType`/`sStatistics` (multiple variants — by date, by 销售员/客户分类/结算方式 filter, with/without zero-balance customers). Builds `TmpAll` by `UNION` of period sales (slave-level sums of `dMoney`/`dTaxMoney`), receipts, invoices, payments, adjustments, opening balances and quality-abnormal/reject deductions; then aggregates per `sCustomerName` from `EleCustomer`. Sets `dNoReceiptMoney`/`dDueReceiptMoney` as INOUT totals and hands the final SQL to `Sp_Outstanding_Query` for paging, `bFilter` splicing, `countMapJson` building. + +**Invocation:** Bound as data-source of form 应收账款 (`gfm.sId=19211681015115285275044580`, module 应收账款 `19211681015115285273329980` under 财务管理 → 应收账款). Also called internally by `Sp_System_ReplaceField` / `Sp_System_ReplaceFieldNew` / `Sp_System_ReplaceField_NEW_ACT` (dynamic-field expansion), `Sp_Receivables_ARAccount`, `Sp_Sales_PerformanceCommission`, and `Fun_getInitColumnByProName`. Install: `script/标版/30100101/Sp_Receivables_AR.sql` (with the 20220119-2858 upgrade adding `订单金额` column). diff --git a/en/docs/auto-catalog/procedures/Sp_Receivables_ARAccount.md b/en/docs/auto-catalog/procedures/Sp_Receivables_ARAccount.md index 66c2560..6338666 100644 --- a/en/docs/auto-catalog/procedures/Sp_Receivables_ARAccount.md +++ b/en/docs/auto-catalog/procedures/Sp_Receivables_ARAccount.md @@ -33,4 +33,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 常用模块 → 常用设置 → 客户流水账 — paged per-customer "running account" ledger view. Lists every AR-affecting transaction (sales/送货/invoice/receipt/payment/adjustment) for a customer within a date range, in chronological order, with running balance. + +**What it does:** Builds an opening-balance row from `Sp_Receivables_AR` (called for `tStartDate` as cutoff to inherit the balance carried in) and then unions per-document detail rows from `viw_salsalescheckingmaster`/`SalSalesCheckingSlave`, `CahReceiptMaster`, `SalSalesInvoiceMaster`, `CahPaymentMaster`, `CahFinancialAdjust`. Groups by date and document id, computing running `d余额` per row. Hands the final dynamic SQL to `Sp_Outstanding_Query` for paging, total counts, and `bFilter`/`sGroupby_*_sql` splicing. + +**Invocation:** Bound as data-source of form 客户流水账 (`gfm.sId=192116810113315318251537560`, module 客户流水账 `192116810113315318250950380` under 常用模块 → 常用设置). Also referenced by `Fun_getInitColumnByProName` (column-introspection helper). Install: `script/标版/30100101/Sp_Receivables_ARAccount.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Receivables_ARDetail.md b/en/docs/auto-catalog/procedures/Sp_Receivables_ARDetail.md index db679e5..f931ca6 100644 --- a/en/docs/auto-catalog/procedures/Sp_Receivables_ARDetail.md +++ b/en/docs/auto-catalog/procedures/Sp_Receivables_ARDetail.md @@ -36,4 +36,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 常用模块 → 常用设置 → 订单-收款明细表 family — per-order AR detail rows broken out by document type. The single procedure serves seven sibling reports (sales / receipts / invoiceable / invoice / adjustment-票据 / adjustment-金额 / refunds), discriminating by `iType`. + +**What it does:** For a given customer (`sCustomerId`) and date range, walks every order's lifecycle: lists `salsalesorderslave` rows, joins delivery (`saldelivergoodsslave`), checking (`salsalescheckingslave`), invoice (`SalSalesInvoiceMaster`), receipt (`CahReceiptMaster`), adjustment (`CahFinancialAdjust`), payment (`CahPaymentMaster`), reject/quality-abnormal slaves. Picks the appropriate slave-money/tax fields per `iType` (`p_sSlaveMoneyField`, `p_sSlaveTaxField`) and unions into a `TmpAll` temp set. Hands the final dynamic SQL to `Sp_Outstanding_Query` for paging, total counts, `bFilter`/`sGroupby_*_sql` splicing. Returns `dNoReceiptMoney`/`dDueReceiptMoney` totals via INOUT. + +**Invocation:** Bound as data-source for seven forms under module 常用设置 (`19211681019715652613160550`): 订单-收款明细表(销售) (`gfm 19211681015115285335200010`), (收款) `19211681015115285344460960`, (应开票) `19211681015115285346418610`, (调整票据) `19211681015115285348627730`, (调整金额) `192116810113315317427032430`, (退款) `192116810113315317431675000`, (开票) `192116810113315317436170150`. Also referenced by `Fun_getInitColumnByProName`. Install: `script/标版/30100101/Sp_Receivables_ARDetail.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Receivables_AR_copy1.md b/en/docs/auto-catalog/procedures/Sp_Receivables_AR_copy1.md index b5aac43..bc5bdac 100644 --- a/en/docs/auto-catalog/procedures/Sp_Receivables_AR_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_Receivables_AR_copy1.md @@ -35,4 +35,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_Receivables_AR` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_Receivables_AR` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Receivables_AR_new.md b/en/docs/auto-catalog/procedures/Sp_Receivables_AR_new.md index 8216069..4dd4467 100644 --- a/en/docs/auto-catalog/procedures/Sp_Receivables_AR_new.md +++ b/en/docs/auto-catalog/procedures/Sp_Receivables_AR_new.md @@ -39,4 +39,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 应收账款 — 应收账款-优化搜索条件 customer/branch variant of `Sp_Receivables_AR`. Adds first-class filter params `sSalesManNameParam` / `sCustomerClassifyNameParam` so the legacy free-form `bFilter` doesn't have to encode 销售员 and 客户分类 splits. Body otherwise mirrors the base AR roll-up: opening balance + period sales + receipts + invoices + payments/adjustments per customer. + +**What it does:** Same `TmpAll` UNION pipeline as `Sp_Receivables_AR`, but pre-builds `p_sWhere` from the two extra params before splicing into the dynamic SQL. Hands the final `SELECT` to `Sp_Outstanding_Query` for paging/`countMapJson`. Returns `dNoReceiptMoney`/`dDueReceiptMoney` as totals. + +**Invocation:** No bindings found. Not referenced by any `gdsconfigformmaster.sSqlStr`, no `gdsmodule` hook, no other routine calls it, no xly-src match. Status: appears orphaned — likely a staging snapshot of the optimised AR report that never got promoted into the live form binding. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Receivables_AR_sd.md b/en/docs/auto-catalog/procedures/Sp_Receivables_AR_sd.md index c645393..ccf1830 100644 --- a/en/docs/auto-catalog/procedures/Sp_Receivables_AR_sd.md +++ b/en/docs/auto-catalog/procedures/Sp_Receivables_AR_sd.md @@ -35,4 +35,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 应收账款 — `_sd` customer/branch override of `Sp_Receivables_AR` (file naming convention: `_<二字简拼>` typically denotes a printer customer). The 结算方式 (settlement-method) annotation on `sStatistics` parameter suggests the variant pre-builds the report keyed on `EleCustomer.sSettleStyleId` rather than the standard customer dimensions. + +**What it does:** Same AR roll-up pipeline as base `Sp_Receivables_AR` (opening balance + period sales + receipts + invoices + adjustments per customer, via `TmpAll` UNION → `Sp_Outstanding_Query`), with the variant's filter clauses adapted to that customer's chart-of-accounts/結算 conventions. + +**Invocation:** No bindings found. Not referenced by `gdsconfigformmaster.sSqlStr`, no `gdsmodule` hook, no other routine calls it, no xly-src match. Status: appears orphaned — customer-specific variant retained without live binding. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Receivables_AR_yh.md b/en/docs/auto-catalog/procedures/Sp_Receivables_AR_yh.md index 67da205..fd6a1e1 100644 --- a/en/docs/auto-catalog/procedures/Sp_Receivables_AR_yh.md +++ b/en/docs/auto-catalog/procedures/Sp_Receivables_AR_yh.md @@ -35,4 +35,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 应收账款 — `_yh` customer/branch override of `Sp_Receivables_AR` (file naming convention: `_<二字简拼>` typically denotes a printer customer). The `加工商ID` (processor id) annotation hints the variant pivots the AR rows by 加工商 (processing subcontractor) instead of pure customer. + +**What it does:** Same AR roll-up pipeline as base `Sp_Receivables_AR` (opening balance + period sales + receipts + invoices + adjustments, via `TmpAll` UNION → `Sp_Outstanding_Query`), with that customer's filter/grouping adapted to their processor-dimensioned AR view. + +**Invocation:** No bindings found. Not referenced by `gdsconfigformmaster.sSqlStr`, no `gdsmodule` hook, no other routine calls it, no xly-src match. Status: appears orphaned — customer-specific variant retained without live binding. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Receivables_ARageDetail.md b/en/docs/auto-catalog/procedures/Sp_Receivables_ARageDetail.md index 0cb4139..ed75733 100644 --- a/en/docs/auto-catalog/procedures/Sp_Receivables_ARageDetail.md +++ b/en/docs/auto-catalog/procedures/Sp_Receivables_ARageDetail.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 应收账款 — 应收账款账龄明细 (AR aging-bucket detail). Companion to `Sp_Receivables_Aging`: where 账龄 (aging) buckets balances into 30/60/90/120/150+ day intervals at the customer/order level, this proc drills into each bucket to list the underlying documents (orders, invoices, deliveries) that contribute to it. The leading `iSelect` parameter picks which dimension (`0`=客户, others=order/invoice level). + +**What it does:** Like the base AR procs, builds a `TmpAll` UNION over `salsalesorderslave`/`viw_salsalescheckingmaster`/`SalSalesCheckingSlave`/`CahReceiptMaster`/`SalSalesInvoiceMaster`/`CahFinancialAdjust`/`CahPaymentMaster`, with each row tagged by aging bucket (`p_dDueSalesMoney60/90/120/150` etc., computed from `tCheckDate` vs `tEndDate`). Hands the dynamic SQL to `Sp_Outstanding_Query` for paging/`countMapJson`/`bFilter` splicing. + +**Invocation:** No bindings found. Not referenced by `gdsconfigformmaster.sSqlStr`, no `gdsmodule` hook, no other routine calls it, no xly-src match. Status: appears orphaned — likely a staging/replaced version of an aging-detail report whose form binding has been redirected elsewhere. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Receivables_Aging.md b/en/docs/auto-catalog/procedures/Sp_Receivables_Aging.md index 15a6dab..851f0de 100644 --- a/en/docs/auto-catalog/procedures/Sp_Receivables_Aging.md +++ b/en/docs/auto-catalog/procedures/Sp_Receivables_Aging.md @@ -35,4 +35,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 应收账款 → 应收账款账龄分析 (AR aging analysis). Same data sources as `Sp_Receivables_AR` but bucketed by overdue interval: 当期未到期, 30日内, 30-60, 60-90, 90-120, 120-150, 150+ 天 — producing the classic accounting aging-summary table per customer. + +**What it does:** Builds the `TmpAll` UNION over `salsalesorderslave`/`viw_salsalescheckingmaster`/`SalSalesCheckingSlave`/`saldelivergoodsslave`/`CahReceiptMaster`/`SalSalesInvoiceMaster`/`CahFinancialAdjust`/`CahPaymentMaster` like base AR. For each row, computes `p_dDueLastBalanceMoney`/`p_dDueThisBalanceMoney` plus per-bucket sums `dDueSalesMoney`, `dDueSalesMoney60`, `…90`, `…120`, `…150` from `tCheckDate` vs `tEndDate`/`tInitDate`. Hands the dynamic SQL to `Sp_Outstanding_Query` for paging, total counts, `bFilter`/`countMapJson` splicing. + +**Invocation:** Called by `Sp_Task_doAgingSmallai` (scheduled Quartz task for the 小ai overdue-AR daily report — installed at `script/标版/30100101/Sp_Task_doAgingSmallai.sql`). No direct `gdsconfigformmaster` binding found in the live db, but the procedure is otherwise the standard 账龄 engine; an aging report form usually wires it. Install: `script/标版/30100101/Sp_Receivables_Aging.sql` (with a customer override at `script/客户/千彩/Sp_Receivables_Aging.sql`). diff --git a/en/docs/auto-catalog/procedures/Sp_Receivables_AgingSmallai.md b/en/docs/auto-catalog/procedures/Sp_Receivables_AgingSmallai.md index 0fe78ae..cc53862 100644 --- a/en/docs/auto-catalog/procedures/Sp_Receivables_AgingSmallai.md +++ b/en/docs/auto-catalog/procedures/Sp_Receivables_AgingSmallai.md @@ -35,4 +35,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 应收账款 — 小ai保驾护航 (AI assistant) edition of the AR aging report. Tailored output shape for the scheduled WeChat/IM message that the 小ai bot pushes to finance — same bucketing as `Sp_Receivables_Aging` but trimmed to the column set the message-template consumes (`dDueLastBalanceMoney, dDueThisBalanceMoney, dDueSalesMoney, dDueSalesMoney60, …90, …120, …150, dNoCheckMoney`). + +**What it does:** Same `TmpAll` UNION pipeline over `salsalesorderslave`/`viw_salsalescheckingmaster`/`CahReceiptMaster`/`SalSalesInvoiceMaster`/`CahFinancialAdjust`/`CahPaymentMaster` as base AR aging, computing the same 当期/30/60/90/120/150 buckets. Result is paged via `Sp_Outstanding_Query`; `countMapJson` returns the summary used by the messaging layer. + +**Invocation:** Called by `Sp_Task_doAgingSmallai` — the Quartz scheduled task ("小ai保驾护航-超期应收") which composes the daily 应收帐款超期未收分析报告. Quartz dispatch lives in `xlyFlow/src/main/java/com/xly/quartz/task/QuartzTask.java` / `TaskServiceImpl`. Install: `script/标版/30100101/Sp_Receivables_AgingSmallai.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Receivables_Warning.md b/en/docs/auto-catalog/procedures/Sp_Receivables_Warning.md index fa080a9..76436be 100644 --- a/en/docs/auto-catalog/procedures/Sp_Receivables_Warning.md +++ b/en/docs/auto-catalog/procedures/Sp_Receivables_Warning.md @@ -33,4 +33,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 应收账款 → 超期未收款 — customer-level overdue-receivables warning. Returns `bOut=1` when the given customer (`sCustomerId`) has receivables past the system 应收预警 threshold, supporting blocking new sales/delivery on the standard "客户应收预警" gate; also paged-listable as a report of all warned customers. + +**What it does:** Reads `Fun_Sis_GetConst('iReceivableType')` / `Fun_Sis_GetConst('tCheckDate')` etc. for the configured warning thresholds, and `p_sLookCustomer` from `SysSystemSettings` for the per-tenant customer scope. Populates temp table `p_tmp_ReceivablesWarning` (`sCustomerNo`, `sCustomerName`, …) by joining receivable balances against the warning rule, then either flips `bOut=1` (when called with a single `sCustomerId`) or hands the result to `Sp_Outstanding_Query` for paging. + +**Invocation:** No bindings found. Not referenced by `gdsconfigformmaster.sSqlStr`, no `gdsmodule` hook, no other routine calls it, only the install script at `script/标版/30100101/Sp_Receivables_Warning.sql`. Status: appears orphaned — the warning-gate proc that no live form/save-hook currently wires up. Candidate for maintainer audit (likely meant to be referenced from a save-hook on 销售订单/送货单). diff --git a/en/docs/auto-catalog/procedures/Sp_Relation_Call_Rep.md b/en/docs/auto-catalog/procedures/Sp_Relation_Call_Rep.md index 7019bbf..624077d 100644 --- a/en/docs/auto-catalog/procedures/Sp_Relation_Call_Rep.md +++ b/en/docs/auto-catalog/procedures/Sp_Relation_Call_Rep.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Generic dynamic-call helper — given a target procedure name plus a delimited param string, builds and executes a CALL statement, then fetches a single OUT variable back. Intended to wrap legacy `Sp_*` procs into a uniform "report call by name" entry point. + +**What it does:** Reads `information_schema.PARAMETERS` for `s_proName` (cursor over ORDINAL_POSITION), splits `s_proParam` by `;`, walks each parameter — for IN it splices the literal value into the CALL list, for OUT/INOUT it splices `@p_name`. Builds `CALL(p1,p2,...)` via `PREPARE`/`EXECUTE`/`DEALLOCATE`, then fires `SELECT ,@ INTO @p_sReturn` to extract the named OUT into `sReturn`. + +**Invocation:** Status: appears orphaned. The body queries `information_schema.PARAMETERS` with `SPECIFIC_SCHEMA = 'xlyweberp'` hard-coded (not the saas multi-tenant schema), and no caller exists in `gdsmodule`, `gdsconfigformmaster`, other routines, or xly-src (only the install script `script/标版/30100101/Sp_Relation_Call_Rep.sql` ships it). Looks like a deprecated dispatcher superseded by `GenericProcedureCallServiceImpl` — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Repair_salsaleschance_Lost.md b/en/docs/auto-catalog/procedures/Sp_Repair_salsaleschance_Lost.md index b08a660..6061969 100644 --- a/en/docs/auto-catalog/procedures/Sp_Repair_salsaleschance_Lost.md +++ b/en/docs/auto-catalog/procedures/Sp_Repair_salsaleschance_Lost.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 商机机会 — bulk-mark sales-opportunity rows as 商机输单 (lost bid). The COMMENT `'商机输单'` and write-back to `salsaleschancemaster (sLostMemo, sLossType, dLossAimMoney, dRivalMoney, iFollowUp=3)` identify it as the lost-bid grid action; companion of `Sp_Repair_salsaleschance_sScrap` (废单/scrapped). + +**What it does:** Parses `sProInParam` JSON (`$.params[*].value[*].sId`) plus `$.changeValue.{textareaValue, sLostMemo, sLostType, dLossAimMoney, dRivalMoney}`. For each `sId`, runs `UPDATE salsaleschancemaster SET sLostMemo, sLossType, dLossAimMoney, dRivalMoney, iFollowUp=3 WHERE sId=... AND iFollowUp=0` — guards on `iFollowUp=0` so already-followed/lost/scrapped rows are skipped. Aborts with `Sp_Sis_GetConst('paramsErro', ...)` and `sCode=-1` on empty input. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 商机机会 grid's 输单 toolbar button names this proc as the action (`Sp_Repair_*` is an alternative naming for the `Sp_BtnEvent_*` slot, sharing the same `sProInParam`/`sMakePerson`/…/`sCode` signature). Not in `gdsmodule`, form-master, or xly-src. diff --git a/en/docs/auto-catalog/procedures/Sp_Repair_salsaleschance_sScrap.md b/en/docs/auto-catalog/procedures/Sp_Repair_salsaleschance_sScrap.md index ab5bd1d..629172e 100644 --- a/en/docs/auto-catalog/procedures/Sp_Repair_salsaleschance_sScrap.md +++ b/en/docs/auto-catalog/procedures/Sp_Repair_salsaleschance_sScrap.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 商机机会 — bulk-mark sales-opportunity rows as 商机废单 (scrapped). The COMMENT `'商机废单'` and write-back to `salsaleschancemaster (sScrapMemo, iFollowUp=2)` identify it as the scrap-bid grid action; companion of `Sp_Repair_salsaleschance_Lost` (输单/lost). + +**What it does:** Parses `sProInParam` JSON (`$.params[*].value[*].sId`) plus `$.changeValue.{textareaValue, sScrapMemo}`. For each `sId`, runs `UPDATE salsaleschancemaster SET sScrapMemo, iFollowUp=2 WHERE sId=... AND iFollowUp=0` — guards on `iFollowUp=0` so already-followed/lost/scrapped rows are skipped. Aborts with `Sp_Sis_GetConst('paramsErro', ...)` and `sCode=-1` on empty input. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 商机机会 grid's 废单 toolbar button names this proc as the action (`Sp_Repair_*` is an alternative naming for the `Sp_BtnEvent_*` slot, sharing the same `sProInParam`/…/`sCode` signature). Not in `gdsmodule`, form-master, or xly-src. diff --git a/en/docs/auto-catalog/procedures/Sp_ReplaceField_Calc.md b/en/docs/auto-catalog/procedures/Sp_ReplaceField_Calc.md index ecf17fd..beb327c 100644 --- a/en/docs/auto-catalog/procedures/Sp_ReplaceField_Calc.md +++ b/en/docs/auto-catalog/procedures/Sp_ReplaceField_Calc.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Formula-engine support — given a master/slave row and a formula sId from `sisformula`, parses each `set @rN_xxx := value` statement out of `sisformula.sFormulaSet` and persists the named parameter+value into `mftcalcparam` so downstream calculators (报价/工艺成本) can look it up. COMMENT `'公式语言转换成sql'` ("formula language → SQL"). + +**What it does:** Loads `sFormulaSet` and Chinese name map `sColTitleName` from `sisformula` for the brand/sub. Splits `sFormulaSet` by `;`, and for each `set @rN_ := ` clause: extracts `p_sName` and `p_sValue`, looks up `p_sChineseName` from the JSON column-title map, then either `INSERT INTO mftcalcparam (sSrcId=sGuid, sSrcSlaveId=sSlaveGuid, sParamName, sChineseName, sParamValue)` when the name still appears in `sDetail`, or `DELETE FROM mftcalcparam` for that key when the name is no longer referenced. Surfaces any externally-set `@sReturn` to the OUT. + +**Invocation:** Called as `CALL Sp_ReplaceField_Calc(...)` from the quotation/work-order parts-standard calculators — `Sp_Quotation__CalcDataPackPartsStd` and `Sp_WorkOrder_CalcDataPackPartsStd_child`. Install scripts ship in `script/标版/30100101/Sp_ReplaceField_Calc_.sql` (with the patch under `script/标版/upgrade/20220321计算获取公式解析/`). diff --git a/en/docs/auto-catalog/procedures/Sp_ReplaceField_Calc_TXT.md b/en/docs/auto-catalog/procedures/Sp_ReplaceField_Calc_TXT.md index fd5704f..2db5cbf 100644 --- a/en/docs/auto-catalog/procedures/Sp_ReplaceField_Calc_TXT.md +++ b/en/docs/auto-catalog/procedures/Sp_ReplaceField_Calc_TXT.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Formula-text rendering helper — given a freeform description `sDetail` and a formula sId from `sisformula`, substitutes every `sisformulacustomizeparam` placeholder (`sName` / `sValue1..sValue21`) into the text so the resulting string reads with concrete values instead of formula tokens. COMMENT `'公式语言转换成sql'`. Sister to `Sp_ReplaceField_Calc` — that one writes into `mftcalcparam`, this one only renders strings. + +**What it does:** Loads the column-title map `sColTitleName` from `sisformula` (normalises to a JSON object), counts and cursors `sisformulacustomizeparam WHERE sParentId = sFormulaGuid ORDER BY iOrder DESC`, fetching each row's `sName, sValue, sValue1..sValue21`. Inside the loop `REPLACE`s each `sName` token in `sDetail` with the matching `sValue*` and writes the rendered text out to `sReturn`. + +**Invocation:** Status: appears orphaned. Not bound to `gdsmodule.sProcName`, form-master sSqlStr, other routines, or anything in xly-src. Likely intended for inline rendering of formula descriptions in the 报价/工艺 forms but currently not wired up — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Report_GetFlowPerson.md b/en/docs/auto-catalog/procedures/Sp_Report_GetFlowPerson.md index f3ad65c..8fc2aa9 100644 --- a/en/docs/auto-catalog/procedures/Sp_Report_GetFlowPerson.md +++ b/en/docs/auto-catalog/procedures/Sp_Report_GetFlowPerson.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Workflow helper — for a given source-bill sId and node name, returns the approver(s) and timing for that node from the Activiti BPMN history (`biz_todo_item` + `biz_flow` + `act_hi_comment`). COMMENT `'获取节点审核人'` ("get node approver"). Intended for reports/print templates that need to render "who approved which step and when". + +**What it does:** Builds a TEMP table `tbFlowPerson(sId, sSlaveId, Id, sItemName, sNodeName, sHideUserName, tToDate, tHandleDate, sMessage)`. Inserts from `biz_todo_item A INNER JOIN (SELECT instance_id FROM biz_flow WHERE sSrcId=sId ORDER BY create_time DESC LIMIT 1) F ON F.instance_id = A.instance_id AND A.node_name = p_sNodeName` — the approval-history rows for the most recent flow on the bill. The `sMessage` column is sub-selected from `act_hi_comment` by task_id. If empty, inserts one placeholder row. Returns the temp table via `SELECT * FROM tbFlowPerson`. + +**Invocation:** Status: appears orphaned. The "Sp_Report_*" naming suggests it was meant for a Jasper print template's data-source, but it's not referenced from `gdsmodule`, form-master sSqlStr, other procedures, or xly-src — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_SalOrder_BillForceComplete.md b/en/docs/auto-catalog/procedures/Sp_SalOrder_BillForceComplete.md index 78e2993..35d72de 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalOrder_BillForceComplete.md +++ b/en/docs/auto-catalog/procedures/Sp_SalOrder_BillForceComplete.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售订单管理 → 销售订单 (`salsalesordermaster`) — master-level "强制完结" toolbar. Flips `bBillComplete=1` on the bill, stamps `tBillCompleteDate=NOW()`, and records `sCompletePerson=sMakePerson`, irreversibly closing the order even if not all lines have shipped. Master-side companion to the line-level `Sp_SalesOrder_BtnOrderComplete` (slave `bSlaveComplete`); naming sibling of `Sp_WorkOrder_BillForceComplete` on the work-order side. + +**What it does:** Validates `sProInParam`, parses `$.params[*].value[*].sId` (master ids) and the reason text `$.changeValue.textareaValue`. For each master id runs `UPDATE salsalesordermaster SET bBillComplete=1, tBillCompleteDate=NOW(), sCompletePerson=sMakePerson WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. The captured `p_sReason` is parsed but never written to the table — likely a TODO; a maintainer should confirm whether a `sBillCompleteMemo` column is expected here. + +**Invocation:** Generic-dispatch button signature `(sProInParam, sMakePerson, sBrId, sSuId, OUT sReturn, OUT sCode)` — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from the 销售订单 master grid's 强制完结 button. No xly-src reference, no gdsmodule row, no other proc references it. Status: live button but reason-text is read and discarded — candidate for maintainer review. diff --git a/en/docs/auto-catalog/procedures/Sp_SalOrder_BtnCancelOrderReview.md b/en/docs/auto-catalog/procedures/Sp_SalOrder_BtnCancelOrderReview.md index bf4cf93..97a274b 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalOrder_BtnCancelOrderReview.md +++ b/en/docs/auto-catalog/procedures/Sp_SalOrder_BtnCancelOrderReview.md @@ -1,7 +1,7 @@ # `Sp_SalOrder_BtnCancelOrderReview` (procedure) -> @author:zhucx - @date: +> @author:zhucx + @date: @describe: @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售订单管理 → 销售订单 (`salsalesorderslave`) — workflow toolbar that withdraws / cancels a 工艺审核 (craftworks-review) approval. Sets `bCraftworksReply=0` on the selected order lines, stamps `tCraftworksReply=SYSDATE()` and records `sCraftworkPerson=sMakePerson`. Paired with `Sp_SalOrder_BtnOrderReview` (the approval variant, `bCraftworksReply=1`); same logic shape as the symmetric `Sp_SalOrder_BtnReturnOrderReview` (which also clears the flag). + +**What it does:** Validates `sProInParam`, parses `$.params[*].value[*].sSlaveId`, and for each line runs `UPDATE salsalesorderslave SET bCraftworksReply=0, tCraftworksReply=SYSDATE(), sCraftworkPerson=sMakePerson WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. + +**Invocation:** Generic-dispatch button signature `(sProInParam, sMakePerson, sBrId, sSuId, OUT sReturn, OUT sCode)` — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from the 销售订单 grid's 取消工艺审核 line-toolbar button. Install script: `script/标版/30100101/Sp_SalOrder_BtnCancelOrderReview.sql`. No xly-src Java caller, no gdsmodule row — binding lives in the grid-button metadata. diff --git a/en/docs/auto-catalog/procedures/Sp_SalOrder_BtnEventClaim.md b/en/docs/auto-catalog/procedures/Sp_SalOrder_BtnEventClaim.md index b005dff..3068c51 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalOrder_BtnEventClaim.md +++ b/en/docs/auto-catalog/procedures/Sp_SalOrder_BtnEventClaim.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售订单管理 → 销售订单 (`salsalesorderslave`) — 研发任务认领 (R&D task claim) button. When a sales order has lines that need new-product development (NPI), an engineer presses 认领 on the grid to take ownership: the proc flips `bClaim=1`, stamps `sClaimPerson=sMakePerson` and `tClaimDate=NOW()`. The commented-out guard "该任务已被认领" suggests the original spec was to refuse re-claim; in the current body the row is overwritten unconditionally. Naming variant in `script/客户/千彩/`: `Sp_Zld_BtnEventClaim` (customer-specific override). + +**What it does:** Validates `sProInParam`, parses `$.params[0].value[*].sSlaveId`. For each line first reads the current `bClaim` (the result `p_bClaimed` is captured but the check is commented out), then unconditionally runs `UPDATE salsalesorderslave SET bClaim=1, sClaimPerson=sMakePerson, tClaimDate=NOW() WHERE sId=p_sTmpId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. + +**Invocation:** Generic-dispatch button signature `(sProInParam, sMakePerson, sBrId, sSuId, OUT sReturn, OUT sCode)` — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from the 销售订单 grid's 认领 line-toolbar button. No xly-src reference for the base proc; the 千彩 customer ships an `Sp_Zld_BtnEventClaim.sql` override. No gdsmodule row, no other proc references it — binding lives in the grid-button metadata. diff --git a/en/docs/auto-catalog/procedures/Sp_SalOrder_BtnOrderReview.md b/en/docs/auto-catalog/procedures/Sp_SalOrder_BtnOrderReview.md index 7ab019f..2f6fcc0 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalOrder_BtnOrderReview.md +++ b/en/docs/auto-catalog/procedures/Sp_SalOrder_BtnOrderReview.md @@ -1,7 +1,7 @@ # `Sp_SalOrder_BtnOrderReview` (procedure) -> @author:zhucx - @date: +> @author:zhucx + @date: @describe: @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售订单管理 → 销售订单 (`salsalesorderslave`) — 工艺审核通过 (craftworks-review approval) button. Sets `bCraftworksReply=1` on the selected order lines, stamps `tCraftworksReply=SYSDATE()` and records `sCraftworkPerson=sMakePerson`. Approval counterpart to `Sp_SalOrder_BtnCancelOrderReview` (which clears the flag back to 0); same flag is also reset by `Sp_SalOrder_BtnReturnOrderReview` (退回). + +**What it does:** Validates `sProInParam`, parses `$.params[*].value[*].sSlaveId`, and for each line runs `UPDATE salsalesorderslave SET bCraftworksReply=1, tCraftworksReply=SYSDATE(), sCraftworkPerson=sMakePerson WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. + +**Invocation:** Generic-dispatch button signature `(sProInParam, sMakePerson, sBrId, sSuId, OUT sReturn, OUT sCode)` — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from the 销售订单 grid's 工艺审核 line-toolbar button. Install script: `script/标版/30100101/Sp_SalOrder_BtnOrderReview.sql`. No xly-src Java caller, no gdsmodule row — binding lives in the grid-button metadata. diff --git a/en/docs/auto-catalog/procedures/Sp_SalOrder_BtnReturnOrderReview.md b/en/docs/auto-catalog/procedures/Sp_SalOrder_BtnReturnOrderReview.md index 696ab73..c8ba6d3 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalOrder_BtnReturnOrderReview.md +++ b/en/docs/auto-catalog/procedures/Sp_SalOrder_BtnReturnOrderReview.md @@ -1,7 +1,7 @@ # `Sp_SalOrder_BtnReturnOrderReview` (procedure) -> @author:zhucx - @date: +> @author:zhucx + @date: @describe: @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售订单管理 → 销售订单 (`salsalesorderslave`) — 工艺审核退回 (craftworks-review reject/return) button. Identical body to `Sp_SalOrder_BtnCancelOrderReview`: clears `bCraftworksReply=0` on the selected order lines and re-stamps `tCraftworksReply=SYSDATE()` and `sCraftworkPerson=sMakePerson`. Two siblings (退回 vs 取消) share one effect because the system distinguishes them only at the button-label level; both undo the approval performed by `Sp_SalOrder_BtnOrderReview`. Candidate for de-duplication. + +**What it does:** Validates `sProInParam`, parses `$.params[*].value[*].sSlaveId`, and for each line runs `UPDATE salsalesorderslave SET bCraftworksReply=0, tCraftworksReply=SYSDATE(), sCraftworkPerson=sMakePerson WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. + +**Invocation:** Generic-dispatch button signature `(sProInParam, sMakePerson, sBrId, sSuId, OUT sReturn, OUT sCode)` — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from the 销售订单 grid's 退回工艺审核 line-toolbar button. No xly-src reference, no gdsmodule row, no other proc references it — binding lives in the grid-button metadata. diff --git a/en/docs/auto-catalog/procedures/Sp_SalSalesCheck.md b/en/docs/auto-catalog/procedures/Sp_SalSalesCheck.md index ed35fdb..8d08893 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalSalesCheck.md +++ b/en/docs/auto-catalog/procedures/Sp_SalSalesCheck.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售送货流程 → 3/4 送货单->销售对帐 → 设定单据->销售对账 — paged "to-be-reconciled" delivery / reject list shown when finance picks lines to bundle into a 销售对账单. Reads the unmatched portion of 送货单 (`saldelivergoodsmaster/slave`) and 销售退货单 (`salrejectgoodsmaster`) and projects the per-line/per-bill totals that the user drags onto a new 对账单. + +**What it does:** Reads `SysSystemSettings` for `NetMoney/NetPrice` rounding and `CbxSrcNoCheck` / `CkxWebNotInFinance` policy switches; builds `TmpSalSalesCheck` (master+slave columns with currency, salesman, gross/tax/foreign-money buckets); fills it from `Viw_SalDeliverGoods`, `viw_saldelivergoodsded`, `Viw_SalRejectGoods` and `viw_Accproductinit` filtered by `Fun_GetLookCustomer`, `bCheck=1`, optional `sCustomerId`, the saved `bFilter`, and the `B1` exclusion (rows already linked through `sMinusSrcId`). Hands the final `SELECT * FROM TmpSalSalesCheck ...` to `Sp_Outstanding_Query` for paging, count, and `bFilter`-splicing. + +**Invocation:** Bound as the data-source of the 设定单据->销售对账 form `gfm.sId=11811781131121915181734332700` (parent module `3/4 送货单->销售对帐` / `sId 11811781131121915179925472440` → 销售送货流程 → KPI流程操作菜单) via `gdsconfigformmaster.sTbName='Sp_SalSalesCheck', sType='proc'`. Install scripts ship in `script/标版/30100101/Sp_SalSalesCheck.sql`, an optimised variant in `script/标版/optimize/`, and a customer override in `script/客户/重庆展印/`. Also referenced inside `Fun_getInitColumnByProName`, `Sp_ProductCarryforward`, `Sp_Receivables_AR_copy1`. diff --git a/en/docs/auto-catalog/procedures/Sp_SalSalesCheck1.md b/en/docs/auto-catalog/procedures/Sp_SalSalesCheck1.md index 547cce0..39ced33 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalSalesCheck1.md +++ b/en/docs/auto-catalog/procedures/Sp_SalSalesCheck1.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售送货流程 → 3/4 送货单->销售对帐 — alternate / experimental variant of `Sp_SalSalesCheck` that joins additional sources (`Viw_SalSalesOrder`, `Viw_MftWorkOrder`, `Viw_SalQualityAbnormal`) into the to-be-reconciled list so the 对账 view can also pick from orders, work orders, and quality-abnormality bills, not just 送货单 / 退货单. + +**What it does:** Same signature and same `TmpSalSalesCheck` shape as `Sp_SalSalesCheck`; reads `CbxSrcNoCheck` / `CkxWebNotInFinance` from `SysSystemSettings`, applies `Fun_GetLookCustomer` scoping, then assembles the union from the four `Viw_*` sources, calls `Sp_Do_UpdateByPageSizeBefore` for paging prep, and returns the final dataset to the form. The `1` suffix is the naming convention for a side-by-side alternate that the integrator can swap into the form binding. + +**Invocation:** Not currently bound to any `gdsconfigformmaster` row (verified against the live DB) — superseded by `Sp_SalSalesCheck` for the 设定单据->销售对账 form (`sId 11811781131121915181734332700`). `Sp_ProductCarryforward` still references it in code paths. Status: appears retired in favour of the default variant — candidate for maintainer audit before removal. diff --git a/en/docs/auto-catalog/procedures/Sp_SalSalesCheckNEW.md b/en/docs/auto-catalog/procedures/Sp_SalSalesCheckNEW.md index 39a3a48..b994853 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalSalesCheckNEW.md +++ b/en/docs/auto-catalog/procedures/Sp_SalSalesCheckNEW.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售送货流程 → 3/4 送货单->销售对帐 — "NEW" rewrite of `Sp_SalSalesCheck` for the 设定单据->销售对账 form. Combines regular 送货 and deduction 送货 (`Viw_SalDeliverGoods` + `Viw_SalDeliverGoodsded`) plus 退货 (`Viw_SalRejectGoods`) in one pass, intended to replace the legacy variant. + +**What it does:** Same `TmpSalSalesCheck` staging shape, same `SysSystemSettings` policy reads (`NetMoney/NetPrice`, `CbxSrcNoCheck`, `CkxWebNotInFinance`), and same `Fun_GetLookCustomer` scoping as the base. Differs by sourcing both regular and deduction delivery views in the same union, and dropping the `viw_Accproductinit` join. Hands the assembled set to `Sp_Outstanding_Query` for paging + `bFilter` splicing. + +**Invocation:** Not currently bound to any `gdsconfigformmaster` row, no `gdsmodule` hook, no other-routine caller, and no xly-src reference. Status: appears orphaned — the 设定单据->销售对账 form still binds the original `Sp_SalSalesCheck`. Candidate for maintainer audit (kept as a swap-in for sites that want the unified deduction view). diff --git a/en/docs/auto-catalog/procedures/Sp_SalSalesCheck_1227.md b/en/docs/auto-catalog/procedures/Sp_SalSalesCheck_1227.md index 6e0cfd2..a79cb44 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalSalesCheck_1227.md +++ b/en/docs/auto-catalog/procedures/Sp_SalSalesCheck_1227.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售对账/开票流程 → 销售对账 (`salsalescheckingmaster` / `salsalescheckingslave`) — date-suffixed snapshot of the standard "未对账印件清单" data-source proc `Sp_SalSalesCheck`, kept around from a 12-27 (Dec 27) build. Same 14-parameter pager signature, same `CbxSrcNoCheck` / `NetMoney` / `NetPrice` / `CkxWebNotInFinance` setting reads, same branch on `p_sBillType` (`delivergoods` etc.) and same `Viw_SalDeliverGoods` join pattern as the production `Sp_SalSalesCheck`. + +**What it does:** Reads SysSystemSettings (`CbxSrcNoCheck` to pick the 未对账来源 bill type, `NetMoney`/`NetPrice` for money/price rounding, `CkxWebNotInFinance` to exclude web-only customers). Computes `Fun_GetLookCustomer(sLoginId,…)` for the see-all-customers filter. Branches on the bill-type setting (送货单 / 工单 / 销售订单 / …) to build a dynamic SQL over `Viw_SalDeliverGoods` etc., projecting the un-checked qty (`A.dProductQty - A.dCheckingQty`) as `dNoCheckingQty` and returning a paged result via the standard `Sp_Outstanding_Query`-style pager glue. + +**Invocation:** Status: **appears orphaned** — date-suffixed backup of `Sp_SalSalesCheck`. No `gdsconfigformmaster.sSqlStr` binds it, no `gdsmodule.sProcName` references it, no other proc in `information_schema.ROUTINES` mentions it, no xly-src script (`30100101/`, `客户/`, `optimize/`, MyBatis mappers, Java) refers to it. The production form uses `Sp_SalSalesCheck` (the canonical version) — this `_1227` snapshot is dead code retained for rollback. Per wiki convention, not expected to be called. diff --git a/en/docs/auto-catalog/procedures/Sp_SalSalesCheck_All.md b/en/docs/auto-catalog/procedures/Sp_SalSalesCheck_All.md index 0c68d4a..f3fc10d 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalSalesCheck_All.md +++ b/en/docs/auto-catalog/procedures/Sp_SalSalesCheck_All.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售对账/开票流程 → 销售对账 (`salsalescheckingmaster` / `salsalescheckingslave`) — variant of the standard "未对账印件清单" data-source proc `Sp_SalSalesCheck` that returns the union of *all* source-bill types (送货单 + 销售订单 + 工单 + …) in one paged listing, rather than the single-type branch the production version picks via `SysSystemSettings.CbxSrcNoCheck`. Pre-stages a temp table `B1` of `sMinusSrcId` from `saldelivergoodsmaster` + `salrejectgoodsmaster` so that delivery notes already replaced by 抵扣/退货 bills are filtered out. + +**What it does:** Reads `NetMoney`/`NetPrice` rounding settings, builds a `B1` temp table of replaced source ids, resolves `Fun_GetLookCustomer` for visibility, then `CREATE TEMPORARY TABLE TmpSalSalesCheck` and inserts from each bill family in turn — selecting `(dProductQty - dCheckingQty) AS dNoCheckingQty` and the standard projection columns. Caller-supplied `bFilter` JSON is rewritten to a WHERE clause via `Fun_bFilter_toWhere(.,'A')` and `@sTableAlias@` is replaced with `A.`. Returns the paged + counted result through the usual `Sp_Outstanding_Query`-style pager glue. + +**Invocation:** Status: **appears orphaned** — `_All` is a feature variant retained alongside the canonical `Sp_SalSalesCheck`. No `gdsconfigformmaster.sSqlStr` binds it, no `gdsmodule.sProcName` references it, no other proc in `information_schema.ROUTINES` mentions it, and `grep -rln Sp_SalSalesCheck_All xly-src` returns no hits. Maintainers should confirm whether this is an experimental successor to `Sp_SalSalesCheck` or stale code; per wiki convention, treat as not-in-production until a binding is re-established. diff --git a/en/docs/auto-catalog/procedures/Sp_SalSalesCheck_YM.md b/en/docs/auto-catalog/procedures/Sp_SalSalesCheck_YM.md index 1944d81..3ae4b15 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalSalesCheck_YM.md +++ b/en/docs/auto-catalog/procedures/Sp_SalSalesCheck_YM.md @@ -34,4 +34,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售送货流程 → 3/4 送货单->销售对帐 → 发出商品未对账月末账龄 — month-end (月末) aging report of un-reconciled 送货 stock. The `_YM` (年月) variant of `Sp_SalSalesCheck` projects every still-open 送货 line into 1-30天 / 31-60天 / 61-90天 / 91-120天 / 121-180天 / 181-360天 / 361天以上 buckets as of `tEndDate` so finance can size the AR-发出 reserve. + +**What it does:** Reads `SysSystemSettings` `NetMoney/NetPrice` rounding; assembles `TmpSalSalesCheck` from `Viw_SalDeliverGoods`, `viw_saldelivergoodsded`, `Viw_SalRejectGoods` and `viw_Accproductinit`; excludes rows already linked via the `B1`/`sMinusSrcId` table; computes the aging bucket from `DATEDIFF(tEndDate, A.tCreateDate)` and writes the bucket amount into the matching `dN_M` column; applies `Fun_GetLookCustomer` scoping, splices `bFilter`, and returns paged results to the form via the standard report contract. + +**Invocation:** Not bound to any `gdsconfigformmaster` row in the live DB and no other-routine caller — but the page heading (`gdsmodule.sChinese` 发出商品未对账月末账龄) is preserved on the file, so the form binding presumably exists under a customer-specific tenant or has been retired. Status: appears orphaned in this tenant — candidate for maintainer audit before removal. diff --git a/en/docs/auto-catalog/procedures/Sp_SalSalesCheck_YanBao.md b/en/docs/auto-catalog/procedures/Sp_SalSalesCheck_YanBao.md index 601c36a..696e78e 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalSalesCheck_YanBao.md +++ b/en/docs/auto-catalog/procedures/Sp_SalSalesCheck_YanBao.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售送货流程 → 3/4 送货单->销售对帐 — 延保 ("warranty / aged-receivable") variant of `Sp_SalSalesCheck` keyed by an explicit slave-row list. Takes the user's already-selected 送货 / 退货 lines (`p_sSlaveId` CSV) plus `iSumQty` and returns the paged 对账 candidate set with master-level aging buckets (1-30天 / 31-60天 / ... / 361天以上 — see `Sp_SalSalesCheck_YM`'s sibling buckets) ready to roll into a 销售对账单. + +**What it does:** Stages a `TmpSalSalesCheck` slave table + a `TmpSalSalesCheckMaster` aggregate; pulls the same view family (`Viw_SalDeliverGoods`, `Viw_SalRejectGoods`, `viw_salsalesorder`, `viw_sgdsemigoodsmatch`, `Viw_SalQualityAbnormal`) but pre-restricts to `FIND_IN_SET(sId, p_sSlaveId)`; applies `Fun_GetLookCustomer` scoping; bucketises aging on `DATEDIFF(NOW(), tCreateDate)`; calls `Sp_Do_UpdateByPageSizeBefore` for paged update of the master totals. Output goes back to the calling form via the standard `pageNum/pageSize/totalCount/countMapJson` contract. + +**Invocation:** Not bound to any `gdsconfigformmaster` row, no `gdsmodule` hook, no other-routine caller in the live DB. Install script ships in `script/标版/30100101/Sp_SalSalesCheck_YanBao.sql`. Status: ships in the standard install but appears unwired in this tenant — candidate for maintainer audit (likely activated by re-pointing the 设定单据->销售对账 form's `sTbName` for sites that use the warranty/aging layout). diff --git a/en/docs/auto-catalog/procedures/Sp_SalSalesCheckded.md b/en/docs/auto-catalog/procedures/Sp_SalSalesCheckded.md index 7eb8c48..ac7dd12 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalSalesCheckded.md +++ b/en/docs/auto-catalog/procedures/Sp_SalSalesCheckded.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售送货流程 → 3/4 送货单->销售对帐 — deductions-only ("ded") variant of `Sp_SalSalesCheck`. Reads only the deduction view `Viw_SalDeliverGoodsded` so the user can reconcile 扣款类送货单 rows separately from regular 送货 lines when the integrator splits the to-be-reconciled list. + +**What it does:** Same `TmpSalSalesCheck` staging shape and same `SysSystemSettings` (`NetMoney/NetPrice`) rounding as the base proc. Builds the to-be-reconciled rows from `Viw_SalDeliverGoodsded` + `salrejectgoodsmaster`, applies the `B1` exclusion of rows already linked via `sMinusSrcId`, scopes by `Fun_GetLookCustomer`, splices `bFilter`, then projects gross/tax/foreign-money buckets to the form via `Sp_Outstanding_Query` paging. + +**Invocation:** Not currently bound to any `gdsconfigformmaster` row, no `gdsmodule` hook, no other-routine caller, and no xly-src reference. Status: appears orphaned — likely a customer/branch fork of `Sp_SalSalesCheck` that the integrator wires in by editing `gdsconfigformmaster.sTbName` on the 设定单据->销售对账 form. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_SalSalesCheckded_copy1.md b/en/docs/auto-catalog/procedures/Sp_SalSalesCheckded_copy1.md index 520b8c8..38a44c3 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalSalesCheckded_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_SalSalesCheckded_copy1.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_SalSalesCheckded` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_SalSalesCheckded` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_SalSalesOrder_CheckUpdate.md b/en/docs/auto-catalog/procedures/Sp_SalSalesOrder_CheckUpdate.md index 580b8d8..0ce9e0c 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalSalesOrder_CheckUpdate.md +++ b/en/docs/auto-catalog/procedures/Sp_SalSalesOrder_CheckUpdate.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售订单 — 销售订单保存插入工艺卡: on order-save (`iFlag=1`) or order-uncheck/withdraw (`iFlag=0`), refreshes the order's 工艺卡 control rows (`salsalesordercontrol` / `salsalesordercontrolcombine`). The control rows are the per-product process-card snapshot that downstream 生产 modules consume when scheduling work orders, so this proc keeps them in sync with whatever the user just edited on the order's slave grid. + +**What it does:** Sets `tNextDate = tCreateDate` on the master if NULL; reads `sCustomerId` / `tAppointDate` from `salsalesordermaster`; validates that every slave line has a non-zero unit price and the master has a non-zero total (returns localised `产品【…】单价为0,请核实确认!` / `产品总金额不能为0!` via `sCode=-1` when not). On `iFlag=1`, stages a `salsalesordercontrol_tmp` from `salsalesorderslave`, applies the diff into `salsalesordercontrol` and the combine bridge `salsalesordercontrolcombine`. On `iFlag=0`, removes the matching control rows so the order can be edited again. + +**Invocation:** No live `gdsmodule.sSaveProName` / `sProcName` hook references this proc and no other routine calls it; the page heading 销售订单保存插入工艺卡 is preserved, and an install script ships at `script/标版/30100101/Sp_SalSalesOrder_CheckUpdate.sql`. Status: appears orphaned in this tenant — likely wired in by customer-specific gdsmodule patches that aren't applied here. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_SaleOrder_ProgressOfImplementation.md b/en/docs/auto-catalog/procedures/Sp_SaleOrder_ProgressOfImplementation.md index 04bc340..8a5aa36 100644 --- a/en/docs/auto-catalog/procedures/Sp_SaleOrder_ProgressOfImplementation.md +++ b/en/docs/auto-catalog/procedures/Sp_SaleOrder_ProgressOfImplementation.md @@ -30,4 +30,12 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 订单(工单)执行情况 — full-lifecycle 订单全生命周期 progress tracker. COMMENT `'订单(工单)执行情况'`. For each 销售订单 line gives master/product fields, work-order qty/date/lag, 成品入库 qty/money/date, in-progress qty (`dProducting`), 送货 qty/money/date/未送 qty, 在途, 销售对账 (sSalesChecking) qty/money/未对账, 发票 qty/money/未发票, 回款 qty/money/已未回款, 结算方式 — i.e. one row collapses the full order→工单→入库→送货→对账→发票→回款 chain. + +**What it does:** Builds the wide TEMP `p_TmpTb` (60+ columns with indexes on sSlaveId/sCustomerId/sProductId/tReportDate), populates the base row set from `Viw_SalSalesOrder` filtered to brand/sub. Applies `Fun_GetLookCustomer(sLoginId, sBrId, sSuId)` for row-level customer scoping. Multiple UPDATE … INNER JOIN passes layer in: work-order from `viw_mftworkorder`, 成品入库 / 在制 / 送货 / 销售对账 / 发票 / 回款 / 退货 from the matching `viw_*` views. Computes lag fields (`iFinishLag`, `iProductInLag`, `iLag`) and currency `dRoundingMoney`. Final dynamic SQL is fed to the standard paging helper for `bFilter`, `pageNum/pageSize`, `totalCount`, `countMapJson`, `sFilterOrderBy`, `sGroupby_*`. + +**Invocation:** Bound as the data source of two 订单执行情况 forms via `gdsconfigformmaster.sSqlStr`: +- `19211681019715708434233300` — 销售订单执行情况 +- `101251240115015897737820980` — 订单执行情况 + +Loaded when the user opens either report grid. xly-src ships the install + multiple upgrade scripts under `script/标版/30100101/`, `script/标版/upgrade/20220114-2862-…/`, `script/标版/upgrade/20220121-2839-…/`, `script/标版/optimize/`, and a customer-override under `script/客户/千彩/Sp_SaleOrder_ProgressOfImplementationNew.sql` — verify which build is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_SaleOrder_ProgressOfImplementationNew.md b/en/docs/auto-catalog/procedures/Sp_SaleOrder_ProgressOfImplementationNew.md index 91830ff..254a907 100644 --- a/en/docs/auto-catalog/procedures/Sp_SaleOrder_ProgressOfImplementationNew.md +++ b/en/docs/auto-catalog/procedures/Sp_SaleOrder_ProgressOfImplementationNew.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 订单(工单)执行情况 — paged lifecycle report that lays out, for each 销售订单 row, every downstream stage of production, delivery, settlement, invoicing and receipt. Updated/replacement variant of the legacy `Sp_SaleOrder_ProgressOfImplementation` proc. + +**What it does:** Builds the temp table `p_TmpTb` keyed on order slave, then `INSERT INTO`s the base rows from `Viw_SalSalesOrder` filtered by `bFilter` (defaults to the last 6 months from `tCreateDate`). Successive `UPDATE`s fold in customer-visibility (`Fun_GetLookCustomer`), 工单下达 (`viw_mftproductionreport`), 委外入库 (`Viw_opsoutsideinstore`/`opsoutsideinstoreslave`), 成品入库 (`Viw_PitProductInStore`/`PitProductInStoreSlave`), 送货 (`viw_saldelivergoods`/`SalDeliverGoodsSlave`), 退货 (`SalRejectGoodsSlave`), 销售对账 (`viw_salsaleschecking`/`SalSalesCheckingSlave`), 发票 (`viw_SalSalesInvoice`/`SalSalesInvoiceSlave`) and 收款 (`CahReceiptSlave`). Final SELECT pages out of `p_TmpTb` using `pageNum/pageSize`, with `countMapJson` aggregating totals from `countCloumn`. + +**Invocation:** No live form-master binding in `gdsconfigformmaster` and no Java/MyBatis hit in xly-src — only the install script `script/标版/30100101/Sp_SaleOrder_ProgressOfImplementationNew.sql` and customer override `script/客户/千彩/Sp_SaleOrder_ProgressOfImplementationNew.sql`. Likely wired through a form-master row not present in this database snapshot (or driven dynamically as a `Sp_SalesQuery*`-style report); maintainer audit recommended before pruning. diff --git a/en/docs/auto-catalog/procedures/Sp_SaleOrder_ProgressOfImplementation_copynew.md b/en/docs/auto-catalog/procedures/Sp_SaleOrder_ProgressOfImplementation_copynew.md index b756553..3e42b8e 100644 --- a/en/docs/auto-catalog/procedures/Sp_SaleOrder_ProgressOfImplementation_copynew.md +++ b/en/docs/auto-catalog/procedures/Sp_SaleOrder_ProgressOfImplementation_copynew.md @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 订单(工单)执行情况 — newer copy variant (`_copynew`) of `Sp_SaleOrder_ProgressOfImplementation`, adding a `sStateParam` selector to filter the report by execution state. COMMENT `'订单(工单)执行情况'`. The base proc is the full-lifecycle 订单全生命周期 progress tracker, joining order/work-order/in-store/deliver/checking/invoice/receipt rows; this variant adds a state filter for the dashboard's tab-switch UX. + +**What it does:** Same shape as `Sp_SaleOrder_ProgressOfImplementation`: builds the wide TEMP `p_TmpTb` (60+ columns spanning master, product, work-order, in-store, delivery, sales-checking, invoice, receipt, lag indicators, brand/sub), populates from `Viw_SalSalesOrder` / `viw_mftworkorder` / `viw_pitproductinstore` / `viw_SalDeliverGoods` / `viw_SalSalesChecking` / `viw_SalSalesInvoice` / `viw_CahReceipt` etc. via dynamic-SQL INSERT + several UPDATE … INNER JOIN passes, then hands to the standard paging helper. The added `sStateParam` slot lets the form constrain the result set without rebuilding `bFilter`. + +**Invocation:** Status: appears orphaned in this DB snapshot. The base `Sp_SaleOrder_ProgressOfImplementation` is bound to forms `19211681019715708434233300` (销售订单执行情况) and `101251240115015897737820980` (订单执行情况) via `gdsconfigformmaster.sSqlStr`, but the `_copynew` variant is not — likely a WIP swap-in superseded by the base proc, or a customer-specific copy not yet wired in. Candidate for maintainer audit (consolidate or wire up). diff --git a/en/docs/auto-catalog/procedures/Sp_SaleOrder_ProocessImplementation.md b/en/docs/auto-catalog/procedures/Sp_SaleOrder_ProocessImplementation.md index 72bbf3d..2c12a02 100644 --- a/en/docs/auto-catalog/procedures/Sp_SaleOrder_ProocessImplementation.md +++ b/en/docs/auto-catalog/procedures/Sp_SaleOrder_ProocessImplementation.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 订单全生命周期 — paged report (note the typo `Prooces…` in the proc name) that walks each `salsalesorderslave` row through 工单 → 文件确认 → 首工序开工 → 成品入库 → 发货 → 对账 → 发票 → 收款, exposing per-stage qty, money and lag metrics so sales can see where individual orders are stuck. + +**What it does:** Parses `bFilter` via `Fun_bFilter_toWhere`, replaces `@sTableAlias@` with `A.`, defaults the period to the last six months and builds `p_TmpTb` from `viw_salsalesorder`. Successive joins/updates pull figures and dates from `viw_mftproductionreport`, `Viw_opsoutsideinstore`/`opsoutsideinstoreslave`, `Viw_PitProductInStore`/`PitProductInStoreSlave`/`PitProductRejectSlave`, `viw_saldelivergoods`/`SalDeliverGoodsSlave`/`SalRejectGoodsSlave`, `viw_salsaleschecking`/`SalSalesCheckingSlave`, `viw_salsalesinvoice`/`SalSalesInvoiceSlave` and `CahReceiptSlave`. The page slice is emitted via the standard `Sp_Outstanding_Query`-style trailer (`pageNum/pageSize`, `countMapJson`). + +**Invocation:** Status: appears orphaned. No `gdsconfigformmaster` binding, no other-routine caller, no xly-src reference (not even an install script). Sister proc `Sp_SaleOrder_ProgressOfImplementationNew` covers the same business surface — likely the surviving variant; candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_SaleOrderlist_BtnEventCraftworkDo.md b/en/docs/auto-catalog/procedures/Sp_SaleOrderlist_BtnEventCraftworkDo.md index d61a8a5..0a98ab2 100644 --- a/en/docs/auto-catalog/procedures/Sp_SaleOrderlist_BtnEventCraftworkDo.md +++ b/en/docs/auto-catalog/procedures/Sp_SaleOrderlist_BtnEventCraftworkDo.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售 / 工艺 — 订单交接表 page's 拒绝接收 button handler. When the craftworks (工艺) reviewer cannot accept an order line for technical reasons (typically incomplete 齐套), this records the rejection plus a free-text memo back onto the order slave so sales/PMC can react. + +**What it does:** Parses `$.params[*].value[*].sSlaveId` from `sProInParam` and `$.changeValue[*].textareaValue` (the operator's reason). For each slave id, `UPDATE salsalesorderslave SET iReplyCount = ifnull(iReplyCount,0)+1, iReplyResult = 1, tCraftworksReply = NOW(), sCraftworksMemo = ` scoped to `sBrandsId=sBrId AND sSubsidiaryId=sSuId`. Aborts with `Sp_Sis_GetConst('paramsErro')` when the JSON payload is too short. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — 订单交接表 grid's 拒绝接收 toolbar button names this proc as the action. Companion procs: `Sp_SaleOrderlist_BtnEventCraftworkOk` (accept) and `Sp_SaleOrderlist_BtnEventSaleDepartDo` (业务部 reply). Install script: `script/标版/30100101/Sp_SaleOrderlist_BtnEventCraftworkDo.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_SaleOrderlist_BtnEventCraftworkOk.md b/en/docs/auto-catalog/procedures/Sp_SaleOrderlist_BtnEventCraftworkOk.md index 57a5d34..8734529 100644 --- a/en/docs/auto-catalog/procedures/Sp_SaleOrderlist_BtnEventCraftworkOk.md +++ b/en/docs/auto-catalog/procedures/Sp_SaleOrderlist_BtnEventCraftworkOk.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售 / 工艺 — 订单交接表 page's ok button handler. When the craftworks (工艺) reviewer accepts an order line for production, this records the acknowledgement on the order slave so sales/PMC can move to 业务部 response and downstream 下达生产. + +**What it does:** Parses `$.params[*].value[*].sSlaveId` from `sProInParam`. For each slave id, `UPDATE salsalesorderslave SET iReplyCount = ifnull(iReplyCount,0)+1, iReplyResult = 3, tCraftworksReply = NOW(), sCraftworksMemo = '接收OK'` scoped to `sBrandsId=sBrId AND sSubsidiaryId=sSuId`. Aborts with `Sp_Sis_GetConst('paramsErro')` when the JSON payload is too short. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — 订单交接表 grid's ok toolbar button names this proc as the action. Inverse: `Sp_SaleOrderlist_BtnEventCraftworkDo` (拒绝接收, sets `iReplyResult=1`). Install script: `script/标版/30100101/Sp_SaleOrderlist_BtnEventCraftworkOK.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_SaleOrderlist_BtnEventSaleDepartDo.md b/en/docs/auto-catalog/procedures/Sp_SaleOrderlist_BtnEventSaleDepartDo.md index f33075a..f1d1598 100644 --- a/en/docs/auto-catalog/procedures/Sp_SaleOrderlist_BtnEventSaleDepartDo.md +++ b/en/docs/auto-catalog/procedures/Sp_SaleOrderlist_BtnEventSaleDepartDo.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售 — 订单交接表 page's 业务部 响应 button handler. After 工艺 has reviewed an order line, the business desk acknowledges (with or without an exception memo) before the order can flow to 下达生产. + +**What it does:** Parses `$.params[*].value[*].sSlaveId` and the optional `$.changeValue[*].textareaValue` memo from `sProInParam`. For each slave id, `UPDATE salsalesorderslave SET iReplyCount = ifnull(iReplyCount,0)+1, iReplyResult = 2, sSaleDepartMemo = , tSaleDepartReply = NOW()` scoped to `sBrandsId=sBrId AND sSubsidiaryId=sSuId`. Aborts with `Sp_Sis_GetConst('paramsErro')` when the JSON payload is too short. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — 订单交接表 grid's 业务部响应 toolbar button names this proc as the action. Sibling buttons: `Sp_SaleOrderlist_BtnEventCraftworkOk`/`Sp_SaleOrderlist_BtnEventCraftworkDo`. Install script: `script/标版/30100101/Sp_SaleOrderlist_BtnEventSaleDepartDo.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Sale_OrderCompleteApply.md b/en/docs/auto-catalog/procedures/Sp_Sale_OrderCompleteApply.md index 54877d6..32ebe0c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sale_OrderCompleteApply.md +++ b/en/docs/auto-catalog/procedures/Sp_Sale_OrderCompleteApply.md @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售订单 — paged report of 销售订单 (sales orders) whose 送货完结 status still needs operator action: rows where `bDeliverComplete=0 AND bInvalid=0 AND bCheck=1`. Used by the 订单完结申请 grid that lets sales/operations apply for "mark this order delivered/complete" against the order-progress flow. + +**What it does:** Builds the wide TEMP `p_TmpTb` (customer + product + sales-rep + qty/money/delivery + completion fields), populates it via dynamic SQL `INSERT INTO p_TmpTb … SELECT … FROM Viw_SalSalesOrder WHERE bDeliverComplete=0 AND bInvalid=0 AND bCheck=1 AND brand/sub`. Applies `Fun_GetLookCustomer(sLoginId, sBrId, sSuId)` as a row-level customer filter. Joins (UPDATE … INNER JOIN) to update: 成品入库 `dProductInStoreQty` from `viw_PitProductInStore`, 发外入库 (`viw_opsoutsideinstore`) summed into `dProductStoreQty`, 送货数 `dDeliverGoodsQty` from `viw_SalDeliverGoods`, 库存数 from `eleproductstock`. Hands the final SQL to the standard paging helper for `bFilter`, `sFilterOrderBy`, `sGroupby_*`, `pageNum/pageSize`, `totalCount`, `countMapJson`. + +**Invocation:** Status: appears orphaned in this DB snapshot. Signature matches the standard form-master report contract `(sBrId, sSuId, sLoginId, bFilter, pageNum, pageSize, OUT totalCount, countCloumn, OUT countMapJson, sFilterOrderBy, sGroupby_*)` — expected to be bound to a form via `gdsconfigformmaster.sSqlStr`, but no binding exists here. xly-src ships install + optimize scripts (`script/标版/30100101/`, `script/标版/optimize/`). Candidate for maintainer audit — verify which form sources this proc in production. diff --git a/en/docs/auto-catalog/procedures/Sp_Sale_OrderCompleteDoing.md b/en/docs/auto-catalog/procedures/Sp_Sale_OrderCompleteDoing.md index 9dc3f98..d932c65 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sale_OrderCompleteDoing.md +++ b/en/docs/auto-catalog/procedures/Sp_Sale_OrderCompleteDoing.md @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售订单 — paged report of orders that are 送货完结 at the master level but still have un-completed slave rows: `bInvalid=0 AND bCheck=1 AND bDeliverComplete=1 AND bSlaveComplete=0`. Used by the "完结处理中" (completion-in-progress) grid — the inverse window of `Sp_Sale_OrderCompleteApply`. + +**What it does:** Mirrors `Sp_Sale_OrderCompleteApply` minus the secondary `UPDATE` joins to inventory/delivery views — builds TEMP `p_TmpTb` of order-slave rows with customer/product/sales-rep/qty/money/delivery fields, inserts dynamic SQL `INSERT INTO p_TmpTb … FROM Viw_SalSalesOrder WHERE bInvalid=0 AND bCheck=1 AND bDeliverComplete=1 AND bSlaveComplete=0 AND brand/sub`, applies `Fun_GetLookCustomer(sLoginId, sBrId, sSuId)` row-level customer filter, then hands the SQL to the standard paging helper for `bFilter`, `sFilterOrderBy`, `sGroupby_*`, paging, `totalCount`, `countMapJson`. + +**Invocation:** Status: appears orphaned in this DB snapshot. Signature matches the standard form-master report contract; expected to bind via `gdsconfigformmaster.sSqlStr`, but no binding exists here. Install script ships in `script/标版/30100101/Sp_Sale_OrderCompleteDoing.sql`. Candidate for maintainer audit — verify the form that sources this proc in production (likely paired with `Sp_Sale_OrderCompleteApply` on the order-completion dashboard). diff --git a/en/docs/auto-catalog/procedures/Sp_Sale_ProductInventory_Outdated.md b/en/docs/auto-catalog/procedures/Sp_Sale_ProductInventory_Outdated.md index 649ad32..9503d19 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sale_ProductInventory_Outdated.md +++ b/en/docs/auto-catalog/procedures/Sp_Sale_ProductInventory_Outdated.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售 / 库存 → 呆滞产品 (stale-inventory) dashboard — paged report of finished goods in `eleproductstock` with positive qty that have not been moved through 成品入库 (`viw_pitproductinstore`) recently, grouped by 呆滞天数 buckets (0-30天 / 30-60天 / 60-90天 / 90-180天 / 180天以上). Drives the sales/inventory team's stale-product review and KPI 呆滞 (obsolete) flagging. + +**What it does:** Builds TEMP `TMP_TmpDatedProducts` (clone of `eleproductstock` plus `dLastUseDayBefore` = days since the last 成品入库 of that product on `sFormId='192116810113315228246447250'`). Inserts current stock filtered to `dProductQty>0` and brand/sub. Adds many display columns (product/customer/warehouse names, sales-rep, order/qty/price/money, in-store qty, deliver qty, 呆滞 KPI fields). Populates them via `UPDATE … INNER JOIN eleproduct/elecustomer/siswarehouse/viw_mftworkorder/viw_salsalesorder/sissalesman/viw_pitproductinstore`. Computes `bDeliverComplete` per slave; bins `dLastUseDayBefore` into `Scycle` text. Hands the final SQL to the standard paging helper for `bFilter`, `pageNum/pageSize`, `totalCount`, `countMapJson`, `sFilterOrderBy`, `sGroupby_*`. + +**Invocation:** Status: appears orphaned in this DB snapshot. Signature matches the form-master report contract (with extras `iType`, `sUnTaskFormId`); expected to bind to a 呆滞产品 form via `gdsconfigformmaster.sSqlStr`, but no binding exists here. Install + optimize scripts ship in `script/标版/30100101/` and `script/标版/optimize/Sp_Sale_ProductInventory_Outdated.sql`. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_SalesInvoicing_CheckUpdate.md b/en/docs/auto-catalog/procedures/Sp_SalesInvoicing_CheckUpdate.md index cdbe8a9..636110a 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalesInvoicing_CheckUpdate.md +++ b/en/docs/auto-catalog/procedures/Sp_SalesInvoicing_CheckUpdate.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售对账/开票流程 → 销售对账 (`salsalescheckingmaster` / `salsalescheckingslave` / `salsalescheckingchild`); body comment 销售对账&开票单据保存后校验. POST-save validator that enforces the two business rules a 销售对账 must obey before the row can be persisted: every 送货单 (`sSrcNo`) may appear only once, and all lines must come from one and the same customer. It also redistributes the per-child `dProductQty` so each child's allocation cannot exceed the remaining `dProductQty - dCheckingQty` on the source `saldelivergoodsslave`. + +**What it does:** (1) Aggregates `salsalescheckingslave` by `sSrcNo,sSrcSlaveId` for `sParentId=sGuid` and rejects with localised `sDeliveryNoDuplicate` (送货单号重复选择,请核实删除) if any combination repeats; (2) joins through `saldelivergoodsmaster→elecustomer` and rejects with `sDeliveryNoNeedSameCustomer` if more than one customer is in the basket; (3) for each slave row, opens nested cursors that compute the maximum sellable quantity `MIN(SUM(dProductQty)/MAX(dCoefficient))` over `salsalescheckingchild + saldelivergoodsslave` and rejects with `sOrderProductQtyUp` if the slave qty exceeds it, otherwise re-allocates `dProductQty` across child rows in `iIncrement` order; (4) recomputes `dProductForeignPrice` on return-style rows (`sSrcNo LIKE '%XSTH%'`); (5) chains to `CALL Sp_Check_sSck` for the standard 销售对账 post-save check. + +**Invocation:** Naming pattern + `(sGuid,sFormGuid,sLoginId,sBrId,sSuId,OUT sCode,OUT sReturn)` signature places this as a `gdsmodule.sSaveProName` POST-save hook on the 销售对账单据 form (module sId `11811781131121915184849572550`) — runs after `BusinessBaseServiceImpl.addUpdateDelBusinessData` persists the bill. No xly-src caller; not referenced from any other proc. The trailing `CALL Sp_Check_sSck` ties it to the same bill family. diff --git a/en/docs/auto-catalog/procedures/Sp_SalesMaterials_Memo1.md b/en/docs/auto-catalog/procedures/Sp_SalesMaterials_Memo1.md index c50b937..75165c8 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalesMaterials_Memo1.md +++ b/en/docs/auto-catalog/procedures/Sp_SalesMaterials_Memo1.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 工单子表 (`mftworkorderslave`) — 车间主管反馈 button-event handler that writes the first feedback slot (`sFeedBack1Memo`, `sFeedBack1Name`, `tFeedBack1Date`) on selected work-order slave rows. Sibling pair: `Sp_SalesMaterials_Memo2` (slot 2), `Sp_SalesMaterials_Memo3` (slot 3, also flips `bSucceed`). The "Sales" in the name is a misnomer — the proc updates the manufacturing work-order slave, not anything in `sal*`. + +**What it does:** Parses `$.params[*].value[*].sSlaveId` and `$.changeValue.sFeedBack1Memo` from `sProInParam`. Rejects with `sCode=-1, sReturn=Fun_Sis_GetConst('sEnterFeedBack')` (请输入反馈内容) if the memo is empty. Otherwise loops over every `sSlaveId` and runs `UPDATE mftworkorderslave SET sFeedBack1Memo=…, sFeedBack1Name=sMakePerson, tFeedBack1Date=NOW() WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. + +**Invocation:** Generic-dispatch button signature `(sProInParam, sMakePerson, sUserId, sBrId, sSuId, OUT sReturn, OUT sCode)` — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` when a 车间主管反馈(1) toolbar button on a 工单 grid posts to `/procedureCall/doGenericProcedureCall` with this name. No xly-src reference, no gdsmodule binding, no other proc references it — status: appears orphaned / candidate for maintainer audit (likely a customer-specific button that lost its grid configuration). diff --git a/en/docs/auto-catalog/procedures/Sp_SalesMaterials_Memo2.md b/en/docs/auto-catalog/procedures/Sp_SalesMaterials_Memo2.md index d7dba2f..e84516c 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalesMaterials_Memo2.md +++ b/en/docs/auto-catalog/procedures/Sp_SalesMaterials_Memo2.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 工单子表 (`mftworkorderslave`) — 车间主管反馈 button-event handler that writes the second feedback slot (`sFeedBack2Memo`, `sFeedBack2Name`, `tFeedBack2Date`) on selected work-order slave rows. Slot-2 sibling of `Sp_SalesMaterials_Memo1`; slot-3 sibling `Sp_SalesMaterials_Memo3` also flips `bSucceed`. Despite the `Sp_SalesMaterials_*` prefix the proc targets the manufacturing work-order slave, not anything in `sal*`. + +**What it does:** Parses `$.params[*].value[*].sSlaveId` and `$.changeValue.sFeedBack2Memo` from `sProInParam`. Rejects with `sCode=-1, sReturn=Fun_Sis_GetConst('sEnterFeedBack')` (请输入反馈内容) if the memo is empty. Otherwise loops over every `sSlaveId` and runs `UPDATE mftworkorderslave SET sFeedBack2Memo=…, sFeedBack2Name=sMakePerson, tFeedBack2Date=NOW() WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. + +**Invocation:** Generic-dispatch button signature `(sProInParam, sMakePerson, sUserId, sBrId, sSuId, OUT sReturn, OUT sCode)` — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` when a 车间主管反馈(2) toolbar button posts to `/procedureCall/doGenericProcedureCall` with this name. No xly-src reference, no gdsmodule binding, no other proc references it — status: appears orphaned / candidate for maintainer audit (likely a customer-specific button that lost its grid configuration). diff --git a/en/docs/auto-catalog/procedures/Sp_SalesMaterials_Memo3.md b/en/docs/auto-catalog/procedures/Sp_SalesMaterials_Memo3.md index 5d276ae..f7cd744 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalesMaterials_Memo3.md +++ b/en/docs/auto-catalog/procedures/Sp_SalesMaterials_Memo3.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 工单子表 (`mftworkorderslave`) — 车间主管反馈 button-event handler for slot 3. In addition to writing `sFeedBack3Memo`, `sFeedBack3Name`, `tFeedBack3Date` (like slots 1/2), it also flips the success flag `bSucceed` carried in `changeValue`, marking the work-order line as "fed back successfully" or "failed". Slot-3 sibling of `Sp_SalesMaterials_Memo1` / `Sp_SalesMaterials_Memo2`. Despite the `Sp_SalesMaterials_*` prefix the proc targets the manufacturing work-order slave, not anything in `sal*`. + +**What it does:** Parses `$.params[*].value[*].sSlaveId`, `$.changeValue.sFeedBack3Memo`, and `$.changeValue.bSucceed` from `sProInParam`. Rejects with `sCode=-1, sReturn=Fun_Sis_GetConst('sEnterFeedBack')` (请输入反馈内容) if the memo is empty. Otherwise loops over every `sSlaveId` and runs `UPDATE mftworkorderslave SET sFeedBack3Memo=…, sFeedBack3Name=sMakePerson, tFeedBack3Date=NOW(), bSucceed=p_bSucceed WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. + +**Invocation:** Generic-dispatch button signature `(sProInParam, sMakePerson, sUserId, sBrId, sSuId, OUT sReturn, OUT sCode)` — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` when a 车间主管反馈(3) toolbar button posts to `/procedureCall/doGenericProcedureCall` with this name. No xly-src reference, no gdsmodule binding, no other proc references it — status: appears orphaned / candidate for maintainer audit (likely a customer-specific button that lost its grid configuration). diff --git a/en/docs/auto-catalog/procedures/Sp_SalesOrder_Analysis.md b/en/docs/auto-catalog/procedures/Sp_SalesOrder_Analysis.md index 00495ca..936355e 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalesOrder_Analysis.md +++ b/en/docs/auto-catalog/procedures/Sp_SalesOrder_Analysis.md @@ -35,4 +35,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售分析 — 销售订单分析报表 data-source. Pivot report keyed by configurable `sGroupType` (客户 / 业务员 / 产品 / 业务部门 / …), aggregating sales-order or 报价 bills across a date range. Returns one row per dimension+`sCurrency` combo with totals: `dProductMoney` (含税金额), `dProductNoTaxMoney` (不含税), `dProductTaxMoney` (税额), `dProductQty` (数量), `dProductForeignMoney` (外币). Also returns a dynamic `sColumnNameConfig` so the grid can render the show-hide column choices the user saved. + +**What it does:** Resolves the date range (`tStartDate` is the string `start,end`; default = last 12 months), sets `p_sDateType` / `p_sGroupType` / `p_sBillType` from the input flags. Creates temp table `p_SalesOrder_Analysis` and emits a `Fun_get_show_config` row per displayed column (编号 / 币别 / 名称 / 总计-金额 / 不含税 / 税额 / 总数量 / 外币金额, …) accumulating the JSON config in `p_sColumnNameConfig`. Then it branches on `sBillType` (`salsalesorder` / `salquotation` / etc.) and `sGroupType` to build the dynamic insert into the temp table, joining `viw_salsalesorder` (or equivalent) to dimension tables (`elecustomer`, `SisSalesMan`, `eleproduct`, …) filtered to the date range and `bInvalid=0`. Final SELECT runs through the standard pager (`Sp_Outstanding_Query` shape) with `bFilter` → WHERE translation and grouping driven by `sGroupby_select_sql` / `sGroupby_group_sql`. + +**Invocation:** Standard 报表 data-source signature (17 params ending in `sColumnNameConfig OUT`). Status: **appears orphaned in this snapshot** — no `gdsconfigformmaster.sSqlStr` matches in current DB, no `gdsmodule` ties it as a procName, no other proc references it, no install-script call beyond the self-defining `script/标版/30100101/Sp_SalesOrder_Analysis.sql`. The corresponding form is likely customer-seeded; if missing in your tenant, the report won't show. Candidate for maintainer audit to confirm whether a 销售订单分析 form-master row needs to be re-installed. diff --git a/en/docs/auto-catalog/procedures/Sp_SalesOrder_BtnOrderComplete.md b/en/docs/auto-catalog/procedures/Sp_SalesOrder_BtnOrderComplete.md index 87bb7b9..8d17b7b 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalesOrder_BtnOrderComplete.md +++ b/en/docs/auto-catalog/procedures/Sp_SalesOrder_BtnOrderComplete.md @@ -1,7 +1,7 @@ # `Sp_SalesOrder_BtnOrderComplete` (procedure) -> @author:zhucx - @date: +> @author:zhucx + @date: @describe: @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售订单管理 → 销售订单 (`salsalesorderslave`) — line-level "完结" toolbar that flips `bSlaveComplete=1` on the selected order lines. Pair: `Sp_SalesOrder_BtnOrderCompleteApply` is the editable variant that lets the operator attach a memo and runs the `valueKey`/`changeValue` SQL-merge pattern; this one is the simple yes-button that just marks lines complete with no extra fields. Distinct from `Sp_SalOrder_BillForceComplete`, which closes the entire bill at master level. + +**What it does:** Validates `sProInParam`, parses `$.params[*].value[*].sSlaveId`, then for each line runs `UPDATE salsalesorderslave SET bSlaveComplete = 1 WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. + +**Invocation:** Generic-dispatch button signature `(sProInParam, sMakePerson, sBrId, sSuId, OUT sReturn, OUT sCode)` (no `sUserId`) — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from the 销售订单 grid's 完结 line-toolbar button. Install script: `script/标版/30100101/Sp_SalesOrder_BtnOrderComplete.sql`. No xly-src Java caller, no gdsmodule binding row — the binding lives in the grid-button metadata that the front-end pushes into the dispatcher. diff --git a/en/docs/auto-catalog/procedures/Sp_SalesOrder_BtnOrderCompleteApply.md b/en/docs/auto-catalog/procedures/Sp_SalesOrder_BtnOrderCompleteApply.md index d4ba4c2..16641b1 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalesOrder_BtnOrderCompleteApply.md +++ b/en/docs/auto-catalog/procedures/Sp_SalesOrder_BtnOrderCompleteApply.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售订单管理 → 销售订单 (`salsalesorderslave`) — "申请完结" (apply-to-complete) toolbar that flips the order-line's `bDeliverComplete=1`, stamps `tDeliverCompleteDate=SYSDATE()`, and stores the operator's textarea message into `sDeliverCompleteMemo`. Also runs the standard generic-grid `valueKey`/`changeValue` SQL-merge pattern, so any extra columns named in `valueKey` are merged into the same UPDATE. Distinct from `Sp_SalesOrder_BtnOrderComplete`, which is the simple toggle with no memo. + +**What it does:** Validates `sProInParam`, splits `$.changeValue.valueKey` on commas and builds `p_setSql` as `col1=val1, col2=val2, …` from `$.changeValue[0].colN`. Appends `bDeliverComplete = 1, tDeliverCompleteDate=SYSDATE(), sDeliverCompleteMemo=` to the SET-clause. For each `sSlaveId` in `$.params[*].value[*]` it CONCATs the prepared statement `UPDATE salsalesorderslave SET WHERE sId=p_sTmpId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId` and executes it via PREPARE/EXECUTE. + +**Invocation:** Generic-dispatch button signature `(sProInParam, sMakePerson, sBrId, sSuId, OUT sReturn, OUT sCode)` — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from the 销售订单 grid's 申请完结 line-toolbar button. Install script: `script/标版/30100101/Sp_SalesOrder_BtnOrderCompleteApply.sql` (also bundled in `Sp_SalesOrder_BtnOrderComplete.sql`). No xly-src Java caller, no gdsmodule row — binding lives in the front-end grid-button metadata. diff --git a/en/docs/auto-catalog/procedures/Sp_SalesOrder_KpiObsoleteClose.md b/en/docs/auto-catalog/procedures/Sp_SalesOrder_KpiObsoleteClose.md index ae6c4c4..0365d34 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalesOrder_KpiObsoleteClose.md +++ b/en/docs/auto-catalog/procedures/Sp_SalesOrder_KpiObsoleteClose.md @@ -1,7 +1,7 @@ # `Sp_SalesOrder_KpiObsoleteClose` (procedure) -> @author:zhucx - @date: +> @author:zhucx + @date: @describe: @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售订单管理 → 销售订单 KPI 跟踪 (`salsalesorderslave`) — toolbar that marks an order line as "已作废 / 已结案" for KPI purposes: sets `bKpiObsolete=1` and stamps `tKpiObsoleteCloseDate=SYSDATE()` so the operator's quote-then-lose case is closed out of the open-KPI pipeline. Paired with `Sp_SalesOrder_KpiObsoleteMemo` (the memo-edit variant) and the parallel quotation-side pair `Sp_SalesOrder_KpiQuoClose` / `Sp_SalesOrder_KpiQuoMemo`. + +**What it does:** Validates `sProInParam`, parses `$.params[*].value[*].sOrderSlaveId`, and for each line runs `UPDATE salsalesorderslave SET bKpiObsolete=1, tKpiObsoleteCloseDate=SYSDATE() WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. + +**Invocation:** Generic-dispatch button signature `(sProInParam, sMakePerson, sBrId, sSuId, OUT sReturn, OUT sCode)` — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from a KPI-tracking grid button (likely on a 销售订单 KPI 跟踪 board). Install script: `script/标版/30100101/Sp_SalesOrder_KpiObsoleteClose.sql`. No xly-src Java caller, no gdsmodule row — binding lives in the grid-button metadata. diff --git a/en/docs/auto-catalog/procedures/Sp_SalesOrder_KpiObsoleteMemo.md b/en/docs/auto-catalog/procedures/Sp_SalesOrder_KpiObsoleteMemo.md index 90a29f4..5e4bc49 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalesOrder_KpiObsoleteMemo.md +++ b/en/docs/auto-catalog/procedures/Sp_SalesOrder_KpiObsoleteMemo.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售订单管理 → 销售订单 KPI 跟踪 (`salsalesorderslave`) — toolbar that lets the operator attach a 作废原因 / 结案备注 to a KPI-obsolete order line: writes `sKpiObsoleteMemo` (and any extra fields named in `valueKey`). Edit-variant of `Sp_SalesOrder_KpiObsoleteClose`, which is the simple flag-flip. Sibling 报价侧: `Sp_SalesOrder_KpiQuoMemo`. + +**What it does:** Validates `sProInParam`, parses `$.params[*].value[*].sOrderSlaveId` and `$.changeValue.textareaValue`. Splits `$.changeValue.valueKey` on commas and builds `p_setSql` from `$.changeValue[0].colN` so any extra grid-editable columns are merged in. Appends `sKpiObsoleteMemo=` to the SET-clause. For each `sOrderSlaveId` it CONCATs and PREPARE/EXECUTEs `UPDATE salsalesorderslave SET WHERE sId=p_sTmpId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. + +**Invocation:** Generic-dispatch button signature `(sProInParam, sMakePerson, sBrId, sSuId, OUT sReturn, OUT sCode)` — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from the KPI-tracking grid's memo-edit button. Install script: `script/标版/30100101/Sp_SalesOrder_KpiObsoleteMemo.sql`. No xly-src Java caller, no gdsmodule row — binding lives in the grid-button metadata. diff --git a/en/docs/auto-catalog/procedures/Sp_SalesOrder_KpiQuoClose.md b/en/docs/auto-catalog/procedures/Sp_SalesOrder_KpiQuoClose.md index ed41ef5..54a2700 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalesOrder_KpiQuoClose.md +++ b/en/docs/auto-catalog/procedures/Sp_SalesOrder_KpiQuoClose.md @@ -1,7 +1,7 @@ # `Sp_SalesOrder_KpiQuoClose` (procedure) -> @author:zhucx - @date: +> @author:zhucx + @date: @describe: @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售订单管理 → 销售订单 KPI 跟踪 (`salsalesorderslave`) — quotation-side KPI close button: flips `bKpiQuo=1` and stamps `tKpiQuoCloseDate=SYSDATE()` to close out the 报价跟踪 KPI for an order line. Quote-side mirror of `Sp_SalesOrder_KpiObsoleteClose`, which closes the 作废 KPI; paired with the edit variant `Sp_SalesOrder_KpiQuoMemo`. + +**What it does:** Validates `sProInParam`, parses `$.params[*].value[*].sSlaveId`, and for each line runs `UPDATE salsalesorderslave SET bKpiQuo=1, tKpiQuoCloseDate=SYSDATE() WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. + +**Invocation:** Generic-dispatch button signature `(sProInParam, sMakePerson, sBrId, sSuId, OUT sReturn, OUT sCode)` — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from a 销售订单 KPI 跟踪 grid's 关闭报价 button. Install script: `script/标版/30100101/Sp_SalesOrder_KpiQuoClose.sql`. No xly-src Java caller, no gdsmodule row — binding lives in the grid-button metadata. diff --git a/en/docs/auto-catalog/procedures/Sp_SalesOrder_KpiQuoMemo.md b/en/docs/auto-catalog/procedures/Sp_SalesOrder_KpiQuoMemo.md index 6031d30..2e95e54 100644 --- a/en/docs/auto-catalog/procedures/Sp_SalesOrder_KpiQuoMemo.md +++ b/en/docs/auto-catalog/procedures/Sp_SalesOrder_KpiQuoMemo.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售订单管理 → 销售订单 KPI 跟踪 (`salsalesorderslave`) — quotation-side KPI memo button: writes the operator's textarea note into `sKpiQuoMemo` on the selected order lines (plus any extra fields named in `valueKey`). Edit-variant of `Sp_SalesOrder_KpiQuoClose`; mirror of `Sp_SalesOrder_KpiObsoleteMemo` on the 作废 side. + +**What it does:** Validates `sProInParam`, parses `$.params[*].value[*].sSlaveId` and `$.changeValue.textareaValue`. Splits `$.changeValue.valueKey` on commas and builds `p_setSql` from `$.changeValue[0].colN` so any extra grid-editable columns are merged in. Appends `sKpiQuoMemo=` to the SET-clause. For each `sSlaveId` it CONCATs and PREPARE/EXECUTEs `UPDATE salsalesorderslave SET WHERE sId=p_sTmpId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. + +**Invocation:** Generic-dispatch button signature `(sProInParam, sMakePerson, sBrId, sSuId, OUT sReturn, OUT sCode)` — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from the 销售订单 KPI 跟踪 grid's 报价备注 button. Install script: `script/标版/30100101/Sp_SalesOrder_KpiQuoMemo.sql`. No xly-src Java caller, no gdsmodule row — binding lives in the grid-button metadata. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_Lable_NotWorkOrderList.md b/en/docs/auto-catalog/procedures/Sp_Sales_Lable_NotWorkOrderList.md index 654f062..f2b8d9a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_Lable_NotWorkOrderList.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_Lable_NotWorkOrderList.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 待下达生产订单任务列表 (标签 / 标签印刷 flavour) — paged worklist of 销售订单 lines whose 工单 has not yet been issued, customised for the label-printing line. Same business surface as `Sp_Sales_NotWorkOrderList` but built for label-product semantics. + +**What it does:** Builds temp `NotWorkOrderList`, `Insert INTO NotWorkOrderList` from a `JOIN` over `eleproduct`, `elecustomer`, `sissalesman`, `siswarehouse` plus `eleproductstock` / `PitProductStoreVirtual` for on-hand qty, restricted to undispatched order slaves between `tStartDate` and `tEndDate`. `UPDATE NotWorkOrderList` folds in any additional flags, then the standard `CALL Sp_Do_UpdateByPageSizeBefore` paging trailer slices out `pageNum/pageSize` and computes `countMapJson` from `countCloumn`. + +**Invocation:** Status: appears orphaned. No `gdsconfigformmaster` binding, no other-routine caller, no xly-src reference at all (not even an install script in `script/标版/30100101/`). May have been a customer-specific variant that never landed in standard or is referenced by a dashboard not in this snapshot — maintainer audit recommended. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodList.md b/en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodList.md index 4882a47..2a17afd 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodList.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodList.md @@ -34,4 +34,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售送货流程 → 2/4 销售订单->送货单 (also reused by 扫码送货 and 未送货汇总表) — paged worklist of 销售订单 lines that still have outstanding qty to deliver. Source of the dropdown grid that lets the shipping clerk pick orders for the next 送货单. + +**What it does:** Builds temp `NotDeliverGoodList`, joins `salsalesordermaster`/`salsalesorderslave` against `eleproduct`, `elecustomer`, `sissalesman`, `siscurrency`, `sispayment`, `sisdeliver`, `sistax` to project order context, then folds in stock (`eleproductstock`, `pitproductstorevirtual`, `PitProductInStoreSlave`), 工单 status (`mftworkorderslave`/`opsoutsideprocessmaster`), inspection (`qlyproducttestmaster`) and reject deductions (`SalRejectGoodsSlave`). Filters by `iCopeEvent` (0 未处理 / 1 已处理 / 2 全部), `sState` (0 正常 / 1 强制完工), `bFilter` and customer-visibility (`Fun_GetLookCustomer(sLoginId)`). Final paging via `Sp_Do_ProcedurePageTree` returning `pageNum/pageSize` slice and `countMapJson`. + +**Invocation:** Bound to `gdsconfigformmaster.sSqlStr` on three forms — `192116810113315262977376700` (2/4 销售订单->送货单, 销售送货流程), `101251240115015959228704840` (扫码送货, 功能操作 → 移动端管理), `101251240115016215088119550` (未送货汇总表, 分析报表 → 财务管理). Also reachable through `Fun_getInitColumnByProName`. Install scripts: standard at `script/标版/30100101/`, optimised at `script/标版/optimize/`, customer override at `script/客户/无锡中江/`. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodListNew.md b/en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodListNew.md index 1840ad5..aa60fc9 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodListNew.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodListNew.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Customer-specific (`安徽金印`) variant of `Sp_Sales_NotDeliverGoodList` — paged worklist of 销售订单 lines still owing delivery, with the 安徽金印 build's tweaks (different qty-rounding, customer-product-mapping, etc.). + +**What it does:** Same overall shape as `Sp_Sales_NotDeliverGoodList`: temp `NotDeliverGoodList` filled from `salsalesorderslave`/`viw_product_materials` joined with `elecustomer`, `siswarehouse`, `sissalesman`, `sispayment`, `sisdeliver`, `sistax`; folded with stock (`eleproductstock`, `pitproductstorevirtual`, `PitProductInStoreSlave`), 工单 status (`mftworkorderslave`) and reject deductions (`SalRejectGoodsSlave`). Filters on `sState`, `bFilter`, `Fun_GetLookCustomer(sLoginId)` and `sUnTaskFormId`. Final paging via `Sp_Do_ProcedurePageTree`. + +**Invocation:** Status: appears orphaned in this snapshot. No `gdsconfigformmaster` binding and no Java/MyBatis hit; only the customer override script `script/客户/安徽金印/Sp_Sales_NotDeliverGoodListNew.sql` ships it. The 安徽金印 build likely activates this proc by swapping the form-master sSqlStr from `Sp_Sales_NotDeliverGoodList` to `…New`, but that wiring isn't present in this DB — maintainer audit recommended before pruning. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodMaterialsList.md b/en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodMaterialsList.md index c87d3cc..7b57321 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodMaterialsList.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodMaterialsList.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料销售管理 → 材料未送货任务列表 — paged worklist of material-side 销售订单 lines still owing delivery (companion to the product-side `Sp_Sales_NotDeliverGoodList`). Used by the materials-sales clerk to plan which 材料送货单 to ship next. + +**What it does:** Builds temp `NotDeliverGoodList`, sources base rows from `Viw_SalSalesOrder`/`SalSalesOrderSlave` joined against `elecustomer`, `elematerials`, `siswarehouse`, `sissalesman`, `sispayment`, `sisdeliver`, `sistax`; folds in stock (`eleproductstock`, `pitproductstorevirtual`, `PitProductInStoreSlave`), 工单 status (`Viw_MftWorkOrder`/`mftworkorderslave`), 委外入库 (`Viw_OpsOutSideInStore`), 送货 history (`SalDeliverGoodsSlave`) and reject deductions (`SalRejectGoodsSlave`). Filters by `iCopeEvent`, `sState`, `bFilter`, `Fun_GetLookCustomer(sLoginId)` and `sUnTaskFormId`. Paging via `Sp_Do_UpdateByPageSizeBefore`. + +**Invocation:** Bound to `gdsconfigformmaster.sSqlStr` on form `101251240115016140462211080` (材料未送货任务列表) under 材料销售管理 → 销售管理. Install scripts at `script/标版/30100101/` and `script/标版/20210323/optimizeprocedure.sql`, plus customer override `script/客户/福雅/optimizeprocedure.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodMaterialsNotifyList.md b/en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodMaterialsNotifyList.md index a37430a..0139ce2 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodMaterialsNotifyList.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodMaterialsNotifyList.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料销售管理 → 未开材料送货通知任务列表 — paged worklist of material-side 销售订单 lines whose 材料送货通知单 has not yet been issued. Mirrors the product-side `Sp_Sales_NotDeliverGoodNotifyList` for the materials line. + +**What it does:** Builds temp `NotDeliverGoodNotifyList`, populates it from `Viw_SalSalesOrder`/`Viw_MftWorkOrder` joined against `elecustomer`, `elematerials`, `SisDeliver`, `sgdsemigoodsmatchbillmaster`, `viw_product_materials`; folds in 销售退货 deductions (`SalRejectGoodsSlave`) and `SysSystemSettings` config flags. Filters by `sCustomerGuid`, `iCopeEvent`, `sState`, `bFilter`, `Fun_GetLookCustomer(sLoginId)` and `sUnTaskFormId`. Final paging via `Sp_Outstanding_Query`. + +**Invocation:** Bound to `gdsconfigformmaster.sSqlStr` on form `101251240115016140462416230` (未开材料送货通知任务列表) under 材料销售管理 → 销售管理. Install script: `script/标版/30100101/Sp_Sales_NotDeliverGoodMaterialsNotifyList.sql`; also re-issued by the `script/标版/20210323/gdsconfigformmaster.sql` form-master refresh. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodNotifyList.md b/en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodNotifyList.md index 3986003..b715df1 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodNotifyList.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_NotDeliverGoodNotifyList.md @@ -33,4 +33,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售送货流程 → 3/5 销售订单->送货通知 — paged worklist of 销售订单 lines whose 送货通知单 has not yet been issued. Source of the dropdown grid in step 3/5 of the sales-delivery flow. + +**What it does:** Builds temp `NotDeliverGoodNotifyList`, populates it from `viw_salsalesorder`/`Viw_MftWorkOrder` joined against `elecustomer`, `eleproduct`, `sisproductclassify`, `SisDeliver`, `sistax`, `salsalesordermaster`/`salsalesorderslave`, `mftworkordermaster`/`mftworkorderslave`, `opsoutsideinstoremaster`/`opsoutsideinstoreslave` and `sgdsemigoodsmatchbillmaster`/`sgdsemigoodsmatchbillslave`; folds in inspection (`qlyproducttestmaster`), stock (`eleproductstock`) and 销售退货 (`SalRejectGoodsSlave`). Filters by `sCustomerGuid`, `iCopeEvent`, `bAll`, `sState`, `bFilter`, `Fun_GetLookCustomer(sLoginId)` and `sUnTaskFormId`. `SysSystemSettings` toggles drive variant behaviour. + +**Invocation:** Bound to `gdsconfigformmaster.sSqlStr` on form `15833199030002272611938056549000` (3/5 销售订单->送货通知, 销售送货流程). Also reachable through `Fun_getInitColumnByProName`. Install scripts: standard at `script/标版/30100101/`, optimised variant at `script/标版/optimize/Sp_Sales_NotDeliverGoodNotifyList.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_NotWorkOrderList.md b/en/docs/auto-catalog/procedures/Sp_Sales_NotWorkOrderList.md index d03597f..18933e5 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_NotWorkOrderList.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_NotWorkOrderList.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 待下达生产订单任务列表 — paged worklist of 销售订单 lines whose 工单 has not yet been issued. Drives the PMC / 计划员 screen used to pick the next batch of orders to release to production. + +**What it does:** Builds temp `NotWorkOrderList`, `Insert INTO NotWorkOrderList` from a `JOIN` over `eleproduct`, `elecustomer`, `sissalesman`, `siswarehouse` plus `eleproductstock` / `PitProductStoreVirtual` for current and virtual stock, restricted to undispatched order slaves between `tStartDate` and `tEndDate`. `UPDATE NotWorkOrderList` folds in flags (`bComplete`, `iLag`, etc.). The standard `CALL Sp_Do_UpdateByPageSizeBefore` paging trailer slices out `pageNum/pageSize` and computes `countMapJson` from `countCloumn`. + +**Invocation:** Status: appears orphaned in this snapshot — no `gdsconfigformmaster` binding and no Java/MyBatis hit. Install script `script/标版/30100101/Sp_Sales_NotWorkOrderList.sql` ships the standard definition, suggesting it was once bound; the form-master row may have been removed or renamed. Sibling `Sp_Sales_Lable_NotWorkOrderList` is the label-line variant. Maintainer audit recommended. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_PerformanceCommission.md b/en/docs/auto-catalog/procedures/Sp_Sales_PerformanceCommission.md index cd4cb8d..df5c1a9 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_PerformanceCommission.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_PerformanceCommission.md @@ -33,4 +33,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售分析(人员角度) → 销售提成统计 — paged report that computes each 销售员's commissionable sales by aggregating receivables, payments, adjustments and rejects across the period. Drives the commission-payout review the sales manager runs at month-end. + +**What it does:** Reads `CbxReceivablesType` from `SysSystemSettings`, ensures the `ARAccount`/`ARAccountA` running balance is current for the window (`call Sp_Receivables_AR`, `Insert into ARAccount` from `viw_CahReceipt`, `CahPaymentMaster`, `CahReceiptMaster`, `CahCustomerInit`, `cahfinancialadjust`, `viw_SalRejectGoods` filtered by `sysaccountperiod`). Then joins `viw_salsalesorder`/`viw_MftWorkOrder` against `EleCustomer`, `eleproduct`, `elesupply`, `sissalesman`, `sispayment`, `gdsmodule` to assemble per-salesperson sums; `iSum`/`iType`/`sStatistics` switch between summary and detail layouts. Final paging via `Sp_Outstanding_Query` with `countMapJson` from `countCloumn`. + +**Invocation:** Bound to `gdsconfigformmaster.sSqlStr` on form `19211681019715708610310890` (销售提成统计) under 销售分析(人员角度) → 销售管理. Install script `script/标版/30100101/Sp_Sales_PerformanceCommission.sql` and re-issued by `script/标版/20210323/gdsconfigformmaster.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfMaterial.md b/en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfMaterial.md index b29e89f..9f29237 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfMaterial.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfMaterial.md @@ -32,4 +32,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 → 采购分析报表 → 采购分析-按物料 — paged report that aggregates purchase qty, money and payment status by material across the period. Used by procurement to see which materials drive purchase spend. + +**What it does:** Builds temp `SAS`/`tempSAS`, `INSERT INTO SAS` from `viw_purpurchaseorder` (the standard purchase-order view) joined against `elematerials` and `viw_cahpayment` to pull payment progress per PO. `UPDATE SAS` folds in additional aggregates, then the standard `Sp_Do_UpdateByPageSizeBefore` trailer slices out `pageNum/pageSize` and computes `countMapJson` from `countCloumn`. The `bFilter`/`sFilterOrderBy`/`sGroupby_*` params are spliced into the dynamic SQL by the same trailer. + +**Invocation:** Bound to `gdsconfigformmaster.sSqlStr` on form `101251240115015848408620791` (采购分析-按物料) and also referenced from form `101251240115015848408987391` (采购分析-按物料分类) — both under 采购分析报表 → 采购管理. Install scripts at `script/标版/30100101/Sp_Sales_PurchaseAnalysiseOfMaterial.sql`, optimised at `script/标版/20210323/optimizeprocedure.sql`; customer override at `script/客户/福雅/`. + +Note: the page's heading `现金日记帐` is an artefact of the auto-catalog grabbing the wrong `gdsmodule.sChinese` row — the business identity is 采购分析-按物料 per `gdsconfigformmaster`. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfMaterialClass.md b/en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfMaterialClass.md index b1ba1a3..e3260b0 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfMaterialClass.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfMaterialClass.md @@ -32,4 +32,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 → 采购分析报表 → 采购分析-按物料分类 — paged report that aggregates purchase qty, money and payment status by material class across the period. Rolls the by-material view up to the class level for procurement. + +**What it does:** Builds temp `SAS`/`tempSAS`, `INSERT INTO SAS` from `viw_purpurchaseorder` joined against `elematerials`, `sismaterialsclassify` and `viw_cahpayment`. `UPDATE SAS` folds in extra aggregates. Final paging via `CALL Sp_Outstanding_Query` with `pageNum/pageSize` and `countMapJson` from `countCloumn`; `bFilter`/`sFilterOrderBy`/`sGroupby_*` are spliced into the dynamic SQL. + +**Invocation:** Bound to `gdsconfigformmaster.sSqlStr` on form `101251240115015848408987391` (采购分析-按物料分类) under 采购分析报表 → 采购管理. Install scripts at `script/标版/30100101/`, optimised variant at `script/标版/20210323/optimizeprocedure.sql`, customer override at `script/客户/福雅/Sp_Sales_PurchaseAnalysiseOfMaterialClass.sql`. + +Note: the page's heading `现金日记帐` is a stale `gdsmodule.sChinese` artefact — the live business identity is 采购分析-按物料分类. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfSupply.md b/en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfSupply.md index 8acfec4..5b83c34 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfSupply.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfSupply.md @@ -32,4 +32,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 → 采购分析报表 → 采购分析-按供应商 — paged report that aggregates purchase qty, money and payment status by 供应商 across the period. Lets procurement compare supplier-level spend and outstanding payment. + +**What it does:** Builds temp `SAS`/`tempSAS`, `INSERT INTO SAS` from `viw_purpurchaseorder` joined against `elesupply` and `cahpaymentmaster` for per-supplier payment totals. `UPDATE SAS` folds in extra aggregates. Final paging via `Sp_Do_UpdateByPageSizeBefore` with `pageNum/pageSize` and `countMapJson` from `countCloumn`; `bFilter`/`sFilterOrderBy`/`sGroupby_*` spliced in. + +**Invocation:** Bound to `gdsconfigformmaster.sSqlStr` on form `19211681019715708433570790` (采购分析-按供应商) under 采购分析报表 → 采购管理. Install scripts at `script/标版/30100101/Sp_Sales_PurchaseAnalysiseOfSupply.sql`, optimised at `script/标版/20210323/optimizeprocedure.sql`, customer override at `script/客户/福雅/`. + +Note: the page's heading `现金日记帐` is a stale `gdsmodule.sChinese` artefact — the live business identity is 采购分析-按供应商. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfSupplyCount.md b/en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfSupplyCount.md index 4c8f899..16334f0 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfSupplyCount.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfSupplyCount.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 → 采购分析报表 → 供应商采购频次 — paged report that counts how many distinct purchase orders each 供应商 received in the window. Helps procurement spot under- or over-used suppliers. + +**What it does:** Builds temp `SAS`/`tempSAS`, `INSERT INTO SAS` from `viw_purpurchaseorder` `JOIN elesupply`, grouping by supplier with `COUNT(*)` / `SUM(qty)` aggregates. Filtered by `tStartDate`/`tEndDate` and `bFilter`. Final paging via `Sp_Do_UpdateByPageSizeBefore` returning `pageNum/pageSize` slice plus `countMapJson` from `countCloumn`. + +**Invocation:** Status: appears orphaned in this snapshot. No `gdsconfigformmaster` binding and no xly-src reference at all (no install script, no customer override). Sibling procs in the `Sp_Sales_PurchaseAnalysiseOfSupply*` family are wired to live forms — this one may have been a planned report whose form-master row was never persisted, or was pruned. Maintainer audit recommended. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfSupplyGroup.md b/en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfSupplyGroup.md index 63a6730..0318a39 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfSupplyGroup.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfSupplyGroup.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 → 采购分析报表 → 供应商月度供应汇总表 — paged monthly supplier-supply summary that pivots purchase qty and money by supplier × material across the period. Used by procurement for month-over-month supplier-supply comparisons. + +**What it does:** Builds temp `SAS`/`tempSAS`, `INSERT INTO SAS` from `viw_purpurchaseorder` joined against `elesupply`, `elematerials`, `sistax`, grouping rows into a supplier×material pivot keyed on month-of-`tCreateDate`. `Update SAS` fills in derived columns; the standard `Sp_Do_UpdateByPageSizeBefore` trailer returns `pageNum/pageSize` slice and `countMapJson` from `countCloumn`. `bFilter`/`sFilterOrderBy`/`sGroupby_*` spliced in. + +**Invocation:** Status: appears orphaned in this snapshot. No `gdsconfigformmaster` binding and no xly-src reference at all. May have been a planned report whose form-master row was never persisted, or was pruned. Maintainer audit recommended. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfSupplyYear.md b/en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfSupplyYear.md index 244cf9d..3dda099 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfSupplyYear.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfSupplyYear.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 → 采购分析报表 → 材料季度、年度均价表 — paged quarterly/annual material average-price report. Aggregates purchase qty and money per material across the window so procurement can track price drift. + +**What it does:** Builds temp `SAS`/`tempSAS`, `INSERT INTO SAS` from `viw_purpurchaseorder` `JOIN elematerials`, grouping by material with `SUM(qty)`/`SUM(money)` and computing `avg_price = money/qty` per quarter/year bucket derived from `tCreateDate`. Final paging via `Sp_Do_UpdateByPageSizeBefore` returning `pageNum/pageSize` slice plus `countMapJson` from `countCloumn`. + +**Invocation:** Status: appears orphaned in this snapshot. No `gdsconfigformmaster` binding and no xly-src reference at all. Likely intended for a 材料均价 dashboard whose form-master row was never persisted (or was pruned). Maintainer audit recommended. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysise.md b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysise.md index 00d4567..fb1f294 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysise.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysise.md @@ -33,4 +33,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售分析 — the multi-dimensional sales-analysis engine. Single proc that backs a dozen form-master views (销售大数据分析, 销售分析表 by 产品/客户/客户分类/客户属性/业务人员/销售部门/产品大类/制单人员, 销售统计日报表, 销售利润分析-按产品/按客户). The dimension is selected by `sStatiStics`, the bill-type by `iBillType`, the classify mode by `iClassifyType`, summary vs. detail by `iSum`. + +**What it does:** Builds temp `p_TmpInOutStore`, `Insert INTO p_TmpInOutStore` from `viw_salsalesorder`/`viw_saldelivergoods` etc. joined against `EleCustomer` and `eleproduct`. `UPDATE p_TmpInOutStore` folds in derived columns (margin, money, qty by 销售/送货/对账). The dynamic pivot column-set is driven by `sStatiStics` (`salesman`, `customer`, `customerclass`, `customerproperty`, `product`, `productclass`, `makeperson`, `salesdepart`). Final paging via `CALL Sp_Outstanding_Query` with `pageNum/pageSize` slice and `countMapJson` from `countCloumn`; `bFilter`/`sFilterOrderBy`/`sGroupby_*` spliced into the dynamic SQL. + +**Invocation:** Bound to `gdsconfigformmaster.sSqlStr` on 12 forms across three modules: 销售分析(产品角度) (销售大数据分析, 销售分析表(产品/产品大类), 销售统计日报表, 销售利润分析-按产品), 销售分析(客户角度) (销售分析表(客户/客户分类/客户属性)), 销售分析(人员角度) (销售分析表(业务人员/销售部门/制单人员)), 利润分析 → 成本管理 (销售利润分析-按客户). Install scripts under `script/标版/30100101/` plus optimised variants under `script/标版/optimize/` — the dimension-specific sibling procs (`Sp_Sales_SalesAnalysiseOfProduct`, `OfSalesperson`, etc.) are typically what those forms call now; this base proc is the legacy single-procedure surface. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomer.md b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomer.md index 85d9361..54ccfb9 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomer.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomer.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售分析(客户角度) → 销售分析表(客户) — paged sales analysis report grouped by customer. Cross-references the 销售订单 / 入库 / 送货 / 对账 / 开票 / 收款 chain so the user sees ordered, in-stocked, delivered, reconciled, invoiced and collected totals for every 客户 inside a date window. + +**What it does:** Builds temp table `SAS` seeded from `eleCustomer` (filtered by `Fun_GetLookCustomer(sLoginId,...)`), then progressively `UPDATE ... JOIN`s in counts and money columns: `viw_salSalesOrder` for ordered qty/money (restricted to the seven 销售订单 `sFormId` whitelist and `iOldNew=0`), `viw_pitproductinstore` + `viw_opsoutsideinstore` (excluding 余数库 warehouses and 备品 give-away qty) for instored no-tax money, `Viw_SalDeliverGoods` minus `Viw_SalRejectGoods` for delivered no-tax money, `viw_salsaleschecking` for reconciled money, `viw_SalSalesInvoice` for invoiced money and `viw_cahreceiptsum` for collected money. Computes 平均单价/数量, 占比 (`dRate`/`dPayRate`/`dBalanceRate`) via a sum from `tempSAS`, fills 上级客户名称 from `elecustomer.sSrcCustomerId`, drops zero-activity rows, then hands `SAS` to `Sp_Do_UpdateByPageSizeBefore` for `bFilter` paging and `countCloumn` summing. + +**Invocation:** Bound as the data-source of the 销售分析表(客户) form `gfm.sId=101251240115015848397842351` via `gdsconfigformmaster.sSqlStr` (literal proc name); module path 销售管理 → 销售分析(客户角度) → 销售分析表(客户). Loaded when the user opens the report. The 优化版 install script ships at `script/标版/optimize/Sp_Sales_SalesAnalysiseOfCustomer.sql`; the original install lives at `script/标版/30100101/Sp_Sales_SalesAnalysiseOfCustomer.sql` — verify which version is deployed. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomer1old001.md b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomer1old001.md index c2c5b36..eacfced 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomer1old001.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomer1old001.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Predecessor of `Sp_Sales_SalesAnalysiseOfCustomer` (the `1old001` suffix marks it as an archived earlier revision). Same 客户销售分析表 intent — paged ordered / instored / delivered / reconciled / invoiced / collected money pivoted by 客户 — but works in tax-inclusive `dProductMoney` only (no `dProductNoTaxMoney` columns, no max/min price tracking, no `sSrcCustomerName` rollup, no order-line count column for tempInStore). + +**What it does:** Seeds `SAS` from `eleCustomer`, then progressively `UPDATE ... JOIN`s ordered totals from `viw_salSalesOrder` (seven `sFormId` whitelist), collected money from `cahreceiptmaster`, instored money from `viw_pitproductinstore` + `viw_opsoutsideinstore` (excluding 余数库 and 备品), delivered money from `Viw_SalDeliverGoods` minus `Viw_SalRejectGoods`, reconciled from `viw_salsaleschecking`, invoiced from `SalSalesInvoiceMaster`. Computes averages, 占比 and the "not yet…" delta columns (`dNoInstoreMoney`/`dNoDeliverMoney`/`dNoCheckMoney`/`dNoInvoiceMoney`), then pages via `Sp_Do_UpdateByPageSizeBefore`. + +**Invocation:** Status: appears orphaned. No `gdsconfigformmaster.sSqlStr` / `sConfigSqlStr` / `sSqlCondition` binding, no `gdsmodule` hook, no caller in other routines, no xly-src reference outside the install scripts. The current production form (`gfm.sId=101251240115015848397842351`) points at `Sp_Sales_SalesAnalysiseOfCustomer` (no-tax-money variant) instead. Candidate for maintainer audit / removal. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomerClass.md b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomerClass.md index 480c70b..3c87e57 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomerClass.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomerClass.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售分析(客户角度) → 销售分析表(客户分类) — paged sales analysis pivoted by 客户分类 (customer category), one row per `siscustomerclassify` entry with that category's aggregate ordered / collected / outstanding totals. + +**What it does:** Seeds `SAS` from `siscustomerclassify` for the current `sBrId`/`sSuId`, then `UPDATE ... INNER JOIN`s in counts and money from `viw_salSalesOrder` joined to `elecustomer` and grouped by `EP.sParentId` (each 客户's category id), restricted to the seven 销售订单 `sFormId` whitelist and `bCheck=1 AND bInvalid=0`. Brings in 收款 from `cahreceiptmaster` the same way (joined via `elecustomer.sParentId`). Computes `dBalanceMoney = dProductMoney − dPayMoney`, the 平均 columns, and the three percentage columns (`dRate`/`dPayRate`/`dBalanceRate`) via a sum in `tempSAS`. Hands `SAS` to `Sp_Do_UpdateByPageSizeBefore` and returns the page. + +**Invocation:** Bound as the data-source of the 销售分析表(客户分类) form `gfm.sId=101251240115015848398353901` via `gdsconfigformmaster.sSqlStr`; module path 销售管理 → 销售分析(客户角度) → 销售分析表(客户分类). 优化版 ships at `script/标版/optimize/Sp_Sales_SalesAnalysiseOfCustomerClass.sql`, original at `script/标版/30100101/Sp_Sales_SalesAnalysiseOfCustomerClass.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomer_copy1.md b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomer_copy1.md index d39bf17..dad4b90 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomer_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomer_copy1.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_Sales_SalesAnalysiseOfCustomer` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_Sales_SalesAnalysiseOfCustomer` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomerproperty.md b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomerproperty.md index 89ede1f..09c00e9 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomerproperty.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomerproperty.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售分析(客户角度) → 销售分析表(客户属性) — paged sales analysis pivoted by 客户属性 (customer property — industry / distributor type), one row per `siscustomerproperty` entry. + +**What it does:** Seeds `SAS` from `siscustomerproperty` for the current 品牌/分公司, then `UPDATE ... INNER JOIN`s in order counts and money from `viw_salSalesOrder` joined to `elecustomer` and grouped by `EP.sCustomerPropertyId` (subject to the seven 销售订单 `sFormId` whitelist and `bCheck=1 AND bInvalid=0`). Joins `cahreceiptmaster` via the same customer→property mapping to bring in collected money, computes `dBalanceMoney`, averages and 占比 columns from `tempSAS`, drops zero-activity rows, then pages through `Sp_Do_UpdateByPageSizeBefore`. The receipts subquery's inner `group by EP.sParentId` rather than `EP.sCustomerPropertyId` is a known mismatch carried in this variant. + +**Invocation:** Bound as the data-source of the 销售分析表(客户属性) form `gfm.sId=101251240115015848399159370` via `gdsconfigformmaster.sSqlStr`; module path 销售管理 → 销售分析(客户角度) → 销售分析表(客户属性). Install ships at `script/标版/30100101/Sp_Sales_SalesAnalysiseOfCustomerproperty.sql`; 优化版 at `script/标版/optimize/`. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfDay.md b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfDay.md index b2b7189..1b68471 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfDay.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfDay.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售分析(产品角度) → 销售统计日报表 — daily roll-up of sales / instore / delivery 不含税金额 pivoted by `eleproduct.sProductproperty` (`卡盒类`/`坑盒类`/`书刊类`/`胶片盒类`/`精品手工类`/`其他`). Carton/box-printing taxonomy — the form is a customer-line specialization (paper-box industry property bins) reused as the standard 销售统计日报表. + +**What it does:** Computes a `Fun_GetLookCustomer(sLoginId,...)` data-permission filter, builds a UNION across `viw_salsalesorder`/`viw_saldelivergoods`/`viw_pitproductinstore` to collect every distinct `tCreateDate` day within the window into `SAS.tReportDay`. Then three `UPDATE ... INNER JOIN` blocks pivot `dProductNoTaxMoney` by `sProductproperty` for each of the three source views into 销售/入库/送货 column groups (suffixes `dSalesAY/SY/RY/SM/ZH/HJG/HJ`, `dInStore*`, `dDelivery*`). Each property-group total is summed into the `HJ` (合计) column. Output is paged via `Sp_Outstanding_Query`. + +**Invocation:** Bound as the data-source of the 销售统计日报表 form `gfm.sId=101251240115016215103304510` via `gdsconfigformmaster.sSqlStr`; module path 销售管理 → 销售分析(产品角度) → 销售统计日报表. Install ships at `script/标版/30100101/Sp_Sales_SalesAnalysiseOfDay.sql`; 优化版 at `script/标版/optimize/`. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfMakePerson.md b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfMakePerson.md index bbc71a8..5efdb84 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfMakePerson.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfMakePerson.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售分析(人员角度) → 销售分析表(制单人员) — paged sales analysis pivoted by 制单人员 (the operator who keyed the 销售订单), one row per active `sftlogininfo` user with that user's aggregate ordered / collected / outstanding totals. + +**What it does:** Seeds `SAS` from `sftlogininfo` (login user master) for the current 品牌/分公司, then `UPDATE ... INNER JOIN`s in order counts and money from `viw_salSalesOrder` grouped by `S.sMakePerson` and matched to `A.sName` (i.e. `sftlogininfo.sUserName` ↔ order's `sMakePerson` string) — subject to the seven 销售订单 `sFormId` whitelist and `bCheck=1 AND bInvalid=0`. Joins `cahreceiptmaster` by `sMakePerson` for 收款, computes `dBalanceMoney`, averages and 占比 columns from `tempSAS`, drops zero-money rows, pages via `Sp_Do_UpdateByPageSizeBefore`. + +**Invocation:** Bound as the data-source of the 销售分析表(制单人员) form `gfm.sId=192116811110216080102093540` via `gdsconfigformmaster.sSqlStr`; module path 销售管理 → 销售分析(人员角度) → 销售分析表(制单人员). 优化版 ships at `script/标版/optimize/Sp_Sales_SalesAnalysiseOfMakePerson.sql`. Caveat: matching by `sUserName` is fragile if usernames change — verify before relying on per-operator totals. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfMonth.md b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfMonth.md index cc53963..65122c5 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfMonth.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfMonth.md @@ -35,4 +35,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Generic monthly sales-pivot template for the 销售分析 family — builds a 12-bucket (or N-month) horizontal cross-tab of money by month, parameterised by source bill (`iBillType` 0=`Viw_MftWorkOrder` / 1=`SalSalesOrderMaster` / 2=`SalDeliverGoodsMaster` / 3=`SalSalesInvoiceMaster`), classification axis (`iClassifyType` 0=`sCustomerId` / 1=`sCustomerPropertyId` / 2=`sParentId` (上级客户) / 3=`sSaleManId`) and detail vs sum mode (`iSum`). Twin/superseded by `Sp_Sales_SalesAnalysiseOfMonthOfCustomer*` family which is form-bound. + +**What it does:** Walks `tStartDate`→`tEndDate` month-by-month, splicing one correlated-subquery column per month (`Select Sum(dTotalMoney) From Where date_format(tCreateDate,'%Y-%m-%d') between :StartDate and :EndDate AND :sKeyFieldName = ...) As YYYYMM` onto the outer SELECT. The outer SELECT does the grouped roll-up of `dProductMoney`/`dTotalMoney` from the chosen source. Template placeholders (`:sTableName`/`:sFieldName`/`:sJoin`/`:sGroupBy`/`:sStatistics`/`:sCheck`) are filled by the `iBillType`/`iClassifyType` switches, then handed to `Sp_Outstanding_Query` for paging. + +**Invocation:** Status: appears orphaned. No `gdsconfigformmaster.sSqlStr` / `sConfigSqlStr` / `sSqlCondition` binding for this exact name, no `gdsmodule` hook, no other-routine caller. Only references are install scripts (`script/标版/30100101/`). Likely either pre-dispatch helper called dynamically from BACK's JS, or a legacy form fixture replaced by per-axis procs (`Sp_DaysaleCustomer`, `Sp_DaysaleSalesMan`, `Sp_DaysaleProduct`, …). Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfProduct.md b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfProduct.md index b6be52d..da79d7d 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfProduct.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfProduct.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售分析(产品角度) → 销售分析表(产品) — paged sales analysis pivoted by 产品 (product), one row per active `eleproduct` entry showing that product's order count / qty / money, max & min unit price, collected money and 占比. + +**What it does:** Seeds `SAS` from `eleproduct` for the current 品牌/分公司, fills `sCustomerName` from `elecustomer`. Then `UPDATE ... INNER JOIN`s in counts, qty, money and the min/max `dProductPrice` from `viw_salsalesorder` grouped by `S.sProductId` — restricted to the seven 销售订单 `sFormId` whitelist with `bCheck=1 AND bInvalid=0 AND iOldNew=0`. Brings in 收款 from `viw_cahreceipt` grouped by `sProductId`. Drops zero-money rows, computes `dBalanceMoney`, 平均单价/数量, 占比 columns from `tempSAS`, and finally copies `sCustomerProductNo` from `eleproduct`. Hands `SAS` to `Sp_Do_UpdateByPageSizeBefore` for paging. + +**Invocation:** Bound as the data-source of the 销售分析表(产品) form `gfm.sId=101251240115015848397022101` via `gdsconfigformmaster.sSqlStr`; module path 销售管理 → 销售分析(产品角度) → 销售分析表(产品). 优化版 ships at `script/标版/optimize/Sp_Sales_SalesAnalysiseOfProduct.sql`; original at `script/标版/30100101/Sp_Sales_SalesAnalysiseOfProduct.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfProductClass.md b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfProductClass.md index 1c6223d..e0179c0 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfProductClass.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfProductClass.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售分析(产品角度) → 销售分析表(产品大类) — paged sales analysis pivoted by 产品分类/大类 (`sisproductclassify`), one row per category with aggregate ordered / collected / outstanding totals for that classification. + +**What it does:** Seeds `SAS` from `sisproductclassify` for the current 品牌/分公司, then `UPDATE ... INNER JOIN`s in counts, qty and money from `viw_salsalesorder` joined to `eleproduct` and grouped by `EP.sParentId` (each product's classification id) — restricted to the seven 销售订单 `sFormId` whitelist with `bCheck=1 AND bInvalid=0 AND iOldNew=0`. Brings in 收款 from `viw_cahreceipt` joined to `eleproduct` the same way. Drops zero-money rows, computes `dBalanceMoney` and averages, fills the three 占比 columns from `tempSAS`, then hands `SAS` to `Sp_Do_UpdateByPageSizeBefore`. + +**Invocation:** Bound as the data-source of the 销售分析表(产品大类) form `gfm.sId=101251240115015848407645250` via `gdsconfigformmaster.sSqlStr`; module path 销售管理 → 销售分析(产品角度) → 销售分析表(产品大类). 优化版 ships at `script/标版/optimize/Sp_Sales_SalesAnalysiseOfProductClass.sql`; original at `script/标版/30100101/Sp_Sales_SalesAnalysiseOfProductClass.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfProfit.md b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfProfit.md index 994ca4f..eeb08f6 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfProfit.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfProfit.md @@ -1,7 +1,7 @@ # `Sp_Sales_SalesAnalysiseOfProfit` (procedure) -> @author:杨恒林 - @date:20210616 封存 +> @author:杨恒林 + @date:20210616 封存 @describe: 销售利润分析-按客户,从对帐,送货,入库 三个层面分析 三个层面没有关联,只与时间段有关 @@ -34,4 +34,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本管理 → 利润分析 → 销售利润分析-按客户 — paged customer-level profit report. Per the embedded comment (`@author:杨恒林 @date:20210616 封存`, "由对帐、送货、入库 三个层面分析"), it cross-checks profit from three independent angles (入库 / 送货 / 对账) within a date window — the three layers are not joined, only sharing the same period. + +**What it does:** Builds dynamic `INSERT INTO SAS(sCustomerId,sCustomerName) ... from eleCustomer` filtered by `Fun_GetLookCustomer(sLoginId,...)`. Three parallel `UPDATE ... INNER JOIN`s pull `(SUM(dProductNoTaxMoney), SUM(dCostMoney), profit = sales − cost, rate = profit/sales*100)` grouped by `sCustomerId` from `viw_pitproductinstore` → `dInStoreSalesMoney/CostMoney/ProfitMoney`, from `viw_saldelivergoods` → `dDelivery*`, and from `viw_salsaleschecking` → `dReconciliation*`. Filters out rows where all three layers sum to zero, then pages via `Sp_Outstanding_Query`. Note: the proc has a swapped-target bug — the in-store update writes its rate into `dDeliveryProfitRate`, and the delivery update writes its rate into `dInStoreProfitRate`. Verify before trusting the rate columns. + +**Invocation:** Bound as the data-source of the 销售利润分析-按客户 form `gfm.sId=19211681019715708609753630` via `gdsconfigformmaster.sSqlStr`; module path 成本管理 → 利润分析 → 销售利润分析-按客户. Marked `封存` (archived) in 2021-06-16 by the author but still wired to the form. xly-src has no install/optimize script for it — DB-only. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfProfit_Product.md b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfProfit_Product.md index f84b575..b970790 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfProfit_Product.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfProfit_Product.md @@ -1,7 +1,7 @@ # `Sp_Sales_SalesAnalysiseOfProfit_Product` (procedure) -> @author:杨恒林 - @date:20210616 封存 +> @author:杨恒林 + @date:20210616 封存 @describe: 销售利润分析-按产品,从对帐,送货,入库 三个层面分析 三个层面没有关联,只与时间段有关 @@ -34,4 +34,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本管理 → 利润分析 → 销售利润分析-按产品 — paged customer×product profit report. Twin of `Sp_Sales_SalesAnalysiseOfProfit` but with an extra `sProductId` axis: one row per (`sCustomerId`,`sProductId`) pair. Per the embedded `@author:杨恒林 @date:20210616 封存` comment, it cross-checks profit from three independent angles (入库 / 送货 / 对账); the three layers are not joined, only sharing the same period. + +**What it does:** Seeds `SAS(sCustomerId,sProductId)` by `UNION`ing distinct (customer,product) pairs from `viw_pitproductinstore`, `viw_saldelivergoods` and `viw_salsaleschecking` for the period. Three parallel `UPDATE ... INNER JOIN`s pull `(SUM(dProductNoTaxMoney), SUM(dCostMoney), profit = sales − cost, rate)` grouped by `(sProductId,sCustomerId)` from each source view into the `dInStore*` / `dDelivery*` / `dReconciliation*` column groups. Joins back `eleCustomer.sCustomerName` and `eleproduct.sProductName`, drops rows where all six money columns are zero, then pages via `Sp_Outstanding_Query`. Same `dInStoreProfitRate`/`dDeliveryProfitRate` target-swap bug as the customer-only variant. + +**Invocation:** Bound as the data-source of the 销售利润分析-按产品 form `gfm.sId=101251240115016230550817050` via `gdsconfigformmaster.sSqlStr`; module path 成本管理 → 利润分析 → 销售利润分析-按产品. The cost-side install lives at `script/标版/30100101/cost/Sp_Sales_SalesAnalysiseOfProfit_Product.sql`; 优化版 at `script/标版/optimize/`. Marked `封存` (archived) by the author but still wired to the form. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfSalesdepart.md b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfSalesdepart.md index 65fee77..19cf579 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfSalesdepart.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfSalesdepart.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售分析(人员角度) → 销售分析表(销售部门) — paged sales analysis pivoted by 销售部门 (`sisdepart`), one row per department with that department's aggregate ordered / collected / outstanding totals. + +**What it does:** Seeds `SAS` from `sisdepart` for the current 品牌/分公司, then `UPDATE ... INNER JOIN`s in order counts, qty and money from `viw_salSalesOrder` joined to `sissalesman` (to lift each order's `sSalesManId` to a `sDepartId`) and grouped by `EP.sDepartId` — restricted to the seven 销售订单 `sFormId` whitelist with `bCheck=1 AND bInvalid=0`. Joins `cahreceiptmaster` through `sissalesman` the same way for 收款. Drops zero-money rows, computes `dBalanceMoney`, averages and 占比 columns from `tempSAS`, then hands `SAS` to `Sp_Do_UpdateByPageSizeBefore`. + +**Invocation:** Bound as the data-source of the 销售分析表(销售部门) form `gfm.sId=101251240115015848401639221` via `gdsconfigformmaster.sSqlStr`; module path 销售管理 → 销售分析(人员角度) → 销售分析表(销售部门). 优化版 ships at `script/标版/optimize/Sp_Sales_SalesAnalysiseOfSalesdepart.sql`; original at `script/标版/30100101/Sp_Sales_SalesAnalysiseOfSalesdepart.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfSalesperson.md b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfSalesperson.md index c6ac5bb..51b89e5 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfSalesperson.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfSalesperson.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售分析(人员角度) → 销售分析表(业务人员) — paged sales analysis pivoted by 销售员/业务员 (`sissalesman`), one row per active salesperson with that user's ordered, collected, reconciled and invoiced totals plus 未对账 / 未开票 deltas. (The `COMMENT '现金日记帐'` on the proc is a copy-paste artifact — actual purpose is per-salesperson sales analysis.) + +**What it does:** Seeds `SAS` from `sissalesman` for the current 品牌/分公司, then `UPDATE ... INNER JOIN`s in order counts, qty and money from `viw_salsalesorder` grouped by `S.sSalesManId` — restricted to the seven 销售订单 `sFormId` whitelist, `bCheck=1 AND bInvalid=0`, filtered by `tCheckDate` rather than `tCreateDate`. Three more inner joins bring in 收款 (`viw_cahreceipt.dSlaveTotalMoney` → `dPayMoney`), 对账 (`viw_salsaleschecking.dProductMoney` → `dCheckMoney`), and 开票 (`SalSalesInvoiceMaster.dTotalMoney` → `dInvoiceMoney`). Computes `dBalanceMoney`/`dNoCheckMoney`/`dNoInvoiceMoney` deltas, averages and 占比 columns, then runs `Sp_Do_UpdateByPageSizeBefore` and returns paged rows with a `RowNum` sequence. + +**Invocation:** Bound as the data-source of the 销售分析表(业务人员) form `gfm.sId=101251240115015848401113270` via `gdsconfigformmaster.sSqlStr`; module path 销售管理 → 销售分析(人员角度) → 销售分析表(业务人员). 优化版 ships at `script/标版/optimize/Sp_Sales_SalesAnalysiseOfSalesperson.sql`; original at `script/标版/30100101/Sp_Sales_SalesAnalysiseOfSalesperson.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfSalesperson_copy1.md b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfSalesperson_copy1.md index 998e177..b79f74c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfSalesperson_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfSalesperson_copy1.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_Sales_SalesAnalysiseOfSalesperson` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_Sales_SalesAnalysiseOfSalesperson` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseProduct.md b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseProduct.md index 75b466e..b1edb1a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseProduct.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseProduct.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Generic product-axis sales-pivot template — paged product-level sales analysis parameterised by source bill (`iBillType` 0=`Viw_SalSalesOrder` / 1=`Viw_SalDeliverGoods` / 2=`Viw_SalSalesInvoice`), classification axis (`iClassify_type` 0=客户上级 group / 1=产品 group) and a secondary statistics axis (`iStatistics_type` 0=none / 1=客户 / 2=业务员). Distinct from the form-bound `Sp_Sales_SalesAnalysiseOfProduct` — this is a lower-level template without the `eleproduct` seed. + +**What it does:** Builds a dynamic `SELECT :sFieldName, SUM(dProductQty), SUM(dProductMoney), A.sSlaveId FROM :sTableName :sJoin WHERE bCheck=1 AND tCreateDate ∈ [start,end+1) GROUP BY :sGroupBy`. The `iBillType`/`iClassify_type`/`iStatistics_type` switches fill `:sTableName` (one of the three sales views), `:sFieldName` (`A.sCustomerName`/`A.sCustomerId`/`A.sSalesManId`/blank), `:sJoin` (`LEFT JOIN EleCustomer As B ON A.sCustomerId = B.sId` when classifying by customer parent) and `:sGroupBy` (`B.sParentId` / `A.sCustomerName` / `A.sSalesManId` / `A.sProductId` / `A.sProductId, A.sCustomerId` / `A.sProductId, A.sSalesManId`). Output is paged via `Sp_Outstanding_Query`. + +**Invocation:** Status: appears orphaned. No `gdsconfigformmaster.sSqlStr` / `sConfigSqlStr` / `sSqlCondition` binding for this exact name, no `gdsmodule` hook, no other-routine caller. Only references are install scripts (`script/标版/30100101/Sp_Sales_SalesAnalysiseProduct.sql`). Twin (verbatim byte-for-byte) `Sp_Sales_SalesAnalysiseProduct1`. Likely a template superseded by the form-bound `Sp_Sales_SalesAnalysiseOfProduct` / `Sp_Sales_SalesAnalysiseOfProductClass` family. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseProduct1.md b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseProduct1.md index 47dc646..5927bb0 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseProduct1.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseProduct1.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Verbatim duplicate of `Sp_Sales_SalesAnalysiseProduct` (same parameters, same body — diffed byte-for-byte). Generic product-axis sales-pivot template parameterised by source bill (`iBillType` 0=`Viw_SalSalesOrder` / 1=`Viw_SalDeliverGoods` / 2=`Viw_SalSalesInvoice`), classification axis (`iClassify_type` 0/1) and statistics axis (`iStatistics_type` 0/1/2). + +**What it does:** Identical to `Sp_Sales_SalesAnalysiseProduct` — builds a dynamic `SELECT ... FROM :sTableName WHERE bCheck=1 AND tCreateDate ∈ window GROUP BY :sGroupBy`, fills the placeholders from the three int switches, and pages via `Sp_Outstanding_Query`. See that proc's narrative for full mechanism. + +**Invocation:** Status: appears orphaned. No `gdsconfigformmaster.sSqlStr` binding, no `gdsmodule` hook, no other-routine caller. Only reference is the install script `script/标版/30100101/Sp_Sales_SalesAnalysiseProduct1.sql`. The `1` suffix suggests a snapshot copy taken during refactoring of `Sp_Sales_SalesAnalysiseProduct`. Per wiki convention, backup objects are not narrated separately — see `Sp_Sales_SalesAnalysiseProduct`. Candidate for maintainer audit / removal. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseProductOfMonth.md b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseProductOfMonth.md index 05de030..cf0546f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseProductOfMonth.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_SalesAnalysiseProductOfMonth.md @@ -33,4 +33,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Generic product×month sales-pivot template — builds a per-month horizontal cross-tab of `dProductMoney` parameterised by source bill (`iBillType` 0=`Viw_MftWorkOrder` / 1=`Viw_SalSalesOrder` / 2=`Viw_SalDeliverGoods` / 3=`Viw_SalSalesInvoice`), classification axis (`iClassifyType` 0=`EleProduct.sParentId` (产品大类) / 1=`A.sProductName` (产品)) and a secondary statistics axis (`iStatisticsType` 0=none / 1=客户 / 2=业务员). Sibling of `Sp_Sales_SalesAnalysiseOfMonth` but with the product axis instead of the customer axis. + +**What it does:** Walks `tStartDate`→`tEndDate` month-by-month, splicing one correlated-subquery column per month (`(Select Sum(dProductMoney) From :sSubTableName :sSubJoin Where bCheck=1 AND bInvalid=0 AND date_format(tCreateDate,'%Y-%m-%d') between start and end AND :sKeyFieldName) As YYYYMM`) onto the outer `Select :sFieldName, Sum(dProductMoney) As dTotalMoney`. Then the `iBillType`/`iClassifyType`/`iStatisticsType` switches replace placeholders (`:sTableName`/`:sFieldName`/`:sJoin`/`:sSubJoin`/`:sGroupBy`/`:sKeyFieldName`) with the right view, group key and join. Output is paged via `Sp_Outstanding_Query`. Note: the `Set p_iStatisticsType = IFNULL(p_iStatisticsType, 0)` self-reference is a typo (intended `IFNULL(iStatisticsType, 0)`) — the parameter is effectively ignored. + +**Invocation:** Status: appears orphaned. No `gdsconfigformmaster.sSqlStr` binding, no `gdsmodule` hook, no other-routine caller. Only reference is the install script `script/标版/30100101/Sp_Sales_SalesAnalysiseProductOfMonth.sql`. Likely either pre-dispatch template called dynamically from BACK's JS, or a legacy fixture superseded by per-axis procs. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Sales_SalesDelivergoodsAnalysiseOfCustomer.md b/en/docs/auto-catalog/procedures/Sp_Sales_SalesDelivergoodsAnalysiseOfCustomer.md index 8f2712e..d2d3542 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sales_SalesDelivergoodsAnalysiseOfCustomer.md +++ b/en/docs/auto-catalog/procedures/Sp_Sales_SalesDelivergoodsAnalysiseOfCustomer.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售送货分析 — paged customer-level delivery-goods analysis: one row per customer showing aggregate delivered qty / money, collected money and outstanding balance for a single specific 送货单 form (`sFormId='11811781131121915179924491520'`). Distinct from `Sp_Sales_SalesAnalysiseOfCustomer` (which is sales-order-side) — this proc tallies the 送货单 side only. (The `COMMENT '现金日记帐'` is a copy-paste artifact — actual purpose is per-customer delivery analysis.) + +**What it does:** Seeds `SAS` from `eleCustomer` for the current 品牌/分公司, carrying each customer's `sSalesManId` and `sGetPayId`. `UPDATE ... INNER JOIN`s in count, qty and money from `viw_saldelivergoods` grouped by `sCustomerId` — restricted to the single `sFormId='11811781131121915179924491520'` (a specific 送货单 form), `bCheck=1 AND bInvalid=0`. Resolves `sSalesManName` from `sisSalesMan` and `sGetPayName` from `sispayment`. Joins `cahreceiptmaster` for `dPayMoney`, computes `dBalanceMoney`, the three 占比 columns from `tempSAS` totals, and pages via `Sp_Do_UpdateByPageSizeBefore`. + +**Invocation:** Status: appears orphaned. No `gdsconfigformmaster.sSqlStr` / `sConfigSqlStr` / `sSqlCondition` binding, no `gdsmodule` hook, no other-routine caller. Only reference is the install script `script/标版/30100101/Sp_Sales_SalesDelivergoodsAnalysiseOfCustomer.sql` (and an `optimizeprocedure` registration row). The single hard-coded `sFormId` whitelist suggests this was a customer-specific 送货单 analysis that was never wired to a form. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Salesdevplan_CommonGtChar.md b/en/docs/auto-catalog/procedures/Sp_Salesdevplan_CommonGtChar.md index 881182f..9f4812f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Salesdevplan_CommonGtChar.md +++ b/en/docs/auto-catalog/procedures/Sp_Salesdevplan_CommonGtChar.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** PLM管理 → 研发项目管理(雅昌) → 项目进度 → 项目进度甘特图 — Gantt-chart data feed for `salsalesdevplanmaster`/`salsalesdevplanslave` (项目立项 master/slave). Returns the JSON (`{zoom,data,links}`) consumed by the dhtmlxGantt-style front-end. The header constant on the wiki page (项目立项甘特图) is the proc's `COMMENT`; the actual form name in `gdsconfigformmaster` is 项目进度甘特图. + +**What it does:** Builds a temporary table `tmp_gt_PlanInfo` from `salsalesdevplanmaster` joined to `salsalesdevplanslave` (filtered to `bCheck=1, bInvalid=0` and tenant), translates the optional `bFilter` JSON to a WHERE-clause via `Fun_bFilter_toWhere`. Iterates the master rows with a cursor, emitting one `data` entry per master (id/text/start_date/end_date/parent) and then, for each child slave row, emits a second `data` entry plus a `link` joining successive slaves in `iOrder` sequence. Returns the assembled JSON in `sReturn` with `zoom={scale:Minutes,step:30}`. + +**Invocation:** Bound as the data-source of the 项目进度甘特图 form `gfm.sId=101251240115016149122423040` via `gdsconfigformmaster.sSqlStr='Sp_Salesdevplan_CommonGtChar'` — under module 项目进度 (parent: 研发项目管理(雅昌)). Loaded when the user opens the gantt board. Install script: `script/标版/30100101/Sp_Salesdevplan_CommonGtChar.sql`; form-master row in `script/标版/20210323/gdsconfigformmaster.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_SampleStatistics.md b/en/docs/auto-catalog/procedures/Sp_SampleStatistics.md index b78c1c2..0f7c13d 100644 --- a/en/docs/auto-catalog/procedures/Sp_SampleStatistics.md +++ b/en/docs/auto-catalog/procedures/Sp_SampleStatistics.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 打样统计表 — paged sample-to-order conversion report. For every product on the customer's catalogue (`EleProduct`), counts how many 打样订单 the customer placed (`iSampleCount`) versus how many real 销售订单 followed (`iOrderCount`) in a date window, and computes the conversion `dPercentageQty = iOrderCount / iSampleCount * 100`. Used by sales to see which proofs converted and which were dead samples. + +**What it does:** Stages `Tmp_EleProduct` from `EleProduct` filtered by `sCustomerGuid` / `sProductGuid`. For each row, counts checked rows in `Viw_SalSalesOrder` whose `sFormId` is one of three 打样订单 form ids (`101251240115015876853553040`, `101251240115015891763306420`, `101251240115015923011260880`) into `iSampleCount`, and one of three 销售订单 form ids (`11811781131121915179702987440`, `101251240115015878710737470`, `101251240115015923020662710`) into `iOrderCount`, optionally between `tStartDate / tEndDate`. Computes the percentage, joins `elecustomer` for `sCustomerNo` / `sCustomerName`, then hands the final `Select ... From Tmp_EleProduct A where iSampleCount > 0` to `Sp_Outstanding_Query` for paging. + +**Invocation:** Bound as the data-source of the 打样统计表 form `gfm.sId=15936608930005133957219822193000` (parent module `101251240115015878880530950`) via `gdsconfigformmaster.sTbName='Sp_SampleStatistics', sType='proc'` — see the install script in `script/标版/20210323/gdsconfigformmaster.sql` and `script/标版/30100101/Sp_SampleStatistics.sql` (with an optimised variant under `script/标版/optimize/`). diff --git a/en/docs/auto-catalog/procedures/Sp_Save_CheckSaveAfter.md b/en/docs/auto-catalog/procedures/Sp_Save_CheckSaveAfter.md index baa27c6..302d2d4 100644 --- a/en/docs/auto-catalog/procedures/Sp_Save_CheckSaveAfter.md +++ b/en/docs/auto-catalog/procedures/Sp_Save_CheckSaveAfter.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 系统 → 保存校验单据 — central POST-save validator that the framework calls after a row is committed but before the user sees "saved". Branches on `sTableName` and `sFormGuid` to run business-rule guards across most of the ERP — basic data (`elecustomer`, `eleemployee`, `eleKnifemould`, `elematerialsyearmaster`, `eleproductpricemaster`, `elesupply`, `mftproductmaster`), sales (`salsalesordermaster`, `SalSalesInvoiceMaster`, `salsalesorderbecomemaster`, `saldelivergoodsdedmaster`, `saldelivergoodsdedinmaster`), production / outsource (`mftoutprocessmaster`, `mftprocesschangemaster`, `mftmaterialstest`, `mitproductionapplymaster`, `mitproductionmaterialsmaster`, `mftproductionplanbillslave`, `pitproductcheckmaster`), purchasing (`purpurchaseinstorededmaster`, `opsoutsideinstorededmaster`), and file management (`filfilemanagemaster`). + +**What it does:** For each branch, runs a `SELECT COUNT` / `EXISTS` style check on the slave or related tables, and on violation emits a localised error from `Fun_Sis_GetConst` / `Sp_Sis_GetConst` (e.g. `sGykkNagativeNum` "扣款单单价请填写负数!", `sCheckSaveAfterRemarkEmpty`, `sCheckSaveAfterProductCantInsert`, `sCheckSaveAfterChooseDbType`, `sCheckSaveAfterMaterialCg`, `sCheckSaveAfterZyzrMoneyNoSameZr`, `sCheckSaveAfterOrderTypeZlsgNeedNo`, ...) and aborts with `sCode=-1` via the labelled `top:` block. On all-pass falls through with no message. + +**Invocation:** Signature matches the save-validator hook contract. Dispatched by Java `BusinessBaseServiceImpl` against `gdsmodule.sSaveProName` for every form whose `sFormGuid` the proc explicitly branches on (the form ids enumerated inside the body). No other-routine caller; no install script ships in `xly-src/script/` under the standard tree — this proc is DB-resident. Effectively the catch-all "everything-else" save validator for the ERP modules that don't have a dedicated `Sp_Check_s`. diff --git a/en/docs/auto-catalog/procedures/Sp_Save_Check_Supply.md b/en/docs/auto-catalog/procedures/Sp_Save_Check_Supply.md index 08565bd..75a343f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Save_Check_Supply.md +++ b/en/docs/auto-catalog/procedures/Sp_Save_Check_Supply.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购管理 → 供应商考核 — recomputes the per-supplier KPI rollup on `revsupplyslave` for the parent 考核表 (`revsupplymaster.sId = sGuId`) over the master-defined `tStartDate / tEndDate` window. The numbers drive supplier scorecards (incoming receipts count, receipt money, accident rate, on-time-delivery rate, accident money, deduction money) used to rank and rate vendors. + +**What it does:** Reads `tStartDate` / `tEndDate + 1 day` from `revsupplymaster` for the given `sGuId`. Updates `revsupplyslave` setting: `iHappendCount` = total count of `purpurchaseinstoremaster` + `opsoutsideinstoremaster` rows in window for the supplier; `dInStoreMoney` = sum of slave `dMaterialsMoney` from both receipt tables; `dAccidentRate` = `mftqualityaccidentmaster` rows (`sFormId='22112241153111416876678221340'`) divided by `purpurchaseordermaster` rows × 100; `dDeliverRate` = on-time arrivals (`tDeliverDate >= tCreateDate`) divided by total arrivals × 100; `dAccidentMoney` and `dOutMoney` summed from the `purpurchaseinstoreded*` / `opsoutsideinstoreded*` deduction tables. Replaces zero rates with 100 (i.e. perfect score when no data) in a follow-up `UPDATE`. + +**Invocation:** Signature matches the save-validator hook contract (`sFormGuid, sGuid, sTableName, sLogINId, sUserId, sReturn, sBrId, sSuId, sCode`), but no `gdsmodule.sSaveProName` / `sSaveProNameBefore` row currently points at it in the live DB and no other routine / xly-src caller references it. Status: appears orphaned in this tenant — likely activated by a customer patch that wires it as the 供应商考核 form's after-save proc. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_ScanPicking.md b/en/docs/auto-catalog/procedures/Sp_ScanPicking.md index 4cde2f7..5bae26b 100644 --- a/en/docs/auto-catalog/procedures/Sp_ScanPicking.md +++ b/en/docs/auto-catalog/procedures/Sp_ScanPicking.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 移动端管理 → 扫码业务 (likely 扫码送货 / 扫码入库, paired with modules `101251240115015959228704430` 扫码送货 and `101251240115015959853077870` 扫码送货(单据)). When a worker scans a product-barcode label on a mobile device the proc validates the label and returns its full attributes for the next step (`COMMENT '扫码入库'`). + +**What it does:** Looks up `pitproductbarcode` by the scanned `sId`. Returns `sCode=-1` with a localised message if the label doesn't exist (`该标签不存在`) or has been used (`bUsed=1` → `该标签已使用,不能重复扫码`). Otherwise selects the full barcode row plus a derived `sSqlConditionId = CONCAT(sMaterialsId, sDefineNo, sDefineNo2, sWarehouseId, sLocationId, sWarehouseLocationId, sMaterialsStyle)` so the caller can match the label against in-store / picking conditions. + +**Invocation:** No DB caller and no Java/XML reference in xly-src — only the install script `script/标版/30100101/Sp_ScanPicking.sql` ships the proc. The expected reach is a mobile/scan-handler that invokes it dynamically by name (similar pattern to other scan routines), but no concrete call site is discoverable in this tree. Status: appears orphaned — candidate for maintainer audit to confirm which mobile endpoint dispatches it. diff --git a/en/docs/auto-catalog/procedures/Sp_SetUpSubjectAssociate.md b/en/docs/auto-catalog/procedures/Sp_SetUpSubjectAssociate.md index f314a4c..df0cad5 100644 --- a/en/docs/auto-catalog/procedures/Sp_SetUpSubjectAssociate.md +++ b/en/docs/auto-catalog/procedures/Sp_SetUpSubjectAssociate.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 凭证 / 科目设置 — generic-dispatch BtnEvent on the 科目 (subject / chart-of-accounts) grid. The button takes a set of `sissubject` rows already configured with `sSubject1..6` and `sThirdNo`, and propagates those values to every other `sissubject` row sharing the same `sFormId` (form-binding) that has the slot still empty. Effect: "apply this subject's account mapping to every other entry of the same business form". + +**What it does:** Parses the standard `$.params[*].value[*].sId` JSON. For each `sId` it `SELECT ... INTO p_sFormId, p_sSubject1..6, p_sThirdNo FROM sissubject` then `UPDATE sissubject SET sSubject{1..6} = IF(IFNULL(sSubject{N},'')='', p_sSubject{N}, sSubject{N}), sThirdNo = IF(IFNULL(sThirdNo,'')='', p_sThirdNo, sThirdNo) WHERE sFormId = p_sFormId` (scoped to the calling `sBrId` / `sSuId`). If the source row has no `sFormId` it aborts with the localised `paramsErro` message from `Fun_Sis_GetConst`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — a 设置科目关联 toolbar button on the 科目 grid names `Sp_SetUpSubjectAssociate` as the action. xly-src ships `script/标版/30100101/Sp_SetUpSubjectAssociate.sql` and the original 2021-11-15 upgrade `script/标版/upgrade/20211115生成凭证/Sp_SetUpSubjectAssociate.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_SingleReceipt_BtnEventAbnormal.md b/en/docs/auto-catalog/procedures/Sp_SingleReceipt_BtnEventAbnormal.md index 8570d4e..db409b6 100644 --- a/en/docs/auto-catalog/procedures/Sp_SingleReceipt_BtnEventAbnormal.md +++ b/en/docs/auto-catalog/procedures/Sp_SingleReceipt_BtnEventAbnormal.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 移动端管理 → 现场 → 功能操作 → 送货回执 (`101251240115015892027636750`) — mobile-side button "异常回执" on the 送货回执 module. The driver / receiver marks one or more delivery lines as abnormal (e.g. damaged, short, mis-shipped) and types an explanation; this proc records the abnormal flag, the typed memo and any custom fields on the upstream 送货单从表 `saldelivergoodsslave`. + +**What it does:** Parses the standard `$.params[*].value[*].sId` JSON and the bag `$.changeValue` carrying `textareaValue` (the memo) and `valueKey` (comma-separated list of extra fields the front-end is overwriting — `sSingleReceipt`, custom abnormal fields, etc.). For each sId, builds a dynamic UPDATE on `saldelivergoodsslave` setting the listed fields plus the memo column. Refuses with the localised `paramsErro` from `Sp_Sis_GetConst` when the JSON is too short or malformed. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 异常回执 button on the mobile 送货回执 grid names `Sp_SingleReceipt_BtnEventAbnormal` as the action. Sibling: `Sp_SingleReceipt_BtnEventFinished` (正常回执). xly-src ships `script/标版/30100101/Sp_SingleReceipt_BtnEventAbnormal.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_SingleReceipt_BtnEventFinished.md b/en/docs/auto-catalog/procedures/Sp_SingleReceipt_BtnEventFinished.md index a9527bb..932d4fb 100644 --- a/en/docs/auto-catalog/procedures/Sp_SingleReceipt_BtnEventFinished.md +++ b/en/docs/auto-catalog/procedures/Sp_SingleReceipt_BtnEventFinished.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 移动端管理 → 现场 → 功能操作 → 送货回执 (`101251240115015892027636750`) — mobile-side button "确认回执" on the 送货回执 module. The driver / receiver confirms that the delivery lines were received in full; this proc stamps the receipt-confirmed flag, receiver name, timestamp and full received qty on the upstream 送货单从表 `saldelivergoodsslave`. + +**What it does:** Parses the standard `$.params[*].value[*].sId` JSON. For each `sId` it `UPDATE saldelivergoodsslave SET tSingleReceipt=NOW(), sSingleReceipt=sMakePerson, dSingleReceiptQty=dProductQty, bSingleReceipt=1 WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId` — i.e. accepts the full shipped qty as the received qty (no per-line override). Refuses with the localised `paramsErro` from `Sp_Sis_GetConst` when the JSON is too short. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 确认回执 button on the mobile 送货回执 grid names `Sp_SingleReceipt_BtnEventFinished` as the action. Sibling: `Sp_SingleReceipt_BtnEventAbnormal` (异常回执). Customer override: `script/客户/千彩/Sp_SingleReceipt_BtnEventFinished.sql`. Standard install: `script/标版/30100101/Sp_SingleReceipt_BtnEventFinished.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Sis_CopeEventList.md b/en/docs/auto-catalog/procedures/Sp_Sis_CopeEventList.md index fc15c03..b5ad82c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sis_CopeEventList.md +++ b/en/docs/auto-catalog/procedures/Sp_Sis_CopeEventList.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**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. diff --git a/en/docs/auto-catalog/procedures/Sp_Sis_GetConst.md b/en/docs/auto-catalog/procedures/Sp_Sis_GetConst.md index 54add8e..f92ffa5 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sis_GetConst.md +++ b/en/docs/auto-catalog/procedures/Sp_Sis_GetConst.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 系统工具 — i18n constant lookup. Resolves a logical message key (`sStr`) to the localised string the caller should surface to the user. Procedure twin of the function `Fun_Sis_GetConst`; widely used by audit/check/btn-event procs to emit translated error / status messages ("请选择数据", "Working", "paramsErro", …). + +**What it does:** Reads `SysSystemSettings.CbxLanguage` (defaulting to `sChinese`) for the tenant, builds a dynamic `SELECT INTO @sReturnValue FROM gdsformconst WHERE 1=1 [AND sParentId='sGuid'] [AND sName='sStr'] LIMIT 1`, executes via `PREPARE`/`EXECUTE`, then returns `@sReturnValue` in `sReturn`. Falls back to the raw `sStr` if no row matches. `sGuid` scopes the lookup to a particular constant namespace; passing `''` is normalised to `'100'`. + +**Invocation:** Called via `CALL Sp_Sis_GetConst(...)` from 488 other DB routines (sample: `Sp_AfterPost_sQtt`, `Sp_Bill_Used`, `Sp_BtnEventCalculatewages`, `Sp_BtnEventDepartSure_New`, every `Sp_Supply_*` btn-handler, `Sp_Sis_CopeEventList`, etc.). Not directly invoked from xly-src Java — the Java layer uses the function `Fun_Sis_GetConst` for the same purpose. Status: live core utility. diff --git a/en/docs/auto-catalog/procedures/Sp_Sis_GetEleProductNo.md b/en/docs/auto-catalog/procedures/Sp_Sis_GetEleProductNo.md index fe7cba5..5a0eca6 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sis_GetEleProductNo.md +++ b/en/docs/auto-catalog/procedures/Sp_Sis_GetEleProductNo.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础资料 → 印品资料 (eleproduct) — auto-generates the next 印品编号 (品牌+系列+sequence) for a new product master row, using the customer / reserve-code prefix plus a per-prefix incrementing tail. Specifically targets `sProductNo LIKE 'KH%'` (客户款式) and supports two width modes — 5-digit tail when `sDemandItemCode=0`, 3-digit tail otherwise — driven by `sBillType` (`sMReserve5` / `sProductNo` / default `sMReserve6`). + +**What it does:** Parses `sClassNo` as JSON (`sCustomerId, sCustomerNo, sNo, sMReserve1..6, sDemandItemCode, sProductName, sId`); if `sId` is supplied and an existing `KH%` row already exists for that product, returns the existing `sProductNo` (idempotency); otherwise composes a dynamic `SELECT MAX(CONVERT(,UNSIGNED))` over `eleproduct` with the assembled `WHERE` (brand/subsidiary + customer + reserve fields + optional product-name) restricted to `sProductNo LIKE 'KH%'`, adds 1, left-pads to the configured width, and concatenates with the title prefix for the `sProductNo` mode (or returns just the tail for the reserve-column modes). + +**Invocation:** Called by Java `BusinessCharacterFormatServiceImpl.getEleProductNo(sBillType, sClassNo, sBrandsId, sSubsidiaryId)` through `procedureService.getCallProByMap(...)` — the character-format pipeline that fills auto-generated codes on the product master form during save/draft. Install script: `script/标版/30100101/Sp_Sis_GetEleProductNo.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Sis_GetMaxNo.md b/en/docs/auto-catalog/procedures/Sp_Sis_GetMaxNo.md index 3efff67..e9fa46a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sis_GetMaxNo.md +++ b/en/docs/auto-catalog/procedures/Sp_Sis_GetMaxNo.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 系统工具 — 单据号 (bill-number) generator. Universal next-bill-number factory used during bill-master save: returns the next sequential `sBillNo` for a given target table (`mftworkordermaster`, `mftproductmaster`, `pitproductinstoremaster`, sales/purchase masters, …) using the per-form template configured in `SysBillNoSettings` (`sBillNoTitle`, `sBillNoType`, `iBillNoLength`, `sColumnNames`, `sReset`). + +**What it does:** Reads `SysBillNoSettings` for `sFormId=sFormGuid` (with `sSrcFormId` redirection) to learn the title prefix, the type code (`nyrlsh`/`nylsh`/`nlsh`/`ywybhnylsh`/`khbhlsh`/`khjclsh`/`yjhlsh`/…) and the numeric width. Builds the time/sales-man/customer/product prefix accordingly — `sYear/sMonth/sDay/sMinute` from `NOW()`, `EleEmployee.sEmployeeNo` for the salesman, `EleCustomer.sCustomerShort/sCustomerNo` for the customer, `EleProduct.sProductNo` for the product. Then queries `MAX(CAST(RIGHT(sBillNo, iBillNoLength) AS UNSIGNED))` from the target table filtered by the same prefix + reset window, adds 1, left-pads to `iBillNoLength`, and returns `prefix || sequence` in `sReturn`. Also routes through `Fn_json_extract` to read fields out of the `sClassNo` JSON blob for product/material-classify suffixes. + +**Invocation:** Called via `procedureService.getCallProByMap(...)` from Java `BusinessCharacterFormatServiceImpl.getMaxBillNo(...)` (the standard pipeline) and `webService.service.impl.ErpOrderProcurementServiceImpl.getMaxBillNo(...)` (web-service variant for external order intake). Also invoked from peer routines `Sp_Calc_sOis`, `Sp_Calc_sWod`, `Sp_Manufacture_InsertMftPlanBook`, `Sp_Manufacture_InsertMftPlanToErp`, and the split procs `Sp_Split_sMpt` / `Sp_Split_sWod` when they fabricate new master rows. Install scripts: `script/标版/30100101/Sp_Sis_GetMaxNo.sql` plus the `optimize/` patch variant. diff --git a/en/docs/auto-catalog/procedures/Sp_Sis_GetMaxNo_1.md b/en/docs/auto-catalog/procedures/Sp_Sis_GetMaxNo_1.md index 7ddaccd..301a3aa 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sis_GetMaxNo_1.md +++ b/en/docs/auto-catalog/procedures/Sp_Sis_GetMaxNo_1.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup variant of [`Sp_Sis_GetMaxNo`](Sp_Sis_GetMaxNo.md) — same 8-arg signature, near-identical body (header `declares` and prefix builders match line-for-line). The `_1` suffix marks a snapshot kept around the time of a behaviour change; per wiki convention, `_N` backup objects are not narrated as live code. + +**What it does:** Same as `Sp_Sis_GetMaxNo` at the time of copy — bill-number factory keyed by `SysBillNoSettings` template, time/salesman/customer prefix, table-side `MAX(...) + 1` sequence, zero-padded to `iBillNoLength`. + +**Invocation:** Not referenced in `gdsmodule`, no form-master binding, no other DB routine calls it, no xly-src reference. Status: appears orphaned — not expected to be called from production. Verify against the live `Sp_Sis_GetMaxNo` before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Sis_GetMaxNo_New.md b/en/docs/auto-catalog/procedures/Sp_Sis_GetMaxNo_New.md index 2c71c72..45bce1d 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sis_GetMaxNo_New.md +++ b/en/docs/auto-catalog/procedures/Sp_Sis_GetMaxNo_New.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Forward variant of [`Sp_Sis_GetMaxNo`](Sp_Sis_GetMaxNo.md) — same 8-arg signature with extra local declarations (`sFormGuidWhere LONGTEXT`, `p_sRealFormGuid varchar(100)`), apparently a work-in-progress rewrite that adds richer multi-form-guid handling. Per wiki convention, `_New` variants are not narrated as live code unless wired in. + +**What it does:** Same shape as `Sp_Sis_GetMaxNo` (bill-number factory) with extended logic around `sFormGuidWhere`/`p_sRealFormGuid` — likely supporting reset / sequence segregation across grouped form IDs. Confirm against the diff before deploying. + +**Invocation:** Not referenced in `gdsmodule`, no form-master binding, no other DB routine calls it, no xly-src reference. Status: appears orphaned — not expected to be called from production. The live entry point is `Sp_Sis_GetMaxNo`. diff --git a/en/docs/auto-catalog/procedures/Sp_Sis_GetMaxNo_copy1.md b/en/docs/auto-catalog/procedures/Sp_Sis_GetMaxNo_copy1.md index c35b136..d349626 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sis_GetMaxNo_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_Sis_GetMaxNo_copy1.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_Sis_GetMaxNo` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_Sis_GetMaxNo` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_Sis_GetMertialsInventoryFormGuid.md b/en/docs/auto-catalog/procedures/Sp_Sis_GetMertialsInventoryFormGuid.md index 2311244..b2bc823 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sis_GetMertialsInventoryFormGuid.md +++ b/en/docs/auto-catalog/procedures/Sp_Sis_GetMertialsInventoryFormGuid.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 库存管理 — material-inventory IN/OUT form-ID classifier. Returns two hard-coded comma-separated lists that tell callers which sales/purchase/production bill forms add to `mitmaterialsstore` (入库) vs which remove from it (出库). The same name exists as a `FUNCTION` returning a single flag (0/1); this procedure variant returns both lists in a single call. + +**What it does:** Hard-codes two long string literals into `OUT` parameters — `sReturnIn` (the form-IDs whose audit increases material stock: 采购入库, 调拨入库, 退料, 期初入库, 委外退货入库, etc.) and `sReturnOut` (form-IDs that decrease stock: 领料, 调拨出库, 报废, 委外发料, 期初出库, etc.). Some slots are placeholders `'后续增加'` reserved for forms not yet wired in. Callers then `INSTR(@sInSql, sFormId)` / `INSTR(@sOutSql, sFormId)` to decide the sign when summing `mitmaterialsstore`. + +**Invocation:** Called via `CALL Sp_Sis_GetMertialsInventoryFormGuid(@sInSql, @sOutSql)` from at least 10 inventory-flow procs: `Sp_Inventory_InOutStore`, `Sp_Inventory_InOutStoreNew*`, `SP_Inventory_InOutWarehouse*`, `Sp_calc_materialsstoreLimit`, `Sp_check_MaterialsStockLimitNew`. Not reachable from a form-master or `gdsmodule` hook directly. Install script: `script/标版/30100101/Sp_Sis_GetMertialsInventoryFormGuid.sql`. Caveat: any new material form-ID must be appended here manually — drift between this list and the actual form set is a known maintenance hazard. diff --git a/en/docs/auto-catalog/procedures/Sp_Sis_GetProductInventoryFormGuid.md b/en/docs/auto-catalog/procedures/Sp_Sis_GetProductInventoryFormGuid.md index 8d9319e..4d10b44 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sis_GetProductInventoryFormGuid.md +++ b/en/docs/auto-catalog/procedures/Sp_Sis_GetProductInventoryFormGuid.md @@ -20,4 +20,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 库存管理 — product-inventory IN/OUT form-ID classifier. Product-side counterpart of `Sp_Sis_GetMertialsInventoryFormGuid`. Returns the two comma-separated form-ID lists that decide which 印品 bills add to `pitproductstore` (入库: 产品入库主表, 配料单主表, 印品调拨入库, …) vs subtract (出库: 印品销售出库, 调拨出库, 发外退货, 印品报废, …). + +**What it does:** Hard-codes both lists into `OUT sReturnIn` and `OUT sReturnOut`; callers `INSTR(@sInSql, A.sFormId) > 0` / `INSTR(@sOutSql, A.sFormId) > 0` to sign the `dProductQty` when aggregating `pitproductstore` snapshots and to refuse audits that would push stock negative. + +**Invocation:** Called via `CALL Sp_Sis_GetProductInventoryFormGuid(@sInSql, @sOutSql)` from 10+ product-stock procs including `Sp_Calc_sPst` (印品入库审核), `Sp_Calc_sOpi1`, `SP_Inventory_ProductCalcQty`, `Sp_Inventory_ProductInOutStore*`, `Sp_calc_productstoreLimit`, `Sp_check_productstoreLimitNew`. Install scripts: `script/标版/30100101/Sp_Sis_GetProductInventoryFormGuid.sql`. Same maintenance hazard as the materials twin — new product-flow forms must be appended here. diff --git a/en/docs/auto-catalog/procedures/Sp_SortReportProcess.md b/en/docs/auto-catalog/procedures/Sp_SortReportProcess.md index 3518d15..4a7ce62 100644 --- a/en/docs/auto-catalog/procedures/Sp_SortReportProcess.md +++ b/en/docs/auto-catalog/procedures/Sp_SortReportProcess.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产报工 — assigns/refreshes the `iGroupOrder` ranking on work-order processes (`mftworkorderprocess`) and production-plan slaves (`mftproductionplanslave`) so report-quantity validation can compare against the previous process in the same group. Despite the page subtitle ("判断工单是否完工并修改"), the body is purely an ordering rebuild used by report-quantity guards. + +**What it does:** Drops/creates `SortTmp` temp table; selects every `mftproductionplanslave` row for the scoped work-order (`sWorkOrderId = sGuid`, or all when `sGuid=''`) joined to `mftworkordercontrol` (excluding `bOutside=1`, `dProcessQty>0`), groups by `(sWorkOrderId || sId)` and assigns a 1..N rank via the classic MySQL `@rank` session-variable trick ordered by `iOrder` of the work-order-process. Then UPDATEs `mftproductionplanslave.iGroupOrder` from `SortTmp` and propagates the same rank up to `mftworkorderprocess.iGroupOrder` for the processes that back those plans. + +**Invocation:** Called by `Sp_CheckExceedReport` (`p_sReportType='2'`) before it queries the previous-process report quantity — so the rank reflects today's plan topology when the operator submits 报工. Install script: `script/标版/30100101/Sp_SortReportProcess.sql`. No xly-src Java caller. diff --git a/en/docs/auto-catalog/procedures/Sp_SplicingTableSql.md b/en/docs/auto-catalog/procedures/Sp_SplicingTableSql.md index a4f43b6..6885364 100644 --- a/en/docs/auto-catalog/procedures/Sp_SplicingTableSql.md +++ b/en/docs/auto-catalog/procedures/Sp_SplicingTableSql.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务管理 → 凭证管理 — generic source-table → 凭证模板 (UdfVoucherTemplate) column-mapping SQL builder. Used by the universal voucher-generation flow to splice a per-form `SELECT ... INSERT INTO udfvoucherslave` based on which optional columns the source `gdsconfigformmaster` table actually has (sSlaveId, sWareHouseId, sMaterialsId, sCustomerId, sSupplyId, sBankId, sProductId, sInvoiceNo, sMemo, dCostMoney/dProfitLossMoney/dMaterialsMoney, dSlaveTotalMoney/dTotalMoney, …). + +**What it does:** Resolves `p_sSrcTableName` from `gdsconfigformmaster.sTbName WHERE sParentId=sFormGuid`; reads `p_sSumType` from `udfvouchertemplatemaster`; then conditionally appends to `p_sInsertSql` and `p_sSelectSql` via `EXISTS(... information_schema.COLUMNS WHERE COLUMN_NAME=...)` checks — every optional column on the source table becomes a paired insert+select term. Money columns fall through `dCostMoney → dProfitLossMoney → dMaterialsMoney` and `dSlaveTotalMoney → dTotalMoney → dProductMoney` cascades. Returns the assembled column-mapping SQL fragment via `sReturn` for the caller to assemble the final voucher-insert statement. + +**Invocation:** Called by `Sp_InsertVoucher_Universals_All` and `Sp_InsertVoucher_Universals_Pro` — the two universal voucher-generation procs that consume any audited business bill and emit 财务凭证. Install script: `script/标版/30100101/Sp_SplicingTableSql.sql`. No direct xly-src or `gdsmodule` binding — strictly an internal helper. diff --git a/en/docs/auto-catalog/procedures/Sp_Split_sMpt.md b/en/docs/auto-catalog/procedures/Sp_Split_sMpt.md index 2b0dc0c..5058754 100644 --- a/en/docs/auto-catalog/procedures/Sp_Split_sMpt.md +++ b/en/docs/auto-catalog/procedures/Sp_Split_sMpt.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 产品工艺卡 (`mftproductmaster` / 印品工艺卡) — splits a multi-line product-craft master into individual one-line masters, one per product. When a craft card carries several products in its slave, the user runs this proc to fan out the master so each product has its own card (a precondition for downstream MRP / 工艺差异 reporting). + +**What it does:** Counts `mftproductslave WHERE sParentId=sGuid`; if there are 2+ slaves, opens a cursor over them and for each slave (after `sId`, `sCustomerId`, `sProductId`, `sProductNo`): generates `new_masterId`/`new_slaveId` via `newId()`, skips when an active master for `sProductId` already exists, requests a fresh `sBillNo` via `CALL SP_Sis_GetMaxNo('mftproductmaster', …)`, then `INSERT INTO mftproductmaster (...) SELECT ... FROM mftproductmaster WHERE sId=sGuid` (clones the master with new IDs) and `INSERT INTO mftproductslave (...) SELECT ...` (clones only that one slave row). Does nothing when the master has 0 or 1 slaves. + +**Invocation:** Install script: `script/标版/30100101/Sp_Split_sMpt.sql`. No form-master binding, no `gdsmodule` hook, no other DB caller, no xly-src reference. Status: appears orphaned — likely a manual one-off tool invoked by DBA; candidate for maintainer audit before relying on the cloned-row column list (verify all reserved/extension columns are still covered). diff --git a/en/docs/auto-catalog/procedures/Sp_Split_sWod.md b/en/docs/auto-catalog/procedures/Sp_Split_sWod.md index 70e25fa..bdc5e18 100644 --- a/en/docs/auto-catalog/procedures/Sp_Split_sWod.md +++ b/en/docs/auto-catalog/procedures/Sp_Split_sWod.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产工单 (`mftworkordermaster` / 研发工单) — work-order equivalent of `Sp_Split_sMpt`. Splits a multi-line work-order master into individual one-line work-orders so each printable product has its own 工单 number, scheduling row, and downstream report chain. + +**What it does:** Counts `mftworkorderslave WHERE sParentId=sGuid`; iterates each slave with a cursor; for each iteration skips when another slave already references the same `sProductId` (dedup), then calls `SP_Sis_GetMaxNo('mftworkordermaster', …)` for a fresh `sBillNo`, generates new IDs via `newId()`, and `INSERT INTO mftworkordermaster ... SELECT ... FROM mftworkordermaster WHERE sId=sGuid` (cloning every master column including the production-stage money fields `dPrintBeforeMoney`/`dPrintMoney`/`dPackMoney`/`dTransportMoney`, completion flags `bBillComplete`/`bSealingComplete`, plate fields, etc.) followed by `INSERT INTO mftworkorderslave ... SELECT ...` for that single slave (full column list including process flags `bDeliverComplete`/`bOutsideProcessComplete`/`bCheckingComplete`, transferred-matter fields, etc.). + +**Invocation:** Install script: `script/标版/30100101/Sp_Split_sWod.sql`. No form-master binding, no `gdsmodule` hook, no other DB caller, no xly-src reference. Status: appears orphaned — DBA-side helper. Caveat: cloned column list is hard-coded; any schema additions to `mftworkordermaster`/`mftworkorderslave` need to be reflected here, otherwise clones drop those columns silently. diff --git a/en/docs/auto-catalog/procedures/Sp_Supply_BtnEventCancelInvalid.md b/en/docs/auto-catalog/procedures/Sp_Supply_BtnEventCancelInvalid.md index cf66b3a..4590374 100644 --- a/en/docs/auto-catalog/procedures/Sp_Supply_BtnEventCancelInvalid.md +++ b/en/docs/auto-catalog/procedures/Sp_Supply_BtnEventCancelInvalid.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础资料 → 供应商与外协加工商 → 供应商信息 — 取消作废 (un-invalidate / restore) toolbar action for the supplier-master grid (`elesupply`). Reverses [`Sp_Supply_BtnEventInvalid`](Sp_Supply_BtnEventInvalid.md), bringing previously-deactivated suppliers back into purchase pickers. + +**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam` (supports `-`-joined multi-id strings). For each `sIdOne`: reads `elesupply.sSupplyName`, runs `UPDATE elesupply SET bInvalid=0 WHERE sId=… AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`, and writes a `syslog` row with `sOperationType='取消作废供应商'`, `sLog='取消作废供应商:'`, `sFormId='11811781131121915163429350260'` (the 供应商信息 form sId), `sClientType='浏览器'`. Returns the localised `Fun_Sis_GetConst('chooseData', …)` error when `sProInParam` is empty. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 取消作废 button on the 供应商信息 grid names this procedure. Install script: `script/标版/30100101/Sp_Supply_BtnEventCancelInvalid.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Supply_BtnEventInvalid.md b/en/docs/auto-catalog/procedures/Sp_Supply_BtnEventInvalid.md index 375d640..3aea80c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Supply_BtnEventInvalid.md +++ b/en/docs/auto-catalog/procedures/Sp_Supply_BtnEventInvalid.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础资料 → 供应商与外协加工商 → 供应商信息 — 作废 (invalidate) toolbar action for the supplier-master grid (`elesupply`). Soft-deletes supplier records so they no longer appear in purchase pickers, while preserving the audit trail. + +**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam` (supports `-`-joined multi-id strings). For each `sIdOne`: looks up `elesupply.sSupplyName`, then `UPDATE elesupply SET bInvalid=1 WHERE sId=… AND sBrandsId/sSubsidiaryId` and writes an audit row to `syslog` with `sOperationType='作废供应商'`, `sFormId='11811781131121915163429350260'` (the 供应商信息 form sId), `sLog='作废供应商:'`. Errors out with localised `Fun_Sis_GetConst('chooseData', …)` when `sProInParam` is empty. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 作废 button on the 供应商信息 grid (form sId `11811781131121915163429350260`) names `Sp_Supply_BtnEventInvalid` as its action. Inverse: [`Sp_Supply_BtnEventCancelInvalid`](Sp_Supply_BtnEventCancelInvalid.md). Install script: `script/标版/30100101/Sp_Supply_BtnEventInvalid.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_Supply_filecheck.md b/en/docs/auto-catalog/procedures/Sp_Supply_filecheck.md index e807aa1..d9caea4 100644 --- a/en/docs/auto-catalog/procedures/Sp_Supply_filecheck.md +++ b/en/docs/auto-catalog/procedures/Sp_Supply_filecheck.md @@ -1,7 +1,7 @@ # `Sp_Supply_filecheck` (procedure) -> @author:zhucx - @date: 2022/12/02 +> @author:zhucx + @date: 2022/12/02 @describe: 供应商评估-资质审核 @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础资料 → 供应商与外协加工商 → 供应商评估 — 资质审核 toolbar action. Reviews submitted supplier-evaluation entries: stamps the reviewer and advances `iLevel` to the awaiting-final-rating state (2) so [`Sp_Supply_setLevel`](Sp_Supply_setLevel.md) can finalise. + +**What it does:** Parses `$.params[*].value[*].sSlaveId` from `sProInParam`. For each `p_sId` runs `UPDATE elesupply SET tFileCheck=SYSDATE(), sFileCheck=sMakePerson, iLevel=2 WHERE sId=p_sId AND sBrandsId/sSubsidiaryId`. Refuses with the localised `paramsErro` constant (via `Sp_Sis_GetConst`) when `sProInParam` is empty. Reverse pair with [`Sp_Supply_refilecheck`](Sp_Supply_refilecheck.md), which strips the audit fields and resets `iLevel=0`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — 供应商评估 grid's 资质审核 button names this proc. Install script: `script/标版/30100101/Sp_Supply_filecheck.sql`. Author tag: `@author:zhucx @date: 2022/12/02`. diff --git a/en/docs/auto-catalog/procedures/Sp_Supply_reLevel.md b/en/docs/auto-catalog/procedures/Sp_Supply_reLevel.md index 9353b78..3ed2f63 100644 --- a/en/docs/auto-catalog/procedures/Sp_Supply_reLevel.md +++ b/en/docs/auto-catalog/procedures/Sp_Supply_reLevel.md @@ -1,7 +1,7 @@ # `Sp_Supply_reLevel` (procedure) -> @author:zhucx - @date: 2022/12/02 +> @author:zhucx + @date: 2022/12/02 @describe: 供应商信息-重新评级 @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础资料 → 供应商与外协加工商 → 供应商信息 — 重新评级 (re-rate) toolbar action. Reverses [`Sp_Supply_setLevel`](Sp_Supply_setLevel.md) and clears the rating fields so the supplier needs to re-enter the evaluation flow. + +**What it does:** Parses `$.params[*].value[*].sSlaveId` from `sProInParam` plus `$.changeValue[0].valueKey` (comma-separated columns to reset) and `changeValue.textareaValue` (reason). Splices each `=` into `p_setSql`, always appends `sLevelMemo=`, then executes `UPDATE elesupply SET WHERE sId=p_sId AND sBrandsId/sSubsidiaryId`. Errors with localised `paramsErro` when `sProInParam` is empty. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — 供应商信息 grid's 重新评级 button. Install script: `script/标版/30100101/Sp_Supply_reLevel.sql`. Author tag: `@author:zhucx @date: 2022/12/02`. Caveat: like its sibling `Sp_Supply_setLevel`, the body retains a `SELECT @sSqlStmt` debug echo before `PREPARE`. diff --git a/en/docs/auto-catalog/procedures/Sp_Supply_refilecheck.md b/en/docs/auto-catalog/procedures/Sp_Supply_refilecheck.md index 3a654a3..79342f9 100644 --- a/en/docs/auto-catalog/procedures/Sp_Supply_refilecheck.md +++ b/en/docs/auto-catalog/procedures/Sp_Supply_refilecheck.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础资料 → 供应商与外协加工商 → 供应商评估 — 取消资质审核 / 反审核 toolbar action. Reverses [`Sp_Supply_filecheck`](Sp_Supply_filecheck.md) by stamping `sFileCheckMemo` with the rejection note and resetting `iLevel=0`, putting the supplier back to draft. + +**What it does:** Parses `$.params[*].value[*].sSlaveId` from `sProInParam` plus `$.changeValue.textareaValue` (rejection memo) and any optional `valueKey`-driven extra column setters. Builds a dynamic `UPDATE elesupply SET iLevel=0, =, …, tFileCheck=SYSDATE(), sFileCheck=sMakePerson, sFileCheckMemo= WHERE sId=p_sId AND sBrandsId/sSubsidiaryId`, then `PREPARE`/`EXECUTE`. Errors with localised `paramsErro` when `sProInParam` is empty. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — 供应商评估 grid's 取消资质审核 button names this proc, with the reviewer comment travelling via `changeValue.textareaValue`. Install script: `script/标版/30100101/Sp_Supply_refilecheck.sql`. Caveat: the dynamic `SET` includes `,iLevel = 0` after the prefix already contains `Set ` — relies on `p_setSql` not being empty after the join; the stray `SELECT @sSqlStmt` (debug echo) is left in the body and will surface in the response — clean before relying on output shape. diff --git a/en/docs/auto-catalog/procedures/Sp_Supply_setLevel.md b/en/docs/auto-catalog/procedures/Sp_Supply_setLevel.md index 4e04cff..df2565c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Supply_setLevel.md +++ b/en/docs/auto-catalog/procedures/Sp_Supply_setLevel.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础资料 → 供应商与外协加工商 → 供应商评估 — 评级 (set rating) toolbar action. Final step of the supplier-evaluation flow after [`Sp_Supply_submit`](Sp_Supply_submit.md) and [`Sp_Supply_filecheck`](Sp_Supply_filecheck.md): records the assigned rating against the supplier row. + +**What it does:** Parses `$.params[*].value[*].sSlaveId` and `$.changeValue` (the rating-form field set). For each `valueKey` column listed in `changeValue[0].valueKey` (comma-separated), splices a `=` term into `p_setSql`. Always appends `sLevelMemo=`. Then builds and executes `UPDATE elesupply SET WHERE sId=p_sId AND sBrandsId=… AND sSubsidiaryId=…`. Returns the localised `paramsErro` via `Sp_Sis_GetConst` when `sProInParam` is empty. Reverse pair with [`Sp_Supply_reLevel`](Sp_Supply_reLevel.md). + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — 供应商评估 grid's 评级 button names this proc, with the rating-dialog fields flowing through `changeValue`. Install script: `script/标版/30100101/Sp_Supply_setLevel.sql`. Caveat: the body leaves `SELECT @sSqlStmt` in place (debug echo) which can leak the assembled SQL into the response. diff --git a/en/docs/auto-catalog/procedures/Sp_Supply_submit.md b/en/docs/auto-catalog/procedures/Sp_Supply_submit.md index de8279e..0bb0111 100644 --- a/en/docs/auto-catalog/procedures/Sp_Supply_submit.md +++ b/en/docs/auto-catalog/procedures/Sp_Supply_submit.md @@ -1,7 +1,7 @@ # `Sp_Supply_submit` (procedure) -> @author:zhucx - @date: 2022/12/02 +> @author:zhucx + @date: 2022/12/02 @describe: 供应商评估-提交评估 @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 基础资料 → 供应商与外协加工商 → 供应商评估 — 提交评估 toolbar action. Submits supplier-evaluation slave rows (`elesupply.iLevel` workflow) into the awaiting-review state so the qualification reviewer can pick them up via 资质审核. + +**What it does:** Parses `$.params[*].value[*].sSlaveId` from `sProInParam`. For each `p_sId` runs `UPDATE elesupply SET tSubmit=SYSDATE(), sSubmit=sMakePerson, iLevel=1 WHERE sId=p_sId AND sBrandsId/sSubsidiaryId`. Errors out with the localised `paramsErro` constant (via `Sp_Sis_GetConst`) when `sProInParam` is empty. Despite operating on the `sId` parameter as `sSlaveId`, target table is `elesupply` directly — the slave-id key reflects how the evaluation grid embeds supplier rows. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — 供应商评估 grid's 提交评估 button names `Sp_Supply_submit` as the action. Forward pair with [`Sp_Supply_filecheck`](Sp_Supply_filecheck.md) (资质审核 next step) and [`Sp_Supply_setLevel`](Sp_Supply_setLevel.md) (final evaluation rating). Install script: `script/标版/30100101/Sp_Supply_submit.sql`. Author tag: `@author:zhucx @date: 2022/12/02`. diff --git a/en/docs/auto-catalog/procedures/Sp_Sys_GetMenu.md b/en/docs/auto-catalog/procedures/Sp_Sys_GetMenu.md index 0a65543..3e8daa9 100644 --- a/en/docs/auto-catalog/procedures/Sp_Sys_GetMenu.md +++ b/en/docs/auto-catalog/procedures/Sp_Sys_GetMenu.md @@ -1,6 +1,6 @@ # `Sp_Sys_GetMenu` (procedure) -> 根据模块sId删除模块(包含子模块) +> 根据模块sId删除模块(包含子模块) 需要执行:SET GLOBAL group_concat_max_len = 40960 @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 系统平台 → 菜单 — returns the menu tree (one branch at a time) for the BACK side-bar of the logged-in user, scoped to the current brand/subsidiary. The proc itself doesn't apply role-authorisation; that's layered by the calling Java service. + +**What it does:** When `s_pSid` is empty, selects all root-level `gdsmodule` rows (`sParentId=''`) for the current `sBrandsId`/`sSubsidiaryId`, excluding `sDisplayType='System'` and the reserved sId `'100'`, ordered by `iOrder`. When `s_pSid` is given, selects descendants by `LOCATE(CONCAT('-', s_pSid), m.sAllId) > 0`. The `sMenuName` output column picks `sChinese`/`sEnglish`/`sBig5` based on `s_sLanguage`. Despite the auto-catalog header comment ("根据模块sId删除模块"), the body is a read-only SELECT — only the comment is misleading. + +**Invocation:** Called by MyBatis `GdsmoduleMapper.getBuMenu` (`{call Sp_Sys_GetMenu(...)}`), wired into Java `MenuServiceImpl.getBuMenu(param)` — `@Cacheable(value="getBuMenu")` per `(sUserId, sBrandsId, sSubsidiaryId)`. Also referenced by `CleanRedisServiceImpl`, `BusinessParameterImpl`, `MenuChildServiceImpl`, `BusinessBaseService` for cache invalidation of the same key. Install script: `script/标版/30100101/Sp_Sys_GetMenu.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_System_AccountSquareCheck.md b/en/docs/auto-catalog/procedures/Sp_System_AccountSquareCheck.md index 98a7bec..6b51e8e 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_AccountSquareCheck.md +++ b/en/docs/auto-catalog/procedures/Sp_System_AccountSquareCheck.md @@ -1,13 +1,13 @@ # `Sp_System_AccountSquareCheck` (procedure) -> @author:杨恒林 - @date:20210521 封存 - @describe: 检验期间内未审核单据: - iType = 0 库存单据: - 材料 iType2 = 0 或 1 生产领料,生产退料,采购入库,采购退货,材料调拨,材料报废,来料入库,材料盘点,材料库存调整, - 存货调整金额,其他入库 - 产品 iType2 = 0 或 2 成品入库,成品报废,送货单,退货单,成品调拨,发外入库,成品盘点 - iType = 1 应收单据: 根据应收类型,找到相应单据销售发票 1 送货单 2印刷工单 3销售订单 4销售合同 5销售对账 +> @author:杨恒林 + @date:20210521 封存 + @describe: 检验期间内未审核单据: + iType = 0 库存单据: + 材料 iType2 = 0 或 1 生产领料,生产退料,采购入库,采购退货,材料调拨,材料报废,来料入库,材料盘点,材料库存调整, + 存货调整金额,其他入库 + 产品 iType2 = 0 或 2 成品入库,成品报废,送货单,退货单,成品调拨,发外入库,成品盘点 + iType = 1 应收单据: 根据应收类型,找到相应单据销售发票 1 送货单 2印刷工单 3销售订单 4销售合同 5销售对账 iType = 2 应付单据: 根据应付类弄,找到相应单据 0 采购订单 1 采购入库 2采购对账 @@ -36,4 +36,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 / 财务月结 — pre-close validator that scans the closing period for un-audited 业务单据 across stock / AR / AP. Header comment marks it `封存` (sealed/frozen, 2021-05-21 杨恒林) — superseded by `Sp_System_AccountSquareCheck_New`/`Sp_System_AccountSquareCheck_material`. Branches on `iType`: `0` 库存单据 (with `iType2=0/1` materials side: 生产领料/生产退料/采购入库/采购退货/材料调拨/材料报废/来料入库/材料盘点/材料库存调整/存货调整金额/其他入库; `iType2=0/2` products: 成品入库/成品报废/送货单/退货单/成品调拨/发外入库/成品盘点); `1` 应收 (1 送货单, 2 印刷工单, 3 销售订单, 4 销售合同, 5 销售对账); `2` 应付 (0 采购订单, 1 采购入库, 2 采购对账). + +**What it does:** For each branch the body assembles a list of `sBillNo` rows with `bCheck=0` (or equivalent un-audited flag) inside `[tStartDate, tEndDate]`, optionally filtered by `sWareHouseGuid`. Hits set `sCode=-1` and `sReturn` to the localised "存在未审核单据" message via `Fun_Sis_GetConst`/`Sp_Sis_GetConst` plus the offending BillNo list. The pre-close caller is expected to abort if `sCode=-1`. + +**Invocation:** Called by `Sp_Cost_CheckBusinessData` from the 财务结账 flow — the latter resolves the active period from `sysaccountperiod`, then `CALL Sp_System_AccountSquareCheck(0, p_tStart, p_tEnd, 0, '', '1111111111', '1111111111', 'admin', sCode, sReturn)` on the stock branch. Also referenced by `Sp_financialClosing_BtnEventCalcMaterialPrice_New`. Install script: `script/标版/30100101/cost/Sp_System_AccountSquareCheck.sql`. Verify the deployed body is the sealed one or its `_New` successor before changes. diff --git a/en/docs/auto-catalog/procedures/Sp_System_AccountSquareCheck_New.md b/en/docs/auto-catalog/procedures/Sp_System_AccountSquareCheck_New.md index 0b34e82..742f49a 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_AccountSquareCheck_New.md +++ b/en/docs/auto-catalog/procedures/Sp_System_AccountSquareCheck_New.md @@ -1,13 +1,13 @@ # `Sp_System_AccountSquareCheck_New` (procedure) -> @author:杨恒林 - @date:20210521 封存 - @describe: 检验期间内未审核单据: - iType = 0 库存单据: - 材料 iType2 = 0 或 1 生产领料,生产退料,采购入库,采购退货,材料调拨,材料报废,来料入库,材料盘点,材料库存调整, - 存货调整金额,其他入库 - 产品 iType2 = 0 或 2 成品入库,成品报废,送货单,退货单,成品调拨,发外入库,成品盘点 - iType = 1 应收单据: 根据应收类型,找到相应单据销售发票 1 送货单 2印刷工单 3销售订单 4销售合同 5销售对账 +> @author:杨恒林 + @date:20210521 封存 + @describe: 检验期间内未审核单据: + iType = 0 库存单据: + 材料 iType2 = 0 或 1 生产领料,生产退料,采购入库,采购退货,材料调拨,材料报废,来料入库,材料盘点,材料库存调整, + 存货调整金额,其他入库 + 产品 iType2 = 0 或 2 成品入库,成品报废,送货单,退货单,成品调拨,发外入库,成品盘点 + iType = 1 应收单据: 根据应收类型,找到相应单据销售发票 1 送货单 2印刷工单 3销售订单 4销售合同 5销售对账 iType = 2 应付单据: 根据应付类弄,找到相应单据 0 采购订单 1 采购入库 2采购对账 @@ -36,4 +36,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 / 财务月结 — successor copy of `Sp_System_AccountSquareCheck` (same `iType`/`iType2` matrix for 库存单据 / 应收单据 / 应付单据). Same author/date comment (杨恒林 2021-05-21 封存) — both flavours coexist; the `_New` body is the one referenced by the modernised close path. + +**What it does:** Same shape as the base proc — for the requested `iType`/`iType2` slice it scans the matching 业务表 inside `[tStartDate, tEndDate]` for `bCheck=0` rows, collects their `sBillNo` list, and if any are found returns `sCode=-1` with the localised "存在未审核单据" message plus the BillNo list, letting the caller block the close. See `Sp_System_AccountSquareCheck` for the field-level matrix. + +**Invocation:** Status: appears orphaned at this snapshot. No `gdsmodule` hook, no `gdsconfigformmaster` binding, no other-routine caller (information_schema query at audit returned empty), no xly-src reference outside the install script `script/标版/30100101/cost/Sp_System_AccountSquareCheck_New.sql`. Kept as a `_New` variant alongside `Sp_System_AccountSquareCheck` and `Sp_System_AccountSquareCheck_material`; verify which body the close flow actually invokes before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_System_AccountSquareCheck_material.md b/en/docs/auto-catalog/procedures/Sp_System_AccountSquareCheck_material.md index 8a24299..c09b288 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_AccountSquareCheck_material.md +++ b/en/docs/auto-catalog/procedures/Sp_System_AccountSquareCheck_material.md @@ -1,13 +1,13 @@ # `Sp_System_AccountSquareCheck_material` (procedure) -> @author:杨恒林 - @date:20210521 封存 - @describe: 检验期间内未审核单据: - iType = 0 库存单据: - 材料 iType2 = 0 或 1 生产领料,生产退料,采购入库,采购退货,材料调拨,材料报废,来料入库,材料盘点,材料库存调整, - 存货调整金额,其他入库 - 产品 iType2 = 0 或 2 成品入库,成品报废,送货单,退货单,成品调拨,发外入库,成品盘点 - iType = 1 应收单据: 根据应收类型,找到相应单据销售发票 1 送货单 2印刷工单 3销售订单 4销售合同 5销售对账 +> @author:杨恒林 + @date:20210521 封存 + @describe: 检验期间内未审核单据: + iType = 0 库存单据: + 材料 iType2 = 0 或 1 生产领料,生产退料,采购入库,采购退货,材料调拨,材料报废,来料入库,材料盘点,材料库存调整, + 存货调整金额,其他入库 + 产品 iType2 = 0 或 2 成品入库,成品报废,送货单,退货单,成品调拨,发外入库,成品盘点 + iType = 1 应收单据: 根据应收类型,找到相应单据销售发票 1 送货单 2印刷工单 3销售订单 4销售合同 5销售对账 iType = 2 应付单据: 根据应付类弄,找到相应单据 0 采购订单 1 采购入库 2采购对账 @@ -36,4 +36,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 / 财务月结 — materials-only variant of `Sp_System_AccountSquareCheck`. Triggered before materials-side close so that the 材料价格核算 stage refuses to run while any of the in-period materials documents (生产领料/生产退料/采购入库/采购退货/材料调拨/材料报废/来料入库/材料盘点/材料库存调整/存货调整金额/其他入库) still sits at `bCheck=0`. Same author/date marker (杨恒林 2021-05-21 封存). + +**What it does:** Despite the shared `iType`/`iType2` parameter shell, this body only walks the materials documents — for each materials business table it `SELECT sBillNo` rows with `bCheck=0` and `[tStartDate, tEndDate]`, scoped by `sBrandsId`/`sSubsidiaryId` and (where applicable) `sWareHouseGuid`. Any hit sets `sCode=-1` and concatenates the offending BillNos plus a localised "存在未审核单据" message into `sReturn`. + +**Invocation:** Called by `Sp_financialClosing_BtnEventCalcMaterialPrice_New` at the start of the 计算材料价格 button-event — that proc is dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from the 财务月结 → 计算材料价格 button. If the check fails, the price calc aborts. Install/companion scripts: `script/标版/30100101/cost/Sp_financialClosing_BtnEventCalcMaterialPrice_New.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_System_AutoMaterialsPriceSingle.md b/en/docs/auto-catalog/procedures/Sp_System_AutoMaterialsPriceSingle.md index 6da6e6e..6de8bf7 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_AutoMaterialsPriceSingle.md +++ b/en/docs/auto-catalog/procedures/Sp_System_AutoMaterialsPriceSingle.md @@ -34,4 +34,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 库存管理 / 成本核算 → 材料价格自动结转 — single-material variant of the materials weighted-average price calculator. On audit of a stock movement (生产领料/生产退料/采购入库/采购退货/材料调拨/材料报废/来料入库/材料盘点/材料库存调整/其他入库/分切单/送货单) the calling 审核 proc passes one material + warehouse + period; this proc recomputes that material's running weighted-average price from `viw_mitmaterialscheck`/`elematerials`, then propagates it back into the source document and the materials-stock check tables. + +**What it does:** Resolves the material name via `viw_mitmaterialscheck` joined to `elematerials`. Reads system settings for `sPriceDecimal`/`sMoneyDecimal` and the chosen cost-mode (`p_iMaterialsCostMode`). For the requested `sMaterialsGuid`/`sMaterialsStyle`/`sDefineNo`/`sDefineNo2`/warehouse/location/period it sums入库金额+期初金额 and divides by qty (全月加权 / 移动加权 depending on cost-mode), then writes the resulting `dMaterialsPrice` back to the originating slave row identified by `sGuid` and refreshes downstream stock balances. `bUpdate`/`bFlag`/`bUpdateAll` flags select between first-pass distribution (分切单 master→slave) and the standard second-pass distribution. + +**Invocation:** Called by every materials-side `Sp_Calc_s*` audit proc that needs to refresh the unit price after a stock movement — confirmed callers in DB: `Sp_Calc_sCut`, `Sp_Calc_sDgd`(+`_1226`/`_20250612`), `Sp_Calc_sDgdCL`, `Sp_Calc_sDYDgd`, `Sp_Calc_sMad`, `Sp_Calc_sMma`, `Sp_Calc_sMmm`(+`_copy1`), `Sp_Calc_sPmd_old`, `Sp_Calc_sPrj`, `Sp_Calc_sRgd`(+`1`/`_new`), `SP_Inventory_Materials_Inout_new`, `Sp_System_BatchPriceMoney`, plus the `_new` body. Reached transitively via `BusinessBaseServiceImpl.getPrcName` on those forms' 审核 button. Install: `script/标版/30100101/Sp_System_AutoMaterialsPriceSingle.sql`; archived copies under `script/标版/材料库存/` (`_Ret`, `_RetAll`) and `script/标版/30100101/Sp_System_AutoMaterialsPriceSingle_Old.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_System_AutoMaterialsPriceSingle_Old.md b/en/docs/auto-catalog/procedures/Sp_System_AutoMaterialsPriceSingle_Old.md index 88ee4bc..7a9906e 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_AutoMaterialsPriceSingle_Old.md +++ b/en/docs/auto-catalog/procedures/Sp_System_AutoMaterialsPriceSingle_Old.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_System_AutoMaterialsPriceSingle` (`_Old` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_System_AutoMaterialsPriceSingle` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_System_AutoMaterialsPriceSingle_new.md b/en/docs/auto-catalog/procedures/Sp_System_AutoMaterialsPriceSingle_new.md index c2864dc..91a3607 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_AutoMaterialsPriceSingle_new.md +++ b/en/docs/auto-catalog/procedures/Sp_System_AutoMaterialsPriceSingle_new.md @@ -33,4 +33,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 库存管理 / 成本核算 → 材料价格自动结转 — `_new` revision of `Sp_System_AutoMaterialsPriceSingle` (one fewer parameter: `sLoginId` dropped). Same business intent — recompute one material's weighted-average price after a stock movement and back-write it to the originating slave row and stock check. + +**What it does:** Mirrors the base proc body — derives the unit price from `viw_mitmaterialscheck`/`elematerials` for the requested material/period/warehouse, applies the system cost-mode and decimal settings, writes back the new `dMaterialsPrice` and refreshes stock balances. The `_new` revision adjusts signature handling but keeps the same algorithm. + +**Invocation:** Status: appears orphaned. The DB-side caller scan finds it only referenced from `Sp_System_AutoMaterialsPriceSingle` itself (the base proc's body mentions `_new` in branching/upgrade logic). No `gdsmodule` hook, no form-master binding, no xly-src file references this `_new` name. Likely a staged replacement that was committed but not switched on at the audit-proc level — verify whether any deployed `Sp_Calc_s*` body has been migrated to invoke this variant before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_System_AutoProductPriceSingle.md b/en/docs/auto-catalog/procedures/Sp_System_AutoProductPriceSingle.md index 5b70e7c..96aa727 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_AutoProductPriceSingle.md +++ b/en/docs/auto-catalog/procedures/Sp_System_AutoProductPriceSingle.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 库存管理 / 成本核算 → 成品价格自动结转 — product-side counterpart of `Sp_System_AutoMaterialsPriceSingle`. Period-scoped (no per-document `sGuid`) pass that resolves each in-period product's effective price from the latest sales / customer-price / product-master / reconciliation source, populates a temp `Sp_EleProductStockSum`/`Sp_EleProductStock` snapshot, and back-writes the unit price to the period's成品 stock-check rows. + +**What it does:** Initialises temp tables `Sp_EleProductStockSum` (per-product roll-up across the period) and `Sp_EleProductStock` (per-warehouse/location detail). For each product touched between `tStartDate`/`tEndDate`, looks up `dProductPrice` in priority order — most recent sales-order in the period, then `eleproductcustomer`/`eleproduct` defaults, then nearest 销售对账. Settings `NetPrice`/`NetMoney` from `SysSystemSettings` set decimals. `iType` switches between in-period stock-view computation and downstream propagation; results refresh the成品 stock-check tables for the period. Mirrors the dual-mode in the base materials proc (`bUpdate=1` 月末结帐, `bUpdate=0` UI preview). + +**Invocation:** Status: appears orphaned at this snapshot. No `gdsmodule.sProcName` hook, no form-master binding, no other-routine caller, no MyBatis XML reference. Install copies live at `script/标版/30100101/Sp_System_AutoProductPriceSingle.sql` and `script/客户/千彩/Sp_System_AutoProductPriceSingle.sql` (customer override). Verify whether a 成品价值 button or batch job currently invokes it before relying on it; the wiring may be customer-specific. diff --git a/en/docs/auto-catalog/procedures/Sp_System_AutoSendCheckMsg.md b/en/docs/auto-catalog/procedures/Sp_System_AutoSendCheckMsg.md index da46916..604b03c 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_AutoSendCheckMsg.md +++ b/en/docs/auto-catalog/procedures/Sp_System_AutoSendCheckMsg.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 系统平台 → 审核流程 / 消息中心 — when a 业务单据 enters an approval workflow (`elecheckmodel` + `elecheckmodelphase`), this proc materialises the in-app inbox: it writes a `sysMsg` envelope, one `sysmsguser` row per approver, and a placeholder `sysbillcheckresult` for each phase, so approvers see the bill in their pending list and the audit trail rows are pre-staged. + +**What it does:** Validates `sFormGuid` / `sGuid` / `sTbName` / current login (`Fun_GetLoginUser`) — bails with `sCode=-1` if any are empty. Builds dynamic SQL `Select tCreateDate, sBillNo From Where sId=` to read the bill date / number. Deletes any prior `sysbillcheckresult` / `sysmsguser` / `sysMsg` rows for the same `sBillId` (idempotency). Resolves the localised "审核申请" title via `Sp_Sis_GetConst('BillCheckApply', …)` with `sBillNo` interpolated, then `INSERT INTO sysMsg` the envelope. If `sCheckPerson` is empty, joins `sischeckphase` ⇨ `sischeckphaselogininfo` for the first phase of the active model (`elecheckmodel.bActivate=1`, ordered by `iOrder LIMIT 1`) to seed approvers; otherwise tokenises the comma-list and writes one row per name. For each approver, writes the matching `sysbillcheckresult` placeholder so the審核 detail screen has its skeleton. + +**Invocation:** Status: appears orphaned at this snapshot. No `gdsmodule.sProcName` hook, no other-routine caller in `information_schema.ROUTINES`, no xly-src reference outside the install script `script/标版/30100101/Sp_System_AutoSendCheckMsg.sql`. The signature (sFormGuid + sBillKey + sTbName + sCheckModelGuid + sCheckPerson) is the standard "kick off a multi-phase check" envelope, so the live close-loop is almost certainly Java-driven (`CheckExamineFlowDataServiceImpl` family) bypassing this proc — flag for maintainer audit to confirm whether any deployed flow still routes through it. diff --git a/en/docs/auto-catalog/procedures/Sp_System_BatchNPriceMoney.md b/en/docs/auto-catalog/procedures/Sp_System_BatchNPriceMoney.md index b8055cd..f76f3c5 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_BatchNPriceMoney.md +++ b/en/docs/auto-catalog/procedures/Sp_System_BatchNPriceMoney.md @@ -1,7 +1,7 @@ # `Sp_System_BatchNPriceMoney` (procedure) -> @author: qmj - @date: 20210707 封存 +> @author: qmj + @date: 20210707 封存 @describe: 价格批量更新,按产品金额,目前仅订单可使用 @@ -33,4 +33,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售订单 / 改价 — batch price update by 产品金额 for a sales-order line. Header comment marks it `封存` (qmj, 2021-07-07) — "目前仅订单可使用". When the user re-prices a 销售订单从表 row, this proc recomputes the line money/tax/foreign-currency fields from the new price and propagates the change to any linked 印刷工单 (`MftWorkOrderSlave`) and 送货通知/送货单 not yet confirmed, so downstream documents stay in sync with the new agreed price. + +**What it does:** Reads `NetMoney`/`NetPrice` decimal settings and the `CbxDeliverGoods`/`CbxDeliverGoodsNotify` system flags from `SysSystemSettings`. Resolves the parent `SalSalesOrderMaster` for the slave id `sSrcGuid` and the order's `tCreateDate`. Checks `sysaccountperiod` — if the order's period is `bFrozen=1`, aborts with `sNoCanCheckByAccountPeriod`. Otherwise updates `SalSalesOrderSlave` with the new `dProductPrice`/`dProductMoney`/`dForeignPrice`/`dForeignMoney`/`dTax*`, joining `sistax` for the tax rate; replicates the change to `MftWorkOrderSlave` (when the slave is order-driven) and any in-flight 送货通知/送货单 rows controlled by the system settings. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from the 销售订单 改价 button. Java `BusinessBaseServiceImpl.updatePriceBatch` recognises the name (`equalsIgnoreCase("Sp_System_BatchNPriceMoney")`) and, after a successful run, pushes the updated `dProductMoney` to RocketMQ via `rocketMQService.pushERPOrderAmount(dict)` so a 印工厂B2B partner / cloud order (`sWebOrderId`) sees the new amount. Also called by `Sp_Calc_sQtt_hm` (报价单 audit) and the variant `Sp_System_BatchNPriceMoney_quo`. Companion: `Sp_System_BatchPriceMoney` (external-currency variant). Install: `script/标版/30100101/Sp_System_BatchNPriceMoney.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_System_BatchNPriceMoney_quo.md b/en/docs/auto-catalog/procedures/Sp_System_BatchNPriceMoney_quo.md index ac543d8..2560679 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_BatchNPriceMoney_quo.md +++ b/en/docs/auto-catalog/procedures/Sp_System_BatchNPriceMoney_quo.md @@ -1,7 +1,7 @@ # `Sp_System_BatchNPriceMoney_quo` (procedure) -> @author: qmj - @date: 20210707 封存 +> @author: qmj + @date: 20210707 封存 @describe: 价格批量更新,按产品金额,目前仅订单可使用 @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 报价单 / 改价 (报价(quo)variant) — quotation-side trimmed copy of `Sp_System_BatchNPriceMoney`. Same intent (按产品金额 batch re-pricing) but the signature is reduced to `(sSrcGuid, p_dPrice, sLoginId, sBrId, sSuId, OUT sCode, OUT sReturn)` — only price comes from the caller, money/qty/dates are derived. Header `封存` (qmj, 2021-07-07). + +**What it does:** Reads `NetMoney`/`NetPrice` decimal settings and `CbxDeliverGoods`/`CbxDeliverGoodsNotify` flags from `SysSystemSettings`. Resolves the parent `SalSalesOrderMaster` for slave id `sSrcGuid` and checks the order's `sysaccountperiod` — aborts with `sNoCanCheckByAccountPeriod` when frozen. Updates `MftWorkOrderSlave` (joined with `sistax`) with the new `dNProductPrice`-driven money/tax fields. The proc-comment leftover ("目前仅订单可使用") and the `_quo` suffix reflect that this body was peeled out of the order variant for the 报价单 audit path. + +**Invocation:** Called by `Sp_Calc_sQtt_hm` — the audit (`Sp_Calc_s*`) handler for 报价单, dispatched by `BusinessBaseServiceImpl.getPrcName(sFormGuid, …)` on report audit. No xly-src file references this name directly — DB-only wiring. No standalone install script ships in `script/标版/30100101/` for this `_quo` variant; deploy from `Sp_System_BatchNPriceMoney.sql` family if missing. diff --git a/en/docs/auto-catalog/procedures/Sp_System_BatchPriceMoney.md b/en/docs/auto-catalog/procedures/Sp_System_BatchPriceMoney.md index 0c906ed..89894b7 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_BatchPriceMoney.md +++ b/en/docs/auto-catalog/procedures/Sp_System_BatchPriceMoney.md @@ -1,7 +1,7 @@ # `Sp_System_BatchPriceMoney` (procedure) -> @author: qmj - @date: 20210707 封存 +> @author: qmj + @date: 20210707 封存 @describe: 价格批量更新,按外币计算,目前仅使用销售订单 @@ -33,4 +33,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售管理 → 销售订单 / 改价(外币) — foreign-currency batch price-update twin of `Sp_System_BatchNPriceMoney`. Same trigger (改价 button on a sales-order slave) and same propagation (订单→工单→送货通知/送货单), but the price input `dPrice` is interpreted as 外币价 (`dForeignPrice`) and the proc back-computes local-currency `dProductPrice` / `dProductMoney` from `dCurrencyRate`. Header `封存` (qmj, 2021-07-07): "价格批量更新,按外币计算,目前仅使用销售订单". + +**What it does:** Reads `NetMoney`/`NetPrice` decimals and `CbxDeliverGoods`/`CbxDeliverGoodsNotify` flags from `SysSystemSettings`. Resolves the parent `SalSalesOrderMaster` for slave id `sSrcGuid`, looks up its `dCurrencyRate` and the order's `tCreateDate`, and gates on `sysaccountperiod.bFrozen` — aborts with `sNoCanCheckByAccountPeriod` when frozen. Calls `Sp_System_AutoMaterialsPriceSingle` for any materials touched by the change (refreshing weighted-average prices). Updates `SalSalesOrderSlave` with new `dForeignPrice` / derived `dProductPrice` / `dProductMoney` / tax fields, then cascades the same money set to `MftWorkOrderSlave` (joined with `sistax`) and pending 送货通知/送货单 rows. `sChangePriceMemo` is stored on the slave for the audit trail. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from the 销售订单 改价(外币) button. Java `BusinessBaseServiceImpl.updatePriceBatch` matches the name and, after successful run, pushes the new `dProductMoney` to RocketMQ (`rocketMQService.pushERPOrderAmount`) keyed by `sWebOrderId` so any cloud-order partner sees the new amount. Install: `script/标版/30100101/Sp_System_BatchPriceMoney.sql`, customer override `script/客户/千彩/Sp_System_BatchPriceMoney.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_System_BatchWorkListPriceMoney.md b/en/docs/auto-catalog/procedures/Sp_System_BatchWorkListPriceMoney.md index b9c03a2..212a620 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_BatchWorkListPriceMoney.md +++ b/en/docs/auto-catalog/procedures/Sp_System_BatchWorkListPriceMoney.md @@ -1,7 +1,7 @@ # `Sp_System_BatchWorkListPriceMoney` (procedure) -> @author: qmj - @date: 20210707 封存 +> @author: qmj + @date: 20210707 封存 @describe: 工单价格批量更新,按产品金额 @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 印刷工单 / 改价 — work-order side of the batch re-price family. Re-prices a comma-separated list of `MftWorkOrderSlave` rows by either an absolute new `dNProductPrice` or a `dFloatRate` percentage adjustment, then refreshes the line tax/total from `sistax`. Header `封存` (qmj, 2021-07-07): "工单价格批量更新,按产品金额". + +**What it does:** Reads `NetMoney` / `NetPrice` decimal settings from `SysSystemSettings`. Strips `[`/`]` from `sSrcGuid`, then walks the comma-separated slave-id list with a `WHILE p_index <= p_count` loop. For each id: if `dNProductPrice<>0` sets `A.dNProductPrice = Round(p_dNProductPrice, p_dNetPrice)`; else if `dFloatRate<>0` applies `A.dNProductPrice = Round(A.dNProductPrice * (1 + dFloatRate/100), p_dNetPrice)`. Re-derives the slave's `sParentId` and currency/tax (`dCurrencyRate`, `sistax.dRate`) for the corresponding `MftWorkOrderMaster` totals refresh. + +**Invocation:** Status: appears orphaned at this snapshot. No `gdsmodule.sProcName` hook, no `gdsconfigformmaster` binding, no other-routine caller in `information_schema.ROUTINES`, no Java/MyBatis reference in xly-src. Install / customer copies live under `script/标版/30100101/Sp_System_BatchWorkListPriceMoney.sql` and `script/客户/千彩/Sp_System_BatchWorkListPriceMoney.sql`. The 工单 改价 button likely calls a successor proc (Java `updatePriceBatch` recognises only the order-side names) — verify before relying on this body. diff --git a/en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost.md b/en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost.md index 533d702..bc8ea79 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost.md +++ b/en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost.md @@ -1,9 +1,9 @@ # `Sp_System_CalcCurrentPeriodCost` (procedure) -> @author:杨恒林 - @date:20210523 封存 - @describe: 从成本月结表中,拿到工单数据,计算本月成本数据后回写到成本月结表 注意点: - 1.本期期初成本从本工单最近一次月结成本表中获取,不一定就是上期 +> @author:杨恒林 + @date:20210523 封存 + @describe: 从成本月结表中,拿到工单数据,计算本月成本数据后回写到成本月结表 注意点: + 1.本期期初成本从本工单最近一次月结成本表中获取,不一定就是上期 2.在制品是指所有入库数小于工单数的工单 @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 → 订单成本分析 / 工单本期成本 — period-cost kernel: for every工单 (`accordercostanalysis` row) inside the requested closing period, recomputes 本期入库金额/数量/直接材料/人工/制造费用 and back-writes them onto the cost month-end table. Header (杨恒林 2021-05-23 封存) flags two subtleties: (1) 期初成本 comes from the work order's *most recent* prior month-end row, not necessarily the immediately preceding period; (2) 在制品 = orders whose cumulative入库数 still falls short of the order qty. + +**What it does:** Loads the targeted accounting period (resolved from `sPeriod`/`tStartDate`/`tEndDate` against `sysaccountperiod`). For each `accordercostanalysis` row in scope, sums the period's 入库金额 from product inflow ledgers, 直接材料 from materials-issue history, 直接人工 from `accexpenseentryworkcenterslave`, 制造费用 / 部门费用 from `accdepart`/`accexpenseentrydepartmentmaster`, applies the carry-over 期初 amount looked up from the most recent prior month-end row of the same工单, and writes the resulting `dInMoney`/`dInQty`/`dEndMoney`/`dEndQty`/`d_*Cost` columns back. `sProInParam` lets the caller scope to a subset of orders; `sMakePerson` is recorded as the operator. + +**Invocation:** Called by `Sp_CalcCost_BtnEventReCalcCost` (the 重新计算本期成本 button) and by `Sp_Cost_OrderCostAnalysis` (the 订单成本分析 entry point). Both upstream callers are dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from the 财务月结 / 成本核算 button toolbars. Install copies: `script/标版/30100101/cost/Sp_System_CalcCurrentPeriodCost.sql`, `Sp_CalcCost_BtnEventReCalcCost.sql`, `Sp_Cost_OrderCostAnalysis.sql`. Dated backup `Sp_System_CalcCurrentPeriodCost_1115` retains an older revision of the same proc. diff --git a/en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost_1115.md b/en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost_1115.md index de6c3e2..109c8f3 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost_1115.md +++ b/en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost_1115.md @@ -1,9 +1,9 @@ # `Sp_System_CalcCurrentPeriodCost_1115` (procedure) -> @author:杨恒林 - @date:20210523 封存 - @describe: 从成本月结表中,拿到工单数据,计算本月成本数据后回写到成本月结表 注意点: - 1.本期期初成本从本工单最近一次月结成本表中获取,不一定就是上期 +> @author:杨恒林 + @date:20210523 封存 + @describe: 从成本月结表中,拿到工单数据,计算本月成本数据后回写到成本月结表 注意点: + 1.本期期初成本从本工单最近一次月结成本表中获取,不一定就是上期 2.在制品是指所有入库数小于工单数的工单 @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 → 订单成本分析 / 工单本期成本 — dated backup revision (`_1115`) of `Sp_System_CalcCurrentPeriodCost`. Same author/header — preserved alongside the live body so a rollback or comparison is possible if the recomputation produces unexpected period numbers. + +**What it does:** Same algorithm as `Sp_System_CalcCurrentPeriodCost` at the time of the `1115` snapshot — walks `accordercostanalysis` rows in the requested period, sums 入库 / 材料 / 人工 / 制造费用 from the respective ledgers, applies the work order's most recent prior 期初 amount, and writes `dInMoney`/`dEndMoney`/`d_*Cost` back to the month-end row. Per the playbook backup-variant convention, treat divergence from the live body as a regression candidate rather than an intentional behavioural difference. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` hook, no `gdsconfigformmaster` binding, no other-routine caller in `information_schema.ROUTINES`, no xly-src reference outside the procedure itself. Kept purely as a backup snapshot of the production proc — not expected to be called from any live flow. Verify before redeploying. diff --git a/en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost_20221014.md b/en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost_20221014.md index 2341138..52f3df4 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost_20221014.md +++ b/en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost_20221014.md @@ -1,9 +1,9 @@ # `Sp_System_CalcCurrentPeriodCost_20221014` (procedure) -> @author:杨恒林 - @date:20210523 封存 - @describe: 从成本月结表中,拿到工单数据,计算本月成本数据后回写到成本月结表 注意点: - 1.本期期初成本从本工单最近一次月结成本表中获取,不一定就是上期 +> @author:杨恒林 + @date:20210523 封存 + @describe: 从成本月结表中,拿到工单数据,计算本月成本数据后回写到成本月结表 注意点: + 1.本期期初成本从本工单最近一次月结成本表中获取,不一定就是上期 2.在制品是指所有入库数小于工单数的工单 @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_System_CalcCurrentPeriodCost` (`_20221014` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_System_CalcCurrentPeriodCost` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost_20221109.md b/en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost_20221109.md index f243e61..1725d93 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost_20221109.md +++ b/en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost_20221109.md @@ -1,9 +1,9 @@ # `Sp_System_CalcCurrentPeriodCost_20221109` (procedure) -> @author:杨恒林 - @date:20210523 封存 - @describe: 从成本月结表中,拿到工单数据,计算本月成本数据后回写到成本月结表 注意点: - 1.本期期初成本从本工单最近一次月结成本表中获取,不一定就是上期 +> @author:杨恒林 + @date:20210523 封存 + @describe: 从成本月结表中,拿到工单数据,计算本月成本数据后回写到成本月结表 注意点: + 1.本期期初成本从本工单最近一次月结成本表中获取,不一定就是上期 2.在制品是指所有入库数小于工单数的工单 @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_System_CalcCurrentPeriodCost` (`_20221109` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_System_CalcCurrentPeriodCost` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost_copy1.md b/en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost_copy1.md index 979f041..cbfb693 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_System_CalcCurrentPeriodCost_copy1.md @@ -1,9 +1,9 @@ # `Sp_System_CalcCurrentPeriodCost_copy1` (procedure) -> @author:杨恒林 - @date:20210523 封存 - @describe: 从成本月结表中,拿到工单数据,计算本月成本数据后回写到成本月结表 注意点: - 1.本期期初成本从本工单最近一次月结成本表中获取,不一定就是上期 +> @author:杨恒林 + @date:20210523 封存 + @describe: 从成本月结表中,拿到工单数据,计算本月成本数据后回写到成本月结表 注意点: + 1.本期期初成本从本工单最近一次月结成本表中获取,不一定就是上期 2.在制品是指所有入库数小于工单数的工单 @@ -31,4 +31,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_System_CalcCurrentPeriodCost` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_System_CalcCurrentPeriodCost` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_System_CalcMaterialsPrice.md b/en/docs/auto-catalog/procedures/Sp_System_CalcMaterialsPrice.md index 57ff6fb..ad718d5 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_CalcMaterialsPrice.md +++ b/en/docs/auto-catalog/procedures/Sp_System_CalcMaterialsPrice.md @@ -1,9 +1,9 @@ # `Sp_System_CalcMaterialsPrice` (procedure) -> @author:杨恒林 - @date:20210521 封存 - @describe:全月加权计算价格后 期初金额 + 采购入库金额+期它入库金额/ 期初数量 + 采购入库金额+期它入库金额 - 更新到其它各单据 +> @author:杨恒林 + @date:20210521 封存 + @describe:全月加权计算价格后 期初金额 + 采购入库金额+期它入库金额/ 期初数量 + 采购入库金额+期它入库金额 + 更新到其它各单据 bUpdate = 0:第一次分摊,分切单主表分摊到从表。 第二次正常分摊 @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 / 财务月结 → 计算材料价格 — period-level materials weighted-average pricer. For the closing period, computes 全月加权 unit price per material as `(期初金额 + 采购入库金额 + 其它入库金额) / (期初数量 + 采购入库数量 + 其它入库数量)`, then propagates that price back onto every materials movement in the period (生产领料、生产退料、材料调拨、材料报废、来料入库、其它入库、分切单, etc.). Header (杨恒林 2021-05-21 封存) notes `bUpdate=0` is the first pass — 分切单 master price split to slaves first; the second pass does the normal propagation. + +**What it does:** Walks every material with a `[tStartDate, tEndDate]` movement. Loads `期初金额`/`期初数量` from the prior month-end materials store (`accmaterialsstore`), sums本期 input money/qty from `mitpurchaseinmaster`/`mitothermaterialsinmaster`/`mitmaterialsinmaster` etc., divides for the weighted-average unit price (`dMaterialsPrice`). Writes that price back onto each in-period materials slave (and the `viw_mitmaterialscheck` underlying tables), refreshing `dMaterialsMoney = qty * price` with `SysSystemSettings` decimal rounding. `bUpdate=1` 月末结帐 path additionally stores the period roll-up to the closing table; `bUpdate=0` is the materials-stock-value preview path that only updates prices. + +**Invocation:** Called by `Sp_financialClosing_BtnEventCalcMaterialPrice` (the 计算材料价格 button on 财务月结), `Sp_CalcCost_BtnEventReCalcCost`, `Sp_CommonList_BtnEventCheck`, `Sp_Cost_CheckBusinessData`, and `Sp_financialClosing_BtnEventCalcYM_New` — each dispatched via `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from the corresponding 月结 toolbar buttons. Install: `script/标版/30100101/cost/Sp_System_CalcMaterialsPrice.sql` (+ `Sp_CalcCost_BtnEventReCalcCost.sql`, `Sp_financialClosing_BtnEventCalcMaterialPrice.sql`, `Sp_CommonList_BtnEventCheck.sql`). Dated backups `_220709`, `_221111` retain older revisions. diff --git a/en/docs/auto-catalog/procedures/Sp_System_CalcMaterialsPrice_220709.md b/en/docs/auto-catalog/procedures/Sp_System_CalcMaterialsPrice_220709.md index 8e5db72..5cbaa02 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_CalcMaterialsPrice_220709.md +++ b/en/docs/auto-catalog/procedures/Sp_System_CalcMaterialsPrice_220709.md @@ -1,9 +1,9 @@ # `Sp_System_CalcMaterialsPrice_220709` (procedure) -> @author:杨恒林 - @date:20210521 封存 - @describe:全月加权计算价格后 期初金额 + 采购入库金额+期它入库金额/ 期初数量 + 采购入库金额+期它入库金额 - 更新到其它各单据 +> @author:杨恒林 + @date:20210521 封存 + @describe:全月加权计算价格后 期初金额 + 采购入库金额+期它入库金额/ 期初数量 + 采购入库金额+期它入库金额 + 更新到其它各单据 bUpdate = 1 时,表示月末结帐时调用,并存入结存表,0:在材料存货核算表界面 调用 只是计算材料库存相关单据的价格 @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 / 财务月结 → 计算材料价格 — dated backup revision (2022-07-09 snapshot) of `Sp_System_CalcMaterialsPrice`. Preserved alongside the live body so closing-period revaluations can be reproduced or rolled back if a later edit changes the period numbers. + +**What it does:** Same algorithm as `Sp_System_CalcMaterialsPrice` at the 2022-07-09 cut — period-walk over each material's prior-month closing balance plus current 采购/其它入库 to derive a 全月加权 unit price, then propagate back to in-period materials slaves with system-settings decimal rounding. The header comment retains the original `bUpdate=1` 月末结帐 / `bUpdate=0` 材料存货核算表 split. + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, no form-master binding, no other-routine caller in `information_schema.ROUTINES`, no xly-src reference. Per the playbook backup-variant convention, treat as a frozen snapshot — not expected to be called from any live flow; verify before redeploying. diff --git a/en/docs/auto-catalog/procedures/Sp_System_CalcMaterialsPrice_221111.md b/en/docs/auto-catalog/procedures/Sp_System_CalcMaterialsPrice_221111.md index 792f23c..38ac694 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_CalcMaterialsPrice_221111.md +++ b/en/docs/auto-catalog/procedures/Sp_System_CalcMaterialsPrice_221111.md @@ -1,9 +1,9 @@ # `Sp_System_CalcMaterialsPrice_221111` (procedure) -> @author:杨恒林 - @date:20210521 封存 - @describe:全月加权计算价格后 期初金额 + 采购入库金额+期它入库金额/ 期初数量 + 采购入库金额+期它入库金额 - 更新到其它各单据 +> @author:杨恒林 + @date:20210521 封存 + @describe:全月加权计算价格后 期初金额 + 采购入库金额+期它入库金额/ 期初数量 + 采购入库金额+期它入库金额 + 更新到其它各单据 bUpdate = 0:第一次分摊,分切单主表分摊到从表。 第二次正常分摊 @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 / 财务月结 → 计算材料价格 — dated backup revision (2022-11-11 snapshot) of `Sp_System_CalcMaterialsPrice`. Sits alongside the live body and the earlier `_220709` snapshot so closing-period revaluations from that day can be reproduced. + +**What it does:** Same intent as `Sp_System_CalcMaterialsPrice` at the 2022-11-11 cut — 全月加权 unit price per material across the closing period, then propagate back onto in-period materials slaves. Header retains the dual-pass split (`bUpdate=0` 分切单 master→slave first pass; second pass正常分摊). + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, no form-master binding, no other-routine caller in `information_schema.ROUTINES`, no xly-src file references this dated variant. Per the playbook backup-variant convention, treat as a frozen snapshot of the live body. diff --git a/en/docs/auto-catalog/procedures/Sp_System_CalcProductPrice.md b/en/docs/auto-catalog/procedures/Sp_System_CalcProductPrice.md index 9998626..5025d10 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_CalcProductPrice.md +++ b/en/docs/auto-catalog/procedures/Sp_System_CalcProductPrice.md @@ -1,9 +1,9 @@ # `Sp_System_CalcProductPrice` (procedure) -> @author:杨恒林 - @date:20210521 封存 - @describe: 计算库存产品商品价值并存入月结表 主要思路如下: - 从本月月末之前最近一次订单取价格,如果取不到 从 产品客户表中取 ,再取不到 从产品表中取,再取不到,从最近取对帐 +> @author:杨恒林 + @date:20210521 封存 + @describe: 计算库存产品商品价值并存入月结表 主要思路如下: + 从本月月末之前最近一次订单取价格,如果取不到 从 产品客户表中取 ,再取不到 从产品表中取,再取不到,从最近取对帐 bUpdate = 1 时,表示月末结帐时调用,0:在库存商品价值表界面 调用 @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 / 财务月结 → 计算产品价格 — period-level成品价值 pricer; product-side counterpart of `Sp_System_CalcMaterialsPrice`. Header (杨恒林 2021-05-21 封存) spells out the price-discovery cascade: first, the most-recent in-period 销售订单价; falling back to `eleproductcustomer` (产品客户特价); then `eleproduct.dProductPrice` default; lastly the nearest 销售对账价. `bUpdate=1` 月末结帐 also stores the period snapshot into the成品库存价值结存表; `bUpdate=0` is the 库存商品价值表 UI preview path. + +**What it does:** Walks every product touched by an in-period成品 movement (送货单/成品入库/退货单/成品调拨/成品报废/发外入库/成品盘点). For each product, runs the price-discovery cascade against the cut-off `tEndDate` to pick `dProductPrice`. Writes that price back onto every in-period成品 stock line (`accproductstore` slave rows and feed tables), recomputes `dProductMoney = dProductQty * dProductPrice` honouring `NetMoney`/`NetPrice` decimal settings, and on `bUpdate=1` consolidates the period totals into the成品 month-end / inventory-value snapshot. + +**Invocation:** Called by `Sp_CalcCost_BtnEventReCalcCost` (重新计算本期成本), `Sp_Cost_CheckBusinessData` (close-time business-data validation), `Sp_financialClosing_BtnEventCalcMaterialPrice` (财务月结 → 计算材料价格 button, which also kicks off product-side pricing), `Sp_financialClosing_BtnEventCalcYM_New`, and `Sp_Product_BtnEventCheck` (成品入库 audit). Each upstream caller is dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from the corresponding 月结 / 成本核算 toolbar buttons. Install: `script/标版/30100101/cost/Sp_System_CalcProductPrice.sql` (+ caller scripts). Customer override: `script/客户/千彩/Sp_Inventory_ProductInOutStoreStock.sql`. `_new` revision exists with a reduced caller set. diff --git a/en/docs/auto-catalog/procedures/Sp_System_CalcProductPrice_new.md b/en/docs/auto-catalog/procedures/Sp_System_CalcProductPrice_new.md index b858ce5..dc1dbd3 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_CalcProductPrice_new.md +++ b/en/docs/auto-catalog/procedures/Sp_System_CalcProductPrice_new.md @@ -1,9 +1,9 @@ # `Sp_System_CalcProductPrice_new` (procedure) -> @author:杨恒林 - @date:20210521 封存 - @describe: 计算库存产品商品价值并存入月结表 主要思路如下: - 从本月月末之前最近一次订单取价格,如果取不到 从 产品客户表中取 ,再取不到 从产品表中取,再取不到,从最近取对帐 +> @author:杨恒林 + @date:20210521 封存 + @describe: 计算库存产品商品价值并存入月结表 主要思路如下: + 从本月月末之前最近一次订单取价格,如果取不到 从 产品客户表中取 ,再取不到 从产品表中取,再取不到,从最近取对帐 bUpdate = 1 时,表示月末结帐时调用,0:在库存商品价值表界面 调用 @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 / 财务月结 → 计算产品价格 — `_new` revision of `Sp_System_CalcProductPrice` (identical signature). Used by a narrower subset of close-time button-events; intent unchanged: derive per-product `dProductPrice` from the 销售订单价 → 产品客户特价 → 产品默认价 → 销售对账价 cascade and write it into the period's成品 movements. + +**What it does:** Same body shape as the base proc — walks成品 movements in `[tStartDate, tEndDate]`, applies the price cascade against `tEndDate`, writes back `dProductPrice` / `dProductMoney` to in-period成品 stock and (when `bUpdate=1`) consolidates into the month-end snapshot. + +**Invocation:** Called by `Sp_financialClosing_BtnEventCalcMaterialPrice` and `Sp_financialClosing_BtnEventCalcYM_New` — both 财务月结 button handlers dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()`. The base `Sp_System_CalcProductPrice` retains the wider caller set (audit-time `Sp_Product_BtnEventCheck`, `Sp_Cost_CheckBusinessData`, `Sp_CalcCost_BtnEventReCalcCost`), so the `_new` body is the slimmer月结-only variant. No standalone install script for this `_new` revision in xly-src — deploy from the base script and tag the patched body. diff --git a/en/docs/auto-catalog/procedures/Sp_System_CheckFlow.md b/en/docs/auto-catalog/procedures/Sp_System_CheckFlow.md index 1aa107c..29f95e1 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_CheckFlow.md +++ b/en/docs/auto-catalog/procedures/Sp_System_CheckFlow.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Generic 审批流条件检查 — evaluates every active `elecheckmodel` row tied to a form id against the candidate bill's joined master/slave/base-entity values via `Sisformula`, returning a pipe-delimited `slave-master-formula` digest of which conditions matched. Invoked by the `Sp_Calc_s*` audit slot of every business module whose `SysSystemSettings.CkxDefineCheck=1`, so 销售/采购/生产/委外/品质 audit buttons all share this single approval-routing engine. + +**What it does:** First rejects re-submission while `sysMsg` already holds a pending 审批 message for the same `sGuid`/`sType=2`. Then cursors over `elecheckmodel WHERE sFormId=sFormGuid AND bActivate=1`, and inside each model cursors `elecheckmodelcondition` joined to `Sisformula`; for every condition it calls `Sp_System_ReplaceField` with the caller's `sAllGuids/sTbNames/sTypes` payload to evaluate the formula and, if the returned `p_sFieldsReturn=1`, appends `slaveGuid-modelGuid-formulaName` to `sReturn`. `sCode` stays 1 unless `Sp_System_ReplaceField` itself reports an error. + +**Invocation:** Static `CALL Sp_System_CheckFlow(...)` from virtually every `Sp_Calc_s` (e.g. `Sp_Calc_sAcc`, `Sp_Calc_sDgn`, `Sp_Calc_sQtt_hm`, ~50 more) inside their `iFlag=1 AND iDefineCheck=1 AND iTmpCheck<>1` audit branch. No direct form-master / gdsmodule / Java wiring — exclusively a helper for the `Sp_Calc_s*` audit family. Install script at `script/标版/30100101/Sp_System_CheckFlow.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_System_CheckMaterialsInvalid.md b/en/docs/auto-catalog/procedures/Sp_System_CheckMaterialsInvalid.md index 2add98d..323148e 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_CheckMaterialsInvalid.md +++ b/en/docs/auto-catalog/procedures/Sp_System_CheckMaterialsInvalid.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料作废校验 — blocks save of a 工单 / 报价单 when any referenced material has been retired (`elematerials.bInvalid=1`) and additionally blocks 工单 save when its upstream 销售订单 has been unaudited/deleted. Used by the standard post-save validator hook to keep retired-material work-orders out of production. + +**What it does:** On `sTableName='mftworkordermaster'` joins `mftworkordermaterials` to `elematerials` and collects `GROUP_CONCAT(sMaterialsName)` where `bInvalid=1`; on `quoquotationmaster` does the same against `quoquotationmaterials`. If any names come back, returns `sCode=-8` with `':材料已作废,不能保存'`. Then counts `salsalesordermaster` rows referenced by `mftworkorderslave.sSrcId` whose `bCheck=1`; zero means the source order has been retracted or deleted, so it returns `sCode=-1` with `'订单已消审/或已删除 不能保存工单数据 请核查订单数据'`. + +**Invocation:** Standard `gdsmodule.sSaveProName` post-save validator, dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` (which delegates to `checkSaveService.getCheckSaveUpd`). The install script `script/标版/30100101/Sp_System_CheckMaterialsInvalid.sql` is the only deployed copy; no current `gdsmodule.sSaveProName` row in this DB instance binds it, so it ships as a customer-configurable check. The `L` variant drops the salsalesorder check. diff --git a/en/docs/auto-catalog/procedures/Sp_System_CheckMaterialsInvalidL.md b/en/docs/auto-catalog/procedures/Sp_System_CheckMaterialsInvalidL.md index 33bfa80..47a419b 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_CheckMaterialsInvalidL.md +++ b/en/docs/auto-catalog/procedures/Sp_System_CheckMaterialsInvalidL.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Trimmed variant of `Sp_System_CheckMaterialsInvalid` — same 材料作废校验 ("material retired") guard for 工单 / 报价单 save, but without the downstream `salsalesordermaster.bCheck` cross-check. The `L` suffix marks the "lite" version used when the order-audit linkage isn't enforced. + +**What it does:** On `sTableName='mftworkordermaster'` joins `mftworkordermaterials → elematerials` and collects `GROUP_CONCAT(sMaterialsName WHERE E.bInvalid=1)`; on `quoquotationmaster` does the same against `quoquotationmaterials`. If any retired material is referenced, returns `sCode=-8` with `':材料已作废,不能保存'`. Otherwise leaves `sCode=1`. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, `gdsmodule` hooks, other routines, xly-src grep across all extensions, dynamic-dispatch search) — looks like a relaxed copy of `Sp_System_CheckMaterialsInvalid` kept on hand for a tenant that bypasses the order-bCheck enforcement; candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_System_CheckSave.md b/en/docs/auto-catalog/procedures/Sp_System_CheckSave.md index 7d68701..281b123 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_CheckSave.md +++ b/en/docs/auto-catalog/procedures/Sp_System_CheckSave.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Universal 业务单据保存校验 hook — the single fall-through post-save validator that runs for every business form after the per-form `sSaveProName` validator. The procedure is **hard-coded** into Java save handling (not pulled from `gdsmodule`), making it the system-wide place to add tenant-agnostic post-save side-effects. The active body (the approval-routing logic is fully commented out) now does only one thing: copies a configured `SysBillNoSettings.sSrcFormId` onto the just-saved row. + +**What it does:** Looks up `SysBillNoSettings.sSrcFormId WHERE sFormId=sFormGuid` for the tenant; if found and `sTableName` is non-empty, builds and EXECUTEs a prepared `UPDATE SET sFormId='' WHERE sId=''`. Everything else in the body — the elecheckmodel scan and the per-slave `Sp_System_CheckSaveFlow` cursor against `saldelivergoodsmaster` — is commented out (`-- 以下代码是一直注释状态,没有启用`). Always returns `sCode=1`. + +**Invocation:** Called as the **second pass** of every save by `BusinessBaseServiceImpl.checkUpdateFlow()` via `checkSaveService.getCheckSaveUpdFlow(..., "Sp_System_CheckSave")` (string literal in the Java source) — this runs after the per-module `checkUpdate(..., "sSaveProName")` succeeds. Install script `script/标版/30100101/Sp_System_CheckSave.sql`; an upgrade copy lives at `script/标版/upgrade/20211104单独升级后台包需要执行/Sp_System_CheckSave.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_System_CheckSaveFlow.md b/en/docs/auto-catalog/procedures/Sp_System_CheckSaveFlow.md index e0b7ce6..7ef7393 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_CheckSaveFlow.md +++ b/en/docs/auto-catalog/procedures/Sp_System_CheckSaveFlow.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 业务单据保存校验 — the formula-driven post-save validator twin of `Sp_System_CheckFlow` (which serves the audit path). Same `sAllGuids/sTbNames/sTypes` payload signature; intended to walk `elecheckmodel WHERE bSave=1` and report which conditions match on save. In the current standard-edition build the body is essentially empty (only `set sCode=1; set sReturn=''` and a never-executed `top: BEGIN ... END`) — the real save-time formula sweep was decommissioned, and `Sp_System_CheckSave`/`Sp_System_CheckSaveFlowCps` now handle the actual save-side checks. + +**What it does:** Declares the same set of locals as `Sp_System_CheckFlow` (master/condition cursor placeholders, `sMaterialsGuid`, `iCheckMaster`, etc.), sets `sCode=1` and `sReturn=''`, and immediately falls out of the `top:` block. Effectively a no-op placeholder retained for ABI compatibility with callers that still `CALL` it. + +**Invocation:** `CALL Sp_System_CheckSaveFlow(...)` from `Sp_System_CheckSave` (in a commented-out 送货单 branch), `Sp_BtnEventProductionmaterialSure_New`, `Sp_financialClosing_BtnEventCalcCost_New`, and `Sp_financialClosing_BtnEventExpense` — all cost / 费用录入 paths. xly-src ships `script/标版/30100101/Sp_System_CheckSaveFlow.sql` and an upgrade copy. Effectively a stub today; treat any reliance on its return as latent dead code. diff --git a/en/docs/auto-catalog/procedures/Sp_System_CheckSaveFlowCps.md b/en/docs/auto-catalog/procedures/Sp_System_CheckSaveFlowCps.md index e68433a..ca93a0c 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_CheckSaveFlowCps.md +++ b/en/docs/auto-catalog/procedures/Sp_System_CheckSaveFlowCps.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 费用录入保存调用 — post-save cost-allocation engine for the 费用录入(部门) master form `accexpenseentrydepartmentmaster` (sFormId `101801153119616595200652250`). Whenever a 费用录入 row is saved, this routine reapportions the expense across the department-slave / work-center-slave hierarchy and fills the differential / transfer columns so the cost ledger stays balanced. Lives on the 成本核算 path of the 财务结账 module. + +**What it does:** Reads `accexpenseentrydepartmentmaster.dExpenseeMoney − SUM(slave.dEnterMoney WHERE bDepartInsert=0)` and refuses save with `sSystemCostUnderDepartSum` if the residual goes negative. Resets `dTotalMoney/dApportionMoney/dTransferMoney` on `accexpenseentrydepartmentslave` and `accexpenseentryworkcenterslave`, then reads `iAssignStandardName2/3` to drive the apportionment standard, and over many cursor passes recomputes per-department and per-work-center totals, posts the rounding residual to the last row, and updates `sTransferDepartName / sTransferWorkCenterMemo`. Touches `accexpenseentrydepartmentmaster_dif`, `accexpenseentrydepartmentslave`, `accexpenseentryworkcenterslave`, `sysaccountperiod`. + +**Invocation:** Called from `Sp_BtnEventProductionmaterialSure_New` (per-cost-frame loop that auto-inserts 系统插入 master rows), `Sp_financialClosing_BtnEventCalcCost_New`, and `Sp_financialClosing_BtnEventExpense`. No direct `sSaveProName` binding in `gdsmodule` for this DB instance — the cost-flow procs `CALL` it after they assemble each `accexpenseentrydepartmentmaster` row, then `CALL Sp_Calc_sCps` to audit. Install scripts at `script/标版/30100101/cost/Sp_System_CheckSaveFlowCps.sql` and a `ftfydr` upgrade variant in `script/标版/20250616/`. diff --git a/en/docs/auto-catalog/procedures/Sp_System_CheckSaveOee.md b/en/docs/auto-catalog/procedures/Sp_System_CheckSaveOee.md index f638987..7786c67 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_CheckSaveOee.md +++ b/en/docs/auto-catalog/procedures/Sp_System_CheckSaveOee.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** OEE-side 业务单据保存校验 stub — declares the OEE-related locals (`p_dCount`, `p_MaiCount`, `P_MaName`, `ReplaceField_*`) and the standard `sAllGuids/sTbNames/sTypes` payload variables, but the active body has been gutted: it unconditionally sets `sCode=1`, `sReturn='工单数量大于订单数,请核查数量或有无未审核工单'`, and leaves `top:`. Either a half-finished feature (the OEE save-time check against 工单 quantities vs 订单 quantities) or a deliberately disabled validator left in place for ABI compatibility. + +**What it does:** Lowers `sTableName`, hard-codes `sReturn` to the 工单数量大于订单数 warning string, sets `sCode=1`, and exits. Touches no tables. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, `gdsmodule` hooks, other routines, xly-src grep across all extensions, dynamic-dispatch search). Naming and signature mirror `Sp_System_CheckSaveFlow` so it would slot into the same `sSaveProName` dispatcher if wired up — candidate for maintainer audit / cleanup. diff --git a/en/docs/auto-catalog/procedures/Sp_System_Checkquoquo.md b/en/docs/auto-catalog/procedures/Sp_System_Checkquoquo.md index 4c067ac..b1fd64b 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_Checkquoquo.md +++ b/en/docs/auto-catalog/procedures/Sp_System_Checkquoquo.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售变更单保存校验 — refuses to save a 报价单 (quotation) edit on `quoquotationmaster` when any downstream 销售订单 it spawned has already been picked up by a 销售对账 (sales reconciliation) line. Prevents tenants from amending a quote whose money has already entered the AR workflow. + +**What it does:** On `sTableName='QuoQuotationmaster'`, joins `viw_quoquotation M → viw_salsalesorder E ON E.sSrcId=M.sSrcId` filtered to `M.sFormId='10110110111016576940332730'` and `M.sParentId=sGuid`, then `GROUP_CONCAT`s any `E.sBillNo` whose `sOrderNo` appears in `salsalescheckingslave`. If matches exist, sets `sCode=-8` and returns `'此报价单生成的销售订单: 已做销售对账不能变更!'`. Otherwise leaves `sCode=1`. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, `gdsmodule` hooks, other routines, xly-src grep, dynamic-dispatch search). Name pattern (`Check…quoquo`) and signature match the `gdsmodule.sSaveProName` post-save slot dispatched by `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")`, but no row currently binds it in this DB instance — likely a customer-specific check awaiting configuration; candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_System_Checkquoquo_copy1.md b/en/docs/auto-catalog/procedures/Sp_System_Checkquoquo_copy1.md index 5f16bb6..260798a 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_Checkquoquo_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_System_Checkquoquo_copy1.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_System_Checkquoquo` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_System_Checkquoquo` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_System_DelMsgCheckFlow.md b/en/docs/auto-catalog/procedures/Sp_System_DelMsgCheckFlow.md index 3f6fc88..7d681cf 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_DelMsgCheckFlow.md +++ b/en/docs/auto-catalog/procedures/Sp_System_DelMsgCheckFlow.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 单据删除连带清审批消息 — when a business bill is invalidated or deleted, this proc tears down its parked approval-flow records: the `sysMsg` rows (pending-approval inbox), their `sysmsguser` recipient mappings, and the `sysbillcheckresult` per-condition results. Keeps the in-flight 审批 queue clean when a 单据 is retracted. + +**What it does:** Counts `sysMsg WHERE sBillId=sGuid` for the tenant; if zero, returns `sCode=1` (nothing to clean). Otherwise issues three cascading deletes scoped to the bill: `DELETE FROM sysbillcheckresult WHERE sMsgId IN (SELECT sId FROM sysMsg WHERE sBillId=sGuid ...)`, the same for `sysmsguser` keyed on `sParentId`, and finally `DELETE FROM sysMsg WHERE sBillId=sGuid` itself. + +**Invocation:** Statically called from `Sp_Calc_sQtt_hm` (报价单 audit slot) inside its uncheck/delete branch, and likely intended for the wider `Sp_Calc_s*` family — only this one current caller in the DB. Install script `script/标版/30100101/Sp_System_DelMsgCheckFlow.sql`. Not bound through any `gdsmodule` / form-master hook; pure proc-to-proc helper. diff --git a/en/docs/auto-catalog/procedures/Sp_System_InitCurrentPeriodCost.md b/en/docs/auto-catalog/procedures/Sp_System_InitCurrentPeriodCost.md index 47fe27c..6c09a55 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_InitCurrentPeriodCost.md +++ b/en/docs/auto-catalog/procedures/Sp_System_InitCurrentPeriodCost.md @@ -1,11 +1,11 @@ # `Sp_System_InitCurrentPeriodCost` (procedure) -> @author:杨恒林 - @date:20210523 封存 - @describe: 获取当前月份要进行成本核算的工单号,在月末结帐时并存入成本月结表,只有结构数据, - 暂无成本数据,等实际的费用分摊单据数据出来后,调用成本核算过程,更新成本数据 主要思路如下: - 1.月末结帐时调用本过程 - 2.本月核算工单 = 本月成品入库+发外对帐对应的工单号和本月装配单号从表对应的工单 + 没有完工的工单号(入库数<工单数 或者单据完工) +> @author:杨恒林 + @date:20210523 封存 + @describe: 获取当前月份要进行成本核算的工单号,在月末结帐时并存入成本月结表,只有结构数据, + 暂无成本数据,等实际的费用分摊单据数据出来后,调用成本核算过程,更新成本数据 主要思路如下: + 1.月末结帐时调用本过程 + 2.本月核算工单 = 本月成品入库+发外对帐对应的工单号和本月装配单号从表对应的工单 + 没有完工的工单号(入库数<工单数 或者单据完工) 3.把上面工单存入本月月度成本表,为成本核算做准备 @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 / 月末结帐 — populates the per-period cost ledger skeleton at month-end close. Per the procedure `COMMENT` (杨恒林, 2021-05-23): the current period's 工单 set = (this-period 成品入库) + (this-period 发外对帐 工单) + (this-period 装配单从表 工单) + (open 工单 where 入库数<工单数 or marked 完工). The proc selects those 工单s and inserts structure-only rows into the 成本月结表 family (`CotOrderCostAnalysis`/`accordercostanalysis*`), ready for the subsequent `Sp_System_MaterialsCost` / `Sp_System_ProductionCost` runs to fill in money. + +**What it does:** Pulls `tStartDate/tEndDate/sPeriodId`, looks up `DATABASE()` and `EleWorkCenter` / `EleCostFrame` counts (refuses to run when either base table is empty), then assembles dynamic SQL (`p_sSumSql`, `p_sSumSqlBl`, `p_updateSql`, `p_sSetSql`) that joins `mftworkordermaster` to `pitproductstoremaster`, `mftvinvoiceslave` (发外发票), `mftassemblyslave` (装配从表) and the prior period's 成本月结 row, and bulk-inserts the in-scope 工单s into `accordercostanalysis` / cost-frame slaves with `iType` codes for each category. Mostly INSERT-with-cost-zero placeholders; later cost procs UPDATE them. + +**Invocation:** Called by `Sp_financialClosing_BtnEventCalcMaterialPrice` (月末结帐 button — after `Sp_System_CalcMaterialsPrice` and `Sp_System_CalcProductPrice_new`), and additionally by `Sp_CalcCost_BtnEventReCalcCost`, `Sp_Cost_CheckBusinessData`, `Sp_System_ReCostStructure`, and `Sp_System_ReCostStructure_new`. Install scripts at `script/标版/30100101/cost/Sp_System_InitCurrentPeriodCost.sql` plus an `financialClosing_BtnEventCalcMaterialPrice.sql` upgrade copy. diff --git a/en/docs/auto-catalog/procedures/Sp_System_MaterialsAllReSure.md b/en/docs/auto-catalog/procedures/Sp_System_MaterialsAllReSure.md index 3c2f41f..42f66f9 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_MaterialsAllReSure.md +++ b/en/docs/auto-catalog/procedures/Sp_System_MaterialsAllReSure.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 / 期间材料价格批量反确认 — inverse of `Sp_System_MaterialsAllSure`. Bulk-clears the 材料分摊价格 confirmation flag for selected periods on the 月度成本 module so the period can be recomputed. Refuses to run while downstream 成本核算 (`accordercostanalysis iType=1` 直接材料 or `accproductionmaterialsslave` 非工单领用) already holds `bConfirm=1` data, to prevent ledger drift. + +**What it does:** Validates `sProInParam` (JSON `$.params[*].value[*].sId`) hits `sysaccountperiod`; for each `sId` it reads `sPeriodId` / `bCalMaterials`, checks for any `bConfirm=1` row in `accordercostanalysis (iType=1)` or `accproductionmaterialsslave` against that period — if found returns `sCode=-1` with `sCbhsHaveConfirmData`. Otherwise refuses periods already `bCalMaterials=1` ("数据已核算不能批量操作"). When clean, sets `sysaccountperiod.bCalMaterials=0` for the listed periods and zeros related material-cost confirmation columns across `accmaterialsstore` / `mitmaterialsstoreadjustmoney*`. + +**Invocation:** Status: appears orphaned at the procedure-call level (no other proc, form-master, or gdsmodule hook references it; no xly-src caller outside its own `script/标版/30100101/cost/Sp_System_MaterialsAllReSure.sql` install). Signature `(sProInParam JSON, sMakePerson, sBrId, sSuId, sReturn, sCode)` is the canonical `Sp_BtnEvent_*` dispatch shape — so it likely lands via `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from a toolbar button on the 月度成本 grid; verify by searching for the literal `Sp_System_MaterialsAllReSure` in front-end button configs. diff --git a/en/docs/auto-catalog/procedures/Sp_System_MaterialsAllSure.md b/en/docs/auto-catalog/procedures/Sp_System_MaterialsAllSure.md index 4a7eec6..79c07a1 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_MaterialsAllSure.md +++ b/en/docs/auto-catalog/procedures/Sp_System_MaterialsAllSure.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 / 期间材料价格批量确认 — confirms the 材料分摊价格 across all 期间 (accounting periods) selected on the 月度成本 grid, locking the materials-cost layer so subsequent 成本核算 stages can proceed. Same guardrail as `Sp_System_MaterialsAllReSure`: refuses to (re-)confirm while `accordercostanalysis iType=1` 直接材料 or `accproductionmaterialsslave` already has `bConfirm=1` rows. + +**What it does:** Validates `sProInParam` ≥ 13 chars, `JSON_EXTRACT($.params)`, and counts matching `sysaccountperiod` ids. Refuses if 0 (`selectedRowKeysNo`) or if input is malformed (`paramsErro`). For each period iterates `$.params[*].value[*].sId`, looks up `sPeriodId/bCalMaterials`, blocks when downstream cost data already confirmed, otherwise flips `sysaccountperiod.bCalMaterials=1` for the period and propagates `bConfirm=1` / `sConfirmMonth=` across the materials-cost ledger family (`accmaterialsstore`, `mitmaterialsstoreadjustmoneymaster/slave`, etc.). + +**Invocation:** Status: appears orphaned at the procedure-call level (no proc-to-proc, form-master, gdsmodule, or xly-src caller beyond the install script `script/标版/30100101/cost/Sp_System_MaterialsAllSure.sql`). Signature matches the `Sp_BtnEvent_*` shape — `(sProInParam JSON, sMakePerson, sBrId, sSuId, sReturn, sCode)` — so almost certainly dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from a 批量确认 button on the 月度成本 grid. Pair with `Sp_System_MaterialsAllReSure` (反确认) and `Sp_System_ProductionCostAllSure` (生产成本批量确认). diff --git a/en/docs/auto-catalog/procedures/Sp_System_MaterialsCost.md b/en/docs/auto-catalog/procedures/Sp_System_MaterialsCost.md index 5109eff..4b6ca48 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_MaterialsCost.md +++ b/en/docs/auto-catalog/procedures/Sp_System_MaterialsCost.md @@ -1,9 +1,9 @@ # `Sp_System_MaterialsCost` (procedure) -> @author:杨恒林 - @date:20210521 封存 - @describe:全月加权计算价格后 期初金额 + 采购入库金额+期它入库金额/ 期初数量 + 采购入库金额+期它入库金额 - 更新到其它各单据 +> @author:杨恒林 + @date:20210521 封存 + @describe:全月加权计算价格后 期初金额 + 采购入库金额+期它入库金额/ 期初数量 + 采购入库金额+期它入库金额 + 更新到其它各单据 bUpdate = 0:第一次分摊,分切单主表分摊到从表。 第二次正常分摊 @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 / 全月加权材料价格计算 — per the procedure `COMMENT` (杨恒林, 2021-05-21): full-month weighted-average price = (期初金额 + 采购入库金额 + 其它入库金额) / (期初数量 + 采购入库数量 + 其它入库数量). Computes the period's material weighted price, writes it into the materials-cost ledger, and pushes the price back into each consuming bill so downstream calculations (产品成本, 工单成本) work off a single canonical 材料价 per period. `iSecond` flag controls first-pass (master-to-slave price seed) vs subsequent reallocation. + +**What it does:** Validates the `sProInParam` JSON of selected `sysaccountperiod` ids. For each period: reads `sPeriodId`, gathers prior-period balance via `Sp_MaterialsCarryforward`, builds the weighted price across `mitmaterialspurchaseinslave` (采购入库), and other inbound flows, then upserts `accmaterialsstore` (materials cost ledger) and `Sp_EleMaterialsStock` temp; deletes and rebuilds `mitmaterialsstoreadjustmoneymaster`/`slave` (adjustment journals) when prices change; loops through 分切单 (`mitmaterialscutmaster`) to re-spread cost; calls `SP_Sis_GetMaxNo` for adjustment bill numbers; finally updates `sysaccountperiod` flags. + +**Invocation:** Called from `Sp_System_ProductionCost`, `Sp_System_ProductionCost_new`, and `Sp_System_ProductionCost24222` (production-cost runs need materials priced first). No direct UI binding; reached transitively when the user clicks 生产成本计算 on the 月度成本 grid. Install script `script/标版/30100101/cost/Sp_System_MaterialsCost.sql`. Body is 65K chars — most of the bulk is the multi-stage temp-table assembly for the weighted-price spread. diff --git a/en/docs/auto-catalog/procedures/Sp_System_MaterialsReCost.md b/en/docs/auto-catalog/procedures/Sp_System_MaterialsReCost.md index 4cdd114..ccf39ae 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_MaterialsReCost.md +++ b/en/docs/auto-catalog/procedures/Sp_System_MaterialsReCost.md @@ -1,9 +1,9 @@ # `Sp_System_MaterialsReCost` (procedure) -> @author:杨恒林 - @date:20210521 封存 - @describe:全月加权计算价格后 期初金额 + 采购入库金额+期它入库金额/ 期初数量 + 采购入库金额+期它入库金额 - 更新到其它各单据 +> @author:杨恒林 + @date:20210521 封存 + @describe:全月加权计算价格后 期初金额 + 采购入库金额+期它入库金额/ 期初数量 + 采购入库金额+期它入库金额 + 更新到其它各单据 bUpdate = 0:第一次分摊,分切单主表分摊到从表。 第二次正常分摊 @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 / 期间材料价格重算 — the "re-cost" counterpart to `Sp_System_MaterialsCost`. Same weighted-average algorithm (期初金额 + 采购入库 + 其它入库 / 同口径数量) but operating from the 月度成本 batch context: takes a JSON list of `sysaccountperiod` ids, undoes any prior 材料分摊 confirmation, and reruns the price computation. Lets accounting re-issue 材料价 for an already-priced period when adjustments arrive. + +**What it does:** Validates `sProInParam` ≥ 13 chars and that the JSON `$.params[*].value[*].sId` list hits `sysaccountperiod`; for each id reads `sPeriodId`, refuses when `accordercostanalysis iType=1 bConfirm=1` or `accproductionmaterialsslave bConfirm=1` exists for the period, then follows the same temp-table / `Sp_MaterialsCarryforward` / `accmaterialsstore` / `mitmaterialsstoreadjustmoney*` rebuild flow as `Sp_System_MaterialsCost` to refresh prices. + +**Invocation:** Status: appears orphaned at the procedure-call level (no proc-to-proc, gdsmodule, or form-master binding). Signature `(sProInParam JSON, sMakePerson, sBrId, sSuId, sReturn, sCode)` is the canonical `Sp_BtnEvent_*` dispatch shape — almost certainly invoked by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from a 重新计算材料价 button on the 月度成本 grid. Install script `script/标版/30100101/cost/Sp_System_MaterialsReCost.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_System_MonThendCheckOut.md b/en/docs/auto-catalog/procedures/Sp_System_MonThendCheckOut.md index 5c1bb8c..6461fc9 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_MonThendCheckOut.md +++ b/en/docs/auto-catalog/procedures/Sp_System_MonThendCheckOut.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Empty stub for 月末签出 / 月末结账 退出 — the procedure signature (`sPeriodID, sLoginName, tDate, sSuId, sBrId, sReturn`) implies "month-end close check-out": when accounting closes a period, this would be the symmetric "release" or post-close cleanup step. The body, however, is literally `BEGIN END` (12 chars of definition). + +**What it does:** Nothing. Body is empty — declares no locals, runs no statements, sets no output. `sReturn` is left at its caller-supplied value. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, `gdsmodule` hooks, other routines, xly-src grep across all extensions, dynamic-dispatch search). Only the install script `script/标版/30100101/Sp_System_MonThendCheckOut.sql` ships it. A reserved-for-later placeholder; safe to call but useless until the body is filled in — candidate for maintainer audit (either delete or implement). diff --git a/en/docs/auto-catalog/procedures/Sp_System_ProductCost.md b/en/docs/auto-catalog/procedures/Sp_System_ProductCost.md index 76edf38..ffbc5ee 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_ProductCost.md +++ b/en/docs/auto-catalog/procedures/Sp_System_ProductCost.md @@ -1,9 +1,9 @@ # `Sp_System_ProductCost` (procedure) -> @author:杨恒林 - @date:20210521 封存 - @describe: 计算库存产品商品价值并存入月结表 主要思路如下: - 从本月月末之前最近一次订单取价格,如果取不到 从 产品客户表中取 ,再取不到 从产品表中取,再取不到,从最近取对帐 +> @author:杨恒林 + @date:20210521 封存 + @describe: 计算库存产品商品价值并存入月结表 主要思路如下: + 从本月月末之前最近一次订单取价格,如果取不到 从 产品客户表中取 ,再取不到 从产品表中取,再取不到,从最近取对帐 bUpdate = 1 时,表示月末结帐时调用,0:在库存商品价值表界面 调用 @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 / 库存商品价值结存 — per the procedure `COMMENT` (杨恒林, 2021-05-21): computes the period's 库存产品商品价值 (finished-product inventory value) and writes it into the 月结表. Price-discovery cascade: latest 销售订单 → `EleProductCustomer` (per-customer override) → `EleProduct` master → latest 销售对账. Drives the finished-goods side of the cost ledger; pairs with `Sp_System_MaterialsCost` (raw-material side) and `Sp_System_ProductionCost` (work-order side). + +**What it does:** Validates `sProInParam` JSON `$.params` and counts `sysaccountperiod` hits. For each period: drops/recreates the `Sp_EleProductStock` and `Sp_PitProductStore` temp tables, calls `Sp_ProductCarryforward` for prior-period balance, `Sp_Sis_GetProductInventoryFormGuid` for in/out-form filters, then bulk-loads movement from `pitproductstore*` / `saldelivergoods*`. Computes weighted price per (`sProductId, sWareHouseId, sLocationId`), and INSERTs/UPDATEs `accproductstore` (成品库存月结), `eleproductstock`, `eleproductstockmonth`, `eleproductstockmonthcost`, and the adjustment journals `pitproductmoneymaster/slave` (with `SP_Sis_GetMaxNo` for bill numbers). Touches sysaccountperiod flags at the end. + +**Invocation:** Called from `Sp_financialClosing_BtnEventProductStock_New` — the 月末结帐 → 库存商品价值 button. Internally `CALL`s `Sp_System_ProductCost_OutPrice` to finish the 出库 side. No direct UI or gdsmodule binding. Install script `script/标版/30100101/cost/Sp_System_ProductCost.sql`. Body is 204K chars — bulk is the multi-stage temp-table weighted-price recomputation. diff --git a/en/docs/auto-catalog/procedures/Sp_System_ProductCost_OutPrice.md b/en/docs/auto-catalog/procedures/Sp_System_ProductCost_OutPrice.md index bb75da8..3238abc 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_ProductCost_OutPrice.md +++ b/en/docs/auto-catalog/procedures/Sp_System_ProductCost_OutPrice.md @@ -1,11 +1,11 @@ # `Sp_System_ProductCost_OutPrice` (procedure) -> @author:杨恒林 - - - @date:20221126 封存 - - +> @author:杨恒林 + + + @date:20221126 封存 + + @describe: 计算出库成本 @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 / 出库成本计算 — per the procedure `COMMENT` (杨恒林, 2022-11-26): "计算出库成本". Computes the per-period 成品出库价 (finished-product issue cost) so that 送货单 / 退货单 lines get a costed-out value driven by the 库存商品价值 ledger, not just the most recent purchase price. Runs as the final pricing pass during 月末结帐 for the 成品库存 side. + +**What it does:** Reads `sysaccountperiod.tStartDate/tEndDate` for `p_sPeriod`, extends `tEndDate` by one day, calls `Sp_Sis_GetProductInventoryFormGuid` to fetch the `@sInSql/@sOutSql` form-id filters, drops and rebuilds the `Sp_EleProductStock` temp table (one row per product / warehouse / location: prior qty+money+price, in qty+money+price, out qty+money+price, end qty+price+money, plus `dNowOutAdjustStoreMoney`), then loops to compute weighted out-prices and push them back into `saldelivergoodsslave`, `salrejectgoodsslave`, `eleproductstock(month)`, and `eleproductstockmonthcost`. Tail-call coordinates with `Sp_System_ProductCost`. + +**Invocation:** Called from `Sp_financialClosing_BtnEventProductStock_New` — the 月末结帐 → 库存成本 button on the financial closing module. No direct UI or gdsmodule binding; reached transitively as the finishing step of the product-stock cost flow. Install script `script/标版/30100101/cost/Sp_System_ProductCost_OutPrice.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_System_ProductCost_copy1.md b/en/docs/auto-catalog/procedures/Sp_System_ProductCost_copy1.md index 92f89ae..b92f495 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_ProductCost_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_System_ProductCost_copy1.md @@ -1,9 +1,9 @@ # `Sp_System_ProductCost_copy1` (procedure) -> @author:杨恒林 - @date:20210521 封存 - @describe: 计算库存产品商品价值并存入月结表 主要思路如下: - 从本月月末之前最近一次订单取价格,如果取不到 从 产品客户表中取 ,再取不到 从产品表中取,再取不到,从最近取对帐 +> @author:杨恒林 + @date:20210521 封存 + @describe: 计算库存产品商品价值并存入月结表 主要思路如下: + 从本月月末之前最近一次订单取价格,如果取不到 从 产品客户表中取 ,再取不到 从产品表中取,再取不到,从最近取对帐 bUpdate = 1 时,表示月末结帐时调用,0:在库存商品价值表界面 调用 @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_System_ProductCost` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_System_ProductCost` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_System_ProductMoney.md b/en/docs/auto-catalog/procedures/Sp_System_ProductMoney.md index 3bbe1ea..ec6c5bc 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_ProductMoney.md +++ b/en/docs/auto-catalog/procedures/Sp_System_ProductMoney.md @@ -1,9 +1,9 @@ # `Sp_System_ProductMoney` (procedure) -> @author:杨恒林 - @date:20210521 封存 - @describe: 计算库存产品商品价值并存入月结表 主要思路如下: - 从本月月末之前最近一次订单取价格,如果取不到 从 产品客户表中取 ,再取不到 从产品表中取,再取不到,从最近取对帐 +> @author:杨恒林 + @date:20210521 封存 + @describe: 计算库存产品商品价值并存入月结表 主要思路如下: + 从本月月末之前最近一次订单取价格,如果取不到 从 产品客户表中取 ,再取不到 从产品表中取,再取不到,从最近取对帐 bUpdate = 1 时,表示月末结帐时调用,0:在库存商品价值表界面 调用 @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本管理 → 产品存货核算 → 库存商品价值 — month-end recalculation of finished-product inventory value, writing the 收/发/存 (in/out/end) snapshot per `sProductId` to `eleproductstockmonthmoney`. Header comment (@author:杨恒林 @date:20210521 封存) describes the price-lookup chain: closest sales order before month-end → 产品客户表 → 产品表 → most recent 对帐. + +**What it does:** Validates the selected `sysaccountperiod` (`bCalProducts=0`, prior period must be already cost-finalised, `eleproductstockmonthcost` for this month must exist, all 销售发票 rows must be confirmed). Builds temp tables `Sp_EleProductStock` and `Sp_PitProductStore` seeded from `accproductstore` + `viw_accproductinit` + `eleproductstockmonthmoney`(prior). Pulls 上期 qty/money via `UPDATE … Inner Join`. Imports current-period confirmed `AccProductStore` rows tagged by `iInOut` (0 in, 1 out, 2 调整, 3 退货, 4 other) — covers 送货单/退货单/发票/存货调整/etc. Auto-generates an offsetting 存货调整确认单 (`pitproductmoneymaster`/`pitproductmoneyslave` with fixed `sId='999917794310946194302692936'`, form `192116810113315232425737501`) for products where `dEndQty=0` but `dEndMoney<>0`. Recomputes 期末 qty/money/price, then `DELETE`/`INSERT` `eleproductstockmonthmoney` and finally flips `sysaccountperiod.bCalProducts=1`. + +**Invocation:** Status: appears orphaned. No `gdsmodule` binding, no form-master, no other-proc match, no xly-src caller beyond `script/标版/30100101/cost/Sp_System_ProductMoney.sql` install script. `封存` (sealed) author tag suggests this is the v1 snapshot; the live caller routes through `Sp_System_ProductMoneyAllSure` (batch) instead. Candidate for maintainer audit — may have been superseded. diff --git a/en/docs/auto-catalog/procedures/Sp_System_ProductMoneyAllReSure.md b/en/docs/auto-catalog/procedures/Sp_System_ProductMoneyAllReSure.md index 75e31c6..b734f6e 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_ProductMoneyAllReSure.md +++ b/en/docs/auto-catalog/procedures/Sp_System_ProductMoneyAllReSure.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本管理 → 产品存货核算 — batch un-confirm (批量反确认) of every product-inventory line in one or more 会计期间. Inverse of `Sp_System_ProductMoneyAllSure`. Used to unwind a month's product-inventory confirmation across the whole period in a single click. + +**What it does:** Parses `$.params[*].value[*].sId` to period ids, refuses if `sysaccountperiod.bCalProducts=1` ("数据已核算不能批量操作"). For each `p_sPeriodId` clears `bConfirm=0, sConfirmMonth=''` on `accproductstore` for each product-inventory source bucket: 盘盈入库 (`sFormId='192116810113315264733417750'`), 装配入库 (rows whose `sBillSlaveId` ties via `pitproductinstoreslave`→`sgdsemigoodsmatchbillmaster`), 出库业务 (forms `101251240115015920999005840` / `11811781131121915179924491520` / `101801153119616626885036940` / `11811781131121915179924871530`), 签收扣数 (`101801153119616654889797200`), 发货运费 (`15839936170002427227633635401000`), 销售发票 (`11811781131121915184849572550`). + +**Invocation:** No `gdsmodule` binding, no form-master, no other-proc, no xly-src match beyond the install script — dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from the 产品存货核算 period grid's 批量反确认 toolbar button. Forward pair: `Sp_System_ProductMoneyAllSure`. diff --git a/en/docs/auto-catalog/procedures/Sp_System_ProductMoneyAllSure.md b/en/docs/auto-catalog/procedures/Sp_System_ProductMoneyAllSure.md index f811b0e..690ccff 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_ProductMoneyAllSure.md +++ b/en/docs/auto-catalog/procedures/Sp_System_ProductMoneyAllSure.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本管理 → 产品存货核算 — batch confirm (批量确认) of every product-inventory line in one or more 会计期间. Forward pair of `Sp_System_ProductMoneyAllReSure`. Marks `accproductstore` rows for each 收/发/存 source as `bConfirm=1` so the downstream `Sp_System_ProductMoney` month-end calc can consume them. + +**What it does:** Parses `$.params[*].value[*].sId` to period ids, refuses if `sysaccountperiod.bCalProducts=1` ("数据已核算不能批量操作"). For each `p_sPeriodId` sets `bConfirm=1, sConfirmMonth=p_sPeriodId` on `accproductstore` for the same six product-inventory source buckets the un-confirm twin covers: 盘盈入库 (form `192116810113315264733417750`), 装配入库 (via `pitproductinstoreslave`/`sgdsemigoodsmatchbillmaster`), 出库业务 (4 forms), 签收扣数, 发货运费, 销售发票. + +**Invocation:** No `gdsmodule` binding, no form-master, no other-proc, no xly-src match beyond `script/标版/30100101/cost/Sp_System_ProductMoneyAllSure.sql` — dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from the 产品存货核算 period grid's 批量确认 toolbar button. diff --git a/en/docs/auto-catalog/procedures/Sp_System_ProductionCost.md b/en/docs/auto-catalog/procedures/Sp_System_ProductionCost.md index ddc983c..2d53cd4 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_ProductionCost.md +++ b/en/docs/auto-catalog/procedures/Sp_System_ProductionCost.md @@ -1,9 +1,9 @@ # `Sp_System_ProductionCost` (procedure) -> @author:杨恒林 - @date:20210523 封存 - @describe: 从成本月结表中,拿到工单数据,计算本月成本数据后回写到成本月结表 注意点: - 1.本期期初成本从本工单最近一次月结成本表中获取,不一定就是上期 +> @author:杨恒林 + @date:20210523 封存 + @describe: 从成本月结表中,拿到工单数据,计算本月成本数据后回写到成本月结表 注意点: + 1.本期期初成本从本工单最近一次月结成本表中获取,不一定就是上期 2.在制品是指所有入库数小于工单数的工单 @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 / 生产成本核算 — per the procedure `COMMENT` (杨恒林, 2021-05-23): pulls 工单 data from the 成本月结表, recomputes this period's cost numbers, writes them back. Notes: (1) 期初成本 comes from the nearest prior 月结 row for the same 工单, not strictly the previous period; (2) 在制品 = 工单 where 入库数 < 工单数. This is the workhorse of the 工单成本核算 stage — runs after materials are priced (`Sp_System_MaterialsCost`) and after 期间初始化 (`Sp_System_InitCurrentPeriodCost`). + +**What it does:** Validates `sProInParam` JSON of period ids; for each: reads `bCost`, refuses if already 已核算, calls `Sp_System_MaterialsCost` to pin material prices, then assembles the per-work-order cost via a cascade of temp tables — `TmpCostWorkOrder`, `TmpCostWorkOrder_BQ` (本期), `TmpCostWorkOrder_dAreaBlZreo` (面积比例零除护栏), `TmpCostWorkOrderSum`, `p_accordercostanalysis*`, `p_dProductQty_tmp`. INSERT/UPDATE/DELETE `accordercostanalysis` (主成本表), `accproductstore` (期末成品库存), and `accexpenseentrydepartmentmaster_dif` (差异回写). Calls `Sp_WorkCostCarryforward` for 期初 carry-forward, and self-`CALL`s `Sp_System_ProductionCost` recursively where the cost-frame model requires it. + +**Invocation:** Called from `Sp_System_ProductionCost_new` and `Sp_System_ProductionCost24222` (variants), `Sp_System_ProductionCostBak` (backup), `Sp_System_ProductionCostTest` (test). No direct gdsmodule / form-master / xly-src caller — front-end button "生产成本计算" on the 月度成本 grid presumably routes here through `GenericProcedureCallServiceImpl.doGenericProcedureCall()`. Install scripts at `script/标版/30100101/cost/Sp_System_ProductionCost.sql` (plus `…AllSure` / `…AllReSure` confirm wrappers). Body 152K chars — bulk is temp-table assembly. diff --git a/en/docs/auto-catalog/procedures/Sp_System_ProductionCost24222.md b/en/docs/auto-catalog/procedures/Sp_System_ProductionCost24222.md index f47d2d4..c24b4d5 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_ProductionCost24222.md +++ b/en/docs/auto-catalog/procedures/Sp_System_ProductionCost24222.md @@ -1,9 +1,9 @@ # `Sp_System_ProductionCost24222` (procedure) -> @author:杨恒林 - @date:20210523 封存 - @describe: 从成本月结表中,拿到工单数据,计算本月成本数据后回写到成本月结表 注意点: - 1.本期期初成本从本工单最近一次月结成本表中获取,不一定就是上期 +> @author:杨恒林 + @date:20210523 封存 + @describe: 从成本月结表中,拿到工单数据,计算本月成本数据后回写到成本月结表 注意点: + 1.本期期初成本从本工单最近一次月结成本表中获取,不一定就是上期 2.在制品是指所有入库数小于工单数的工单 @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Dated snapshot variant of `Sp_System_ProductionCost`. Same author / comment / signature as the base proc — pulls 工单 data from 成本月结表, calls `Sp_System_MaterialsCost` to lock material prices, recomputes this period's 生产成本 via the same `TmpCostWorkOrder*` temp-table cascade, writes back to `accordercostanalysis` / `accproductstore`. The `24222` suffix is a ticket / date tag, not a semantic version — body diverges from `Sp_System_ProductionCost` in a handful of inline filters but the table footprint is identical. + +**What it does:** Identical pipeline to `Sp_System_ProductionCost`: validate `sProInParam` periods → refuse 已核算 periods (`bCost=1`) → `CALL Sp_System_MaterialsCost` → assemble per-work-order cost through `TmpCostWorkOrder` / `TmpCostWorkOrder_BQ` / `TmpCostWorkOrderSum` / `p_accordercostanalysis*` → INSERT/UPDATE/DELETE `accordercostanalysis` and `accproductstore` → tail-`CALL`s `Sp_System_ProductionCost` to share finishing logic. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule, other routines, xly-src grep, dynamic dispatch). Numeric-suffix name plus the install set shipping only the base `Sp_System_ProductionCost.sql` says this is a fork-and-patch retained for one-off tenant work; safe to leave but treat as cold storage — candidate for maintainer audit / cleanup. diff --git a/en/docs/auto-catalog/procedures/Sp_System_ProductionCostAllReSure.md b/en/docs/auto-catalog/procedures/Sp_System_ProductionCostAllReSure.md index d7efa0e..f38d907 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_ProductionCostAllReSure.md +++ b/en/docs/auto-catalog/procedures/Sp_System_ProductionCostAllReSure.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本管理 → 成本核算 — batch un-confirm (反核算) of every cost line in one or more 会计期间 (`sysaccountperiod`). Inverse of `Sp_System_ProductionCostAllSure`. Used to unwind a 本期作业汇总 / 直接材料 / 发外发票 / 计件工资 cost confirmation across the whole period in a single click. + +**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam` to a list of period ids, refuses if any selected period already has `sysaccountperiod.bCost=1` ("数据已核算不能批量操作"). For each `p_sPeriodId` clears `bConfirm` and `sConfirmMonth` on every cost-source row: `accordercostanalysis` (iType=1 直接材料, 2 本期作业汇总, 3 发外发票, 4 计件工资, 5 上期发外暂估抵消, 7 本期暂估发外入库 for the 成品入库 forms `192116810113315228246447250`/`192116810113315235917608210`/`192116810113315234275562360`), `accworkcenter` (工作中心数据), `accdepart` (部门数据), `accproductstore` (成品入库), and `accproductionmaterialsslave` (非工单领用确认). + +**Invocation:** No `gdsmodule` binding, no form-master, no other-proc, no xly-src match beyond the install script `script/标版/30100101/cost/Sp_System_ProductionCostAllReSure.sql` — dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from the 成本核算 period grid's 批量反确认 toolbar button. Forward pair: `Sp_System_ProductionCostAllSure`. diff --git a/en/docs/auto-catalog/procedures/Sp_System_ProductionCostAllSure.md b/en/docs/auto-catalog/procedures/Sp_System_ProductionCostAllSure.md index a9ae0d2..99c7099 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_ProductionCostAllSure.md +++ b/en/docs/auto-catalog/procedures/Sp_System_ProductionCostAllSure.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本管理 → 成本核算 — batch confirm (批量核算) of every cost line in one or more 会计期间. Forward pair of `Sp_System_ProductionCostAllReSure`. Marks all cost-source rows for the period as `bConfirm=1` so the downstream 工单成本计算 (`Sp_System_ProductionCost`) can consume them. + +**What it does:** Parses `$.params[*].value[*].sId` to period ids, refuses if `sysaccountperiod.bCost=1` ("数据已核算不能批量操作"). For each `p_sPeriodId` sets `bConfirm=1, sConfirmMonth=p_sPeriodId` on `accordercostanalysis` (iType 1/2/3/4/5/7 — same six cost subjects as the un-confirm twin: 直接材料, 本期作业汇总, 发外发票, 计件工资, 上期发外暂估抵消, 本期暂估发外入库), `accworkcenter`, `accdepart`, `accproductstore` (for 成品入库 forms `192116810113315228246447250`/`192116810113315235917608210`), and `accproductionmaterialsslave`. + +**Invocation:** No `gdsmodule` binding, no form-master, no other-proc, no xly-src match beyond `script/标版/30100101/cost/Sp_System_ProductionCostAllSure.sql` install script — dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from the 成本核算 period grid's 批量确认 toolbar button. diff --git a/en/docs/auto-catalog/procedures/Sp_System_ProductionCostBak.md b/en/docs/auto-catalog/procedures/Sp_System_ProductionCostBak.md index ba28e68..da6ced3 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_ProductionCostBak.md +++ b/en/docs/auto-catalog/procedures/Sp_System_ProductionCostBak.md @@ -1,9 +1,9 @@ # `Sp_System_ProductionCostBak` (procedure) -> @author:杨恒林 - @date:20210523 封存 - @describe: 从成本月结表中,拿到工单数据,计算本月成本数据后回写到成本月结表 注意点: - 1.本期期初成本从本工单最近一次月结成本表中获取,不一定就是上期 +> @author:杨恒林 + @date:20210523 封存 + @describe: 从成本月结表中,拿到工单数据,计算本月成本数据后回写到成本月结表 注意点: + 1.本期期初成本从本工单最近一次月结成本表中获取,不一定就是上期 2.在制品是指所有入库数小于工单数的工单 @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本管理 → 工单成本核算 — backup/sealed variant of `Sp_System_ProductionCost` from 杨恒林 (@date:20210523 封存, per the header comment). Computes work-order cost from the cost monthly-summary table and writes the period's cost data back to `accordercostanalysis`/`accworkcenter`/`accdepart`. Period opening (本期期初) cost comes from the work order's most recent month-end cost row (not strictly the prior period); 在制品 means work orders where total inbound qty < ordered qty. Per `封存` (sealed) tag, this is a historical snapshot of the algorithm before further refactoring. + +**What it does:** Same operation as the production-active `Sp_System_ProductionCost`: parses `sProInParam` JSON to a `p_sId` period, reads `NetMoney`/`NetPrice` decimal settings from `SysSystemSettings`, joins `sysaccountperiod` to derive `p_tStartDate`/`p_tEndDate`/`p_sPeriod`, validates the period isn't already costed (`bCost=1`) and that 直接材料 (`bCalMaterials=1`) is complete, then iterates the cost centres and expense subjects (`p_sAllCostCenter`, `p_sAllExpense`) to allocate 本期作业汇总, 直接材料, 发外发票, 计件工资, 期初/期末 by `sCostFrameId`. Builds dynamic SQL into `accordercostanalysis` and `accworkcenter`, populates `cotordercostanalysis` snapshot, and at the end flips `sysaccountperiod.bCost=1`. + +**Invocation:** Status: appears orphaned. No `gdsmodule` binding, no form-master, no other-proc, no xly-src match — not even an install-script copy. The `封存` (sealed) author tag in the header signals this is a frozen reference copy of `Sp_System_ProductionCost` kept for compare/rollback, not wired to any button. Candidate for maintainer audit / deletion. diff --git a/en/docs/auto-catalog/procedures/Sp_System_ProductionCostTest.md b/en/docs/auto-catalog/procedures/Sp_System_ProductionCostTest.md index 8a8cf69..b74b345 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_ProductionCostTest.md +++ b/en/docs/auto-catalog/procedures/Sp_System_ProductionCostTest.md @@ -1,9 +1,9 @@ # `Sp_System_ProductionCostTest` (procedure) -> @author:杨恒林 - @date:20210523 封存 - @describe: 从成本月结表中,拿到工单数据,计算本月成本数据后回写到成本月结表 注意点: - 1.本期期初成本从本工单最近一次月结成本表中获取,不一定就是上期 +> @author:杨恒林 + @date:20210523 封存 + @describe: 从成本月结表中,拿到工单数据,计算本月成本数据后回写到成本月结表 注意点: + 1.本期期初成本从本工单最近一次月结成本表中获取,不一定就是上期 2.在制品是指所有入库数小于工单数的工单 @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本管理 → 工单成本核算 — `Test` development-staging copy of `Sp_System_ProductionCost` from 杨恒林 (@date:20210523 封存, per the header comment). Same algorithm: pulls work-order rows from the cost monthly-summary, computes the period's cost data, writes back to `accordercostanalysis`/`accworkcenter`/`accdepart`. Period opening cost comes from the work order's most recent month-end cost row; 在制品 = work orders where inbound qty < ordered qty. + +**What it does:** Same shape as `Sp_System_ProductionCostBak`/`Sp_System_ProductionCost`: parses `$.params[0].value[0].sId` (skips the `JSON_VALID` defensive checks the active version added), reads `NetMoney`/`NetPrice` settings, joins `sysaccountperiod` to get period bounds, then iterates cost-centre and expense ids to build dynamic UPDATE SQL into `accordercostanalysis`/`accworkcenter` for 本期作业汇总, 直接材料, 发外发票, 计件工资, 期初/期末. Differs from `_Bak` only in the parameter-validation prelude (less defensive). + +**Invocation:** Status: appears orphaned. No `gdsmodule` binding, no form-master, no other-proc, no xly-src match. `Test` suffix and `封存` author tag identify this as a developer sandbox copy kept alongside `_Bak` for A/B comparison — not wired to any production button. Candidate for cleanup. diff --git a/en/docs/auto-catalog/procedures/Sp_System_ProductionCost_new.md b/en/docs/auto-catalog/procedures/Sp_System_ProductionCost_new.md index 916b896..9577b2a 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_ProductionCost_new.md +++ b/en/docs/auto-catalog/procedures/Sp_System_ProductionCost_new.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 / 生产成本(期初按比例分摊版) — newer variant of `Sp_System_ProductionCost`. Per the procedure `COMMENT` (`期初按比例分摊`): the change versus the base is how the 期初成本 is allocated — instead of grabbing the nearest prior 月结 row verbatim, the `_new` build spreads the prior-period 在制品 cost proportionally across this period's work-orders by 工时 / 数量 ratios. Same target ledger (`accordercostanalysis`), same call topology, different apportionment. + +**What it does:** Validates `sProInParam` JSON of period ids; per period, reads `sPeriodId/bCost`, refuses when the period is already 已核算 (`bCost=1`). Drives the standard 生产成本 pipeline: `CALL Sp_System_MaterialsCost` first to lock material prices, then walks the per-work-order cursor, INSERTs into `TmpCostWorkOrder*` / `p_accordercostanalysis*` temp tables, applies the *proportional* 期初 allocation (`Sp_WorkCostCarryforward`), and writes back `accordercostanalysis` / `accproductstore`. Tail-`CALL`s `Sp_System_ProductionCost` for shared finishing logic. + +**Invocation:** Status: appears orphaned at the procedure level — no other proc, gdsmodule binding, or form-master ref calls `Sp_System_ProductionCost_new` directly, and no xly-src script ships it (the only `Sp_System_ProductionCost*` install scripts cover the base name and `…AllSure/AllReSure`). Almost certainly a manual-trigger alternative wired up by a 生产成本 button via `GenericProcedureCallServiceImpl.doGenericProcedureCall()` for customers needing the prorated 期初 model. Candidate for maintainer audit — confirm whether any production tenant still routes to this variant. diff --git a/en/docs/auto-catalog/procedures/Sp_System_ReCostStructure.md b/en/docs/auto-catalog/procedures/Sp_System_ReCostStructure.md index 597b208..e2d2f78 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_ReCostStructure.md +++ b/en/docs/auto-catalog/procedures/Sp_System_ReCostStructure.md @@ -1,7 +1,7 @@ # `Sp_System_ReCostStructure` (procedure) -> @author:杨恒林 - @date:20210616 封存 +> @author:杨恒林 + @date:20210616 封存 @describe: 成本结构发生变化时,需要保存当前的数据到备份表,CotOrderCostAnalysis+时分秒 @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本管理 → 成本结构维护 — snapshot the active cost-analysis table when 成本结构 schema changes. Header comment (@author:杨恒林 @date:20210616 封存): "成本结构发生变化时,需要保存当前的数据到备份表,CotOrderCostAnalysis+时分秒". Production version (paired with the `_new` developer copy); after renaming the table it re-initialises a Jan 2000 placeholder period via `Sp_System_InitCurrentPeriodCost`. + +**What it does:** Hard-codes `p_sDbName='xlyweberp'` and `p_sTableName='cotordercostanalysis'+DATE_FORMAT(NOW(),'%Y%m%d%H%i%s')`. Checks `information_schema.tables` for `cotordercostanalysis`; if present executes `ALTER TABLE CotOrderCostAnalysis rename to ` via PREPARE/EXECUTE. Re-checks and `DROP TABLE cotordercostanalysis` if it still exists. Calls `Sp_System_InitCurrentPeriodCost('2000-01-01','2000-01-01','200001', sMakePerson, sBrId, sSuId, sReturn, sCode)` to seed a fresh empty period, then clears `sReturn`. + +**Invocation:** No `gdsmodule` binding, no form-master, no other-proc, no xly-src match beyond `script/标版/30100101/cost/Sp_System_ReCostStructure.sql` install script — dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from a 成本结构维护 admin button (likely 重置成本结构). The hard-coded `xlyweberp` database name and `封存` tag suggest this is brittle in multi-tenant SaaS; verify before invoking. diff --git a/en/docs/auto-catalog/procedures/Sp_System_ReCostStructure_new.md b/en/docs/auto-catalog/procedures/Sp_System_ReCostStructure_new.md index 4f536d5..af15822 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_ReCostStructure_new.md +++ b/en/docs/auto-catalog/procedures/Sp_System_ReCostStructure_new.md @@ -1,7 +1,7 @@ # `Sp_System_ReCostStructure_new` (procedure) -> @author:杨恒林 - @date:20210616 封存 +> @author:杨恒林 + @date:20210616 封存 @describe: 成本结构发生变化时,需要保存当前的数据到备份表,CotOrderCostAnalysis+时分秒 @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本管理 → 成本结构维护 — snapshot the active cost-analysis table when 成本结构 schema changes. Header comment (@author:杨恒林 @date:20210616 封存) says: when 成本结构 (cost framework) changes, save current data into a timestamped backup table `cotordercostanalysis`. `_new` variant differs from `Sp_System_ReCostStructure` only in checking/renaming `accordercostanalysis` (not the legacy `cotordercostanalysis`) and in skipping the trailing `Sp_System_InitCurrentPeriodCost` re-initialisation call. + +**What it does:** Hard-codes `p_sDbName='xlyweberp'` (one-tenant assumption) and `p_sTableName='cotordercostanalysis'+DATE_FORMAT(NOW(),'%Y%m%d%H%i%s')`. Checks `information_schema.tables` for `accordercostanalysis`; if present, executes a dynamic `ALTER TABLE accordercostanalysis rename to ` via PREPARE/EXECUTE. Then re-checks and `DROP TABLE cotordercostanalysis` if it (still) exists. The post-rename `Sp_System_InitCurrentPeriodCost('2000-01-01',…)` call is commented out — leaves the schema empty. + +**Invocation:** Status: appears orphaned. No `gdsmodule` binding, no form-master, no other-proc, no xly-src match. `_new` suffix and `封存` author tag mark this as a developer staging copy of `Sp_System_ReCostStructure` — likely never deployed (the hard-coded `xlyweberp` database name would fail in multi-tenant SaaS). Candidate for cleanup. diff --git a/en/docs/auto-catalog/procedures/Sp_System_ReProductMoney.md b/en/docs/auto-catalog/procedures/Sp_System_ReProductMoney.md index 8fbfbe4..26c6d79 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_ReProductMoney.md +++ b/en/docs/auto-catalog/procedures/Sp_System_ReProductMoney.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本管理 → 产品存货核算 — un-finalise a 会计期间's product-inventory calc, allowing `Sp_System_ProductMoney` to be re-run. Companion to `Sp_System_ReCostStructure`/`Sp_System_ProductMoney`: clears the `bCalProducts`/`sCalProducts`/`tCalProducts` flags on `sysaccountperiod` so the period drops back to "not yet closed for product inventory". + +**What it does:** Parses `$.params[*].value[*].sId` to a list of period ids, refuses if no row matches in `sysaccountperiod` (sBrId/sSuId-scoped). Reads the period's `sPeriodId` and guards: if any *later* period already has `bCalProducts=1` then this earlier period cannot be reopened ("本会计期间之后有会计期间已核算,本会计期间不能重新核算"). For each selected period sets `sysaccountperiod.bCalProducts=Null, sCalProducts=Null, tCalProducts=Null`. The commented-out check on `accproductstore`+`sVoucherBillNo` shows an earlier rule that blocked reopen when 成本凭证 had already been generated — relaxed in the current version. + +**Invocation:** No `gdsmodule` binding, no form-master, no other-proc, no xly-src match beyond `script/标版/30100101/cost/Sp_System_ReProductMoney.sql` install script — dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from the 产品存货核算 period grid's 重新核算 toolbar button (the reverse of the AllSure→ProductMoney chain). diff --git a/en/docs/auto-catalog/procedures/Sp_System_ReplaceField.md b/en/docs/auto-catalog/procedures/Sp_System_ReplaceField.md index 8cae34d..2ced794 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_ReplaceField.md +++ b/en/docs/auto-catalog/procedures/Sp_System_ReplaceField.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 / 计价 → 公式解析 — formula-language → SQL transpiler (label "公式语言转换成sql"), the engine behind 公式 fields on 工单/排产/计件/报价 rows. Given a formula id and a set of (table, id, tag) triples, substitutes each `#{tag.column}` placeholder in the formula's body with the actual value from the named table+row, then evaluates the resulting SQL. + +**What it does:** Reads `SysSystemSettings` (`CbxLanguage`, `CbxMaterialsUnit`, `CbxMachineUnit`, `NetConversionRate`, `CkxMinColorCalculation`) into a JSON env, loads language-specific constants from `gdsformconst sParentId='100'`, then walks the formula text stored in `eleformula`/`eleformulaslave` keyed by `sFormulaGuid`. For each token in `sAllType` (`billMaster`, `billSlave`, `billControl`, `billMaterial`, `billProcedure`, `baseProcedure`, `baseMaterial`, `baseProduct`, `baseMachine`, `baseCustomer`, `baseSupply`, `baseTax`, `baseSalesMan`, `basePayment`, `billemployee`, `billreportemployee`, `billParam`, etc.) it reads the column from the matching table in `sAllTbName` keyed by the matching id in `sAllGuid` and splices the value into the SQL string. Assembled SQL is run via PREPARE/EXECUTE; numeric result returned in `sReturn`, per-step audit trail in `sDetail`. + +**Invocation:** Called by Java `BtnCalculationServiceImpl` (the `doSetTimeCalcMachineHour` flow that recomputes 机台 `dHour` after a 排产 row is locked) — the Java code builds `p_sAllTbName="mftworkordermaster,MftWorkOrderSlave,MftWorkOrderControl,…,elemachine"`, `p_sAllType="billMaster,billSlave,billControl,…,baseMachine"`, then issues the procedure call. xly-src also ships install scripts at `script/标版/30100101/Sp_System_ReplaceField.sql` and references the name from several `Sp_Check_*` / `Sp_Calc_*` install scripts. Many DB sites embed `Sp_System_ReplaceField` calls inline at the SQL layer. diff --git a/en/docs/auto-catalog/procedures/Sp_System_ReplaceFieldNew.md b/en/docs/auto-catalog/procedures/Sp_System_ReplaceFieldNew.md index bc56758..7b6abd6 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_ReplaceFieldNew.md +++ b/en/docs/auto-catalog/procedures/Sp_System_ReplaceFieldNew.md @@ -29,4 +29,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 / 计价 → 公式解析 — formula-language → SQL transpiler (label "公式语言转换成sql"). `ReplaceFieldNew` (no underscore) is the `20220111公式解析实际详情` upgrade variant of `Sp_System_ReplaceField`: same signature, refactored body that wraps the lookup in a labelled `top:` block so the upper layer can `LEAVE top` cleanly on parameter errors. Note the `sCode` parameter is `IN` here (vs `OUT` on the original) — a signature bug that may explain its limited adoption. + +**What it does:** Same algorithm as `Sp_System_ReplaceField`: reads `SysSystemSettings` (`CbxLanguage`, `CbxMaterialsUnit`, `CbxMachineUnit`, `NetConversionRate`, `CkxMinColorCalculation`) into a JSON env, loads `gdsformconst` constants in the active language, then expands the formula in `eleformula` keyed by `sFormulaGuid` against the (`sAllGuid`, `sAllTbName`, `sAllType`) triple. Builds dynamic SQL by substituting `#{tag.col}` tokens, runs via PREPARE/EXECUTE, returns the numeric result in `sReturn` and trace in `sDetail`. + +**Invocation:** Status: appears orphaned. No `gdsmodule` binding, no form-master, no other-proc match, no xly-src caller beyond `script/标版/upgrade/20220111公式解析实际详情/Sp_System_ReplaceFieldNew.sql` install script. Likely a 2022-Q1 refactor draft that was superseded by `Sp_System_ReplaceField_NEW` (with underscore, from 20220321) and never wired into a live caller. Candidate for cleanup. diff --git a/en/docs/auto-catalog/procedures/Sp_System_ReplaceField_Detail.md b/en/docs/auto-catalog/procedures/Sp_System_ReplaceField_Detail.md index 75dfa05..67a3ad4 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_ReplaceField_Detail.md +++ b/en/docs/auto-catalog/procedures/Sp_System_ReplaceField_Detail.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 排产/产能 — formula-language → SQL transpiler used while computing a 排产 (production-plan) row's 工时 / 调机时间. Member of the `Sp_System_ReplaceField*` family (label "公式语言转换成sql"): each variant binds a different set of context tables (单据主表/从表/工序表/材料表 + 基础产品/材料/工序/机台/客户/供应商). The `_Detail` variant takes an extra `sParentGuid` to scope the formula evaluation to a parent context row — used when the formula resolves against a slave/control/process triple inside a parent 排产明细. + +**What it does:** Reads `SysSystemSettings` (`CbxLanguage`, `CbxMaterialsUnit`, `CbxMachineUnit`, `NetConversionRate`, `CkxMinColorCalculation`) into a JSON envelope, looks up `gdsformconst` constants in the active language, then walks the formula text in `eleformula` (and adjacent `eleformulaslave`/`eleformulaparam` rows) keyed by `sFormulaGuid`, building a SQL expression by substituting tagged tokens (`#{billMaster.col}`, `#{baseProcedure.col}`, etc.) with values pulled from the named table+id pair in `sAllGuid`/`sAllTbName`/`sAllType`. Executes the assembled SQL via PREPARE/EXECUTE, captures the numeric result back into `sReturn` and a human-readable trace into `sDetail`. + +**Invocation:** Called by `Sp_CalcPlan_dHour` (the per-排产-行 hour-calculation proc) twice — once with `p_sProductionReportId` (产能 formula) and once with `p_sAdjustableFormulaId` (调机 formula). `Sp_CalcPlan_dHour` is in turn invoked by the 排产 module's hour-recalc button. No `gdsmodule` binding, no form-master, no xly-src Java caller — DB-layer helper only. diff --git a/en/docs/auto-catalog/procedures/Sp_System_ReplaceField_NEW.md b/en/docs/auto-catalog/procedures/Sp_System_ReplaceField_NEW.md index 27b379d..efb4350 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_ReplaceField_NEW.md +++ b/en/docs/auto-catalog/procedures/Sp_System_ReplaceField_NEW.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 工单/排产 — formula-language → SQL transpiler (label "公式语言转换成sql"). `_NEW` is the upgraded version of `Sp_System_ReplaceField` shipped by `script/标版/upgrade/20220321计算获取公式解析/`: same eight context-table convention (单据主/从/工序/材料/控制 + 基础产品/材料/工序/客户/供应商/机台/税率/销售员/付款), but adds an extra `sSlaveGuid` parameter so the formula can resolve slave-row scope alongside the master. + +**What it does:** Loads `SysSystemSettings` (`CbxLanguage`, `CbxMaterialsUnit`, `CbxMachineUnit`, `NetConversionRate`, `CkxMinColorCalculation`) into a JSON env, reads language-specific labels from `gdsformconst`, then expands the formula stored in `eleformula` keyed by `sFormulaGuid`. For each `#{tableTag.column}` token, looks up the table+id mapping from `sAllGuid`/`sAllTbName`/`sAllType`, reads the column value, substitutes it into the SQL expression. Resulting dynamic SQL is run via PREPARE/EXECUTE; numeric result lands in `sReturn`, per-step trace into `sDetail`. + +**Invocation:** Status: appears orphaned. No `gdsmodule` binding, no form-master, no other-proc match (only `Sp_CalcPlan_dHour` calls the `_Detail` sibling). xly-src has the upgrade install scripts (`upgrade/20220321计算获取公式解析/Sp_System_ReplaceField_NEW.sql` and `30100101/Sp_System_ReplaceField_NEW.sql`) but no caller. Likely the 2022 upgrade defined the new signature but the dispatch sites were never re-wired off the original `Sp_System_ReplaceField`. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_System_ReplaceField_NEW_ACT.md b/en/docs/auto-catalog/procedures/Sp_System_ReplaceField_NEW_ACT.md index 1f7d105..9357b9e 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_ReplaceField_NEW_ACT.md +++ b/en/docs/auto-catalog/procedures/Sp_System_ReplaceField_NEW_ACT.md @@ -30,4 +30,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 工单/排产 — formula-language → SQL transpiler (label "公式语言转换成sql"). `_NEW_ACT` is the actual-cost (`ACT` = 实际) variant inside the 公式解析 family: same engine as `Sp_System_ReplaceField_NEW` but resolves formulas against the *posted* (实际) values in `mftworkorderprocess*`/`mftworkordermaterials*` rather than the planned snapshot. Originated in the `20220321计算获取公式解析` upgrade. + +**What it does:** Loads `SysSystemSettings` (`CbxLanguage`, `CbxMaterialsUnit`, `CbxMachineUnit`, `NetConversionRate`, `CkxMinColorCalculation`) as JSON, joins language-specific labels from `gdsformconst`, then expands the formula in `eleformula` keyed by `sFormulaGuid` against the table+id pairs supplied in `sAllGuid`/`sAllTbName`/`sAllType` (plus the slave-scope `sSlaveGuid`). Substitutes each `#{tableTag.col}` placeholder by reading from the named real table, assembles dynamic SQL, executes via PREPARE/EXECUTE, and returns the numeric result in `sReturn` with a per-step trace in `sDetail`. + +**Invocation:** Status: appears orphaned. No `gdsmodule` binding, no form-master, no other-proc match in `information_schema.ROUTINES`, no xly-src caller beyond install/upgrade scripts (`script/标版/upgrade/20220321计算获取公式解析/`). Likely a staging variant of `Sp_System_ReplaceField_NEW` from the same upgrade batch — not yet wired into the active 排产 / 计件 flows. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_System_ReplyCheckMsg.md b/en/docs/auto-catalog/procedures/Sp_System_ReplyCheckMsg.md index e78f680..c9024a1 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_ReplyCheckMsg.md +++ b/en/docs/auto-catalog/procedures/Sp_System_ReplyCheckMsg.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 系统 → 审核流 (approval workflow) — handler for an approver replying to a 审核留言 (review-message) on any 业务单据 sent through the workflow engine. Writes the approver's decision (同意/不批准) into `sysbillcheckresult`, marks the inbox message read in `sysmsguser`, and advances the workflow stage when the current phase has gathered enough approvers. + +**What it does:** Resolves the logged-in user via `Fun_GetLoginUser`, flags `sysmsguser.bIsView=1` for this message. Reads `sysmsg` for `sMakePerson`/`sCheckModelId`/title/content; if the message no longer exists returns "单据送审流程已结束,无需操作,请忽略". Locates the current `sCheckPhaseId` in `sysbillcheckresult` ordered by `elecheckmodelphase.iOrder`. Branches on `iReply`: when `0` (不批准) it writes `sResult=0, sReplyContent=sReply`, sets all related `sysmsguser.bReply=1`, and stops the flow; when `1` (同意当前阶段) or `2` (同意通过) it tallies how many approvers have signed against the phase's `dNeedPeople` quorum and, if quorum is met, either advances to the next `sysbillcheckphase` (creating new `sysmsg`+`sysmsguser` rows for the next-phase reviewers) or finalises the bill (updates the source `sBillTableName` `bCheck=1, sCheckPerson, tCheckDate`). All updates wrapped in defensive `IFNULL` and constant-lookup error messages via `Sp_Sis_GetConst`. + +**Invocation:** Status: appears orphaned. No `gdsmodule` binding, no form-master, no other-proc match, no xly-src Java caller, no xly-src match beyond `script/标版/30100101/Sp_System_ReplyCheckMsg.sql` install script. Given the parameter shape (`sMsgGuid`, `sBillGuid`, `iReply`, `sReply`, `sLoginId`) it's clearly the back-end of the 待办审核 reply action — but the dispatch may be hidden behind a non-grep-able indirection (e.g. a `sName`-keyed lookup table). Candidate for maintainer audit of the message-centre service. diff --git a/en/docs/auto-catalog/procedures/Sp_System_SaveReport.md b/en/docs/auto-catalog/procedures/Sp_System_SaveReport.md index 56e69b4..14796ed 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_SaveReport.md +++ b/en/docs/auto-catalog/procedures/Sp_System_SaveReport.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 系统 → 业务单据保存校验 (header comment: "本期间已结账不允许保存"). A POST-save guard: when a user saves any bill whose `tCreateDate` falls in a 会计期间 that has been frozen (`sysaccountperiod.bFrozen=1`), the save is rejected. Acts as the default 期间已结账 check; modules with finer rules layer their own checks on top. + +**What it does:** Reads `SysSystemSettings('CkxfirstInspection')` (unused after read — looks like a partial port). Pulls the master `sTbName` for the given `sFormGuid` from `gdsconfigformmaster sparentid=sFormGuid` (the first slave entry, `ORDER BY iincrement LIMIT 1`). Builds dynamic SQL `SELECT count(A.sPeriodID) FROM sysaccountperiod a WHERE bFrozen=1 AND sPeriodID = (SELECT date_format(tCreateDate,'%Y%m') FROM WHERE sId='')` via PREPARE/EXECUTE. If the count is 1 (i.e. the bill's create-month is closed) sets `sCode=-1, sReturn='本月已结账,不允许保存本月内单据!'` and `LEAVE top`. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName`/`sSaveProNameBefore` binding (despite the name pattern suggesting `Sp_System_SaveReport` would be the universal pre-save hook), no form-master, no other-proc, no xly-src caller. Either dispatched via a string-keyed lookup invisible to grep, or — more likely — never wired in. The variable name typo `p_TableName` initialised once with the *first* slave's table, not the master table, suggests this proc was prototyped but not deployed. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_System_UpdateWorkCl.md b/en/docs/auto-catalog/procedures/Sp_System_UpdateWorkCl.md index 214f200..01b5cc3 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_UpdateWorkCl.md +++ b/en/docs/auto-catalog/procedures/Sp_System_UpdateWorkCl.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 制造 → 工单 (生产工单) — POST-save validation+materialisation hook (header comment: "业务单据保存校验") used when saving a 工单主表 (`mftworkordermaster`) row. Refuses saves with missing component/product picks or stopped materials, then snapshots inserted/changed materials into the inventory-detail backing table `EleMaterialsStock`. + +**What it does:** Only fires for `sTableName='mftworkordermaster'`. Stamps `mftworkordermaster.sSaveName=sLoginId, tSaveDate=NOW()`; backfills `sAddPerson/tAddDate` on new `mftworkordermaterials` rows (where `sAddPerson=''` and `bSource=1`). Then runs four guards: (1) any non-type-2 row with empty `sControlId` → "未选择部件信息" (sNoComponentSelect); (2) any type-2 row with empty `sCombinePartsName` → "未选择成品信息" (sNoProductSelect); (3) any material whose `elematerials.bInvalid=1` → "物料为停用物料,请用其他料替换" (sMaterialInactive) with `sCode=-8`; (4) any duplicate (materialsId, style) pair where both `bSource=1` and `bSource=0` exist → "物料已存在工单中,禁止核算新增" (sMaterialHaveWorkOrder). Last guard runs the same dedup against type-2 (combined) rows joined through `mftworkorderslave`/`eleproduct`. On success inserts the work-order's materials into `EleMaterialsStock` (qty/unit/warehouse/location seed) for downstream inventory ops. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName`/`sSaveProNameBefore` binding, no form-master, no other-proc, no xly-src match. Given the signature shape (`sFormGuid,sGuid,sTableName,sLoginId,sReturn,sBrId,sSuId,sCode` — the standard `sSaveProName` slot) and the work-order-master-only branch, this is clearly the save-validator for the 工单 form. Dispatch must be via a route table not visible to grep. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_System_UpdateWorkProcessMemo.md b/en/docs/auto-catalog/procedures/Sp_System_UpdateWorkProcessMemo.md index e59a4e1..4a7e65f 100644 --- a/en/docs/auto-catalog/procedures/Sp_System_UpdateWorkProcessMemo.md +++ b/en/docs/auto-catalog/procedures/Sp_System_UpdateWorkProcessMemo.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 制造 → 工单 (生产工单) — narrow save-side hook (header comment: "业务单据保存校验") that propagates the 工序备注 (process remark) from the 工单工序 master rows into the per-排产 slave plan rows. Ensures `mftproductionplanslave` displays the same `sProcessMemo` the planner typed against `mftworkorderprocess`. + +**What it does:** Single statement: `UPDATE mftproductionplanslave A INNER JOIN mftworkorderprocess B ON A.sWorkOrderProcessTbId=B.sId SET A.sProcessMemo=B.sProcessMemo WHERE B.sParentId=sGuId`. No other reads or writes, no parameter handling, no error path. + +**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName`/`sSaveProNameBefore` binding, no form-master, no other-proc, no xly-src match. The signature shape (`sFormGuid,sGuid,sTableName,sLoginId,sReturn,sBrId,sSuId,sCode`) is the standard sSaveProName slot — likely the save-side hook on the 工单/排产 form's "复制工序备注到排产" toolbar action or a pre-save hook for the 工单 master. Dispatch must be via a string-keyed lookup invisible to grep. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Task_GrossProfitSmallai.md b/en/docs/auto-catalog/procedures/Sp_Task_GrossProfitSmallai.md index 28dfb33..aac65a0 100644 --- a/en/docs/auto-catalog/procedures/Sp_Task_GrossProfitSmallai.md +++ b/en/docs/auto-catalog/procedures/Sp_Task_GrossProfitSmallai.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 小ai保驾护航 — scheduled push of the daily 毛利分析 (gross-margin) digest. Member of the `Sp_Task_*` quartz-scheduled message family. + +**What it does:** Defaults `sBrId/sSuId/sCode`, sets `title='今日毛利…'`, queries `Viw_MftWorkOrder` join `elecustomer` + `eleproduct` (filtered to `bCheck=1` and today's `tCreateDate`) to total `dProductMoney` / `dAllMoney` / `dSaleProfit` plus the cost breakdown (`dMasterMaterialsMoney`, `dAuxiliaryMaterialsMoney`, `dPrintBeforeMoney`, `dPrintMoney`, `dPrintAfterMoney + dPrintProductMoney`). Builds one card-list row per 工单 in the shared `Sp_Task_doTestMsg` temp table for the message template to render. + +**Invocation:** Dispatched by the Quartz scheduler — `QuartzTask` (xlyFlow) calls `TaskServiceImpl.doProOne()` which executes the procedure named in the scheduler-job config, then `sendMsgDoNew(...)` pipes the OUT params + result set to the configured `sMestemplateId`. Install script `script/标版/30100101/Sp_Task_GrossProfitSmallai.sql`; no `gdsmodule`/form-master binding. diff --git a/en/docs/auto-catalog/procedures/Sp_Task_NetProfitSmallai.md b/en/docs/auto-catalog/procedures/Sp_Task_NetProfitSmallai.md index f24412a..3e2317c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Task_NetProfitSmallai.md +++ b/en/docs/auto-catalog/procedures/Sp_Task_NetProfitSmallai.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 小ai保驾护航 — scheduled push of the 企业净利分析报告 (enterprise net-profit digest). Member of the `Sp_Task_*` quartz-scheduled message family. Companion to `Sp_Task_PrintWorkshop3` which reuses the same body for a different scheduler slot. + +**What it does:** Defaults `sBrId/sSuId/sCode`, sets `title='企业净利分析报告'`, reads `viw_corebusinessreport` for confirmed periods (`exists` on `accproductstore` where `sFormId='11811781131121915184849572550'` and `bConfirm=1`). Composes one row per `sConfirmMonth` with 利润总额, 主营业务收入, 主营外收入, 其他收益或损失, 制程/管理/销售/财务/研发 费用, 营业外支出, 税金及附加 — pushed into the shared `Sp_Task_doTestMsg` temp table for the message template. + +**Invocation:** Dispatched by the Quartz scheduler — `QuartzTask` (xlyFlow) calls `TaskServiceImpl.doProOne()` which executes the procedure named in the scheduler-job config; `sendMsgDoNew(...)` then renders via the configured `sMestemplateId`. Install script `script/标版/30100101/Sp_Task_NetProfitSmallai.sql`; no `gdsmodule`/form-master binding. diff --git a/en/docs/auto-catalog/procedures/Sp_Task_PrintWorkshop1.md b/en/docs/auto-catalog/procedures/Sp_Task_PrintWorkshop1.md index 77ae773..185dc76 100644 --- a/en/docs/auto-catalog/procedures/Sp_Task_PrintWorkshop1.md +++ b/en/docs/auto-catalog/procedures/Sp_Task_PrintWorkshop1.md @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 小ai任务自动派送 — scheduled push of the 印刷车间员工生产日报 (print-workshop daily production digest, by-employee angle). Member of the `Sp_Task_*` quartz-scheduled message family; the extra `sUrl` OUT param links to the 印刷车间分析 BI bigscreen. + +**What it does:** Defaults `sBrId/sSuId/sCode`, sets `title='印刷车间员工生产日报'` and `sUrl` to the YSCJFX BI report URL. Computes yesterday's 07:30-to-today 07:30 shift window into `p_tStartDate/p_tEndDate`, builds `Tmp_Report` keyed by machine+team with 印版付数 (`dPlateQty`), 实际产量 (`dProcessQty`), 单付产出 (`dOutQty`), 单付小时产出 (`dOutHourQty`), 工单数, 开机/异常 小时 and 异常占比. Emits the rows through `Sp_Task_doTestMsg` for the template; resolves the recipient list dynamically via `sftlogininfo` `sUserName IN ('杨恒林','曹建英')` (note: hard-coded; this is the demo/客户-deploy seed). + +**Invocation:** Dispatched by the Quartz scheduler — `QuartzTask`/`TaskServiceImpl.doProOne()` runs whichever `Sp_Task_*` the scheduler-job config names. Recipients are computed in-procedure into `sUserList`, then `sendMsgDoNew(...)` renders via the configured `sMestemplateId`. No `gdsmodule`/form-master binding; not in xly-src 30100101 install scripts — DB-only / introduced by upgrade scripts. diff --git a/en/docs/auto-catalog/procedures/Sp_Task_PrintWorkshop2.md b/en/docs/auto-catalog/procedures/Sp_Task_PrintWorkshop2.md index 82d79ce..b4759b6 100644 --- a/en/docs/auto-catalog/procedures/Sp_Task_PrintWorkshop2.md +++ b/en/docs/auto-catalog/procedures/Sp_Task_PrintWorkshop2.md @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 小ai任务自动派送 — scheduled push of the 印刷车间异常汇报 (print-workshop machine-anomaly digest). Member of the `Sp_Task_*` quartz-scheduled message family; pairs with `Sp_Task_PrintWorkshop1` (production angle) and `Sp_Task_PrintWorkshop3` (net-profit reuse). + +**What it does:** Defaults `sBrId/sSuId/sCode`, sets `title='印刷车间异常汇报'` and `sUrl` to the YSCJFX BI bigscreen. Spans yesterday-07:30 → today-07:30, inserts into `Tmp_Report` every distinct (`sMachineId`, `sMachineStateName`) seen in `mftproducereportmachinestate` joined to `mftproductionreportslave/master`, and aggregates per state: `iCount` (异常次数) and `dErrorHour` (异常时间小时). Renders one row per machine+status into `Sp_Task_doTestMsg`; `cardTitle` summarises 合计时间 / 异常次数. Resolves recipients from `sftlogininfo` where `sUserName IN ('杨恒林','曹建英')`. + +**Invocation:** Dispatched by the Quartz scheduler — `QuartzTask`/`TaskServiceImpl.doProOne()` runs whichever `Sp_Task_*` the scheduler-job config names; in-procedure-computed `sUserList` drives recipients; `sendMsgDoNew(...)` renders via the configured `sMestemplateId`. No `gdsmodule`/form-master binding; not in xly-src 30100101 install scripts — DB-only / introduced via upgrade scripts. diff --git a/en/docs/auto-catalog/procedures/Sp_Task_PrintWorkshop3.md b/en/docs/auto-catalog/procedures/Sp_Task_PrintWorkshop3.md index 1bea0bd..8367931 100644 --- a/en/docs/auto-catalog/procedures/Sp_Task_PrintWorkshop3.md +++ b/en/docs/auto-catalog/procedures/Sp_Task_PrintWorkshop3.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 小ai保驾护航 — scheduled push of the 企业净利分析报告 (net-profit digest). Member of the `Sp_Task_*` quartz-scheduled message family. Body is essentially identical to `Sp_Task_NetProfitSmallai` (same `viw_corebusinessreport` aggregation) — the `PrintWorkshop3` name appears to be a misnamed/re-slotted copy used as a third workshop scheduler job; review for de-duplication. + +**What it does:** Defaults `sBrId/sSuId/sCode`, sets `title='企业净利分析报告'`, reads `viw_corebusinessreport` for confirmed periods via `accproductstore.sFormId='11811781131121915184849572550' and bConfirm=1`. Composes one row per `sConfirmMonth` with 利润总额, 主营业务收入, 主营外收入, 其他收益或损失, 制程/管理/销售/财务/研发 费用, 营业外支出, 税金及附加 — pushed into `Sp_Task_doTestMsg` for the message template. + +**Invocation:** Dispatched by the Quartz scheduler — `QuartzTask`/`TaskServiceImpl.doProOne()` runs whichever `Sp_Task_*` the scheduler-job config names; `sendMsgDoNew(...)` renders via the configured `sMestemplateId`. No `gdsmodule`/form-master binding; not in xly-src 30100101 install scripts — DB-only. diff --git a/en/docs/auto-catalog/procedures/Sp_Task_ProductStockKeepLongSmallai.md b/en/docs/auto-catalog/procedures/Sp_Task_ProductStockKeepLongSmallai.md index 3e947cc..2ddfe83 100644 --- a/en/docs/auto-catalog/procedures/Sp_Task_ProductStockKeepLongSmallai.md +++ b/en/docs/auto-catalog/procedures/Sp_Task_ProductStockKeepLongSmallai.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 小ai保驾护航 — scheduled push of the 产品呆滞库存 (finished-goods stagnant-stock) digest. Member of the `Sp_Task_*` quartz-scheduled message family; pairs with `Sp_Task_StockKeepLongSmallai` (materials side). + +**What it does:** Defaults `sBrId/sSuId/sCode`, sets the digest title for 产品呆滞库存超期天数, then aggregates from `eleproductstock A` join `eleproduct B`, left-join `elecustomer d`, left-join the per-product max-storage-date subquery on `pitproductstore` filtered to `sFormId='192116810113315228246447250'`. Keeps rows where `dProductQty > 0` and `TIMESTAMPDIFF(DAY, c.tCreateDate, now()) > 30`. Builds the card-rows into `Sp_Task_doTestMsg` (库存数量/销售单价/积压金额/呆滞天数 by 客户+产品名). + +**Invocation:** Dispatched by the Quartz scheduler — `QuartzTask` (xlyFlow) calls `TaskServiceImpl.doProOne()` which executes the procedure named in the scheduler-job config; `sendMsgDoNew(...)` renders via the configured `sMestemplateId`. Install script `script/标版/30100101/Sp_Task_ProductStockKeepLongSmallai.sql`; no `gdsmodule`/form-master binding. diff --git a/en/docs/auto-catalog/procedures/Sp_Task_Send_Elecustomer_Birthday.md b/en/docs/auto-catalog/procedures/Sp_Task_Send_Elecustomer_Birthday.md index 0a4f285..a08e75c 100644 --- a/en/docs/auto-catalog/procedures/Sp_Task_Send_Elecustomer_Birthday.md +++ b/en/docs/auto-catalog/procedures/Sp_Task_Send_Elecustomer_Birthday.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 小ai保驾护航 — scheduled push of customer-contact birthday reminders. Member of the `Sp_Task_*` quartz-scheduled message family; mirror of `Sp_Task_Send_Eleemployee_Birthday` (employee side). + +**What it does:** Defaults `sBrId/sSuId/sCode`, declares `p_tBirthday=NOW()` (advance-day shift commented out) and a static card-background `sPicPath`. Drops/creates temp table `Sp_Task_SendBirthday` with `(sUserId, sUserName, tBirthday, sPicPath, title)`, then `INSERT … SELECT` from `elecustomercontacts` where `DATE_FORMAT(tBirthday,'%Y-%m-%d')=DATE_FORMAT(NOW(),'%Y-%m-%d')`. Emits the temp table, builds `sUserList=["sId1","sId2",…]` (JSON-string of contact ids) for downstream dynamic recipients. + +**Invocation:** Dispatched by the Quartz scheduler — `QuartzTask`/`TaskServiceImpl.doProOne()` runs the procedure named in the scheduler-job config; `sendMsgDoNew(...)` consumes the OUT `sUserList` to resolve recipients via `viw_msguser` (微信/邮件/登录ID) and renders via the configured `sMestemplateId`. No `gdsmodule`/form-master binding; not in xly-src 30100101 install scripts — DB-only. diff --git a/en/docs/auto-catalog/procedures/Sp_Task_Send_Eleemployee_Birthday.md b/en/docs/auto-catalog/procedures/Sp_Task_Send_Eleemployee_Birthday.md index 0c2f91d..0bce141 100644 --- a/en/docs/auto-catalog/procedures/Sp_Task_Send_Eleemployee_Birthday.md +++ b/en/docs/auto-catalog/procedures/Sp_Task_Send_Eleemployee_Birthday.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 小ai保驾护航 — scheduled push of employee birthday reminders. Member of the `Sp_Task_*` quartz-scheduled message family; mirror of `Sp_Task_Send_Elecustomer_Birthday` (customer-contact side). + +**What it does:** Defaults `sBrId/sSuId/sCode`, declares `p_tBirthday=NOW()` and a static card-background `sPicPath`. Drops/creates temp table `Sp_Task_SendBirthday` with `(sUserId, sUserName, tBirthday, sPicPath, title, sAbstract)`, then `INSERT … SELECT` from `eleemployee E` join `sftlogininfo U on U.sEmployeeId=E.sId` where today matches `E.tBirthday`. Emits the temp table and packs the matching `sftlogininfo.sId` list as `sUserList=["…","…"]` for the dispatcher. + +**Invocation:** Dispatched by the Quartz scheduler — `QuartzTask`/`TaskServiceImpl.doProOne()` runs the procedure named in the scheduler-job config; `sendMsgDoNew(...)` consumes `sUserList` (resolved through `viw_msguser` for 微信/邮件/登录ID) and renders via the configured `sMestemplateId`. No `gdsmodule`/form-master binding; not in xly-src 30100101 install scripts — DB-only. diff --git a/en/docs/auto-catalog/procedures/Sp_Task_StockKeepLongSmallai.md b/en/docs/auto-catalog/procedures/Sp_Task_StockKeepLongSmallai.md index 6aa4823..0f12ca3 100644 --- a/en/docs/auto-catalog/procedures/Sp_Task_StockKeepLongSmallai.md +++ b/en/docs/auto-catalog/procedures/Sp_Task_StockKeepLongSmallai.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 小ai保驾护航 — scheduled push of the 材料呆滞库存 (raw-materials stagnant-stock) digest. Member of the `Sp_Task_*` quartz-scheduled message family; pairs with `Sp_Task_ProductStockKeepLongSmallai` (finished-goods side). + +**What it does:** Defaults `sBrId/sSuId/sCode`, sets the materials-aging title, aggregates from `elematerialsstock A` join `elematerials B`, left-join the per-material max-storage-date subquery on `mitmaterialsstore` filtered to `sFormId='192116810113315220315711060'` (joining on `sMaterialsId, sMaterialsStyle, sDefineNo, sDefineNo2, sWarehouseId, sLocationId, sWarehouseLocationId`). Keeps rows where `dMaterialsMoney > 0`, builds the card-rows into `Sp_Task_doTestMsg` (库存金额/库存数量/计价数量/全月加权单价/呆滞天数) ordered by `dMaterialsMoney DESC`. + +**Invocation:** Dispatched by the Quartz scheduler — `QuartzTask`/`TaskServiceImpl.doProOne()` runs the procedure named in the scheduler-job config; `sendMsgDoNew(...)` renders via the configured `sMestemplateId`. Install script `script/标版/30100101/Sp_Task_StockKeepLongSmallai.sql`; no `gdsmodule`/form-master binding. diff --git a/en/docs/auto-catalog/procedures/Sp_Task_TodayMoneySmallai.md b/en/docs/auto-catalog/procedures/Sp_Task_TodayMoneySmallai.md index 16150a1..73c9cc0 100644 --- a/en/docs/auto-catalog/procedures/Sp_Task_TodayMoneySmallai.md +++ b/en/docs/auto-catalog/procedures/Sp_Task_TodayMoneySmallai.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 小ai保驾护航 — scheduled push of the 今日货币资金 (today's cash-on-hand) digest. Member of the `Sp_Task_*` quartz-scheduled message family. + +**What it does:** Defaults `sBrId/sSuId/sCode`, sets the cash-position title, then `CALL Sp_Cashier_SumJournalTodayMoney` to load the `Cash` working set (`sBankName`, `dBalanceMoney`, `dInMoney`, `dOutMoney`). Composes `cardTitle` ("截至今天货币资金合计…万元"), inserts per-account rows into `Sp_Task_doTestMsg` (帐户余额 / 今日入账 / 今日支出 with conditional `color: #00ff21` for non-zero values). + +**Invocation:** Dispatched by the Quartz scheduler — `QuartzTask` (xlyFlow) calls `TaskServiceImpl.doProOne()` with the scheduler-job config's `sProcedureName`; `sendMsgDoNew(...)` renders via the configured `sMestemplateId`. Install script `script/标版/30100101/Sp_Task_TodayMoneySmallai.sql`; no `gdsmodule`/form-master binding. diff --git a/en/docs/auto-catalog/procedures/Sp_Task_TodayWorkRateProgressSmallai.md b/en/docs/auto-catalog/procedures/Sp_Task_TodayWorkRateProgressSmallai.md index 1f5771d..0a45ebd 100644 --- a/en/docs/auto-catalog/procedures/Sp_Task_TodayWorkRateProgressSmallai.md +++ b/en/docs/auto-catalog/procedures/Sp_Task_TodayWorkRateProgressSmallai.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 小ai保驾护航 — scheduled push of the 各部门当日工作执行情况 (per-department daily KPI-backlog digest). Member of the `Sp_Task_*` quartz-scheduled message family. + +**What it does:** Defaults `sBrId/sSuId/sCode`, sets `title='各部门当日工作执行情况'`. Reads `kpimodule` for `Sum(sToDayNum)` (today未处理) and `Sum(sTobeDone)` (未清总数), composes `cardTitle` ("截止今日有 X 件事未处理,未清总数:Y"). Then joins `kpimodule A` to `gdsmodule B` on `A.sModelId=B.sId`, groups by `sChineseDepart`, inserts per-department rows into `Sp_Task_doTestMsg`. + +**Invocation:** Dispatched by the Quartz scheduler — `QuartzTask`/`TaskServiceImpl.doProOne()` runs the procedure named in the scheduler-job config; `sendMsgDoNew(...)` renders via the configured `sMestemplateId`. Install script `script/标版/30100101/Sp_Task_TodayWorkRateProgressSmallai.sql`; no `gdsmodule`/form-master binding. diff --git a/en/docs/auto-catalog/procedures/Sp_Task_doAgingSmallai.md b/en/docs/auto-catalog/procedures/Sp_Task_doAgingSmallai.md index f5a433f..721efc4 100644 --- a/en/docs/auto-catalog/procedures/Sp_Task_doAgingSmallai.md +++ b/en/docs/auto-catalog/procedures/Sp_Task_doAgingSmallai.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 小ai保驾护航 — scheduled push of the 超期应收帐款 (overdue-receivables) digest. Member of the `Sp_Task_*` family: each routine produces a card-title summary plus a `Sp_Task_doTestMsg` temp-table data set keyed for use in a configured message template (微信/邮件/站内信). + +**What it does:** Defaults `sBrId/sSuId/sCode`, sets `title='应收帐款超期未收分析报告'`, then `CALL Sp_Receivables_AgingSmallai` to load `TmpAll` with overdue buckets (`dDueThisBalanceMoney`, `dDueSalesMoney/60/90/120/150`). Aggregates total overdue and customer count, formats `cardTitle` ("截至今天…位客户超期应收…万元"), builds the per-customer rows by joining `TmpAll` to `elecustomer`, and emits them through the `Sp_Task_doTestMsg` temp table so the message template can render an item list. + +**Invocation:** Dispatched by the Quartz scheduler — `QuartzTask` (xlyFlow) calls `TaskServiceImpl.doProOne()` which executes the procedure named in the scheduler-job config (`Procedure.sProcedureName='Sp_Task_doAgingSmallai'`), then `sendMsgDoNew(...)` pipes the OUT params plus the result set to the message template referenced by `sMestemplateId`. Install script `script/标版/30100101/Sp_Task_doAgingSmallai.sql`; no `gdsmodule`/form-master binding. diff --git a/en/docs/auto-catalog/procedures/Sp_Task_doSalesPlanImplementationMsg.md b/en/docs/auto-catalog/procedures/Sp_Task_doSalesPlanImplementationMsg.md index 11d45ba..2f35ca7 100644 --- a/en/docs/auto-catalog/procedures/Sp_Task_doSalesPlanImplementationMsg.md +++ b/en/docs/auto-catalog/procedures/Sp_Task_doSalesPlanImplementationMsg.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 小ai保驾护航 — scheduled push of the 销售任务达标分析报告 (sales-target attainment digest). Member of the `Sp_Task_*` quartz-scheduled message family; companion to `Sp_Task_doTestMsg` (same skeleton, sales-plan-specific aggregation). + +**What it does:** Defaults `sBrId/sSuId/sCode`, sets `title='销售任务达标分析报告'`, runs a long sequence of `Select Sum(A.dProductMoney)/10000 Into p_dProduct*` queries from `viw_salsalesorder` join `sissalesman` + `elecustomer` to break the day / week / month / year sales by 新/老客户 (`sCustomerProperty`). Builds the day-vs-target ratio plus per-bucket card items in the `Sp_Task_doTestMsg` temp table for the message template to render. + +**Invocation:** Dispatched by the Quartz scheduler — `QuartzTask` (xlyFlow) calls `TaskServiceImpl.doProOne()` which executes the procedure named in the scheduler-job config, then `sendMsgDoNew(...)` pipes the OUT params + result set to the configured `sMestemplateId`. Install script `script/标版/30100101/Sp_Task_doSalesPlanImplementationMsg.sql`; no `gdsmodule`/form-master binding. diff --git a/en/docs/auto-catalog/procedures/Sp_Task_doTest.md b/en/docs/auto-catalog/procedures/Sp_Task_doTest.md index a2251e8..018550f 100644 --- a/en/docs/auto-catalog/procedures/Sp_Task_doTest.md +++ b/en/docs/auto-catalog/procedures/Sp_Task_doTest.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Diagnostic / smoke-test procedure (COMMENT `'定时过程执行'`). Acts as the canonical reference implementation for the `Sp_Task_*` quartz-job family — `QuartzTask` hardcodes it as the dev fixture (`procedure.setsProcedureName("Sp_Task_doTest")`). + +**What it does:** Inserts one row into table `test` with `(NewId(), sBrId, sSuId, '测试插入数据')`. Confirms scheduler→procedure plumbing without business side-effects. + +**Invocation:** Reachable through `TaskServiceImpl.doProOne()` whenever a scheduled job names `Sp_Task_doTest` as `sProcedureName`. Wired directly into `QuartzTask` as the test fixture. Not bound to any `gdsmodule`/form-master entry. diff --git a/en/docs/auto-catalog/procedures/Sp_Task_doTestMsg.md b/en/docs/auto-catalog/procedures/Sp_Task_doTestMsg.md index f40060a..1a4c258 100644 --- a/en/docs/auto-catalog/procedures/Sp_Task_doTestMsg.md +++ b/en/docs/auto-catalog/procedures/Sp_Task_doTestMsg.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售业绩统计报表 — scheduled daily-sales-performance digest. Template/reference implementation for the `Sp_Task_*` message family: the temp table name `Sp_Task_doTestMsg` is reused by every sibling procedure as the data-set table that the message template renders. + +**What it does:** Defaults `sBrId/sSuId/sCode`, sets `title='销售业绩统计报表'`, then runs a long block of `Select Sum(dProductMoney)/10000 Into p_d*` queries from `viw_salsalesorder` joined to `sissalesman` and `elecustomer` to compute today's, this-week's (four week buckets), this-month's, and YTD sales totals split by 新/老 `sCustomerProperty`. Composes `cardTitle`, `itemMemo`, `cardDate`, and per-bucket rows into `Sp_Task_doTestMsg` for the message template to render. Returns the temp table plus optional `sUserList`/`sUserData` for ad-hoc dynamic recipients (see the leading `--` documentation block). + +**Invocation:** Dispatched by the Quartz scheduler — `QuartzTask` (xlyFlow) calls `TaskServiceImpl.doProOne()` which executes the procedure named in the scheduler-job config; `sendMsgDoNew(...)` then pipes the OUT params and result set into the message template referenced by `sMestemplateId`. No `gdsmodule`/form-master binding; bootstrapped by the `script/标版/upgrade/更新WAR脚本/20230210_消息、工作流、定时 模块` upgrade. diff --git a/en/docs/auto-catalog/procedures/Sp_UnConfirm_Zg.md b/en/docs/auto-catalog/procedures/Sp_UnConfirm_Zg.md index f94222c..21b3962 100644 --- a/en/docs/auto-catalog/procedures/Sp_UnConfirm_Zg.md +++ b/en/docs/auto-catalog/procedures/Sp_UnConfirm_Zg.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售订单跟进 — 主管确认:不通过 button (despite the COMMENT saying "通过"). Used when a 主管 (supervisor) rejects a salesperson's 跟进完成 declaration on a 销售订单 slave row: clears the per-line "follow-up confirmed" flag and pushes a `sysmsg` back to the order's 制单人 explaining the rejection. + +**What it does:** Validates `sProInParam`, parses `$.params[0].value[i].sSlaveId` JSON, and for each id: looks up the matching `salsalesorderslave` → `salsalesordermaster`, finds the original `sMakePerson`'s login id via `Fun_GetLoginUser(...)`, inserts a row into `sysmsg` (title "跟进完成发送通知", content "…跟进完成主管确认不通过", `sFormId='101251240115016285600841620'`) and a corresponding `sysmsguser` row addressed to that user, then `update salsalesorderslave set iConfirmPersonSate=1 where sId=p_sId`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (the POST `/procedureCall/doGenericProcedureCall` channel) — bound to the 主管确认:不通过 toolbar button on the 销售订单跟进 grid. Install script `script/标版/30100101/Sp_UnConfirm_Zg.sql`. The COMMENT label is misleading (says 通过, body messages "不通过") — flag for review. diff --git a/en/docs/auto-catalog/procedures/Sp_UndeliverIsRelated.md b/en/docs/auto-catalog/procedures/Sp_UndeliverIsRelated.md index 0898c15..02e3ab8 100644 --- a/en/docs/auto-catalog/procedures/Sp_UndeliverIsRelated.md +++ b/en/docs/auto-catalog/procedures/Sp_UndeliverIsRelated.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 送货单 — undo the "relate to upstream" flag on `saldelivergoodsslavechildren` rows so a 送货单 children-line can be re-linked or re-sourced. Used when finance/storage needs to detach a delivery-line's relationship to its source (e.g., 销售订单 slave) without deleting it. + +**What it does:** Validates `sProInParam`, parses `$.params[0].value[i].sSlaveId` JSON; for each non-empty id runs `update saldelivergoodsslavechildren set bRelated = 0 where sId = p_sId`. Nothing else — no audit log, no message, no cascade. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — bound to a toolbar button on the 送货单 children-detail grid (action name `Sp_UndeliverIsRelated`). The proc COMMENT ('主管确认:通过') is copy-pasted from `Sp_UnConfirm_Zg` and unrelated to behaviour — flag for review. Install script `script/标版/30100101/Sp_UndeliverIsRelated.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_UpdateAdd_Check.md b/en/docs/auto-catalog/procedures/Sp_UpdateAdd_Check.md index b39708d..9f133a5 100644 --- a/en/docs/auto-catalog/procedures/Sp_UpdateAdd_Check.md +++ b/en/docs/auto-catalog/procedures/Sp_UpdateAdd_Check.md @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Cross-cutting save/delete guard (修改,删除校验) — invoked from the BACK before a record is updated or deleted to verify the operation is allowed: master/slave table resolution, row-existence, audit-state, lock-table conflicts, special form exclusions. Returns `sCode<0` to halt the caller's transaction with `sReturn` as the user-facing reason. + +**What it does:** Short-circuits when `sTableName` starts with `gds` (backend tables), is `accexpenseentryworkcenterslave`, `mftproductionplanbillslave`, or `sFormGuid` is one of two whitelist forms (`192116811124916399633266060`, `1691254111217047895126140`). For `sysmsg` it marks `sysmsguser.bIsView=1` for the current user. Otherwise calls `Sp_GetMasterSlave(sTableName, …)` to resolve master/slave names and the delete-key column, then runs the per-row check loop — guards include audit (`bCheck=1`), maker-only edits, child existence, and lock-table entries. + +**Invocation:** Two Java callers (real). `BusinessCheckServiceImpl.checkUpdateDel(...)` packages the params into `searMap`, runs `getDoProMap` and `getCallProByMap` to invoke `Sp_UpdateAdd_Check`, and throws `CustomException(sReturn)` when `sCode<0`. `BusinessBaseServiceImpl.addSysLocking(...)` invokes the same path during the "click modify button" lock-acquisition flow — see its `校验Sp_UpdateAdd_Check过程调用` comment. Also called by `Sp_DelMasterSlave_Pro` and `Sp_DelMasterSlave_Pro2` as the pre-delete guard before they call `Sp_delete_backwriting`. xly-src ships `script/标版/30100101/Sp_UpdateAdd_Check.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_UpdateAdd_Check_NEW.md b/en/docs/auto-catalog/procedures/Sp_UpdateAdd_Check_NEW.md index 31f256e..2655540 100644 --- a/en/docs/auto-catalog/procedures/Sp_UpdateAdd_Check_NEW.md +++ b/en/docs/auto-catalog/procedures/Sp_UpdateAdd_Check_NEW.md @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Newer/development variant of `Sp_UpdateAdd_Check` (修改,删除校验). Same signature and intent — the BACK-side save/delete pre-check — but the default `sType` is `'check'` rather than `'SaleTrial'`, the whitelist-form short-circuits are gone, and the `sysmsg` branch is the only non-`gds` early-out before delegating to `Sp_GetMasterSlave`. + +**What it does:** Mirror of `Sp_UpdateAdd_Check` — resolves master/slave table names via `Sp_GetMasterSlave`, sets `sCode=1`/`sReturn=''` on success or `sCode=-1` with a localised message from `Sp_Sis_GetConst('paramsErro', …)` when inputs are missing. Designed to call the same downstream check routines but with the trimmed pre-conditions. + +**Invocation:** Status: appears orphaned. No caller found in any channel — not in `BusinessCheckServiceImpl`/`BusinessBaseServiceImpl` (which both call the unsuffixed name), no form-master, no gdsmodule hook, no other proc references it, no xly-src grep hit. The `_NEW` suffix and reduced whitelist suggest this is a half-finished refactor of `Sp_UpdateAdd_Check`. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_Waste_details_product.md b/en/docs/auto-catalog/procedures/Sp_Waste_details_product.md index 035e8c1..e512535 100644 --- a/en/docs/auto-catalog/procedures/Sp_Waste_details_product.md +++ b/en/docs/auto-catalog/procedures/Sp_Waste_details_product.md @@ -33,4 +33,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量管理 → 报废分析 — paged 成品核检废明细 report ("finished-goods inspection-waste detail", header tagged `wx-12-17`). Lists every produced work-order/product card and its 工序报废 (`dProcessWasteQty`) + 品检报废 (`dQualityInspectionWasteQty`) totals, with master-side context (customer, product, schedule warning, work-order stage). + +**What it does:** From `viw_mftworkorder_copy1` filters to `sFormId in ('101251240115016002469445380','20240312202019690261117124589280')` (the two finished-goods card forms), `sOrderBusinessType<>'ZS01-5' AND <>'ZS06'`, `bProd=1`, `bcheck=1`. For each work-order row aggregates `SUM(dProcessWasteQty)` and `SUM(dQualityInspectionWasteQty)` from `hrmftworkorderprocess` where `bTypeWork=1`. Wires customer-tree filter `[sCustomerId, sLookCustomer]` and rewrites `bFilter`'s `A.sProductNo` → `E.sProductNo` to match the join alias. Hands the SQL to `sp_groupby` for `pageNum`/`pageSize`/`countCloumn` paging. + +**Invocation:** Status: appears orphaned. The paged-report signature is the standard form-data-source pattern, but no `gdsconfigformmaster` references it, no gdsmodule hook, no other proc, no xly-src grep. The `wx-12-17` author tag and the commented-out SELECT template at the top of the body suggest it was authored as a report draft but never bound to a form `sSqlStr`. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkCostCarryforward.md b/en/docs/auto-catalog/procedures/Sp_WorkCostCarryforward.md index b760f18..958a5e2 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkCostCarryforward.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkCostCarryforward.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本核算 / 月结结转 — period-close pre-flight that builds a `TmpWorkCostCarryforward` reconciliation table for the closing accountant. For every period in `sCostPeriod` that's not yet frozen and ≥ 202209, it sums hours/qty/money across the work-hour, work-center, department, materials-issue, outside-process estimate, and cost-allocation modules so the operator can spot mismatches before locking the period. + +**What it does:** Loads candidate `sysaccountperiod` rows into a temp table, populates 25+ aggregates per period (e.g. `dWorkHourDetailHour`/`dWorkHourSumHour` from `accordercostanalysis`, `dWorkCenterHourSumHour` from `accworkcenter`, `dDepartHourSumHour` from `accdepart`, materials issuance from `Accmaterialsstore`/`accproductionmaterialsslave`, outside-process estimate from `viw_accProductDoing`, expense entries from `accexpenseentry`/`accdepartexpense`/`accworkcenterexpense`/`accworkexpense`), then validates that detail vs. summary totals match and returns the discrepancy rows. + +**Invocation:** Called from `Sp_System_ProductionCost` (`call Sp_WorkCostCarryforward(p_sPeriod, sBrId, sSuId, …)`), the cost-period close orchestrator that drives the monthly cost run. Install script: `script/标版/30100101/cost/Sp_WorkCostCarryforward.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkDayReport.md b/en/docs/auto-catalog/procedures/Sp_WorkDayReport.md index a245605..3350256 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkDayReport.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkDayReport.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 / 设备日报表 (intended) — daily-output pivot by machine: one row per `sMachineId` with 31 columns `dReport1Qty..dReport31Qty` (sum of `dProcessQty` per day-of-month) plus `dSumQty`. Designed as a 设备产量日报 grid feeding off `viw_mftproductionreport` between `tStartDate` and `tEndDate`. + +**What it does:** Creates temp `WorkDayReport`, inserts one row per machine grouped by date with a 31-arm `CASE WHEN date_format(tCreateDate,'%d')='NN'` pivot, joins `elemachine` to fill `sMachineName`, sums the 31 columns into `dSumQty`, then `SELECT *` from the temp table as the result set. Side-effect-free; the date-range is the only filter. + +**Invocation:** Status: appears orphaned. No caller found in any channel — no `gdsconfigformmaster.sSqlStr` binding, no `gdsmodule` hook, no other routine references the name, and the only xly-src hit is its own install script `script/标版/30100101/Sp_WorkDayReport.sql`. The signature (`tStartDate, tEndDate, sLoginId, sBrId, sSuId, OUT sReturn, OUT sCode`) lacks the paging/`bFilter`/`countMapJson` parameters of live report data-source procs, suggesting it was an earlier prototype superseded by a paged variant. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOpsOutProcess.md b/en/docs/auto-catalog/procedures/Sp_WorkOpsOutProcess.md index 9a09b13..0962aa8 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOpsOutProcess.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOpsOutProcess.md @@ -28,4 +28,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 / 生产工单工序发外 — paged report listing work-order operations sent to outside processors. The signature matches the standard form-master report data-source contract (`bFilter`, `pageNum`/`pageSize`, `totalCount`, `countCloumn`/`countMapJson`, `sFilterOrderBy`, `sGroupby_select_sql`/`sGroupby_group_sql`) used elsewhere for paged grids backed by `Sp_Outstanding_Query`. + +**What it does:** Builds dynamic SQL against `mftworkordermaster` joined to `mftworkorderProcess` (and friends) to materialise temp table `TMP_viw_mftworkorderprocessextralnew_Nsyn` — every column maps to the 工序发外 grid: `sMaterialsId/Name/No`, `sCustomerId/Name`, `sProductId/No/Name`, `dOutsideQty`, `dOutsideProcessQty`, `sProcessId/Name`, `sParamsV`, `sKnifeMouldId`, `tCheckDate`, etc. Applies `Fun_bFilter_toWhere` to convert the front-end filter JSON, scopes by `Fun_GetLookCustomer(sLoginId, sBrId, sSuId)` for per-user customer visibility, then runs the paging/count path. + +**Invocation:** Status: appears orphaned. No `gdsconfigformmaster` binds it as `sSqlStr`/`sConfigSqlStr`/`sSqlCondition`, no `gdsmodule` hook references it, no other DB routine calls it, and xly-src has no hits. The signature is identical to live report procs (a strong tell), but the corresponding form-master row is missing — likely deployed for an in-progress 工序发外 report that hasn't been wired up, or its form was removed. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrderProcessDetail.md b/en/docs/auto-catalog/procedures/Sp_WorkOrderProcessDetail.md index 4352a80..6a9d6d4 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrderProcessDetail.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrderProcessDetail.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本管理 → 材料存货分析 → 实际加工费 / 标准加工费 / 机台加工费 — month-aggregate cost-of-process report. Rebuilds `cosstdcostmonth` for the date window from `viw_mftworkorder` + `mftworkordermaterials` + `mftworkorderprocess` (joined to `eleprocess`/`sisprocessclassify`) so the three "加工费" reports can pivot cost by process classification (晒版, 印刷, 模切, …) per product / month. + +**What it does:** Date-aligns `tEndDate += 1 day`, `DELETE` then `INSERT INTO cosstdcostmonth` rows for `tCreateDate IN (tStartDate, tEndDate)` keyed off `viw_mftworkorder` where `bCheck=1 AND iSlaveOrder=1`. Subsequent `UPDATE`s fill `sMaterials`/`dMaterialsMoney` from `mftworkordermaterials`, `dSbQty` (晒版 process qty), `dOutSideMoney` from `viw_opsoutsideprocess`, then cursors over `sisprocessclassify` building dynamic `Update cosstdcostmonth E ... Set E.dProcessNMoney = ...` per classification (`p_iFor=1,2,3,…`) so each classification id lands in its own column. Final statement is `SELECT * FROM cosstdcostmonth`. + +**Invocation:** Bound as `gdsconfigformmaster.sSqlStr` on three reports under 成本管理 → 材料存货分析: `101251240115016165723345830` 实际加工费, `101251240115016157801662250` 标准加工费, `101251240115016170662415160` 机台加工费. Triggered when those reports are opened (date range as query params). No `gdsmodule` hook, no other DB-routine caller, no Java caller in xly-src outside the install scripts. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrder_BillForceComplete.md b/en/docs/auto-catalog/procedures/Sp_WorkOrder_BillForceComplete.md index 653c403..433be36 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrder_BillForceComplete.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrder_BillForceComplete.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 / 生产工单 — toolbar action 强制完结 (force-complete) for whole 生产工单 masters. The operator selects one or more `mftworkordermaster` rows in the 生产工单 grid, opens a popup that requires a 完结说明 reason, and the action flips the bills to `bBillComplete=1` with full audit logging — used when the work-order can't be finished through normal reporting (defects, cancellations, residual qty). + +**What it does:** Parses `sProInParam` (the JSON `{params:[{value:[{sId},…]}…], changeValue:{textareaValue}}` shape produced by GenericProcedureCall). Refuses empty payload (`paramsErro` constant) and missing reason (`sWorkOrderFinishNeedSm` constant). For each `sId`, sets `mftworkordermaster.bBillComplete=1`, `tBillCompleteDate=NOW()`, `sCompletePerson`, `sComRecordPerson`, `sReasonMemo`; cascades to `mftworkorderslave.sLossMemo`; flips `mftproductionplan.sState='6'` and `mftproductionplanslave.sState='5'`/`bProductionPlanComplete=1`; finally `INSERT INTO syscomplete` an audit row tagged `sForceComplete` quoting the reason. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 生产工单 grid's 强制完结 toolbar button names this proc. Per-row variant: `Sp_WorkOrder_BillForceCompleteSlave`. Install script: `script/标版/30100101/Sp_WorkOrder_BillForceComplete.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrder_BillForceCompleteSlave.md b/en/docs/auto-catalog/procedures/Sp_WorkOrder_BillForceCompleteSlave.md index 63ecb8c..fe5cc3d 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrder_BillForceCompleteSlave.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrder_BillForceCompleteSlave.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 / 生产工单 — slave-level toggle of 强制完结 for individual `mftworkorderslave` lines. Where `Sp_WorkOrder_BillForceComplete` closes a whole work-order master, this variant flips a single line item (a parts/finished-product row) without touching the master — used when one part of a multi-part work-order is abandoned but the rest continues. + +**What it does:** Parses `sProInParam` for `{params:[{value:[{sSlaveId},…]}…], changeValue:{textareaValue}}` (GenericProcedureCall JSON). For each `sSlaveId`, toggles `mftworkorderslave.bSlaveBillComplete` (`0↔1`) — when setting to 1 stamps `tSlaveBillCompleteDate=NOW()`, `sSlaveBillCompletePerson=sMakePerson`, `sLossMemo`/`sLossPerson` with the operator-supplied reason; when un-setting clears them all. Refuses empty payload via `paramsErro`. Unlike the master variant, no reason-required check and no `syscomplete` audit row. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 生产工单 slave-grid 强制完结 toolbar button names this proc. Master-level variant: `Sp_WorkOrder_BillForceComplete`. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataBookStd.md b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataBookStd.md index 373720e..be52d7c 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataBookStd.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataBookStd.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 / 生产工单 → 计算 (书刊工单) — full-bill cost/quantity calculation for 书刊 (book/magazine) work-orders. One of the four model-specific siblings of `Sp_WorkOrder_CalcDataStd`: `Pack` (包装), `Book` (书刊), `Set` (套装), `Flex` (柔印), with `Std` as the default fallback. The calc rewrites the calc-staging snapshot tables so the user can preview material/process figures before saving. + +**What it does:** Operates entirely on the `mftworkordermaster_Tmp`/`mftworkorderslave_Tmp`/`mftworkordercontrol_tmp`/`mftworkordermaterials_Tmp`/`mftworkorderprocess_tmp` staging set keyed by `sGuid` + `sMakePerson`. Reads system constants (`CbxCorrugateWidth`/`CbxCorrugateLength`/`NetCorrugateLengthSubtract`/`NetCorrugateWidthSubtract` from `SysSystemSettings`), derives slave/customer/product context, then walks every control row (printing-plate/parts) and process row to compute paper area, run-counts, loss qty, capacity hours, and money figures specific to the book-binding flow (signatures, gathering, binding). Calls `Sp_Sis_GetConst` for error messages and `Sp_System_ReplaceField` for formula substitution. + +**Invocation:** Dispatched by `Sp_Calc_sBgd` (the 生产工单 audit/calc entry) when the work-order's `sFormId='101251240115016042931766970'` (书刊工单). Also enumerated in `CaclProNameEnum.SP_WORKORDER_CALCDATABOOKSTD` for direct Java invocation via `WorkOrderCalcDataPackService`. Install script: `script/标版/30100101/Sp_WorkOrder_CalcDataBookStd.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataBsLastStd.md b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataBsLastStd.md index 2128ad0..6f7baf6 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataBsLastStd.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataBsLastStd.md @@ -35,4 +35,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 商务工单 → 计算 → 收尾阶段 (商务工单计算材料部分) — final/aggregation phase of the 商务 (business / non-packaging) work-order cost calc. Sibling of `Sp_WorkOrder_CalcDataPackLastStd`; both are the "Last" stage in the Java orchestrator's `Product → PartsStd → LastStd` pipeline. Runs after every parts/process row is computed, collapsing the per-part figures into the master totals. + +**What it does:** Operates on `mftworkordermaster_Tmp`/`mftworkorderslave_Tmp`/`mftworkordercontrol_tmp`/`mftworkordermaterials_tmp`/`mftworkorderprocess_tmp` keyed by `sGuid`+`sMakePerson`. Receives all calc context as IN parameters (corrugate dimensions, models type, slave/customer/product/delivery-date) — no re-reading of `SysSystemSettings`. Updates the staging master/slave/control/materials/process tables with summed costs, totalled paper area, finalised process money, capacity hours. Returns the calc result via `sCode`/`sReturn`. + +**Invocation:** Called by `WorkOrderCalcDataPackServiceImpl.doCalcDataPackStd()` as the `Sp_WorkOrder_CalcLastStd` slot when the orchestrator runs in 商务 mode (it points `Sp_WorkOrder_CalcLastStd = Sp_WorkOrder_CalcDataBsLastStd`). Called by the Java service after `Sp_WorkOrder_CalcDataBsProductStd` (before) and per-control `Sp_WorkOrder_CalcDataBsPartsStd` loops. Install script: `script/标版/30100101/Sp_WorkOrder_CalcDataBsLastStd.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataBsPartsStd.md b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataBsPartsStd.md index 280ffde..f3c927c 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataBsPartsStd.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataBsPartsStd.md @@ -36,4 +36,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 商务工单 → 计算 → 部件工序阶段 (商务工单计算部件工序部分) — per-control-row parts/process calc for the 商务 (business) work-order branch. Sibling of `Sp_WorkOrder_CalcDataPackPartsStd`; the orchestrator loops one call per `mftworkordercontrol_tmp` row (each 部件/拼版) so each parts grouping is costed independently before the LastStd phase rolls them up. + +**What it does:** Operates on `T_mftworkordercalc_tmp` plus the `mftworkordermaster_Tmp` / `mftworkordercontrol_tmp` / `mftworkordermaterials_tmp` / `mftworkorderprocess_tmp` staging keyed by `sGuid`+`sMakePerson`. For the supplied `p_sControlId`, computes per-process input/output quantities, loss qty, capacity hours, process money, materials qty — handling 公版 (`p_bPublicPlate`)/合版 (`p_sCombinedMemo`)/sample (`bSample`) variants. `INSERT INTO T_mftworkordercalc_tmp` accumulates calc rows for the LastStd phase to consume. Caller is responsible for looping; this proc handles a single control row. + +**Invocation:** Called by `WorkOrderCalcDataPackServiceImpl.doCalcDataPackStd()` as the `Sp_WorkOrder_CalcPartsStd` slot when running in 商务 mode (it points `Sp_WorkOrder_CalcPartsStd = Sp_WorkOrder_CalcDataBsPartsStd`). The Java service builds the call string via `getCallPart(…)` and runs it once per control-table row. Install script: `script/标版/30100101/Sp_WorkOrder_CalcDataBsPartsStd.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataBsProductStd.md b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataBsProductStd.md index 05286bc..dbfc724 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataBsProductStd.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataBsProductStd.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 商务工单 → 计算 → 成品工序阶段 (商务工单计算成品工序部分) — first/Before phase of the 商务 (business) work-order cost calc. Sibling of `Sp_WorkOrder_CalcDataPackProductStd`; primes the calc-staging tables with finished-product-level (`成品`) figures so the parts-loop and LastStd phases have consistent input. + +**What it does:** Operates on `mftworkordermaster_Tmp`/`mftworkorderslave_Tmp`/`mftworkordercontrol_tmp`/`mftworkordermaterials_Tmp`/`mftworkorderprocess_tmp` keyed by `sGuid`+`sMakePerson`. Seeds working tables `mftworkordercalc_tmp` and `p_mftworkorderslave_tmp`, then walks every `mftworkorderslave_Tmp` (成品) row to compute its production qty / loss qty / paper area / capacity, updating the staging control/process rows so subsequent parts calc can read consistent inputs. + +**Invocation:** Called by `WorkOrderCalcDataPackServiceImpl.doCalcDataPackStdBefore()` as the `Sp_WorkOrder_CalcProduct` slot when running in 商务 mode (it points `Sp_WorkOrder_CalcProduct = Sp_WorkOrder_CalcDataBsProductStd`). Runs once before the per-control PartsStd loop. Install script: `script/标版/30100101/Sp_WorkOrder_CalcDataBsProductStd.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataFlex.md b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataFlex.md index 67352d6..ec17a96 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataFlex.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataFlex.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 / 生产工单 → 计算 (柔印工单) — full-bill cost/quantity calculation for 柔印 (flexographic-print) work-orders. One of the four model-specific siblings of `Sp_WorkOrder_CalcDataStd`: `Pack` (包装), `Book` (书刊), `Set` (套装), `Flex` (柔印). Largest of the family by code size — the flexo flow has additional paper-roll/web handling and per-station ink-laydown logic. + +**What it does:** Operates entirely on the `mftworkordermaster_Tmp` / `mftworkorderslave_Tmp` / `mftworkordercontrol_tmp` / `mftworkordermaterials_tmp` / `mftworkorderprocess_tmp` staging snapshot keyed by `sGuid`+`sMakePerson`. Reads system constants (`CbxCorrugateWidth`/`CbxCorrugateLength`/`NetCorrugateLengthSubtract`/`NetCorrugateWidthSubtract` from `SysSystemSettings`), iterates every slave (成品) and control (部件/印刷) row, computes paper area, run-counts, loss qty, capacity hours, and process money under the flexo formula set. Calls `Sp_Sis_GetConst` for error messages and `Sp_System_ReplaceField` for formula substitution. + +**Invocation:** Enumerated in `CaclProNameEnum.SP_WORKORDER_CALCDATAFLEX` for direct Java invocation. Dispatched by `Sp_Calc_sBgd` (生产工单 audit/calc entry) as the fallback/柔印 branch alongside `Sp_WorkOrder_CalcDataStd`. Install script: `script/标版/30100101/Sp_WorkOrder_CalcDataFlex.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackLastStd.md b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackLastStd.md index f2cef64..08a166d 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackLastStd.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackLastStd.md @@ -33,4 +33,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 包装工单 → 计算 → 收尾阶段 — final/aggregation phase of the 包装 (packaging) work-order cost calc. Sibling of `Sp_WorkOrder_CalcDataBsLastStd`; the "Last" stage in the Java orchestrator's `Product → PartsStd → LastStd` pipeline. Runs after every parts/process row is computed, collapsing per-part figures into master totals. + +**What it does:** Operates on `mftworkordermaster_Tmp`/`mftworkorderslave_Tmp`/`mftworkordercontrol_tmp`/`mftworkordermaterials_tmp`/`mftworkorderprocess_tmp` plus per-call working tables `p_calc_MftWorkOrderControl_first_cal`, `_first_process`, `_laster_cal`, `_next`, `_order`, `_orderNew`, `_process_laster` to walk the control-row graph from innermost children outward. Finalises `mftworkorderslavemoney_tmp` (per-slave money), per-control loss qty, capacity hours, materials qty, and process money. Heavily customised — every shipped customer has an override script (千彩/金宣发/高旺/上海亚峰…) layered on top of the base 标版 install. + +**Invocation:** Called by `WorkOrderCalcDataPackServiceImpl.doCalcDataPackStd()` as the `Sp_WorkOrder_CalcLastStd` slot when running in 包装 mode (it points `Sp_WorkOrder_CalcLastStd = Sp_WorkOrder_CalcDataPackLastStd`). Runs after `Sp_WorkOrder_CalcDataPackProductStd` (before) and per-control `Sp_WorkOrder_CalcDataPackPartsStd` loops. Install scripts: `script/标版/30100101/Sp_WorkOrder_CalcDataPackLastStd.sql` plus customer overrides in `script/客户/*/`. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackPartsStd.md b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackPartsStd.md index e0e9578..2081a77 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackPartsStd.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackPartsStd.md @@ -34,4 +34,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 包装工单 → 计算 → 部件工序阶段 — per-control-row dispatch shim for the 包装 (packaging) parts/process calc. Sibling of `Sp_WorkOrder_CalcDataBsPartsStd`; the orchestrator loops one call per `mftworkordercontrol_tmp` row. This thin wrapper inspects the control-row hierarchy and decides whether to recurse from the innermost split-children outward or kick off straight from the outermost control row. + +**What it does:** Resolves the outermost `sControlParentId` for `p_sControlId` from `mftworkordercontrol_tmp` (`sParentId=sGuid`, scoped by 品牌/分公司), then builds temp `p_calc_MftWorkOrderControl_split` listing every part under that outermost control. If no rows have `bSplit=1` and the control isn't innermost (`sChildren=0`), leaves; otherwise dispatches one or more calls to `Sp_WorkOrder_CalcDataPackPartsStd_child` with the split flag — once for the "from-inside-out" walk and once more for split children. All real computation happens in `_child`. + +**Invocation:** Called by `WorkOrderCalcDataPackServiceImpl.doCalcDataPackStd()` as the `Sp_WorkOrder_CalcPartsStd` slot when running in 包装 mode (it points `Sp_WorkOrder_CalcPartsStd = Sp_WorkOrder_CalcDataPackPartsStd`). The Java service builds the call string via `getCallPart(…)` and runs it once per control-table row. Install scripts: `script/标版/30100101/Sp_WorkOrder_CalcDataPackPartsStd.sql` plus customer overrides in `script/客户/*/`. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackPartsStd_child.md b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackPartsStd_child.md index 3c2486a..ff06808 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackPartsStd_child.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackPartsStd_child.md @@ -35,4 +35,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 包装工单 → 计算 → 部件工序阶段 (内部递归) — heavy-lifting child of `Sp_WorkOrder_CalcDataPackPartsStd`. Takes the same args plus `p_bSplit` and does the actual per-part calc against the staging tables. The dispatcher (`PartsStd`) decides which control rows need calc and recurses through this proc for each, walking from innermost children outward. + +**What it does:** Builds heavy working tables — `p_calc_MftWorkOrderControl` (full control hierarchy), `_all` (incl. parents), `_first_cal`, `_next` (next-process), `p_mftworkordercalc_tmp_table`, `p_mftworkordercontrolcombine_tmp`/`_json` (合版 layout) — then for the supplied `p_sControlId` computes per-process input/output qty, loss qty, capacity hours, process money, materials qty under packaging-specific formulas (合版/公版/拆切/sample). Accumulates results into `mftworkorderslavemoney_tmp` for the LastStd phase to roll up. The recursion handles nested control hierarchies (one part split into sub-parts split into sheets, etc.). + +**Invocation:** Called by `Sp_WorkOrder_CalcDataPackPartsStd` (the same-named dispatcher without `_child`); never invoked directly from Java. The dispatcher passes `p_bSplit=0` for the innermost walk and `p_bSplit=1` for split-child walks. No xly-src install script present (DB-only definition) — the dispatcher is in `script/标版/30100101/Sp_WorkOrder_CalcDataPackPartsStd.sql`; the `_child` body lives in the same family of customer-override scripts. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackProductStd.md b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackProductStd.md index 818fa2b..87a4ff4 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackProductStd.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackProductStd.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 包装工单 → 计算 → 成品工序阶段 — first/Before phase of the 包装 (packaging) work-order cost calc. Sibling of `Sp_WorkOrder_CalcDataBsProductStd`; primes the calc-staging tables with finished-product-level (`成品`) figures so the parts-loop and LastStd phases have consistent input. Customer-heaviest of the family (千彩/快马/金宣发/上海亚峰 all ship overrides) — packaging calc-rules diverge widely between plants. + +**What it does:** Operates on `mftworkordermaster_Tmp`/`mftworkorderslave_Tmp`/`mftworkordercontrol_tmp`/`mftworkordermaterials_Tmp`/`mftworkorderprocess_tmp` keyed by `sGuid`+`sMakePerson`. Seeds working tables `mftworkordercalc_tmp` (and `_tmpNew`), `mftworkordercontrolcombine_tmp`/`mftworkordercontrolcombinecalc_tmp`/`mftworkordercontrolJson_tmp` (合版 layout), `p_mftworkordercalc_tmp_table[_max]`. Walks every `mftworkorderslave_Tmp` (成品) row to compute its production qty / loss qty / paper area / capacity, primes the per-control-row records so subsequent PartsStd calls read consistent inputs. Stamps `mftworkorderslavemoney_tmp` with the initial money rows. + +**Invocation:** Called by `WorkOrderCalcDataPackServiceImpl.doCalcDataPackStdBefore()` as the `Sp_WorkOrder_CalcProduct` slot when running in 包装 mode (it points `Sp_WorkOrder_CalcProduct = Sp_WorkOrder_CalcDataPackProductStd`). Runs once before the per-control PartsStd loop. Install scripts: `script/标版/30100101/Sp_WorkOrder_CalcDataPackProductStd.sql` plus customer overrides in `script/客户/*/`. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackStd.md b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackStd.md index a92a2fa..f0d7425 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackStd.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackStd.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 / 生产工单 → 计算 (包装工单) — full-bill cost/quantity calculation for 包装 (packaging) work-orders. One of the four model-specific siblings of `Sp_WorkOrder_CalcDataStd`: `Pack` (包装), `Book` (书刊), `Set` (套装), `Flex` (柔印). Largest of the family (208KB body) — packaging has the richest control-row hierarchy (合版/拼版/sub-parts) and is where most customer-specific cost rules accumulate. + +**What it does:** Operates on the `mftworkordermaster_Tmp` / `mftworkorderslave_Tmp` / `mftworkordercontrol_tmp` / `mftworkordermaterials_tmp` / `mftworkorderprocess_tmp` staging set keyed by `sGuid`+`sMakePerson`. Reads system constants (`CbxCorrugateWidth` etc. from `SysSystemSettings`), then runs the Product → Parts → Last pipeline inline (this is the all-in-one variant; the Java service prefers the split-proc variant via `WorkOrderCalcDataPackServiceImpl` for parallelism). Computes paper area, run-counts, loss qty, capacity hours, process money. Calls `Sp_Sis_GetConst` and `Sp_System_ReplaceField` (twice — one for normal, one for change-rate path). + +**Invocation:** Dispatched by `Sp_Calc_sBgd` (生产工单 audit/calc entry) when the work-order's `sFormId='101251240115016002469445380'` (包装工单). Also enumerated in `CaclProNameEnum` (constant `pack`) for direct Java invocation when the split-proc orchestrator isn't used. Install script: `script/标版/30100101/Sp_WorkOrder_CalcDataPackStd.sql` plus optimisation patch in `script/标版/optimize/Sp_Calc_sBgd.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackStdQ.md b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackStdQ.md index 22c8542..a5b6959 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackStdQ.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataPackStdQ.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 / 生产工单 → 计算 (包装工单, Q 变体) — alternate full-bill calc for 包装工单. Signature identical to `Sp_WorkOrder_CalcDataPackStd`; the `Q` suffix marks a variant branch (likely "Q for quote/quick" or a customer-specific code-path) — both procs hit the same staging tables but the Q variant adds an extra working table `p_SlaveMoneyTable` (deletes then re-inserts per call) to track per-slave money separately. + +**What it does:** Same shape as `Sp_WorkOrder_CalcDataPackStd` — operates on `mftworkordermaster_Tmp` / `mftworkorderslave_Tmp` / `mftworkordercontrol_tmp` / `mftworkordermaterials_tmp` / `mftworkorderprocess_tmp` keyed by `sGuid`+`sMakePerson`. Reads `SysSystemSettings` constants, runs the Product → Parts → Last pipeline inline, computes paper area / run-counts / loss / capacity / money. Adds a `p_SlaveMoneyTable` working table the standard variant doesn't have, suggesting it was forked for a per-slave-money output requirement. + +**Invocation:** Enumerated in `CaclProNameEnum.SP_WORKORDER_CALCDATAPACKSTDQ` for direct Java invocation via `CaclProNameEnum.getNameByKey("Sp_WorkOrder_CalcDataPackStdQ")` — selected when the front-end passes `proName="Sp_WorkOrder_CalcDataPackStdQ"` into `WorkOrderCalcDataPackService`. Not dispatched by `Sp_Calc_sBgd`; appears to be Java-only. No xly-src install script — DB-only deployment, probably a customer-specific build. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataSetStd.md b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataSetStd.md index 11687e7..025ff9b 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataSetStd.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataSetStd.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 / 生产工单 → 计算 (套装工单) — full-bill cost/quantity calculation for 套装 (set/kit) work-orders. One of the four model-specific siblings of `Sp_WorkOrder_CalcDataStd`: `Pack` (包装), `Book` (书刊), `Set` (套装), `Flex` (柔印). Drives the calc when a single work-order bundles multiple finished products as a kit. + +**What it does:** Operates on the `mftworkordermaster_Tmp` / `mftworkorderslave_Tmp` / `mftworkordercontrol_tmp` / `mftworkordermaterials_tmp` / `mftworkorderprocess_tmp` staging set keyed by `sGuid`+`sMakePerson`. Reads system constants (`CbxCorrugateWidth`/`CbxCorrugateLength`/`NetCorrugateLengthSubtract`/`NetCorrugateWidthSubtract` from `SysSystemSettings`), iterates every slave (成品) and control (部件/印刷) row, computes paper area, run-counts, loss qty, capacity hours, and process money under the kit-bundling formula set. Calls `Sp_Sis_GetConst` for error messages and `Sp_System_ReplaceField` for formula substitution. + +**Invocation:** Dispatched by `Sp_Calc_sBgd` (生产工单 audit/calc entry) when the work-order's `sFormId='101251240115016087802299360'` (套装工单). Also enumerated in `CaclProNameEnum.SP_WORKORDER_CALCDATASETSTD` for direct Java invocation. Install script: `script/标版/30100101/Sp_WorkOrder_CalcDataSetStd.sql`. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStd.md b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStd.md index 8687e4b..dd6ca30 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStd.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStd.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 / 生产工单 → 计算 (默认/通用工单) — full-bill cost/quantity calculation for the default (general) work-order model. Default fallback in the `Pack`/`Book`/`Set`/`Flex` family — `Sp_Calc_sBgd` dispatches to one of the three model-specific siblings by `sFormId`, falling through to this proc when no specific match. The root entry the rest of the family was forked from. + +**What it does:** Operates entirely on the `mftworkordermaster_Tmp` / `mftworkorderslave_Tmp` / `mftworkordercontrol_tmp` / `mftworkordermaterials_tmp` / `mftworkorderprocess_tmp` staging snapshot keyed by `sGuid`+`sMakePerson`. Reads system constants (`CbxCorrugateWidth`/`CbxCorrugateLength`/`NetCorrugateLengthSubtract`/`NetCorrugateWidthSubtract` from `SysSystemSettings`), iterates every slave (成品) and control (部件/印刷) row, computes paper area, run-counts, loss qty, capacity hours, and process money under the default formula set. Calls `Sp_Sis_GetConst` and `Sp_System_ReplaceField`. Also referenced from `Sp_Manufacture_InsertWorkOrder` (work-order insert path) for the initial calc. + +**Invocation:** Dispatched by `Sp_Calc_sBgd` as the `Else` branch (any work-order whose `sFormId` isn't 包装/书刊/套装). Default constant `typeNameDefalut = "Sp_WorkOrder_CalcDataStd"` in `CaclProNameEnum` — `getNameByKey()` returns this when no key matches. Install scripts: `script/标版/30100101/Sp_WorkOrder_CalcDataStd.sql` plus customer overrides in `script/客户/无锡中江/`, `script/客户/福雅/`. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStdBefore.md b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStdBefore.md index 49bfced..2a11977 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStdBefore.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStdBefore.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 / 生产工单 → 计算 (准备阶段, 旧) — intended pre-flight phase of the default work-order calc: read the staging snapshot, pull `SysSystemSettings` corrugate constants, derive slave/customer/product/delivery context, and prime the per-control combine qty before the main calc walks the rows. Signature with no `sCode`/`sReturn` (`sGuid, bChangeRate, sLoginId, sBrId, sSuId` only) marks it as an early sub-step, not a top-level entry. + +**What it does:** Reads `mftworkordermaster_Tmp.sFormId` for the order, four `SysSystemSettings` rows (`CbxCorrugateWidth`/`CbxCorrugateLength`/`NetCorrugateLengthSubtract`/`NetCorrugateWidthSubtract`), the first slave's (`MftWorkOrderSlave_Tmp`) `sCustomerId`/`sProductId`/`tDeliverDate`, then clears stale `sControlId` rows on `MftWorkOrderProcess_Tmp` and `mftworkordermaterials_Tmp` and sets every slave's `dProductQty` from the max combine ratio. Side-effects limited to the staging tables. + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, no `gdsconfigformmaster` binding, no other DB routine references it, no xly-src hit. Same proc-shape and same staging-table reads as the logic inlined at the top of `Sp_WorkOrder_CalcDataStd` / `Sp_WorkOrder_CalcDataPackStd` — suggests it was the pre-fork "before" step that got inlined into each model-specific proc and then never deleted. Candidate for maintainer audit / cleanup. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStdBeforeAfter.md b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStdBeforeAfter.md index 5e05def..a0395e7 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStdBeforeAfter.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStdBeforeAfter.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 / 生产工单 → 计算 (准备阶段+收尾, 旧) — intended composite "before-and-after" wrapper of the default work-order calc: same staging reads as `Sp_WorkOrder_CalcDataStdBefore` plus the post-walk updates that finalise `MftWorkOrderMaterials_Tmp` and `mftworkordermaster_tmp`. Signature without `sCode`/`sReturn` (`sGuid, bChangeRate, sLoginId, sBrId, sSuId`) — designed to be wedged into the calc pipeline, not invoked directly by users. + +**What it does:** Mirrors `Sp_WorkOrder_CalcDataStdBefore`'s setup (reads `mftworkordermaster_Tmp.sFormId`, four `SysSystemSettings` rows, first slave context) and then performs the after-phase updates: `UPDATE mftworkordermaster_tmp` totals, `Insert INTO MftWorkOrderMaterials_Tmp` for derived materials lines, `Update MftWorkOrderMaterials_Tmp` /`MftWorkOrderControl_Tmp` /`MftWorkOrderProcess_Tmp` /`MftWorkOrderSlave_Tmp` to consolidate the calc. + +**Invocation:** Status: appears orphaned. No `gdsmodule` hook, no `gdsconfigformmaster` binding, no other DB routine references it, no xly-src hit. Almost certainly a dead twin of `Sp_WorkOrder_CalcDataStdBefore` retained from a pre-fork era when the calc was split into discrete before/before-after/after sub-procs — the current generation inlines all phases into `Sp_WorkOrder_CalcData{Pack,Book,Set,Flex,Std}`. Candidate for maintainer audit / cleanup. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStdCenterProcess.md b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStdCenterProcess.md index 2230725..ffeaccb 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStdCenterProcess.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStdCenterProcess.md @@ -44,4 +44,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 制造 → 工单 (`mftworkordermaster_Tmp` / `MftWorkOrderControl_Tmp` / `MftWorkOrderProcess_Tmp`) — per-process calculator in the standard-工单 recompute pipeline. Sits next to the `Sp_WorkOrder_CalcDataStd*` family and is named like a "center process" recompute (one工序 row at a time given a control id + process id), used when a single process row's loss/quantity needs re-solving without touching peer processes. + +**What it does:** Takes 30+ in-params (sGuid, control / parts / process ids, rates, page/sample flags, qty inputs). On the temp tables loaded for the active session (`sParentId=sGuid AND sMakePerson=sLoginId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`), drives a long `top:` block that re-derives `dMaterialsQty`, `dProcessOutQty`, machine/stick math, capacity hours, and downstream process linkage rows; pure `UPDATE`s on `MftWorkOrderProcess_Tmp` / `MftWorkOrderControl_Tmp` / `MftWorkOrderMaterials_Tmp`. No outside-DB side effects. + +**Invocation:** Status: appears orphaned. No caller found in any channel — neither `gdsconfigformmaster`, `gdsmodule.sProcName/sSaveProName*/sDeleteProName`, other DB routines (the live wiring orchestrator `Sp_WorkOrder_CalcDataStd` and its `Std`-suffixed peers do not reference this name), nor xly-src grep across all extensions. Candidate dead code / branched experiment — verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStdCenterPrsAfter.md b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStdCenterPrsAfter.md index 9e87790..cd05bed 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStdCenterPrsAfter.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CalcDataStdCenterPrsAfter.md @@ -21,4 +21,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 制造 → 工单 (`mftworkordermaster_Tmp` / `MftWorkOrderControl_Tmp` / `MftWorkOrderProcess_Tmp`) — "process-after" leg of a 工单 standard-recompute pipeline. Companion to `Sp_WorkOrder_CalcDataStdCenterProcess`: handles the post-process pass that rolls up machine count, plate count, stretch/print-after qty and the trailing per-control aggregates once each process row has been solved. + +**What it does:** Reads `mftworkordermaster_Tmp.sFormId` for the session, then runs a chain of pure `UPDATE`s on `MftWorkOrderControl_Tmp` keyed on `sParentId=sGuid AND sMakePerson=sLoginId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId` — `dMachineQty` / `dSumMachineQty` / `dSumPlateQty` (Ceiling math over `dCoupletQty`, `dSinglePQty`, `iStick`, positive/special/opposite color counts), `dStretchPrintQty` from per-process loss sums, `dStretchPrintAfterQty` from the next-process `dProcessInQty`, and follow-up auxiliary/materials qty rollups. No CALL, INSERT, DELETE. + +**Invocation:** Status: appears orphaned. No caller found in any channel — `gdsconfigformmaster`, `gdsmodule` hooks, other DB routines (the live `Sp_WorkOrder_CalcDataStd` and `Sp_WorkOrder_CalcDataStdBefore`/`Sp_WorkOrder_CalcDataStdBeforeAfter` orchestrators do not reference this name), and xly-src grep across all extensions all empty. Candidate dead code paired with `Sp_WorkOrder_CalcDataStdCenterProcess` — verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CheckUpdate.md b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CheckUpdate.md index bde0ad9..21629fd 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CheckUpdate.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CheckUpdate.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 制造 → 工单 — 工单保存前检验 (per the `COMMENT`): on-save validator for 生产工单 / 轮转工单 / 生产补单, refusing the save when material / process / slave (product) rows users tried to delete are still referenced downstream (purchase orders generated, production reports, etc.). + +**What it does:** Parses the form's `sAllData` JSON, splits by `name in (materials, process, slave, control)`, materialises each into a temp table (`p_MftWorkOrdermaterials_tmp` / `p_MftWorkOrderproces_tmp` / `p_MftWorkOrderSlave_tmp`), tags each row with `fun_workmaterials_used`/`fun_workprocess_used` to fetch the downstream-usage memo, and if any row with `handleType='del'` still has a non-empty `sUsedMemo` (e.g. 采购订单已生成) sets `sCode=-8` and `sReturn` to a concatenated reason and leaves `top`. + +**Invocation:** Predecessor to `Sp_WorkOrder_CheckUpdateNew`. Currently no `gdsmodule.sSaveProName*` row references this name (the 轮转工单 / 生产工单 / 生产补单 forms point at `Sp_Check_sWod` for save validation and `Sp_beforeSave_sWod` for pre-save), and no other DB routine nor xly-src extension (outside the install script `script/标版/30100101/Sp_WorkOrder_CheckUpdate.sql`) calls it. Status: appears orphaned in the live DB — superseded by `Sp_WorkOrder_CheckUpdateNew`/`Sp_Check_sWod`; candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CheckUpdateNew.md b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CheckUpdateNew.md index 33a86bd..eaa6726 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CheckUpdateNew.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CheckUpdateNew.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 制造 → 工单 — `New` rewrite of the 工单保存前检验 validator: on-save guard for 生产工单 / 轮转工单 / 生产补单 that blocks deletion of material / process / product (slave) rows still referenced by downstream purchase / production records. + +**What it does:** Walks `sAllData` JSON with `JSON_LENGTH` + `JSON_EXTRACT`, branches on `name in (materials, process, slave, control)` and inserts each section into per-table temp tables. Calls `fun_workmaterials_used` / `fun_workprocess_used` against each `handleType='del'` row to get the downstream-usage memo; also looks up purchase-order billno via a join through `mftpurchaseapplyslave` → `mftpurchaseorderslave`. Any non-empty memo causes `sCode=-8`/`sReturn=` and `LEAVE top` to abort the save. + +**Invocation:** Status: appears orphaned. The live 工单 forms (`101251240115015840916341460` 轮转工单, `101251240115016002469445380` 生产工单, `101251240115016098136660960` 生产补单) all point `sSaveProName=Sp_Check_sWod` and `sSaveProNameBefore=Sp_beforeSave_sWod` — neither references `Sp_WorkOrder_CheckUpdateNew`. No `gdsconfigformmaster`, no other DB routine, no xly-src file calls it. Candidate dead code (likely a stalled rewrite) — verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CopyToWorkOrderData.md b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CopyToWorkOrderData.md index ab567c5..5832a10 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrder_CopyToWorkOrderData.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrder_CopyToWorkOrderData.md @@ -22,4 +22,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 制造 → 工单 — "Copy product-card data into the in-progress 工单" helper. Behind the 工单 editor's "拷贝工艺" / "套用工艺卡" action: after the user picks customer + product rows on the 工单 slave, this proc fills the slave's `sProductTechnologyId` and explodes the chosen `mftproduct` cards into the 工单 control / materials / process / color slots. + +**What it does:** Operates entirely on the `mftworkorder*_tmp` family (session-scoped by `sParentId=sGuid AND sMakePerson=sLoginId AND sBrandsId/sSubsidiaryId`). First ranks the latest `viw_mftproduct.bCheck=1` rows per (sCustomerId, sProductId) and `UPDATE`s `mftworkorderslave_tmp.sProductTechnologyId` to the most recent product-card sId. Then groups `mftproductmaterials` rows by parts (`sType='0'`) and uses cursors to fan out `mftproductmaterials` / `mftproductprocess` / `mftproductcontrolcombine` etc. into `mftworkordermaterials_tmp` / `mftworkorderprocess_tmp` / `mftworkordercontrol_tmp` keyed by the new control ids it generates via `NewId()`. + +**Invocation:** Called from Java by `BusinessBaseServiceImpl.getCopyToWorkOrderData(Map)`, which builds and runs `call Sp_WorkOrder_CopyToWorkOrderData(?, sConfigId, sControlName, sMakePerson, sBrId, sSuId)` via `businessBaseDao.getByStringSql()`. The HTTP entry is `BusinessBaseController` POST `/getCopyToWorkOrderData`. Not bound on `gdsmodule` or `gdsconfigformmaster` — the dispatch is Java-side, fired by the 工单 拷贝/套用 button. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrder_GtChar.md b/en/docs/auto-catalog/procedures/Sp_WorkOrder_GtChar.md index c3b3bf0..c02c568 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrder_GtChar.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrder_GtChar.md @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 制造 → 工单 — 工单甘特图 (`COMMENT '工单甘特图'`): builds the Gantt-chart payload for a single 工单, returning a JSON `{data, links}` shape that the front-end Gantt widget (dhtmlx-style) consumes — control rows (`mftworkordercontrol`) as parents, process rows (`mftworkorderprocess`) as children, with `tStartDate`/`tEndDate` joined from `mftproductionplanslave` and a derived `sProcessState` ("已完成"/"已排程"/"未排程"/"发外加工"/"偏离APS规则转人工排程"…). + +**What it does:** Validates `sWorkOrderGuid`, reads `syssystemsettings.CkxXd` for the brand to switch the "已下达/已排程" label, builds two temp tables `tmp_gt_WorkControl` and `tmp_gt_WorkProcess`, populates them from `mftworkordercontrol` / `mftworkorderprocess` + `eleprocess` joins, then cursors over them concatenating `JSON_OBJECT(...)` rows into `p_dataArray` and `p_linkArray` (parent/child linkage via `iOrder`). Final output: `sReturn=JSON_OBJECT('data',p_dataArray,'links',p_linkArray)`, `sCode=1`. No INSERT/UPDATE/DELETE to real tables. + +**Invocation:** Status: appears orphaned. No `gdsconfigformmaster` binding, no `gdsmodule` hook, no other DB routine calls it. The only xly-src reference is the install script `script/标版/30100101/Sp_WorkOrder_GtChar.sql` — no Java caller, no MyBatis mapper. Either dispatched dynamically through a name not yet grep-able, or unused; candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkOrder_TechnologicalProcess.md b/en/docs/auto-catalog/procedures/Sp_WorkOrder_TechnologicalProcess.md index 2ce6d09..eb508b2 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkOrder_TechnologicalProcess.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkOrder_TechnologicalProcess.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 制造 → 工单 — 工序工序流程 (per `COMMENT`): denormaliser that writes the "→"-separated process chain (e.g. `印刷->过油->模切->贴合`) into `mftworkordercontrol.sTechnologicalProcessMemo` for the given 工单, so the 工单 print/preview and Gantt views can show one-line process flows per control row without re-aggregating live. + +**What it does:** Two `UPDATE mftworkordercontrol P INNER JOIN (SELECT GROUP_CONCAT(eleprocess.sProcessName ORDER BY sType, iOrder SEPARATOR '->') ... FROM MftWorkOrderProcess JOIN eleprocess ON sId=sProcessId GROUP BY sControlId)` passes: first pass with `sType <> '3'` populates the base chain; second pass with `sType = '3'` appends the post-process steps, concatenating onto the existing memo with another `->`. Both pass scope is `sParentId=p_sWorkOrderId AND sBrandsId AND sSubsidiaryId`. `sCode` is set to 1 on entry but never changed. + +**Invocation:** Status: appears orphaned in the standard DB. No `gdsmodule`/`gdsconfigformmaster` binding, no other live DB routine calls it. Referenced only by xly-src install scripts: `script/标版/30100101/schedule/Sp_WorkOrder_TechnologicalProcess.sql` (install), the 金宣发 customer-override `script/客户/金宣发/Sp_Calc_sWod.sql` calls it inside the audit flow (`CALL Sp_WorkOrder_TechnologicalProcess(sGuid,sBrId,sSuId,sReturn,sCode);`) — but the live `Sp_Calc_sWod` deployed in this DB does not include that line. Customer-specific helper; verify deployment before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkProcess_BtnEventOutSide.md b/en/docs/auto-catalog/procedures/Sp_WorkProcess_BtnEventOutSide.md index e656eb9..17627ee 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkProcess_BtnEventOutSide.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkProcess_BtnEventOutSide.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 制造 → 工序 — toolbar handler that flips a 工单 工序 (`mftworkorderprocess`) row to "发外加工" (outside processing). Caption-wise the `COMMENT` reads 研发任务认领 (probably stale from a forked template) but the body is a 发外加工 mark: it sets `bOutSide=1` and stamps the outside qty/date/person. + +**What it does:** Validates `sProInParam` (JSON), unpacks `$.params[0].value[*].sSlaveId` (multi-row pattern) and walks them in a WHILE loop. For each `sSlaveId`, runs `UPDATE mftworkorderprocess SET bOutSide=1, dOutsideQty=dProcessQty, tOutSideDate=NOW(), sOutSidePerson=sMakePerson WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. On empty `sProInParam` it pulls the `paramsErro` constant via `Sp_Sis_GetConst` and returns `sCode=-1`. Reads `$.changeValue.textareaValue` but does not write it (leftover from template). + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — fired by the 发外加工 toolbar button on a 工单工序 grid. Not bound on `gdsmodule` or `gdsconfigformmaster` (the standard `Sp_BtnEvent_*`/`sp_btn_action*` channel). No other DB-routine callers, no xly-src references — discoverable only via the generic-dispatch contract. diff --git a/en/docs/auto-catalog/procedures/Sp_WorkWeekReport.md b/en/docs/auto-catalog/procedures/Sp_WorkWeekReport.md index a041ffa..24a91bf 100644 --- a/en/docs/auto-catalog/procedures/Sp_WorkWeekReport.md +++ b/en/docs/auto-catalog/procedures/Sp_WorkWeekReport.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成本管理 → 材料存货分析 → 生产周报 — placeholder data-source for the 生产周报 report. The form is registered but the procedure is a stub: it only returns the date range it was given, with no aggregation logic yet. + +**What it does:** Date-aligns `tEndDate = DATE_ADD(DATE_FORMAT(tEndDate,'%Y-%m-%d'), INTERVAL 1 DAY)` and runs a single `SELECT tStartDate, tEndDate;`. No CRUD, no joins, no real data — opening the report will only display the two date columns. + +**Invocation:** Bound as `gdsconfigformmaster.sSqlStr` on form `101251240115016179581404740` (生产周报, parent module `101251240115016179581403880`) under 成本管理 → 材料存货分析. Fires when the report is opened. No other channel calls it. Status: report scaffold awaiting an actual implementation — flag for maintainer follow-up. diff --git a/en/docs/auto-catalog/procedures/Sp_Work_WorkOfDayRecord.md b/en/docs/auto-catalog/procedures/Sp_Work_WorkOfDayRecord.md index b4cc078..fb3082b 100644 --- a/en/docs/auto-catalog/procedures/Sp_Work_WorkOfDayRecord.md +++ b/en/docs/auto-catalog/procedures/Sp_Work_WorkOfDayRecord.md @@ -32,4 +32,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产管理 → 生产运营报表 → CQZY生产日报分析表 (生产记录表) — paged daily production-record report for the 重庆中烟 customer scope. One row per work-order/product with the full production-card context: work-order #, 客户名称, 产品分类, 印版号, 折算率, 膜宽, 排版数, 标准用料, 总升放, 版周长, 机组数, plus per-material breakdown. + +**What it does:** Defaults `tStartDate=NOW()-3 MONTH`, `tEndDate=NOW()`. Builds temp `SAS` (`sWorkOrderId, sCustomerId, sProductId, sWorkOrderNo, sCustomerNo, sProductNo, sProductName, dProductQty, sProductionCenter, sProductionClassify, dConversionRate, dMaterialsWidth, dSinglePQty, dSumMachineQty, dSumStretchQty, dMaterialsLength, dCrew, sMaterialsId, sMaterialsName, sMaterialsNo, dCoefficient …`) and populates it from `viw_mftworkorder` + materials/process joins for the date window. Hands the final `SELECT` to the standard paging helper for `pageNum`/`pageSize`/`bFilter`/`countCloumn`. + +**Invocation:** Bound as the data-source of the 生产运营报表 → CQZY生产日报分析表 form `gfm.sId=101251240115016219884052520` (parent module 101251240115016219884051700 → 生产运营报表 → 生产管理). Loaded when the user opens the report. xly-src ships the form-master row in `script/标版/20210323/gdsconfigformmaster.sql`; the proc body itself is DB-only (no install script). diff --git a/en/docs/auto-catalog/procedures/Sp_Yfworkorder_BtnEventCustomerFail.md b/en/docs/auto-catalog/procedures/Sp_Yfworkorder_BtnEventCustomerFail.md index 564e3e7..24a2ae9 100644 --- a/en/docs/auto-catalog/procedures/Sp_Yfworkorder_BtnEventCustomerFail.md +++ b/en/docs/auto-catalog/procedures/Sp_Yfworkorder_BtnEventCustomerFail.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 研发 → 研发工单 (`mftworkorderslave` 研发 variant) — toolbar handler that marks slave rows as "客户驳回 / 客户未通过" (per the comment 研发工单客户通过 — the caption is the inverse-naming convention used across the 研发 流程). Records the customer-rejection reason on the slave row so the 研发 follow-up flow can branch. + +**What it does:** Validates `sProInParam` (length ≥5, otherwise `Sp_Sis_GetConst('paramsErro',...)` and `sCode=-1`). Parses `$.params` array and the form's `$.changeValue` for `sCustomerFailType` and `textareaValue` → `sCustomerFailMemo`. Nested WHILE loop over `$.params[i].value[j].sSlaveId`. For each id, runs `UPDATE mftworkorderslave SET bCustomerStatusEnd=1, sCustomerFailType=p_sCustomerFailType, sCustomerFailMemo=p_sCustomerFailMemo WHERE sId=p_sId AND sBrandsId=sBrId AND sSubsidiaryId=sSuId`. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — fired from the 研发工单 grid's 客户未通过 / 客户驳回 toolbar button (standard `Sp__BtnEvent*` channel). Not bound on `gdsmodule` or `gdsconfigformmaster`; no other DB-routine callers, no xly-src references — discoverable only via the generic-dispatch contract. diff --git a/en/docs/auto-catalog/procedures/Sp_Zld_BtnEventClaim.md b/en/docs/auto-catalog/procedures/Sp_Zld_BtnEventClaim.md index 0f45c83..f04520a 100644 --- a/en/docs/auto-catalog/procedures/Sp_Zld_BtnEventClaim.md +++ b/en/docs/auto-catalog/procedures/Sp_Zld_BtnEventClaim.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 制造 → 资料袋 (`mftdatabagmaster`) — 资料袋领用 (customer-specific 千彩 override per the `script/客户/千彩/` install path). Toolbar handler that lets a department claim a 资料袋 (production "data bag" — order-package the shop floor uses to carry job specs / 文件) once, and logs the action. + +**What it does:** Validates `sProInParam`; parses `$.params[i].value[j].sId / sClaimPerson / sClaimDepartment`. For each row reads existing `(sState, sClaimPerson, sClaimDepartment, tClaimDate)` from `mftdatabagmaster`. If `sState='2'` it aborts with `领用,不能再次领用` reason concatenated from the existing claimer. Otherwise `UPDATE mftdatabagmaster SET sClaimPerson, sClaimDepartment, tClaimDate = ` and `INSERT INTO mftdatabaglog(sId, sParentId=p_sId, sType='2', sHandleDepartment, sHandlePerson, tHandleDate, sMakePerson)` — `sType='2'` denotes the claim event. + +**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — fired by a 领用 button on the 资料袋 grid. Not bound on `gdsmodule` or `gdsconfigformmaster`; the only xly-src reference is the customer override script `script/客户/千彩/Sp_Zld_BtnEventClaim.sql`. Verify deployment per tenant before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_addBtn_gdsmodle.md b/en/docs/auto-catalog/procedures/Sp_addBtn_gdsmodle.md index 2829c21..f21fe93 100644 --- a/en/docs/auto-catalog/procedures/Sp_addBtn_gdsmodle.md +++ b/en/docs/auto-catalog/procedures/Sp_addBtn_gdsmodle.md @@ -17,4 +17,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** One-shot DBA / install-time helper. Header says 新增按钮 ("add buttons"). Retrofits the standard toolbar button row (BtnAdd / BtnUpd / BtnDel / BtnBsOperation.BtnInvalid / BtnExamine / BtnOut / BtnRefresh / BtnSave / BtnCancel / BtnCancelExamine) onto the primary form of every `gdsmodule` row whose `sDisplayType='Business'`, so newly created Business modules get the full button set without the dev having to wire 10 `gdsconfigformslave` rows by hand. + +**What it does:** Cursors over `gdsmodule WHERE sName <> '' AND sDisplayType ='Business'`; for each, picks the `gdsconfigformmaster` child (or, if multiple, the one with `bGrd=0` ordered by `iOrder`); runs 10 `INSERT … SELECT … FROM DUAL WHERE NOT EXISTS (…)` blocks — one per standard `sControlName` — into `gdsconfigformslave` under that form, hard-coding tenant `sBrandsId='1111111111'` / `sSubsidiaryId='1111111111'`. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep) — candidate for maintainer audit. The proc is idempotent (every INSERT is guarded by `NOT EXISTS`), so it's safe to run manually as a one-shot retrofit; the standard new-module flow today seeds buttons through a different path. + +Caveats: hardcoded tenant GUID `'1111111111'` makes this single-tenant only; the 审核 (BtnExamine) `NOT EXISTS` guard checks `sControlName='BtnBsOperation.BtnInvalid'` instead of `BtnExamine` — copy-paste bug that lets BtnExamine be inserted twice or skipped depending on the order of prior runs. diff --git a/en/docs/auto-catalog/procedures/Sp_addSysbrands.md b/en/docs/auto-catalog/procedures/Sp_addSysbrands.md index 62cfc67..e49b37c 100644 --- a/en/docs/auto-catalog/procedures/Sp_addSysbrands.md +++ b/en/docs/auto-catalog/procedures/Sp_addSysbrands.md @@ -30,4 +30,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Tenant/分公司 (subsidiary) provisioning helper. Given the new brand's id / name / short-name / number / parent and an initial admin password, this proc bootstraps a fresh `sysbrands` row plus all the metadata a usable tenant needs: cloned `gdsmodule` / `gdsjurisdiction` / `gdsconfigformmaster` / `gdsconfigformslave` / `gdsparameter` / `syssystemsettings` / `sysbillnosettings` / `syssearch` (common only) / `sysreport` rows from the canonical tenant `'1111111111'` (xly's seed tenant), plus a `_admin` login row in both `sftlogininfo` and `gdslogininfo`. The catalog header `根据模块sId删除模块(包含子模块)` is mis-copied from another routine — it does not match the body. + +**What it does:** Validates `sBrandNo` is unique via `COUNT(*) FROM sysbrands WHERE sNo = sBrandNo` (returns `SP_Sis_GetConst('sBrandNoUnique', …)` and `sCode=-1` on conflict). Then runs 10 `INSERT … SELECT FROM … WHERE sBrandsId='1111111111' AND sSubsidiaryId='1111111111'` blocks to copy seed-tenant metadata into the new brand's namespace (the seed-tenant's `sId`s are reused, the brand/subsidiary keys are remapped to `sBrandParentId`/`sBrandId`). Final two `INSERT`s seed the admin login rows and the `sysbrands` row itself. + +**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep). The lone xly-src hit `script/标版/30100101/Sp_addSysbrands.sql` is the install-bundle `CREATE PROCEDURE` source, not a call site — candidate for maintainer audit. Likely meant as a one-shot ops script driven manually when onboarding a new tenant, not via the BACK UI. + +Caveats: relies on the `'1111111111'` seed-tenant rows being intact; if seed-tenant data is mutated the clone is corrupted; the `gdsconfigformslave` clone reuses the seed `sId` values rather than generating new ones — risks collisions with the seed tenant's own rows; subsidiary-vs-brand id semantics are swapped relative to the rest of the schema (`sBrandsId = sBrandParentId`, `sSubsidiaryId = sBrandId`). diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sAcc.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sAcc.md index bfcbf6e..0416aea 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sAcc.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sAcc.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 质量事故报告 (quality-accident report) — thin save-phase wrapper. The `Sp_afterSave_s` family is the historic post-save hook tier: each is a 1-line delegator to `Sp_saveReturn_s(..., iFlag=2, ...)` (the `iFlag=2` phase code signals "after save" for the saveReturn worker, distinguishing it from the audit/反审 paths that pass `iFlag=1`/`0`). For `_sAcc` the worker is `Sp_saveReturn_sAcc` — meant to re-write quantities on related rows after the accident report is saved. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted (the worker expects a JSON-array-style id list) and, when `sGuid` is non-empty, runs `CALL Sp_saveReturn_sAcc(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate `@sCode`/`@sReturn` back to its own OUT params (unlike the `_sGYKK` sibling which does). + +**Invocation:** Status: appears orphaned. No caller found in any channel — no `gdsmodule` row sets `sSaveProName` / `sCalcProName` / `sProcName` to this name, no form-master `sSqlStr` references it, no other routine calls it, and `grep` across xly-src finds no hits. Java `BusinessBaseServiceImpl.addUpdateDelBusinessData()` dispatches the post-save hook via the form/module's `sSaveProName` column, but in production that column holds the corresponding `Sp_Check_s` name, never `Sp_afterSave_s` — candidate for maintainer audit. The wrapper-plus-worker pair is decommissioned legacy. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sCio.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sCio.md index 00b95d8..0f19c32 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sCio.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sCio.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Customer-审核 reverse-write (`sCio` short-code, "客户审核反写数量"). Thin save-phase wrapper in the historic `Sp_afterSave_s` family — each member is a 1-line delegator to `Sp_saveReturn_s` with `iFlag=2` (the "after save" phase code). For `_sCio` the worker is `Sp_saveReturn_sCio`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sCio(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate `@sCode`/`@sReturn` to its own OUT params. + +**Invocation:** Status: appears orphaned. No caller found in any channel (`gdsmodule.sSaveProName`/`sCalcProName`/`sProcName`, form-master, other routines, xly-src grep) — same decommissioned-legacy condition as the rest of the `Sp_afterSave_*` family; production save-phase hooks dispatch to `Sp_Check_s` instead. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sCldApply.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sCldApply.md index 717f4ca..f930306 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sCldApply.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sCldApply.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 子产品出库申请 (sub-product issue-out application) — thin save-phase wrapper in the historic `Sp_afterSave_s` family. Each member is a 1-line delegator to `Sp_saveReturn_s` with `iFlag=2` (the "after save" phase code). For `_sCldApply` the worker is `Sp_saveReturn_sCldApply` ("子产品领用申请反写"). + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sCldApply(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate `@sCode`/`@sReturn` to its own OUT params. + +**Invocation:** Status: appears orphaned. No caller found in any channel (`gdsmodule.sSaveProName`/`sCalcProName`/`sProcName`, form-master, other routines, xly-src grep) — same decommissioned-legacy condition as the rest of the `Sp_afterSave_*` family; production save-phase hooks dispatch to `Sp_Check_s` instead. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sCmt.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sCmt.md index d03e208..5944c13 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sCmt.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sCmt.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购到货 / 材料检验 (purchase-receipt / materials-inspection) — thin save-phase wrapper in the historic `Sp_afterSave_s` family. Each member is a 1-line delegator to `Sp_saveReturn_s` with `iFlag=2` (the "after save" phase code). For `_sCmt` the worker is `Sp_saveReturn_sCmt` ("采购到货、材料检验反写数量") — meant to reverse-write received-qty onto the source purchase-order rows. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sCmt(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate `@sCode`/`@sReturn` to its own OUT params. + +**Invocation:** Status: appears orphaned. No caller found in any channel (`gdsmodule.sSaveProName`/`sCalcProName`/`sProcName`, form-master, other routines, xly-src grep) — same decommissioned-legacy condition as the rest of the `Sp_afterSave_*` family; production save-phase hooks dispatch to `Sp_Check_s` instead. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sDgd.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sDgd.md index e1f5af7..881a996 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sDgd.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sDgd.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 送货单 (delivery / shipment note) — thin save-phase wrapper in the historic `Sp_afterSave_s` family. Each member is a 1-line delegator to `Sp_saveReturn_s` with `iFlag=2` (the "after save" phase code). For `_sDgd` the worker is `Sp_saveReturn_sDgd` ("送货单单据反写") — meant to reverse-write shipped-qty onto upstream sales-order / 送货通知 rows after a 送货单 is saved. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sDgd(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Declares a `sDeliverSrc VARCHAR(100)` that is never assigned or used (template artefact). Does not propagate `@sCode`/`@sReturn` to its own OUT params. + +**Invocation:** Status: appears orphaned. No caller found in any channel (`gdsmodule.sSaveProName`/`sCalcProName`/`sProcName`, form-master, other routines, xly-src grep) — same decommissioned-legacy condition as the rest of the `Sp_afterSave_*` family; production save-phase hooks dispatch to `Sp_Check_s` instead. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sDgda.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sDgda.md index a5f7a1d..01b1f35 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sDgda.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sDgda.md @@ -23,4 +23,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料送货单 (materials-delivery note) — outlier in the historic `Sp_afterSave_s` family. Unlike its thin-wrapper siblings, this one inlines the reverse-write logic directly instead of delegating to `Sp_saveReturn_sDgda` (companion was removed or renamed). The work it does is the same: after a materials-delivery note is saved, the proc syncs the upstream 送货通知 row's `dDeliverQty`/`dMaterialsDeliverQty` to the SUM of all related 送货单 detail rows and renumbers the line numbers. + +**What it does:** Builds three dynamic UPDATE statements in `p_sMasterSql`, then splits by `;` and `PREPARE`/`EXECUTE`s each: (1) `UPDATE saldelivernotifyslave SET dDeliverQty / dMaterialsDeliverQty = SUM(non-invalid saldelivergoodsslave qty grouped by sSrcSlaveId)` for the notify-rows referenced by the saved delivery; (2) `UPDATE saldelivergoodsslave SET iDeliverLineNo = iIncrement % 1000000` to renumber lines on the saved delivery; (3) `UPDATE saldelivergoodsslave SET dReturnQty = |SUM(red-strike rows by sMinusSrcSlaveId)|` to write back 红冲 (red-strike) reversals; and a fourth block updating `mitmaterialsstorebarcode.dReturnQty/dReturnMaterialsQty` from `salrejectgoodsmaster` aggregates. + +**Invocation:** Status: appears orphaned. No caller found in any channel (`gdsmodule.sSaveProName`/`sCalcProName`/`sProcName`, form-master, other routines, xly-src grep) — same decommissioned-legacy condition as the rest of the `Sp_afterSave_*` family; production reverse-write for delivery notes flows through `Sp_Check_sDgd` instead. Candidate for maintainer audit. + +Caveats: builds and executes raw dynamic SQL via PREPARE/EXECUTE, splitting on `;` — fragile against any literal `;` inside the SQL (none present today but no escaping); JOIN-against-self pattern means the proc can be expensive on large `saldelivergoodsslave` tables. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sDgda_phone.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sDgda_phone.md index 64b863a..6377323 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sDgda_phone.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sDgda_phone.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料送货单 PDA-side variant. Distinct from the rest of the `Sp_afterSave_s` family: instead of reverse-writing into upstream rows, this proc CREATES the `saldelivergoodsslave` detail rows from the scanner barcode rows after a 材料送货 master is saved from the mobile/PDA scan-flow. + +**What it does:** Runs a single `INSERT INTO saldelivergoodsslave(...) SELECT … FROM saldelivergoodsmaster B INNER JOIN mitmaterialsstorebarcode A ON A.sParentId=B.sId LEFT JOIN elecustomer E ON B.sCustomerId=E.sId WHERE A.sParentId=sGuid GROUP BY A.sProductId, A.sWarehouseId, A.sLocationId, A.sWarehouseLocationId, A.sDefineNo, A.sDefineNo2` — collapses N scanned barcodes per product/location/define into one detail row carrying SUM(`dProductQty`), SUM(`dProductMoney`), SUM(`dGiveQty`) and a CONVERT-derived per-unit price. The customer contact/phone/sales-man/tax fields are pulled from `elecustomer` so the new detail row is self-contained without referencing the master. + +**Invocation:** Status: appears orphaned. No caller found in any channel (`gdsmodule.sSaveProName`/`sCalcProName`/`sProcName`, form-master, other routines, xly-src grep) — candidate for maintainer audit. The mobile-scan delivery flow today commits detail rows directly via the front-end's addBusinessData call, so this server-side aggregator no longer has a hook. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sDgn.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sDgn.md index 2ce6b5e..9150dcc 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sDgn.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sDgn.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 送货通知单 (delivery-notify) — thin save-phase wrapper in the historic `Sp_afterSave_s` family. Each member is a 1-line delegator to `Sp_saveReturn_s` with `iFlag=2` (the "after save" phase code). For `_sDgn` the worker is `Sp_saveReturn_sDgn` ("送货通知单反写") — meant to reverse-write notified-qty onto upstream sales-order rows after the notify-bill is saved. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sDgn(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate `@sCode`/`@sReturn` to its own OUT params. + +**Invocation:** Status: appears orphaned. No caller found in any channel (`gdsmodule.sSaveProName`/`sCalcProName`/`sProcName`, form-master, other routines, xly-src grep) — same decommissioned-legacy condition as the rest of the `Sp_afterSave_*` family; production save-phase hooks dispatch to `Sp_Check_s` instead. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sGYKK.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sGYKK.md index 120857b..9dfe80c 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sGYKK.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sGYKK.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 供应商扣款 (supplier-deduction / chargeback) — thin save-phase wrapper in the historic `Sp_afterSave_s` family. The `_sGYKK` short-code (GYS-KK = 供应商-扣款) is the only all-caps variant in the family. Each member is a 1-line delegator to `Sp_saveReturn_s` with `iFlag=2`. For `_sGYKK` the worker is `Sp_saveReturn_sGYKK` ("供应商扣款单据反写"). + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sGYKK(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Unlike its siblings, this wrapper **does** copy `@sCode` and `@sReturn` back into its own OUT params after the worker call. + +**Invocation:** Status: appears orphaned. No caller found in any channel (`gdsmodule.sSaveProName`/`sCalcProName`/`sProcName`, form-master, other routines, xly-src grep) — same decommissioned-legacy condition as the rest of the `Sp_afterSave_*` family; production save-phase hooks dispatch to `Sp_Check_s` instead. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sLok.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sLok.md index a1cfdb0..01d36fe 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sLok.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sLok.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 物流对账 (logistics reconciliation) — thin save-phase wrapper in the historic `Sp_afterSave_s` family. Each member is a 1-line delegator to `Sp_saveReturn_s` with `iFlag=2` (the "after save" phase code). For `_sLok` the worker is `Sp_saveReturn_sLok` ("物流对账反写") — meant to reverse-write reconciled status onto upstream 物流单 rows after the reconciliation bill is saved. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sLok(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate `@sCode`/`@sReturn` to its own OUT params. + +**Invocation:** Status: appears orphaned. No caller found in any channel (`gdsmodule.sSaveProName`/`sCalcProName`/`sProcName`, form-master, other routines, xly-src grep) — same decommissioned-legacy condition as the rest of the `Sp_afterSave_*` family; production save-phase hooks dispatch to `Sp_Check_s` instead. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sLos.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sLos.md index 2903e4e..0154060 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sLos.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sLos.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 物流单 (logistics / freight bill) — thin save-phase wrapper in the historic `Sp_afterSave_s` family. Each member is a 1-line delegator to `Sp_saveReturn_s` with `iFlag=2` (the "after save" phase code). For `_sLos` the worker is `Sp_saveReturn_sLos` ("物流单单据反写") — meant to reverse-write freight info onto upstream 送货 rows after the 物流单 is saved. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sLos(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. A `-- select aa from bb;` comment is left in the body (debug scaffolding). Does not propagate `@sCode`/`@sReturn` to its own OUT params. + +**Invocation:** Status: appears orphaned. No caller found in any channel (`gdsmodule.sSaveProName`/`sCalcProName`/`sProcName`, form-master, other routines, xly-src grep) — same decommissioned-legacy condition as the rest of the `Sp_afterSave_*` family; production save-phase hooks dispatch to `Sp_Check_s` instead. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sMad.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sMad.md index be5cb8d..9384873 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sMad.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sMad.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 材料调拨 (materials-transfer / inter-warehouse move) — thin save-phase wrapper in the historic `Sp_afterSave_s` family. Each member is a 1-line delegator to `Sp_saveReturn_s` with `iFlag=2` (the "after save" phase code). For `_sMad` the worker is `Sp_saveReturn_sMad` ("新增调拨申请反写") — meant to reverse-write transferred-qty onto the source 调拨申请 rows after the 材料调拨 is saved. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sMad(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate `@sCode`/`@sReturn` to its own OUT params. + +**Invocation:** Status: appears orphaned. No caller found in any channel (`gdsmodule.sSaveProName`/`sCalcProName`/`sProcName`, form-master, other routines, xly-src grep) — same decommissioned-legacy condition as the rest of the `Sp_afterSave_*` family; production save-phase hooks dispatch to `Sp_Check_s` instead. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sMpa.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sMpa.md index 018de04..373efee 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sMpa.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sMpa.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 领料申请单据 / 补料申请单据 / 补版申请单据 → MES单据 → 生产执行 — header says 领料申请存后反写数量. Thin save-phase wrapper in the `Sp_afterSave_s` family that delegates the actual qty back-write to `Sp_saveReturn_sMpa`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sMpa(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Reached on two paths. (1) `Sp_Check_sMpa` (the save-commit dispatch proc bound via `gdsmodule.sSaveProName` on 领料申请/补料申请/补版申请单据) calls this proc near the tail of a successful save. (2) `Sp_Invalid_backwriting` dispatches to this proc on 作废/取消作废 of form `101251240115016082594412050` (产品工艺卡), which is itself triggered by Java `CheckmodelServiceImpl` through `Sp_Invalidation`. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sMpt.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sMpt.md index ac8b6cc..d9c029e 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sMpt.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sMpt.md @@ -23,4 +23,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 产品工艺卡 → 产品档案及SOP → 产品管理 — header says 产品工艺卡保存后反写状态. Unlike the rest of the `Sp_afterSave_s` family this member does its work inline rather than delegating to `Sp_saveReturn_sMpt`: when a 产品工艺卡 is saved, copy the technology-card id back onto every linked 销售机会产品 and 销售开发计划 row so downstream reports/quotes see the latest 工艺 head. + +**What it does:** When `sGuid` is non-empty, dynamically PREPAREs and EXECUTEs two `UPDATE` statements against `salsaleschanceproduct` and `salsalesdevplanmaster`. Each update joins through `mftproductslave` (where `sSrcSlaveId` traces upward to the just-saved 工艺卡 row) up to `mftproductmaster` and writes `sProductTechnologyId = M.sId`. Tenant-scoped by `sBrId` / `sSuId`. Splits the concatenated SQL string on `;`, runs each fragment via PREPARE/EXECUTE/DEALLOCATE. + +**Invocation:** Reached on two paths. (1) `Sp_Check_sMpt` (save-commit dispatch) calls this proc near the tail of a successful save. (2) `Sp_Invalid_backwriting` dispatches to this proc on 作废/取消作废 of form `101251240115016082594412050` (产品工艺卡), itself triggered by Java `CheckmodelServiceImpl` via `Sp_Invalidation`. + +Caveat: `Sp_Check_sMpt` is not currently bound to any `gdsmodule.sSaveProName`/`sSaveProNameBefore` slot — the save-commit dispatch path may only fire when forms are wired manually. The Invalid path is the more reliable trigger. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sOdt.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sOdt.md index 4138d48..e69190f 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sOdt.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sOdt.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 发外检验单据 → 质量管理单据 → 质量管理 (also 发外检验(mobile单据) → 功能操作 → 移动端管理). Header says 发外检验存后反写数量. Thin save-phase wrapper in the `Sp_afterSave_s` family that delegates the qty back-write to `Sp_saveReturn_sOdt`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sOdt(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate the inner `@sCode`/`@sReturn` to its own OUT params. + +**Invocation:** Reached on two paths. (1) `Sp_Check_sOdt` (bound via `gdsmodule.sSaveProName` on 发外检验单据 and 发外检验(mobile单据)) calls this proc near the tail of a successful save. (2) `Sp_Invalid_backwriting` dispatches to this proc on 作废/取消作废 of form `15827076660008241075501010830000` (发外检验单据), itself triggered by Java `CheckmodelServiceImpl` via `Sp_Invalidation`. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sOis.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sOis.md index cbf6661..a7fbcb2 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sOis.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sOis.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 工序发外确认 → 发外加工流程 → KPI流程操作菜单 (also 发外报工(mobile单据)/工序发外确认单据 under 功能操作 → 移动端管理). Header says 工序发外确认后反写数量. Thin save-phase wrapper in the `Sp_afterSave_s` family that delegates the qty back-write to `Sp_saveReturn_sOis`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sOis(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate the inner `@sCode`/`@sReturn` to its own OUT params. + +**Invocation:** Reached on two paths. (1) `Sp_Check_sOis` (bound via `gdsmodule.sSaveProName` on 工序发外确认 / 发外报工(mobile单据) / 工序发外确认单据) calls this proc near the tail of a successful save. (2) `Sp_Invalid_backwriting` dispatches to this proc on 作废/取消作废 of form `192116810113315234275562360` (工序发外确认), itself triggered by Java `CheckmodelServiceImpl` via `Sp_Invalidation`. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sOiv.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sOiv.md index 56a99f6..647fd37 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sOiv.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sOiv.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 发外发票 → 发外加工流程 → KPI流程操作菜单 — header says 发外发票保存后反写报价数量. Thin save-phase wrapper in the `Sp_afterSave_s` family that delegates the qty back-write to `Sp_saveReturn_sOiv`. Body comment 反写报价数量 indicates downstream effect is to refresh quoted-qty on upstream reconciliation/PO rows once an outsource-side invoice is booked. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sOiv(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate the inner `@sCode`/`@sReturn` to its own OUT params. A `-- set sCode = 1;` debug comment sits below the inner BEGIN. + +**Invocation:** Reached only through `Sp_Check_sOiv`, which is bound via `gdsmodule.sSaveProName` on 发外发票. Not present in the `Sp_Invalid_backwriting` form-id dispatch table — invalidate/un-invalidate of 发外发票 does not currently re-trigger the qty back-write. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sOpc.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sOpc.md index d51e43a..77b8135 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sOpc.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sOpc.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 工序发外 → 发外加工流程 → KPI流程操作菜单 — header says 工序发外保存后反写数量. Thin save-phase wrapper in the `Sp_afterSave_s` family that delegates the qty back-write to `Sp_saveReturn_sOpc`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sOpc(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate the inner `@sCode`/`@sReturn` to its own OUT params. + +**Invocation:** Reached on two paths. (1) `Sp_Check_sOpc` (bound via `gdsmodule.sSaveProName` on 工序发外) calls this proc at the tail of a successful save. (2) `Sp_Invalid_backwriting` dispatches to this proc on 作废/取消作废 of form `101801153119616594919790770` (a stale 工序发外 form-id no longer present in `gdsmodule` but kept in the dispatch table for legacy installs), itself triggered by Java `CheckmodelServiceImpl` via `Sp_Invalidation`. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sOpi.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sOpi.md index b66faa1..2dc8a9f 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sOpi.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sOpi.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 整单发外入库 → 发外加工流程 → KPI流程操作菜单 — header says 成品外购入库保存后反写数量. Thin save-phase wrapper in the `Sp_afterSave_s` family that delegates the qty back-write to `Sp_saveReturn_sOpi`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sOpi(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate the inner `@sCode`/`@sReturn` to its own OUT params. + +**Invocation:** Reached on two paths. (1) `Sp_Check_sOpi` (bound via `gdsmodule.sSaveProName` on 整单发外入库) calls this proc at the tail of a successful save. (2) `Sp_Invalid_backwriting` dispatches to this proc on 作废/取消作废 of form `192116810113315235917608210` (整单发外入库), itself triggered by Java `CheckmodelServiceImpl` via `Sp_Invalidation`. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sOpkg.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sOpkg.md index 3090497..896eb51 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sOpkg.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sOpkg.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 发外对账 → 发外加工流程 → KPI流程操作菜单 — header says 发外发票后反写数量 (the header is mis-copied from the `sOiv` invoice variant; the actual business is outsource-reconciliation, not invoice). Thin save-phase wrapper in the `Sp_afterSave_s` family that delegates the qty back-write to `Sp_saveReturn_sOpkg`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sOpkg(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate the inner `@sCode`/`@sReturn` to its own OUT params. + +**Invocation:** Reached on three paths. (1) The 发外对账 gdsmodule row binds this proc directly into `sDeleteProName` — the only live member of the family that occupies its own `gdsmodule` slot rather than relying solely on the `Sp_Check_s` save chain. (2) `Sp_Check_sOpkg` (bound via `gdsmodule.sSaveProName` on the same 发外对账 row) calls this proc at the tail of a successful save. (3) `Sp_Invalid_backwriting` dispatches to this proc on 作废/取消作废 of form `192116810113315235850403280` (发外对账), itself triggered by Java `CheckmodelServiceImpl` via `Sp_Invalidation`. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sOpn.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sOpn.md index 130be48..61c4678 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sOpn.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sOpn.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 发外到货 (outsource-delivery receipt) — historically lived under 发外加工流程 → KPI流程操作菜单 but the binding has decayed. Header says 发外到货存后反写数量. Thin save-phase wrapper in the `Sp_afterSave_s` family that delegates the qty back-write to `Sp_saveReturn_sOpn`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sOpn(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate the inner `@sCode`/`@sReturn` to its own OUT params. + +**Invocation:** Status: appears orphaned. `Sp_Check_sOpn` (the would-be save-commit caller) is not bound to any `gdsmodule.sSaveProName`/`sSaveProNameBefore` slot, so the save chain does not fire. `Sp_Invalid_backwriting` dispatches to this proc on form-ids `101801153119616635492000790` and `101801153119616635492273100`, both of which are absent from the current `gdsmodule` table — stale dispatch entries from an earlier deployment. No live caller found in any channel (form-master, current gdsmodule hooks, xly-src). Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sOpn1.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sOpn1.md index 61dc1cb..df2a77b 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sOpn1.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sOpn1.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Numbered variant of `Sp_afterSave_sOpn` (发外到货 — outsource-delivery receipt). Body is identical to `_sOpn` (still delegates to `Sp_saveReturn_sOpn`, not to a separate `_sOpn1` worker), so the "1" suffix is a fork-without-divergence — same logic, different name reservation. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sOpn(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate the inner `@sCode`/`@sReturn` to its own OUT params. + +**Invocation:** Status: appears orphaned. Only routine-caller is `Sp_Check_sOpn1`, which has no `gdsmodule` binding (no form's save-commit chain dispatches into it). Not present in the `Sp_Invalid_backwriting` form-id dispatch table. No xly-src refs. Candidate for maintainer audit — likely a placeholder for a 发外到货 mobile/variant form that was never wired up. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sOpp.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sOpp.md index 940b3ad..2fac52c 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sOpp.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sOpp.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 整单发外 → 发外加工流程 → KPI流程操作菜单 — header says 成品外购后反写数量 (mis-copied — actual is whole-order outsource, not finished-goods purchase). Thin save-phase wrapper in the `Sp_afterSave_s` family that delegates the qty back-write to `Sp_saveReturn_sOpp`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sOpp(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate the inner `@sCode`/`@sReturn` to its own OUT params. + +**Invocation:** Reached on two paths. (1) `Sp_Check_sOpp` (bound via `gdsmodule.sSaveProName` on 整单发外) calls this proc at the tail of a successful save. (2) `Sp_Invalid_backwriting` dispatches to this proc on 作废/取消作废 of form `192116810113315234963208090` (整单发外), itself triggered by Java `CheckmodelServiceImpl` via `Sp_Invalidation`. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sOsa.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sOsa.md index 624ce8d..b0b52a6 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sOsa.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sOsa.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Header says 采购到货保存后反写报价数量 ("Procurement Arrival - after-save back-write quoted qty"). Thin save-phase wrapper in the `Sp_afterSave_s` family that delegates the qty back-write to `Sp_saveReturn_sOsa`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sOsa(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate the inner `@sCode`/`@sReturn` to its own OUT params. A `-- set sCode = 1;` debug comment sits below the inner BEGIN. + +**Invocation:** Status: appears orphaned. Only routine-caller is `Sp_Check_sOsa`, which has no `gdsmodule` binding (no form's save-commit chain dispatches into it). Not present in the `Sp_Invalid_backwriting` form-id dispatch table. No xly-src refs. Candidate for maintainer audit — most likely a parallel-naming artefact for a 采购到货 variant that was never wired up (the live 采购到货 variant uses the `_sPca` member). diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sPaj.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sPaj.md index 64b7e31..5cfffd4 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sPaj.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sPaj.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Header says 成品调拨保存后反写报价数量 ("Finished-Goods Transfer - after-save back-write quoted qty"). Thin save-phase wrapper in the `Sp_afterSave_s` family — and notable for being mis-coded: the body delegates to `Sp_saveReturn_sOsa` (the 采购到货 worker) rather than to a `_sPaj` worker. Copy-paste artefact from the `_sOsa` template that was never specialised. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sOsa(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate the inner `@sCode`/`@sReturn` to its own OUT params. A `-- set sCode = 1;` debug comment sits below the inner BEGIN. + +**Invocation:** Status: appears orphaned. No caller found in any channel — `Sp_Check_sPaj` has no `gdsmodule` binding, not present in the `Sp_Invalid_backwriting` form-id dispatch table, no xly-src refs. Candidate for maintainer audit — the proc both lacks a caller and would back-write to the wrong worker if it were invoked. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sPca.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sPca.md index c869e38..dddf229 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sPca.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sPca.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购到货(送检)单据 → 材料库单据 → 材料库存 — header says 采购到货保存后反写数量. Thin save-phase wrapper in the `Sp_afterSave_s` family that delegates the qty back-write to `Sp_saveReturn_sPca`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sPca(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate the inner `@sCode`/`@sReturn` to its own OUT params. + +**Invocation:** Reached via `Sp_Invalid_backwriting` (Java `CheckmodelServiceImpl` → `Sp_Invalidation`) on 作废/取消作废 of form `101251240115016068096930620` (采购到货(送检)单据). The save-commit chain through `Sp_Check_sPca` is also wired (Sp_Check_sPca's body calls this), though `Sp_Check_sPca` itself is currently not bound to any `gdsmodule.sSaveProName` slot — the dispatch is dynamic, likely through a parent module-tree binding. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sPca1.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sPca1.md index 38d44f4..2df3d8f 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sPca1.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sPca1.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Numbered variant of `Sp_afterSave_sPca` (采购到货(送检)单据). Body still delegates to `Sp_saveReturn_sPca` (not `_sPca1`) — same logic, different name reservation. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sPca(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate the inner `@sCode`/`@sReturn` to its own OUT params. + +**Invocation:** Status: appears orphaned. Only routine-caller is `Sp_Check_sPca1`, which has no `gdsmodule` binding. Not present in the `Sp_Invalid_backwriting` form-id dispatch table. No xly-src refs beyond install SQL. Candidate for maintainer audit — likely a placeholder for a 采购到货 variant form that was never wired up. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sPct.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sPct.md index e4cbda4..2c46dad 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sPct.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sPct.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 工序检验单据 → 质量管理单据 → 质量管理 — header says 品质首检(mobile单据)存后反写数量 (the header is mis-copied from the mobile `_sPct1` sibling; the form-id `Sp_Invalid_backwriting` dispatches into this proc points at 工序检验单据). Thin save-phase wrapper in the `Sp_afterSave_s` family that delegates the qty back-write to `Sp_saveReturn_sPct`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sPct(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate the inner `@sCode`/`@sReturn` to its own OUT params. + +**Invocation:** Reached via `Sp_Invalid_backwriting` (Java `CheckmodelServiceImpl` → `Sp_Invalidation`) on 作废/取消作废 of form `15818303350003257780407017498600` (工序检验单据). The save-commit chain through `Sp_Check_sPct` is also wired (its body calls this), though `Sp_Check_sPct` itself currently has no `gdsmodule` binding — likely dispatched dynamically by a parent-module entry. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sPct1.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sPct1.md index 02e8cb1..2138a3a 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sPct1.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sPct1.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 品质首检(mobile单据) → 功能操作 → 移动端管理 → 现场 — header says 品质首检(mobile单据)存后反写数量. Mobile-form sibling of `Sp_afterSave_sPct`; unlike `_sPct` which uses the shared `Sp_saveReturn_sPct` worker, this one delegates to a dedicated `Sp_saveReturn_sPct1` worker keyed to the mobile-form schema. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sPct1(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate the inner `@sCode`/`@sReturn` to its own OUT params. + +**Invocation:** Reached via `Sp_Invalid_backwriting` (Java `CheckmodelServiceImpl` → `Sp_Invalidation`) on 作废/取消作废 of form `12012615914116373957014740` (品质首检(mobile单据)). The save-commit chain through `Sp_Check_sPct1` is also wired (its body calls this), though `Sp_Check_sPct1` itself currently has no `gdsmodule` binding — dispatched dynamically by a parent-module entry. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sPdt.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sPdt.md index cf080b5..399b35b 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sPdt.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sPdt.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成品检验单据 → 质量管理单据 → 质量管理 — header says 成品检验存后反写数量. Thin save-phase wrapper in the `Sp_afterSave_s` family that delegates the qty back-write to `Sp_saveReturn_sPdt`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sPdt(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate the inner `@sCode`/`@sReturn` to its own OUT params. + +**Invocation:** Reached via `Sp_Invalid_backwriting` (Java `CheckmodelServiceImpl` → `Sp_Invalidation`) on 作废/取消作废 of form `15831288240001057224508428921300` (成品检验单据). The save-commit chain through `Sp_Check_sPdt` is also wired (its body calls this), though `Sp_Check_sPdt` itself currently has no `gdsmodule` binding — dispatched dynamically by a parent-module entry. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sPis.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sPis.md index d6d42bd..acc11c1 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sPis.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sPis.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购入库 → 物料采购流程 → KPI流程操作菜单 — header says 采购入库保存后反写数量. Thin save-phase wrapper in the `Sp_afterSave_s` family that delegates the qty back-write to `Sp_saveReturn_sPis`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sPis(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate the inner `@sCode`/`@sReturn` to its own OUT params. + +**Invocation:** Reached on two paths. (1) `Sp_Check_sPis` (bound via `gdsmodule.sSaveProName` on 采购入库) calls this proc at the tail of a successful save. (2) `Sp_Invalid_backwriting` dispatches to this proc on 作废/取消作废 of form `192116810113315220315711060` (采购入库), itself triggered by Java `CheckmodelServiceImpl` via `Sp_Invalidation`. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sPiv.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sPiv.md index 14679f8..a225698 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sPiv.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sPiv.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购发票 → 物料采购流程 → KPI流程操作菜单 — header says 采购发票保存后反写报价数量. Thin save-phase wrapper in the `Sp_afterSave_s` family that delegates the qty back-write to `Sp_saveReturn_sPiv`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sPiv(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate the inner `@sCode`/`@sReturn` to its own OUT params. A `-- set sCode = 1;` debug comment sits below the inner BEGIN. + +**Invocation:** Reached only through `Sp_Check_sPiv`, which is bound via `gdsmodule.sSaveProName` on 采购发票. Not present in the `Sp_Invalid_backwriting` form-id dispatch table — invalidate/un-invalidate of 采购发票 does not currently re-trigger the qty back-write. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sPkg.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sPkg.md index 6d19499..deea82e 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sPkg.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sPkg.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购对账 → 物料采购流程 → KPI流程操作菜单 — header says 采购发票(对账)保存后反写数量. Save-phase 反写 wrapper in the `Sp_afterSave_s` family for 采购对账 (purchase reconciliation) bills. Unlike most family members this one carries non-trivial body logic: it redistributes master-grouped purchase qty/auxiliary-qty totals back across the per-batch `purpurchasecheckingdetail` rows that source them, then calls the standard `Sp_saveReturn_sPkg` to apply the back-write. + +**What it does:** counts master groups in `purpurchasecheckingslave` (grouped by `sMaterialsId`/`sMaterialsStyle`/`sParentId`); for each group, runs a nested cursor over `purpurchasecheckingdetail` ordered by `dAuxiliaryQty` ASC and distributes the slave's total `dMaterialsQty`/`dAuxiliaryQty` across detail rows — early rows get their full `dSrcQty`/`dSrcAuxiliaryQty`, the remainder consumes the residual on the final row. Then double-quote-wraps `sGuid` and calls `Sp_saveReturn_sPkg(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). + +**Invocation:** Called by `Sp_Check_sPkg` (the save-commit dispatch proc bound via `gdsmodule.sSaveProName` on 采购对账) after a successful save; also dispatched by `Sp_Invalid_backwriting` for form sId `192116810113315220489243410` (采购对账) on 作废/取消作废, triggered from Java `CheckmodelServiceImpl` via `Sp_Invalidation`. Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sPmd.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sPmd.md index feb29b5..969eee7 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sPmd.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sPmd.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 1/1 新增生产补料 / 生产领料单据 / 来料入库单据 → 物料领用流程 → KPI流程操作菜单 — header says 生产领料存后反写数量. Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family that delegates the actual qty back-write to `Sp_saveReturn_sPmd`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sPmd(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Reached on two paths. (1) `Sp_Check_sPmd` (the save-commit dispatch proc bound via `gdsmodule.sSaveProName` on 1/1 新增生产补料 + 生产领料单据 + 来料入库单据) calls this proc near the tail of a successful save. (2) `Sp_Invalid_backwriting` dispatches to this proc on 作废/取消作废 of forms `192116810113315226492535760` (生产领料), `192116810113315222184074940` (1/1 新增生产补料) and `101251240115015878867179910` (来料入库), itself triggered from Java `CheckmodelServiceImpl` via `Sp_Invalidation`. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sPmt.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sPmt.md index ce8eeb6..4711b72 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sPmt.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sPmt.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 付款单 → 财务收付款 → KPI流程操作菜单 — catalog header says 付款单保存前反写数量 but the routine is the after-save (iFlag=2) wrapper, not the before-save (header label is misleading). Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family that delegates the actual money back-write to `Sp_saveReturn_sPmt`. + +**What it does:** Declares unused local vars (`iPayType`, `iOutType`), wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sPmt(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Reached on two paths. (1) `Sp_Check_sPmt` (the save-commit dispatch proc bound via `gdsmodule.sSaveProName` on 付款单) calls this proc near the tail of a successful save. (2) `Sp_Invalid_backwriting` dispatches to this proc on 作废/取消作废 of form `192116810113315233387186220` (付款单), itself triggered from Java `CheckmodelServiceImpl` via `Sp_Invalidation`. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sPod.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sPod.md index 91dedab..d805360 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sPod.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sPod.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购订单 → 物料采购流程 → KPI流程操作菜单 — header says 采购订单保存后反写数量. Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family that delegates the actual qty back-write to `Sp_saveReturn_sPod`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sPod(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Reached on two paths. (1) `Sp_Check_sPod` (the save-commit dispatch proc bound via `gdsmodule.sSaveProName` on 采购订单) calls this proc near the tail of a successful save. (2) `Sp_Invalid_backwriting` dispatches to this proc on 作废/取消作废 of form `192116810113315217757747140` (采购订单), itself triggered from Java `CheckmodelServiceImpl` via `Sp_Invalidation`. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sPpa.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sPpa.md index 4ea46e8..4694526 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sPpa.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sPpa.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 采购申请单据 → 采购明细 → 采购管理 — header says 采购申请保存后反写数量. Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family that delegates the actual qty back-write to `Sp_saveReturn_sPpa`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sPpa(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Reached on two paths. (1) `Sp_Check_sPpa` calls this proc near the tail of a successful save — note `gdsmodule.sSaveProName` slot on 采购申请单据 is currently empty, so `Sp_Check_sPpa` itself is not the live save-commit dispatcher; the form may rely on the dispatch path below. (2) `Sp_Invalid_backwriting` dispatches to this proc on 作废/取消作废 of form `192116810113315217105813660` (采购申请单据), itself triggered from Java `CheckmodelServiceImpl` via `Sp_Invalidation`. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sPpr.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sPpr.md index e05de80..be149bd 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sPpr.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sPpr.md @@ -24,4 +24,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 产量上报 → 订单生产流程 → KPI流程操作菜单 — header says 产量上报保存后反写数量. Save-phase wrapper in the `Sp_afterSave_s` family for 产量上报 (production-quantity-report) bills. Unlike most siblings this one carries real body logic on top of the standard `Sp_saveReturn_sPpr` delegation: an 超报校验 (over-report validation) guard plus several housekeeping updates on `mftproductionreportslave` / `mftproductionreportemployee`. + +**What it does:** Sets `iFlag` default 0 and `sReturn` empty; when `iFlag=0` builds a temporary table `p_Root_MftProductionReportSlave` joining `MftProductionReportSlave` → `mftproductionplanslave` and compares `SUM(dProcessQty)` of all report rows against the plan's `dProcessQty`; if any process is over-reported it emits the `sOverReport` i18n message and `LEAVE top` with `sCode=-7`. Then deletes empty-employee rows from `mftproductionreportemployee`; recomputes `dOtherHour`/`dAllHour`/`dSumEmpNum`/`dEmpHour` on `mftproductionreportslave`; reads the `CbxProductionReport` setting from `SysSystemSettings`; finally calls `Sp_saveReturn_sPpr(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. + +**Invocation:** Status: appears dormant. Both known call sites are commented out — `Sp_Check_sPpr` (the proc bound via `gdsmodule.sSaveProName` on 产量上报) has its `call Sp_afterSave_sPpr(...)` block commented, and the `Sp_Invalid_backwriting` dispatch branch for `sFormGuid='19211681019715476042694840'` (产量上报) is also commented. No live caller found in any channel — candidate for maintainer audit. + +Caveats: uses `sGuId` (capital `I`) in several queries while the parameter is `sGuid` — relies on MySQL identifier case-insensitivity, but the inconsistency is worth flagging. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sPrj.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sPrj.md index 5c12290..a9ec5b5 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sPrj.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sPrj.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 2/4 新增采购退货 → 物料采购流程 → KPI流程操作菜单 — header says 采购退货保存后反写报价数量. Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family that delegates the actual qty back-write to `Sp_saveReturn_sPrj`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sPrj(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Status: appears dormant. Its only caller `Sp_Check_sPrj` is itself orphan: `gdsmodule.sSaveProName` slot on form `192116810113315221425660510` (2/4 新增采购退货) is empty, and the live `sProcName` is `Sp_Calc_sPrj` — so `Sp_Check_sPrj` is not bound on any module. `Sp_Invalid_backwriting` has no dispatch entry for this form. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sPst.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sPst.md index 9b7b3ca..abc2a2c 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sPst.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sPst.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成品入库 → 销售送货流程 → KPI流程操作菜单 — header says 成品入库保存后反写数量. Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family that delegates the actual qty back-write to `Sp_saveReturn_sPst`. + +**What it does:** Declares unused local `sDeliverSrc`, wraps `sGuid` in double-quotes if not already quoted, then unconditionally calls `Sp_saveReturn_sPst(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). Body carries several large commented-out blocks (`UPDATE qlyproducttestmaster`, `MftWorkOrderSlave`, `mftproductionplanbillslave`) that were once dynamic-SQL aggregators distributing `pitproductinstoreslave` totals upstream — all currently inert. Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Reached on two paths. (1) `Sp_Check_sPst` (the save-commit dispatch proc bound via `gdsmodule.sSaveProName` on 成品入库) calls this proc near the tail of a successful save. (2) `Sp_Invalid_backwriting` dispatches to this proc on 作废/取消作废 of form `192116810113315228246447250` (成品入库), itself triggered from Java `CheckmodelServiceImpl` via `Sp_Invalidation`. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sPtr.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sPtr.md index 94174a0..a88bfc8 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sPtr.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sPtr.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 成品领用单据 → 出库管理 → 成品库存 — header says 报废单保存后反写数量 (label refers to the earlier 报废 use of the form; current bind is 成品领用). Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family that delegates the actual qty back-write to `Sp_saveReturn_sPtr`. + +**What it does:** Declares unused locals `p_sMasterSql`/`sDeliverSrc`, wraps `sGuid` in double-quotes if not already quoted, then unconditionally calls `Sp_saveReturn_sPtr(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). The body carries a large commented-out dynamic-SQL block that was once a `salchildproductapplyslave` aggregator over `pitproductrejectslave` — inert. Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Called by `Sp_Check_sPtr` (the save-commit dispatch proc bound via `gdsmodule.sSaveProName` on 成品领用单据 `101251240115015920999005840`) near the tail of a successful save. `Sp_Invalid_backwriting` has no dispatch entry for this form. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sQtt.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sQtt.md index eb51f4f..3cc58fd 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sQtt.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sQtt.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 01/04【新增】新报价单 → 估价管理流程 → KPI流程操作菜单 — header says 估价单保存后反写状态. Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family that delegates the actual qty/state back-write to `Sp_saveReturn_sQtt`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and unconditionally calls `Sp_saveReturn_sQtt(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). The body carries a large commented-out dynamic-SQL block that was once a `salsaleschanceproduct.sQuotationId` propagator across `quoquotationslave` joins — inert. Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Reached on two paths. (1) `Sp_Check_sQtt` (the save-commit dispatch proc bound via `gdsmodule.sSaveProName` on 01/04【新增】新报价单) calls this proc near the tail of a successful save. (2) `Sp_Invalid_backwriting` dispatches to this proc on 作废/取消作废 of form `101251240115016076506222050` (报价单), itself triggered from Java `CheckmodelServiceImpl` via `Sp_Invalidation`. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sRct.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sRct.md index 7bc0395..e3fdeaf 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sRct.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sRct.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 收款单 → 财务收付款 → KPI流程操作菜单 — header says 收款单保存后反写数量. Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family that delegates the actual money back-write to `Sp_saveReturn_sRct`. + +**What it does:** Declares unused locals `iReceivablesType`/`CbxAdvanceType`, wraps `sGuid` in double-quotes if not already quoted, then unconditionally calls `Sp_saveReturn_sRct(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). The body carries a very large commented-out block that would once have switched on `SysSystemSettings.CbxAdvanceType` / `CbxReceivablesType` and updated `dRealAdvanceMoney` / `dReceiptMoney` on the corresponding salesorder/workorder/delivergoods/saleschance master + slave — inert. Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Reached on three paths. (1) `Sp_Check_sRct` (the save-commit dispatch proc bound via `gdsmodule.sSaveProName` on 收款单) calls this proc near the tail of a successful save. (2) `Sp_Check_sRcts` and the backup `Sp_Check_sRct_copy1` also reference it. (3) `Sp_Invalid_backwriting` dispatches to this proc on 作废/取消作废 of form `192116810113315231731646200` (收款单). diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sRct_copy1.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sRct_copy1.md index 1735e8c..6044538 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sRct_copy1.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sRct_copy1.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Backup / snapshot variant of `Sp_afterSave_sRct` (`_copy1` suffix). Per wiki convention, backup objects are not narrated (see [the index](../../index.md#whats-out-of-scope)). + +**What it does:** Same as `Sp_afterSave_sRct` at the time of copy. + +**Invocation:** Not expected to be called from production code; verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sRcts.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sRcts.md index ec52053..e73de79 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sRcts.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sRcts.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 收款单 (汇总变种) → 财务收付款 → KPI流程操作菜单 — header says 收款单保存后反写数量(汇总). Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family for the aggregated-receipts (`sRcts` = "Receipt Summary") variant; delegates the actual money back-write to `Sp_saveReturn_sRcts`. + +**What it does:** Declares unused locals `iReceivablesType`/`CbxAdvanceType`, wraps `sGuid` in double-quotes if not already quoted, then unconditionally calls `Sp_saveReturn_sRcts(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). The body carries a very large commented-out block that would once have set `CahReceiptMaster.dCurrencyRate=1` for RMB receipts and switched on `SysSystemSettings.CbxAdvanceType` / `CbxReceivablesType` to update `dRealAdvanceMoney` / `dReceiptMoney` across the upstream master/slave tables — inert. Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Reached on two paths. (1) `Sp_Check_sRcts` calls this proc near the tail of a successful save — note `gdsmodule.sSaveProName` slot for the receipts-summary form is empty, so `Sp_Check_sRcts` itself has no live binding; the form may rely on the dispatch path below. (2) `Sp_Invalid_backwriting` dispatches to this proc on 作废/取消作废 of form `101251240115017022732698090`. Caveat: that sFormGuid does not currently exist in `gdsconfigformmaster` or `gdsmodule` — likely a stale or tenant-specific id from an earlier deployment; this routine's live reachability in the current schema is limited. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sRgd.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sRgd.md index 496121f..5c2af09 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sRgd.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sRgd.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 2/4 新增销售退货 → 销售送货流程 → KPI流程操作菜单 — header says 退货单保存后反写数量. Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family that delegates the actual qty back-write to `Sp_saveReturn_sRgd`. + +**What it does:** Declares unused locals `p_sMasterSql`/`sDeliverSrc`, wraps `sGuid` in double-quotes if not already quoted, then unconditionally calls `Sp_saveReturn_sRgd(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Called by `Sp_Check_sRgd` (the save-commit dispatch proc bound via `gdsmodule.sSaveProName` on 2/4 新增销售退货 `11811781131121915179924871530`, with `sSaveProNameBefore='Sp_beforeSave_sRgd'`) near the tail of a successful save. `Sp_Invalid_backwriting` has no dispatch entry for this form. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sScd.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sScd.md index 9751089..6361e6b 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sScd.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sScd.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 长期合同单据 / 长期合同明细 → 销售订单管理 / 销售单据 → 销售管理 — header says 长期合同保存后反写报价数量. Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family that delegates the actual qty back-write to `Sp_saveReturn_sScd`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sScd(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Status: appears dormant. Its only caller `Sp_Check_sScd` is itself orphan: `gdsmodule.sSaveProName` slot on the 长期合同 forms is empty, and the live `sProcName` is `Sp_Calc_sScd` — so `Sp_Check_sScd` is not bound on any module. `Sp_Invalid_backwriting` has no dispatch entry for either 长期合同 form. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sSck.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sSck.md index 6173d47..2d5f0bb 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sSck.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sSck.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售对账单据 → 销售送货流程 → KPI流程操作菜单 — header says 销售对账保存后反写数量. Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family that delegates the actual qty back-write to `Sp_saveReturn_sSck`. This is one of the few family members that calls the saveReturn proc unconditionally (no `IFNULL(sGuid,'') <> ''` guard). + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted, then unconditionally calls `Sp_saveReturn_sSck(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Reached on two paths. (1) `Sp_Check_sSck` (the save-commit dispatch proc bound via `gdsmodule.sSaveProName` on 销售对账单据 `11811781131121915184849572550`) calls this proc near the tail of a successful save — note the same module also has `sSaveProName='Sp_afterSave_sSck'` recorded directly. (2) `Sp_Invalid_backwriting` dispatches to this proc on 作废/取消作废 of the same form, itself triggered from Java `CheckmodelServiceImpl` via `Sp_Invalidation`. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sScr.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sScr.md index 1fe19fe..7e718b0 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sScr.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sScr.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 派车单单据 → 10.物流单据 → 物流管理 — header says 派车单保存后反写数量. Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family that delegates the actual qty back-write to `Sp_saveReturn_sScr`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and unconditionally calls `Sp_saveReturn_sScr(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). The body carries a large commented-out dynamic-SQL block that would once have updated `saldelivergoodsslave.dSendCarQty` from `salsendcarslave` totals — inert. Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Reached only via dispatch. `Sp_Check_sScr` calls this proc, but `Sp_Check_sScr` itself has no live `gdsmodule.sSaveProName` binding — the 派车单单据 form's live `sProcName` is `Sp_Calc_sScr` and its save-handler slot is empty. The live path is `Sp_Invalid_backwriting`, which dispatches to this proc on 作废/取消作废 of form `15839936170002427227633635401000` (派车单单据), itself triggered from Java `CheckmodelServiceImpl` via `Sp_Invalidation`. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sSdp.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sSdp.md index 4837985..3651ba9 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sSdp.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sSdp.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 开发计划 / 印前任务计划 / 项目立项单据 → PLM单据 → PLM管理 — header says 开发计划保存后反写报价数量. Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family that delegates the actual qty back-write to `Sp_saveReturn_sSdp`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sSdp(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Status: appears dormant. Its only caller `Sp_Check_sSdp` is itself orphan: `gdsmodule.sSaveProName` slot on the three PLM forms (开发计划, 印前任务计划, 项目立项单据) is empty, and the live `sProcName` is `Sp_Calc_sSdp` — so `Sp_Check_sSdp` is not bound on any module. `Sp_Invalid_backwriting` has no dispatch entry for any of these forms. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sSfu.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sSfu.md index 8e8b1f3..8e33526 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sSfu.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sSfu.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 商机跟进单据 → 销售单据 → 销售管理 — header says 商机跟进存后反写数量. Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family that delegates the actual back-write to `Sp_saveReturn_sSfu` (propagates the follow-up phase `sFollowUpPhase` upstream to `salsaleschancemaster.sFlow`). + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and unconditionally calls `Sp_saveReturn_sSfu(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). The body carries a large commented-out dynamic-SQL block that would once have updated `salsaleschancemaster.sFlow` from the latest `salsalesFollowUpmaster.sFollowUpPhase` — inert. Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Reached only via dispatch. `Sp_Check_sSfu` calls this proc, but `Sp_Check_sSfu` itself has no live `gdsmodule.sSaveProName` binding. The live path is `Sp_Invalid_backwriting`, which dispatches to this proc on 作废/取消作废 of form `101251240115016035948853880` (商机跟进单据), itself triggered from Java `CheckmodelServiceImpl` via `Sp_Invalidation`. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sSiv.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sSiv.md index 4b32dad..98d2771 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sSiv.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sSiv.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 销售发票单据 → 销售送货流程 → KPI流程操作菜单 — header says 销售发票保存后反写. Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family that delegates the actual qty back-write to `Sp_saveReturn_sSiv`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sSiv(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Called by `Sp_Check_sSiv` (the save-commit dispatch proc bound via `gdsmodule.sSaveProName` on 销售发票单据 `15780358080007074056281633539000`, with the same module also recording `sSaveProName='Sp_afterSave_sSiv'` directly) near the tail of a successful save. `Sp_Invalid_backwriting` has no dispatch entry for this form. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sSmi.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sSmi.md index f66f1a1..3becb54 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sSmi.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sSmi.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 半成品入库申请 (`sgdsemigoodsinstoreapplyslave` → `sgdsemigoodsinstoreslave`) — header says 半成品入库存前反写数量 (label says "before-save" but routine is after-save iFlag=2). Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family that delegates the actual qty back-write to `Sp_saveReturn_sSmi`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and unconditionally calls `Sp_saveReturn_sSmi(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). The body carries a large commented-out dynamic-SQL block that would once have updated `sgdsemigoodsinstoreapplyslave.dProcessInStoreQty` from `sgdsemigoodsinstoreslave.dProcessQty` totals — inert. Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Reached only via dispatch. `Sp_Check_sSmi` and `Sp_Check_sSmia` both call this proc, but neither has a live `gdsmodule.sSaveProName` binding. The live path is `Sp_Invalid_backwriting`, which dispatches to this proc on 作废/取消作废 of form `101801153119616759291255520` (半成品入库申请), itself triggered from Java `CheckmodelServiceImpl` via `Sp_Invalidation`. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sSmia.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sSmia.md index f1ea53d..288ec2d 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sSmia.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sSmia.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 半成品入库申请单据 — header says 半成品入库申请存后反写数量. Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family that delegates the actual qty back-write to `Sp_saveReturn_sSmia` (the in-line `sgdsemigoodsinstoreapplyslave` → `mftworkorderprocess.dProcessInApplyQty` UPDATE chain is fully commented out). + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and calls `Sp_saveReturn_sSmia(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Reached on two paths. (1) `Sp_Check_sSmia` calls this proc near the tail of a successful save, although `Sp_Check_sSmia` itself currently has no live `gdsmodule.sSaveProName` binding in this database. (2) `Sp_Invalid_backwriting` dispatches to this proc on 作废/取消作废 of form `101801153119616759337165930` (半成品入库申请), itself triggered from Java `CheckmodelServiceImpl` via `Sp_Invalidation`. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sSmo.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sSmo.md index 06c8fd1..b39a705 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sSmo.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sSmo.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 半成品出库单据 — header says 半成品出库存后反写数量. Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family that delegates the actual qty back-write to `Sp_saveReturn_sSmo` (the in-line `sgdsemigoodsoutstoreslave` → `sgdsemigoodsoutstoreapplyslave.dProcessOutStoreQty` UPDATE chain is fully commented out). + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and calls `Sp_saveReturn_sSmo(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Reached on two paths. (1) `Sp_Check_sSmo` calls this proc near the tail of a successful save (the same `Sp_Check_sSmo` also chains a call to `Sp_afterSave_sSmoa`), although `Sp_Check_sSmo` itself currently has no live `gdsmodule.sSaveProName` binding in this database. (2) `Sp_Invalid_backwriting` dispatches to this proc on 作废/取消作废 of form `101801153119616759303641850` (半成品出库), itself triggered from Java `CheckmodelServiceImpl` via `Sp_Invalidation`. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sSmoa.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sSmoa.md index 7d65b98..49e4a63 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sSmoa.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sSmoa.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 半成品出库申请单据 — header says 半成品出库申请存后反写数量. Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family that delegates the actual qty back-write to `Sp_saveReturn_sSmoa` (the in-line `sgdsemigoodsoutstoreapplyslave` → `mftworkorderprocess.dProcessOutApplyQty` UPDATE chain is fully commented out). + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and calls `Sp_saveReturn_sSmoa(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Reached on two paths. (1) `Sp_Check_sSmoa` (and additionally `Sp_Check_sSmo`) calls this proc near the tail of a successful save, although neither `Sp_Check_s` sibling currently has a live `gdsmodule.sSaveProName` binding in this database. (2) `Sp_Invalid_backwriting` dispatches to this proc on 作废/取消作废 of form `101801153119616759337728990` (半成品出库申请), itself triggered from Java `CheckmodelServiceImpl` via `Sp_Invalidation`. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sSod.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sSod.md index 488accf..e9a0aa3 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sSod.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sSod.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 1/3 新增轮转销售订单 / 1/3 新增销售订单 → 订单生产流程 → KPI流程操作菜单 — header says 销售订单保存后反写报价数量. Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family that delegates the actual qty back-write to `Sp_saveReturn_sSod`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sSod(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Reached on two paths. (1) `Sp_Check_sSod` (the save-commit dispatch proc bound via `gdsmodule.sSaveProName` on 1/3 新增轮转销售订单 and 1/3 新增销售订单) calls this proc near the tail of a successful save; the `gdsmodule.sDeleteProName` slot on the same two modules also points here directly. (2) `Sp_Invalid_backwriting` dispatches to this proc on 作废/取消作废 of forms `101251240115016086186007360` (1/3 新增销售订单), `101251240115015878710737470` (1/3 新增轮转销售订单), `101251240115016832521864320` (轮转销售订单), `101251240115016255652064530` and `101251240115016036176643130`, itself triggered from Java `CheckmodelServiceImpl` via `Sp_Invalidation`. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sStl.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sStl.md index 6f713ff..b29e1df 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sStl.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sStl.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 财务调整单据 → 财务单据 — header says 后反写数量. Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family that delegates to `Sp_saveReturn_sStl`. + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sStl(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Status: appears dormant. `Sp_Check_sStl` exists but does not call `Sp_afterSave_sStl` internally (the save-commit chain skips this hook), and the 财务调整单据 module's `sSaveProName`/`sDeleteProName` slots are empty (only `sProcName = Sp_Calc_sStl` is bound). `Sp_Invalid_backwriting` has no dispatch entry for any 财务调整 form. No callers found in any other channel — candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sWXKK.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sWXKK.md index 5c8ba34..7c41f3b 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sWXKK.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sWXKK.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 外协入库扣款单据 (operates on `opsoutsideinstorededmaster`/`opsoutsideinstorededslave`) — header says 外协商扣款反写. Carries real save-phase logic: validates that every deduction line has a negative `dMaterialsPrice`, then rolls up the master `dOKMaterialsMoney` total before delegating downstream qty back-write to `Sp_saveReturn_sWXKK`. + +**What it does:** When `sGuid` is non-empty: (1) counts slave rows where `dMaterialsPrice > 0`; if any exist, sets `sCode = -1`, fetches the localized error via `Fun_Sis_GetConstNew('sGykkNagativeNum', ...)`, and `LEAVE top`. (2) Updates the master's `dOKMaterialsMoney = 0 - SUM(dMaterialsMoney)` over the slaves. (3) Calls `Sp_saveReturn_sWXKK(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. The further `mftqualityaccidentmaster.dBackDeductionSupplyMoney` denorm UPDATE chain is fully commented out. + +**Invocation:** Status: appears dormant. No `gdsmodule.sSaveProName`/`sDeleteProName` slot in this database points at this proc, no `Sp_Check_sWXKK` exists, `Sp_Invalid_backwriting` has no dispatch entry for any 外协扣款 form, and no other routine references it. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_sWod.md b/en/docs/auto-catalog/procedures/Sp_afterSave_sWod.md index c4c49d9..5e69cbf 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_sWod.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_sWod.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产工单 / 2/3 新增生产补单 → 订单生产流程 → KPI流程操作菜单 — header says 生产工单保存前反写数量 (label is misleading; the proc is bound on `sDeleteProName` slot and called by `Sp_Check_sWod` as the after-save hook). Thin save-phase 反写 wrapper that delegates the actual qty back-write to `Sp_saveReturn_sWod` (the in-line `MftWorkOrderSlave` → `SalSalesOrderSlave.dWorkOrderQty/dWorkOrderStockupQty/dPresentQty/dWorkSparesQty` denorm UPDATE chain is fully commented out). + +**What it does:** Wraps `sGuid` in double-quotes if not already quoted and calls `Sp_saveReturn_sWod(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Reached on two paths. (1) `Sp_Check_sWod` (the save-commit dispatch proc bound via `gdsmodule.sSaveProName` on 生产工单 + 2/3 新增生产补单 + 轮转工单) calls this proc near the tail of a successful save; on 生产工单 and 2/3 新增生产补单 the `gdsmodule.sDeleteProName` slot also points here directly. (2) `Sp_Invalid_backwriting` dispatches to this proc on 作废/取消作废 of forms `101251240115016002469445380` (生产工单), `101251240115015840916341460` (轮转工单), `101251240115015876865630390`, `101251240115015923023677080`, `101251240115016002468935320`, `101251240115016002470020610` and others, itself triggered from Java `CheckmodelServiceImpl` via `Sp_Invalidation`. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_tice.md b/en/docs/auto-catalog/procedures/Sp_afterSave_tice.md index e5fdc07..f82fd9c 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_tice.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_tice.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 设备维修通知单据 (operates on `eptmachinefixednoticeslave`/`master`) — header says 回厂通知单保存后. Thin save-phase 反写 wrapper that delegates to `Sp_saveReturn_tice` (the in-line `eptmachinefixedorderslave.dAuxiliaryFXQty` denorm UPDATE chain is fully commented out). + +**What it does:** Calls `Sp_saveReturn_tice(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Status: appears dormant. No `gdsmodule.sSaveProName`/`sDeleteProName`/`sProcName` slot in this database points at this proc (no `Sp_Calc_tice`/`Sp_Check_tice` binding either), `Sp_Invalid_backwriting` has no dispatch entry for any 设备维修通知 form, and no other routine references it. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_afterSave_tore.md b/en/docs/auto-catalog/procedures/Sp_afterSave_tore.md index cedb461..f082760 100644 --- a/en/docs/auto-catalog/procedures/Sp_afterSave_tore.md +++ b/en/docs/auto-catalog/procedures/Sp_afterSave_tore.md @@ -23,4 +23,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 设备维修入库单据 (operates on `eptmachinefixedinstoreslave`/`master`) — header says 回厂通知单保存后 (copy-pasted from the `tice` sibling). Thin save-phase 反写 wrapper that delegates to `Sp_saveReturn_tore` (the in-line `eptmachinefixednoticeslave.dAuxiliaryFXQty` denorm UPDATE chain is fully commented out). + +**What it does:** Calls `Sp_saveReturn_tore(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. + +**Invocation:** Status: appears dormant. No `gdsmodule.sSaveProName`/`sDeleteProName`/`sProcName` slot in this database points at this proc (no `Sp_Calc_tore`/`Sp_Check_tore` binding either), `Sp_Invalid_backwriting` has no dispatch entry for any 设备维修入库 form, and no other routine references it. Candidate for maintainer audit. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_EqAdjust.md b/en/docs/auto-catalog/procedures/Sp_bd_EqAdjust.md index 2ecec14..5c8d996 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_EqAdjust.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_EqAdjust.md @@ -24,4 +24,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 调机时间分析 — equipment setup-time (调机) analysis dashboard tile, reports per-machine 总生产时间 vs 有效生产时间 for yesterday's 8:30 → today's 8:00 shift window. The "valid" subset is `dAdjustableQty>0` (machine actually produced sellable output, not pure adjustment cycles). Sibling of `Sp_bd_Eqabnormal` and `Sp_bd_EqAnalysis`. + +**What it does:** Builds `p_bd_EqAdjust(iPlcNo, sMachineId, sMachineName, dTotalTime, dValidTime)` from `elemachine` rows with `iPlcNo>0` and `MOD(iPlcNo,14) BETWEEN 1 AND 12`, joins `plc_machinedata` aggregated over the yesterday-shift-start → today-shift-start window, computes `dTotalTime = SUM(sStatus<>'offwork')` and `dValidTime = SUM(dAdjustableQty>0)`, emits the table-as-JSON into `sReturn`. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_bd_EqAdjust.sql`. No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Status: reachable only via an external dashboard HTTP endpoint that invokes the proc by name. + +Flag: `MOD(iPlcNo,14)` machine-filter exempts PLCs `0` and `13, 27, 41, ...` (every 14th from 0) — tenant-specific convention for marking test PLCs; will silently drop production machines if PLC numbering changes. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_EqAnalysis.md b/en/docs/auto-catalog/procedures/Sp_bd_EqAnalysis.md index 051b1c9..4ca540d 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_EqAnalysis.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_EqAnalysis.md @@ -22,4 +22,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 大屏展示 → 功能模块 → 小模块-设备全面分析 — full-status equipment dashboard tile, reports per-machine 当前工单/当前状态/班次类型/计划数量/已完成数量 across all production machines for live wallboard display. + +**What it does:** Builds `p_bd_EqAnalysis` with per-machine attributes from `elemachine` (`iPlcNo>0` and `MOD(iPlcNo,14) BETWEEN 1 AND 12`), then joins `plc_currentmachinevalue` (by `sPlcsStatusName='当前工单号'` and status-code lookups: `256→生产中`, etc.) to fill 当前状态/工单/产量, also joining `mft_workorder*` for the work-order's customer/product/part. Emits the table-as-JSON into `sReturn` (note: declared as `varchar(255)` — likely too narrow for the multi-machine JSON, callers may see truncation). + +**Invocation:** Form-master sSqlStr in `gdsconfigformmaster.sId=101251240115016087744264440` under 大屏展示 → 功能模块 → 小模块-设备全面分析. Installed by `xly-src/script/标版/30100101/Sp_bd_EqAnalysis.sql`. No `gdsmodule` hook, no other-routine caller, no Java caller (form-master is the live channel). + +Flag: `sReturn varchar(255)` output is narrower than the full-machine JSON — likely truncates in production; callers should compare expected length vs `LENGTH(sReturn)`. `MOD(iPlcNo,14)` filter shares the test-PLC convention with sibling EqAdjust/Eqabnormal. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_EqLoad.md b/en/docs/auto-catalog/procedures/Sp_bd_EqLoad.md index afa2f0e..4bfb989 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_EqLoad.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_EqLoad.md @@ -24,4 +24,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 设备负荷 — equipment-load top-N bar chart on the 看板管理 / 数字工厂 dashboard. For each machine, divides the scheduled work-order processing quantity by `dAvgRate × dWeek` (machine's average per-hour rate × weekly working days) to estimate days of backlog, returning the 18 most-loaded machines. + +**What it does:** Aggregates `mftproductionplanslave.dProcessQty` joined to `elemachine` for `sState IN (2,3)` (排程/生产中) under the current `sBrId`/`sSuId`, computes `CEILING(SUM(dProcessQty) / (dAvgRate × dWeek))` per `sMachineName`, orders by `dProcessQty DESC LIMIT 18`, and serializes the result to JSON `{"data":[{"x":,"y":""}], "xUnit":"天","yUnit":""}` into `sReturn`. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_bd_EqLoad.sql`. No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Reachable only via an external dashboard HTTP endpoint that invokes the proc by name. Per family convention, kanban/dashboard procs sit outside the routine call-graph wiring tracked in this catalog. + +Falls back to defaults `dAvgRate=3000`, `dWeek=8` when `elemachine` columns are zero — re-mapping needed if cloned to a tenant where machine averages were never seeded. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_EqSpeed.md b/en/docs/auto-catalog/procedures/Sp_bd_EqSpeed.md index 2f7d8a0..cfeaaef 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_EqSpeed.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_EqSpeed.md @@ -24,4 +24,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 速度嫁动率 — speed-utilization (速度稼动率) bar chart on the 看板管理 / 数字工厂 dashboard. For each MES-instrumented machine, divides actual produced quantity by `dProduceTime × dAvgRate` over the last 24-hour shift window to produce a 0–120% utilization percentage. + +**What it does:** Materialises `p_bd_EqSpeed` from `elemachine` (filtered by tenant + `MOD(iPlcNo,14) BETWEEN 1 AND 12` test-PLC exemption, default `dAvgRate=8000` when missing). Walks `plc_machinedata` between yesterday's `sOffWork` and today's `sOffWork` per-machine to sum `dProcessQty` (max minus min per work-order) into `dTotalQty` and `dProduceHour/3600` into `dTotalTime` (only for `endWorked`/`waitingWork` rows). Returns JSON `{"data":[{"x":,"y":""}], "xUnit":"%","yUnit":""}` capping the per-machine value at 120%. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_bd_EqSpeed.sql`. The four `Sp_plc_implementation*` procs each carry a `-- call Sp_bd_EqSpeed(...)` debug comment but never actually invoke it. No form-master sSqlStr, no `gdsmodule` hook, no Java caller — reachable only via an external dashboard HTTP endpoint that invokes the proc by name. + +Tenant-specific `MOD(iPlcNo,14) BETWEEN 1 AND 12` test-PLC exemption — re-mapping needed if PLC numbering differs. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_EqStatus.md b/en/docs/auto-catalog/procedures/Sp_bd_EqStatus.md index a67a569..b7338fb 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_EqStatus.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_EqStatus.md @@ -1,7 +1,7 @@ # `Sp_bd_EqStatus` (procedure) -> @author:zhucx - @date:20210620 封存 +> @author:zhucx + @date:20210620 封存 @describe: 看板管理-数字工厂状态看板-右边 @@ -26,4 +26,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 / 数字工厂状态看板 — right-side equipment-status donut showing the count of machines currently in each PLC state bucket (`endWorked`/`waitingWork`/`waitError`/`PaperError`/`fileError`/`maintain`/`abnormal`/`offwork`/`wait`). Author tagged `封存` 2021-06-20. + +**What it does:** Reads `viw_plc_machine` where `sPlcsStatusName='当前设备状态'`, groups by `sPlcsStatusValue`, decodes the bitmask numeric codes (`256=endWorked`, `64=waitError`, `32=PaperError`, `16=fileError`, `8=maintain`, `4=abnormal`, `2=offwork`, else `wait`) into named buckets, ensures every bucket exists in `p_bd_EqStatus` even with zero count, and serialises to JSON `{"data":[{"x":"","y":}], "subTitle":"机台总数",...}`. The body retains both the live PLC-filter block and an `MOD(iPlcNo,14) BETWEEN 1 AND 12` test-PLC-exclusion fork (the latter commented out as "真实数据" vs "模拟数据"). + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_bd_EqStatus.sql`. No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Reachable only via an external dashboard HTTP endpoint that invokes the proc by name. Marked `封存` (sealed) — superseded by `Sp_bd_EqStatus_new`. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_EqStatus_new.md b/en/docs/auto-catalog/procedures/Sp_bd_EqStatus_new.md index 155d8ea..18e8d27 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_EqStatus_new.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_EqStatus_new.md @@ -1,7 +1,7 @@ # `Sp_bd_EqStatus_new` (procedure) -> @author:zhucx - @date:20210620 封存 +> @author:zhucx + @date:20210620 封存 @describe: 看板管理-数字工厂状态看板-右边 @@ -22,4 +22,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 / 数字工厂状态看板 — right-side equipment-status donut. Revised version of `Sp_bd_EqStatus`: drops the bitmask-numeric decoder and instead takes each machine's latest `sStatus` row from `plc_machinedata` directly, counting machines per state. + +**What it does:** For every `elemachine` row with `iPlcNo>0`, walks `plc_machinedata` ordered by `(sMachineId, iIncrement DESC)` with a window-rank emulation (`@sPsId`/`@rank`) to pick the single latest row per machine, groups by `sStatus`, and inserts counts into `p_bd_EqStatus`. Ensures `endWorked`/`offwork`/`abnormal`/`maintain`/... rows exist with zero default, then returns the donut payload as JSON. Inert "真实数据" alternative using `viw_plc_machine` and the bitmask decoder is retained commented-out. + +**Invocation:** No install script under `xly-src/script/标版/30100101/`, no form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Status: appears orphaned. No caller found in any channel — candidate for maintainer audit. Likely reached only by a tenant-baked external dashboard endpoint that invokes the proc by name; both `_new` and the parent are marked `封存` (sealed) 2021-06-20. + +Parameter signature drops `sLoginId`/`bFilter`/`sCode`/`sReturn` from the parent — leaves no way to surface state codes to the caller; the donut JSON is `SELECT`-emitted instead of returned via `sReturn`. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_EqTime.md b/en/docs/auto-catalog/procedures/Sp_bd_EqTime.md index 7ff7c82..09755d0 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_EqTime.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_EqTime.md @@ -24,4 +24,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 时间稼动率 — time-utilization bar chart on the 看板管理 / 数字工厂 dashboard. Counterpart of `Sp_bd_EqSpeed` (speed) and `Sp_bd_MachineOee` (composite OEE). For each MES-instrumented machine, returns valid-production-time divided by total-time over the last 24-hour shift window. + +**What it does:** Materialises `p_bd_EqTime` from `elemachine` filtered to `iPlcNo>0` and `MOD(iPlcNo,14) BETWEEN 1 AND 12` (test-PLC exemption) under the current `sBrId`/`sSuId`. Walks `plc_machinedata` between yesterday's `sOffWork` and today's `sOffWork` per-machine, summing `dProduceHour` into `dValidTime` (status=`endWorked` AND `dAdjustableQty=0`, plus `waitingWork` rows under 6 minutes) and `dTotalTime` (status≠`offwork`). Returns JSON `{"data":[{"x":,"y":""}], "xUnit":"%","yUnit":""}` capped per the cohort's display convention. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_bd_EqTime.sql`. No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Reachable only via an external dashboard HTTP endpoint that invokes the proc by name. + +Tenant-specific test-PLC exemption (`MOD(iPlcNo,14) BETWEEN 1 AND 12`) — re-mapping needed if PLC numbering differs. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_Eqabnormal.md b/en/docs/auto-catalog/procedures/Sp_bd_Eqabnormal.md index c520299..5b5fdcf 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_Eqabnormal.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_Eqabnormal.md @@ -24,4 +24,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 调机时间分析 — equipment-abnormal time analysis dashboard tile, reports per-machine 待机时间 (idle/waiting time) exceeding 15 minutes for yesterday's 8:30 → today's 8:00 shift window. Sibling of `Sp_bd_EqAdjust` (调机/setup time) and `Sp_bd_EqAnalysis` (full status). Despite the COMMENT header `调机时间分析`, the body filters for `sStatus='waitingWork' AND dAdjustableQty=0 AND dProduceHour/60>15` — i.e., idle (not setup) time anomaly. + +**What it does:** Builds `p_bd_Eqabnormal(iPlcNo, sMachineId, sMachineName, dTotalTime, dValidTime)` from `elemachine` rows where `iPlcNo>0` and `MOD(iPlcNo,14) BETWEEN 1 AND 12` (excludes test PLCs), joins `plc_machinedata` aggregated over the yesterday-8:30 → today-8:00 window, computes total `sStatus<>'offwork'` minutes vs the >15-minute idle subset, and emits the table-as-JSON into `sReturn`. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_bd_Eqabnormal.sql`. No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Status: reachable only via an external dashboard HTTP endpoint that invokes the proc by name. + +Flag: COMMENT header `调机时间分析` is copy-pasted from sibling `Sp_bd_EqAdjust`; actual analysis is 异常 (abnormal idle), not 调机 (setup). diff --git a/en/docs/auto-catalog/procedures/Sp_bd_EquipmentLoad.md b/en/docs/auto-catalog/procedures/Sp_bd_EquipmentLoad.md index 61cc242..6ebf745 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_EquipmentLoad.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_EquipmentLoad.md @@ -24,4 +24,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** Header says `PLC数据同步`, but body is the multi-state equipment-load chart for the 看板管理 / 数字工厂 dashboard — for each machine + plan-state bucket (未排程/排程中/生产中/...), returns the sum of `mftproductionplanslave.dHour` so the dashboard can stack scheduled vs unscheduled hours. + +**What it does:** Builds dynamic SQL into `P_EquipmentLoadChar` with one branch per `sState` value: a fixed `'00000000'` synthetic machine for `sState=0` (未排程) lines, then per-`sMachineId` aggregates for `sState IN (1,2,3,…)` joined to `elemachine.sMachineName` under the current `sBrId`/`sSuId`. Emits the rolled-up rows as JSON for the chart. + +**Invocation:** No install script for this exact name under `xly-src/script/标版/30100101/` (only the `_1` short-form variant `Sp_bd_EquipmentLoad1.sql` ships). No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Status: appears orphaned. No caller found in any channel — candidate for maintainer audit. Likely reached only by an external dashboard endpoint or superseded by `Sp_bd_EquipmentLoad1`. + +The dynamic-SQL approach (`p_sSql` + `p_sWhere` CONCATs) is unusual for this family — the simpler `Sp_bd_EquipmentLoad1` static-SQL fork appears to be the live replacement. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_EquipmentLoad1.md b/en/docs/auto-catalog/procedures/Sp_bd_EquipmentLoad1.md index 55b7ca8..b57d6e9 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_EquipmentLoad1.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_EquipmentLoad1.md @@ -27,4 +27,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 本月设备产量 — month-to-date per-machine load chart on the 看板管理 / 数字工厂 dashboard. For the 8 top-loaded machines, returns the sum of scheduled production hours (`SUM(dHour)/60`) for currently in-flight work orders. + +**What it does:** Aggregates `mftproductionplanslave.dHour` joined to `elemachine.sMachineName` for `sState IN (2,3)` (排程/生产中), groups by `sMachineName`, orders by `dHour` ascending with `LIMIT 8`, then re-sorts by `sMachineName` for display. Returns JSON `{"data":[{"x":"","y":""}], "xUnit":"","yUnit":"h"}`. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_bd_EquipmentLoad1.sql`. No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Reachable only via an external dashboard HTTP endpoint that invokes the proc by name. Carries the 9-arg `(iFlag, iTmpCheck, sFormGuid, sGuid, sLoginId, sReturn, sBrId, sSuId, sCode)` invocation signature shared with other dashboard chart-loader procs. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_MachineOee.md b/en/docs/auto-catalog/procedures/Sp_bd_MachineOee.md index 812238d..f2f9f2b 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_MachineOee.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_MachineOee.md @@ -24,4 +24,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 设备OEE展示 — composite OEE four-bar chart on the 看板管理 / 数字工厂 dashboard, showing 时间稼动率 / 速度稼动率 / 全局设备效率 / 计划达标率 side-by-side. Stub placeholder — emits hardcoded sample values rather than computed ones. + +**What it does:** Builds a 4-row inline `UNION` table with literal `dYvalue` constants (`89`, `69`, `29`, `70`) keyed by `iOrder`, serialises to JSON `{"data":[{"x":"","y":}], "xUnit":"","yUnit":"%"}` and returns. No reads from `plc_machinedata`, `elemachine`, or any production table. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_bd_MachineOee.sql`. No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Reachable only via an external dashboard HTTP endpoint that invokes the proc by name. + +Body emits four hardcoded constants (89/69/29/70%) — the live OEE composite must be computed elsewhere (likely `Sp_bd_EqSpeed` + `Sp_bd_EqTime` joined by the front-end). This proc is a display-only placeholder; the COMMENT header `设备OEE展示` overstates what the body delivers. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanDate.md b/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanDate.md index dfef060..6692ab5 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanDate.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanDate.md @@ -25,4 +25,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 车间效率综合看板-根 — workshop comprehensive-efficiency kanban root payload for one machine. Returns the full set of name/value pairs (date, work-order, team, plan vs report quantities, OEE) consumed by the front-end's `commonAuto` template. + +**What it does:** Resolves the machine from `elemachine` by `iPlcNo=sPlcNo`, derives the current `sWorkType` (`sOffWork`/`sShiftsWork`) by comparing `NOW()` against shift boundaries, and computes the team's `tStartDate`. Inserts per-metric rows into `p_bd_MachinePlanDate(sName,sValue)` for keys including 'sMachineName', 'sWorkOrderNo', 'sTeamName', 'dDayPlanQty' (default 8000), 'dMonthPlanQty' (default 240000), and report-quantity aggregates pulled from `plc_machinedata`/`mftproductionplanslave`. Final SELECT emits the table as the kanban JSON envelope. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_bd_MachinePlanDate.sql`. No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Reachable only via an external dashboard HTTP endpoint that invokes the proc by name. + +Hardcoded defaults `dDayPlanQty=8000`/`dMonthPlanQty=240000` when `elemachine` plan columns are zero — re-mapping needed for tenants with different target quantities. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanStatus.md b/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanStatus.md index 2c067d1..d41e016 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanStatus.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanStatus.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 机台当前转台饼形图 — single-machine current-shift pie chart on the 看板管理 / 车间效率综合看板 dashboard. For one PLC machine (parameter `sPlcNo`), splits hours since the shift began into 总时间 / 设备保养 / 设备异常 / 待料 / 调机 / 生产 buckets. + +**What it does:** Resolves the target machine from `elemachine` by `iPlcNo=sPlcNo`, calls `Fun_GetMachineWorkStartDate(p_iPlcNo, sBrId, sSuId)` to find the current shift start, and aggregates `plc_machinedata.dProduceHour/3600` per `sStatus` since that start into `p_bd_MachinePlanStatus(sName,sValue)` rows including '设备保养' (`sStatus='maintain'`), '设备异常' (`abnormal`), '待料' (`waitingWork`), '调机' (`dAdjustableQty>0`), '生产' (`endWorked`). Returns the table as the pie JSON envelope. Returns `sCode=-1` "传入机台机次号错误" when the machine lookup is empty. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_bd_MachinePlanStatus.sql`. No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Reachable only via an external dashboard HTTP endpoint that invokes the proc by name. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate.md b/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate.md index bfcfb53..b7e3223 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate.md @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 / 数字工厂状态看板 — root proc behind the "车间效率综合看板" single-machine dashboard tile. Returns the live key/value bundle for one PLC-mapped press: machine name, current work-order number, current shift label, qualified-count total, current PLC status (生产中 / 待料异常 / 纸张异常 / 文件异常 / 设备保养 / 设备异常 / 下班停机), today and this-month counter sums, plan-attainment rate, time-utilisation rate, speed-utilisation rate. + +**What it does:** Looks up `elemachine` by `iPlcNo` to resolve `sMachineId` and shift boundaries (`sOffWork`/`sShiftsWork`), then derives `p_tTeamWorkStartDate` and `p_tMachineWorkStartDate` from the current clock. Aggregates `viw_plc_machine` (current status, current 工单号, 合格数) and the `p_bd_Tm` / `p_bd_McPlanCount` temp tables seeded from `mftproductionplanslave` and counter views to fill `p_bd_MachinePlanTemplate(sName,sValue)`, then `SELECT *` returns the rowset to the dashboard renderer. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_bd_MachinePlanTemplate.sql`. No form-master `sSqlStr`, no `gdsmodule` hook, no Java caller in xly-src. Other DB references are sibling `_1`/`_2`/`_3`/`_4`/`_5` variants and `_new` plus the `Sp_mes_TimeActivation_*` family — none of them call it. Reachable only via an external dashboard HTTP endpoint that invokes the proc by name. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_1.md b/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_1.md index ca2e1ee..8429012 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_1.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_1.md @@ -1,7 +1,7 @@ # `Sp_bd_MachinePlanTemplate_1` (procedure) -> @author:zhucx - @date:20210621 封存 +> @author:zhucx + @date:20210621 封存 @describe: 看板管理-单机设备看板(1屏) 对应commonAuto/QCZH1 下 本班数据展示 @@ -25,4 +25,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 / 单机设备看板(1屏) — single-machine dashboard rendered by front-end template `commonAuto/QCZH1`. This is the "本班数据" tile of the layout — current-shift production aggregate for one PLC machine. Author tagged `封存` 2021-06-21. + +**What it does:** Resolves machine + team from `elemachine` and `viw_plc_machine` by `iPlcNo=sPlcNo` (tenant-scoped), derives current `sWorkType` by comparing `NOW()` against `sOffWork`/`sShiftsWork`, then aggregates plan/report quantities, 时间稼动率, 速度稼动率, 总稼动率 across this shift's `plc_machinedata` window into `p_bd_MachinePlanTemplate1(sName,iOrder,sValue)`. Final SELECT emits the rows ordered by `iOrder` as a JSON envelope for the front-end. + +**Invocation:** No install script (the family base `xly-src/script/标版/30100101/Sp_bd_MachinePlanTemplate.sql` ships only the unnumbered version). No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Status: appears orphaned. No caller found in any channel — candidate for maintainer audit. Marked `封存` (sealed) 2021-06-21; reachable only by a tenant-baked external dashboard endpoint that invokes the proc by name. + +Hardcoded defaults `dDayPlanQty=8000`/`dMonthPlanQty=240000` — re-mapping needed for tenants with different shift targets. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_2.md b/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_2.md index 24ac780..70cec8b 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_2.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_2.md @@ -1,7 +1,7 @@ # `Sp_bd_MachinePlanTemplate_2` (procedure) -> @author:zhucx - @date:20210621 封存 +> @author:zhucx + @date:20210621 封存 @describe: 看板管理-单机设备看板(1屏) 对应commonAuto/QCZH1 下 本班数据-本月展示 @@ -25,4 +25,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 / 单机设备看板(1屏) (front-end template `commonAuto/QCZH1`). The "本班数据-本月展示" tile of the layout — month-to-date production aggregate for the same machine that the `_1` sibling reports on as current-shift. Author tagged `封存` 2021-06-21. + +**What it does:** Same machine-resolution preamble as `_1` (reads `elemachine` + `viw_plc_machine` by `iPlcNo=sPlcNo`), but widens the `plc_machinedata` aggregation window to the current calendar month for plan-quantity / report-quantity / 时间稼动率 / 速度稼动率 / 总稼动率 metrics. Writes rows into `p_bd_MachinePlanTemplate2(sName,iOrder,sValue)` and emits the rows ordered by `iOrder` as the kanban JSON envelope. + +**Invocation:** No install script for this exact name. The three `Sp_mes_TimeActivation_*` procs reference the name only in a `-- call Sp_bd_MachinePlanTemplate_2(...)` debug comment and via a same-named temporary table `p_bd_MachinePlanTemplate2` (name collision, not a real call). No form-master sSqlStr, no `gdsmodule` hook, no Java caller. Status: appears orphaned. No caller found in any channel — candidate for maintainer audit. Marked `封存` (sealed) 2021-06-21. + +Hardcoded defaults `dDayPlanQty=8000`/`dMonthPlanQty=240000` — re-mapping needed for tenants with different month targets. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_3.md b/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_3.md index 0dbf1cb..ada0c51 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_3.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_3.md @@ -1,7 +1,7 @@ # `Sp_bd_MachinePlanTemplate_3` (procedure) -> @author:zhucx - @date:20210621 封存 +> @author:zhucx + @date:20210621 封存 @describe: 看板管理-单机设备看板(1屏) 对应commonAuto/QCZH1 下 本设备月度数据展示 @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 / 单机设备看板(1屏) (front-end template `commonAuto/QCZH1`). The "本设备月度数据展示" tile — extended monthly machine-level metrics including comparison against per-metric 标准值 (standard targets) for 时间稼动率 / 速度稼动率 / 稼动率 / 产量达标率. Author tagged `封存` 2021-06-21. + +**What it does:** Same machine-resolution preamble as the family; aggregates monthly `plc_machinedata` data into actual `dTimeOee`/`dSpeedOee`/`dOee` plus the corresponding `dStdTimeOee`/`dStdSpeedOee`/`dStdOee`/`dStdOeeQty` standard-target values. Emits all metric+target pairs as `p_bd_MachinePlanTemplate3(sName,iOrder,sValue)` rows in JSON form. + +**Invocation:** No install script. Only DB reference is its companion `Sp_bd_MachinePlanTemplate_3_new` which carries a `-- call Sp_bd_MachinePlanTemplate_3(...)` debug comment (not a real call). No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Status: appears orphaned. Superseded by `_3_new`; both are marked `封存` (sealed) 2021-06-21. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_3_new.md b/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_3_new.md index 94ce57e..6578f88 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_3_new.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_3_new.md @@ -1,7 +1,7 @@ # `Sp_bd_MachinePlanTemplate_3_new` (procedure) -> @author:zhucx - @date:20210621 封存 +> @author:zhucx + @date:20210621 封存 @describe: 看板管理-单机设备看板(1屏) 对应commonAuto/QCZH1 下 本设备月度数据展示 @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 / 单机设备看板(1屏) (front-end template `commonAuto/QCZH1`). Revised "本设备月度数据展示" tile — refined month-over-month metrics + standard-target comparisons. Successor to `Sp_bd_MachinePlanTemplate_3` (same signature, same role, slightly different aggregation path). Author tagged `封存` 2021-06-21. + +**What it does:** Same as `_3` — aggregates monthly `plc_machinedata`/`mftproductionplanslave` per-machine metrics (actual vs 标准值 for 时间/速度/总稼动率 and 产量达标率), writes rows to `p_bd_MachinePlanTemplate3(sName,iOrder,sValue)`, returns the rows ordered by `iOrder` as the kanban JSON envelope. + +**Invocation:** No install script under `xly-src/script/标版/30100101/`, no form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Status: appears orphaned. No caller found in any channel — candidate for maintainer audit. Marked `封存` (sealed) 2021-06-21; reachable only by a tenant-baked external dashboard endpoint that invokes the proc by name. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_4.md b/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_4.md index aa5d970..3b8a957 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_4.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_4.md @@ -1,7 +1,7 @@ # `Sp_bd_MachinePlanTemplate_4` (procedure) -> @author:zhucx - @date:20210621 封存 +> @author:zhucx + @date:20210621 封存 @describe: 看板管理-单机设备看板(1屏) 对应commonAuto/QCZH1 下 本班时间分析展示 @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 / 单机设备看板(1屏) (front-end template `commonAuto/QCZH1`). The "本班时间分析展示" tile — current-shift time-breakdown pie for one PLC machine, parallel to `Sp_bd_MachinePlanStatus` but team-bound. Author tagged `封存` 2021-06-21. + +**What it does:** Resolves the machine (`elemachine.iPlcNo=sPlcNo`) and current team (`eleteam.sTeamNo` joined to `viw_plc_machine.sPlcsStatusValue` where `sPlcsStatusName='当前班组'`), derives the current `sWorkType` from `sOffWork`/`sShiftsWork`, then aggregates `plc_machinedata.dProduceHour/3600` by `sStatus` for this team's current shift and emits a labelled time-breakdown JSON pie. + +**Invocation:** No install script for this exact name under `xly-src/script/标版/30100101/`, no form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Status: appears orphaned. No caller found in any channel — candidate for maintainer audit. Marked `封存` (sealed) 2021-06-21; reachable only by a tenant-baked external dashboard endpoint. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_5.md b/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_5.md index 23e0826..502ed7a 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_5.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_5.md @@ -1,7 +1,7 @@ # `Sp_bd_MachinePlanTemplate_5` (procedure) -> @author:zhucx - @date:20210621 封存 +> @author:zhucx + @date:20210621 封存 @describe: 看板管理-单机设备看板(1屏) 对应commonAuto/QCZH1 下 本班本月分析展示 @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 / 单机设备看板(1屏) (front-end template `commonAuto/QCZH1`). The "本班本月分析展示" tile — month-wide time-breakdown pie for one PLC machine including this team's contribution. Author tagged `封存` 2021-06-21. + +**What it does:** Resolves the machine (`elemachine.iPlcNo=sPlcNo`) and current team (via `viw_plc_machine.sPlcsStatusName='当前班组'`), aggregates `plc_machinedata.dProduceHour/3600` by `sStatus` for the whole current month into `p_bd_EqStatus(sName,sValue)`, decodes status codes to localized labels, and emits the JSON pie envelope (parallel to the time-breakdown layout used by `Sp_bd_machine_TmAnalysis` and `Sp_bd_MachinePlanTemplate_4`). + +**Invocation:** No install script for this exact name. Only DB reference is its companion `_5_new` which carries a `-- call Sp_bd_MachinePlanTemplate_5(...)` debug comment (not a real call). No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Status: appears orphaned. Superseded by `_5_new`; both marked `封存` (sealed) 2021-06-21. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_5_new.md b/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_5_new.md index f302355..0c7baf5 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_5_new.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_5_new.md @@ -1,7 +1,7 @@ # `Sp_bd_MachinePlanTemplate_5_new` (procedure) -> @author:zhucx - @date:20210621 封存 +> @author:zhucx + @date:20210621 封存 @describe: 看板管理-单机设备看板(1屏) 对应commonAuto/QCZH1 下 本班本月分析展示 @@ -25,4 +25,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 / 单机设备看板(1屏) (front-end template `commonAuto/QCZH1`). Revised "本班本月分析展示" tile — month-wide time-breakdown pie for one PLC machine. Successor to `Sp_bd_MachinePlanTemplate_5` (slightly trimmed body). Author tagged `封存` 2021-06-21. + +**What it does:** Same shape as `_5` — resolves machine + current team, aggregates `plc_machinedata.dProduceHour/3600` per `sStatus` for the current month into `p_bd_EqStatus(sName,sValue)`, decodes status codes, and emits the labelled JSON pie. + +**Invocation:** No install script under `xly-src/script/标版/30100101/`, no form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Status: appears orphaned. No caller found in any channel — candidate for maintainer audit. Marked `封存` (sealed) 2021-06-21; reachable only by a tenant-baked external dashboard endpoint that invokes the proc by name. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_new.md b/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_new.md index 08a1b99..5691758 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_new.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_MachinePlanTemplate_new.md @@ -1,7 +1,7 @@ # `Sp_bd_MachinePlanTemplate_new` (procedure) -> @author:zhucx - @date:20210621 封存 +> @author:zhucx + @date:20210621 封存 @describe: 看板管理-单机设备看板(1屏) 对应commonAuto/QCZH1 下 左边计划,中间顶部 信息 @@ -27,4 +27,10 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 / 单机设备看板(1屏) (front-end template `commonAuto/QCZH1`). The "左边计划, 中间顶部信息" tile — the left-side production plan list plus the centre-top current-status header for one PLC machine. Revised version of the unnumbered family base `Sp_bd_MachinePlanTemplate`. Author tagged `封存` 2021-06-21. + +**What it does:** Resolves machine + team + work-order + current shift window. Pulls the work-order header (`sWorkOrderNo`, `sCurrProductName`), the day's `dDayPlanQty`/月度 `dMonthPlanQty` targets, the actual `dReprotQty` reported on `mftproductionplanslave`, plus the current PLC status (`sStatus`, `iTime`, `iTotal`). Returns rows in `p_bd_MachinePlanTemplate` as the kanban left-panel + top-banner JSON. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_bd_MachinePlanTemplate.sql` (which installs the family-base unnumbered name; this `_new` variant is DB-only). No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Status: appears orphaned. Marked `封存` (sealed) 2021-06-21; reachable only by a tenant-baked external dashboard endpoint that invokes the proc by name. + +Hardcoded defaults `dDayPlanQty=8000`/`dMonthPlanQty=240000` — re-mapping needed for tenants with different target quantities. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_McPlanConter.md b/en/docs/auto-catalog/procedures/Sp_bd_McPlanConter.md index 66d57d5..61bae8e 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_McPlanConter.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_McPlanConter.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 — "计划产量" dashboard tile. Reports the planned-production counter per machine across the configured shift window so the dashboard can show planned vs actual output. + +**What it does:** Builds temp table `p_machinedata` from `plc_machinedata` for PLC-indexed presses (`elemachine.iPlcNo` between 1 and 7 in this brand/subsidiary), enriches with order/team/product columns, then sums planned and adjusted quantities to a JSON payload returned via `OUT sReturn`. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_bd_McPlanConter.sql`. No form-master, no `gdsmodule` hook, no other-routine caller, no Java caller in xly-src. Reached only by an external dashboard HTTP endpoint that calls the proc by name. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_McPlanRate.md b/en/docs/auto-catalog/procedures/Sp_bd_McPlanRate.md index 9bd1763..40270b1 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_McPlanRate.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_McPlanRate.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 — "计划达标率(实际产量/计划产量)" dashboard tile. Returns the plan-attainment percentage per machine: actual produced counter divided by the planned counter for the active shift. + +**What it does:** Materialises `p_bd_McPlanCount` from `mftproductionplanslave` (where `sState IN ('2','3')`, restricted to PLC-mapped machines via `elemachine.iPlcNo BETWEEN 1 AND 7`, anchored by `Fun_GetMachineWorkStartDate`), then materialises `p_machinedata` from `plc_machinedata` for the same set and computes the ratio per machine, formatting the result as the JSON object the dashboard renderer expects. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_bd_McPlanRate.sql`. No form-master, no `gdsmodule` hook, no other-routine caller, no Java caller. Reached only by an external dashboard HTTP endpoint that calls the proc by name. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_OrderProgress.md b/en/docs/auto-catalog/procedures/Sp_bd_OrderProgress.md index 3948392..e817496 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_OrderProgress.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_OrderProgress.md @@ -34,4 +34,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 生产计划看板 — order-progress board for the production-plan dashboard. Lists work orders filtered by customer / date window / 工单号 with pagination, optional grouping, and a side count map. + +**What it does:** Materialises temp table `p_TempTable` with rows joining `mftworkordermaster` and its slaves (parts, products, customer, plan quantities, in-store quantity, deliver date, process state). Honours the standard dashboard pagination contract: `pageNum`/`pageSize`/`totalCount` plus `countCloumn` → `countMapJson` plus `sFilterOrderBy` / `sGroupby_select_sql` / `sGroupby_group_sql` for dynamic ORDER BY and GROUP BY injection. + +**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_bd_OrderProgress.sql`. No form-master, no `gdsmodule` hook, no other-routine caller, no Java caller. Reached only by an external dashboard HTTP endpoint that calls the proc by name. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_TeamDayMonthCompare.md b/en/docs/auto-catalog/procedures/Sp_bd_TeamDayMonthCompare.md index 46d074b..a09c420 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_TeamDayMonthCompare.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_TeamDayMonthCompare.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 — "时间嫁动率(分组报表)机台" tile. Returns the 本班 vs 本月 grouped bar chart comparing four utilisation metrics — 速度稼动率 / 时间稼动率 / OEE效率 / 计划达标率 — for the machine view. + +**What it does:** Hard-codes a fixed value of **89%** for all eight series (本班/本月 × four metrics) into temp table `p_bd_tmTime(sType,x,y,iOrder)` via a UNION block, then serialises to JSON `{"data":[{"type":<本班|本月>,"y":89,"x":}...],"yUnit":"%"}` via OUT `sReturn`. The proc accepts the standard dashboard signature (`sLoginId`/`sBrId`/`sSuId`/`bFilter`) but uses none of them — there is no actual aggregation against `plc_machinedata` or any production table. + +**Invocation:** No install script in xly-src, no form-master, no `gdsmodule` hook, no Java caller. Other DB reference is sibling `Sp_bd_TeamDayMonthCompare1` only. Reached only by an external dashboard HTTP endpoint that calls the proc by name. **The output is entirely demo data** — verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_TeamDayMonthCompare1.md b/en/docs/auto-catalog/procedures/Sp_bd_TeamDayMonthCompare1.md index 48b63a5..ad89f56 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_TeamDayMonthCompare1.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_TeamDayMonthCompare1.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 — "时间嫁动率(分组报表)机台" tile. Identical-shape sibling of `Sp_bd_TeamDayMonthCompare` for the team-level board. + +**What it does:** Same body as `Sp_bd_TeamDayMonthCompare` — hard-codes value 89% for all eight series (本班/本月 × 速度稼动率/时间稼动率/OEE效率/计划达标率) into `p_bd_tmTime` and serialises to JSON via OUT `sReturn`. No table lookups; input params are unused. + +**Invocation:** No install script in xly-src, no form-master, no `gdsmodule` hook, no Java caller, no other-routine caller. Reached only by an external dashboard HTTP endpoint that calls the proc by name. **The output is entirely demo data** — verify before relying on it. diff --git a/en/docs/auto-catalog/procedures/Sp_bd_TeamOee.md b/en/docs/auto-catalog/procedures/Sp_bd_TeamOee.md index ca68563..81a0f15 100644 --- a/en/docs/auto-catalog/procedures/Sp_bd_TeamOee.md +++ b/en/docs/auto-catalog/procedures/Sp_bd_TeamOee.md @@ -24,4 +24,8 @@ _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW C ## Narrative -_No human-written narrative yet._ +**Business context:** 看板管理 — "班组OEE展示" tile. The team-OEE bar chart showing the three utilisation metrics for the current team. + +**What it does:** Builds the OEE payload from a hard-coded UNION — 速度稼动 = 89, 时间稼动 = 69, OEE = 29 — and serialises to JSON `{"data":[{"x":