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
c36c4b45
Commit
c36c4b45
authored
Jun 19, 2018
by
eddie.woo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
c930eef3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
262 additions
and
5 deletions
+262
-5
generator.properties
atms-api/etc/generator/generator.properties
+1
-1
generatorConfig.xml
atms-api/etc/generator/generatorConfig.xml
+14
-0
run.bat
atms-api/etc/generator/run.bat
+1
-1
pom.xml
atms-api/pom.xml
+1
-1
SnowFlake.java
...src/main/java/pwc/taxtech/atms/common/util/SnowFlake.java
+97
-0
InputInvoiceMapper.java
...rc/main/java/pwc/taxtech/atms/dao/InputInvoiceMapper.java
+141
-0
InputInvoice.java
.../src/main/java/pwc/taxtech/atms/entitiy/InputInvoice.java
+0
-0
InputInvoiceExample.java
...in/java/pwc/taxtech/atms/entitiy/InputInvoiceExample.java
+0
-0
DistributedIDService.java
...a/pwc/taxtech/atms/service/impl/DistributedIDService.java
+5
-0
conf_profile_dev.properties
atms-api/src/main/resources/conf/conf_profile_dev.properties
+1
-1
conf_profile_staging.properties
...i/src/main/resources/conf/conf_profile_staging.properties
+1
-1
InputInvoiceMapper.xml
...ain/resources/pwc/taxtech/atms/dao/InputInvoiceMapper.xml
+0
-0
No files found.
atms-api/etc/generator/generator.properties
View file @
c36c4b45
jdbc.driverClass
=
com.mysql.jdbc.Driver
jdbc.connectionURL
=
jdbc:mysql://10.157.107.89:3306/tax_
admin
?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
jdbc.connectionURL
=
jdbc:mysql://10.157.107.89:3306/tax_
longi
?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
jdbc.userId
=
root
jdbc.password
=
tax@Admin2018
atms-api/etc/generator/generatorConfig.xml
View file @
c36c4b45
...
...
@@ -412,5 +412,18 @@
<property
name=
"useActualColumnNames"
value=
"true"
/>
<property
name=
"ignoreQualifiersAtRuntime"
value=
"true"
/>
</table>
<table
tableName=
"input_invoice"
domainObjectName=
"InputInvoice"
>
<property
name=
"ignoreQualifiersAtRuntime"
value=
"true"
/>
<columnOverride
column=
"invoice_type"
javaType=
"java.lang.Integer"
/>
<columnOverride
column=
"upload_type"
javaType=
"java.lang.Integer"
/>
<columnOverride
column=
"invoice_entity_type"
javaType=
"java.lang.Integer"
/>
<columnOverride
column=
"invoice_source_type"
javaType=
"java.lang.Integer"
/>
<columnOverride
column=
"status"
javaType=
"java.lang.Integer"
/>
<columnOverride
column=
"deductible"
javaType=
"java.lang.Boolean"
/>
<columnOverride
column=
"has_down_file"
javaType=
"java.lang.Boolean"
/>
<columnOverride
column=
"verify_type"
javaType=
"java.lang.Integer"
/>
<columnOverride
column=
"deductible_result"
javaType=
"java.lang.Integer"
/>
<columnOverride
column=
"is_red_invoice"
javaType=
"java.lang.Boolean"
/>
</table>
</context>
</generatorConfiguration>
\ No newline at end of file
atms-api/etc/generator/run.bat
View file @
c36c4b45
rem see http://www.mybatis.org/generator/running/runningFromCmdLine.html
cd /d %~dp0
call java -classpath .;./* org.mybatis.generator.api.ShellRunner -configfile generatorConfig.xml -overwrite -verbose -tables
TemplateFormula
call java -classpath .;./* org.mybatis.generator.api.ShellRunner -configfile generatorConfig.xml -overwrite -verbose -tables
input_invoice
echo @@@@@@@@@@@ DONE @@@@@@@@@@@
pause
atms-api/pom.xml
View file @
c36c4b45
...
...
@@ -233,7 +233,7 @@
<dependency>
<groupId>
commons-collections
</groupId>
<artifactId>
commons-collections
</artifactId>
<version>
3.2.
1
</version>
<version>
3.2.
2
</version>
</dependency>
<dependency>
<groupId>
commons-beanutils
</groupId>
...
...
atms-api/src/main/java/pwc/taxtech/atms/common/util/SnowFlake.java
0 → 100644
View file @
c36c4b45
package
pwc
.
taxtech
.
atms
.
common
.
util
;
public
class
SnowFlake
{
/**
* 起始的时间戳
*/
private
final
static
long
START_STAMP
=
1529337600000L
;
/**
* 每一部分占用的位数
*/
private
final
static
long
SEQUENCE_BIT
=
12
;
//序列号占用的位数
private
final
static
long
MACHINE_BIT
=
5
;
//机器标识占用的位数
private
final
static
long
DATA_CENTER_BIT
=
5
;
//数据中心占用的位数
/**
* 每一部分的最大值
*/
private
final
static
long
MAX_DATA_CENTER_NUM
=
-
1L
^
(-
1L
<<
DATA_CENTER_BIT
);
private
final
static
long
MAX_MACHINE_NUM
=
-
1L
^
(-
1L
<<
MACHINE_BIT
);
private
final
static
long
MAX_SEQUENCE
=
-
1L
^
(-
1L
<<
SEQUENCE_BIT
);
/**
* 每一部分向左的位移
*/
private
final
static
long
MACHINE_LEFT
=
SEQUENCE_BIT
;
private
final
static
long
DATA_CENTER_LEFT
=
SEQUENCE_BIT
+
MACHINE_BIT
;
private
final
static
long
TIMESTAMP_LEFT
=
DATA_CENTER_LEFT
+
DATA_CENTER_BIT
;
private
long
dataCenterId
;
//数据中心
private
long
machineId
;
//机器标识
private
long
sequence
=
0L
;
//序列号
private
long
lastStamp
=
-
1L
;
//上一次时间戳
public
SnowFlake
(
long
dataCenterId
,
long
machineId
)
{
if
(
dataCenterId
>
MAX_DATA_CENTER_NUM
||
dataCenterId
<
0
)
{
throw
new
IllegalArgumentException
(
"dataCenterId can't be greater than MAX_DATA_CENTER_NUM or less than 0"
);
}
if
(
machineId
>
MAX_MACHINE_NUM
||
machineId
<
0
)
{
throw
new
IllegalArgumentException
(
"machineId can't be greater than MAX_MACHINE_NUM or less than 0"
);
}
this
.
dataCenterId
=
dataCenterId
;
this
.
machineId
=
machineId
;
}
/**
* 产生下一个ID
*
* @return id
*/
public
synchronized
long
nextId
()
{
long
currStamp
=
getNewStamp
();
if
(
currStamp
<
lastStamp
)
{
throw
new
RuntimeException
(
"Clock moved backwards. Refusing to generate id"
);
}
if
(
currStamp
==
lastStamp
)
{
//相同毫秒内,序列号自增
sequence
=
(
sequence
+
1
)
&
MAX_SEQUENCE
;
//同一毫秒的序列数已经达到最大
if
(
sequence
==
0L
)
{
currStamp
=
getNextMill
();
}
}
else
{
//不同毫秒内,序列号置为0
sequence
=
0L
;
}
lastStamp
=
currStamp
;
return
(
currStamp
-
START_STAMP
)
<<
TIMESTAMP_LEFT
//时间戳部分
|
dataCenterId
<<
DATA_CENTER_LEFT
//数据中心部分
|
machineId
<<
MACHINE_LEFT
//机器标识部分
|
sequence
;
//序列号部分
}
private
long
getNextMill
()
{
long
mill
=
getNewStamp
();
while
(
mill
<=
lastStamp
)
{
mill
=
getNewStamp
();
}
return
mill
;
}
private
long
getNewStamp
()
{
return
System
.
currentTimeMillis
();
}
public
static
void
main
(
String
[]
args
)
{
SnowFlake
snowFlake
=
new
SnowFlake
(
1
,
1
);
for
(
int
i
=
0
;
i
<
(
1
<<
12
);
i
++)
{
System
.
out
.
println
(
snowFlake
.
nextId
());
}
}
}
atms-api/src/main/java/pwc/taxtech/atms/dao/InputInvoiceMapper.java
0 → 100644
View file @
c36c4b45
package
pwc
.
taxtech
.
atms
.
dao
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.session.RowBounds
;
import
pwc.taxtech.atms.MyMapper
;
import
pwc.taxtech.atms.entitiy.InputInvoice
;
import
pwc.taxtech.atms.entitiy.InputInvoiceExample
;
@Mapper
public
interface
InputInvoiceMapper
extends
MyMapper
{
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
long
countByExample
(
InputInvoiceExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
int
deleteByExample
(
InputInvoiceExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
int
deleteByPrimaryKey
(
Long
id
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
int
insert
(
InputInvoice
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
int
insertSelective
(
InputInvoice
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
List
<
InputInvoice
>
selectByExampleWithBLOBsWithRowbounds
(
InputInvoiceExample
example
,
RowBounds
rowBounds
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
List
<
InputInvoice
>
selectByExampleWithBLOBs
(
InputInvoiceExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
List
<
InputInvoice
>
selectByExampleWithRowbounds
(
InputInvoiceExample
example
,
RowBounds
rowBounds
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
List
<
InputInvoice
>
selectByExample
(
InputInvoiceExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
InputInvoice
selectByPrimaryKey
(
Long
id
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
int
updateByExampleSelective
(
@Param
(
"record"
)
InputInvoice
record
,
@Param
(
"example"
)
InputInvoiceExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
int
updateByExampleWithBLOBs
(
@Param
(
"record"
)
InputInvoice
record
,
@Param
(
"example"
)
InputInvoiceExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
int
updateByExample
(
@Param
(
"record"
)
InputInvoice
record
,
@Param
(
"example"
)
InputInvoiceExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
int
updateByPrimaryKeySelective
(
InputInvoice
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
int
updateByPrimaryKeyWithBLOBs
(
InputInvoice
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table input_invoice
*
* @mbg.generated
*/
int
updateByPrimaryKey
(
InputInvoice
record
);
}
\ No newline at end of file
atms-api/src/main/java/pwc/taxtech/atms/entitiy/InputInvoice.java
0 → 100644
View file @
c36c4b45
This diff is collapsed.
Click to expand it.
atms-api/src/main/java/pwc/taxtech/atms/entitiy/InputInvoiceExample.java
0 → 100644
View file @
c36c4b45
This diff is collapsed.
Click to expand it.
atms-api/src/main/java/pwc/taxtech/atms/service/impl/DistributedIDService.java
0 → 100644
View file @
c36c4b45
package
pwc
.
taxtech
.
atms
.
service
.
impl
;
public
class
DistributedIDService
{
}
atms-api/src/main/resources/conf/conf_profile_dev.properties
View file @
c36c4b45
jdbc_url
=
jdbc:mysql://10.157.107.89:3306/tax_
admin
?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
jdbc_url
=
jdbc:mysql://10.157.107.89:3306/tax_
longi
?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
jdbc_user
=
root
jdbc_password
=
tax@Admin2018
jdbc_admin_db
=
tax_admin
...
...
atms-api/src/main/resources/conf/conf_profile_staging.properties
View file @
c36c4b45
jdbc_url
=
jdbc:mysql://10.157.107.89:3306/tax_
admin
?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
jdbc_url
=
jdbc:mysql://10.157.107.89:3306/tax_
longi
?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
jdbc_user
=
root
jdbc_password
=
tax@Admin2018
jdbc_admin_db
=
tax_admin
...
...
atms-api/src/main/resources/pwc/taxtech/atms/dao/InputInvoiceMapper.xml
0 → 100644
View file @
c36c4b45
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