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
ce817a76
Commit
ce817a76
authored
Mar 10, 2020
by
孙亚楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dd
parent
67aa13d9
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
283 deletions
+8
-283
xggsve-invoice/app/base/db/impl/invoice/applyDao.js
+0
-201
xggsve-invoice/app/base/db/impl/invoice/iinvoiceDao.js
+1
-42
xggsve-invoice/app/base/db/impl/invoice/iinvoicedeliverDao.js
+4
-36
xggsve-invoice/app/base/service/impl/invoice/iinvoicedeliverSve.js
+3
-4
No files found.
xggsve-invoice/app/base/db/impl/invoice/applyDao.js
deleted
100644 → 0
View file @
67aa13d9
const
Dao
=
require
(
"../../dao.base"
);
const
system
=
require
(
"../../../system"
);
class
ApplyDao
extends
Dao
{
constructor
()
{
super
(
Dao
.
getModelName
(
ApplyDao
));
this
.
statusMap
=
{
"0090"
:
"未付款"
,
"1000"
:
"待审核"
,
"1010"
:
"审核不通过"
,
"1020"
:
"待分配"
,
"1030"
:
"待处理"
,
"1040"
:
"交付商关闭"
,
"1050"
:
"已开具"
,
"1060"
:
"待审核"
,
"1070"
:
"审核通过"
,
"1080"
:
"已邮寄"
,
"1090"
:
"完成"
,
"1100"
:
"发票撤回"
,
"1200"
:
"红冲"
,
"1300"
:
"审核失败(平台第二次审核)"
};
this
.
customerMap
=
{
"0090"
:
"未付款"
,
"1000"
:
"待审核"
,
"1030"
:
"待处理"
,
"1050"
:
"已开具"
,
"1090"
:
"完成"
};
this
.
deliverMap
=
{
"1030"
:
"待处理"
,
"1040"
:
"交付商关闭"
,
"1050"
:
"已开具"
,
"1060"
:
"待审核"
,
"1080"
:
"已邮寄"
,
"1300"
:
"审核失败(平台第二次审核)"
}
}
async
findMapByIds
(
ids
,
attrs
)
{
var
result
=
{};
if
(
!
ids
||
ids
.
length
==
0
)
{
return
result
;
}
attrs
=
attrs
||
"*"
;
var
sql
=
"SELECT "
+
attrs
+
" FROM invoice_apply where id IN (:ids) "
;
var
list
=
await
this
.
customQuery
(
sql
,
{
ids
:
ids
});
if
(
!
list
||
list
.
length
==
0
)
{
return
result
;
}
for
(
var
item
of
list
)
{
result
[
item
.
id
]
=
item
;
}
return
result
;
}
//按天来计算(平台)
async
statDayByTime
(
begin
,
end
)
{
var
result
=
{};
var
sql
=
[];
sql
.
push
(
"SELECT"
);
sql
.
push
(
"DATE_FORMAT(created_at, '%Y-%m-%d') AS `day`, SUM(service_change) AS serviceChange, COUNT(1) AS invoiceCount"
);
sql
.
push
(
"FROM `invoice_apply`"
);
sql
.
push
(
"WHERE 1 = 1"
);
var
params
=
{
begin
:
begin
,
end
:
end
};
if
(
begin
)
{
sql
.
push
(
"AND created_at >= :begin"
);
}
if
(
end
)
{
sql
.
push
(
"AND created_at <= :end"
);
}
sql
.
push
(
"GROUP BY `day` ORDER BY `day` ASC"
);
var
list
=
await
this
.
customQuery
(
sql
.
join
(
" "
),
params
);
if
(
!
list
||
list
.
length
==
0
)
{
return
result
;
}
for
(
var
item
of
list
)
{
result
[
item
.
day
]
=
item
;
}
return
result
;
}
//安月来计算(平台)
async
statMonthByTime
(
begin
,
end
)
{
var
result
=
{};
var
sql
=
[];
sql
.
push
(
"SELECT"
);
sql
.
push
(
"DATE_FORMAT(created_at, '%Y-%m') AS `month`, SUM(service_change) AS serviceChange, COUNT(1) AS invoiceCount"
);
sql
.
push
(
"FROM `invoice_apply`"
);
sql
.
push
(
"WHERE 1 = 1"
);
var
params
=
{
begin
:
begin
,
end
:
end
};
if
(
begin
)
{
sql
.
push
(
"AND created_at >= :begin"
);
}
if
(
end
)
{
sql
.
push
(
"AND created_at <= :end"
);
}
sql
.
push
(
"GROUP BY `month` ORDER BY `month` ASC"
);
var
list
=
await
this
.
customQuery
(
sql
.
join
(
" "
),
params
);
if
(
!
list
||
list
.
length
==
0
)
{
return
result
;
}
for
(
var
idx
=
0
;
idx
<
list
.
length
;
idx
++
)
{
var
item
=
list
[
idx
];
result
[
item
.
month
]
=
item
;
if
(
idx
==
0
)
{
result
.
begin
=
item
.
month
;
}
if
(
idx
==
list
.
length
-
1
)
{
result
.
end
=
item
.
month
;
}
}
return
result
;
}
async
statInvoiceByTime
(
begin
,
end
)
{
var
sql
=
[];
sql
.
push
(
"SELECT"
);
sql
.
push
(
"COUNT(1) AS invoiceCount, SUM(service_change) AS serviceChange"
);
sql
.
push
(
"FROM `invoice_apply`"
);
sql
.
push
(
"WHERE 1 = 1"
);
var
params
=
{
begin
:
begin
,
end
:
end
};
if
(
begin
)
{
sql
.
push
(
"AND created_at >= :begin"
);
}
if
(
end
)
{
sql
.
push
(
"AND created_at <= :end"
);
}
var
list
=
await
this
.
customQuery
(
sql
.
join
(
" "
),
params
);
if
(
!
list
||
list
.
length
==
0
)
{
return
{
invoiceCount
:
0
,
serviceChange
:
0
,
}
}
var
item
=
list
[
0
];
return
{
invoiceCount
:
item
.
invoiceCount
||
0
,
serviceChange
:
item
.
serviceChange
||
0
,
}
}
async
statByStatus
(
begin
,
end
)
{
var
sql
=
[];
sql
.
push
(
"SELECT"
);
sql
.
push
(
"`status`, COUNT(1) AS invoiceCount "
);
sql
.
push
(
"FROM `invoice_apply`"
);
sql
.
push
(
"WHERE 1 = 1"
);
var
params
=
{
begin
:
begin
,
end
:
end
};
if
(
begin
)
{
sql
.
push
(
"AND created_at >= :begin"
);
}
if
(
end
)
{
sql
.
push
(
"AND created_at <= :end"
);
}
sql
.
push
(
"GROUP BY `status`"
);
var
result
=
{};
var
list
=
await
this
.
customQuery
(
sql
.
join
(
" "
),
params
);
if
(
!
list
||
list
.
length
==
0
)
{
return
result
;
}
for
(
var
item
of
list
)
{
result
[
item
.
status
]
=
item
.
invoiceCount
||
0
;
}
return
result
;
}
}
module
.
exports
=
ApplyDao
;
xggsve-invoice/app/base/db/impl/invoice/iinvoiceDao.js
View file @
ce817a76
...
@@ -4,48 +4,7 @@ const moment = require("moment");
...
@@ -4,48 +4,7 @@ const moment = require("moment");
class
InvoiceDao
extends
Dao
{
class
InvoiceDao
extends
Dao
{
constructor
()
{
constructor
()
{
super
(
Dao
.
getModelName
(
InvoiceDao
));
super
(
Dao
.
getModelName
(
InvoiceDao
));
this
.
statusMap
=
{
this
.
tableName
=
this
.
model
.
tableName
;
"0090"
:
"未付款"
,
"1000"
:
"待审核"
,
"1010"
:
"审核不通过"
,
"1020"
:
"待分配"
,
"1030"
:
"待处理"
,
"1040"
:
"交付商关闭"
,
"1050"
:
"已开具"
,
"1060"
:
"待审核"
,
"1070"
:
"审核通过"
,
"1080"
:
"已邮寄"
,
"1090"
:
"完成"
,
"1100"
:
"发票撤回"
,
"1200"
:
"红冲"
,
"1300"
:
"审核失败(平台第二次审核)"
};
this
.
customerMap
=
{
"0090"
:
"未付款"
,
"1000"
:
"待审核"
,
"1030"
:
"待处理"
,
"1050"
:
"已开具"
,
"1090"
:
"完成"
};
this
.
deliverMap
=
{
"1030"
:
"待处理"
,
"1040"
:
"交付商关闭"
,
"1050"
:
"已开具"
,
"1060"
:
"待审核"
,
"1080"
:
"已邮寄"
,
"1300"
:
"审核失败(平台第二次审核)"
}
this
.
redStatusMap
=
{
"1"
:
"未红冲"
,
"2"
:
"红冲中"
,
"3"
:
"红冲失败"
,
"4"
:
"红冲成功"
,
};
this
.
red_statusMap
=
this
.
redStatusMap
;
}
}
async
countByParams
(
params
)
{
async
countByParams
(
params
)
{
...
...
xggsve-invoice/app/base/db/impl/invoice/
deliver
erDao.js
→
xggsve-invoice/app/base/db/impl/invoice/
iinvoicedeliv
erDao.js
View file @
ce817a76
const
Dao
=
require
(
"../../dao.base"
);
const
Dao
=
require
(
"../../dao.base"
);
const
system
=
require
(
"../../../system"
);
const
system
=
require
(
"../../../system"
);
class
Deliver
erDao
extends
Dao
{
class
Iinvoicedeliv
erDao
extends
Dao
{
constructor
()
{
constructor
()
{
super
(
Dao
.
getModelName
(
DelivererDao
));
super
(
Dao
.
getModelName
(
IinvoicedeliverDao
));
this
.
statusMap
=
{
this
.
tableName
=
this
.
model
.
tableName
;
"0090"
:
"未付款"
,
"1000"
:
"待审核"
,
"1010"
:
"审核不通过"
,
"1020"
:
"待分配"
,
"1030"
:
"待处理"
,
"1040"
:
"交付商关闭"
,
"1050"
:
"已开具"
,
"1060"
:
"待审核"
,
"1070"
:
"审核通过"
,
"1080"
:
"已邮寄"
,
"1090"
:
"完成"
,
"1100"
:
"发票撤回"
,
"1200"
:
"红冲"
,
"1300"
:
"审核失败(平台第二次审核)"
};
this
.
customerMap
=
{
"0090"
:
"未付款"
,
"1000"
:
"待审核"
,
"1030"
:
"待处理"
,
"1050"
:
"已开具"
,
"1090"
:
"完成"
};
this
.
deliverMap
=
{
"1030"
:
"待处理"
,
"1040"
:
"交付商关闭"
,
"1050"
:
"已开具"
,
"1060"
:
"待审核"
,
"1080"
:
"已邮寄"
,
"1300"
:
"审核失败(平台第二次审核)"
}
}
}
//交付商业务概览
//交付商业务概览
...
@@ -354,4 +322,4 @@ class DelivererDao extends Dao {
...
@@ -354,4 +322,4 @@ class DelivererDao extends Dao {
}
}
}
}
}
}
module
.
exports
=
Deliver
erDao
;
module
.
exports
=
Iinvoicedeliv
erDao
;
xggsve-invoice/app/base/service/impl/invoice/
deliver
erSve.js
→
xggsve-invoice/app/base/service/impl/invoice/
iinvoicedeliv
erSve.js
View file @
ce817a76
...
@@ -4,11 +4,10 @@ const moment = require('moment');
...
@@ -4,11 +4,10 @@ const moment = require('moment');
/**
/**
* 平台提交的信息
* 平台提交的信息
*/
*/
class
D
elivererService
extends
ServiceBase
{
class
Iinvoiced
elivererService
extends
ServiceBase
{
constructor
()
{
constructor
()
{
super
(
"invoice"
,
ServiceBase
.
getDaoName
(
DelivererService
));
super
(
"invoice"
,
ServiceBase
.
getDaoName
(
DelivererService
));
this
.
invoiceDao
=
system
.
getObject
(
"db.invoice.invoiceDao"
);
this
.
invoiceDao
=
system
.
getObject
(
"db.invoice.invoiceDao"
);
this
.
applyDao
=
system
.
getObject
(
"db.invoice.applyDao"
);
let
is
=
system
.
getObject
(
"util.invoiceStatus"
);
let
is
=
system
.
getObject
(
"util.invoiceStatus"
);
this
.
invoiceStatus
=
is
.
status
;
this
.
invoiceStatus
=
is
.
status
;
...
@@ -848,4 +847,4 @@ class DelivererService extends ServiceBase {
...
@@ -848,4 +847,4 @@ class DelivererService extends ServiceBase {
}
}
module
.
exports
=
DelivererService
;
module
.
exports
=
IinvoicedelivererService
;
\ No newline at end of file
\ No newline at end of file
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