change_pos.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  1. 'use strict';
  2. /**
  3. * 变更插入新增 - 部位明细
  4. *
  5. * @author Mai
  6. * @date
  7. * @version
  8. */
  9. module.exports = app => {
  10. class ChangePos extends app.BaseService {
  11. /**
  12. * 构造函数
  13. *
  14. * @param {Object} ctx - egg全局变量
  15. * @return {void}
  16. */
  17. constructor(ctx) {
  18. super(ctx);
  19. // this.depart = ctx.app.config.table_depart.heavy;
  20. this.tableName = 'change_pos';
  21. }
  22. async getPosData(condition, columns) {
  23. if (!condition.tid) throw '查询计量单元缺少必要信息';
  24. return await this.db.select(this.tableName, {
  25. where: condition,
  26. columns: columns || ['id', 'tid', 'lid', 'name', 'quantity', 'position', 'drawing_code', 'sgfh_qty', 'sjcl_qty',
  27. 'qtcl_qty', 'in_time', 'porder', 'add_stage', 'sgfh_expr', 'sjcl_expr', 'qtcl_expr', 'real_qty',
  28. 'dagl_status', 'dagl_url', 'gxby_status', 'gxby_limit', 'dagl_limit', 'dagl_status',
  29. 'ex_memo1', 'ex_memo2', 'ex_memo3', 'ccid', 'formc', 'ex_qty1'],
  30. order: [['porder', 'ASC']],
  31. });
  32. }
  33. async _completeInsertPosData(tid, cid, data) {
  34. data.id = this.uuid.v4();
  35. data.tid = tid;
  36. // todo 新增期
  37. data.add_stage = 0;
  38. data.add_stage_order = 0;
  39. data.add_times = 0;
  40. data.in_time = new Date();
  41. data.add_user = this.ctx.session.sessionUser.accountId;
  42. data.ccid = cid;
  43. data.formc = 1;
  44. }
  45. async addPos(tid, cid, data) {
  46. if (data instanceof Array) {
  47. for (const d of data) {
  48. this._completeInsertPosData(tid, cid, d);
  49. }
  50. } else {
  51. this._completeInsertPosData(tid, cid, data);
  52. }
  53. const transaction = await this.db.beginTransaction();
  54. try {
  55. await this.ctx.service.changeAuditList.deleteDataByRevise(transaction, tid, [data.lid], 'gcl_id', '');
  56. await transaction.insert(this.tableName, data);
  57. await transaction.commit();
  58. const returnData = { pos: data };
  59. const bills = await this.ctx.service.ledger.getDataById(data.lid);
  60. if (bills) {
  61. bills.cid = 1;
  62. returnData.ledger = {
  63. update: [bills],
  64. };
  65. }
  66. return returnData;
  67. } catch (err) {
  68. await transaction.rollback();
  69. throw err;
  70. }
  71. }
  72. async updatePos(tid, data) {
  73. if (data.sgfh_qty !== undefined || data.sjcl_qty !== undefined || data.qtcl_qty !== undefined || data.ex_qty1 !== undefined) {
  74. const op = await this.getDataById(data.id);
  75. let bills = await this.ctx.service.changeLedger.getDataById(op.lid);
  76. let newBills = false;
  77. let billsPos = await this.getAllDataByCondition({ where: { tid: tid, lid: op.lid } });
  78. if (bills) {
  79. newBills = true;
  80. } else {
  81. bills = await this.ctx.service.ledger.getDataById(op.lid);
  82. const posData = await this.ctx.service.pos.getAllDataByCondition({ where: { tid: tid, lid: op.lid } });
  83. billsPos = this._.concat(posData, billsPos);
  84. }
  85. const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, bills.unit);
  86. if (data.sgfh_qty !== undefined) {
  87. data.sgfh_qty = this.round(data.sgfh_qty, precision.value);
  88. } else if (op) {
  89. data.sgfh_qty = op.sgfh_qty;
  90. }
  91. if (data.sjcl_qty !== undefined) {
  92. data.sjcl_qty = this.round(data.sjcl_qty, precision.value);
  93. } else if (op) {
  94. data.sjcl_qty = op.sjcl_qty;
  95. }
  96. if (data.qtcl_qty !== undefined) {
  97. data.qtcl_qty = this.round(data.qtcl_qty, precision.value);
  98. } else if (op) {
  99. data.qtcl_qty = op.qtcl_qty;
  100. }
  101. data.quantity = this.ctx.helper.sum([data.sgfh_qty, data.qtcl_qty, data.sjcl_qty]);
  102. if (data.ex_qty1 !== undefined) {
  103. data.ex_qty1 = this.round(data.ex_qty1, precision.value);
  104. } else if (op) {
  105. data.ex_qty1 = op.ex_qty1;
  106. }
  107. const updateBills = { id: bills.id };
  108. for (const bp of billsPos) {
  109. const calcData = bp.id === data.id ? data : bp;
  110. updateBills.sgfh_qty = this.ctx.helper.add(updateBills.sgfh_qty, calcData.sgfh_qty);
  111. updateBills.sjcl_qty = this.ctx.helper.add(updateBills.sjcl_qty, calcData.sjcl_qty);
  112. updateBills.qtcl_qty = this.ctx.helper.add(updateBills.qtcl_qty, calcData.qtcl_qty);
  113. updateBills.quantity = this.ctx.helper.add(updateBills.quantity, calcData.quantity);
  114. updateBills.ex_qty1 = this.ctx.helper.add(updateBills.ex_qty1, calcData.ex_qty1);
  115. }
  116. const info = this.ctx.tender.info;
  117. updateBills.sgfh_tp = this.ctx.helper.mul(updateBills.sgfh_qty, bills.unit_price, info.decimal.tp);
  118. updateBills.sjcl_tp = this.ctx.helper.mul(updateBills.sjcl_qty, bills.unit_price, info.decimal.tp);
  119. updateBills.qtcl_tp = this.ctx.helper.mul(updateBills.qtcl_qty, bills.unit_price, info.decimal.tp);
  120. updateBills.total_price = this.ctx.helper.mul(updateBills.quantity, bills.unit_price, info.decimal.tp);
  121. updateBills.ex_tp1 = this.ctx.helper.mul(updateBills.ex_qty1, bills.unit_price, info.decimal.tp);
  122. const transaction = await this.db.beginTransaction();
  123. try {
  124. await transaction.update(this.tableName, data);
  125. if (newBills) await transaction.update(this.ctx.service.changeLedger.tableName, updateBills);
  126. await this.ctx.service.changeAuditList.updateDataByRevisePos(transaction, tid, [data]);
  127. await transaction.commit();
  128. updateBills.ledger_id = bills.ledger_id;
  129. return {
  130. ledger: { update: [updateBills] },
  131. pos: data,
  132. };
  133. } catch (err) {
  134. await transaction.rollback();
  135. throw err;
  136. }
  137. } else {
  138. const transaction = await this.db.beginTransaction();
  139. try {
  140. await transaction.update(this.tableName, data, { tid, id: data.id });
  141. await this.ctx.service.changeAuditList.updateDataByRevisePos(transaction, tid, [data]);
  142. await transaction.commit();
  143. return { pos: data };
  144. } catch (err) {
  145. await transaction.rollback();
  146. throw err;
  147. }
  148. }
  149. }
  150. async updatePosArr(tid, data) {
  151. console.log(data);
  152. if (data.length === 0) return;
  153. const op = await this.getDataById(data[0].id) || await this.ctx.service.pos.getDataById(data[0].id);
  154. let bills = await this.ctx.service.changeLedger.getDataById(op.lid);
  155. let newBills = false;
  156. let billsPos = await this.getAllDataByCondition({ where: { tid: tid, lid: op.lid } });
  157. if (bills) {
  158. newBills = true;
  159. } else {
  160. bills = await this.ctx.service.ledger.getDataById(op.lid);
  161. const posData = await this.ctx.service.pos.getAllDataByCondition({ where: { tid: tid, lid: op.lid } });
  162. billsPos = this._.concat(posData, billsPos);
  163. }
  164. const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, bills.unit);
  165. let needUpdateBills;
  166. for (const d of data) {
  167. if (d.sgfh_qty !== undefined || d.sjcl_qty !== undefined || d.qtcl_qty !== undefined || d.ex_qty1 !== undefined) {
  168. if (d.sgfh_qty !== undefined) {
  169. d.sgfh_qty = this.round(d.sgfh_qty, precision.value);
  170. } else if (op) {
  171. d.sgfh_qty = op.sgfh_qty;
  172. }
  173. if (d.sjcl_qty !== undefined) {
  174. d.sjcl_qty = this.round(d.sjcl_qty, precision.value);
  175. } else if (op) {
  176. d.sjcl_qty = op.sjcl_qty;
  177. }
  178. if (d.qtcl_qty !== undefined) {
  179. d.qtcl_qty = this.round(d.qtcl_qty, precision.value);
  180. } else if (op) {
  181. d.qtcl_qty = op.qtcl_qty;
  182. }
  183. d.quantity = this.ctx.helper.sum([d.sgfh_qty, d.qtcl_qty, d.sjcl_qty]);
  184. if (d.ex_qty1 !== undefined) {
  185. d.ex_qty1 = this.round(d.ex_qty1, precision.value);
  186. } else if (op) {
  187. d.ex_qty1 = op.ex_qty1;
  188. }
  189. needUpdateBills = true;
  190. }
  191. }
  192. const updateBills = { id: bills.id };
  193. if (needUpdateBills) {
  194. for (const bp of billsPos) {
  195. const newPos = data.find(function(x) { return x.id === bp.id; });
  196. updateBills.sgfh_qty = newPos && newPos.sgfh_qty !== undefined
  197. ? this.ctx.helper.add(updateBills.sgfh_qty, newPos.sgfh_qty)
  198. : this.ctx.helper.add(updateBills.sgfh_qty, bp.sgfh_qty);
  199. updateBills.sjcl_qty = newPos && newPos.sjcl_qty !== undefined
  200. ? this.ctx.helper.add(updateBills.sjcl_qty, newPos.sjcl_qty)
  201. : this.ctx.helper.add(updateBills.sjcl_qty, bp.sjcl_qty);
  202. updateBills.qtcl_qty = newPos && newPos.qtcl_qty !== undefined
  203. ? this.ctx.helper.add(updateBills.qtcl_qty, newPos.qtcl_qty)
  204. : this.ctx.helper.add(updateBills.qtcl_qty, bp.qtcl_qty);
  205. updateBills.quantity = newPos && newPos.quantity !== undefined
  206. ? this.ctx.helper.add(updateBills.quantity, newPos.quantity)
  207. : this.ctx.helper.add(updateBills.quantity, bp.quantity);
  208. updateBills.ex_qty1 = newPos && newPos.ex_qty1 !== undefined
  209. ? this.ctx.helper.add(updateBills.ex_qty1, newPos.ex_qty1)
  210. : this.ctx.helper.add(updateBills.ex_qty1, bp.ex_qty1);
  211. }
  212. const info = this.ctx.tender.info;
  213. updateBills.sgfh_tp = this.ctx.helper.mul(updateBills.sgfh_qty, bills.unit_price, info.decimal.tp);
  214. updateBills.sjcl_tp = this.ctx.helper.mul(updateBills.sjcl_qty, bills.unit_price, info.decimal.tp);
  215. updateBills.qtcl_tp = this.ctx.helper.mul(updateBills.qtcl_qty, bills.unit_price, info.decimal.tp);
  216. updateBills.total_price = this.ctx.helper.mul(updateBills.quantity, bills.unit_price, info.decimal.tp);
  217. updateBills.ex_tp1 = this.ctx.helper.mul(updateBills.ex_qty1, bills.unit_price, info.decimal.tp);
  218. }
  219. const transaction = await this.db.beginTransaction();
  220. try {
  221. for (const d of data) {
  222. // 区分d属于pos还是changePos,分别更新对应的表
  223. const np = await this.getDataById(d.id);
  224. np ? await transaction.update(this.tableName, d) : await transaction.update(this.ctx.service.pos.tableName, d);
  225. }
  226. if (needUpdateBills && newBills) await transaction.update(this.ctx.service.changeLedger.tableName, updateBills);
  227. await this.ctx.service.changeAuditList.updateDataByRevisePos(transaction, tid, data);
  228. await transaction.commit();
  229. updateBills.ledger_id = bills.ledger_id;
  230. return {
  231. ledger: { update: needUpdateBills ? [updateBills] : [] },
  232. pos: data,
  233. };
  234. } catch (err) {
  235. await transaction.rollback();
  236. throw err;
  237. }
  238. }
  239. async deletePos(tid, data) {
  240. if (!data || data.length === 0) {
  241. throw '提交数据错误';
  242. }
  243. const pos = await this.getPosData({tid: tid, id: data});
  244. let bills = await this.ctx.service.changeLedger.getDataById(pos[0].lid);
  245. let newBills = false;
  246. let billsPos = await this.getAllDataByCondition({ where: { tid: tid, lid: pos[0].lid } });
  247. let cid = 1;
  248. if (bills) {
  249. newBills = true;
  250. } else {
  251. bills = await this.ctx.service.ledger.getDataById(pos[0].lid);
  252. const posData = await this.ctx.service.pos.getAllDataByCondition({ where: { tid: tid, lid: pos[0].lid } });
  253. if (billsPos.length === data.length) {
  254. cid = null;
  255. }
  256. billsPos = this._.concat(posData, billsPos);
  257. }
  258. // const bills = await this.ctx.service.reviseBills.getDataById(pos[0].lid);
  259. // const billsPos = await this.getAllDataByCondition({ where: {tid: tid, lid: bills.id} });
  260. const updateBills = {id: bills.id, sgfh_qty: 0, sjcl_qty: 0, qtcl_qty: 0, quantity: 0, ex_qty1: 0};
  261. for (const bp of billsPos) {
  262. if (data.indexOf(bp.id) >= 0) continue;
  263. updateBills.sgfh_qty = this.ctx.helper.add(updateBills.sgfh_qty, bp.sgfh_qty);
  264. updateBills.sjcl_qty = this.ctx.helper.add(updateBills.sjcl_qty, bp.sjcl_qty);
  265. updateBills.qtcl_qty = this.ctx.helper.add(updateBills.qtcl_qty, bp.qtcl_qty);
  266. updateBills.quantity = this.ctx.helper.add(updateBills.quantity, bp.quantity);
  267. updateBills.ex_qty1 = this.ctx.helper.add(updateBills.ex_qty1, bp.ex_qty1);
  268. }
  269. const info = this.ctx.tender.info;
  270. updateBills.sgfh_tp = this.ctx.helper.mul(updateBills.sgfh_qty, bills.unit_price, info.decimal.tp);
  271. updateBills.sjcl_tp = this.ctx.helper.mul(updateBills.sjcl_qty, bills.unit_price, info.decimal.tp);
  272. updateBills.qtcl_tp = this.ctx.helper.mul(updateBills.qtcl_qty, bills.unit_price, info.decimal.tp);
  273. updateBills.total_price = this.ctx.helper.mul(updateBills.quantity, bills.unit_price, info.decimal.tp);
  274. updateBills.ex_tp1 = this.ctx.helper.mul(updateBills.ex_qty1, bills.unit_price, info.decimal.tp);
  275. const transaction = await this.db.beginTransaction();
  276. try {
  277. await transaction.delete(this.tableName, {tid: tid, id: data});
  278. if (newBills) await transaction.update(this.ctx.service.changeLedger.tableName, updateBills);
  279. await this.ctx.service.changeAuditList.deleteDataByRevise(transaction, tid, data, 'mx_id');
  280. await transaction.commit();
  281. updateBills.ledger_id = bills.ledger_id;
  282. updateBills.cid = cid;
  283. return {
  284. ledger: { update: [updateBills] },
  285. pos: data,
  286. };
  287. } catch (err) {
  288. await transaction.rollback();
  289. throw err;
  290. }
  291. }
  292. async deleteBySettle(transaction, tid, posDatas) {
  293. if (!posDatas || posDatas.length === 0) {
  294. return;
  295. }
  296. await transaction.delete(this.tableName, { id: this._.map(posDatas, 'id') });
  297. await this.ctx.service.changeAuditList.deleteDataByRevise(transaction, tid, this._.map(posDatas, 'id'), 'mx_id');
  298. }
  299. /**
  300. * 复制粘贴 部位明细数据
  301. * @param {Array} data - 复制粘贴的数据
  302. * @param {Number} tid - 标段id
  303. * @returns {Promise<{ledger: {}, pos: null}>}
  304. */
  305. async pastePosData(tid, cid, data) {
  306. if (!(data instanceof Array)) throw '提交数据错误';
  307. const transaction = await this.db.beginTransaction();
  308. const result = { ledger: {}, pos: null };
  309. const orgPos = await this.getPosData({ tid: tid, id: this._.map(data, 'id') });
  310. // const bills = await this.ctx.service.reviseBills.getDataById(data[0].lid);
  311. // const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, bills.unit);
  312. // const updateBills = {id: bills.id};
  313. // const billsPos = await this.getAllDataByCondition({where: {tid: tid, lid: bills.id} });
  314. let bills = await this.ctx.service.changeLedger.getDataById(data[0].lid);
  315. let newBills = false;
  316. let billsPos = await this.getAllDataByCondition({ where: { tid: tid, lid: data[0].lid } });
  317. if (bills) {
  318. newBills = true;
  319. } else {
  320. bills = await this.ctx.service.ledger.getDataById(data[0].lid);
  321. const posData = await this.ctx.service.pos.getAllDataByCondition({ where: { tid: tid, lid: data[0].lid } });
  322. billsPos = this._.concat(posData, billsPos);
  323. }
  324. const updateBills = { id: bills.id };
  325. const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, bills.unit);
  326. let needUpdateBills;
  327. for (const bp of billsPos) {
  328. const d = data.find(function(x) {
  329. return bp.id ? x.id === bp.id : false;
  330. });
  331. if (d) continue;
  332. updateBills.sgfh_qty = this.ctx.helper.add(updateBills.sgfh_qty, bp.sgfh_qty);
  333. updateBills.sjcl_qty = this.ctx.helper.add(updateBills.sjcl_qty, bp.sjcl_qty);
  334. updateBills.qtcl_qty = this.ctx.helper.add(updateBills.qtcl_qty, bp.qtcl_qty);
  335. updateBills.quantity = this.ctx.helper.add(updateBills.quantity, bp.quantity);
  336. updateBills.ex_qty1 = this.ctx.helper.add(updateBills.ex_qty1, bp.ex_qty1);
  337. }
  338. try {
  339. for (const d of data) {
  340. const op = d.id ? this._.find(orgPos, { id: d.id }) : null;
  341. if (d.sgfh_qty !== undefined || d.sjcl_qty !== undefined || d.qtcl_qty !== undefined || d.ex_qty1 !== undefined) {
  342. if (d.sgfh_qty !== undefined) {
  343. d.sgfh_qty = this.round(d.sgfh_qty, precision.value);
  344. } else if (op) {
  345. d.sgfh_qty = op.sgfh_qty;
  346. }
  347. updateBills.sgfh_qty = this.ctx.helper.add(updateBills.sgfh_qty, d.sgfh_qty);
  348. if (d.sjcl_qty !== undefined) {
  349. d.sjcl_qty = this.round(d.sjcl_qty, precision.value);
  350. } else if (op) {
  351. d.sjcl_qty = op.sjcl_qty;
  352. }
  353. updateBills.sjcl_qty = this.ctx.helper.add(updateBills.sjcl_qty, d.sjcl_qty);
  354. if (d.qtcl_qty) {
  355. d.qtcl_qty = this.round(d.qtcl_qty, precision.value);
  356. } else if (op) {
  357. d.qtcl_qty = op.qtcl_qty;
  358. }
  359. updateBills.qtcl_qty = this.ctx.helper.add(updateBills.qtcl_qty, d.qtcl_qty);
  360. d.quantity = this.ctx.helper.sum([d.sgfh_qty, d.qtcl_qty, d.sjcl_qty]);
  361. updateBills.quantity = this.ctx.helper.add(updateBills.quantity, d.quantity);
  362. if (d.ex_qty1) {
  363. d.ex_qty1 = this.round(d.ex_qty1, precision.value);
  364. } else if (op) {
  365. d.ex_qty1 = op.ex_qty1;
  366. }
  367. updateBills.ex_qty1 = this.ctx.helper.add(updateBills.ex_qty1, d.ex_qty1);
  368. needUpdateBills = true;
  369. }
  370. if (d.id) {
  371. await transaction.update(this.tableName, d);
  372. } else {
  373. updateBills.cid = 1;
  374. await this._insertPosData(transaction, d, tid, cid);
  375. }
  376. }
  377. const info = this.ctx.tender.info;
  378. if (needUpdateBills) {
  379. updateBills.sgfh_tp = this.ctx.helper.mul(updateBills.sgfh_qty, bills.unit_price, info.decimal.tp);
  380. updateBills.sjcl_tp = this.ctx.helper.mul(updateBills.sjcl_qty, bills.unit_price, info.decimal.tp);
  381. updateBills.qtcl_tp = this.ctx.helper.mul(updateBills.qtcl_qty, bills.unit_price, info.decimal.tp);
  382. updateBills.total_price = this.ctx.helper.mul(updateBills.quantity, bills.unit_price, info.decimal.tp);
  383. updateBills.ex_tp1 = this.ctx.helper.mul(updateBills.ex_qty1, bills.unit_price, info.decimal.tp);
  384. if (newBills) {
  385. const newUpdateBills = this._.cloneDeep(updateBills);
  386. delete newUpdateBills.cid;
  387. await transaction.update(this.ctx.service.changeLedger.tableName, newUpdateBills);
  388. }
  389. updateBills.ledger_id = bills.ledger_id;
  390. }
  391. if (newBills && updateBills.cid && updateBills.cid === 1) {
  392. await this.ctx.service.changeAuditList.deleteDataByRevise(transaction, tid, [bills.id], 'gcl_id', '');
  393. }
  394. await this.ctx.service.changeAuditList.updateDataByRevisePos(transaction, tid, data);
  395. await transaction.commit();
  396. } catch (err) {
  397. await transaction.rollback();
  398. throw err;
  399. }
  400. result.pos = data;
  401. result.ledger.update = needUpdateBills ? [updateBills] : updateBills.cid && updateBills.cid === 1 ? [{ id: bills.id, ledger_id: bills.ledger_id, cid: 1 }] : [];
  402. return result;
  403. }
  404. async _insertPosData(transaction, data, tid, cid) {
  405. data.id = this.uuid.v4();
  406. data.tid = tid;
  407. // todo 新增期
  408. data.add_stage = 0;
  409. data.add_stage_order = 0;
  410. data.add_times = 0;
  411. data.in_time = new Date();
  412. data.add_user = this.ctx.session.sessionUser.accountId;
  413. data.ccid = cid;
  414. data.formc = 1;
  415. if (data.quantity) {
  416. const bills = await this.ctx.service.changeLedger.getDataById(data.lid) || await this.ctx.service.ledger.getDataById(data.lid);
  417. const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, bills.unit);
  418. data.quantity = this.round(data.quantity, precision.value);
  419. }
  420. const addRst = await transaction.insert(this.tableName, data);
  421. }
  422. /**
  423. * 删除清单下部位明细数据(删除清单时调用)
  424. *
  425. * @param transaction - 事务
  426. * @param tid - 标段id
  427. * @param lid - 清单id
  428. * @returns {Promise<void>}
  429. */
  430. async deletePosData(transaction, tid, lid) {
  431. await transaction.delete(this.tableName, {tid: tid, lid: lid});
  432. }
  433. }
  434. return ChangePos;
  435. };