Commit b3f2ffe4 by 兰国旗

Merge branch 'center-order' of gitlab.gongsibao.com:jiangyong/zhichan into center-order

parents a716fb3f 61d55e3a
......@@ -31,9 +31,18 @@ class OrderAPI extends APIBase {
case "getOrderInfo"://获取订单列表信息
opResult = await this.orderinfoSve.getOrderInfo(pobj, pobj.actionBody);
break;
case "getOrderListByOrderServiceNo"://根据合同号获取子订单
opResult = await this.orderinfoSve.getOrderListByOrderServiceNo(pobj,pobj.actionBody);
break;
case "getOrderServiceNoByOrderNo"://根据订单号获取合同号
opResult = await this.orderinfoSve.getOrderServiceNoByOrderNo(pobj,pobj.actionBody);
break;
case "getOrderDetails"://获取订单详情信息
opResult = await this.orderinfoSve.getOrderDetails(pobj, pobj.actionBody);
break;
case "getOrderByOrderNo"://根据订单号获取订单
opResult = await this.orderinfoSve.getOrderByOrderNo(pobj, pobj.actionBody);
break;
case "getOrderDeliveryInfo"://获取订单交付信息
opResult = await this.orderinfoSve.getOrderDeliveryInfo(pobj, pobj.actionBody);
break;
......
......@@ -26,6 +26,12 @@ class OpPayOrder extends APIBase {
return result;
}
//根据合同号获取所有订单
async getOrderListByOrderServiceNo(pobj,qobj,req){
let result = await this.orderinfoSve.getOrderListByOrderServiceNo(pobj,pobj.appInfo)
return result;
}
//获取支付记录
async getPayRecords(pobj,qobj,req){
let result = await this.orderinfoSve.getPayRecords(pobj);
......
......@@ -1183,6 +1183,34 @@ class OrderInfoService extends ServiceBase {
}
//根据合同号,获取子订单
async getOrderListByOrderServiceNo(pobj){
let sql = "select `orderNo`,`channelServiceNo`,`channelOrderNo`,`channelUserId`,`ownerUserId`,`payTime`,`quantity`,`serviceQuantity`,`orderStatusName`,`orderStatus`,`totalSum`,`payTotalSum`,`refundSum`," +
" `itemCode','invoiceApplyStatus`,`opNotes`,`notes`,`channelItemCode`,`channelItemName`,`price`,priceDesc,priceTypeName,channelItemAppendName,`serviceItemCode`,`picUrl`,`serviceItemSnapshot`,`orderSnapshot`,created_at" +
" from v_order where uapp_id =:uapp_id and orderServiceNo =:orderServiceNo"
let paramWhere = {
uapp_id : pobj.appInfo.uapp_id,
orderServiceNo : pobj.orderNo ? pobj.orderNo : pobj.actionBody.orderServiceNo
}
let list = await this.customQuery(sql,paramWhere);
if (!list || list.length == 0) {
return system.getResult(null, "订单数据为空,30200");
}
var result = system.getResultSuccess(list);
return result;
}
async getOrderServiceNoByOrderNo(pobj, actionBody) {//根据订单号获取订单信息
var sql = "select `orderNo`,orderServiceNo from v_order where orderNo=:orderNo LIMIT 1";
var paramWhere = { orderNo: actionBody.orderNo };
var list = await this.customQuery(sql, paramWhere);
if (!list || list.length == 0) {
return system.getResult(null, "订单数据为空,30200");
}
var result = system.getResultSuccess(list[0]);
return result;
}
async getOrderDetails(pobj, actionBody) {//获取订单详情信息
var sql = "select `orderNo`,`channelServiceNo`,`channelOrderNo`,`channelUserId`,`ownerUserId`,`payTime`,`quantity`,`serviceQuantity`,`orderStatusName`,`orderStatus`,`totalSum`,`payTotalSum`,`refundSum`," +
" `invoiceApplyStatus`,`opNotes`,`notes`,`channelItemCode`,`channelItemName`,`price`,priceDesc,priceTypeName,channelItemAppendName,`serviceItemCode`,`picUrl`,`serviceItemSnapshot`,`orderSnapshot`,created_at from " +
......@@ -1195,6 +1223,16 @@ class OrderInfoService extends ServiceBase {
var result = system.getResultSuccess(list[0]);
return result;
}
async getOrderByOrderNo(pobj, actionBody) {//根据订单号获取订单详情信息
;
let orderItem = await this.dao.getItemStatusByOrderNo(actionBody.orderNo);
if (!orderItem) {
return system.getResult(null, "order data is empty!");
}
let result = system.getResultSuccess(orderItem);
return result;
}
async getOrderDeliveryInfo(pobj, actionBody) {//获取订单交付信息
var sql = "select * from c_order_delivery where sourceOrderNo=:sourceOrderNo";
var paramWhere = { sourceOrderNo: actionBody.orderNo };
......@@ -1677,7 +1715,7 @@ class OrderInfoService extends ServiceBase {
return system.getResultSuccess(resultParams);
}
async opOrderPayCallBackChannel(parmas, appInfo) {//操作订单付款回调---微信
async opOrderPayCallBackChannel(parmas, appInfo) {//操作订单付款回调
var item = await this.dao.getItemStatusByOrderNo(parmas.orderNo)
if (!item) {
return system.getResult(null, "order data is empty!");
......
......@@ -174,7 +174,9 @@ class NeedinfoService extends ServiceBase {
return system.getResult(null, "需求数据为空,30210");
}
var item = await this.dao.getItemByNeedNo(solutionitem.needNo);
item.solutionProvince = solutionitem.solutionContent.solution.Area + `(${solutionitem.solutionContent.solution.ActionType})`//北京(新办);
// fixme 阿里直购需要更改
item.solutionProvince = solutionitem.solutionContent.solution.Area
//item.solutionProvince = solutionitem.solutionContent.solution.Area + `(${solutionitem.solutionContent.solution.actionType})`//北京(新办);
item.solutionContent = solutionitem.solutionContent
item.channelSolutionNo = solutionitem.channelSolutionNo
if (!item) {
......
......@@ -493,7 +493,11 @@ class NeedsolutionService extends ServiceBase {
solutionNo,
...ab,
status:"ywc",
solutionContent:JSON.stringify({totalSum: Number(ab.orderPrice || "0")})
solutionContent:JSON.stringify({
totalSum: Number(ab.orderPrice || "0"),
actionType:ab.actionType,
Source:ab.source
})
})
}else {
if (!ab.channelSolutionNo) {
......
......@@ -254,6 +254,7 @@ class AliyunQcService {
if (!solution.ActionType) {
return system.getResultFail(-108, "办理类型不能为空");
}
ab.solutionContent.solution.actionType = solution.ActionType
var solutionFlowList = ab.solutionContent.solutionFlowList || [];
solutionFlowList.push({
status: "SOLUTION_SUBMIT", statusName: this.icpSolutionStatusReference.SOLUTION_SUBMIT, updated_at: new Date()
......@@ -531,9 +532,9 @@ class AliyunQcService {
if (!needsolutioninfo || !needsolutioninfo.id) {
return system.getResultFail(-400, "未知方案");
}
if (!needsolutioninfo.needNo) {
return system.getResultFail(-401, "方案需求信息有误");
}
// if (!needsolutioninfo.needNo) {
// return system.getResultFail(-401, "方案需求信息有误");
// }
var solutionContent = needsolutioninfo.solutionContent;
if (!solutionContent) {
return system.getResultFail(-402, "方案交付信息有误");
......@@ -545,16 +546,16 @@ class AliyunQcService {
return system.getResultFail(-405, "操作失败,该流程状态已提交,不能重复提交");
}
//获取需求信息
var needinfo = await this.needinfoDao.model.findOne({
where: { needNo: needsolutioninfo.needNo }, raw: true
});
if (!needinfo || !needinfo.id) {
return system.getResultFail(-201, "未知需求信息");
}
// if (needinfo.status == "ycd" || needinfo.status == "ygb") {
if (needinfo.status == "ygb") {
return system.getResultFail(-202, "serviceProviderSubmitMateria" + needinfo.statusName + ",不能执行此操作");
}
// var needinfo = await this.needinfoDao.model.findOne({
// where: { needNo: needsolutioninfo.needNo }, raw: true
// });
// if (!needinfo || !needinfo.id) {
// return system.getResultFail(-201, "未知需求信息");
// }
// // if (needinfo.status == "ycd" || needinfo.status == "ygb") {
// if (needinfo.status == "ygb") {
// return system.getResultFail(-202, "serviceProviderSubmitMateria" + needinfo.statusName + ",不能执行此操作");
// }
var solutionFlowList = solutionContent.solutionFlowList || [];
if (ab.ApplicationStatus == 507) {//完成账户注册
if (solutionContent.status != "USER_CONFIRMED") {
......
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