Commit f2d91310 by 王栋源

Merge branch 'center-order' of gitlab.gongsibao.com:jiangyong/zhichan into center-order

parents 363efa33 288118de
var APIBase = require("../../api.base");
var system = require("../../../system");
var settings = require("../../../../config/settings");
class IcpAPI extends APIBase {
constructor() {
super();
// this.utilsProductSve = system.getObject("service.utilsSve.utilsProductSve");
this.needsolutionSve = system.getObject("service.dbneed.needsolutionSve");
this.needinfoSve = system.getObject("service.dbneed.needinfoSve");
this.orderinfoSve = system.getObject("service.dbcorder.orderinfoSve");
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
if (pobj.actionType == 'getPolicyNeedList' || pobj.actionType == 'submitPolicyNeedNotes') {
if (!pobj.userInfo) {
return system.getResult(system.noLogin, "user no login!");
}
if (!pobj.appInfo) {
return system.getResult(system.noLogin, "app is null!");
}
}
var result = await this.opActionProcess(pobj, pobj.actionType, req);
return result;
}
async opActionProcess(pobj, action_type, req) {
var opResult = null;
switch (action_type) {
case "submitIcpProgramme"://icp方案提交
opResult = await this.needsolutionSve.submitIcpProgramme(pobj);
break;
case "submitIcpMaterial"://icp材料提交
opResult = await this.needsolutionSve.submitIcpMaterial(pobj);
break;
case "acceptIcpPartnerNotification"://icp通知状态变更
opResult = await this.needsolutionSve.acceptIcpPartnerNotification(pobj);
break;
case "abolishIcpProgramme"://服务商icp方案关闭
opResult = await this.needsolutionSve.abolishIcpProgramme(pobj);
break;
case "getIcpProgrammeDetail"://获取icp方案
opResult = await this.needsolutionSve.getIcpProgrammeDetail(pobj);
break;
// case "updateStausByRefundOrder"://修改退款方案状态
// opResult = await this.needsolutionSve.updateStausByRefundOrder(pobj);
// break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
}
return opResult;
}
}
module.exports = IcpAPI;
\ No newline at end of file
...@@ -60,6 +60,9 @@ class OrderAPI extends APIBase { ...@@ -60,6 +60,9 @@ class OrderAPI extends APIBase {
opResult = await this.orderinfoSve.putReceiptVoucherInfo(pobj, pobj.actionBody); opResult = await this.orderinfoSve.putReceiptVoucherInfo(pobj, pobj.actionBody);
break; break;
//--------------------------------支付相关接口------------结束 //--------------------------------支付相关接口------------结束
case "tmConfirm"://商标方案确认
opResult = await this.orderinfoSve.tmConfirm(pobj);
break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
......
...@@ -6,9 +6,18 @@ class InternalCallsNotify extends APIBase { ...@@ -6,9 +6,18 @@ class InternalCallsNotify extends APIBase {
constructor() { constructor() {
super(); super();
this.orderinfoSve = system.getObject("service.dbcorder.orderinfoSve"); this.orderinfoSve = system.getObject("service.dbcorder.orderinfoSve");
this.internalCallsNotifySve = system.getObject("service.dbcorder.internalCallsNotifySve");
} }
async updateTmStatus(pobj, qobj, req) { async updateTmStatus(pobj, qobj, req) {
return await this.orderinfoSve.updateTmStatus(pobj); return await this.orderinfoSve.updateTmStatus(pobj);
} }
//接收辅助、担保商标注册信息
async nbtzreceiveAssistTmData(pobj, qobj, req) {
return await this.internalCallsNotifySve.receiveAssistTmData(pobj);
}
//接收辅助、担保商标注册修改信息
async nbtzreceiveEditAssistTmData(pobj, qobj, req) {
return await this.internalCallsNotifySve.receiveEditAssistTmData(pobj);
}
} }
module.exports = InternalCallsNotify; module.exports = InternalCallsNotify;
\ No newline at end of file
...@@ -11,5 +11,9 @@ class OpPayOrder extends APIBase { ...@@ -11,5 +11,9 @@ class OpPayOrder extends APIBase {
var result = await this.orderinfoSve.opOrderPayCallBackTl(pobj, pobj.appInfo); var result = await this.orderinfoSve.opOrderPayCallBackTl(pobj, pobj.appInfo);
return result; return result;
} }
async receivePayCallBackNotifyByAliDing(pobj, qobj, req) {
var result = await this.orderinfoSve.opOrderPayCallBackAliDing(pobj, pobj.appInfo);
return result;
}
} }
module.exports = OpPayOrder; module.exports = OpPayOrder;
\ No newline at end of file
...@@ -22,7 +22,8 @@ class OrderProductDao extends Dao { ...@@ -22,7 +22,8 @@ class OrderProductDao extends Dao {
"payAfterJumpPcUrl", "payAfterJumpPcUrl",
"picUrl", "picUrl",
"price", "price",
"quantity"], "quantity",
"serviceItemSnapshot"],
raw: true raw: true
}); });
} }
......
...@@ -28,7 +28,7 @@ module.exports = { ...@@ -28,7 +28,7 @@ module.exports = {
//订单类型 //订单类型
"order_type": { "zzdd": "自主订单", "dkxd": "代客下单" }, "order_type": { "zzdd": "自主订单", "dkxd": "代客下单" },
//订单付款状态 //订单付款状态
"order_status": { 1: "待付款", 2: "已付款", 4: "服务中", 8: "已完成", 16: "待推送", 32: "已退款", 64: "已作废" }, "order_status": { 1: "待付款", 2: "已付款", 4: "服务中", 8: "已完成", 16: "已退款", 32: "已作废" },
//帐户类型( 支付类型) //帐户类型( 支付类型)
"pay_account_type": { "cash": "现金", "bank": "银行", "wx": "微信", "alipay": "支付宝", "other": "其它" }, "pay_account_type": { "cash": "现金", "bank": "银行", "wx": "微信", "alipay": "支付宝", "other": "其它" },
//订单服务付款状态 //订单服务付款状态
...@@ -69,10 +69,10 @@ module.exports = { ...@@ -69,10 +69,10 @@ module.exports = {
//凭单类型 //凭单类型
"direction_type": { "sr": "收", "zc": "支" }, "direction_type": { "sr": "收", "zc": "支" },
"push_return_type": { "0": "推送失败", "1": "推送成功" }, "push_return_type": { "0": "推送失败", "1": "推送成功" },
"push_chance_type": { "wts": "未推送", "yts": "已推送", "ygj": "已跟进", "ycd": "已成单","ygb" :"已关闭"}, "push_chance_type": { "wts": "未推送", "yts": "已推送", "ygj": "已跟进", "ycd": "已成单", "ygb": "已关闭" },
"policy_type":{'fzbt':'租金减免','jrdk':'金融贷款','zdfc':'行政措施','ssjm':'税收优惠','rlzy':'人力资源'}, "policy_type": { 'fzbt': '租金减免', 'jrdk': '金融贷款', 'zdfc': '行政措施', 'ssjm': '税收优惠', 'rlzy': '人力资源' },
"customer_intention":{"dgj":"待跟进","yyx":"有意向","wyx":"无意向"}, "customer_intention": { "dgj": "待跟进", "yyx": "有意向", "wyx": "无意向" },
"solution_status":{"dqr":"待确认","ywc":"已完成","yzf":"已作废"}, "solution_status": { "dqr": "待确认", "ywc": "已完成", "yzf": "已作废" },
}, },
} }
......
...@@ -22,7 +22,7 @@ module.exports = (db, DataTypes) => { ...@@ -22,7 +22,7 @@ module.exports = (db, DataTypes) => {
this.setDataValue("orderStatus", val); this.setDataValue("orderStatus", val);
this.setDataValue("orderStatusName", uiconfig.config.pdict.order_status[val]); this.setDataValue("orderStatusName", uiconfig.config.pdict.order_status[val]);
} }
},// 订单状态: 1: 待付款, 2: 已付款,4: 服务中, 8: 已完成, 16: 待推送, 32: 已退款, 64: 已作废 },// 订单状态: 1: 待付款, 2: 已付款, 4: 服务中, 8: 已完成, 16: 已退款, 32: 已作废
totalSum :DataTypes.DECIMAL(12, 2),// 订单总额(产品价格×优惠费率×订单件数) totalSum :DataTypes.DECIMAL(12, 2),// 订单总额(产品价格×优惠费率×订单件数)
payTotalSum :DataTypes.DECIMAL(12, 2),// 订单付款总额 payTotalSum :DataTypes.DECIMAL(12, 2),// 订单付款总额
refundSum :DataTypes.DECIMAL(12, 2),// 退款金额 refundSum :DataTypes.DECIMAL(12, 2),// 退款金额
...@@ -36,6 +36,7 @@ module.exports = (db, DataTypes) => { ...@@ -36,6 +36,7 @@ module.exports = (db, DataTypes) => {
invoiceApplyStatus :DataTypes.STRING(10),// 发票状态:00: 未申请, 10: 已申请,20:已开票 invoiceApplyStatus :DataTypes.STRING(10),// 发票状态:00: 未申请, 10: 已申请,20:已开票
opNotes :DataTypes.STRING,// 备注 opNotes :DataTypes.STRING,// 备注
notes :DataTypes.STRING,// 备注 notes :DataTypes.STRING,// 备注
isSolution :DataTypes.INTEGER,// 是否有方案,0无,1有
}, { }, {
paranoid: true,//假的删除 paranoid: true,//假的删除
underscored: true, underscored: true,
......
const system = require("../../../system");
const uuidv4 = require('uuid/v4');
//内部通知调用
class InternalCallsNotifyService {
constructor() {
this.orderinfoDao = system.getObject("db.dbcorder.orderinfoDao");
this.delivery_status={
"dqrfa": "待确认方案",
"fabtg": "方案不通过",
"dfwsfw": "待服务",
"dsccl": "待上传材料",
"dsh": "待审核",
"ddj": "待递交",
"ydj": "已递交",
"ywc": "已完成"
};
this.statusContrast={
"WAITCONFIRM":{name:"待确认方案",value:"dqrfa"},
"CONFIRMFAIL":{name:"方案不通过",value:"fabtg"},
"READY":{name:"待上传材料",value:"dsccl"},
"WAITCOMMIT":{name:"待递交",value:"ddj"},
"WAITARTIFICIALEXAMINE":{name:"待审核",value:"dsh"},
"DOCFINISH": {name:"待审核",value:"dsh"},
"AWAITCHECK": {name:"待审核",value:"dsh"},
"COMMITED": {name:"已递交",value:"ydj"},
"ROBOT": {name:"已递交",value:"ydj"},
"ROBOTPAY": {name:"已递交",value:"ydj"},
"RECVCOMMIT": {name:"已递交",value:"ydj"},
};
}
//接收辅助、担保商标注册信息
async receiveAssistTmData(pobj){
var checkRes = await this.checkParams(pobj);
if(checkRes.status==0){
var deliveryData = await this.packagingTmDeliveryData(pobj,null);
//获取交付信息
var orderdeliveryRes = await this.getOrderDelivery(pobj.sourceOrderNo,pobj.serviceNo);
if(orderdeliveryRes && orderdeliveryRes.length>0){
return system.getResult(null,"保存商标订单交付信息失败,存在重复交付信息,不能重复提交,10300");
}
this.addOrderDelivery(deliveryData,deliveryData.sourceOrderNo);
await this.orderinfoDao.model.update({isSolution:1}, { where: { orderNo: pobj.sourceOrderNo }});
return system.getResultSuccess();
}else{
return checkRes;
}
}
//接收辅助、担保商标注册修改信息
async receiveEditAssistTmData(pobj){
var checkRes = await this.checkParams(pobj);
if(checkRes.status==0){
//获取交付信息
var orderdeliveryRes = await this.getOrderDelivery(pobj.sourceOrderNo,pobj.serviceNo);
if(!orderdeliveryRes || orderdeliveryRes.length<1){
return system.getResult(null,"未知交付信息,10150");
}
var orderdelivery = orderdeliveryRes[0];
var deliveryData = await this.packagingTmDeliveryData(pobj,orderdelivery.deliveryContent);
this.putOrderDelivery(deliveryData,deliveryData.sourceOrderNo,deliveryData.serviceNo);
await this.orderinfoDao.model.update({isSolution:1}, { where: { orderNo: pobj.sourceOrderNo }});
return system.getResultSuccess();
}else{
return checkRes;
}
}
//-----------------------------------------------------------------------------------------------------
async checkParams(pobj){//参数校验
if (!pobj.serviceNo) {
return system.getResult(null, "业务单号不能为空不能为空,10100");
}
if (!pobj.sourceOrderNo) {
return system.getResult(null, "来源单号不能为空,10110");
}
var orderinfo = await this.orderinfoDao.model.findOne({
where:{orderNo:pobj.sourceOrderNo},raw:true
});
if(!orderinfo || !orderinfo.id){
return system.getResult(null, "未知订单,10120");
}
if (!pobj.tm) {
return system.getResult(null, "商标信息不能为空,10130");
}
if (!pobj.nclones) {
return system.getResult(null, "商品/服务项不能为空,10140");
}
if (!pobj.tm) {
return system.getResult(null, "商标信息不能为空,10150");
}
if (!pobj.tm.tmFormType) {
return system.getResult(null, "商标类型不能为空,10160");
}
if (pobj.tm.tmFormType == "4") {
pobj.tm.tmName = "图形";
}
if (!pobj.tm.tmName) {
return system.getResult(null, "商标名称不能为空,10170");
}
if (!pobj.tm.picUrl) {
return system.getResult(null, "商标图样不能为空,10180");
}
if (!pobj.apply) {
return system.getResult(null, "申请信息不能为空,10190");
}
if (!pobj.apply.code) {
return system.getResult(null, "申请统一社会信用代码不能为空,10200");
}
if (!pobj.apply.zipCode) {
return system.getResult(null, "申请邮编不能为空,10210");
}
if (!pobj.apply.customerType) {
return system.getResult(null, "申请人类型不能为空,10220");
}
if (pobj.apply.customerType != "ent" && pobj.apply.customerType != "person") {
return system.getResult(null, "申请人类型错误,10230");
}
if (!pobj.orderContact) {
return system.getResult(null, "联系人信息不能为空,10240");
}
if (!pobj.orderContact.contactName) {
return system.getResult(null, "联系人姓名不能为空,10250");
}
if (!pobj.orderContact.mobile) {
return system.getResult(null, "联系人手机号不能为空,10260");
}
return system.getResultSuccess(pobj);
}
async packagingTmDeliveryData(pobj,deliveryData) {//重新组装商标交付信息
var deliveryStatusList = [];
if(deliveryData && deliveryData.deliveryStatusList){
deliveryStatusList = deliveryData.deliveryStatusList;
}
var nclOne = pobj.nclones[0];
if(nclOne.tmStatus){
var deliveryStatusObj = this.statusContrast[nclOne.tmStatus];
if(deliveryStatusObj && deliveryStatusObj.value){
var deliveryStatus = deliveryStatusObj.value;
var deliveryStatusName = deliveryStatusObj.name;
deliveryStatusList.push({
deliveryStatus: deliveryStatus,
deliveryStatusName: deliveryStatusName,
deliveryUpdated: new Date()
});
pobj.deliveryStatus = deliveryStatus;
pobj.deliveryStatusName = deliveryStatusName;
}else{
deliveryStatusList.push({
deliveryStatus: nclOne.tmStatus,
deliveryStatusName: nclOne.tmStatus,
deliveryUpdated: new Date()
});
}
}
pobj.deliveryStatusList = deliveryStatusList;
pobj.opNotes = ""; //操作备注
return pobj;
}
putOrderDelivery(data, orderNo, channelOrderNo) {//修改交付信息
var sql = "UPDATE `c_order_delivery` SET deliveryContent ='" + JSON.stringify(data) + "' where sourceOrderNo='" + orderNo + "'";
sql = sql + " and deliveryContent->'$.serviceNo' = '"+channelOrderNo+"'";
this.orderinfoDao.customUpdate(sql);
}
addOrderDelivery(data, orderNo) {//新增交付信息
var sql = "INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUE('" +
orderNo + "','" + JSON.stringify(data) + "')";
this.orderinfoDao.customQuery(sql);
}
async getOrderDelivery(orderNo,channelOrderNo) {//查询交付信息
var sql = "select * from `c_order_delivery` where sourceOrderNo='" + orderNo + "'";
sql = sql + " and deliveryContent->'$.serviceNo' = '"+channelOrderNo+"'";
return await this.orderinfoDao.customQuery(sql);
}
//----------------------------------------------------------------------------------------------------------
}
module.exports = InternalCallsNotifyService;
\ No newline at end of file
...@@ -178,9 +178,6 @@ class OrderInfoService extends ServiceBase { ...@@ -178,9 +178,6 @@ class OrderInfoService extends ServiceBase {
if (!actionBody.deliveryData || Object.keys(actionBody.deliveryData).length == 0) { if (!actionBody.deliveryData || Object.keys(actionBody.deliveryData).length == 0) {
return system.getResult(null, "交付数据不能为空,20135"); return system.getResult(null, "交付数据不能为空,20135");
} }
if (Number(actionBody.totalSum) < 300) {
return system.getResult(null, "总价有误,总价不能小于300,20140");
}
var deliveryData = actionBody.deliveryData; var deliveryData = actionBody.deliveryData;
if (!deliveryData.nclones) { if (!deliveryData.nclones) {
return system.getResult(null, "商品/服务项不能为空,20150"); return system.getResult(null, "商品/服务项不能为空,20150");
...@@ -272,11 +269,17 @@ class OrderInfoService extends ServiceBase { ...@@ -272,11 +269,17 @@ class OrderInfoService extends ServiceBase {
return system.getResult(null, "没有查询到附加购买项目信息,20336"); return system.getResult(null, "没有查询到附加购买项目信息,20336");
} }
//重新计算尼斯官费 //重新计算尼斯官费
var totalNclPublicExpense = 0;
for (let g = 0; g < deliveryData.nclones.length; g++) { for (let g = 0; g < deliveryData.nclones.length; g++) {
const nclThree = deliveryData.nclones[g].nclThree; const nclThree = deliveryData.nclones[g].nclThree;
deliveryData.nclones[g].nclPublicExpense = Number(deliveryData.nclones[g].nclPublicExpense) + (nclThree.length - 10) * Number(actionBody.product_info.price_additions_item.public_expense); var tmpNclPublicExpense = Number(deliveryData.nclones[g].nclPublicExpense) + (nclThree.length - 10) * Number(actionBody.product_info.price_additions_item.public_expense);
totalNclPublicExpense = totalNclPublicExpense + tmpNclPublicExpense;
deliveryData.nclones[g].nclPublicExpense = tmpNclPublicExpense;
} }
} }
if (Number(actionBody.totalSum) < Number(totalNclPublicExpense)) {
return system.getResult(null, "总价有误,总价不能小于" + totalNclPublicExpense + ",20140");
}
pobj.actionBody.deliveryData.deliveryStatus = deliveryStatus; pobj.actionBody.deliveryData.deliveryStatus = deliveryStatus;
pobj.actionBody.deliveryData.deliveryStatusName = deliveryStatusName; pobj.actionBody.deliveryData.deliveryStatusName = deliveryStatusName;
pobj.actionBody.deliveryData.deliveryStatusList = deliveryStatusList; pobj.actionBody.deliveryData.deliveryStatusList = deliveryStatusList;
...@@ -728,6 +731,10 @@ class OrderInfoService extends ServiceBase { ...@@ -728,6 +731,10 @@ class OrderInfoService extends ServiceBase {
orderNo + "','" + JSON.stringify(data) + "')"; orderNo + "','" + JSON.stringify(data) + "')";
this.customQuery(sql); this.customQuery(sql);
} }
async getOrderDelivery(orderNo) {//查询交付信息
var sql = "select * from `c_order_delivery` where sourceOrderNo='" + orderNo + "'";
return await this.customQuery(sql);
}
async delOrder(pobj, actionBody) {//删除订单 async delOrder(pobj, actionBody) {//删除订单
await this.dao.delOrderByOrderNo(actionBody.orderNo, pobj.appInfo.uapp_id, pobj.userInfo.channel_userid); await this.dao.delOrderByOrderNo(actionBody.orderNo, pobj.appInfo.uapp_id, pobj.userInfo.channel_userid);
return system.getResultSuccess(); return system.getResultSuccess();
...@@ -743,12 +750,15 @@ class OrderInfoService extends ServiceBase { ...@@ -743,12 +750,15 @@ class OrderInfoService extends ServiceBase {
async getPayOrderInfo(pobj, actionBody) { async getPayOrderInfo(pobj, actionBody) {
var productItem = await this.orderproductDao.getItemByOrderNo(actionBody.orderNo, pobj.appInfo.uapp_id); var productItem = await this.orderproductDao.getItemByOrderNo(actionBody.orderNo, pobj.appInfo.uapp_id);
if (!productItem) { if (!productItem) {
return system.getResult(null, "订单产品数据异常,30090"); return system.getResult(null, "订单产品数据为空,30090");
} }
var item = await this.orderReceiptVoucherDao.getItemByOrderNo(actionBody.orderNo, pobj.appInfo.uapp_id); var item = await this.orderReceiptVoucherDao.getItemByOrderNo(actionBody.orderNo, pobj.appInfo.uapp_id);
if (!item) { if (!item) {
return system.getResult(null, "订单已经付款成功,请勿重复支付,30000"); return system.getResult(null, "订单已经付款成功,请勿重复支付,30000");
} }
var produceinfo = JSON.parse(productItem.serviceItemSnapshot);
productItem.id = produceinfo.id;
productItem.serviceItemSnapshot = null;
var param = { var param = {
receiptVoucher: item, receiptVoucher: item,
orderProduct: productItem orderProduct: productItem
...@@ -779,7 +789,7 @@ class OrderInfoService extends ServiceBase { ...@@ -779,7 +789,7 @@ class OrderInfoService extends ServiceBase {
var from = pageIndex == 1 ? 0 : Number((pageIndex - 1) * pageSize); var from = pageIndex == 1 ? 0 : Number((pageIndex - 1) * pageSize);
var paramWhere = {}; var paramWhere = {};
var sql = "select `orderNo`,`channelServiceNo`,`channelOrderNo`,`channelUserId`,`ownerUserId`,`payTime`,`quantity`,`serviceQuantity`,`orderStatusName`,`orderStatus`,`totalSum`,`payTotalSum`,`refundSum`," var sql = "select `isSolution`,`orderNo`,`channelServiceNo`,`channelOrderNo`,`channelUserId`,`ownerUserId`,`payTime`,`quantity`,`serviceQuantity`,`orderStatusName`,`orderStatus`,`totalSum`,`payTotalSum`,`refundSum`,"
+ " `invoiceApplyStatus`,`opNotes`,`channelItemCode`,`channelItemName`,`price`,priceDesc,priceTypeName,channelItemAppendName,`serviceItemCode`,`picUrl`,created_at from v_order where uapp_id=:uapp_id"; + " `invoiceApplyStatus`,`opNotes`,`channelItemCode`,`channelItemName`,`price`,priceDesc,priceTypeName,channelItemAppendName,`serviceItemCode`,`picUrl`,created_at from v_order where uapp_id=:uapp_id";
var sqlCount = "select count(1) as dataCount from v_order where uapp_id=:uapp_id"; var sqlCount = "select count(1) as dataCount from v_order where uapp_id=:uapp_id";
...@@ -1154,7 +1164,7 @@ class OrderInfoService extends ServiceBase { ...@@ -1154,7 +1164,7 @@ class OrderInfoService extends ServiceBase {
}; };
var moneyJourney = await self.moneyJourneyDao.create(moneyObj, t); var moneyJourney = await self.moneyJourneyDao.create(moneyObj, t);
}); });
item.orderStatus = 2;//已付款
var resultParams = { var resultParams = {
order_info: item, order_info: item,
delivery_content: null,//包含订单联系人orderContact delivery_content: null,//包含订单联系人orderContact
...@@ -1171,7 +1181,172 @@ class OrderInfoService extends ServiceBase { ...@@ -1171,7 +1181,172 @@ class OrderInfoService extends ServiceBase {
return system.getResultSuccess(resultParams); return system.getResultSuccess(resultParams);
} }
async opOrderPayCallBackAliDing(parmas, appInfo) {//操作订单付款回调---阿里钉钉
var item = await this.dao.getItemStatusByOrderNo(parmas.orderNo)
if (!item) {
return system.getResult(null, "order data is empty!");
}
if (item.orderStatus > 1) {
return system.getResult(null, "order status is pay!");
}
var self = this;
await self.db.transaction(async function (t) {
await self.dao.updateByWhere({ orderStatus: 2, payTime: parmas.gmt_payment }, { where: { orderNo: parmas.orderNo } }, t);
var putFields = {
auditStatus: "tg",
accountType: parmas.pay_type,
passTradeNo: parmas.notify_id || "",//通知校验ID
payOrderNo: parmas.trade_no || "",//支付凭证流水单号,如:微信支付凭证单号--该交易在支付宝系统中的交易流水号。最短16位,最长64位。
busPayOrderCode: parmas.out_trade_no || "",//业务支付订单号
buyerOpenId: parmas.buyer_id || "",//用户在支付商户appid下的唯一标识或买家在支付宝的用户id
buyerAliLogonId: parmas.buyer_email || "",//买家支付宝账号
updated_at: parmas.gmt_payment,//该笔交易的买家付款时间。格式为yyyy-MM-dd HH:mm:ss。
notes: parmas.gmt_create || ""//该笔交易创建的时间。格式为yyyy-MM-dd HH:mm:ss。
};
await self.orderReceiptVoucherDao.updateByWhere(putFields, { where: { sourceOrderNo: parmas.orderNo } }, t);
var orderLog = {
uapp_id: appInfo.uapp_id,
sourceOrderNo: parmas.orderNo,
opContent: "您成功支付了订单,请等待服务商服务",
isShow: 1
};
await self.flowlogDao.create(orderLog, t);
var moneyObj = {
uapp_id: appInfo.uapp_id,
sourceOrderNo: parmas.orderNo, // 来源单号
channelUserId: item.channelUserId,
ownerUserId: item.ownerUserId,
accountType: parmas.pay_type,//帐户类型( 支付类型):"cash": "现金", "bank": "银行" ,"wx":"微信","alipay":"支付宝","other":"其它"
directionType: "sr",//凭单类型,"sr": "收","zc": "支"
voucherDate: parmas.gmt_payment,//new Date(),//凭单时间
recvAmount: item.totalSum,//收总额
sourceType: "orderinfo",//来源类型 "orderinfo": "订单","expensevoucher": "费用单"
auditStatus: "tg",//审核状态"dsh": "待审核", "btg": "不通过", "tg": "通过"
};
await self.moneyJourneyDao.create(moneyObj, t);
});
item.orderStatus = 2;//已付款
var resultParams = {
order_info: item,
delivery_content: null,//包含订单联系人orderContact
product_info: null
};
var deliveryInfoResult = await this.getOrderDeliveryInfo(null, parmas);
if (deliveryInfoResult && deliveryInfoResult.status == 0) {
resultParams.delivery_content = deliveryInfoResult.data;
}
var orderProductItem = await this.orderproductDao.getItemInfoByOrderNo(parmas.orderNo);
if (orderProductItem) {
resultParams.product_info = JSON.parse(orderProductItem.serviceItemSnapshot);
}
return system.getResultSuccess(resultParams);
}
//-------------------------------服务商通知订单流程-------------end---------------- //-------------------------------服务商通知订单流程-------------end----------------
//商标方案确认
async tmConfirm(pobj) {
var ab = pobj.actionBody;
var self = this;
var user = pobj.userInfo;
var app = pobj.appInfo;
if (!user || !user.id) {
return system.getResultFail(-100, "未知用户");
}
if (!app || !app.id) {
return system.getResultFail(-100, "未知渠道");
}
var channelUserId = user.channel_userid;
var orderNo = ab.orderNo;
var isConfirm = ab.isConfirm;
if (!channelUserId) {
return system.getResultFail(-101, "渠道用户id不能为空");
}
if (!orderNo) {
return system.getResultFail(-102, "订单号不能为空");
}
if (!isConfirm) {
return system.getResultFail(-103, "确认码不能为空");
}
//获取订单信息
var orderinfo = await this.dao.model.findOne({
where: { orderNo: orderNo, uapp_id: app.uapp_id }, raw: true
});
if (!orderinfo || !orderinfo.id) {
return system.getResultFail(-110, "未知订单信息");
}
if (orderinfo.isSolution != 1) {
return system.getResultFail(-111, "该订单无方案,不能执行此操作");
}
//获取交付单信息
var orderdeliveryRes = await this.getOrderDelivery(orderNo);
if (!orderdeliveryRes || orderdeliveryRes.length < 1) {
return system.getResultFail(-104, "未知订单交付信息");
}
var orderdelivery = orderdeliveryRes[0];
var deliveryContent = orderdelivery.deliveryContent;
// if (!deliveryContent || !deliveryContent.deliveryStatus || deliveryContent.deliveryStatus != "dqrfa") {
// return system.getResultFail(-105, "方案确认失败,方案交付状态错误");
// }
if (!deliveryContent.deliveryStatusList) {
deliveryContent.deliveryStatusList = [];
}
return await self.db.transaction(async function (t) {
var orderLog = {
uapp_id: app.uapp_id,
sourceOrderNo: orderNo,
opContent: "商标方案确认",
isShow: 1
};
var orderInfoObj = {
id: orderinfo.id
};
if (ab.notes) {
orderInfoObj["opNotes"] = ab.notes;
}
if (isConfirm == "0") {
if (!ab.notes) {
return system.getResultFail(-106, "方案确认失败,不通过原因不能为空");
}
deliveryContent["deliveryStatus"] = "fabtg";
deliveryContent["deliveryStatusName"] = "方案不通过";
deliveryContent["opNotes"] = ab.notes;
orderLog["opContent"] = "商标方案不通过";
deliveryContent.deliveryStatusList.push({
deliveryStatus: "fabtg",
deliveryStatusName: "方案不通过",
deliveryUpdated: new Date()
});
orderInfoObj["isSolution"] = 0;
}
if (isConfirm == "1") {
deliveryContent["deliveryStatus"] = "dsh";
deliveryContent["deliveryStatusName"] = "待审核";
deliveryContent["opNotes"] = ab.notes || "";
orderLog["opContent"] = "商标方案确认通过";
deliveryContent.deliveryStatusList.push({
deliveryStatus: "dsh",
deliveryStatusName: "待审核",
deliveryUpdated: new Date()
});
orderInfoObj["isSolution"] = 0;
}
self.putOrderDelivery(deliveryContent, orderNo);//修改订单交付信息
await self.dao.update(orderInfoObj, t);//修改订单信息
await self.flowlogDao.create(orderLog, t);//添加流程信息
// var pushObj = {//推送参数
// serviceNo:deliveryContent.serviceNo,
// isConfirm:isConfirm,
// channelCode:deliveryContent.channelCode,
// notes:ab.notes || ""
// };
orderdeliveryRes = await self.getOrderDelivery(orderNo);
if (orderdeliveryRes && orderdeliveryRes.length > 0) {
return system.getResultSuccess(orderdeliveryRes[0]);
}
return system.getResultSuccess();
})
}
} }
module.exports = OrderInfoService; module.exports = OrderInfoService;
\ No newline at end of file
...@@ -10,6 +10,7 @@ class NeedsolutionService extends ServiceBase { ...@@ -10,6 +10,7 @@ class NeedsolutionService extends ServiceBase {
// this.push2aliSve = system.getObject("service.common.push2aliSve"); // this.push2aliSve = system.getObject("service.common.push2aliSve");
this.orderinfoDao = system.getObject("db.dbcorder.orderinfoDao"); this.orderinfoDao = system.getObject("db.dbcorder.orderinfoDao");
} }
//---------------------公司注册-start-----------------------------------------------------------------
//提交方案 //提交方案
async submitProgramme(pobj){ async submitProgramme(pobj){
var ab = pobj.actionBody; var ab = pobj.actionBody;
...@@ -523,6 +524,526 @@ class NeedsolutionService extends ServiceBase { ...@@ -523,6 +524,526 @@ class NeedsolutionService extends ServiceBase {
await this.dao.model.update(reqObj, { where: { id: ns.id }});//修改方案信息 await this.dao.model.update(reqObj, { where: { id: ns.id }});//修改方案信息
return system.getResultSuccess(); return system.getResultSuccess();
} }
//---------------------公司注册-end-----------------------------------------------------------------
//---------------------icp注册-start-----------------------------------------------------------------
//提交方案
async submitIcpProgramme(pobj){
var ab = pobj.actionBody;
var user = pobj.userInfo;
if(!user || !user.id){
return system.getResultFail(-100,"未知用户");
}
ab["createUserId"]=user.id;
if(!ab.needNo){
return system.getResultFail(-101,"渠道需求号不能为空");
}
if(!ab.solutionContent){
return system.getResultFail(-102,"方案信息有误");
}
//获取需求信息
var needinfo = await this.needinfoDao.model.findOne({
where:{channelNeedNo:ab.needNo},raw:true
});
if(!needinfo || !needinfo.id){
return system.getResultFail(-201,"未知需求信息");
}
if(needinfo.status=="ycd" || needinfo.status=="ygb"){
return system.getResultFail(-202,"该方案需求状态为"+needinfo.statusName+",不能创建方案");
}
var bizType = ab.solutionContent.bizType;//icp业务类型
if(!bizType || !needinfo.typeCode || bizType!=needinfo.typeCode){
return system.getResultFail(-205,"方案类型错误");
}
if(!needinfo.channelTypeCode){
return system.getResultFail(-206,"渠道方案类型错误");
}
var ns = await this.dao.model.findAll({
where:{needNo:ab.needNo},raw:true
});
for(var i=0;i<ns.length;i++){
var fa = ns[i];
if(fa.status!="yzf"){
return system.getResultFail(-207,"需求方案已存在,不能重复提交");
}
}
ab.solutionContent.bizType=needinfo.channelTypeCode;
bizType =needinfo.channelTypeCode;
if(!ab.solutionContent.solution){
return system.getResultFail(-104,"业务方案信息不能为空");
}
var solution = ab.solutionContent.solution;
if(!solution){
return system.getResultFail(-103,"方案交付信息有误");
}
ab.solutionContent.solution.IcpType = needinfo.channelTypeCode;
ab.solutionContent.applicationStatusList = [{
"OfficialFileURL":"",
"ApplicationStatus":"submitIcpProgramme",
"ApplicationStatusName":"提交方案",
"created_at":new Date()
}];
if(!solution.CompanyName){
return system.getResultFail(-105,"公司名不能为空");
}
if(!solution.CompanyAddress){
return system.getResultFail(-106,"公司地址不能为空");
}
if(!solution.Area){
return system.getResultFail(-107,"区域不能为空");
}
ab["channelNeedNo"] = needinfo.channelNeedNo;
var solutionNo = await this.getBusUid("ns");
ab["solutionNo"] = solutionNo;
ab["status"] = "dqr";
ab.solutionContent["notes"]="";
ab.solutionContent["totalSum"]="";
ab.solutionContent = JSON.stringify(ab.solutionContent);
var self = this;
return await this.db.transaction(async function (t) {
ab["needNo"] = needinfo.needNo;
var od = await self.dao.create(ab,t);
if(od && od.id){
var pushflag = 0;//推送标志 值为1推送小记
var needObj={
id:needinfo.id
};
if(!needinfo.followManUserId){
needObj={
id:needinfo.id,
followManUserId: user.id,//跟进人id
followManName: user.channel_username,//跟进人姓名
followManMobile: user.mobile,//跟进人手机号(合伙人)
followManOnlyCode: user.channel_userid
};
}
if(!needinfo.followContent){
var followContent = {
followDate:new Date(),
content:"icp提交到方案"
};
followContent = JSON.stringify(followContent);
needObj["followContent"] = followContent;
pushflag = 1;
}
await self.needinfoDao.update(needObj,t);
needinfo = await self.needinfoDao.model.findOne({
where:{id:needinfo.id},raw:true
});
needinfo["pushflag"]=pushflag;
return system.getResultSuccess({needinfo:needinfo,needsolution:od});
}else{
return system.getResultFail(-202, "提交方案失败");
}
})
}
//修改icp方案-- 无效
async updateIcpProgramme(pobj){
var ab = pobj.actionBody;
var user = pobj.userInfo;
if(!user || !user.id){
return system.getResultFail(-100,"未知用户");
}
ab["createUserId"]=user.id;
if(!ab.needNo){
return system.getResultFail(-101,"渠道需求号不能为空");
}
if(!ab.solutionContent){
return system.getResultFail(-102,"方案信息有误");
}
//获取需求信息
var needinfo = await this.needinfoDao.model.findOne({
where:{channelNeedNo:ab.needNo},raw:true
});
if(!needinfo || !needinfo.id){
return system.getResultFail(-201,"未知需求信息");
}
if(needinfo.status=="ycd" || needinfo.status=="ygb"){
return system.getResultFail(-202,"该方案需求状态为"+needinfo.statusName+",不能创建方案");
}
var bizType = ab.solutionContent.bizType;//icp业务类型
if(!bizType || !needinfo.typeCode || bizType!=needinfo.typeCode){
return system.getResultFail(-205,"方案类型错误");
}
if(!needinfo.channelTypeCode){
return system.getResultFail(-206,"渠道方案类型错误");
}
ab.solutionContent.bizType=needinfo.channelTypeCode;
bizType =needinfo.channelTypeCode;
if(!ab.solutionContent.solution){
return system.getResultFail(-104,"业务方案信息不能为空");
}
var solution = ab.solutionContent.solution;
if(!solution){
return system.getResultFail(-103,"方案交付信息有误");
}
ab.solutionContent.solution.IcpType = needinfo.channelTypeCode;
if(!solution.CompanyName){
return system.getResultFail(-105,"公司名不能为空");
}
if(!solution.CompanyAddress){
return system.getResultFail(-106,"公司地址不能为空");
}
if(!solution.Area){
return system.getResultFail(-107,"区域不能为空");
}
ab["channelNeedNo"] = needinfo.channelNeedNo;
var solutionNo = await this.getBusUid("ns");
ab["solutionNo"] = solutionNo;
ab["status"] = "dqr";
ab.solutionContent["notes"]="";
ab.solutionContent["totalSum"]="";
ab.solutionContent = JSON.stringify(ab.solutionContent);
var self = this;
return await this.db.transaction(async function (t) {
ab["needNo"] = needinfo.needNo;
var od = await self.dao.create(ab,t);
if(od && od.id){
var pushflag = 0;//推送标志 值为1推送小记
var needObj={
id:needinfo.id
};
if(!needinfo.followManUserId){
needObj={
id:needinfo.id,
followManUserId: user.id,//跟进人id
followManName: user.channel_username,//跟进人姓名
followManMobile: user.mobile,//跟进人手机号(合伙人)
followManOnlyCode: user.channel_userid
};
}
if(!needinfo.followContent){
var followContent = {
followDate:new Date(),
content:"icp提交到方案"
};
followContent = JSON.stringify(followContent);
needObj["followContent"] = followContent;
pushflag = 1;
}
await self.needinfoDao.update(needObj,t);
needinfo = await self.needinfoDao.model.findOne({
where:{id:needinfo.id},raw:true
});
needinfo["pushflag"]=pushflag;
return system.getResultSuccess({needinfo:needinfo,needsolution:od});
}else{
return system.getResultFail(-202, "提交方案失败");
}
})
}
//提交icp材料信息
async submitIcpMaterial(pobj){
var ab = pobj.actionBody;
var user = pobj.userInfo;
if(!user || !user.id){
return system.getResultFail(-100,"未知用户");
}
ab["createUserId"]=user.id;
if(!ab.BizId){
return system.getResultFail(-101,"方案编号不能为空");
}
if(!ab.material){
return system.getResultFail(-102,"材料信息有误");
}
//获取方案信息
var needsolutioninfo = await this.dao.model.findOne({
where:{channelSolutionNo: ab.BizId},raw:true
});
if(!needsolutioninfo || !needsolutioninfo.id){
return system.getResultFail(-400,"未知方案");
}
if(!needsolutioninfo.needNo){
return system.getResultFail(-401,"方案需求信息有误");
}
var solutionContent = needsolutioninfo.solutionContent;
if(!solutionContent){
return system.getResultFail(-402,"方案交付信息有误");
}
//获取需求信息
var needinfo = await this.needinfoDao.model.findOne({
where:{needNo:needsolutioninfo.needNo},raw:true
});
if(!needinfo || !needinfo.id){
return system.getResultFail(-201,"未知需求信息");
}
if(needinfo.status=="ycd" || needinfo.status=="ygb"){
return system.getResultFail(-202,"该方案需求状态为"+needinfo.statusName+",不能执行此操作");
}
var material = ab.material;
if(!material.Domain){
return system.getResultFail(-101,"备案域名不能为空");
}
if(!material.hasOwnProperty("IncludeForeignInvestment")){
return system.getResultFail(-102,"包含外贸参数不能为空");
}
if(!material.PartnerBusinessLicense){
return system.getResultFail(-103,"营业执照不能为空");
}
if(!material.PartnerIdCardList || material.PartnerIdCardList.length<1){
return system.getResultFail(-105,"相关人员身份证不能为空");
}
if(!material.PartnerDomainCertificate){
return system.getResultFail(-106,"域名证书不能为空");
}
if(!material.PartnerPreviewOtherList || material.PartnerPreviewOtherList.length<1){
return system.getResultFail(-107,"合作方递交其他供预览文件不能为空");
}
solutionContent.material = ab.material;
needsolutioninfo.solutionContent = JSON.stringify(solutionContent);
var self = this;
return await this.db.transaction(async function (t) {
await self.dao.update(needsolutioninfo,t);
needsolutioninfo = await self.dao.model.findOne({
where:{channelSolutionNo: ab.BizId},raw:true
});
return system.getResultSuccess(needsolutioninfo);
})
}
//通知状态变更
async acceptIcpPartnerNotification(pobj){
var ab = pobj.actionBody;
var user = pobj.userInfo;
if(!user || !user.id){
return system.getResultFail(-100,"未知用户");
}
ab["createUserId"]=user.id;
if(!ab.BizId){
return system.getResultFail(-101,"方案编号不能为空");
}
if(!ab.ApplicationStatus){
return system.getResultFail(-102,"通知状态不能为空");
}
//获取方案信息
var needsolutioninfo = await this.dao.model.findOne({
where:{channelSolutionNo: ab.BizId},raw:true
});
if(!needsolutioninfo || !needsolutioninfo.id){
return system.getResultFail(-400,"未知方案");
}
if(!needsolutioninfo.needNo){
return system.getResultFail(-401,"方案需求信息有误");
}
var solutionContent = needsolutioninfo.solutionContent;
if(!solutionContent){
return system.getResultFail(-402,"方案交付信息有误");
}
//获取需求信息
var needinfo = await this.needinfoDao.model.findOne({
where:{needNo:needsolutioninfo.needNo},raw:true
});
if(!needinfo || !needinfo.id){
return system.getResultFail(-201,"未知需求信息");
}
if(needinfo.status=="ycd" || needinfo.status=="ygb"){
return system.getResultFail(-202,"该方案需求状态为"+needinfo.statusName+",不能执行此操作");
}
var applicationStatusList = solutionContent.applicationStatusList || [];
var statusObj={
"OfficialFileURL":ab.OfficialFileURL || "",
"ApplicationStatus":ab.ApplicationStatus,
"created_at":new Date()
};
applicationStatusList.push(statusObj);
solutionContent.applicationStatusList = applicationStatusList;
// solutionContent.status = ab.ApplicationStatus;
needsolutioninfo.solutionContent = JSON.stringify(solutionContent);
var self = this;
return await this.db.transaction(async function (t) {
await self.dao.update(needsolutioninfo,t);
needsolutioninfo = await self.dao.model.findOne({
where:{channelSolutionNo: ab.BizId},raw:true
});
statusObj["BizId"] = ab.BizId;
return system.getResultSuccess(statusObj);
})
}
//服务商方案作废 -- abolishIcpProgramme
async abolishIcpProgramme(pobj){
var ab = pobj.actionBody;
var user = pobj.userInfo;
if(!user || !user.id){
return system.getResultFail(-100,"未知用户");
}
if(!ab.BizId){
return system.getResultFail(-101,"渠道方案号不能为空");
}
if(!ab.Note){
return system.getResultFail(-105,"关闭理由不能为空");
}
//获取方案信息
var ns = await this.dao.model.findOne({
where:{channelSolutionNo: ab.BizId,createUserId:user.id},raw:true
});
if(!ns || !ns.id){
return system.getResultFail(-102,"未知方案");
}
var needinfo = await this.needinfoDao.model.findOne({
where:{needNo:ns.needNo},raw:true
});
if(!needinfo){
return system.getResultFail(-104,"未知方案需求");
}
if(needinfo.status=="ycd" || needinfo.status=="ygb"){
return system.getResultFail(-105,"该方案需求状态为"+needinfo.statusName+",不能执行此操作");
}
if(ns.status!="dqr"){
return system.getResultFail(-103,"方案状态错误,只能废弃待确认方案");
}
var solutionContent = ns.solutionContent;
solutionContent.solution.Note = ab.Note;
solutionContent = JSON.stringify(solutionContent);
await this.dao.update({id:ns.id,status:"yzf",solutionContent:solutionContent});//方案废弃
//获取方案信息
ns = await this.dao.model.findOne({
where:{channelSolutionNo: ab.BizId,createUserId:user.id},raw:true
});
return system.getResultSuccess(ns);
}
//确认方案
async confirmIcpIntention(pobj){
return system.getResultFail();
}
//接收方案状态变更通知
async receiveIcpStatusNotify(pobj){
var ab = pobj.actionBody;
if(!ab.BizId){
return system.getResultFail(-101,"渠道方案号不能为空");
}
if(!ab.status){
return system.getResultFail(-102,"方案状态不能为空");
}
//获取方案信息
var ns = await this.dao.model.findOne({
where:{channelSolutionNo: ab.BizId},raw:true
});
if(!ns || !ns.id){
return system.getResultFail(-102,"未知方案");
}
var needinfo = await this.needinfoDao.model.findOne({
where:{needNo:ns.needNo},raw:true
});
if(!needinfo){
return system.getResultFail(-104,"未知方案需求");
}
if(needinfo.status=="ycd" || needinfo.status=="ygb"){
return system.getResultFail(-105,"该方案需求状态为"+needinfo.statusName+",不能执行此操作");
}
if(ns.status!="dqr"){
return system.getResultFail(-103,"方案状态错误,只能废弃待确认方案");
}
var solutionContent = ns.solutionContent;
solutionContent.status = ab.status;
var material = solutionContent.material || {};
if(ab.remark){
solutionContent.notes = ab.remark;
}
if(ab.businessLicense){
material.PartnerBusinessLicense = ab.businessLicense;
}
if(ab.idCardUrlList && ab.idCardUrlList.length>0){
material.PartnerIdCardList = ab.idCardUrlList;
}
if(ab.userPlan){
material.PartnerPlan = ab.userPlan;
}
if(ab.userForeig){
material.PartnerForeignInvestment = ab.userForeig;
}
if(ab.userLaw){
material.PartnerLaw = ab.userLaw;
}
if(ab.userOtherList && ab.userOtherList.length>0){
material.PartnerSignAndStampOtherList = ab.userOtherList;
}
solutionContent.material = material;
solutionContent = JSON.stringify(solutionContent);
var updateObj = {
id:ns.id,solutionContent:solutionContent
};
if(ab.status == "11"){//⽅案已关闭
updateObj["status"]="yzf";
}else if(ab.status == "2" || ab.status == "4"){ //2, "⽤户已上传" 4, "⽤户已确认"
updateObj["status"]="dqr";
}
await this.dao.update(updateObj);//方案状态修改
ns = await this.dao.model.findOne({
where:{channelSolutionNo: ab.BizId},raw:true
});
return system.getResultSuccess(ns);
}
//接收icp用户方案反馈
async receiveIcpFeedback(pobj){
var ab = pobj.actionBody;
if(!ab.intentionBizId){
return system.getResultFail(-101,"渠道需求编号错误");
}
if(!ab.description){
return system.getResultFail(-102,"问题描述不能为空");
}
if(!ab.hasOwnProperty("intentionStatus")){
return system.getResultFail(-103,"需求当前状态不能为空");
}
//获取需求信息
var needinfo = await this.needinfoDao.model.findOne({
where:{channelNeedNo: ab.intentionBizId},raw:true
});
if(!needinfo){
return system.getResultFail(-104,"未知方案需求");
}
if(needinfo.status=="ycd" || needinfo.status=="ygb"){
return system.getResultFail(-105,"该方案需求状态为"+needinfo.statusName+",不能执行此操作");
}
//获取方案信息
var ns = await this.dao.model.findOne({
where:{channelNeedNo:ab.intentionBizId,status:"dqr"},raw:true
});
if(!ns){
return system.getResultFail(-106,"未知方案");
}
var intentionStatusList=["未知","⽅案待服务商确认","⽅案待⽤户确认","处理中","已完成","已关闭"];
var updateObj={
id:ns.id
};
var solutionContent = ns.solutionContent;
solutionContent.notes = ab.description;
solutionContent.needStatus = ab.intentionStatus;
if(ab.intentionStatus==1 || ab.intentionStatus==2 || ab.intentionStatus==3){
updateObj["status"]="dqr";
}else if(ab.intentionStatus==4){
updateObj["status"]="ywc";
}else if(ab.intentionStatus==5){
updateObj["status"]="yzf";
}else{
return system.getResultFail(-107,"需求当前状态错误--"+ab.intentionStatus);
}
solutionContent.needStatusName = intentionStatusList[ab.intentionStatus];
solutionContent = JSON.stringify(solutionContent);
updateObj["solutionContent"] =solutionContent;
await this.dao.update(updateObj);//方案状态修改
return system.getResultSuccess();
}
//
async getIcpProgrammeDetail(pobj){
var ab = pobj.actionBody;
if(!ab.BizId){
return system.getResultFail(-101,"方案编号不能为空");
}
//获取方案信息
var ns = await this.dao.model.findAll({
where:{channelSolutionNo:ab.BizId},raw:true
});
return system.getResultSuccess(ns);
}
//---------------------icp注册-end-----------------------------------------------------------------
} }
module.exports = NeedsolutionService; module.exports = NeedsolutionService;
// var task = new NeedsolutionService(); // var task = new NeedsolutionService();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment