Commit 7370121d by 兰国旗

laolan

parents feb9a28e 13f457d8
......@@ -72,6 +72,9 @@ class IcAPI extends APIBase {
case "updateStausByRefundOrder"://修改退款方案状态
opResult = await this.needsolutionSve.updateStausByRefundOrder(pobj);
break;
case "getProgrammeInfoByChannelSolutionNo"://修改退款方案状态
opResult = await this.needsolutionSve.getProgrammeInfoByChannelSolutionNo(pobj);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
......
......@@ -55,6 +55,9 @@ class OrderAPI extends APIBase {
case "updateOrderStatusById":// 2020 0923 lin 新增 根据id修改orderStatus,目前用来商标交易更新订单状态
opResult = await this.orderinfoSve.updateOrderStatusById(pobj, pobj.actionBody);
break;
case "updateOrder":
opResult = await this.orderinfoSve.updateOrderById(pobj,pobj.actionBody);
break;
case "channeldelOrder"://阿里工商注册退款
opResult = await this.orderinfoSve.channeldelOrder(pobj, pobj.actionBody);
break;
......
......@@ -338,20 +338,22 @@ class OrderInfoService extends ServiceBase {
if (!deliveryData.tm.picUrl) {
return system.getResult(null, "商标图样不能为空,20210");
}
if (!deliveryData.apply) {
return system.getResult(null, "申请信息不能为空,20230");
}
if (!deliveryData.apply.code) {
return system.getResult(null, "申请统一社会信用代码不能为空,20250");
}
if (!deliveryData.apply.zipCode) {
return system.getResult(null, "申请邮编不能为空,20280");
}
if (!deliveryData.apply.customerType) {
return system.getResult(null, "申请人类型不能为空,20310");
}
if (deliveryData.apply.customerType != "ent" && deliveryData.apply.customerType != "person") {
return system.getResult(null, "申请人类型错误,20330");
if(pobj.appInfo.uapp_id != 22 ){
if (!deliveryData.apply) {
return system.getResult(null, "申请信息不能为空,20230");
}
if (!deliveryData.apply.code) {
return system.getResult(null, "申请统一社会信用代码不能为空,20250");
}
if (!deliveryData.apply.zipCode) {
return system.getResult(null, "申请邮编不能为空,20280");
}
if (!deliveryData.apply.customerType) {
return system.getResult(null, "申请人类型不能为空,20310");
}
if (deliveryData.apply.customerType != "ent" && deliveryData.apply.customerType != "person") {
return system.getResult(null, "申请人类型错误,20330");
}
}
var deliveryStatus = "dsccl";
var deliveryStatusName = "待上传材料";
......@@ -1892,5 +1894,21 @@ class OrderInfoService extends ServiceBase {
})
return system.getResult(ret);
}
//修改订单信息 更新IC订单号
async updateOrderById(pobj,actionBody){
if(!actionBody.orderNo){
return system.getResultFail(-1,'订单号不能为空');
}
let sql = `update c_order_info set orderServiceNo = :orderServiceNo,channelOrderNo = :channelOrderNo,channelServiceNo=:channelServiceNo where orderNo = :orderNo`
let updateParams = {
orderNo:actionBody.orderNo,
orderServiceNo:actionBody.orderServiceNo,
channelOrderNo:actionBody.channelOrderNo,
channelServiceNo :actionBody.channelServiceNo
}
let result = await this.customQuery(sql,updateParams)
return system.getResult(result);
}
}
module.exports = OrderInfoService;
\ No newline at end of file
......@@ -20,7 +20,7 @@ class UsuallyContactsService extends ServiceBase {
channel_user_id:actionBody.channel_user_id,
uapp_id:pobj.appInfo.uapp_id,
type:actionBody.type,
contact_name:actionBody.contacts.contacts || actionBody.name
contact_name:actionBody.contacts.contacts || actionBody.contacts.name
}
let item = await this.findOne(params);
if(item){
......@@ -34,7 +34,7 @@ class UsuallyContactsService extends ServiceBase {
type:actionBody.type
}
let result = await this.create(contactsInfo);
return system.getResultSuccess();
return system.getResultSuccess({id:result.id});
}
//删除常用联系人、申请人
......@@ -58,6 +58,16 @@ class UsuallyContactsService extends ServiceBase {
if(Object.keys(actionBody.contacts).length<0){
return system.getResultFail(-1,'信息不能为空');
}
let params = {
channel_user_id:actionBody.channel_user_id,
uapp_id:pobj.appInfo.uapp_id,
type:actionBody.type,
contact_name:actionBody.contact_name
}
let item = await this.findOne(params);
if(item){
return system.getResultFail(-1,'联系人已存在,请勿重复添加')
}
let obj = {
id:actionBody.id,
uapp_id:pobj.appInfo.uapp_id,
......@@ -73,7 +83,7 @@ class UsuallyContactsService extends ServiceBase {
//查询常用联系人、申请人
async getContacts(pobj,actionBody){
let sql = `select id,channel_user_id,contact_name,contacts_content,type from c_usually_contacts where uapp_id = :uapp_id and channel_user_id = :channel_user_id and type = :type and deleted_at is null`;
let sql = `select id,channel_user_id,contact_name,contacts_content,type from c_usually_contacts where uapp_id = :uapp_id and channel_user_id = :channel_user_id and type = :type`;
if(!actionBody.type){
return system.getResultFail(-1,'type 不能为空')
}
......@@ -85,6 +95,11 @@ class UsuallyContactsService extends ServiceBase {
channel_user_id: actionBody.channel_user_id,
type:actionBody.type
}
if(actionBody.contact_name){
sql += ` and contact_name = :contact_name`;
paramsWhere['contact_name'] = actionBody.contact_name;
}
sql += ` and deleted_at is null`
let result = await this.customQuery(sql,paramsWhere);
return system.getResult(result);
}
......
......@@ -203,6 +203,24 @@ class NeedsolutionService extends ServiceBase {
});
return system.getResultSuccess(ns);
}
// 2020 1017 lin 新增 根据渠道方案号查看方案
async getProgrammeInfoByChannelSolutionNo(pobj) {
var ab = pobj.actionBody;
if (!ab.channelSolutionNo) {
return system.getResultFail(-101, "渠道方案号不能为空");
}
//获取需求信息
var needsolutioninfo = await this.dao.model.findOne({
attributes:["id","solutionContent","status","orderNo"],
where: { channelSolutionNo: ab.channelSolutionNo,isInvalid:0 }, raw: true
});
if (!needsolutioninfo || !needsolutioninfo.id) {
return system.getResultFail(-102, "未知方案信息");
}
return system.getResultSuccess(needsolutioninfo);
}
//获取方案列表(获取用户所有方案)
async getProgrammeListByUser(pobj) {
var ab = pobj.actionBody;
......@@ -484,14 +502,16 @@ class NeedsolutionService extends ServiceBase {
if (ab.orderPrice) {
// solutionContent = JSON.parse(solutionContent);
solutionContent["totalSum"] = Number(ab.orderPrice || "0");
needsolutioninfo.solutionContent = JSON.stringify(solutionContent);
}
if (ab.status) {
needsolutioninfo.status = "ywc";
}
// 2020 1017 lin 新增去掉status的判断,生成订单这个方案才算完成,所以没必要再判断,另一个原因网文2.3每个状态都有不同status,所以不能以来有没有status来决定方案完成情况。
// if (ab.status) {
// needsolutioninfo.status = "ywc";
// }
if (ab.orderNo) {
needsolutioninfo.orderNo = ab.orderNo;
needsolutioninfo.status = "ywc";
}
needsolutioninfo.solutionContent = JSON.stringify(solutionContent);
await this.dao.update(needsolutioninfo);
var ns = await this.dao.model.findOne({
where: { id: needsolutioninfo.id }, raw: true
......
......@@ -55,7 +55,8 @@ class AliyunQcService {
604: "⼯商部已受理",
605: "⼯商部不予受理",
606: "⼯商部通过",
607: "⼯商部未通过"
607: "⼯商部未通过",
608: "用户驳回"
};
//(文网文状态2020-9-26)
this.wangwenSolutionStatusReference = {
......@@ -682,11 +683,17 @@ class AliyunQcService {
//方案流程列表
var solutionFlowList = solutionContent.solutionFlowList || [];
if (ab.status == "1") {//⽤户已支付
solutionFlowList.push({
status: "PAID", statusName: this.icpSolutionStatusReference.PAID, updated_at: new Date()
});
solutionContent.status = "PAID";
solutionContent.statusName = this.icpSolutionStatusReference.PAID;
var afterStatusList=[//用户支付后的流程状态
"USER_UPLOADED", "MATERIAL_UNCONFIRM", "USER_CONFIRMED", "ACCOUNT_REGISTERED",
"MATERIAL_SUBMITTED","GXB_ACCEPT","GXB_REFUSE","GXB_FAIL","GXB_SUCCESS","CLOSE"
];
if(!solutionContent.status || afterStatusList.indexOf(solutionContent.status)<0){
solutionFlowList.push({
status: "PAID", statusName: this.icpSolutionStatusReference.PAID, updated_at: new Date()
});
solutionContent.status = "PAID";
solutionContent.statusName = this.icpSolutionStatusReference.PAID;
}
// 2020 0826 lin修改 n_need_info status为ycd 已成单
let needObj = {
id: needinfo.id, status: "ycd"
......@@ -1013,6 +1020,7 @@ class AliyunQcService {
id: ns.id,
solutionContent: solutionContent,
};
// 这里修改进去了
if(ab.bizId != ns.channelDeliverId) {
updateObj.channelDeliverId = ab.bizId
}
......@@ -1036,14 +1044,18 @@ class AliyunQcService {
* (文网文)
*/
async serviceSubmitOption(pobj) {
console.log(pobj)
var ab = pobj.actionBody;
var user = pobj.userInfo;
if (!user || !user.id) {
return system.getResultFail(-100, "未知用户");
}
<<<<<<< HEAD
if (!ab.orderNo) {
return system.getResultFail(-101, "订单号不能为空");
=======
if (!ab.solutionNo) {
return system.getResultFail(-101, "方案编号不能为空");
>>>>>>> 13f457d854f6497e537354a63c2833a868ecf001
}
if (!ab.ApplicationStatus) {
return system.getResultFail(-102, "交付状态不能为空");
......@@ -1053,7 +1065,12 @@ class AliyunQcService {
}
//获取方案信息
var needsolutioninfo = await this.needsolutionDao.model.findOne({
<<<<<<< HEAD
where: { orderNo: ab.orderNo }, raw: true
=======
attributes: ["id", "status", "solutionContent", "needNo"],
where: { solutionNo: ab.solutionNo }, raw: true
>>>>>>> 13f457d854f6497e537354a63c2833a868ecf001
});
if (!needsolutioninfo || !needsolutioninfo.id) {
return system.getResultFail(-400, "未知方案");
......@@ -1252,11 +1269,6 @@ class AliyunQcService {
if (!solution.companyLocation) {
return system.getResultFail(-107, "区域不能为空");
}
if (!solution.solutionPrice) {
return system.getResultFail(-108, "办理价格不能为空");
}else{
solution.solutionPrice = solution.solutionPrice / 100;
}
var solutionFlowList = ab.solutionContent.solutionFlowList || [];
solutionFlowList.push({
status: "SOLUTION_SUBMIT", statusName: this.wangwenSolutionStatusReference.SOLUTION_SUBMIT, updated_at: new Date()
......
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