Commit 95d2f395 by 宋毅

增加内容

parents 4d1464d1 8a36d239
......@@ -3,7 +3,8 @@ FROM registry.cn-beijing.aliyuncs.com/hantang2/node105:v2
MAINTAINER jy "jiangyong@gongsibao.com"
ADD center-order /apps/center-order/
WORKDIR /apps/center-order/
RUN cnpm install -S
RUN yum install gcc-c++.x86_64 -y
RUN npm install --unsafe-perm=true --allow-root
CMD ["node","/apps/center-order/main.js"]
......
......@@ -83,6 +83,9 @@ class IcAPI extends APIBase {
case "queryExpertApplyCommunicationLogs":// 查询需求沟通记录 2020-10-28 laolan
opResult = await this.needinfoSve2.queryExpertApplyCommunicationLogs(pobj, pobj.actionBody, req);
break;
case "queryCommunicationLog":// 查询需求沟通记录
opResult = await this.needinfoSve2.queryCommunicationLog(pobj, pobj.actionBody, req);
break;
case "bulkCreateNeeds":
opResult = await this.needinfoSve.bulkCreateNeeds(pobj);
break;
......
......@@ -74,8 +74,10 @@ class NeedinfoService extends ServiceBase {
if (!actionBody.intentionBizId) {
return system.getResultFail(-5001, "intentionBizId不能为空");
}
if (!actionBody.mobile) {
return system.getResultFail(-5002, "mobile不能为空");
if(actionBody.appName != '阿里云商机') {
if (!actionBody.mobile) {
return system.getResultFail(-5002, "mobile不能为空");
}
}
if (!actionBody.type) {
return system.getResultFail(-5003, "type不能为空");
......
......@@ -100,5 +100,28 @@ class NeedinfoService2 extends ServiceBase {
}
//2020-10-28 laolan 新增查询需求沟通记录
async queryCommunicationLog(pobj){
console.log('query++pobj',pobj)
if (!pobj.actionBody.intentionBizId) {
return system.getResult(null, "actionBody.intentionBizId can not be empty,100493");
}
if(pobj.appInfo.uapp_id == 18){
if (!pobj.actionBody.userFeedBack) {
return system.getResult(null, "actionBody.userFeedBack can not be empty,100494");
}
}
var sql = "select followContent from n_need_info where channelNeedNo = :channelNeedNo ";
var where = {
channelNeedNo:pobj.actionBody.intentionBizId
}
var uappIdInfo = await this.customQuery(sql,where);
if(uappIdInfo){
uappIdInfo = uappIdInfo[0];
return system.getResultSuccess(uappIdInfo);
}
}
}
module.exports = NeedinfoService2;
const system = require("../../../system");
const moment = require('moment');
/**
* 阿里云增值电信相关接口(ICP、EDI)
* created by zhuangbing
......@@ -67,7 +66,7 @@ class BaseQcService {
//获取需求信息
var needinfo = await this.needinfoDao.model.findOne({
attributes: ["id", "status", "statusName", "needNo", "uapp_id"],//2020-10-29 laolan xinzeng uapp_id
where: {channelNeedNo: ab.intentionBizId}, raw: true
where: { channelNeedNo: ab.intentionBizId }, raw: true
});
var uappId = {};
if (!needinfo || !needinfo.id) {
......@@ -81,7 +80,7 @@ class BaseQcService {
}
//获取方案信息
var ns = await this.needsolutionDao.model.findOne({
where: {needNo: needinfo.needNo, isInvalid: 0}, raw: true
where: { needNo: needinfo.needNo, isInvalid: 0 }, raw: true
});
if (ns && ns.id) {
......@@ -102,10 +101,7 @@ class BaseQcService {
};
await self.needinfoDao.update(needObj, t);//关闭需求
if (ns && ns.id) {
await self.needsolutionDao.model.update({status: "yzf", isInvalid: 1}, {
where: {id: ns.id},
transaction: t
});//方案废弃
await self.needsolutionDao.model.update({ status: "yzf", isInvalid: 1 }, { where: { id: ns.id }, transaction: t });//方案废弃
// return system.getResultSuccess(ns.orderNo);
ns = ns ? ns : {};
ns = Object.assign(ns, uappId)
......@@ -123,6 +119,8 @@ class BaseQcService {
}
}
//提交方案
async submitIcpProgramme(pobj) {
console.log("pobj++++", pobj)
......@@ -140,7 +138,7 @@ class BaseQcService {
}
//获取需求信息
var needinfo = await this.needinfoDao.model.findOne({
where: {channelNeedNo: ab.needNo}, raw: true
where: { channelNeedNo: ab.needNo }, raw: true
});
if (!needinfo || !needinfo.id) {
return system.getResultFail(-201, "未知需求信息");
......@@ -162,7 +160,7 @@ class BaseQcService {
ab.solutionContent.typeCode = needinfo.typeCode;
ab.solutionContent.typeName = needinfo.typeName;
var ns = await this.needsolutionDao.model.findAll({
where: {channelNeedNo: ab.needNo}, raw: true, order: [["id", 'asc']]
where: { channelNeedNo: ab.needNo }, raw: true, order: [["id", 'asc']]
});
for (var i = 0; i < ns.length; i++) {
var fa = ns[i];
......@@ -181,7 +179,7 @@ class BaseQcService {
return system.getResultFail(-103, "方案交付信息有误");
}
//判断属于渠道 18阿里,44百度,52易名
if (needinfo.uapp_id == 44 || needinfo.uapp_id == 18) {
if(needinfo.uapp_id == 44 || needinfo.uapp_id == 18){
if (needinfo.channelTypeCode == "7") {//edi
ab.solutionContent.solution.IcpType = 2;
} else if (needinfo.channelTypeCode == "5") {//icp
......@@ -190,15 +188,23 @@ class BaseQcService {
return system.getResultFail(-207, "需求业务类型有误");
}
}
if (needinfo.uapp_id == 52) {
if (needinfo.channelTypeCode == "7") {//edi
if(needinfo.uapp_id == 52){
if (needinfo.channelTypeCode == "7") {//edisq
ab.solutionContent.solution.IcpType = 2;
} else if (needinfo.channelTypeCode == "5") {//icp
} else if (needinfo.channelTypeCode == "5") {//icpsq
ab.solutionContent.solution.IcpType = 1;
} else if (needinfo.channelTypeCode == "icpnb") {//icpnb
} else if (needinfo.channelTypeCode == "ICPNB") {//ICPNB
ab.solutionContent.solution.IcpType = 3;
} else if (needinfo.channelTypeCode == "edinb") {//edinb
} else if (needinfo.channelTypeCode == "EIDNB") {//EIDNB
ab.solutionContent.solution.IcpType = 4;
}else if (needinfo.channelTypeCode == "ICPXQ") {//ICPXQ
ab.solutionContent.solution.IcpType = 5;
} else if (needinfo.channelTypeCode == "EIDXQ") {//EIDXQ
ab.solutionContent.solution.IcpType = 6;
} else if (needinfo.channelTypeCode == "ICPWZ") {//ICPWZ
ab.solutionContent.solution.IcpType = 7;
} else if (needinfo.channelTypeCode == "EIDWZ") {//EIDWZ
ab.solutionContent.solution.IcpType = 8;
} else {
return system.getResultFail(-208, "需求业务类型有误-52");
}
......@@ -217,9 +223,7 @@ class BaseQcService {
}
var solutionFlowList = ab.solutionContent.solutionFlowList || [];
solutionFlowList.push({
status: "SOLUTION_SUBMIT",
statusName: this.icpSolutionStatusReference.SOLUTION_SUBMIT,
updated_at: new Date()
status: "SOLUTION_SUBMIT", statusName: this.icpSolutionStatusReference.SOLUTION_SUBMIT, updated_at: new Date()
});
ab.solutionContent.status = "SOLUTION_SUBMIT";
ab.solutionContent.statusName = this.icpSolutionStatusReference.SOLUTION_SUBMIT;
......@@ -268,9 +272,9 @@ class BaseQcService {
}
await self.needinfoDao.update(needObj, t);
needinfo = await self.needinfoDao.model.findOne({
where: {id: needinfo.id}, raw: true
where: { id: needinfo.id }, raw: true
});
return system.getResultSuccess({needinfo: needinfo, needsolution: od});
return system.getResultSuccess({ needinfo: needinfo, needsolution: od });
} else {
return system.getResultFail(-302, "提交方案失败");
}
......@@ -286,16 +290,15 @@ class BaseQcService {
return system.getResultFail(-101, "订单号不能为空");
}
var ns = await this.needsolutionDao.model.findOne({
where: {orderNo: ab.orderNo}, raw: true
where: { orderNo: ab.orderNo }, raw: true
});
if (!ns || !ns.id) {
return system.getResultFail(-301, "未知方案");
}
ab["BizId"] = ns.channelSolutionNo;
pobj.actionBody = ab;
return await this.submitIcpMaterial(pobj);
return this.submitIcpMaterial(pobj);
}
//提交icp材料信息
async submitIcpMaterial(pobj) {
var ab = pobj.actionBody;
......@@ -314,7 +317,7 @@ class BaseQcService {
//获取方案信息
var needsolutioninfo = await this.needsolutionDao.model.findOne({
attributes: ["id", "needNo", "orderNo", "solutionContent"],
where: {channelSolutionNo: ab.BizId, isInvalid: 0}, raw: true
where: { channelSolutionNo: ab.BizId, isInvalid: 0 }, raw: true
});
console.log('needsolutioninfo+++', needsolutioninfo)
if (!needsolutioninfo || !needsolutioninfo.id) {
......@@ -340,6 +343,30 @@ class BaseQcService {
break;
}
}
//----
// var orderInfo = await this.orderinfoDao.model.findOne({
// attributes: ["uapp_id"],
// where: {orderNo: needsolutioninfo.orderNo}, raw: true
// })
// if(orderInfo){
// var uappId = orderInfo.uapp_id
// }
// if(uappId == "18"){//ali
// if (solutionContent.status != "USER_UPLOADED") {
// return system.getResultFail(-403, "用户未上传材料,不能执行此操作");
// }
// }
//获取需求信息
// 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") {
// if (needinfo.status == "ygb") {
// return system.getResultFail(-202, "该方案需求状态为" + needinfo.statusName + ",不能执行此操作");
// }
var material = ab.material;
if (!material.Domain) {
return system.getResultFail(-101, "备案域名不能为空");
......@@ -360,9 +387,7 @@ class BaseQcService {
solutionContent.material = ab.material;
var solutionFlowList = solutionContent.solutionFlowList || [];
solutionFlowList.push({
status: "MATERIAL_UNCONFIRM",
statusName: this.icpSolutionStatusReference.MATERIAL_UNCONFIRM,
updated_at: new Date()
status: "MATERIAL_UNCONFIRM", statusName: this.icpSolutionStatusReference.MATERIAL_UNCONFIRM, updated_at: new Date()
});
solutionContent.status = "MATERIAL_UNCONFIRM";
solutionContent.statusName = this.icpSolutionStatusReference.MATERIAL_UNCONFIRM;
......@@ -371,11 +396,11 @@ class BaseQcService {
return await this.needsolutionDao.db.transaction(async function (t) {
await self.needsolutionDao.update(needsolutioninfo, t);
var new_needsolutioninfo = await self.needsolutionDao.model.findOne({
where: {id: needsolutioninfo.id}, raw: true
where: { id: needsolutioninfo.id }, raw: true
});
//2020-10-27 laolan start
var orderInfo = await self.orderinfoDao.model.findOne({
where: {orderNo: ab.orderNo}, raw: true
where: { orderNo: ab.orderNo }, raw: true
})
if (orderInfo) {
var uappIds = orderInfo.uapp_id;
......@@ -389,16 +414,9 @@ class BaseQcService {
})
}
//交付商通知状态变更
async serviceProviderNotification(pobj) {
let ab = pobj.actionBody;
if (!pobj.userInfo || !pobj.userInfo.id) {
return system.getResultFail(-100, "未知用户");
}
if (!ab.ApplicationStatus) {
return system.getResultFail(-102, "通知状态不能为空");
}
var ab = pobj.actionBody;
if (!ab.orderNo) {
return system.getResultFail(-101, "订单号不能为空");
}
......@@ -420,29 +438,49 @@ class BaseQcService {
if (ab.certificateEndTime) {
ab["CertificateEndTime"] = ab.certificateEndTime;
}
var ns = await this.needsolutionDao.model.findOne({
where: { orderNo: ab.orderNo }, raw: true
});
if (!ns || !ns.id) {
return system.getResultFail(-301, "未知方案");
}
ab["BizId"] = ns.channelSolutionNo;
ab["solutionNo"] = ns.solutionNo;
pobj.actionBody = ab;
return this.acceptIcpPartnerNotification(pobj);
}
//服务商通知状态变更
async acceptIcpPartnerNotification(pobj) {
let self = this;
let ab = pobj.actionBody;
let needSolutionWhere = {};
if (ab.solutionNo) {
needSolutionWhere = {solutionNo: ab.solutionNo};
} else if (ab.orderNo) {
needSolutionWhere = {orderNo: ab.orderNo};
console.log('服务商通知状态变更pobj++++', 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.solutionNo) {
return system.getResultFail(-101, "方案编号不能为空");
}
if (!ab.ApplicationStatus) {
return system.getResultFail(-102, "通知状态不能为空");
}
//获取方案信息
let needsolutioninfo = await this.needsolutionDao.model.findOne({
attributes: ["id", "status", "solutionContent", "needNo", "channelNeedNo"],
where: needSolutionWhere, raw: true
var needsolutioninfo = await this.needsolutionDao.model.findOne({
attributes: ["id", "status", "solutionContent", "needNo","channelNeedNo"],
where: { solutionNo: ab.solutionNo }, raw: true
});
if (!needsolutioninfo || !needsolutioninfo.id) {
return system.getResultFail(-400, "未知方案");
}
let solutionContent = needsolutioninfo.solutionContent;
// if (!needsolutioninfo.needNo) {
// return system.getResultFail(-401, "方案需求信息有误");
// }
var solutionContent = needsolutioninfo.solutionContent;
if (!solutionContent) {
return system.getResultFail(-402, "方案交付信息有误");
}
......@@ -452,19 +490,43 @@ class BaseQcService {
if (solutionContent.ApplicationStatus && solutionContent.ApplicationStatus == ab.ApplicationStatus) {
return system.getResultFail(-405, "操作失败,该流程状态已提交,不能重复提交");
}
let solutionFlowList = solutionContent.solutionFlowList || [];
let orderInfo = await this.orderinfoDao.model.findOne({
attributes: ["uapp_id", "channelOrderNo"],
where: {orderNo: ab.orderNo}, raw: true
//获取需求信息
// 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") {
// if (needinfo.status == "ygb") {
// return system.getResultFail(-202, "serviceProviderSubmitMateria" + needinfo.statusName + ",不能执行此操作");
// }
var solutionFlowList = solutionContent.solutionFlowList || [];
var orderuappId = await this.orderinfoDao.model.findOne({
attributes: ["uapp_id"],
where: { orderNo: ab.orderNo }, raw: true
})
if (!orderInfo || !orderInfo.channelOrderNo) {
return system.getResultFail(-406, "未知订单");
console.log("orderuappId+++", orderuappId)
if (orderuappId) {
var uappId = orderuappId.uapp_id;
}
if (uappId != '50') {
// if (!needsolutioninfo.channelNeedNo) {
// return system.getResultFail(-401, "方案需求信息有误");
// }
// //获取需求信息
// var needinfo = await this.needinfoDao.model.findOne({
// where: { channelNeedNo: needsolutioninfo.channelNeedNo }, raw: true
// });
// if (!needinfo || !needinfo.id) {
// return system.getResultFail(-201, "未知需求信息");
// }
// if (needinfo.status == "ygb") {
// return system.getResultFail(-202, "serviceProviderSubmitMateria" + needinfo.statusName + ",不能执行此操作");
// }
}
let uapp_id = orderInfo.uapp_id;
let channelOrderNo = orderInfo.channelOrderNo
if (ab.ApplicationStatus == 507) {//完成账户注册
if (uapp_id == '18') {
if (uappId == '18') {
if (solutionContent.status != "USER_CONFIRMED") {
return system.getResultFail(-508, "交付流程错误,用户确认递交⽂件后才能执行此操作");
}
......@@ -472,9 +534,7 @@ class BaseQcService {
solutionContent.ApplicationStatus = 507;
solutionFlowList.push({
file: ab.OfficialFileURL || "",
status: "ACCOUNT_REGISTERED",
statusName: this.icpSolutionStatusReference.ACCOUNT_REGISTERED,
updated_at: new Date()
status: "ACCOUNT_REGISTERED", statusName: this.icpSolutionStatusReference.ACCOUNT_REGISTERED, updated_at: new Date()
});
solutionContent.status = "ACCOUNT_REGISTERED";
solutionContent.statusName = this.icpSolutionStatusReference.ACCOUNT_REGISTERED;
......@@ -485,9 +545,7 @@ class BaseQcService {
}
solutionFlowList.push({
file: ab.OfficialFileURL || "",
status: "MATERIAL_SUBMITTED",
statusName: this.icpSolutionStatusReference.MATERIAL_SUBMITTED,
updated_at: new Date()
status: "MATERIAL_SUBMITTED", statusName: this.icpSolutionStatusReference.MATERIAL_SUBMITTED, updated_at: new Date()
});
solutionContent.status = "MATERIAL_SUBMITTED";
solutionContent.statusName = this.icpSolutionStatusReference.MATERIAL_SUBMITTED;
......@@ -519,20 +577,18 @@ class BaseQcService {
if (solutionContent.status != "GXB_ACCEPT") {
return system.getResultFail(-511, "交付流程错误,⼯信部已受理后才能执行此操作");
}
if (uapp_id == "18") {
if(uappId == "18"){
solutionFlowList.push({
file: ab.OfficialFileURL || "", status: "GXB_SUCCESS",
statusName: this.icpSolutionStatusReference.GXB_SUCCESS, updated_at: new Date(),
CertificateNumber: ab.CertificateNumber,
CertificateStartTime: ab.CertificateStartTime,
CertificateEndTime: ab.CertificateEndTime
CertificateNumber:ab.CertificateNumber,
CertificateStartTime:ab.CertificateStartTime,
CertificateEndTime:ab.CertificateEndTime
});
} else {
}else{
solutionFlowList.push({
file: ab.OfficialFileURL || "",
status: "GXB_SUCCESS",
statusName: this.icpSolutionStatusReference.GXB_SUCCESS,
updated_at: new Date()
status: "GXB_SUCCESS", statusName: this.icpSolutionStatusReference.GXB_SUCCESS, updated_at: new Date()
});
}
needsolutioninfo.status = "ywc";
......@@ -551,25 +607,21 @@ class BaseQcService {
needsolutioninfo.status = "ywc";
solutionContent.statusName = this.icpSolutionStatusReference.GXB_FAIL;
}
solutionContent.solutionFlowList = solutionFlowList;
//返回状态
let statusObj = {};
let applicationStatusList = solutionContent.applicationStatusList || [];
if (uapp_id == "18") {
statusObj = {
var applicationStatusList = solutionContent.applicationStatusList || [];
if(uappId == "18"){
var statusObj = {
"OfficialFileURL": ab.OfficialFileURL || "",
"ApplicationStatus": ab.ApplicationStatus,
"ApplicationStatusName": this.icpApplicationStatusReference[ab.ApplicationStatus],
"created_at": new Date(),
//2021-3-18 addNew
"CertificateNumber": ab.CertificateNumber || "",//证书编号
"CertificateStartTime": ab.CertificateStartTime || "",//证书有效期 开始时间
"CertificateEndTime": ab.CertificateEndTime || ""//证书有效期 结束时间
"CertificateNumber":ab.CertificateNumber || "",//证书编号
"CertificateStartTime":ab.CertificateStartTime || "",//证书有效期 开始时间
"CertificateEndTime":ab.CertificateEndTime || ""//证书有效期 结束时间
};
} else {
statusObj = {
}else{
var statusObj = {
"OfficialFileURL": ab.OfficialFileURL || "",
"ApplicationStatus": ab.ApplicationStatus,
"ApplicationStatusName": this.icpApplicationStatusReference[ab.ApplicationStatus],
......@@ -581,13 +633,24 @@ class BaseQcService {
solutionContent.applicationStatus = ab.ApplicationStatus;
needsolutioninfo.solutionContent = JSON.stringify(solutionContent);
console.log("ab.orderNo+++", ab.orderNo)
var self = this;
var orderInfo = await self.orderinfoDao.model.findOne({
attributes: ["channelOrderNo"],
where: { orderNo: ab.orderNo }, raw: true
})
console.log("orderInfo+++", orderInfo)
if (orderInfo) {
var channelOrderNo = orderInfo.channelOrderNo
}
return await this.needsolutionDao.db.transaction(async function (t) {
await self.needsolutionDao.update(needsolutioninfo, t);
statusObj["BizId"] = needsolutioninfo.channelSolutionNo;
statusObj["solutionNo"] = needsolutioninfo.solutionNo;
statusObj["material"] = solutionContent;
statusObj["uapp_id"] = uapp_id;
statusObj["BizId"] = ab.BizId;
//2020-10-27 laolan start
statusObj['uapp_id'] = uappId;
statusObj['channelOrderNo'] = channelOrderNo;
console.log('statusObj++', statusObj)
//2020-10-27 laolan start
return system.getResultSuccess(statusObj);
})
}
......@@ -610,7 +673,6 @@ class BaseQcService {
var timStr = moment().format("YYYYMMDDHHmm");
return prefix + timStr + uidStr;
}
/*
len:返回长度
radix:参与计算的长度,最大为62
......@@ -635,6 +697,6 @@ class BaseQcService {
return uuid.join('');
}
}
module.exports = BaseQcService;
}
module.exports = BaseQcService;
\ No newline at end of file
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