pos.js 23 KB

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