Commit b4104a53 by 宋毅

增加订单推送修改状态

parent e66d70cf
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/center-order.iml" filepath="$PROJECT_DIR$/.idea/center-order.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
\ No newline at end of file
var APIBase = require("../../api.base"); var APIBase = require("../../api.base");
var system = require("../../../system"); var system = require("../../../system");
var settings = require("../../../../config/settings"); var settings = require("../../../../config/settings");
class OrderAPI extends APIBase { class OrderAPI extends APIBase {
constructor() { constructor() {
super(); super();
this.orderinfoSve = system.getObject("service.dbcorder.orderinfoSve"); this.orderinfoSve = system.getObject("service.dbcorder.orderinfoSve");
} }
/** /**
* 接口跳转-POST请求 * 接口跳转-POST请求
* action_process 执行的流程 * action_process 执行的流程
* action_type 执行的类型 * action_type 执行的类型
* action_body 执行的参数 * action_body 执行的参数
*/ */
async springBoard(pobj, qobj, req) { async springBoard(pobj, qobj, req) {
// if (!pobj.userInfo) { // if (!pobj.userInfo) {
// return system.getResultFail(system.noLogin, "user no login!"); // return system.getResultFail(system.noLogin, "user no login!");
...@@ -22,9 +24,13 @@ class OrderAPI extends APIBase { ...@@ -22,9 +24,13 @@ class OrderAPI extends APIBase {
var result = await this.opActionProcess(pobj, pobj.actionType, req); var result = await this.opActionProcess(pobj, pobj.actionType, req);
return result; return result;
} }
async opActionProcess(pobj, action_type, req) { async opActionProcess(pobj, action_type, req) {
var opResult = null; var opResult = null;
switch (action_type) { switch (action_type) {
case "updateOrderPushStatus"://更新订单推送状态
opResult = await this.orderinfoSve.updateOrderPushStatus(pobj.actionBody);
break;
case "addOrder"://创建订单 case "addOrder"://创建订单
this.execClientNew.execLogs("center-order-addOrder-info-1:" + req.path, pobj, "center-order-doexecMethod", null, null); this.execClientNew.execLogs("center-order-addOrder-info-1:" + req.path, pobj, "center-order-doexecMethod", null, null);
opResult = await this.addOrder(pobj, pobj.actionBody); opResult = await this.addOrder(pobj, pobj.actionBody);
...@@ -98,7 +104,7 @@ class OrderAPI extends APIBase { ...@@ -98,7 +104,7 @@ class OrderAPI extends APIBase {
opResult = await this.orderinfoSve.tmConfirm(pobj); opResult = await this.orderinfoSve.tmConfirm(pobj);
break; break;
case "bulkCreateOrders": case "bulkCreateOrders":
opResult = await this.orderinfoSve.bulkCreateOrders(pobj,req); opResult = await this.orderinfoSve.bulkCreateOrders(pobj, req);
break; break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
...@@ -146,6 +152,7 @@ class OrderAPI extends APIBase { ...@@ -146,6 +152,7 @@ class OrderAPI extends APIBase {
var refOpResult = await this.reflexAction(interface_info, pobj); var refOpResult = await this.reflexAction(interface_info, pobj);
return refOpResult; return refOpResult;
} }
async reflexAction(interface_info, pobj) { async reflexAction(interface_info, pobj) {
var refResult = null; var refResult = null;
pobj.interface_params = interface_info.params; pobj.interface_params = interface_info.params;
...@@ -160,12 +167,12 @@ class OrderAPI extends APIBase { ...@@ -160,12 +167,12 @@ class OrderAPI extends APIBase {
var params = [pobj]; var params = [pobj];
this.execClientNew.execLogs("center-order-addOrder-reflexAction-info-2:", params, "center-order-doexecMethod", null, null); this.execClientNew.execLogs("center-order-addOrder-reflexAction-info-2:", params, "center-order-doexecMethod", null, null);
refResult = await invokeObj[interface_info.method_name].apply(invokeObj, params); refResult = await invokeObj[interface_info.method_name].apply(invokeObj, params);
} } else if (interface_info.interface_type == "yc") {
else if (interface_info.interface_type == "yc") {
} }
return refResult; return refResult;
} }
} }
module.exports = OrderAPI; module.exports = OrderAPI;
\ No newline at end of file
...@@ -6,6 +6,7 @@ class TaskAction extends APIBase { ...@@ -6,6 +6,7 @@ class TaskAction extends APIBase {
super(); super();
this.orderinfoSve = system.getObject("service.dbcorder.orderinfoSve"); this.orderinfoSve = system.getObject("service.dbcorder.orderinfoSve");
this.opneedinfoSve = system.getObject("service.dbneed.opneedinfoSve"); this.opneedinfoSve = system.getObject("service.dbneed.opneedinfoSve");
this.orderproductSve = system.getObject("service.dbcorder.orderproductSve");
} }
/** /**
* 接口跳转-POST请求 * 接口跳转-POST请求
...@@ -18,5 +19,10 @@ class TaskAction extends APIBase { ...@@ -18,5 +19,10 @@ class TaskAction extends APIBase {
return result; return result;
} }
async taskProduct(pobj, qobj, req) {
var result = await this.orderproductSve.syncProductData();
return result;
}
} }
module.exports = TaskAction; module.exports = TaskAction;
\ No newline at end of file
...@@ -35,5 +35,48 @@ class OrderProductDao extends Dao { ...@@ -35,5 +35,48 @@ class OrderProductDao extends Dao {
raw: true raw: true
}); });
} }
/**
* 根据ids 获取需求
* @param ids
* @returns {Promise<void>}
*/
async getNeedsByIds(ids){
let needs = await this.findAll({
where: {
channelNeedNo: {
[Op.in]:ids
}
},
attributes: [
"id",
"uapp_id",
"needNo",
"channelNeedNo",
"channelUserId",
"followManUserId",
"followManMobile",
"city",
"province",
"publishContent",
"publishName",
"publishMobile",
"notes",
"followContent",
"disposeNotes",
"status",
"typeCode",
"typeName",
"channelTypeCode",
"channelTypeName",
"publisherOnlyCode",
"followManName",
"followManOnlyCode",
"created_at"
],
raw: true
})
return needs;
}
} }
module.exports = OrderProductDao; module.exports = OrderProductDao;
...@@ -70,7 +70,7 @@ module.exports = { ...@@ -70,7 +70,7 @@ 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": "待确认", "ybh": "用户驳回", "ywc": "已完成", "yzf": "已作废" }, "solution_status": { "dqr": "待确认", "ybh": "用户驳回", "ywc": "已完成", "yzf": "已作废" },
......
This source diff could not be displayed because it is too large. You can view the blob instead.
const System = require("../../../system");
const system = require("../../../system"); const system = require("../../../system");
const Dao = require("../../dao.base"); const ServiceBase = require("../../sve.base");
class OrderProductService extends ServiceBase { class OrderProductService extends ServiceBase {
constructor() { constructor() {
super("dbcorder", ServiceBase.getDaoName(OrderProductService)); super("dbcorder", ServiceBase.getDaoName(OrderProductService));
} }
async syncProductData() {
let sql = "SELECT * FROM `c_order_product_fq` LIMIT 300";
var list = await this.customQuery(sql);
if (!result || result.length == 0) {
return system.getResultFail(-1, "暂无数据要进行处理")
}
let sourceOrderNoList = list.map((item) => { return item.sourceOrderNo });
//根据ids 获取企服通需求
let needs = await this.needinfoDao.getNeedsByIds(sourceOrderNoList);
for (let index = 0; index < result.length; index++) {
const element = result[index];
if (element) {
}
}
}
} }
module.exports = OrderProductService; module.exports = OrderProductService;
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