Commit fe5e8019 by linboxuan

pull order

parents 12c8c62e b4867ca2
......@@ -33,6 +33,9 @@ class IcAPI extends APIBase {
case "submitNeed"://提交需求
opResult = await this.needinfoSve.submitNeed(pobj, pobj.actionBody, req);
break;
case "submitNeedH5"://工商H5提交需求
opResult = await this.needinfoSve.submitNeedH5(pobj, pobj.actionBody, req);
break;
case "getItemByNeedNo"://获取需求详情
opResult = await this.needinfoSve.getItemByNeedNo(pobj);
break;
......
......@@ -22,6 +22,7 @@ module.exports = (db, DataTypes) => {
quantity :DataTypes.INTEGER,// 订单数量(即产品的倍数,默认值为1)
opPayType :DataTypes.STRING(10),// 操作付款类型:00: 创建订单, 10: 补单
serviceItemSnapshot :DataTypes.TEXT('long'), //产品快照
orderSnapshot :DataTypes.TEXT('long') //订单快照
}, {
paranoid: true,//假的删除
underscored: true,
......
......@@ -93,6 +93,49 @@ class NeedinfoService extends ServiceBase {
return system.getResultSuccess();
}
/**
* 工商H5 免费咨询
* @param pobj
* @param actionBody
* @param req
* @returns {Promise<{msg: *, data: *, status: *}|{msg: *, data: (*|null), status: number}>}
*/
async submitNeedH5(pobj, actionBody, req) {
var needNo = await this.getBusUid("n");
var channelNeedNo = await this.getBusUid("i");
if (!actionBody.mobile) {
return system.getResultFail(-5002, "mobile不能为空");
}
if (!actionBody.type) {
return system.getResultFail(-5003, "type不能为空");
}
var ninfo = await this.findOne({ channelNeedNo: actionBody.intentionBizId });
if (ninfo) {
return system.getResultSuccess();
}
var nobj = {
uapp_id: pobj.appInfo.uapp_id,
channelNeedNo: channelNeedNo,
needNo: needNo,
channelUserId: actionBody.mobile,
publishName: actionBody.userName,
publishContent: actionBody.description,
publishMobile: actionBody.mobile,
city: actionBody.area,
typeCode: actionBody.type_code,
typeName: actionBody.type_name,
channelTypeCode: actionBody.channel_type_code,
channelTypeName: actionBody.channel_type_name,
status: "wts"
}
if(nobj.channelTypeCode==7||nobj.channelTypeCode==5){
nobj.province=nobj.city,
nobj.city="";
}
await this.dao.create(nobj);
return system.getResultSuccess();
}
async needClose(pobj, actionBody, req) {
if (!actionBody.intentionBizId) {
return system.getResultFail(-5005, "intentionBizId不能为空");
......
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