Commit 9ee85bb8 by 高宇强

gyq

parent bf74e640
......@@ -117,7 +117,22 @@ class BizOptCtl extends CtlBase {
}
}
/*插入数据信息 */
async insertInfo(pobj,qobj,req){
if (pobj.businessMode && pobj.businessMode != 'undefined' && pobj.businessType && pobj.businessType != 'undefined'){
try{
await this.service.insertInfo(pobj);
return system.getResult("插入成功!");
}
catch(error){
return system.getResultError(error);
}
}
else{
return system.getResultError("参数错误!");
}
}
timeFormat(date) {
let localTime = moment.utc(date).toDate();
......
......@@ -37,7 +37,51 @@ class BizoptDao extends Dao {
/*插入商机信息*/
async insertInfo(qobj,t){
var obj = {
"demand_code":qobj.businessMode,
"business_type":qobj.businessType,
"business_status":"beforeSubmission"
};
if (qobj.channelSource && qobj.channelSource != 'undefined'){
obj.source_name = qobj.channelSource;
}
if (qobj.sourceNumber && qobj.sourceNumber != 'undefined'){
obj.source_number = qobj.sourceNumber;
}
if (qobj.serviceCode && qobj.serviceCode != 'undefined'){
obj.service_address = qobj.serviceCode;
}
if (qobj.memoInfo && qobj.memoInfo != 'undefined'){
obj.business_info.memoInfo = qobj.memoInfo;
}
if (qobj.statusReason && qobj.statusReason != 'undefined'){
obj.close_reason = qobj.statusReason;
}
if (qobj.contactsName && qobj.contactsName != 'undefined'){
obj.business_info.contactsName = qobj.contactsName;
}
if (qobj.contactsPhone && qobj.contactsPhone != 'undefined'){
obj.business_info.contactsPhone = qobj.contactsPhone;
}
if (qobj.servicerCode && qobj.servicerCode != 'undefined'){
obj.facilitator_id = qobj.servicerCode;
}
if (qobj.servicerName && qobj.servicerName != 'undefined'){
obj.facilitator_name = qobj.servicerName;
}
if (qobj.salesmanOpcode && qobj.salesmanOpcode != 'undefined'){
obj.salesman_opcode = qobj.salesmanOpcode;
}
if (qobj.salesmanId && qobj.salesmanId != 'undefined'){
obj.salesman_id = qobj.salesmanId;
}
if (qobj.clerkName && qobj.clerkName != 'undefined'){
obj.salesman_name = qobj.clerkName;
}
if (qobj.clerkPhone && qobj.clerkPhone != 'undefined'){
obj.salesman_phone = qobj.salesman_phone;
}
return await this.create(obj,t);
}
......
......@@ -11,7 +11,7 @@ class DeliverybillDao extends Dao {
[this.db.Op.notIn]: ["ICP", "EDI"]
}
if(qobj.bizpath && qobj.bizpath!=""){
if(qobj.bizpath.indexOf("myChance")>0){//说明是从商机列表过来的
if(qobj.bizpath.indexOf("myDeliver")>0){//说明是从商机列表过来的
qw["salesman_id"]=qobj.userid;
}
}
......@@ -56,6 +56,9 @@ class DeliverybillDao extends Dao {
if (qobj.channelNumber && qobj.channelNumber != 'undefined'){
obj.source_number = qobj.channelNumber;
}
if (qobj.skuCode && qobj.skuCode != 'undefined'){
obj.sku_code = qobj.skuCode;
}
if (qobj.serviceCode && qobj.serviceCode != 'undefined'){
obj.service_address = qobj.serviceCode;
}
......
......@@ -22,6 +22,10 @@ module.exports = (db, DataTypes) => {
allowNull: true,
type: DataTypes.STRING
},
sku_code: {// sku编码
allowNull: true,
type: DataTypes.STRING
},
scheme_number: {// 方案编号
allowNull: true,
type: DataTypes.STRING
......
......@@ -25,5 +25,13 @@ class BizOptService extends ServiceBase {
});
}
/*插入商机信息*/
async insertInfo(qobj){
var self=this;
return self.db.transaction(async function (t) {
return await self.dao.insertInfo(qobj,t);
});
}
}
module.exports = BizOptService;
\ No newline at end of file
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