Commit ae5df8dc by 王悦

专家辅助注册

parent 4f9149f5
......@@ -6,6 +6,8 @@ class tmreview extends APIBase{
constructor() {
super();
this.orderDeliverSve = system.getObject("service.dbcorder.orderdeliverSve");
this.orderinfoSve = system.getObject("service.dbcorder.orderinfoSve");
this.needsolutionSve = system.getObject("service.dbneed.needsolutionSve");
}
async springBoard(pobj, qobj, req) {
......@@ -31,6 +33,9 @@ class tmreview extends APIBase{
case "getOfficalList":
opResult = await this.orderDeliverSve.getOfficialList(pobj,pobj.actionBody)
break;
case "addOrderDelivery":
opResult = await this.needsolutionSve.addOrderDelivery(pobj)
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
......@@ -53,7 +53,8 @@ class OrderInfoDao extends Dao {
async addOrderDelivery(data, orderNo, t) {//新增交付信息
const sql = "INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUE('" +
orderNo + "','" + JSON.stringify(data) + "')";
await this.customInsert(sql, null, t);
await this.customInsert(sql, null, t);
return system.getResultSuccess()
}
}
module.exports = OrderInfoDao;
......@@ -207,7 +207,7 @@ class OrderInfoService extends ServiceBase {
* @param data
* @param orderNo
*/
addOrderDelivery(data, orderNo, t) {
async addOrderDelivery(data, orderNo, t) {
try {
var sql = "INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUE('" +
orderNo + "','" + JSON.stringify(data) + "')";
......
......@@ -188,10 +188,12 @@ class NeedinfoService extends ServiceBase {
return system.getResult(null, "需求数据为空,30210");
}
// fixme 阿里直购需要更改
item.solutionProvince = solutionitem.solutionContent.solution.Area || solutionitem.solutionContent.solution.area ;
//item.solutionProvince = solutionitem.solutionContent.solution.Area + `(${solutionitem.solutionContent.solution.actionType})`//北京(新办);
item.solutionContent = solutionitem.solutionContent
item.channelSolutionNo = solutionitem.channelSolutionNo
if (!pobj.actionBody.bizId.startsWith("TM_")) {//商标不需要
item.solutionProvince = solutionitem.solutionContent.solution.Area || solutionitem.solutionContent.solution.area;
//item.solutionProvince = solutionitem.solutionContent.solution.Area + `(${solutionitem.solutionContent.solution.actionType})`//北京(新办);
item.solutionContent = solutionitem.solutionContent
item.channelSolutionNo = solutionitem.channelSolutionNo
}
return system.getResultSuccess(item);
}
......
......@@ -1334,6 +1334,33 @@ class NeedsolutionService extends ServiceBase {
let ns = await this.dao.create(newNsObj);
return system.getResultSuccess(ns)
}
async addOrderDelivery(pobj){
let ab = pobj.actionBody;
let app = pobj.appInfo;
if (!app || !app.uapp_id) {
return system.getResultFail(-100, "未知渠道");
}
if (!ab.BizId) {
return system.getResultFail(-101, "渠道方案编号不能为空");
}
var needinfo = await this.needinfoDao.model.findOne({
where: { channelNeedNo: ab.bizId }, raw: true
});
if (!needinfo || !needinfo.id) {
return system.getResultFail(-102, "未知需求信息");
}
let newNsObj={
orderNo:ab.serviceOrderNo,
channelSolutionNo:ab.BizId,
solutionNo:ab.BizId,
needNo:needinfo.needNo,
channelNeedNo:ab.IntentionBizId,
status:"ywc"
};
newNsObj.solutionContent = JSON.stringify(ab);
let ns = await this.dao.create(newNsObj);
return system.getResultSuccess(ns)
}
}
module.exports = NeedsolutionService;
// var task = new NeedsolutionService();
......
......@@ -680,92 +680,96 @@ class AliyunQcService {
// return system.getResultFail(-103, "该方案状态为" + ns.statusName + ",不能执行此操作");
// }
var solutionContent = ns.solutionContent;
var checkStatus = {
ACCOUNT_REGISTERED: "完成账户注册", MATERIAL_SUBMITTED: "完成资料递交",
GXB_ACCEPT: "⼯信部已受理", GXB_REFUSE: "⼯信部不予受理", GXB_FAIL: "⼯信部未通过", GXB_SUCCESS: "工信部通过"
, CLOSE: "方案关闭"
};
if (solutionContent.status && checkStatus[solutionContent.status]) {
return system.getResultFail(-111, "方案已进入" + solutionContent.statusName + "流程,不能执行此操作");
}
//方案流程列表
var solutionFlowList = solutionContent.solutionFlowList || [];
if (ab.status == "1") {//⽤户已支付
var afterStatusList=[//用户支付后的流程状态
"USER_UPLOADED", "MATERIAL_UNCONFIRM", "USER_CONFIRMED", "ACCOUNT_REGISTERED",
"MATERIAL_SUBMITTED","GXB_ACCEPT","GXB_REFUSE","GXB_FAIL","GXB_SUCCESS","CLOSE"
];
if(!solutionContent.status || afterStatusList.indexOf(solutionContent.status)<0){
if (!ab.bizId.startsWith("TM_")) {//非商标
var checkStatus = {
ACCOUNT_REGISTERED: "完成账户注册", MATERIAL_SUBMITTED: "完成资料递交",
GXB_ACCEPT: "⼯信部已受理", GXB_REFUSE: "⼯信部不予受理", GXB_FAIL: "⼯信部未通过", GXB_SUCCESS: "工信部通过"
, CLOSE: "方案关闭"
};
if (solutionContent.status && checkStatus[solutionContent.status]) {
return system.getResultFail(-111, "方案已进入" + solutionContent.statusName + "流程,不能执行此操作");
}
//方案流程列表
var solutionFlowList = solutionContent.solutionFlowList || [];
if (ab.status == "1") {//⽤户已支付
var afterStatusList = [//用户支付后的流程状态
"USER_UPLOADED", "MATERIAL_UNCONFIRM", "USER_CONFIRMED", "ACCOUNT_REGISTERED",
"MATERIAL_SUBMITTED", "GXB_ACCEPT", "GXB_REFUSE", "GXB_FAIL", "GXB_SUCCESS", "CLOSE"
];
if (!solutionContent.status || afterStatusList.indexOf(solutionContent.status) < 0) {
solutionFlowList.push({
status: "PAID", statusName: this.icpSolutionStatusReference.PAID, updated_at: new Date()
});
solutionContent.status = "PAID";
solutionContent.statusName = this.icpSolutionStatusReference.PAID;
}
// 2020 0826 lin修改 n_need_info status为ycd 已成单
let needObj = {
id: needinfo.id, status: "ycd"
}
await this.needinfoDao.update(needObj);//关闭需求
} else if (ab.status == "2") {//⽤户已上传
if (solutionContent.status == "USER_CONFIRMED") {//防止用户确认后又否决
return system.getResultFail(-112, "操作失败,⽤户已确认递交⽂件");
}
solutionFlowList.push({
status: "PAID", statusName: this.icpSolutionStatusReference.PAID, updated_at: new Date()
status: "USER_UPLOADED", statusName: this.icpSolutionStatusReference.USER_UPLOADED, updated_at: new Date()
});
solutionContent.status = "PAID";
solutionContent.statusName = this.icpSolutionStatusReference.PAID;
solutionContent.status = "USER_UPLOADED";
solutionContent.statusName = this.icpSolutionStatusReference.USER_UPLOADED;
} else if (ab.status == "4") {//⽤户已确认
if (solutionContent.status != "MATERIAL_UNCONFIRM") {
return system.getResultFail(-113, "操作失败,服务商递交⽂件后才能执行此操作");
}
solutionFlowList.push({
status: "USER_CONFIRMED", statusName: this.icpSolutionStatusReference.USER_CONFIRMED, updated_at: new Date()
});
solutionContent.status = "USER_CONFIRMED";
solutionContent.statusName = this.icpSolutionStatusReference.USER_CONFIRMED;
} else if (ab.status == "11") {//⽅案已关闭
solutionFlowList.push({
status: "CLOSE", statusName: this.icpSolutionStatusReference.CLOSE, updated_at: new Date()
});
solutionContent.status = "CLOSE";
solutionContent.statusName = this.icpSolutionStatusReference.CLOSE;
} else {
return system.getResultFail(-110, "状态错误");
}
// 2020 0826 lin修改 n_need_info status为ycd 已成单
let needObj = {
id: needinfo.id, status: "ycd"
solutionContent.solutionFlowList = solutionFlowList;
var material = solutionContent.customerMaterial || {};
if (ab.remark) {
solutionContent.customerRemark = ab.remark;
}
await this.needinfoDao.update(needObj);//关闭需求
} else if (ab.status == "2") {//⽤户已上传
if (solutionContent.status == "USER_CONFIRMED") {//防止用户确认后又否决
return system.getResultFail(-112, "操作失败,⽤户已确认递交⽂件");
if (ab.newbusinessLicense) {
material.businessLicense = ab.newbusinessLicense;
material.aliBusinessLicense = ab.businessLicense;
}
solutionFlowList.push({
status: "USER_UPLOADED", statusName: this.icpSolutionStatusReference.USER_UPLOADED, updated_at: new Date()
});
solutionContent.status = "USER_UPLOADED";
solutionContent.statusName = this.icpSolutionStatusReference.USER_UPLOADED;
} else if (ab.status == "4") {//⽤户已确认
if (solutionContent.status != "MATERIAL_UNCONFIRM") {
return system.getResultFail(-113, "操作失败,服务商递交⽂件后才能执行此操作");
if (ab.newidCardUrlList && ab.newidCardUrlList.length > 0) {
material.idCardUrlList = ab.newidCardUrlList;
material.aliIdCardUrlList = ab.idCardUrlList;
}
solutionFlowList.push({
status: "USER_CONFIRMED", statusName: this.icpSolutionStatusReference.USER_CONFIRMED, updated_at: new Date()
});
solutionContent.status = "USER_CONFIRMED";
solutionContent.statusName = this.icpSolutionStatusReference.USER_CONFIRMED;
} else if (ab.status == "11") {//⽅案已关闭
solutionFlowList.push({
status: "CLOSE", statusName: this.icpSolutionStatusReference.CLOSE, updated_at: new Date()
});
solutionContent.status = "CLOSE";
solutionContent.statusName = this.icpSolutionStatusReference.CLOSE;
} else {
return system.getResultFail(-110, "状态错误");
}
solutionContent.solutionFlowList = solutionFlowList;
var material = solutionContent.customerMaterial || {};
if (ab.remark) {
solutionContent.customerRemark = ab.remark;
}
if (ab.newbusinessLicense) {
material.businessLicense = ab.newbusinessLicense;
material.aliBusinessLicense = ab.businessLicense;
}
if (ab.newidCardUrlList && ab.newidCardUrlList.length > 0) {
material.idCardUrlList = ab.newidCardUrlList;
material.aliIdCardUrlList = ab.idCardUrlList;
}
if (ab.newuserPlan) {
material.userPlan = ab.newuserPlan;
material.aliUserPlan = ab.userPlan;
}
if (ab.newuserForeig) {
material.userForeig = ab.newuserForeig;
material.aliUserForeig = ab.userForeig;
}
if (ab.newuserLaw) {
material.userLaw = ab.newuserLaw;
material.aliUserLaw = ab.userLaw;
}
if (ab.newuserOtherList && ab.newuserOtherList.length > 0) {
material.userOtherList = ab.newuserOtherList;
material.aliUserOtherList = ab.userOtherList;
if (ab.newuserPlan) {
material.userPlan = ab.newuserPlan;
material.aliUserPlan = ab.userPlan;
}
if (ab.newuserForeig) {
material.userForeig = ab.newuserForeig;
material.aliUserForeig = ab.userForeig;
}
if (ab.newuserLaw) {
material.userLaw = ab.newuserLaw;
material.aliUserLaw = ab.userLaw;
}
if (ab.newuserOtherList && ab.newuserOtherList.length > 0) {
material.userOtherList = ab.newuserOtherList;
material.aliUserOtherList = ab.userOtherList;
}
solutionContent.customerMaterial = material;
solutionContent = JSON.stringify(solutionContent);
}else {
solutionContent.status = ab.status
}
solutionContent.customerMaterial = material;
solutionContent = JSON.stringify(solutionContent);
var updateObj = {
id: ns.id, solutionContent: solutionContent
};
......@@ -836,7 +840,7 @@ class AliyunQcService {
solutionContent = JSON.stringify(solutionContent);
updateObj["solutionContent"] = solutionContent;
await this.needsolutionDao.update(updateObj);//方案状态修改
return system.getResultSuccess();
return system.getResultSuccess(needinfo);
}
//接收方案编号(方案推送至阿里后,接收保存方案信息)
async receiveProgrammeNo(pobj) {
......
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