Commit 0b547a13 by 庄冰

channel

parent e46a7cce
......@@ -144,6 +144,13 @@ class TmOrderAPI extends APIBase {
await this.pushData2(opResult, req, pobj, url);
}
break;
case "tmConfirm"://商标方案确认
opResult = await this.ordertmproductSve.tmConfirm(action_body);
if (opResult && opResult.status == 0) {
// var url = this.pushFqbossDataUrl + "api/channelaccessApi/channelTmConfirm"
// await this.pushData2(opResult, req, pobj, url);
}
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
......@@ -34,7 +34,7 @@ module.exports = {
//订单服务付款状态
"order_service_pay_status": { "dfk": "待付款", "yfk": "已付款" },
//商标交付状态
"delivery_status": { "dsccl": "待上传材料", "dsh": "待审核", "ddj": "待递交", "ydj": "已递交", "ywc": "已完成" },
"delivery_status": {"dqrfa":"待确认方案", "dsccl": "待上传材料", "dsh": "待审核", "ddj": "待递交", "ydj": "已递交", "ywc": "已完成" },
//商标类型
"tm_type": { "p": "普通商标", "j": "集体商标", "z": "证明商标", "t": "特殊商标" },
//商标类型形式
......
......@@ -262,7 +262,9 @@ class OrderTmProductService extends ServiceBase {
orderObj.deliveryStatus = "dsccl";
}
else {
orderObj.deliveryStatus = "dsh";
if(!orderObj.deliveryStatus){
orderObj.deliveryStatus = "dsh";
}
}
}
// var customer = await this.customerinfoDao.findOneByCodeAndUserId(apply.code, user.id);//查询客户档案
......@@ -706,6 +708,9 @@ class OrderTmProductService extends ServiceBase {
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待上传材料" : "订单已创建待付款";
} else {
orderProductObj["deliveryStatus"] = "dsh";
if(tm.tmStatus && tm.tmStatus=="SUBALITMOK"){
orderProductObj["deliveryStatus"] = "dqrfa";
}
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待审核" : "订单已创建待付款";
}
}
......@@ -715,6 +720,9 @@ class OrderTmProductService extends ServiceBase {
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待上传材料" : "订单已创建待付款";
} else {
orderProductObj["deliveryStatus"] = "dsh";
if(tm.tmStatus && tm.tmStatus=="SUBALITMOK"){
orderProductObj["deliveryStatus"] = "dqrfa";
}
flowContent = channelOrder.payStatus == "yfk" ? "订单已付款待审核" : "订单已创建待付款";
}
}
......@@ -820,9 +828,11 @@ class OrderTmProductService extends ServiceBase {
var whereObj={ where: { deliveryOrderNo:deliveryOrderNo,app_id:app.id }, transaction: t };
//申请人
var applyObj = obj.apply;
applyObj["updated_at"] = new Date();
await self.customerinfoDao.model.update(applyObj,whereObj);
//联系人
var contactObj=obj.contacts;
contactObj["updated_at"] = new Date();
await self.customercontactsDao.model.update(contactObj,whereObj);
//商标信息
var tmsList=obj.tms;
......@@ -840,6 +850,7 @@ class OrderTmProductService extends ServiceBase {
tm["itemCode"] = itemCode;
tm["itemName"] = productItem.itemName;
tm["channelUserId"] = user.channelUserId;
tm["updated_at"] = new Date();
if(tm.officialType=="WAITARTIFICIALEXAMINE"){
tm.officialType="dsh"
}
......@@ -858,10 +869,62 @@ class OrderTmProductService extends ServiceBase {
}
//交付单
var otp = obj.order;
if(otp.tmStatus && otp.tmStatus=="SUBALITMOK"){
otp["deliveryStatus"] = "dqrfa";
}
otp["updated_at"] = new Date();
await self.dao.model.update(otp,whereObj);
return system.getResultSuccess();
})
}
async tmConfirm(obj){
var self = this;
var channelUserId = obj.channelUserId;
var deliveryOrderNo = obj.deliveryOrderNo;
var isConfirm = obj.isConfirm;
if(!channelUserId){
return system.getResultFail(-101, "渠道用户id不能为空");
}
if(!deliveryOrderNo){
return system.getResultFail(-102, "交付单号不能为空");
}
if(!isConfirm){
return system.getResultFail(-103, "确认码不能为空");
}
//获取交付单信息
var ordertmproduct = await this.ordertmproductDao.model.findOne({
where:{deliveryOrderNo:deliveryOrderNo},
raw:true
});
if(!ordertmproduct || !ordertmproduct.id){
return system.getResultFail(-104, "未知支付单");
}
if(ordertmproduct.deliveryStatus!="dqrfa"){
return system.getResultFail(-105, "方案确认失败,该方案交付状态为"+ordertmproduct.deliveryStatusName);
}
if(ordertmproduct.channelUserId!=channelUserId){
return system.getResultFail(-105, "方案确认失败,只能确认自己的商标方案");
}
return await self.db.transaction(async function (t) {
var otpObj = {id:ordertmproduct.id};
if(isConfirm=="0"){
if(!obj.notes){
return system.getResultFail(-106, "方案确认失败,不通过原因不能为空");
}
otpObj["deliveryStatus"]="fabtg";
otpObj["notes"]=obj.notes;
}
if(isConfirm=="1"){
otpObj["deliveryStatus"]="dsh";
otpObj["notes"]=obj.notes || "";
var tmObj={deliveryOrderNo:deliveryOrderNo,officialType:"dsh"};
await self.trademarkDao.model.update(tmObj,{where:{deliveryOrderNo:deliveryOrderNo}, transaction: t});
}
await self.dao.update(otpObj,t);
return system.getResultSuccess();
})
}
//------------------------接收辅助注册商标数据--------end---------------------------------------------------------
}
......
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