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;
......
......@@ -54,6 +54,7 @@ class OrderInfoDao extends Dao {
const sql = "INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUE('" +
orderNo + "','" + JSON.stringify(data) + "')";
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 ;
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,6 +680,7 @@ class AliyunQcService {
// return system.getResultFail(-103, "该方案状态为" + ns.statusName + ",不能执行此操作");
// }
var solutionContent = ns.solutionContent;
if (!ab.bizId.startsWith("TM_")) {//非商标
var checkStatus = {
ACCOUNT_REGISTERED: "完成账户注册", MATERIAL_SUBMITTED: "完成资料递交",
GXB_ACCEPT: "⼯信部已受理", GXB_REFUSE: "⼯信部不予受理", GXB_FAIL: "⼯信部未通过", GXB_SUCCESS: "工信部通过"
......@@ -691,11 +692,11 @@ class AliyunQcService {
//方案流程列表
var solutionFlowList = solutionContent.solutionFlowList || [];
if (ab.status == "1") {//⽤户已支付
var afterStatusList=[//用户支付后的流程状态
var afterStatusList = [//用户支付后的流程状态
"USER_UPLOADED", "MATERIAL_UNCONFIRM", "USER_CONFIRMED", "ACCOUNT_REGISTERED",
"MATERIAL_SUBMITTED","GXB_ACCEPT","GXB_REFUSE","GXB_FAIL","GXB_SUCCESS","CLOSE"
"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()
});
......@@ -766,6 +767,9 @@ class AliyunQcService {
}
solutionContent.customerMaterial = material;
solutionContent = JSON.stringify(solutionContent);
}else {
solutionContent.status = ab.status
}
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