change_apply.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  1. 'use strict';
  2. /**
  3. *
  4. *
  5. * @author Mai
  6. * @date 2018/8/14
  7. * @version
  8. */
  9. const audit = require('../const/audit').changeApply;
  10. // const smsTypeConst = require('../const/sms_type');
  11. // const SMS = require('../lib/sms');
  12. // const SmsAliConst = require('../const/sms_alitemplate');
  13. const wxConst = require('../const/wechat_template');
  14. const pushType = require('../const/audit').pushType;
  15. const projectLogConst = require('../const/project_log');
  16. const codeRuleConst = require('../const/code_rule');
  17. const changeConst = require('../const/change');
  18. module.exports = app => {
  19. class ChangeApply extends app.BaseService {
  20. /**
  21. * 构造函数
  22. *
  23. * @param {Object} ctx - egg全局变量
  24. * @return {void}
  25. */
  26. constructor(ctx) {
  27. super(ctx);
  28. this.tableName = 'change_apply';
  29. }
  30. async add(tenderId, userId, code, project_code, name) {
  31. const sql = 'SELECT COUNT(*) as count FROM ?? WHERE `tid` = ? AND `code` = ?';
  32. const sqlParam = [this.tableName, tenderId, code];
  33. const codeCount = await this.db.queryOne(sql, sqlParam);
  34. const count = codeCount.count;
  35. if (count > 0) {
  36. throw '变更申请书编号重复';
  37. }
  38. // 初始化事务
  39. this.transaction = await this.db.beginTransaction();
  40. let result = false;
  41. try {
  42. const change = {
  43. tid: tenderId,
  44. uid: userId,
  45. status: audit.status.uncheck,
  46. times: 1,
  47. in_time: new Date(),
  48. code,
  49. project_code,
  50. name,
  51. quality: changeConst.quality.common.name,
  52. };
  53. if (project_code) {
  54. const projectInfo = await this.ctx.service.changeProject.getDataByCondition({ tid: tenderId, code: project_code });
  55. if (projectInfo) {
  56. change.org_name = projectInfo.org_name;
  57. change.peg = projectInfo.peg;
  58. change.new_code = projectInfo.new_code;
  59. change.class = projectInfo.class;
  60. change.quality = projectInfo.quality;
  61. change.reason = projectInfo.reason;
  62. change.content = projectInfo.content;
  63. change.org_price = projectInfo.org_price;
  64. change.change_price = projectInfo.change_price;
  65. change.crease_price = projectInfo.crease_price;
  66. }
  67. }
  68. const operate = await this.transaction.insert(this.tableName, change);
  69. if (operate.affectedRows <= 0) {
  70. throw '新建变更令数据失败';
  71. }
  72. change.id = operate.insertId;
  73. // 先找出标段最近存在的变更令审批人的变更令info
  74. const preChangeInfo = await this.getHaveAuditLastInfo(tenderId);
  75. if (preChangeInfo) {
  76. // 并把之前存在的变更令审批人添加到zh_change_audit
  77. const auditResult = await this.ctx.service.changeApplyAudit.copyPreChangeApplyAuditors(this.transaction, preChangeInfo, change);
  78. if (!auditResult) {
  79. throw '复制上一次审批流程失败';
  80. }
  81. }
  82. result = change;
  83. this.transaction.commit();
  84. } catch (error) {
  85. console.log(error);
  86. // 回滚
  87. await this.transaction.rollback();
  88. }
  89. return result;
  90. }
  91. async getHaveAuditLastInfo(tenderId) {
  92. const sql = 'SELECT a.* FROM ?? as a LEFT JOIN ?? as b ON a.`id` = b.`caid` WHERE a.`tid` = ? ORDER BY a.`in_time` DESC';
  93. const sqlParam = [this.tableName, this.ctx.service.changeApplyAudit.tableName, tenderId];
  94. return await this.db.queryOne(sql, sqlParam);
  95. }
  96. /**
  97. * 获取变更立项列表
  98. * @param {int} tenderId - 标段id
  99. * @param {int} status - 状态
  100. * @param {int} hadlimit - 分页
  101. * @return {object} list - 列表
  102. */
  103. async getListByStatus(tenderId, status = 0, hadlimit = 1, sortBy = '', orderBy = '') {
  104. let sql = '';
  105. let sqlParam = '';
  106. if (this.ctx.tender.isTourist && status === 0) {
  107. sql = 'SELECT a.*, p.name as account_name FROM ?? As a LEFT JOIN ?? AS p On a.notice_uid = p.id WHERE a.tid = ?';
  108. sqlParam = [this.tableName, this.ctx.service.projectAccount.tableName, tenderId];
  109. } else {
  110. switch (status) {
  111. case 0: // 包含你的所有变更立项
  112. sql =
  113. 'SELECT a.*, p.name as account_name FROM ?? AS a LEFT JOIN ?? AS p On a.notice_uid = p.id WHERE a.tid = ? AND ' +
  114. '(a.uid = ? OR (a.status != ? AND a.id IN (SELECT b.caid FROM ?? AS b WHERE b.aid = ? AND a.times = b.times GROUP BY b.caid)) OR a.status = ?)';
  115. sqlParam = [
  116. this.tableName,
  117. this.ctx.service.projectAccount.tableName,
  118. tenderId,
  119. this.ctx.session.sessionUser.accountId,
  120. audit.status.uncheck,
  121. this.ctx.service.changeApplyAudit.tableName,
  122. this.ctx.session.sessionUser.accountId,
  123. audit.status.checked,
  124. ];
  125. break;
  126. case 1: // 待处理(你的)
  127. sql = 'SELECT a.*, p.name as account_name FROM ?? as a LEFT JOIN ?? AS p On a.notice_uid = p.id WHERE a.tid = ? AND (a.id in(SELECT b.caid FROM ?? as b WHERE b.tid = ? AND b.aid = ? AND b.status = ?) OR (a.uid = ? AND (a.status = ? OR a.status = ? OR a.status = ?)))';
  128. sqlParam = [this.tableName, this.ctx.service.projectAccount.tableName, tenderId, this.ctx.service.changeApplyAudit.tableName, tenderId, this.ctx.session.sessionUser.accountId, audit.status.checking, this.ctx.session.sessionUser.accountId, audit.status.uncheck, audit.status.checkNo, audit.status.revise];
  129. break;
  130. case 5: // 待上报(所有的)PS:取未上报,退回,修订的变更令
  131. sql =
  132. 'SELECT a.*, p.name as account_name FROM ?? AS a LEFT JOIN ?? AS p On a.notice_uid = p.id WHERE ' +
  133. // 'a.id IN (SELECT b.caid FROM ?? AS b WHERE b.aid = ? AND a.times = b.times GROUP BY b.caid) AND ' +
  134. 'a.uid = ? AND a.tid = ? AND (a.status = ? OR a.status = ? OR a.status = ?)';
  135. sqlParam = [
  136. this.tableName,
  137. this.ctx.service.projectAccount.tableName,
  138. // this.ctx.service.changeApplyAudit.tableName,
  139. this.ctx.session.sessionUser.accountId,
  140. tenderId,
  141. audit.status.uncheck,
  142. audit.status.checkNo,
  143. audit.status.revise,
  144. ];
  145. break;
  146. case 2: // 进行中(所有的)
  147. case 4: // 终止(所有的)
  148. sql =
  149. 'SELECT a.*, p.name as account_name FROM ?? AS a LEFT JOIN ?? AS p On a.notice_uid = p.id WHERE ' +
  150. 'a.status = ? AND a.tid = ? AND (a.uid = ? OR a.id IN (SELECT b.caid FROM ?? AS b WHERE b.aid = ? AND a.times = b.times GROUP BY b.caid))';
  151. sqlParam = [this.tableName, this.ctx.service.projectAccount.tableName, status, tenderId, this.ctx.session.sessionUser.accountId, this.ctx.service.changeApplyAudit.tableName, this.ctx.session.sessionUser.accountId];
  152. break;
  153. case 3: // 已完成(所有的)
  154. sql = 'SELECT a.*, p.name as account_name FROM ?? AS a LEFT JOIN ?? AS p On a.notice_uid = p.id WHERE a.status = ? AND a.tid = ?';
  155. sqlParam = [this.tableName, this.ctx.service.projectAccount.tableName, status, tenderId];
  156. break;
  157. default:
  158. break;
  159. }
  160. }
  161. if (sortBy && orderBy) {
  162. if (sortBy === 'code') {
  163. sql += ' ORDER BY CHAR_LENGTH(a.code) ' + orderBy + ',convert(a.code using gbk) ' + orderBy;
  164. } else {
  165. sql += ' ORDER BY a.in_time ' + orderBy;
  166. }
  167. } else {
  168. sql += ' ORDER BY a.in_time DESC';
  169. }
  170. if (hadlimit) {
  171. const limit = this.ctx.pageSize ? this.ctx.pageSize : this.app.config.pageSize;
  172. const offset = limit * (this.ctx.page - 1);
  173. const limitString = offset >= 0 ? offset + ',' + limit : limit;
  174. sql += ' LIMIT ' + limitString;
  175. }
  176. const list = await this.db.query(sql, sqlParam);
  177. return list;
  178. }
  179. // 获取最后一个变更申请
  180. async getLastChange(tenderId) {
  181. const sql = 'select * from ?? where tid = ? order by in_time desc LIMIT 1';
  182. const sqlParam = [this.tableName, tenderId];
  183. const result = await this.db.queryOne(sql, sqlParam);
  184. return result;
  185. }
  186. /**
  187. * 获取变更令个数
  188. * @param {int} tenderId - 标段id
  189. * @param {int} status - 状态
  190. * @return {void}
  191. */
  192. async getCountByStatus(tenderId, status) {
  193. if (this.ctx.tender.isTourist && status === 0) {
  194. const sql5 = 'SELECT count(*) AS count FROM ?? WHERE tid = ? ORDER BY in_time DESC';
  195. const sqlParam5 = [this.tableName, tenderId];
  196. const result5 = await this.db.query(sql5, sqlParam5);
  197. return result5[0].count;
  198. }
  199. switch (status) {
  200. case 0: // 包含你的所有变更令
  201. const sql =
  202. 'SELECT count(*) AS count FROM ?? AS a WHERE a.tid = ? AND ' +
  203. '(a.uid = ? OR (a.status != ? AND a.id IN (SELECT b.caid FROM ?? AS b WHERE b.aid = ? AND a.times = b.times GROUP BY b.caid)) OR a.status = ?)';
  204. const sqlParam = [
  205. this.tableName,
  206. tenderId,
  207. this.ctx.session.sessionUser.accountId,
  208. audit.status.uncheck,
  209. this.ctx.service.changeApplyAudit.tableName,
  210. this.ctx.session.sessionUser.accountId,
  211. audit.status.checked,
  212. ];
  213. const result = await this.db.query(sql, sqlParam);
  214. return result[0].count;
  215. case 1: // 待处理(你的)
  216. // return await this.ctx.service.changeAudit.count({
  217. // tid: tenderId,
  218. // uid: this.ctx.session.sessionUser.accountId,
  219. // status: 2,
  220. // });
  221. const sql6 = 'SELECT count(*) AS count FROM ?? as a WHERE a.tid = ? AND (a.id in(SELECT b.caid FROM ?? as b WHERE b.tid = ? AND b.aid = ? AND b.status = ?) OR (a.uid = ? AND (a.status = ? OR a.status = ? OR a.status = ?)))';
  222. const sqlParam6 = [this.tableName, tenderId, this.ctx.service.changeApplyAudit.tableName, tenderId, this.ctx.session.sessionUser.accountId, audit.status.checking, this.ctx.session.sessionUser.accountId, audit.status.uncheck, audit.status.checkNo, audit.status.revise];
  223. const result6 = await this.db.query(sql6, sqlParam6);
  224. return result6[0].count;
  225. case 5: // 待上报(所有的)PS:取未上报,退回的变更立项
  226. const sql2 =
  227. 'SELECT count(*) AS count FROM ?? AS a WHERE ' +
  228. // 'a.id IN (SELECT b.caid FROM ?? AS b WHERE b.aid = ? AND a.times = b.times GROUP BY b.caid) ' +
  229. 'a.uid = ? AND a.tid = ? AND (a.status = ? OR a.status = ? OR a.status = ?)';
  230. const sqlParam2 = [
  231. this.tableName,
  232. // this.ctx.service.changeApplyAudit.tableName,
  233. this.ctx.session.sessionUser.accountId,
  234. tenderId,
  235. audit.status.uncheck,
  236. audit.status.checkNo,
  237. audit.status.revise,
  238. ];
  239. const result2 = await this.db.query(sql2, sqlParam2);
  240. return result2[0].count;
  241. case 2: // 进行中(所有的)
  242. case 4: // 终止(所有的)
  243. const sql3 =
  244. 'SELECT count(*) AS count FROM ?? AS a WHERE ' +
  245. 'a.status = ? AND a.tid = ? AND (a.uid = ? OR a.id IN (SELECT b.caid FROM ?? AS b WHERE b.aid = ? AND a.times = b.times GROUP BY b.caid))';
  246. const sqlParam3 = [this.tableName, status, tenderId, this.ctx.session.sessionUser.accountId, this.ctx.service.changeApplyAudit.tableName, this.ctx.session.sessionUser.accountId];
  247. const result3 = await this.db.query(sql3, sqlParam3);
  248. return result3[0].count;
  249. case 3: // 已完成(所有的)
  250. const sql4 = 'SELECT count(*) AS count FROM ?? WHERE status = ? AND tid = ?';
  251. const sqlParam4 = [this.tableName, status, tenderId];
  252. const result4 = await this.db.query(sql4, sqlParam4);
  253. return result4[0].count;
  254. default:
  255. break;
  256. }
  257. }
  258. /**
  259. * 获取变更方案金额
  260. * @param {int} tenderId - 标段id
  261. * @param {int} status - 状态
  262. * @return {void}
  263. */
  264. async getTp(tenderId, status) {
  265. if (this.ctx.tender.isTourist && status === 0) {
  266. const sql5 = 'SELECT SUM(cast (total_price as decimal(18,6))) AS total_price FROM ?? WHERE tid = ?';
  267. const sqlParam5 = [this.tableName, tenderId];
  268. const result5 = await this.db.query(sql5, sqlParam5);
  269. return result5[0].total_price ? result5[0].total_price : 0;
  270. }
  271. switch (status) {
  272. case 0: // 包含你的所有变更令
  273. const sql =
  274. 'SELECT SUM(cast (a.total_price as decimal(18,6))) AS total_price FROM ?? AS a WHERE a.tid = ? AND ' +
  275. '(a.uid = ? OR (a.status != ? AND a.id IN (SELECT b.caid FROM ?? AS b WHERE b.aid = ? AND a.times = b.times GROUP BY b.caid)) OR a.status = ?)';
  276. const sqlParam = [
  277. this.tableName,
  278. tenderId,
  279. this.ctx.session.sessionUser.accountId,
  280. audit.status.uncheck,
  281. this.ctx.service.changeApplyAudit.tableName,
  282. this.ctx.session.sessionUser.accountId,
  283. audit.status.checked,
  284. ];
  285. const result = await this.db.query(sql, sqlParam);
  286. return result[0].total_price ? result[0].total_price : 0;
  287. case 1: // 待处理(你的)
  288. // return await this.ctx.service.changeAudit.count({
  289. // tid: tenderId,
  290. // uid: this.ctx.session.sessionUser.accountId,
  291. // status: 2,
  292. // });
  293. const sql6 = 'SELECT SUM(cast (a.total_price as decimal(18,6))) AS total_price FROM ?? as a WHERE a.tid = ? AND (a.id in(SELECT b.caid FROM ?? as b WHERE b.tid = ? AND b.aid = ? AND b.status = ?) OR (a.uid = ? AND (a.status = ? OR a.status = ? OR a.status = ?)))';
  294. const sqlParam6 = [this.tableName, tenderId, this.ctx.service.changeApplyAudit.tableName, tenderId, this.ctx.session.sessionUser.accountId, audit.status.checking, this.ctx.session.sessionUser.accountId, audit.status.uncheck, audit.status.checkNo, audit.status.revise];
  295. const result6 = await this.db.query(sql6, sqlParam6);
  296. return result6[0].total_price ? result6[0].total_price : 0;
  297. case 5: // 待上报(所有的)PS:取未上报,退回的变更立项
  298. const sql2 =
  299. 'SELECT SUM(cast (a.total_price as decimal(18,6))) AS total_price FROM ?? AS a WHERE ' +
  300. // 'a.id IN (SELECT b.caid FROM ?? AS b WHERE b.aid = ? AND a.times = b.times GROUP BY b.caid) ' +
  301. 'a.uid = ? AND a.tid = ? AND (a.status = ? OR a.status = ? OR a.status = ?)';
  302. const sqlParam2 = [
  303. this.tableName,
  304. // this.ctx.service.changePlanAudit.tableName,
  305. this.ctx.session.sessionUser.accountId,
  306. tenderId,
  307. audit.status.uncheck,
  308. audit.status.checkNo,
  309. audit.status.revise,
  310. ];
  311. const result2 = await this.db.query(sql2, sqlParam2);
  312. return result2[0].total_price ? result2[0].total_price : 0;
  313. case 2: // 进行中(所有的)
  314. case 4: // 终止(所有的)
  315. const sql3 =
  316. 'SELECT SUM(cast (a.total_price as decimal(18,6))) AS total_price FROM ?? AS a WHERE ' +
  317. 'a.status = ? AND a.tid = ? AND (a.uid = ? OR a.id IN (SELECT b.caid FROM ?? AS b WHERE b.aid = ? AND a.times = b.times GROUP BY b.caid))';
  318. const sqlParam3 = [this.tableName, status, tenderId, this.ctx.session.sessionUser.accountId, this.ctx.service.changeApplyAudit.tableName, this.ctx.session.sessionUser.accountId];
  319. const result3 = await this.db.query(sql3, sqlParam3);
  320. return result3[0].total_price ? result3[0].total_price : 0;
  321. case 3: // 已完成(所有的)
  322. const sql4 = 'SELECT SUM(cast (total_price as decimal(18,6))) AS total_price FROM ?? WHERE status = ? AND tid = ?';
  323. const sqlParam4 = [this.tableName, status, tenderId];
  324. const result4 = await this.db.query(sql4, sqlParam4);
  325. return result4[0].total_price ? result4[0].total_price : 0;
  326. default:
  327. break;
  328. }
  329. }
  330. /**
  331. * 保存变更信息
  332. * @param {int} postData - 表单提交的数据
  333. * @param {int} tenderId - 标段id
  334. * @return {void}
  335. */
  336. async saveInfo(caId, postData) {
  337. // 初始化事务
  338. const transaction = await this.db.beginTransaction();
  339. let result = false;
  340. try {
  341. const updateData = {
  342. id: caId,
  343. };
  344. updateData[postData.name] = postData.val;
  345. await transaction.update(this.tableName, updateData);
  346. await transaction.commit();
  347. result = true;
  348. } catch (error) {
  349. await transaction.rollback();
  350. result = false;
  351. }
  352. return result;
  353. }
  354. /**
  355. * 判断是否有重名的变更立项
  356. * @param caid
  357. * @param code
  358. * @param tid
  359. * @return {Promise<void>}
  360. */
  361. async isRepeat(caId, code, tid) {
  362. const sql = 'SELECT COUNT(*) as count FROM ?? WHERE `code` = ? AND `id` != ? AND `tid` = ?';
  363. const sqlParam = [this.tableName, code, caId, tid];
  364. const result = await this.db.queryOne(sql, sqlParam);
  365. return result.count !== 0;
  366. }
  367. /**
  368. * 查询可用的变更令
  369. * @param { string } cid - 查询的清单
  370. * @return {Promise<*>} - 可用的变更令列表
  371. */
  372. async delete(id) {
  373. // 初始化事务
  374. this.transaction = await this.db.beginTransaction();
  375. let result = false;
  376. try {
  377. const changeInfo = await this.getDataById(id);
  378. // 先删除审批人列表
  379. await this.transaction.delete(this.ctx.service.changeApplyAudit.tableName, { caid: id });
  380. // 再删除附件和附件文件ni zuo
  381. const attList = await this.ctx.service.changeApplyAtt.getAllDataByCondition({ where: { caid: id } });
  382. await this.ctx.helper.delFiles(attList);
  383. await this.transaction.delete(this.ctx.service.changeApplyAtt.tableName, { caid: id });
  384. // 最后删除变更令
  385. await this.transaction.delete(this.tableName, { id });
  386. // 删除history
  387. await this.transaction.delete(this.ctx.service.changeApplyHistory.tableName, { caid: id });
  388. // 记录删除日志
  389. await this.ctx.service.projectLog.addProjectLog(this.transaction, projectLogConst.type.changeApply, projectLogConst.status.delete, changeInfo.code);
  390. await this.transaction.commit();
  391. result = true;
  392. } catch (e) {
  393. await this.transaction.rollback();
  394. result = false;
  395. }
  396. return result;
  397. }
  398. async doCheckChangeCanCancel(change) {
  399. // 获取当前审批人的上一个审批人,判断是否是当前登录人,并赋予撤回功能,(当审批人存在有审批过时,上一人不允许再撤回)
  400. const status = audit.status;
  401. const accountId = this.ctx.session.sessionUser.accountId;
  402. const auditors = change.auditors;
  403. change.cancancel = 0;
  404. if (change.status !== status.checked && change.status !== status.uncheck && change.status !== status.revise) {
  405. if (change.status !== status.checkNo) {
  406. // 找出当前操作人上一个审批人,包括审批完成的和退回上一个审批人的,同时当前操作人为第一人时,就是则为原报
  407. const onAuditor = this._.find(auditors, function(item) {
  408. return item.aid === change.curAuditor.aid && item.status === status.checking;
  409. });
  410. const preAudit = onAuditor.order !== 1 ? this._.find(auditors, { order: onAuditor.order - 1 }) : false;
  411. const preAid = preAudit ? (preAudit.status !== status.checkAgain ? preAudit.aid : false) : change.uid;// 已发起重审无法撤回
  412. if (onAuditor && onAuditor.aid === preAid && preAudit.status === status.checkCancel) {
  413. return;// 不可以多次撤回
  414. } else if (preAid === accountId && preAid !== change.uid) {
  415. if (preAudit.status === status.checked) {
  416. change.cancancel = 2;// 审批人撤回审批通过
  417. }
  418. // else if (preAudit.status === status.checkNoPre) {
  419. // change.cancancel = 3;// 审批人撤回审批退回上一人
  420. // }
  421. change.preAudit = preAudit;
  422. } else if (preAid === accountId && preAid === change.uid) {
  423. change.cancancel = 1;// 原报撤回
  424. }
  425. } else {
  426. const lastAuditors = await this.service.changeApplyAudit.getAuditors(change.id, change.times - 1);
  427. const onAuditor = this._.findLast(lastAuditors, { status: status.checkNo });
  428. if (onAuditor && onAuditor.aid === accountId) {
  429. change.cancancel = 4;// 审批人撤回退回原报
  430. }
  431. }
  432. }
  433. }
  434. async getListByArchives(tid, ids) {
  435. if (ids.length === 0) return [];
  436. const sql = 'SELECT c.* FROM ?? as c LEFT JOIN (SELECT caid, MAX(end_time) as end_time FROM ?? WHERE ' +
  437. 'tid = ? AND caid in (' + this.ctx.helper.getInArrStrSqlFilter(ids) + ') GROUP BY caid) as ca ON c.id = ca.caid WHERE' +
  438. ' c.tid = ? AND c.id in (' + this.ctx.helper.getInArrStrSqlFilter(ids) + ') AND c.status = ? ORDER BY ca.end_time DESC';
  439. const params = [this.tableName, this.ctx.service.changeApplyAudit.tableName, tid, tid, audit.status.checked];
  440. const list = await this.db.query(sql, params);
  441. return list;
  442. }
  443. }
  444. return ChangeApply;
  445. };