Commit ab65226e by 宋毅

Merge branch 'igirl-channel' of gitlab.gongsibao.com:jiangyong/zhichan into igirl-channel

parents 9b14d4bf c093e63f
...@@ -46,8 +46,8 @@ class ReceiveDataAPI extends APIBase { ...@@ -46,8 +46,8 @@ class ReceiveDataAPI extends APIBase {
async opActionProcess(action_process, action_type, action_body, pobj, req) { async opActionProcess(action_process, action_type, action_body, pobj, req) {
// action_body.app = req.app; // action_body.app = req.app;
// action_body.user = req.user; // action_body.user = req.user;
action_body.app = { id: 1, appPayType: "00", appDataOpType: "00" }; // action_body.app = { id: 1, appPayType: "00", appDataOpType: "00" };
action_body.user = { id: 1, app_id: 1, nickname: "测试用户",channelUserId:"channelUserIdtest01" }; // action_body.user = { id: 1, app_id: 1, nickname: "测试用户",channelUserId:"channelUserIdtest01" };
var opResult = null; var opResult = null;
switch (action_type) { switch (action_type) {
// sy // sy
...@@ -61,7 +61,8 @@ class ReceiveDataAPI extends APIBase { ...@@ -61,7 +61,8 @@ class ReceiveDataAPI extends APIBase {
opResult = await this.ordertmproductSve.addAssistTm(action_body); opResult = await this.ordertmproductSve.addAssistTm(action_body);
break; break;
case "assistEditTmData"://接收辅助注册修改商标数据 case "assistEditTmData"://接收辅助注册修改商标数据
opResult = system.getResultSuccess(null, "测试成功"); // opResult = system.getResultSuccess(null, "测试成功");
opResult = await this.ordertmproductSve.editAssistTm(action_body);
break; break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
......
...@@ -39,7 +39,7 @@ module.exports = (db, DataTypes) => { ...@@ -39,7 +39,7 @@ module.exports = (db, DataTypes) => {
nclCount :DataTypes.INTEGER, // 尼斯数量 nclCount :DataTypes.INTEGER, // 尼斯数量
nclPublicExpense :DataTypes.DECIMAL(12, 2), // 尼斯官费总额 nclPublicExpense :DataTypes.DECIMAL(12, 2), // 尼斯官费总额
}, { }, {
paranoid: false,//假的删除 paranoid: true,//假的删除
underscored: true, underscored: true,
version: true, version: true,
freezeTableName: true, freezeTableName: true,
......
...@@ -15,6 +15,7 @@ class OrderTmProductService extends ServiceBase { ...@@ -15,6 +15,7 @@ class OrderTmProductService extends ServiceBase {
this.receiptvoucherDao = system.getObject("db.dborder.receiptvoucherDao"); this.receiptvoucherDao = system.getObject("db.dborder.receiptvoucherDao");
this.tmofficialDao = system.getObject("db.dbtrademark.tmofficialDao"); this.tmofficialDao = system.getObject("db.dbtrademark.tmofficialDao");
this.userDao = system.getObject("db.dbapp.appuserDao"); this.userDao = system.getObject("db.dbapp.appuserDao");
this.appDao = system.getObject("db.dbapp.appDao");
} }
//------------------------------------------创建订单-------------------开始------------------------- //------------------------------------------创建订单-------------------开始-------------------------
...@@ -598,8 +599,6 @@ class OrderTmProductService extends ServiceBase { ...@@ -598,8 +599,6 @@ class OrderTmProductService extends ServiceBase {
var itemCode = params.itemCode;//产品编码 var itemCode = params.itemCode;//产品编码
var tm = params.tm;//增加sourceType || "00";//来源类型:00订单,10需求,20服务商 var tm = params.tm;//增加sourceType || "00";//来源类型:00订单,10需求,20服务商
var apply = params.apply; var apply = params.apply;
var app = params.app;
var user = params.user;
var nclones = params.nclones || null; var nclones = params.nclones || null;
var channelOrder = params.channelOrder || null; var channelOrder = params.channelOrder || null;
var orderType = params.orderType || "dkxd";//订单类型,zzdd: 自主订单,dkxd: 代客下单 var orderType = params.orderType || "dkxd";//订单类型,zzdd: 自主订单,dkxd: 代客下单
...@@ -614,17 +613,17 @@ class OrderTmProductService extends ServiceBase { ...@@ -614,17 +613,17 @@ class OrderTmProductService extends ServiceBase {
if(!order || !order.id){ if(!order || !order.id){
return system.getResult(null, "未知订单"); return system.getResult(null, "未知订单");
} }
// //获取渠道用户数据 //获取渠道用户数据
// var channelUser = await this.userDao.model.findOne({ var user = await this.userDao.model.findOne({
// where:{channelUserId:order.channelUserId,app_id:order.app_id}, where:{channelUserId:order.channelUserId,app_id:order.app_id},
// raw:true, raw:true
// attributes:["id","app_id","channelUserId","channelUserName","userMoblie","nickname"] });
// }); var app = await this.appDao.model.findOne({
channelOrder["channelServiceNo"]=order.channelServiceNo; where:{id:order.app_id},
raw:true
});
// channelOrder["channelServiceNo"]=order.channelServiceNo;
channelOrder["payTime"]=order.payTime; channelOrder["payTime"]=order.payTime;
// if(channelUser && channelUser.userMobile){
// channelUser["channelUserMobile"]=channelUser.userMobile;
// }
if (!nclones || nclones.length < 1) { if (!nclones || nclones.length < 1) {
return system.getResult(null, "尼斯大类不能为空"); return system.getResult(null, "尼斯大类不能为空");
} }
...@@ -668,13 +667,7 @@ class OrderTmProductService extends ServiceBase { ...@@ -668,13 +667,7 @@ class OrderTmProductService extends ServiceBase {
var orderAmount = tm; var orderAmount = tm;
orderAmount.salesNum = tm.nclOneCodes.length; orderAmount.salesNum = tm.nclOneCodes.length;
orderAmount.minitermNum = tm.nclCount; orderAmount.minitermNum = tm.nclCount;
// var orderResult = await self.orderDao.addOrder(ordercode, orderType, user, app, productItem, channelOrder, channelUser, apply, orderAmount, t);
// if (orderResult.status != 0) {
// return orderResult;
// }
// var order = orderResult.data;
var jfcode = await self.getBusUid("jf"); var jfcode = await self.getBusUid("jf");
var orderProductObj = { var orderProductObj = {
app_id: user.app_id,// app_id: user.app_id,//
productType_id: productItem.picUrl,//产品类型Id productType_id: productItem.picUrl,//产品类型Id
...@@ -699,7 +692,7 @@ class OrderTmProductService extends ServiceBase { ...@@ -699,7 +692,7 @@ class OrderTmProductService extends ServiceBase {
sywjUrl: tm.sywjUrl || null,//声音文件 sywjUrl: tm.sywjUrl || null,//声音文件
gzwtsUrl: tm.gzwtsUrl || null,//盖章委托书 gzwtsUrl: tm.gzwtsUrl || null,//盖章委托书
smwjUrl: tm.smwjUrl || null,//说明文件 smwjUrl: tm.smwjUrl || null,//说明文件
channelUserId: channelUser.channelUserId,// 渠道用户id channelUserId: user.channelUserId,// 渠道用户id
createuser_id: user.id,// createuser_id: user.id,//
createuser: user.nickname,// createuser: user.nickname,//
notes: tm.notes || "", // 备注信息 notes: tm.notes || "", // 备注信息
...@@ -754,6 +747,16 @@ class OrderTmProductService extends ServiceBase { ...@@ -754,6 +747,16 @@ class OrderTmProductService extends ServiceBase {
await self.orderflowDao.create(flowObj, t);//创建交付流程 await self.orderflowDao.create(flowObj, t);//创建交付流程
orderTm.needNo = channelOrder.needNo || null;//需求单号 orderTm.needNo = channelOrder.needNo || null;//需求单号
var returnTm = await self.opTmInfo(user, tm, apply, nclones, orderTm, JSON.stringify(productItem), t); var returnTm = await self.opTmInfo(user, tm, apply, nclones, orderTm, JSON.stringify(productItem), t);
var orderObj={
id:order.id
};
if(channelOrder.channelServiceNo){
orderObj["channelServiceNo"]=channelOrder.channelServiceNo;
}
if(channelOrder.channelOrderNo){
orderObj["channelOrderNo"]=channelOrder.channelOrderNo;
}
await self.orderDao.update(orderObj,t);
return system.getResultSuccess({ return system.getResultSuccess({
deliveryOrderNo: orderProductObj.deliveryOrderNo, deliveryOrderNo: orderProductObj.deliveryOrderNo,
channelServiceNo: channelOrder.channelServiceNo, channelServiceNo: channelOrder.channelServiceNo,
...@@ -766,7 +769,98 @@ class OrderTmProductService extends ServiceBase { ...@@ -766,7 +769,98 @@ class OrderTmProductService extends ServiceBase {
* 接收辅助注册商标修改数据 * 接收辅助注册商标修改数据
*/ */
async editAssistTm(obj){ async editAssistTm(obj){
return system.getResultSuccess(null, "接口开发中"); // return system.getResultSuccess(null, "接口开发中");
var self = this;
var needNo = obj.needId;
if(!needNo){
return system.getResultFail(-101, "needNo参数错误");
}
//获取交付单信息
var ordertmproduct = await this.ordertmproductDao.model.findOne({
where:{needNo:needNo},
raw:true
});
if(!ordertmproduct || !ordertmproduct.id){
return system.getResultFail(-102, "商标交付单不存在");
}
var deliveryOrderNo = ordertmproduct.deliveryOrderNo;
//获取交付单状态,判断是否可修改
if(ordertmproduct.deliveryStatus=='ddj' || ordertmproduct.deliveryStatus=='ywc'){
var deliveryStatusName = "待递交";
if(ordertmproduct.deliveryStatus=='ywc'){
deliveryStatusName="已完成";
}
return system.getResultFail(-103, "该商标交付单状态为"+deliveryStatusName+",不能进行修改");
}
//获取渠道用户数据
var user = await this.userDao.model.findOne({
where:{id:ordertmproduct.createuser_id},
raw:true
});
if (!user) {
return system.getResultFail(-104, "未知的用户");
}
//获取渠道数据
var app = await this.appDao.model.findOne({
where:{id:ordertmproduct.app_id},
raw:true
});
if (!app) {
return system.getResultFail(-105, "未知的渠道");
}
var itemCode = obj.itemCode;//产品编码
if(!itemCode){
return system.getResultFail(-106, "产品编码参数错误");
}
var productItem = await this.appproductDao.findOneByCode(itemCode,app.id);//获取产品
if (!productItem) {
return system.getResultFail(-107, "未知的产品");
}
return await self.db.transaction(async function (t) {
var whereObj={ where: { deliveryOrderNo:deliveryOrderNo,app_id:app.id }, transaction: t };
//申请人
var applyObj = obj.apply;
await self.customerinfoDao.model.update(applyObj,whereObj);
//联系人
var contactObj=obj.contacts;
await self.customercontactsDao.model.update(contactObj,whereObj);
//商标信息
var tmsList=obj.tms;
await self.trademarkDao.bulkDeleteByWhere(whereObj, t);
for(var i=0;i<tmsList.length;i++){
var tm = tmsList[i];
tm["needNo"] = needNo;
tm["deliveryOrderNo"]=deliveryOrderNo;
tm["app_id"] = app.id;
tm["createuser_id"] = user.id;
tm["owner_id"] = user.id;
tm["owner"] = user.nickname;
tm["ownerMoblie"] = user.ownerMoblie;
tm["creator"] = user.nickname;
tm["itemCode"] = itemCode;
tm["itemName"] = productItem.itemName;
tm["channelUserId"] = user.channelUserId;
if(tm.officialType=="WAITARTIFICIALEXAMINE"){
tm.officialType="dsh"
}
else if(tm.officialType=="FILLEXCEPTION"){
tm.officialType="shbtg"
}
else if(tm.officialType=="WAITCOMMIT"){
tm.officialType="ddj"
}
else if(tm.officialType=="ROBOT"){
tm.officialType="ydj"
}else{
tm.officialType="dsccl";
}
await self.trademarkDao.create(tm,t);
}
//交付单
var otp = obj.order;
await self.dao.model.update(otp,whereObj);
return system.getResultSuccess();
})
} }
//------------------------接收辅助注册商标数据--------end--------------------------------------------------------- //------------------------接收辅助注册商标数据--------end---------------------------------------------------------
} }
......
...@@ -44,7 +44,7 @@ var settings = { ...@@ -44,7 +44,7 @@ var settings = {
}, },
pushFqbossDataUrl: function () { pushFqbossDataUrl: function () {
if (this.env == "dev") { if (this.env == "dev") {
return "https://fqgirlstage.gongsibao.com/";//localsettings.reqEsDevUrl; return "http://localhost:3000/";//localsettings.reqEsDevUrl;
} else { } else {
return "https://fqgirl.gongsibao.com/"; return "https://fqgirl.gongsibao.com/";
} }
......
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