Commit ae5df8dc by 王悦

专家辅助注册

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