|
@@ -242,7 +242,7 @@ module.exports = app => {
|
|
|
tips: wxConst.tips.check,
|
|
|
begin_time: Date.parse(new Date()),
|
|
|
m_tp: this.ctx.helper.add(this.ctx.helper.round(materialInfo.m_tp, material_decimal.tp), this.ctx.helper.round(materialInfo.ex_tp, material_decimal.tp)),
|
|
|
- hs_m_tp: this.ctx.helper.add(this.ctx.helper.round(this.ctx.helper.mul(materialInfo.m_tp, 1+materialInfo.rate/100), material_decimal.tp), this.ctx.helper.round(this.ctx.helper.mul(materialInfo.ex_tp, 1+materialInfo.rate/100), material_decimal.tp)),
|
|
|
+ hs_m_tp: this.ctx.helper.add(this.ctx.helper.round(this.ctx.helper.mul(materialInfo.m_tp, 1+materialInfo.rate/100), material_decimal.tp), this.ctx.helper.round(this.ctx.helper.mul(materialInfo.ex_tp, 1+materialInfo.exponent_rate/100), material_decimal.tp)),
|
|
|
};
|
|
|
await this.ctx.helper.sendWechat(audit.aid, smsTypeConst.const.TC, smsTypeConst.judge.approval.toString(), wxConst.template.material, wechatData);
|
|
|
|
|
@@ -325,7 +325,7 @@ module.exports = app => {
|
|
|
tips: wxConst.tips.check,
|
|
|
begin_time: Date.parse(begin_audit.begin_time),
|
|
|
m_tp: this.ctx.helper.add(this.ctx.helper.round(materialInfo.m_tp, material_decimal.tp), this.ctx.helper.round(materialInfo.ex_tp, material_decimal.tp)),
|
|
|
- hs_m_tp: this.ctx.helper.add(this.ctx.helper.round(this.ctx.helper.mul(materialInfo.m_tp, 1+materialInfo.rate/100), material_decimal.tp), this.ctx.helper.round(this.ctx.helper.mul(materialInfo.ex_tp, 1+materialInfo.rate/100), material_decimal.tp)),
|
|
|
+ hs_m_tp: this.ctx.helper.add(this.ctx.helper.round(this.ctx.helper.mul(materialInfo.m_tp, 1+materialInfo.rate/100), material_decimal.tp), this.ctx.helper.round(this.ctx.helper.mul(materialInfo.ex_tp, 1+materialInfo.exponent_rate/100), material_decimal.tp)),
|
|
|
};
|
|
|
await this.ctx.helper.sendWechat(nextAudit.aid, smsTypeConst.const.TC, smsTypeConst.judge.approval.toString(), wxConst.template.material, wechatData);
|
|
|
|
|
@@ -417,7 +417,7 @@ module.exports = app => {
|
|
|
tips: wxConst.tips.success,
|
|
|
begin_time: Date.parse(begin_audit.begin_time),
|
|
|
m_tp: this.ctx.helper.add(this.ctx.helper.round(materialInfo.m_tp, material_decimal.tp), this.ctx.helper.round(materialInfo.ex_tp, material_decimal.tp)),
|
|
|
- hs_m_tp: this.ctx.helper.add(this.ctx.helper.round(this.ctx.helper.mul(materialInfo.m_tp, 1+materialInfo.rate/100), material_decimal.tp), this.ctx.helper.round(this.ctx.helper.mul(materialInfo.ex_tp, 1+materialInfo.rate/100), material_decimal.tp)),
|
|
|
+ hs_m_tp: this.ctx.helper.add(this.ctx.helper.round(this.ctx.helper.mul(materialInfo.m_tp, 1+materialInfo.rate/100), material_decimal.tp), this.ctx.helper.round(this.ctx.helper.mul(materialInfo.ex_tp, 1+materialInfo.exponent_rate/100), material_decimal.tp)),
|
|
|
};
|
|
|
await this.ctx.helper.sendWechat(users, smsTypeConst.const.TC, smsTypeConst.judge.result.toString(), wxConst.template.material, wechatData);
|
|
|
|
|
@@ -515,7 +515,7 @@ module.exports = app => {
|
|
|
tips: wxConst.tips.back,
|
|
|
begin_time: Date.parse(begin_audit.begin_time),
|
|
|
m_tp: this.ctx.helper.add(this.ctx.helper.round(materialInfo.m_tp, material_decimal.tp), this.ctx.helper.round(materialInfo.ex_tp, material_decimal.tp)),
|
|
|
- hs_m_tp: this.ctx.helper.add(this.ctx.helper.round(this.ctx.helper.mul(materialInfo.m_tp, 1+materialInfo.rate/100), material_decimal.tp), this.ctx.helper.round(this.ctx.helper.mul(materialInfo.ex_tp, 1+materialInfo.rate/100), material_decimal.tp)),
|
|
|
+ hs_m_tp: this.ctx.helper.add(this.ctx.helper.round(this.ctx.helper.mul(materialInfo.m_tp, 1+materialInfo.rate/100), material_decimal.tp), this.ctx.helper.round(this.ctx.helper.mul(materialInfo.ex_tp, 1+materialInfo.exponent_rate/100), material_decimal.tp)),
|
|
|
};
|
|
|
await this.ctx.helper.sendWechat(users, smsTypeConst.const.TC, smsTypeConst.judge.result.toString(), wxConst.template.material, wechatData);
|
|
|
|
|
@@ -613,7 +613,7 @@ module.exports = app => {
|
|
|
tips: wxConst.tips.check,
|
|
|
begin_time: Date.parse(begin_audit.begin_time),
|
|
|
m_tp: this.ctx.helper.add(this.ctx.helper.round(materialInfo.m_tp, material_decimal.tp), this.ctx.helper.round(materialInfo.ex_tp, material_decimal.tp)),
|
|
|
- hs_m_tp: this.ctx.helper.add(this.ctx.helper.round(this.ctx.helper.mul(materialInfo.m_tp, 1+materialInfo.rate/100), material_decimal.tp), this.ctx.helper.round(this.ctx.helper.mul(materialInfo.ex_tp, 1+materialInfo.rate/100), material_decimal.tp)),
|
|
|
+ hs_m_tp: this.ctx.helper.add(this.ctx.helper.round(this.ctx.helper.mul(materialInfo.m_tp, 1+materialInfo.rate/100), material_decimal.tp), this.ctx.helper.round(this.ctx.helper.mul(materialInfo.ex_tp, 1+materialInfo.exponent_rate/100), material_decimal.tp)),
|
|
|
};
|
|
|
await this.ctx.helper.sendWechat(preAuditor.aid, smsTypeConst.const.TC, smsTypeConst.judge.approval.toString(), wxConst.template.material, wechatData);
|
|
|
|
|
@@ -682,7 +682,7 @@ module.exports = app => {
|
|
|
const time = new Date();
|
|
|
// 整理当前流程审核人状态更新
|
|
|
const audit = (await this.getAllDataByCondition({ where: { mid: materialId, times }, orders: [['order', 'desc']], limit: 1, offset: 0 }))[0];
|
|
|
- if (!audit || audit.order <= 1) {
|
|
|
+ if (!audit || audit.order < 1) {
|
|
|
throw '审核数据错误';
|
|
|
}
|
|
|
const transaction = await this.db.beginTransaction();
|
|
@@ -713,19 +713,18 @@ module.exports = app => {
|
|
|
id: materialId, status: auditConst.status.checking,
|
|
|
});
|
|
|
|
|
|
- // // 添加短信通知-需要审批提醒功能
|
|
|
- // const smsUser = await this.ctx.service.projectAccount.getDataById(audit.aid);
|
|
|
- // if (smsUser.auth_mobile !== undefined && smsUser.sms_type !== '') {
|
|
|
- // const smsType = JSON.parse(smsUser.sms_type);
|
|
|
- // if (smsType[smsTypeConst.const.JL] !== undefined && smsType[smsTypeConst.const.JL].indexOf(smsTypeConst.judge.approval.toString()) !== -1) {
|
|
|
- // const tenderInfo = await this.ctx.service.tender.getDataById(audit.tid);
|
|
|
- // const stageInfo = await this.ctx.service.stage.getDataById(audit.sid);
|
|
|
- // const sms = new SMS(this.ctx);
|
|
|
- // const tenderName = await sms.contentChange(tenderInfo.name);
|
|
|
- // const content = '【纵横计量支付】' + tenderName + '第' + stageInfo.order + '期,需要您审批。';
|
|
|
- // sms.send(smsUser.auth_mobile, content);
|
|
|
- // }
|
|
|
- // }
|
|
|
+ const materialInfo = await this.ctx.service.material.getDataById(materialId);
|
|
|
+ const material_decimal = materialInfo && materialInfo.decimal ? JSON.parse(materialInfo.decimal) : materialConst.decimal;
|
|
|
+ // 微信模板通知
|
|
|
+ const wechatData = {
|
|
|
+ qi: materialInfo.order,
|
|
|
+ status: wxConst.status.check,
|
|
|
+ tips: wxConst.tips.check,
|
|
|
+ begin_time: Date.parse(new Date()),
|
|
|
+ m_tp: this.ctx.helper.add(this.ctx.helper.round(materialInfo.m_tp, material_decimal.tp), this.ctx.helper.round(materialInfo.ex_tp, material_decimal.tp)),
|
|
|
+ hs_m_tp: this.ctx.helper.add(this.ctx.helper.round(this.ctx.helper.mul(materialInfo.m_tp, 1+materialInfo.rate/100), material_decimal.tp), this.ctx.helper.round(this.ctx.helper.mul(materialInfo.ex_tp, 1+materialInfo.exponent_rate/100), material_decimal.tp)),
|
|
|
+ };
|
|
|
+ await this.ctx.helper.sendWechat(audit.aid, smsTypeConst.const.TC, smsTypeConst.judge.approval.toString(), wxConst.template.material, wechatData);
|
|
|
await transaction.commit();
|
|
|
} catch (err) {
|
|
|
await transaction.rollback();
|