Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
b099a0aa
Commit
b099a0aa
authored
Nov 15, 2018
by
eddie.woo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
22f66510
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
7 deletions
+31
-7
DateUtils.java
...src/main/java/pwc/taxtech/atms/common/util/DateUtils.java
+26
-4
Constant.java
...api/src/main/java/pwc/taxtech/atms/constant/Constant.java
+2
-0
InputInvoiceDataImportServiceImpl.java
...s/vat/service/impl/InputInvoiceDataImportServiceImpl.java
+2
-2
DataInitTest.java
...i/src/test/java/pwc/taxtech/atms/common/DataInitTest.java
+1
-1
No files found.
atms-api/src/main/java/pwc/taxtech/atms/common/util/DateUtils.java
View file @
b099a0aa
package
pwc
.
taxtech
.
atms
.
common
.
util
;
import
pwc.taxtech.atms.constant.Constant
;
import
java.text.ParseException
;
import
java.text.ParsePosition
;
import
java.text.SimpleDateFormat
;
...
...
@@ -540,16 +542,36 @@ public class DateUtils {
return
sdf
.
format
(
calendar
.
getTime
());
}
public
static
String
getPeriodBeginFormat
(
int
year
,
int
period
,
String
format
)
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
format
);
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
year
,
period
-
1
,
1
,
0
,
0
,
0
);
return
sdf
.
format
(
calendar
.
getTime
());
}
public
static
String
getPeriodBeginFormat
(
int
year
,
int
period
)
{
return
getPeriodBeginFormat
(
year
,
period
,
Constant
.
DateFormat
.
DEFAULT
);
}
public
static
String
getPeriodEnd
(
int
year
,
int
period
)
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
return
getPeriodEndFormat
(
year
,
period
,
Constant
.
DateFormat
.
YYYY_MM_DD_HH_MM_SS
);
}
public
static
String
getPeriodEndFormat
(
int
year
,
int
period
,
String
format
)
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
format
);
Calendar
calendar
=
Calendar
.
getInstance
();
if
(
period
<
12
)
calendar
.
set
(
year
,
period
,
-
1
,
23
,
59
,
59
);
else
if
(
period
==
12
)
if
(
period
<
12
)
{
calendar
.
set
(
year
,
period
,
1
,
23
,
59
,
59
);
calendar
.
set
(
Calendar
.
DATE
,
calendar
.
get
(
Calendar
.
DATE
)
-
1
);
}
else
if
(
period
==
12
)
calendar
.
set
(
year
,
period
-
1
,
31
,
23
,
59
,
59
);
return
sdf
.
format
(
calendar
.
getTime
());
}
public
static
String
getPeriodEndFormat
(
int
year
,
int
period
)
{
return
getPeriodEndFormat
(
year
,
period
,
Constant
.
DateFormat
.
DEFAULT
);
}
// /***************************************************************************
// * //nd=1表示返回的值中包含年度 //yf=1表示返回的值中包含月份 //rq=1表示返回的值中包含日期 //format表示返回的格式 1
// * 以年月日中文返回 2 以横线-返回 // 3 以斜线/返回 4 以缩写不带其它符号形式返回 // 5 以点号.返回
...
...
atms-api/src/main/java/pwc/taxtech/atms/constant/Constant.java
View file @
b099a0aa
...
...
@@ -112,5 +112,6 @@ public final class Constant {
public
static
class
DateFormat
{
public
static
final
String
DEFAULT
=
"yyyy-MM-dd"
;
public
static
final
String
YEAR_MONTH
=
"yyyy-MM"
;
public
static
final
String
YYYY_MM_DD_HH_MM_SS
=
"yyyy-MM-dd HH:mm:ss"
;
}
}
\ No newline at end of file
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/InputInvoiceDataImportServiceImpl.java
View file @
b099a0aa
...
...
@@ -58,8 +58,8 @@ public class InputInvoiceDataImportServiceImpl {
Project
project
=
projectMapper
.
selectByPrimaryKey
(
projectId
);
Organization
organization
=
organizationMapper
.
selectByPrimaryKey
(
project
.
getOrganizationId
());
InputInvoiceExample
invoiceExample
=
new
InputInvoiceExample
();
invoiceExample
.
createCriteria
().
andGFSHEqualTo
(
organization
.
getTaxPayerNumber
()).
andRZSJBetween
(
DateUtils
.
getPeriodBegin
(
project
.
getYear
(),
paras
.
getPeriodStart
()),
DateUtils
.
getPeriodEnd
(
project
.
getYear
(),
paras
.
getPeriodEnd
()))
invoiceExample
.
createCriteria
().
andGFSHEqualTo
(
organization
.
getTaxPayerNumber
()).
andRZSJBetween
(
DateUtils
.
getPeriodBegin
Format
(
project
.
getYear
(),
paras
.
getPeriodStart
()),
DateUtils
.
getPeriodEnd
Format
(
project
.
getYear
(),
paras
.
getPeriodEnd
()))
.
andRZJGEqualTo
(
INPUT_RZJG_SUCCESS
).
andRZZTEqualTo
(
INPUT_RZZT_OVER
);
PageHelper
.
startPage
(
paras
.
getPageInfo
().
getPageIndex
(),
paras
.
getPageInfo
().
getPageSize
());
...
...
atms-api/src/test/java/pwc/taxtech/atms/common/DataInitTest.java
View file @
b099a0aa
...
...
@@ -172,7 +172,7 @@ public class DataInitTest extends CommonIT {
@Test
public
void
initOutput
()
throws
Exception
{
Workbook
workbook
=
WorkbookFactory
.
create
(
new
File
(
"C:\\Users\\Eddie Wu\\Desktop\\导入/导入模板_销项主表_
乐叶_201807
(1).xlsx"
));
Workbook
workbook
=
WorkbookFactory
.
create
(
new
File
(
"C:\\Users\\Eddie Wu\\Desktop\\导入/导入模板_销项主表_
绿能_201809
(1).xlsx"
));
Sheet
sheet
=
workbook
.
getSheetAt
(
0
);
for
(
int
r
=
1
;
r
<=
sheet
.
getLastRowNum
();
r
++)
{
try
{
...
...
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