Commit d75bfe3f by 庄冰

receivedata

parent 8b70c462
......@@ -61,7 +61,8 @@ class ReceiveDataAPI extends APIBase {
opResult = await this.ordertmproductSve.addAssistTm(action_body);
break;
case "assistEditTmData"://接收辅助注册修改商标数据
opResult = system.getResultSuccess(null, "测试成功");
// opResult = system.getResultSuccess(null, "测试成功");
opResult = await this.ordertmproductSve.editAssistTm(action_body);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
......
......@@ -39,7 +39,7 @@ module.exports = (db, DataTypes) => {
nclCount :DataTypes.INTEGER, // 尼斯数量
nclPublicExpense :DataTypes.DECIMAL(12, 2), // 尼斯官费总额
}, {
paranoid: false,//假的删除
paranoid: true,//假的删除
underscored: true,
version: true,
freezeTableName: true,
......
......@@ -759,7 +759,98 @@ class OrderTmProductService extends ServiceBase {
* 接收辅助注册商标修改数据
*/
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---------------------------------------------------------
}
......
......@@ -44,7 +44,7 @@ var settings = {
},
pushFqbossDataUrl: function () {
if (this.env == "dev") {
return "https://fqgirlstage.gongsibao.com/";//localsettings.reqEsDevUrl;
return "http://localhost:3000/";//localsettings.reqEsDevUrl;
} else {
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