Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
87382b23
Commit
87382b23
authored
Apr 02, 2021
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处理渠道退款
parent
c7065bd9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
157 additions
and
132 deletions
+157
-132
center-order/app/base/db/impl/dbcorder/orderinfoDao.js
+157
-132
center-order/app/base/service/impl/dbcorder/orderinfoSve.js
+0
-0
No files found.
center-order/app/base/db/impl/dbcorder/orderinfoDao.js
View file @
87382b23
const
system
=
require
(
"../../../system"
);
const
system
=
require
(
"../../../system"
);
const
Dao
=
require
(
"../../dao.base"
);
const
Dao
=
require
(
"../../dao.base"
);
const
{
Op
}
=
require
(
"sequelize"
);
const
{
Op
}
=
require
(
"sequelize"
);
class
OrderInfoDao
extends
Dao
{
class
OrderInfoDao
extends
Dao
{
constructor
()
{
constructor
()
{
super
(
Dao
.
getModelName
(
OrderInfoDao
));
super
(
Dao
.
getModelName
(
OrderInfoDao
));
}
async
getItemStatusByOrderNo
(
orderNo
,
uapp_id
)
{
var
sqlWhere
=
{
where
:
{
orderNo
:
orderNo
},
attributes
:
[
"id"
,
"uapp_id"
,
"orderNo"
,
"channelServiceNo"
,
"channelOrderNo"
,
"orderServiceNo"
,
"channelUserId"
,
"ownerUserId"
,
"payTime"
,
"quantity"
,
"serviceQuantity"
,
"orderStatusName"
,
"orderStatus"
,
"totalSum"
,
"payTotalSum"
,
"refundSum"
,
"invoiceApplyStatus"
,
"created_at"
],
raw
:
true
};
if
(
uapp_id
)
{
sqlWhere
.
where
.
uapp_id
=
uapp_id
;
}
}
return
await
this
.
model
.
findOne
(
sqlWhere
);
}
/**
async
getItemStatusByChannelOrderNo
(
channelOrderNo
,
uapp_id
)
{
* 更新订单
var
sqlWhere
=
{
* @param status
where
:
{
* @param statusName
channelOrderNo
:
channelOrderNo
* @param channelOrderNo
},
* @param uapp_id
attributes
:
[
* @returns {Promise<*>}
"id"
,
*/
"uapp_id"
,
async
updateStatus
(
status
,
statusName
,
channelOrderNo
,
uapp_id
)
{
"orderNo"
,
let
result
=
await
this
.
updateByWhere
({
orderStatus
:
status
,
orderStatusName
:
statusName
},
{
"channelServiceNo"
,
where
:
{
"channelOrderNo"
,
channelOrderNo
:
channelOrderNo
,
"orderServiceNo"
,
uapp_id
:
uapp_id
,
"channelUserId"
,
}
"ownerUserId"
,
});
"payTime"
,
return
result
;
"quantity"
,
"serviceQuantity"
,
"orderStatusName"
,
"orderStatus"
,
"totalSum"
,
"payTotalSum"
,
"refundSum"
,
"invoiceApplyStatus"
,
"created_at"
],
raw
:
true
};
if
(
uapp_id
)
{
sqlWhere
.
where
.
uapp_id
=
uapp_id
;
}
}
return
await
this
.
model
.
findOne
(
sqlWhere
);
}
async
delOrderByOrderNo
(
orderNo
,
uapp_id
,
channelUserId
)
{
var
sqlWhere
=
{
orderNo
:
orderNo
,
uapp_id
:
uapp_id
,
channelUserId
:
channelUserId
};
return
await
this
.
delete
(
sqlWhere
);
}
async
delOrderByOrderNoEname
(
orderNo
)
{
async
getItemStatusByOrderNo
(
orderNo
,
uapp_id
)
{
var
sqlWhere
=
{
var
sqlWhere
=
{
orderNo
:
orderNo
where
:
{
};
orderNo
:
orderNo
return
await
this
.
delete
(
sqlWhere
);
},
}
attributes
:
[
async
channeldelOrder
(
channelOrderNo
,
uapp_id
)
{
"id"
,
var
sqlWhere
=
{
"uapp_id"
,
channelOrderNo
:
channelOrderNo
,
"orderNo"
,
uapp_id
:
uapp_id
,
"channelServiceNo"
,
};
"channelOrderNo"
,
return
await
this
.
delete
(
sqlWhere
);
"orderServiceNo"
,
}
"channelUserId"
,
async
addOrderDelivery
(
data
,
orderNo
,
t
)
{
//新增交付信息
"ownerUserId"
,
const
sql
=
"INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUE('"
+
"payTime"
,
orderNo
+
"','"
+
JSON
.
stringify
(
data
)
+
"')"
;
"quantity"
,
await
this
.
customInsert
(
sql
,
null
,
t
);
"serviceQuantity"
,
return
system
.
getResultSuccess
()
"orderStatusName"
,
}
"orderStatus"
,
"totalSum"
,
"payTotalSum"
,
"refundSum"
,
"invoiceApplyStatus"
,
"created_at"
],
raw
:
true
};
if
(
uapp_id
)
{
sqlWhere
.
where
.
uapp_id
=
uapp_id
;
}
return
await
this
.
model
.
findOne
(
sqlWhere
);
}
/**
async
getItemStatusByChannelOrderNo
(
channelOrderNo
,
uapp_id
)
{
* 根据ids 获取需求
var
sqlWhere
=
{
* @param ids
where
:
{
* @returns {Promise<void>}
channelOrderNo
:
channelOrderNo
*/
},
async
getOrdersByIds
(
ids
)
{
attributes
:
[
let
orders
=
await
this
.
findAll
({
"id"
,
where
:
{
"uapp_id"
,
channelOrderNo
:
{
"orderNo"
,
[
Op
.
in
]:
ids
"channelServiceNo"
,
"channelOrderNo"
,
"orderServiceNo"
,
"channelUserId"
,
"ownerUserId"
,
"payTime"
,
"quantity"
,
"serviceQuantity"
,
"orderStatusName"
,
"orderStatus"
,
"totalSum"
,
"payTotalSum"
,
"refundSum"
,
"invoiceApplyStatus"
,
"created_at"
],
raw
:
true
};
if
(
uapp_id
)
{
sqlWhere
.
where
.
uapp_id
=
uapp_id
;
}
}
}
return
await
this
.
model
.
findOne
(
sqlWhere
);
})
}
return
orders
;
}
/**
async
delOrderByOrderNo
(
orderNo
,
uapp_id
,
channelUserId
)
{
* 批量更新
var
sqlWhere
=
{
* @param needs
orderNo
:
orderNo
,
* @returns {Promise<Array<Model>|*>}
uapp_id
:
uapp_id
,
*/
channelUserId
:
channelUserId
async
bulkUpdate
(
orders
)
{
};
let
result
=
await
this
.
bulkCreate
(
orders
,
{
return
await
this
.
delete
(
sqlWhere
);
fields
:
[
"id"
,
"status"
,
"statusName"
],
}
updateOnDuplicate
:
[
"status"
,
"statusName"
]
});
return
result
;
}
/**
async
delOrderByOrderNoEname
(
orderNo
)
{
* 批量更新
var
sqlWhere
=
{
* @param needs
orderNo
:
orderNo
* @returns {Promise<Array<Model>|*>}
};
*/
return
await
this
.
delete
(
sqlWhere
);
async
bulkUpdateStatus
(
status
,
statusName
,
ids
)
{
}
let
result
=
await
this
.
updateByWhere
({
orderStatus
:
status
,
orderStatusName
:
statusName
},
{
where
:
{
async
channeldelOrder
(
channelOrderNo
,
uapp_id
)
{
channelOrderNo
:
{
var
sqlWhere
=
{
[
Op
.
in
]:
ids
channelOrderNo
:
channelOrderNo
,
}
uapp_id
:
uapp_id
,
}
};
});
return
await
this
.
delete
(
sqlWhere
);
return
result
;
}
}
async
addOrderDelivery
(
data
,
orderNo
,
t
)
{
//新增交付信息
const
sql
=
"INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUE('"
+
orderNo
+
"','"
+
JSON
.
stringify
(
data
)
+
"')"
;
await
this
.
customInsert
(
sql
,
null
,
t
);
return
system
.
getResultSuccess
()
}
/**
* 根据ids 获取需求
* @param ids
* @returns {Promise<void>}
*/
async
getOrdersByIds
(
ids
)
{
let
orders
=
await
this
.
findAll
({
where
:
{
channelOrderNo
:
{
[
Op
.
in
]:
ids
}
}
})
return
orders
;
}
/**
* 批量更新
* @param needs
* @returns {Promise<Array<Model>|*>}
*/
async
bulkUpdate
(
orders
)
{
let
result
=
await
this
.
bulkCreate
(
orders
,
{
fields
:
[
"id"
,
"status"
,
"statusName"
],
updateOnDuplicate
:
[
"status"
,
"statusName"
]
});
return
result
;
}
/**
* 批量更新
* @param needs
* @returns {Promise<Array<Model>|*>}
*/
async
bulkUpdateStatus
(
status
,
statusName
,
ids
)
{
let
result
=
await
this
.
updateByWhere
({
orderStatus
:
status
,
orderStatusName
:
statusName
},
{
where
:
{
channelOrderNo
:
{
[
Op
.
in
]:
ids
}
}
});
return
result
;
}
}
}
module
.
exports
=
OrderInfoDao
;
module
.
exports
=
OrderInfoDao
;
center-order/app/base/service/impl/dbcorder/orderinfoSve.js
View file @
87382b23
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment