Inventory.cs 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  1. // 函数:库存销减;
  2. // 保存前的数据 beforeSaveModel;
  3. // 当前的数据 currentMode是currentMode的备份修改;
  4. // 订单开单减库存模式, 否则取件减库存在模式;
  5. // OPlist_ProdQuantity 商品数量;
  6. // OPlist_PickupStatus 取件状态 "0":未取 "1":OK(已取);
  7. // OPlist_PickupQuantity 取走数量;
  8. // OPlist_CompletedStatus 完成状态 "0":未完 "1":已完(OK);
  9. // OPlist_CompletedQuantity 完成数量;
  10. // OPlist_CompletedHadLessQuantity 库存已减数量;
  11. void InventoryQuantity(LYFZ.Model.Model_ErpOrderProductList beforeSaveModel, LYFZ.Model.Model_ErpOrderProductList currentMode, bool IsOrderModel = false )
  12. {
  13. // 必须有一个不为空;
  14. if ( beforeSaveModel == null && currentMode == null )
  15. return;
  16. LYFZ.BLL.BLL_ErpProduct prodcutBll = new BLL.BLL_ErpProduct();
  17. if ( beforeSaveModel == null && currentMode != null )
  18. {// 保存前没有数据, 添加新库存;
  19. }
  20. else if ( beforeSaveModel != null && currentMode == null )
  21. {// 当前数据空,表示删除订单商品, 减库存;
  22. }
  23. else
  24. {
  25. // 如果商品ID不一致,表示不是同一个商品比较;
  26. if ( beforeSaveModel.ID != currentMode.ID )
  27. return;
  28. if ( IsOrderModel )
  29. {// 开单减库存模式;
  30. }
  31. else
  32. {// 取件减库存模式(如果取件状态为未取, 则出库以完成数量为准);
  33. if ( beforeSaveModel.OPlist_PickupStatus == "0" && currentMode.OPlist_PickupStatus == "0" )
  34. {// 取件状态前后都没有变化的;
  35. if ( beforeSaveModel.OPlist_CompletedStatus == "1" && currentMode.OPlist_CompletedStatus == "0" )
  36. {// 由未完成变成已完成;
  37. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), currentMode.OPlist_CompletedQuantity, true );
  38. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_CompletedQuantity;
  39. }
  40. if (beforeSaveModel.OPlist_CompletedStatus == "0" && currentMode.OPlist_CompletedStatus == "1" )
  41. {// 由已完成变成未完成;
  42. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), beforeSaveModel.OPlist_CompletedQuantity, false );
  43. currentMode.OPlist_CompletedHadLessQuantity = 0;
  44. currentMode.OPlist_CompletedQuantity = 0;
  45. }
  46. if (beforeSaveModel.OPlist_CompletedStatus == "0" && currentMode.OPlist_CompletedStatus == "0" )
  47. {// 完成状态都是"完成";
  48. if ( beforeSaveModel.OPlist_CompletedQuantity > currentMode.OPlist_CompletedQuantity )
  49. {// 完成数量变少;
  50. int nDiffValue = beforeSaveModel.OPlist_CompletedQuantity - currentMode.OPlist_CompletedQuantity;
  51. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, false );
  52. currentMode.OPlist_CompletedHadLessQuantity = beforeSaveModel.OPlist_CompletedQuantity - nDiffValue;
  53. }
  54. if ( beforeSaveModel.OPlist_CompletedQuantity < currentMode.OPlist_CompletedQuantity )
  55. {// 完成数量变多;
  56. int nDiffValue = currentMode.OPlist_CompletedQuantity - beforeSaveModel.OPlist_CompletedQuantity;
  57. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, true );
  58. currentMode.OPlist_CompletedHadLessQuantity = beforeSaveModel.OPlist_CompletedQuantity + nDiffValue;
  59. }
  60. }
  61. }
  62. else if ( beforeSaveModel.OPlist_PickupStatus == "0" && currentMode.OPlist_PickupStatus == "1" )
  63. {// 取件状态由"未取"变成"已取"的;
  64. if ( beforeSaveModel.OPlist_CompletedStatus == "1" && currentMode.OPlist_CompletedStatus == "1" )
  65. {// 未完成->未完成;
  66. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), currentMode.OPlist_PickupQuantity, true );
  67. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_PickupQuantity;
  68. }
  69. if ( beforeSaveModel.OPlist_CompletedStatus == "1" && currentMode.OPlist_CompletedStatus == "0" )
  70. {// 未完成->已完成;
  71. if ( currentMode.OPlist_CompletedQuantity >= currentMode.OPlist_PickupQuantity )
  72. {// 完成数量 大于或等于 取件数量;
  73. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), currentMode.OPlist_CompletedQuantity, true );
  74. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_CompletedQuantity;
  75. }
  76. else if ( currentMode.OPlist_CompletedQuantity < currentMode.OPlist_PickupQuantity )
  77. {// 取件数量 大于 完成数量;
  78. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), currentMode.OPlist_PickupQuantity, true );
  79. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_PickupQuantity;
  80. }
  81. }
  82. if (beforeSaveModel.OPlist_CompletedStatus == "0" && currentMode.OPlist_CompletedStatus == "1" )
  83. {// 已完成->未完成;
  84. if ( beforeSaveModel.OPlist_CompletedQuantity == currentMode.OPlist_PickupQuantity )
  85. {// 完成数量 等于 取件数量;
  86. // 不用处理//此处代码勿删, 以保持代码逻辑完成性;
  87. }
  88. else if ( beforeSaveModel.OPlist_CompletedQuantity > currentMode.OPlist_PickupQuantity )
  89. {// 完成数量 > 取件数量;
  90. int nDiffValue = beforeSaveModel.OPlist_CompletedQuantity - currentMode.OPlist_PickupQuantity;
  91. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, false );
  92. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_PickupQuantity;
  93. }
  94. else if ( beforeSaveModel.OPlist_CompletedQuantity < currentMode.OPlist_PickupQuantity )
  95. {// 完成数量 < 取件数量;
  96. int nDiffValue = currentMode.OPlist_PickupQuantity - beforeSaveModel.OPlist_CompletedQuantity;
  97. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, true );
  98. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_PickupQuantity;
  99. }
  100. }
  101. if (beforeSaveModel.OPlist_CompletedStatus == "0" && currentMode.OPlist_CompletedStatus == "0" )
  102. {// 已完成->已完成;
  103. if ( beforeSaveModel.OPlist_CompletedQuantity == currentMode.OPlist_CompletedQuantity )
  104. {// 完成数量没有变化;
  105. if ( currentMode.OPlist_CompletedQuantity >= currentMode.OPlist_PickupQuantity )
  106. {
  107. // 不用处理,仍以完成数量为减库存指标值//此处代码勿删, 以保持代码逻辑完成性;
  108. }
  109. else if ( currentMode.OPlist_CompletedQuantity < currentMode.OPlist_PickupQuantity )
  110. {// 完成数量 < 取件数量;
  111. int nDiffValue = currentMode.OPlist_PickupQuantity - currentMode.OPlist_CompletedQuantity;
  112. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, false );
  113. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_PickupQuantity;
  114. }
  115. }
  116. else if ( beforeSaveModel.OPlist_CompletedQuantity > currentMode.OPlist_CompletedQuantity )
  117. {// 完成数量变少;
  118. int nDiffValue = beforeSaveModel.OPlist_CompletedQuantity - currentMode.OPlist_CompletedQuantity;
  119. if ( currentMode.OPlist_CompletedQuantity >= currentMode.OPlist_PickupQuantity )
  120. {// 完成数量 >= 取件数量;
  121. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, false );
  122. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_CompletedQuantity;
  123. }
  124. else if ( currentMode.OPlist_CompletedQuantity < currentMode.OPlist_PickupQuantity )
  125. {// 完成数量 < 取件数量;
  126. if ( currentMode.OPlist_PickupQuantity == beforeSaveModel.OPlist_CompletedQuantity )
  127. {
  128. // 不用处理, 代码勿删, 保持逻辑完整性;
  129. }
  130. else if ( currentMode.OPlist_PickupQuantity > beforeSaveModel.OPlist_CompletedQuantity )
  131. {
  132. nDiffValue = currentMode.OPlist_PickupQuantity - beforeSaveModel.OPlist_CompletedQuantity;
  133. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, true );
  134. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_PickupQuantity;
  135. }
  136. else if ( currentMode.OPlist_PickupQuantity < beforeSaveModel.OPlist_CompletedQuantity )
  137. {
  138. nDiffValue = beforeSaveModel.OPlist_CompletedQuantity - currentMode.OPlist_PickupQuantity;
  139. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, false );
  140. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_PickupQuantity;
  141. }
  142. }
  143. }
  144. else if ( beforeSaveModel.OPlist_CompletedQuantity < currentMode.OPlist_CompletedQuantity )
  145. {// 完成数量变多;
  146. int nDiffValue = currentMode.OPlist_CompletedQuantity - beforeSaveModel.OPlist_CompletedQuantity;
  147. if ( currentMode.OPlist_CompletedQuantity >= currentMode.OPlist_PickupQuantity )
  148. {// 完成数量 >= 取件数量;
  149. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, true );
  150. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_CompletedQuantity;
  151. }
  152. else if (currentMode.OPlist_CompletedQuantity < currentMode.OPlist_PickupQuantity)
  153. {// 完成数量 < 取件数量;
  154. nDiffValue = currentMode.OPlist_PickupQuantity - beforeSaveModel.OPlist_CompletedQuantity;
  155. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, true );
  156. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_PickupQuantity;
  157. }
  158. }
  159. }
  160. }
  161. else if ( beforeSaveModel.OPlist_PickupStatus == "1" && currentMode.OPlist_PickupStatus == "1" )
  162. {// 取件状态一直是"已取"的;
  163. if ( beforeSaveModel.OPlist_CompletedStatus == "1" && currentMode.OPlist_CompletedStatus == "1" )
  164. {// "未完成" -> "未完成";
  165. if ( beforeSaveModel.OPlist_PickupQuantity == currentMode.OPlist_PickupQuantity )
  166. {// 取件数量不变;
  167. // 不处理;
  168. }
  169. else if ( beforeSaveModel.OPlist_PickupQuantity > currentMode.OPlist_PickupQuantity )
  170. {// 取件数量变少;
  171. int nDiffValue = beforeSaveModel.OPlist_PickupQuantity - currentMode.OPlist_PickupQuantity;
  172. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, false );
  173. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_PickupQuantity;
  174. }
  175. else if ( beforeSaveModel.OPlist_PickupQuantity < currentMode.OPlist_PickupQuantity )
  176. {// 取件数量变多;
  177. int nDiffValue = currentMode.OPlist_PickupQuantity - beforeSaveModel.OPlist_PickupQuantity;
  178. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, true );
  179. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_PickupQuantity;
  180. }
  181. }
  182. if ( beforeSaveModel.OPlist_CompletedStatus == "1" && currentMode.OPlist_CompletedStatus == "0" )
  183. {// "未完成"->"已完成";
  184. if ( beforeSaveModel.OPlist_PickupQuantity == currentMode.OPlist_PickupQuantity )
  185. {// 取件数量不变;
  186. if ( currentMode.OPlist_PickupQuantity >= currentMode.OPlist_CompletedQuantity )
  187. {
  188. // 不处理;
  189. }
  190. else if ( currentMode.OPlist_PickupQuantity < currentMode.OPlist_CompletedQuantity )
  191. {
  192. int nDiffValue = currentMode.OPlist_CompletedQuantity - currentMode.OPlist_PickupQuantity;
  193. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, true );
  194. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_CompletedQuantity;
  195. }
  196. }
  197. if ( beforeSaveModel.OPlist_PickupQuantity < currentMode.OPlist_PickupQuantity )
  198. {// 取件数量变多;
  199. int nDiffValue = currentMode.OPlist_PickupQuantity - beforeSaveModel.OPlist_PickupQuantity;
  200. if ( currentMode.OPlist_PickupQuantity >= currentMode.OPlist_CompletedQuantity )
  201. {// 取件数量 >= 完成数量;
  202. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, true );
  203. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_PickupQuantity;
  204. }
  205. else if ( currentMode.OPlist_PickupQuantity < currentMode.OPlist_CompletedQuantity )
  206. {// 取件数量 < 完成数量;
  207. nDiffValue = currentMode.OPlist_CompletedQuantity - beforeSaveModel.OPlist_PickupQuantity;
  208. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, true );
  209. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_CompletedQuantity;
  210. }
  211. }
  212. if ( beforeSaveModel.OPlist_PickupQuantity > currentMode.OPlist_PickupQuantity )
  213. {// 取件数量变少;
  214. if ( currentMode.OPlist_CompletedQuantity == beforeSaveModel.OPlist_PickupQuantity )
  215. {
  216. // 不用处理;
  217. }
  218. if ( currentMode.OPlist_CompletedQuantity > beforeSaveModel.OPlist_PickupQuantity )
  219. {// 完成数量 > 取走数量;
  220. int nDiffValue = currentMode.OPlist_CompletedQuantity - beforeSaveModel.OPlist_PickupQuantity;
  221. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, true );
  222. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_CompletedQuantity;
  223. }
  224. else if ( currentMode.OPlist_CompletedQuantity < beforeSaveModel.OPlist_PickupQuantity )
  225. {// 完成数量 < 取走数量;
  226. if ( currentMode.OPlist_CompletedQuantity >= currentMode.OPlist_PickupQuantity )
  227. {
  228. int nDiffValue = beforeSaveModel.OPlist_PickupQuantity - currentMode.OPlist_CompletedQuantity;
  229. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, false );
  230. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_CompletedQuantity;
  231. }
  232. else if ( currentMode.OPlist_CompletedQuantity < currentMode.OPlist_PickupQuantity )
  233. {
  234. int nDiffValue = beforeSaveModel.OPlist_PickupQuantity - currentMode.OPlist_PickupQuantity;
  235. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, false );
  236. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_PickupQuantity;
  237. }
  238. }
  239. }
  240. }
  241. if (beforeSaveModel.OPlist_CompletedStatus == "0" && currentMode.OPlist_CompletedStatus == "1" )
  242. {// "已完成"->"未完成";
  243. if ( beforeSaveModel.OPlist_PickupQuantity == currentMode.OPlist_PickupQuantity )
  244. {// 取件数量不变;
  245. if ( currentMode.OPlist_PickupQuantity >= beforeSaveModel.OPlist_CompletedQuantity )
  246. {
  247. // 不用处理;
  248. }
  249. else if ( currentMode.OPlist_PickupQuantity < beforeSaveModel.OPlist_CompletedQuantity )
  250. {
  251. int nDiffValue = beforeSaveModel.OPlist_CompletedQuantity - currentMode.OPlist_PickupQuantity;
  252. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, false );
  253. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_PickupQuantity;
  254. }
  255. }
  256. else if ( beforeSaveModel.OPlist_PickupQuantity > currentMode.OPlist_PickupQuantity )
  257. {// 取件数量变少;
  258. int nDiffValue = beforeSaveModel.OPlist_PickupQuantity - currentMode.OPlist_PickupQuantity;
  259. if ( beforeSaveModel.OPlist_PickupQuantity >= beforeSaveModel.OPlist_CompletedQuantity )
  260. {
  261. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, false );
  262. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_PickupQuantity;
  263. }
  264. else if ( beforeSaveModel.OPlist_PickupQuantity < beforeSaveModel.OPlist_CompletedQuantity )
  265. {
  266. nDiffValue = beforeSaveModel.OPlist_CompletedQuantity - currentMode.OPlist_PickupQuantity;
  267. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, false );
  268. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_PickupQuantity;
  269. }
  270. }
  271. if ( beforeSaveModel.OPlist_PickupQuantity < currentMode.OPlist_PickupQuantity )
  272. {// 取件数量变多;
  273. int nDiffValue = currentMode.OPlist_PickupQuantity - beforeSaveModel.OPlist_PickupQuantity;
  274. if ( currentMode.OPlist_PickupQuantity == beforeSaveModel.OPlist_CompletedQuantity )
  275. {
  276. // 不处理;
  277. }
  278. else if ( currentMode.OPlist_PickupQuantity > beforeSaveModel.OPlist_CompletedQuantity )
  279. {
  280. if ( beforeSaveModel.OPlist_PickupQuantity >= beforeSaveModel.OPlist_CompletedQuantity )
  281. {
  282. int nDiffValue = currentMode.OPlist_PickupQuantity - beforeSaveModel.OPlist_PickupQuantity;
  283. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, true );
  284. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_PickupQuantity;
  285. }
  286. else if ( beforeSaveModel.OPlist_PickupQuantity < beforeSaveModel.OPlist_CompletedQuantity )
  287. {
  288. int nDiffValue = currentMode.OPlist_PickupQuantity - beforeSaveModel.OPlist_CompletedQuantity;
  289. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, true );
  290. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_PickupQuantity;
  291. }
  292. }
  293. else if ( currentMode.OPlist_PickupQuantity < beforeSaveModel.OPlist_CompletedQuantity )
  294. {
  295. int nDiffValue = beforeSaveModel.OPlist_CompletedQuantity - currentMode.OPlist_PickupQuantity;
  296. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, false );
  297. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_PickupQuantity;
  298. }
  299. }
  300. }
  301. if (beforeSaveModel.OPlist_CompletedStatus == "0" && currentMode.OPlist_CompletedStatus == "0" )
  302. {// "已完成"->"已完成";
  303. if ( beforeSaveModel.OPlist_CompletedQuantity == currentMode.OPlist_CompletedQuantity )
  304. {// 完成数量不变;
  305. if ( beforeSaveModel.OPlist_PickupQuantity == currentMode.OPlist_PickupQuantity )
  306. {// 取走数量不变;
  307. // 不用处理;
  308. }
  309. else if ( beforeSaveModel.OPlist_PickupQuantity > currentMode.OPlist_PickupQuantity )
  310. {// 取走数量变少;
  311. int nDiffValue = beforeSaveModel.OPlist_PickupQuantity - currentMode.OPlist_PickupQuantity;
  312. if ( currentMode.OPlist_CompletedQuantity == currentMode.OPlist_PickupQuantity )
  313. {
  314. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, false );
  315. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_PickupQuantity;
  316. }
  317. else if ( currentMode.OPlist_CompletedQuantity < currentMode.OPlist_PickupQuantity )
  318. {
  319. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, false );
  320. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_PickupQuantity;
  321. }
  322. else if ( currentMode.OPlist_CompletedQuantity > currentMode.OPlist_PickupQuantity )
  323. {
  324. if ( currentMode.OPlist_CompletedQuantity >= beforeSaveModel.OPlist_PickupQuantity )
  325. {
  326. // 不处理;
  327. }
  328. else if ( currentMode.OPlist_CompletedQuantity < beforeSaveModel.OPlist_PickupQuantity )
  329. {
  330. nDiffValue = beforeSaveModel.OPlist_CompletedQuantity - currentMode.OPlist_CompletedQuantity;
  331. prodcutBll.GetProductLessInventory( currentMode.OPlist_ProdNumber.Trim(), nDiffValue, false );
  332. currentMode.OPlist_CompletedHadLessQuantity = currentMode.OPlist_CompletedQuantity;
  333. }
  334. }
  335. }
  336. else if ( beforeSaveModel.OPlist_PickupQuantity < currentMode.OPlist_PickupQuantity )
  337. {// 取走数量变多;
  338. }
  339. }
  340. if ( beforeSaveModel.OPlist_CompletedQuantity > currentMode.OPlist_CompletedQuantity )
  341. {// 完成数量变少;
  342. if ( beforeSaveModel.OPlist_PickupQuantity == currentMode.OPlist_PickupQuantity )
  343. {// 取走数量不变;
  344. }
  345. else if ( beforeSaveModel.OPlist_PickupQuantity > currentMode.OPlist_PickupQuantity )
  346. {// 取走数量变少;
  347. }
  348. else if ( beforeSaveModel.OPlist_PickupQuantity < currentMode.OPlist_PickupQuantity )
  349. {// 取走数量变多;
  350. }
  351. }
  352. if ( beforeSaveModel.OPlist_CompletedQuantity < currentMode.OPlist_CompletedQuantity )
  353. {// 完成数量变多;
  354. if ( beforeSaveModel.OPlist_PickupQuantity == currentMode.OPlist_PickupQuantity )
  355. {// 取走数量不变;
  356. }
  357. else if ( beforeSaveModel.OPlist_PickupQuantity > currentMode.OPlist_PickupQuantity )
  358. {// 取走数量变少;
  359. }
  360. else if ( beforeSaveModel.OPlist_PickupQuantity < currentMode.OPlist_PickupQuantity )
  361. {// 取走数量变多;
  362. }
  363. }
  364. }
  365. }
  366. }
  367. }
  368. }