_tmp_field_level_io.json 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138
  1. {
  2. "pr_WMS_SavePrepareMaterial": {
  3. "empty": false,
  4. "def_len": 12157,
  5. "updates": {
  6. "NbrMaster": [
  7. "Status",
  8. "Remark",
  9. "UpdateTime",
  10. "UpdateUser"
  11. ],
  12. "NbrDetail": [
  13. "QtyFrom",
  14. "PUfld3",
  15. "User1",
  16. "UpdateTime",
  17. "UpdateUser"
  18. ],
  19. "MissedPrint": [
  20. "OrdNbr",
  21. "WorkOrd",
  22. "PickQty",
  23. "Status",
  24. "PeriodChar",
  25. "UpdateTime",
  26. "UpdateUser"
  27. ]
  28. },
  29. "inserts": {
  30. "EmpWorkWmsHist": [
  31. "Domain",
  32. "TransNum",
  33. "Employee",
  34. "Type",
  35. "OrdNbr",
  36. "OrdLine",
  37. "ItemNum",
  38. "Descr",
  39. "Descr1",
  40. "LabelRecID",
  41. "BarCode",
  42. "LotSerial",
  43. "Location",
  44. "Shelf",
  45. "Status",
  46. "Qty",
  47. "WorkOrd",
  48. "WoLot",
  49. "Ufld1",
  50. "ProdDate",
  51. "Period",
  52. "User1",
  53. "Reason",
  54. "CreateUser",
  55. "UpdateUser",
  56. "CreateTime",
  57. "UpdateTime"
  58. ]
  59. },
  60. "nested": [
  61. "pr_SFM_GetSequenceID",
  62. "pr_WMS_BPM_DelMobileTask"
  63. ],
  64. "update_snippets": [
  65. "update NbrDetail set QtyFrom=IsNull(d.QtyFrom,0)+t.Qty ,PUfld3=(case when IsNull(d.PUfld3,'')='' then '' else d.PUfld3+'|' end)+t.PUfld3 ,User1=@UserNo ,UpdateTime=@CurTime ,UpdateUser=@UserNo from NbrDetail d,(select n.RecID,n.PUfld3,sum(m.NewQty) as Qty from #nbrDetails n left join #missedPrint m on n.ItemNum=m.ItemNum and n.RecID=m.NbrDetailRecI",
  66. "update NbrMaster set Status='C' ,Remark=(case when IsNull(Remark,'')<>'' then Remark+',' else '' end)+'手工关闭' ,UpdateTime=getdate() ,UpdateUser=@UserNo where Domain=@Domain and Nbr=@Nbr select 1 as Success,'保存成功!' as Msg exec pr_WMS_BPM_DelMobileTask @TaskID=@Nbr, @IsProcCall=1, @ReturnMsg=@Msg output return end declare @IsInvFixed bit,@IsShelfAcc b",
  67. "update NbrMaster set Status=case when Status='C' then 'C' else 'A' end ,UpdateTime=getdate() ,UpdateUser=@UserNo where RecID=(select top 1 NbrRecID from #nbrDetails) update NbrDetail set QtyFrom=IsNull(d.QtyFrom,0)+t.Qty ,PUfld3=(case when IsNull(d.PUfld3,'')='' then '' else d.PUfld3+'|' end)+t.PUfld3 ,User1=@UserNo ,UpdateTime=@CurTime ,UpdateUser",
  68. "update MissedPrint set OrdNbr=@Nbr ,WorkOrd=t.DetWorkOrd ,PickQty=m.PickQty+t.NewQty ,Status=(case when m.Type='Card' then m.Status else 'A' end) ,PeriodChar=m.Status ,UpdateTime=@CurTime ,UpdateUser=@UserNo from MissedPrint m,(select RecID,sum(NewQty) as NewQty,max(DetWorkOrd) as DetWorkOrd from #missedPrint group by RecID) t where m.RecID=t.RecID"
  69. ]
  70. },
  71. "pr_WMS_SaveWorkOrdMaterialIssue": {
  72. "empty": false,
  73. "def_len": 45667,
  74. "updates": {
  75. "NbrMaster": [
  76. "SignTime",
  77. "User1",
  78. "UpdateTime",
  79. "UpdateUser",
  80. "Status",
  81. "IsConfirm"
  82. ],
  83. "NbrDetail": [
  84. "PUfld3",
  85. "PUfld2",
  86. "QtyFrom",
  87. "QtyRec",
  88. "Status",
  89. "IsConfirm",
  90. "SignTime",
  91. "User1",
  92. "UpdateTime",
  93. "UpdateUser"
  94. ],
  95. "WorkOrdDetail": [
  96. "QtyPosted",
  97. "UpdateTime",
  98. "UpdateUser"
  99. ],
  100. "MissedPrint": [
  101. "BarCode",
  102. "Qty",
  103. "CompQty",
  104. "QtyIssued",
  105. "OrdNbr",
  106. "PickQty",
  107. "QtyChange",
  108. "Status",
  109. "PeriodChar",
  110. "Location",
  111. "UpdateTime",
  112. "UpdateUser"
  113. ],
  114. "PurOrdRctDetail": [
  115. "RctQty"
  116. ]
  117. },
  118. "inserts": {
  119. "EmpWorkWmsHist": [
  120. "Domain",
  121. "TransNum",
  122. "Employee",
  123. "Type",
  124. "OrdNbr",
  125. "OrdLine",
  126. "ItemNum",
  127. "Descr",
  128. "LotSerial",
  129. "Location",
  130. "Qty",
  131. "WorkOrd",
  132. "Remark",
  133. "Reason",
  134. "LabelRecID",
  135. "ProdDate",
  136. "User1",
  137. "BarCode",
  138. "StartTime",
  139. "EndTime",
  140. "CreateUser",
  141. "UpdateUser",
  142. "CreateTime",
  143. "UpdateTime"
  144. ]
  145. },
  146. "nested": [
  147. "pr_SFM_CheckInventoryStatus",
  148. "pr_SFM_GetSequenceID",
  149. "pr_SFM_InventoryTransactionProcessing2",
  150. "pr_WMS_BPM_DelMobileTask",
  151. "pr_WMS_BPM_RctPurOrdAndPurOrdByBarcode",
  152. "pr_WMS_CreateBarCodeCard"
  153. ],
  154. "update_snippets": [
  155. "update NbrDetail set PUfld3=(case when @IsOutBatch=0 then '' else d.PUfld3 end) ,PUfld2=IsNull(t.PUfld2,'') ,QtyFrom=(case when @IsOutBatch=0 then 0 else d.QtyFrom end) ,QtyRec=d.QtyRec+t.QtyFrom ,Status=(case when d.QtyRec+t.QtyFrom>=d.QtyOrd then 'C' else '' end) ,IsConfirm=(case when d.QtyRec+t.QtyFrom>=d.QtyOrd then 1 else 0 end) ,SignTime=@Cur",
  156. "update NbrMaster set SignTime=@CurTime ,User1=@UserNo ,UpdateTime=@CurTime ,UpdateUser=@UserNo where Domain=@Domain and Nbr=@Nbr update NbrDetail set PUfld3=(case when @IsOutBatch=0 then '' else d.PUfld3 end) ,PUfld2=IsNull(t.PUfld2,'') ,QtyFrom=(case when @IsOutBatch=0 then 0 else d.QtyFrom end) ,QtyRec=d.QtyRec+t.QtyFrom ,Status=(case when d.QtyR",
  157. "update NbrMaster set Status='C' ,IsConfirm=1 ,UpdateTime=@CurTime ,UpdateUser=@UserNo where Domain=@Domain and Nbr=@Nbr else begin if not exists(select * from NbrDetail where Domain=@Domain and Nbr=@Nbr and QtyFrom>0) update NbrMaster set Status='' ,UpdateTime=@CurTime ,UpdateUser=@UserNo where Domain=@Domain and Nbr=@Nbr end declare @tbMissedRecID",
  158. "update MissedPrint set BarCode=BarCode+convert(varchar(10),RecID) where RecID in(select RecID from @tbMissedRecID) end declare @tbMissedPrints table(DetRecID int,LocationFrom varchar(30),NewQty decimal(18,5),IsRctVMI bit,LotSerial varchar(100),ItemLocation varchar(30),InsSampleQty decimal(18,5)) if(@IsErpToLotSerial='1') begin insert @tbMissedPrint",
  159. "update MissedPrint set Qty=t.NewQty+t.InsSampleQty from MissedPrint m,#missedPrints t where m.RecID=t.RecID and t.IsRctVMI=1 update @tbPurOrdRcts set RctQty=t.RctQty+m.InsSampleQty from @tbPurOrdRcts t,#missedPrints m where t.LabRecID=m.RecID and m.IsRctVMI=1 update @tbPurOrdRcts set LabRecID=m.RecID from @tbPurOrdRcts t,@tbMissedRecID m where t.La",
  160. "update MissedPrint set Qty=t.BarcodeQty-t.InsSampleQty,CompQty=0,QtyIssued=0 from MissedPrint m,#missedPrints t where m.RecID=t.RecID and t.IsRctVMI=1 update PurOrdRctDetail set RctQty=d.RctQty+t.UseQty from PurOrdRctDetail d,@tbRctDets t where d.RecID=t.RecID and t.UseQty>0 delete @Inventorys insert @Inventorys( TransType ,OrderNbr ,OrdLine ,Sales",
  161. "update MissedPrint set OrdNbr=(case when @IsOutBatch=0 and (m.Qty<>t.NewQty or t.IsCard=1) then '' else m.OrdNbr end) ,PickQty=(case when @IsOutBatch=0 and (m.Qty<>t.NewQty or t.IsCard=1) then m.PickQty-t.NewQty else m.PickQty end) ,Qty=(case when m.Qty<>t.NewQty or t.IsCard=1 or (t.IsBarcodeTurnover=1 and IsMainMas=0) then m.Qty-t.NewQty else m.Qt",
  162. "update MissedPrint set Qty=m.Qty+t.NewQty ,QtyChange=t.NewQty ,UpdateTime=@CurTime ,UpdateUser=@UserNo from MissedPrint m,(select ToRecID,sum(NewQty) as NewQty from #missedPrints where ToRecID>0 group by ToRecID) t where m.RecID=t.ToRecID insert MissedPrintTransHist( Domain ,Product ,ItemNum ,Descr ,BarCode ,Qty ,QtyChange ,PurQty ,Carton ,ProdDate",
  163. "update WorkOrdDetail set QtyPosted=w.QtyPosted+d.QtyFrom ,UpdateTime=@CurTime ,UpdateUser=@UserNo from WorkOrdDetail w,#nbrDetails d where w.RecID=d.WorkOrdDetailRecID if not exists(select * from NbrDetail where Domain=@Domain and Nbr=@Nbr and IsNull(Status,'')<>'C') update NbrMaster set Status='C' ,IsConfirm=1 ,UpdateTime=@CurTime ,UpdateUser=@Use"
  164. ]
  165. },
  166. "pr_WMS_SaveWorkOrdMaterialIssueByQty": {
  167. "empty": false,
  168. "def_len": 16734,
  169. "updates": {
  170. "NbrMaster": [
  171. "SignTime",
  172. "User1",
  173. "UpdateTime",
  174. "UpdateUser",
  175. "Status",
  176. "IsConfirm"
  177. ],
  178. "NbrDetail": [
  179. "QtyRec",
  180. "Status",
  181. "IsConfirm",
  182. "SignTime",
  183. "User1",
  184. "UpdateTime",
  185. "UpdateUser"
  186. ]
  187. },
  188. "inserts": {},
  189. "nested": [
  190. "pr_SFM_CheckInventoryStatus",
  191. "pr_SFM_GetSequenceID",
  192. "pr_SFM_InventoryTransactionProcessing2",
  193. "pr_WMS_BPM_DelMobileTask"
  194. ],
  195. "update_snippets": [
  196. "update NbrDetail set QtyRec=d.QtyRec+t.NewQty ,Status=(case when d.QtyRec+t.NewQty>=d.QtyOrd then 'C' else '' end) ,IsConfirm=(case when d.QtyRec+t.NewQty>=d.QtyOrd then 1 else 0 end) ,SignTime=@CurTime ,User1=@UserNo ,UpdateTime=@CurTime ,UpdateUser=@UserNo from NbrDetail d,#nbrDetails t where d.RecID=t.RecID if not exists(select * from NbrDetail ",
  197. "update NbrMaster set SignTime=@CurTime ,User1=@UserNo ,UpdateTime=@CurTime ,UpdateUser=@UserNo where Domain=@Domain and Nbr=@Nbr update NbrDetail set QtyRec=d.QtyRec+t.NewQty ,Status=(case when d.QtyRec+t.NewQty>=d.QtyOrd then 'C' else '' end) ,IsConfirm=(case when d.QtyRec+t.NewQty>=d.QtyOrd then 1 else 0 end) ,SignTime=@CurTime ,User1=@UserNo ,Up",
  198. "update NbrMaster set Status='C' ,IsConfirm=1 ,UpdateTime=@CurTime ,UpdateUser=@UserNo where Domain=@Domain and Nbr=@Nbr declare @Inventorys InventoryTVP insert @Inventorys( TransType ,OrderNbr ,OrdLine ,SalesOrder ,Site ,Location ,LocationTo ,LotSerial ,ItemNumber ,Dimension1 ,Dimension2 ,ChangeQty ,Address ,Batch ,EffTime ,Dated ,Remark ,Reason "
  199. ]
  200. },
  201. "pr_WMS_SaveWorkOrdMaterialConfirm": {
  202. "empty": true,
  203. "alts": []
  204. },
  205. "pr_WMS_BPM_SaveCancelPrepareMaterial": {
  206. "empty": false,
  207. "def_len": 4852,
  208. "updates": {
  209. "NbrDetail": [
  210. "QtyFrom",
  211. "PUfld3",
  212. "UpdateTime",
  213. "UpdateUser"
  214. ],
  215. "NbrMaster": [
  216. "Status",
  217. "UpdateTime",
  218. "UpdateUser"
  219. ],
  220. "MissedPrint": [
  221. "OrdNbr",
  222. "PickQty",
  223. "Status",
  224. "PeriodChar",
  225. "UpdateTime",
  226. "UpdateUser"
  227. ]
  228. },
  229. "inserts": {},
  230. "nested": [],
  231. "update_snippets": [
  232. "update NbrDetail set QtyFrom=0 ,PUfld3='' ,UpdateTime=@CurTime ,UpdateUser=@UserNo where RecID=@RecID if not exists(select RecID from NbrDetail where Domain=@Domain and Nbr=@Nbr and QtyFrom>0) update NbrMaster set Status='' ,UpdateTime=@CurTime ,UpdateUser=@UserNo where Domain=@Domain and Nbr=@Nbr update MissedPrint set OrdNbr='' ,PickQty=m.PickQty",
  233. "update NbrMaster set Status='' ,UpdateTime=@CurTime ,UpdateUser=@UserNo where Domain=@Domain and Nbr=@Nbr update MissedPrint set OrdNbr='' ,PickQty=m.PickQty-t.NewQty ,Status=(case when m.PeriodChar='R' then m.PeriodChar when m.PickQty>t.NewQty then m.Status else 'N' end) ,PeriodChar='' ,UpdateTime=@CurTime ,UpdateUser=@UserNo from MissedPrint m,#m",
  234. "update MissedPrint set OrdNbr='' ,PickQty=m.PickQty-t.NewQty ,Status=(case when m.PeriodChar='R' then m.PeriodChar when m.PickQty>t.NewQty then m.Status else 'N' end) ,PeriodChar='' ,UpdateTime=@CurTime ,UpdateUser=@UserNo from MissedPrint m,#missedPrint t where m.RecID=t.RecID insert MissedPrintTransHist( Domain ,Product ,ItemNum ,Descr ,BarCode ,"
  235. ]
  236. },
  237. "pr_WMS_CreateBarCodeCard": {
  238. "empty": false,
  239. "def_len": 3244,
  240. "updates": {},
  241. "inserts": {
  242. "MissedPrint": [
  243. "Domain",
  244. "LabelFormat",
  245. "Printer",
  246. "Product",
  247. "ItemNum",
  248. "Descr",
  249. "BarCode",
  250. "Qty",
  251. "PrintTime",
  252. "Checker",
  253. "IsMiss",
  254. "CreateUser",
  255. "UpdateUser",
  256. "CreateTime",
  257. "UpdateTime",
  258. "Carton",
  259. "ProdDate",
  260. "FirmString5",
  261. "PCName",
  262. "Remark",
  263. "Period",
  264. "PeriodDate",
  265. "Location",
  266. "Shelf",
  267. "Site",
  268. "Status",
  269. "Type",
  270. "CartonQty"
  271. ]
  272. },
  273. "nested": [],
  274. "update_snippets": []
  275. },
  276. "pr_SFM_InventoryTransactionProcessing2": {
  277. "empty": false,
  278. "def_len": 16969,
  279. "updates": {
  280. "InvMaster": [
  281. "ABCClass",
  282. "AvgInt",
  283. "AverageSales",
  284. "CycCntInt",
  285. "LastIssue",
  286. "MRPRequired",
  287. "QOHNonnettable",
  288. "QtyChange",
  289. "QtyOnHand",
  290. "AvailStatusQty",
  291. "Assay",
  292. "FreezeQty",
  293. "QtyOnOrd",
  294. "WORcptActive",
  295. "PORcptActive",
  296. "LastRct",
  297. "RollupReqd",
  298. "EffTime",
  299. "IsActive",
  300. "IsConfirm",
  301. "UpdateTime",
  302. "UpdateUser"
  303. ],
  304. "ItemMaster": [
  305. "Location"
  306. ],
  307. "LocationDetail": [
  308. "QtyPicked",
  309. "DateCreated",
  310. "QtyOnHand",
  311. "AvailStatusQty",
  312. "Assay",
  313. "FreezeQty",
  314. "InvStatus",
  315. "EffTime",
  316. "Ufld1",
  317. "Cost",
  318. "IsActive",
  319. "IsConfirm",
  320. "UpdateTime",
  321. "UpdateUser"
  322. ]
  323. },
  324. "inserts": {
  325. "InvMaster": [
  326. "Domain",
  327. "Site",
  328. "ItemNum",
  329. "Location",
  330. "Dimension1",
  331. "Dimension2",
  332. "CreateTime",
  333. "CreateUser"
  334. ],
  335. "LocationDetail": [
  336. "Domain",
  337. "Site",
  338. "Location",
  339. "LotSerial",
  340. "Refs",
  341. "ItemNum",
  342. "Dimension1",
  343. "Dimension2",
  344. "CreateTime",
  345. "CreateUser"
  346. ]
  347. },
  348. "nested": [],
  349. "update_snippets": []
  350. },
  351. "pr_SFM_SaveWorkOrdChooseByOpData": {
  352. "empty": false,
  353. "def_len": 32483,
  354. "updates": {
  355. "WorkOrdMaster": [
  356. "Status",
  357. "OrdDate",
  358. "UpdateTime",
  359. "UpdateUser"
  360. ],
  361. "WorkOrdRouting": [
  362. "Status",
  363. "Ufld1",
  364. "UpdateTime",
  365. "UpdateUser",
  366. "Ufld2"
  367. ],
  368. "PeriodSequenceDet": [
  369. "Status",
  370. "UpdateTime",
  371. "UpdateUser"
  372. ],
  373. "LineStatusDet": [
  374. "ReleaseQty",
  375. "Employee",
  376. "EmployeeName",
  377. "WorkOrd",
  378. "OP",
  379. "UpdateTime",
  380. "ItemNum",
  381. "ID",
  382. "ProdDate",
  383. "PlanDate",
  384. "Period",
  385. "ParItemDesc",
  386. "CompItemDesc",
  387. "CompItemDesc1",
  388. "UChar1",
  389. "UChar2",
  390. "UChar3",
  391. "SalesOrd",
  392. "SetupStd",
  393. "RunStd",
  394. "BOMqty",
  395. "ScrapeStd",
  396. "WorkCtr",
  397. "Machine",
  398. "IsActive",
  399. "Dimension1",
  400. "BusinessID",
  401. "ItemLineNum",
  402. "IsNoWorkOrdPlan",
  403. "RoutingVer"
  404. ]
  405. },
  406. "inserts": {
  407. "WorkOrdMaster": [
  408. "Domain",
  409. "Site",
  410. "WorkOrd",
  411. "Batch",
  412. "ID",
  413. "Typed",
  414. "WoTyped",
  415. "Status",
  416. "ItemNum",
  417. "BOMFormula",
  418. "RoutingCode",
  419. "OrdDate",
  420. "QtyOrded",
  421. "Period",
  422. "Active",
  423. "IsActive",
  424. "IsConfirm",
  425. "CreateUser",
  426. "CreateTime",
  427. "UpdateUser",
  428. "UpdateTime"
  429. ],
  430. "WorkOrdRouting": [
  431. "Domain",
  432. "WorkOrd",
  433. "ID",
  434. "OP",
  435. "WorkOp",
  436. "Descr",
  437. "Status",
  438. "MilestoneOp",
  439. "ItemNum",
  440. "QtyOrded",
  441. "StartDate",
  442. "WorkCtr",
  443. "IsUseTurnoverBox",
  444. "IsActive",
  445. "IsConfirm",
  446. "CreateUser",
  447. "CreateTime",
  448. "UpdateUser",
  449. "UpdateTime"
  450. ],
  451. "WorkOrdDetail": [
  452. "Domain",
  453. "Site",
  454. "WorkOrd",
  455. "ID",
  456. "Op",
  457. "Line",
  458. "ItemNum",
  459. "FrozenBOMQty",
  460. "QtyRequired",
  461. "LoadedfromMO",
  462. "IsActive",
  463. "IsConfirm",
  464. "CreateUser",
  465. "CreateTime",
  466. "UpdateUser",
  467. "UpdateTime"
  468. ]
  469. },
  470. "nested": [
  471. "pr_SFM_AccPeriodSequenceDet",
  472. "pr_SFM_CreateLineLostSerial",
  473. "pr_SFM_GetSequenceID",
  474. "pr_SFM_SaveOpenLineConditions"
  475. ],
  476. "update_snippets": [
  477. "update WorkOrdMaster set Status='W',OrdDate=@CurTime,UpdateTime=@CurTime,UpdateUser=@UserNo from WorkOrdMaster w,#workOrdMaster t where w.RecID=t.RecID update WorkOrdRouting set Status='W',Ufld1=null,UpdateTime=@CurTime,UpdateUser=@UserNo where RecID in(select RecID from #workOrdRouting where RecID is not null) if @IsAssistLine=0 update PeriodSeque",
  478. "update WorkOrdRouting set Status='W',Ufld1=null,UpdateTime=@CurTime,UpdateUser=@UserNo where RecID in(select RecID from #workOrdRouting where RecID is not null) if @IsAssistLine=0 update PeriodSequenceDet set Status='W',UpdateTime=@CurTime,UpdateUser=@UserNo where RecID in(select PeriodRecID from #periodSequenceDet) declare @tbLineDet table(ID int ",
  479. "update WorkOrdRouting set Status=(case when QtyComplete>=QtyOrded then 'C' else 'W' end),Ufld2='A' where RecID=(select RecID from #workOrdRouting where RecID is not null) end update LineStatusDet set ReleaseQty=ReleaseQty+IsNull(w.QtyOrd,0) ,Employee=@UserNo ,EmployeeName=@UserName ,WorkOrd=(case when w.WorkOrd='' then w.OtherWorkOrd else w.WorkOrd",
  480. "update PeriodSequenceDet set Status='W',UpdateTime=@CurTime,UpdateUser=@UserNo where RecID in(select PeriodRecID from #periodSequenceDet) declare @tbLineDet table(ID int identity(1,1),RecID int,Domain varchar(20),Site varchar(20),ItemNum varchar(50),PlanDate datetime,WorkCtr varchar(20),Line varchar(20),WorkOrd varchar(50),Op varchar(10),RoutingVer",
  481. "update LineStatusDet set ReleaseQty=ReleaseQty+IsNull(w.QtyOrd,0) ,Employee=@UserNo ,EmployeeName=@UserName ,WorkOrd=(case when w.WorkOrd='' then w.OtherWorkOrd else w.WorkOrd end) ,OP=w.Op ,UpdateTime=@CurTime ,ItemNum=w.ItemNum ,ID=w.ID ,ProdDate=@ProdDate ,PlanDate=w.PlanDate ,Period=@Period ,ParItemDesc=left(w.Descr+w.Descr1,60) ,CompItemDesc=w"
  482. ]
  483. },
  484. "pr_SFM_SaveWorkOrdChooseByRWData": {
  485. "empty": false,
  486. "def_len": 5249,
  487. "updates": {
  488. "PeriodSequenceDet": [
  489. "OrdQty",
  490. "UDate1",
  491. "UpdateTime",
  492. "UpdateUser"
  493. ]
  494. },
  495. "inserts": {
  496. "PeriodSequenceDet": [
  497. "Domain",
  498. "Site",
  499. "WorkOrds",
  500. "ItemNum",
  501. "Op",
  502. "Line",
  503. "ProdDate",
  504. "PlanDate",
  505. "Period",
  506. "Sequence",
  507. "OrdQty",
  508. "UChar5",
  509. "UDate1",
  510. "CreateTime",
  511. "UpdateTime",
  512. "CreateUser",
  513. "UpdateUser"
  514. ]
  515. },
  516. "nested": [],
  517. "update_snippets": [
  518. "update PeriodSequenceDet set OrdQty=OrdQty+@PlanQty ,UDate1=case when UDate1 is null then @CurTime else UDate1 end ,UpdateTime=@CurTime ,UpdateUser=@UserNo where Domain=@Domain and Line=@Line and ItemNum=@PItemNum and PlanDate=@ProdDate and Period=@Period and ProdDate=@ProdDate if @@ROWCOUNT=0 insert PeriodSequenceDet( Domain ,Site ,WorkOrds ,ItemN"
  519. ]
  520. },
  521. "pr_SFM_SaveEmployeeWorkStatus": {
  522. "empty": false,
  523. "def_len": 16785,
  524. "updates": {
  525. "EmployeeStatus": [
  526. "StartTime",
  527. "WorkStatus",
  528. "EmploymentStatus",
  529. "JOBNo",
  530. "JOBDescr",
  531. "WorkLocation",
  532. "UpdateTime",
  533. "UpdateUser",
  534. "InductionNum",
  535. "WorkTime"
  536. ],
  537. "LineStatusDet": [
  538. "Employee",
  539. "EmployeeName"
  540. ],
  541. "PeriodSequenceDet": [
  542. "UChar3",
  543. "UChar2"
  544. ],
  545. "EmpWorkHist": [
  546. "EndDate",
  547. "WorkTime",
  548. "UpdateUser",
  549. "UpdateTime",
  550. "WorkOrd",
  551. "ID",
  552. "ItemNum",
  553. "ProdTime2",
  554. "RestTime2",
  555. "UDate1"
  556. ]
  557. },
  558. "inserts": {
  559. "EmployeeStatus": [
  560. "Domain",
  561. "Employee",
  562. "Name",
  563. "StartTime",
  564. "WorkStatus",
  565. "EmploymentStatus",
  566. "JOBNo",
  567. "JOBDescr",
  568. "WorkLocation",
  569. "JobTitle",
  570. "InductionNum",
  571. "CreateTime",
  572. "CreateUser",
  573. "UpdateTime",
  574. "UpdateUser"
  575. ],
  576. "EmpWorkHist": [
  577. "JOBNo",
  578. "JOBDescr",
  579. "StartDate",
  580. "Employee",
  581. "EmployeeName",
  582. "ProdDate",
  583. "Line",
  584. "Period",
  585. "OP",
  586. "WorkOrd",
  587. "ID",
  588. "ItemNum",
  589. "Domain",
  590. "Site",
  591. "UpdateTime",
  592. "UpdateUser",
  593. "CreateTime",
  594. "CreateUser",
  595. "PerDate",
  596. "UDate3",
  597. "InductionNum",
  598. "PlanDate",
  599. "EndDate",
  600. "WorkTime"
  601. ]
  602. },
  603. "nested": [
  604. "pr_SFM_SavePlanDownTimeAndActualTime"
  605. ],
  606. "update_snippets": [
  607. "update PeriodSequenceDet set UChar3=(case when IsNull(UChar3,'')='' then @LineEmployees else UChar3 end), UChar2=(case when IsNull(UChar3,'')='' then @LineEmployeeNames else UChar2 end) from PeriodSequenceDet p,#lineStatusDet s where p.Domain=s.Domain and p.Line=s.Line and p.Period=s.Period and p.PlanDate=s.PlanDate and p.Op=cast(s.OP as int) and p",
  608. "update LineStatusDet set Employee=@LineEmployees,EmployeeName=@LineEmployeeNames from LineStatusDet d,#lineStatusDet s where d.RecID=s.RecID update PeriodSequenceDet set UChar3=(case when IsNull(UChar3,'')='' then @LineEmployees else UChar3 end), UChar2=(case when IsNull(UChar3,'')='' then @LineEmployeeNames else UChar2 end) from PeriodSequenceDet ",
  609. "update LineStatusDet set Employee=replace(d.Employee,@LineEmployees,''),EmployeeName=replace(d.EmployeeName,@LineEmployeeNames,'') from LineStatusDet d,#lineStatusDet s where d.RecID=s.RecID declare @ItemNums varchar(max),@EmpWorkHistRecIDs varchar(max) set @ItemNums=(select ItemNum+'|' from #lineStatusDet group by ItemNum for xml path('')) if exis",
  610. "update EmployeeStatus set StartTime=@CurTime ,WorkStatus='Idle' ,EmploymentStatus='OnDuty' ,JOBNo=@JobNo ,JOBDescr=@JobDescr ,WorkLocation=IsNull(s.WorkLocation,'')+@Line+'-'+convert(varchar(10),e.NewInductionNum)+';' ,JobTitle=null ,InductionNum=s.InductionNum+e.NewInductionNum ,UpdateTime=getdate() ,UpdateUser=@UserNo from EmployeeStatus s,#emplo",
  611. "update EmployeeStatus set UpdateTime=getdate(),UpdateUser=@UserNo ,InductionNum=case when s.InductionNum-e.NewInductionNum<0 then 0 else s.InductionNum-e.NewInductionNum end ,WorkStatus=case when (s.InductionNum-e.NewInductionNum<0) or ( s.InductionNum-e.NewInductionNum=0) then null else s.WorkStatus end ,JOBDescr=case when (s.InductionNum-e.NewInd",
  612. "update EmployeeStatus set WorkTime=datediff(second,s.StartTime,@CurTime)/3600.0 ,WorkLocation=replace(s.WorkLocation,h.Line+'-'+convert(varchar(10),h.InductionNum)+';','') from EmployeeStatus s,#empWorkHist h where s.RecID=h.StatusRecID if (@CompanyCode='YCT' and (select count(1)from #lineStatusDet)>1) begin select it.WorkOrd,it.Op into #OpTransEmp"
  613. ]
  614. },
  615. "pr_SFM_LinePlanedStart": {
  616. "empty": false,
  617. "def_len": 2612,
  618. "updates": {
  619. "LineStatusDet": [
  620. "ProdTime",
  621. "SetupTime",
  622. "RestTime",
  623. "QCTime",
  624. "ProdDownTime",
  625. "NextSetup",
  626. "AlertCode",
  627. "Status",
  628. "ProdType",
  629. "PrvAlertCode",
  630. "PrvAlertDescr",
  631. "PrvProdType",
  632. "UpdateTime",
  633. "UpdateUser"
  634. ],
  635. "LineRunRestDet": [
  636. "FinDate",
  637. "Closed",
  638. "UpdateTime",
  639. "UpdateUser",
  640. "Remark"
  641. ]
  642. },
  643. "inserts": {
  644. "LineRunRestDet": [
  645. "Line",
  646. "Period",
  647. "Domain",
  648. "ComeDate",
  649. "TransType",
  650. "ProdDate",
  651. "CreateTime",
  652. "UpdateTime",
  653. "CreateUser",
  654. "UpdateUser",
  655. "Reason"
  656. ]
  657. },
  658. "nested": [],
  659. "update_snippets": [
  660. "update LineStatusDet set ProdTime=ProdTime+(case when [Status]='Run' then datediff(second,NextSetup,@CurTime) else 0 end) ,SetupTime=SetupTime+(case when [Status]='Setup' or ProdType='Setup' then datediff(second,NextSetup,@CurTime) else 0 end) ,RestTime=RestTime+(case when [Status]='Rest' then datediff(second,NextSetup,@CurTime) else 0 end) ,QCTime"
  661. ]
  662. },
  663. "pr_SFM_LinePlanedEnd": {
  664. "empty": false,
  665. "def_len": 6045,
  666. "updates": {
  667. "LineStatusDet": [
  668. "ProdTime",
  669. "SetupTime",
  670. "RestTime",
  671. "QCTime",
  672. "ProdDownTime",
  673. "NextSetup",
  674. "AlertCode",
  675. "Status",
  676. "ProdType",
  677. "PrvAlertCode",
  678. "PrvAlertDescr",
  679. "UpdateTime",
  680. "UpdateUser",
  681. "BeginDT",
  682. "Endtime",
  683. "ProdTime4"
  684. ],
  685. "LineRunRestDet": [
  686. "FinDate",
  687. "Closed",
  688. "UpdateTime",
  689. "UpdateUser",
  690. "Remark"
  691. ],
  692. "EmpWorkHist": [
  693. "RestTime1"
  694. ]
  695. },
  696. "inserts": {
  697. "LineRunRestDet": [
  698. "Line",
  699. "Period",
  700. "Domain",
  701. "ComeDate",
  702. "TransType",
  703. "ProdDate",
  704. "CreateTime",
  705. "UpdateTime",
  706. "CreateUser",
  707. "UpdateUser",
  708. "Reason"
  709. ]
  710. },
  711. "nested": [],
  712. "update_snippets": [
  713. "update LineStatusDet set ProdTime=ProdTime+(case when [Status]='Run' then datediff(second,NextSetup,@CurTime) else 0 end) ,SetupTime=SetupTime+(case when [Status]='Setup' or ProdType='Setup' then datediff(second,NextSetup,@CurTime) else 0 end) ,RestTime=RestTime+(case when [Status]='Rest' then datediff(second,NextSetup,@CurTime) else 0 end) ,QCTime",
  714. "update LineStatusDet set ProdTime=0,ProdTime4=0 where RecID in(select RecID from #lineStatusDets) end update LineRunRestDet set FinDate=@CurTime ,Closed=1 ,UpdateTime=@CurTime ,UpdateUser=@UserNo ,Remark='linePlanedEnd' output inserted.ComeDate into @tbReset where Domain=@Domain and Line=@Line and Closed=0 set @Reset=IsNull(datediff(second,(select "
  715. ]
  716. },
  717. "pr_SFM_RejectsTransactionProcessingByOp": {
  718. "empty": false,
  719. "def_len": 2785,
  720. "updates": {
  721. "LineStatusDet": [
  722. "ScrapQty",
  723. "RejectQty",
  724. "UpdateTime"
  725. ]
  726. },
  727. "inserts": {},
  728. "nested": [],
  729. "update_snippets": [
  730. "update LineStatusDet set ScrapQty=ScrapQty+(case when @ReasonType='Scrap' then @ScrapQty else 0 end) ,RejectQty=RejectQty+(case when @ReasonType='Reject' then @ScrapQty else 0 end) ,UpdateTime=@CurTime ,@UserNo=@UserNo where RecID=@LineRecID end try begin catch set @Msg=ERROR_MESSAGE() set @tran_error=@tran_error+1 end catch if(@tran_error>0) begin"
  731. ]
  732. },
  733. "pr_SFM_InventoryMesTransactionProcessingByOp": {
  734. "empty": false,
  735. "def_len": 5529,
  736. "updates": {},
  737. "inserts": {},
  738. "nested": [
  739. "pr_SFM_InventoryMesCartonTransactionProcessingByOp"
  740. ],
  741. "update_snippets": []
  742. },
  743. "pr_SFM_InventoryMesCartonTransactionProcessingByOp": {
  744. "empty": false,
  745. "def_len": 129149,
  746. "updates": {
  747. "LineStatusDet": [
  748. "WorkOrd",
  749. "CompQty",
  750. "ScrapQty",
  751. "ScrapQty4",
  752. "RejectQty",
  753. "RejectQty4",
  754. "AddProdTime",
  755. "NextProdTime",
  756. "CompQty4",
  757. "MachineName",
  758. "UDeci1",
  759. "UChar3",
  760. "UpdateTime",
  761. "UpdateUser"
  762. ],
  763. "WorkOrdIssued": [
  764. "IsDelete",
  765. "ParDescr1",
  766. "UpdateTime",
  767. "UpdateUser",
  768. "CompDescr1",
  769. "QtyAllocated",
  770. "LineTotal"
  771. ],
  772. "WorkOrdRouting": [
  773. "QtyComplete",
  774. "QtyScrap",
  775. "QtyReject",
  776. "Status",
  777. "Ufld1",
  778. "Last",
  779. "UpdateTime",
  780. "UpdateUser",
  781. "SubQtyComp"
  782. ],
  783. "WorkOrdMaster": [
  784. "QtyReject",
  785. "QtyCompleted",
  786. "UpdateTime",
  787. "UpdateUser"
  788. ],
  789. "MissedPrint": [
  790. "Qty",
  791. "PurQty",
  792. "WorkOrd",
  793. "Op",
  794. "ItemNum",
  795. "Status",
  796. "UpdateUser",
  797. "UpdateTime",
  798. "Descr",
  799. "Product",
  800. "Location",
  801. "Position",
  802. "PickQty",
  803. "QtyIssued",
  804. "Remark",
  805. "StNbr"
  806. ],
  807. "SingleBarCode": [
  808. "BarCode",
  809. "ItemNum",
  810. "Descr",
  811. "Descr1",
  812. "Op",
  813. "OpDescr",
  814. "Status",
  815. "Location",
  816. "Position",
  817. "WorkOrd",
  818. "ProdLine",
  819. "DevCreateTime",
  820. "UpdateUser",
  821. "UpdateTime"
  822. ],
  823. "ReleaseDet": [
  824. "CompQty",
  825. "IsLocked",
  826. "UChar1",
  827. "UpdateUser",
  828. "UpdateTime",
  829. "UDeci4",
  830. "UChar2"
  831. ]
  832. },
  833. "inserts": {
  834. "MissedPrint": [
  835. "Domain",
  836. "LabelFormat",
  837. "Printer",
  838. "Product",
  839. "ItemNum",
  840. "Descr",
  841. "BarCode",
  842. "Qty",
  843. "Position",
  844. "Carton",
  845. "ProdDate",
  846. "ProdLine",
  847. "OrdNbr",
  848. "Remark",
  849. "Period",
  850. "WorkOrd",
  851. "Location",
  852. "Site",
  853. "Status",
  854. "LotSerial",
  855. "Type",
  856. "Op",
  857. "PurQty",
  858. "CreateUser",
  859. "UpdateUser",
  860. "CreateTime",
  861. "UpdateTime"
  862. ],
  863. "SingleBarCode": [
  864. "Domain",
  865. "ItemNumSN",
  866. "BarCode",
  867. "ItemNum",
  868. "WorkOrd",
  869. "Op",
  870. "ProdLine",
  871. "Status",
  872. "DateType",
  873. "Result",
  874. "DevCreateTime",
  875. "MESProcess",
  876. "Ufld1",
  877. "Ufld2",
  878. "RelChar1",
  879. "RelChar2",
  880. "RelChar3",
  881. "MaterialBarCode1",
  882. "MaterialBarCode2",
  883. "MaterialBarCode3",
  884. "MaterialBarCode4",
  885. "Code1",
  886. "Code2",
  887. "Code3",
  888. "Code4",
  889. "Material1",
  890. "Material2",
  891. "Material3",
  892. "Material4",
  893. "CreateUser",
  894. "UpdateUser",
  895. "CreateTime",
  896. "UpdateTime"
  897. ]
  898. },
  899. "nested": [
  900. "pr_SFM_AccPeriodSequenceDet",
  901. "pr_SFM_BomAnalyzeToMaterielLocations",
  902. "pr_SFM_CheckFeedWorkOrdIsses",
  903. "pr_SFM_CheckInventoryStatus",
  904. "pr_SFM_CreateLineLostSerial",
  905. "pr_SFM_CreateWorkordRoutingEmployeeOp",
  906. "pr_SFM_EndWorkOrdByOp",
  907. "pr_SFM_GetSequenceID",
  908. "pr_SFM_InventoryMesCreateBarCode",
  909. "pr_SFM_InventoryMesWorkOrdIsses",
  910. "pr_SFM_InventoryTransactionProcessing2",
  911. "pr_WMS_SaveInspectionScrap"
  912. ],
  913. "update_snippets": [
  914. "update WorkOrdMaster set QtyReject=QtyReject+@ScrapQty+@RejectQty ,QtyCompleted=QtyCompleted+@CompQty ,UpdateTime=@CurTime ,UpdateUser=@UserNo where Domain=@Domain and WorkOrd=@WorkOrd update mes_morder set work_number=IsNull(work_number,0)+@CompQty ,inventory_number=IsNull(inventory_number,0)+@CompQty ,update_time=@CurTime where factory_id=@Domain",
  915. "update WorkOrdRouting set QtyComplete=QtyComplete+@CompQty ,QtyScrap=QtyScrap+@ScrapQty ,QtyReject=QtyReject+@RejectQty ,Status=(case when (@IsPlanScrapCtr=1 and QtyComplete+@CompQty+QtyScrap+@ScrapQty+QtyReject+@RejectQty>=QtyOrded) or (@IsPlanScrapCtr=0 and QtyComplete+@CompQty>=QtyOrded) then 'C' else Status end) ,Ufld1=@SAPConfirmType ,Last=@Cu",
  916. "update WorkOrdRouting set QtyComplete=QtyComplete-@PrevOpRejectQty ,QtyReject=QtyReject+@PrevOpRejectQty ,UpdateTime=@CurTime ,UpdateUser=@UserNo where Domain=@Domain and WorkOrd=@WorkOrd and ItemNum=@ItemNum and OP=@RejectPrevOp if @IsAssistLine=1 update WorkOrdRouting set SubQtyComp=SubQtyComp+@CompQty ,UpdateTime=@CurTime ,UpdateUser=@UserNo whe",
  917. "update MissedPrint set Qty=(case when BarCode=@TurnoverBarCode then 0 else Qty+@TurnoverQty end), PurQty=(case when BarCode=@TurnoverBarCode then 0 else Qty+@TurnoverQty end), WorkOrd=(case when BarCode=@MoveTurnoverBarCode then @TurnoverWorkOrd else WorkOrd end), Op=(case when BarCode=@MoveTurnoverBarCode then @TurnoverOp else Op end), ItemNum=(ca",
  918. "update MissedPrint set Qty=m.Qty-n.Qty ,PurQty=m.PurQty-n.Qty ,Status=(case when m.Qty>n.Qty then 'D' else 'N' end) ,Op=(case when m.Qty>n.Qty then m.Op else 0 end) ,UpdateUser=@UserNo ,UpdateTime=@CurTime output inserted.RecID,'报工释放原周转箱','单件追溯报工释放原周转箱' into @tbTurnoverRecID(RecID,TransType,Remark) from MissedPrint m,(select BarCode,count(*) as Qty",
  919. "update MissedPrint set Qty=Qty+@ProcessDiffQty ,PurQty=PurQty+@ProcessDiffQty ,ItemNum=(case when Qty=0 then @ItemNum else ItemNum end) ,Descr=(case when Qty=0 then @ItemDescr else Descr end) ,Product=(case when Qty=0 then @ItemDescr1 else Product end) ,Op=(case when Qty=0 then @MissedPrintOp else Op end) ,Location=(case when Qty=0 then @MissedPrin",
  920. "update MissedPrint set Qty=m.Qty-t.UseQty ,PurQty=m.PurQty-t.UseQty ,ItemNum=(case when m.Qty=t.UseQty then '' else m.ItemNum end) ,Descr=(case when m.Qty=t.UseQty then '' else m.Descr end) ,Product=(case when m.Qty=t.UseQty then '' else m.Product end) ,Op=(case when m.Qty=t.UseQty then 0 else m.Op end) ,Location=(case when m.Qty=t.UseQty then '' e",
  921. "update MissedPrint set Qty=m.Qty-t.CurQtyAllocated ,PurQty=m.PurQty-t.CurQtyAllocated ,PickQty=(case when @IsPaintingLine=1 then m.PickQty-t.CurQtyAllocated else m.PickQty end) ,QtyIssued=(case when m.Type in('Turnover','Kanban') then m.QtyIssued else m.QtyIssued+t.CurQtyAllocated end) ,Status=(case when IsNull(m.Type,'') not in('Turnover','Kanban'",
  922. "update LineStatusDet set WorkOrd=@WorkOrd where RecID=@LineRecID drop table #otherWorkordRouting end declare @WorkOrdBatch varchar(50),@WorkOrdOpDescr varchar(160)='',@WorkOrdStatus varchar(10),@WorkOrdFID varchar(30),@WorkOrdRefs varchar(30),@WorkOrdBomVer varchar(100),@WorkOrdLotSerial varchar(60)='' select top 1 @WorkOrdBatch=Batch,@WorkOrdOpDes",
  923. "update LineStatusDet set CompQty=CompQty+@CompQty ,ScrapQty=ScrapQty+(case when @IsScrapByOp=1 then 0 else @ScrapQty end) ,ScrapQty4=ScrapQty4+@ScrapQty ,RejectQty=RejectQty+(case when @IsScrapByOp=1 then 0 else @RejectQty end) ,RejectQty4=RejectQty4+@RejectQty ,AddProdTime=AddProdTime+(case when NextProdTime is not null then datediff(second,NextPr"
  924. ]
  925. },
  926. "pr_SFM_EndWorkOrdByOp": {
  927. "empty": false,
  928. "def_len": 14884,
  929. "updates": {
  930. "PeriodSequenceDet": [
  931. "Status",
  932. "UpdateTime",
  933. "UpdateUser",
  934. "OrdQty"
  935. ],
  936. "WorkOrdRouting": [
  937. "Status",
  938. "UpdateTime",
  939. "UpdateUser"
  940. ],
  941. "WorkOrdMaster": [
  942. "Status",
  943. "Ufld2",
  944. "AcctingClosed",
  945. "AcctingCloseDate",
  946. "UpdateTime",
  947. "UpdateUser"
  948. ],
  949. "LineRunRestDet": [
  950. "FinDate",
  951. "Closed",
  952. "UpdateTime",
  953. "UpdateUser",
  954. "Remark"
  955. ],
  956. "WorkOrdIssued": [
  957. "QtyIssued",
  958. "UpdateTime",
  959. "UpdateUser"
  960. ],
  961. "LineMaster": [
  962. "Ufld2",
  963. "QCBeginDT",
  964. "QCNextDT",
  965. "CheckFrequency"
  966. ]
  967. },
  968. "inserts": {},
  969. "nested": [
  970. "pr_SFM_AccPeriodSequenceDet",
  971. "pr_SFM_GetSequenceID",
  972. "pr_SFM_InventoryMesCartonTransactionProcessingByOp"
  973. ],
  974. "update_snippets": [
  975. "update WorkOrdMaster set Status=case when @IsSFMClosedWorkOrd=1 or (@IsPlanScrapCtr=1 and QtyCompleted+QtyReject>=QtyOrded) or (@IsPlanScrapCtr=0 and QtyCompleted>=QtyOrded) then 'C' else 'S' end ,Ufld2=case when @IsSFMClosedWorkOrd=1 or (@IsPlanScrapCtr=1 and QtyCompleted+QtyReject>=QtyOrded) or (@IsPlanScrapCtr=0 and QtyCompleted>=QtyOrded) then ",
  976. "update WorkOrdRouting set Status=case when @IsSFMClosedWorkOrd=1 or (@IsPlanScrapCtr=1 and QtyComplete+QtyReject+QtyScrap>=QtyOrded) or (@IsPlanScrapCtr=0 and QtyComplete>=QtyOrded) then 'C' else 'S' end ,UpdateTime=@CurTime ,UpdateUser=@UserNo output inserted.Status,inserted.MilestoneOp into @tbWorkOrdRouting(Status,MilestoneOp) where RecID=@WorkO",
  977. "update PeriodSequenceDet set Status=@WorkOrdStatus ,UpdateTime=@CurTime ,UpdateUser=@UserNo where Domain=@Domain and Line=@Line and ItemNum=@LineItemNum and PlanDate=@LinePlanDate and Period=@LinePlanPeriod and Op=@IntOp and WorkOrds=@WorkOrd and OrdQty>0 and UChar4=(case when @IsNoWorkOrdPlan=1 then @RoutingVer else UChar4 end) end if @VirtualPlan"
  978. ]
  979. },
  980. "pr_SFM_AccPeriodSequenceDet": {
  981. "empty": false,
  982. "def_len": 8206,
  983. "updates": {
  984. "PeriodSequenceDet": [
  985. "ProdDate",
  986. "WorkOrds",
  987. "RunCrew",
  988. "WholeNormal",
  989. "OrdQty",
  990. "UDeci3",
  991. "SetupTime",
  992. "UDeci2",
  993. "ProductActual",
  994. "CompQty",
  995. "UInt1",
  996. "ScrapQty",
  997. "RejectQty",
  998. "BackQty",
  999. "UDeci1",
  1000. "ProductStandard",
  1001. "WholeDynamic",
  1002. "UDate2",
  1003. "QCTime",
  1004. "PlanDownTime",
  1005. "UChar3",
  1006. "UChar2",
  1007. "UChar1",
  1008. "UDate1",
  1009. "WorkCtr",
  1010. "UInt2",
  1011. "UInt3",
  1012. "UpdateTime",
  1013. "UpdateUser"
  1014. ]
  1015. },
  1016. "inserts": {
  1017. "PeriodSequenceDet": [
  1018. "Domain",
  1019. "Site",
  1020. "PlanDate",
  1021. "Period",
  1022. "ItemNum",
  1023. "Line",
  1024. "UDate1",
  1025. "UChar5",
  1026. "Op",
  1027. "ProdDate",
  1028. "WorkOrds",
  1029. "RunCrew",
  1030. "WholeNormal",
  1031. "OrdQty",
  1032. "UDeci3",
  1033. "SetupTime",
  1034. "ProductActual",
  1035. "CompQty",
  1036. "UInt1",
  1037. "ScrapQty",
  1038. "RejectQty",
  1039. "BackQty",
  1040. "UDeci1",
  1041. "ProductStandard",
  1042. "WholeDynamic",
  1043. "UDate2",
  1044. "QCTime",
  1045. "PlanDownTime",
  1046. "UChar3",
  1047. "UChar2",
  1048. "UChar1",
  1049. "WorkCtr",
  1050. "UInt2",
  1051. "UChar4",
  1052. "UInt3",
  1053. "Status",
  1054. "Sequence",
  1055. "UDeci2",
  1056. "BusinessID",
  1057. "IsActive"
  1058. ]
  1059. },
  1060. "nested": [],
  1061. "update_snippets": [
  1062. "update PeriodSequenceDet set ProdDate=@ProdDate ,WorkOrds=case when IsNull(WorkOrds,'')='' and IsNull(@WorkOrd,'')<>'' then @WorkOrd else WorkOrds end ,RunCrew=@RunCrew ,WholeNormal=@WholeNormal ,OrdQty=case when @OrdQty>0 then OrdQty+@OrdQty else OrdQty end ,UDeci3=case when @UdecQty>0 then UDeci3+@UdecQty else UDeci3 end ,SetupTime=case when @Set",
  1063. "update PeriodSequenceDet set OrdQty=OrdQty-@OrdQty where RecID=@VirtualPlanRecID set @ReturnMsg='保存周期表成功!' end try begin catch set @ReturnMsg='保存周期表失败,'+IsNull(ERROR_MESSAGE(),'') end catch"
  1064. ]
  1065. },
  1066. "pr_MES_UpdateWorkOrder": {
  1067. "empty": false,
  1068. "def_len": 2866,
  1069. "updates": {
  1070. "WorkOrdMaster": [
  1071. "QtyOrded",
  1072. "LotSerial",
  1073. "Priority",
  1074. "UpdateTime",
  1075. "UpdateUser"
  1076. ],
  1077. "WorkOrdRouting": [
  1078. "QtyOrded",
  1079. "UpdateTime",
  1080. "UpdateUser",
  1081. "Status"
  1082. ],
  1083. "WorkOrdDetail": [
  1084. "QtyRequired",
  1085. "UpdateTime",
  1086. "UpdateUser"
  1087. ],
  1088. "NbrMaster": [
  1089. "Status",
  1090. "UpdateTime",
  1091. "UpdateUser"
  1092. ],
  1093. "NbrDetail": [
  1094. "Status",
  1095. "QtyOrd",
  1096. "CurrQtyOpened",
  1097. "UpdateTime",
  1098. "UpdateUser"
  1099. ]
  1100. },
  1101. "inserts": {},
  1102. "nested": [
  1103. "pr_SFM_GetSequenceID"
  1104. ],
  1105. "update_snippets": [
  1106. "update WorkOrdMaster set QtyOrded=@Qty,LotSerial=@LotSerial,Priority=@Priority,UpdateTime=GETDATE(),UpdateUser=@UserNO where Domain = @Domian and WorkOrd =@WorkOrd update mes_morder set need_number=@Qty,morder_production_number=@Qty,update_time=GETDATE(),update_by_name=@UserNO where morder_no=@WorkOrd update mes_moentry set need_number=@Qty,morder_",
  1107. "update WorkOrdRouting set QtyOrded=@Qty,UpdateTime=GETDATE(),UpdateUser=@UserNO,Status=iif(Status='C','W',Status) where WorkOrd =@WorkOrd --更新物料 update WorkOrdDetail set QtyRequired=CEILING(FrozenBOMQty*@Qty),UpdateTime=GETDATE(),UpdateUser=@UserNO where WorkOrd =@WorkOrd --更新领料单 update NbrMaster set Status = '',UpdateTime=GETDATE(),UpdateUser=@Use",
  1108. "update NbrDetail set Status='',QtyOrd=CEILING(b.FrozenBOMQty*@Qty),CurrQtyOpened=CEILING(b.FrozenBOMQty*@Qty),UpdateTime=GETDATE(),UpdateUser=@UserNO from NbrDetail a,WorkOrdDetail b where a.itemnum=b.itemnum and a.workord=b.workord and a.type='SM' and a.QtyOrd<>CEILING(b.FrozenBOMQty*@Qty) and a.WorkOrd=@WorkOrd and a.Domain=@Domian --添加工单修改事务推送 d",
  1109. "update NbrMaster set Status = '',UpdateTime=GETDATE(),UpdateUser=@UserNO where Type ='SM' and Domain = @Domian and WorkOrd =@WorkOrd and Nbr in (select Nbr from NbrDetail a,WorkOrdDetail b where a.itemnum=b.itemnum and a.workord=b.workord and a.type='SM' and a.QtyOrd<>CEILING(b.FrozenBOMQty*@Qty) and a.WorkOrd=@WorkOrd ) --更新领料单明细 update NbrDetail ",
  1110. "update WorkOrdDetail set QtyRequired=CEILING(FrozenBOMQty*@Qty),UpdateTime=GETDATE(),UpdateUser=@UserNO where WorkOrd =@WorkOrd --更新领料单 update NbrMaster set Status = '',UpdateTime=GETDATE(),UpdateUser=@UserNO where Type ='SM' and Domain = @Domian and WorkOrd =@WorkOrd and Nbr in (select Nbr from NbrDetail a,WorkOrdDetail b where a.itemnum=b.itemnum"
  1111. ]
  1112. },
  1113. "pr_MES_CloseWorkOrders": {
  1114. "empty": false,
  1115. "def_len": 2962,
  1116. "updates": {
  1117. "WorkOrdMaster": [
  1118. "Status",
  1119. "AcctingClosed"
  1120. ],
  1121. "NbrMaster": [
  1122. "Status"
  1123. ],
  1124. "NbrDetail": [
  1125. "Status"
  1126. ]
  1127. },
  1128. "inserts": {},
  1129. "nested": [
  1130. "pr_SFM_GetSequenceID"
  1131. ],
  1132. "update_snippets": [
  1133. "update WorkOrdMaster set Status = 'C',AcctingClosed=1 where Domain = @Domian and WorkOrd in (select col from [dbo].[f_splitSTR](@WorkOrds,'|')); --更新领料单状态为C update NbrMaster set Status = 'C' where Type ='SM' and Domain = @Domian and WorkOrd in (select col from [dbo].[f_splitSTR](@WorkOrds,'|')); --更新领料单明细状态为C update NbrDetail set Status='C' where D",
  1134. "update NbrDetail set Status='C' where Domain = @Domian and Type ='SM' and Nbr in ( select Nbr from NbrMaster where Type ='SM' and Domain = @Domian and WorkOrd in (select col from [dbo].[f_splitSTR](@WorkOrds,'|')) ); --更新退料单状态为C update NbrMaster set Status = 'C' where Type ='WOD' and Domain = @Domian and WorkOrd in (select col from [dbo].[f_splitST",
  1135. "update NbrMaster set Status = 'C' where Type ='SM' and Domain = @Domian and WorkOrd in (select col from [dbo].[f_splitSTR](@WorkOrds,'|')); --更新领料单明细状态为C update NbrDetail set Status='C' where Domain = @Domian and Type ='SM' and Nbr in ( select Nbr from NbrMaster where Type ='SM' and Domain = @Domian and WorkOrd in (select col from [dbo].[f_splitSTR"
  1136. ]
  1137. }
  1138. }