Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
manager
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
reyun
manager
Commits
f2f1349e
Commit
f2f1349e
authored
5 years ago
by
kangxiaoshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adtest 项目
parent
01f6e6b0
master
…
0727_bugfix
1082_bugfix
1151_bugfix
1209_bugfix
1315_bugfix
1439_bugfix
1608_bugfix
1608_from_1619
1619_bugfix
1990_bugfix
2578_bugfix
2580_fix
bigfix_20201028
bugfix_1608_new
bugfix_1760
bugfix_master_1760
change_double
liushaowei
master_mv
mobvista_master
month_flow
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
13 deletions
+40
-13
pom.xml
pom.xml
+3
-0
ContractController.java
src/main/java/common/controller/ContractController.java
+9
-4
ContractServiceImpl.java
src/main/java/common/service/impl/ContractServiceImpl.java
+27
-9
Constant.java
src/main/java/util/Constant.java
+1
-0
No files found.
pom.xml
View file @
f2f1349e
...
...
@@ -72,6 +72,7 @@
<mail.valid_time>
3
</mail.valid_time>
<report.url>
http://10.3.20.41:9010
</report.url>
<import.temp.url>
http://10.3.20.41:9001/
</import.temp.url>
<!--Redis setting-->
<redis.key.validtime>
120
</redis.key.validtime>
...
...
@@ -136,6 +137,7 @@
<!--<report.url>http://localhost:9010</report.url>-->
<report.url>
http://10.3.20.41:11010
</report.url>
<import.temp.url>
http://10.3.20.41:9001/
</import.temp.url>
<contract.uppath></contract.uppath>
<!--Redis setting-->
<redis.key.validtime>
120
</redis.key.validtime>
...
...
@@ -221,6 +223,7 @@
<mail.valid_time>
3
</mail.valid_time>
<report.url>
http://internal-report-api-976419027.cn-north-1.elb.amazonaws.com.cn
</report.url>
<import.temp.url>
http://172.31.25.137:9001
</import.temp.url>
<!--Redis setting-->
<redis.key.validtime>
120
</redis.key.validtime>
<redis.ip.requesttimes>
5
</redis.ip.requesttimes>
...
...
This diff is collapsed.
Click to expand it.
src/main/java/common/controller/ContractController.java
View file @
f2f1349e
...
...
@@ -19,10 +19,7 @@ import org.springframework.web.multipart.MultipartFile;
import
org.springframework.web.multipart.commons.CommonsMultipartFile
;
import
security.annotation.AuthKey
;
import
security.annotation.CurrentAccount
;
import
util.IPAddrUtil
;
import
util.NewUserLogThread
;
import
util.ResultModel
;
import
util.ValidateUtil
;
import
util.*
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -413,4 +410,12 @@ public class ContractController {
}
@RequestMapping
(
value
=
"/upload/tempurl"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
ResultModel
fileTempUrl
()
{
return
ResultModel
.
OK
(
Constant
.
importTempUrl
);
}
}
This diff is collapsed.
Click to expand it.
src/main/java/common/service/impl/ContractServiceImpl.java
View file @
f2f1349e
...
...
@@ -102,6 +102,8 @@ public class ContractServiceImpl implements ContractService {
put
(
"DMP"
,
"dmp"
);
put
(
"防作弊卫士"
,
"fake"
);
put
(
"ADI"
,
"adi"
);
put
(
"ADS"
,
"ads"
);
put
(
"ABTEST"
,
"abtest"
);
}};
Logger
logger
=
LoggerFactory
.
getLogger
(
ContractServiceImpl
.
class
);
...
...
@@ -253,8 +255,16 @@ public class ContractServiceImpl implements ContractService {
List
<
ContractBody
>
all
=
contractBodyRepository
.
findAllDis
();
return
all
;
}
else
{
List
<
ContractBody
>
common
=
contractBodyRepository
.
findByPlatform
(
"common"
);
List
<
ContractBody
>
common
=
null
;
if
(!
"abtest"
.
equals
(
platform
)
||
!
"ads"
.
equals
(
platform
))
{
common
=
contractBodyRepository
.
findByPlatform
(
"common"
);
}
List
<
ContractBody
>
byPlatform
=
contractBodyRepository
.
findByPlatform
(
platform
);
if
(
common
==
null
)
{
common
=
new
ArrayList
<>();
}
common
.
addAll
(
byPlatform
);
if
(
RoleEnum
.
FINANCE
.
getKey
().
equals
(
loginAccount
.
getRole
()))
{
...
...
@@ -365,6 +375,7 @@ public class ContractServiceImpl implements ContractService {
// }
List
list
=
new
ArrayList
();
if
(
"tkio"
.
equals
(
platform
)
||
"io"
.
equals
(
platform
))
{
List
<
PackageType
>
packageTypeList
=
packageTypeRepository
.
findIsNewAll
();
for
(
PackageType
p
:
packageTypeList
)
{
...
...
@@ -374,9 +385,7 @@ public class ContractServiceImpl implements ContractService {
return
list
;
}
else
{
List
<
PackageBase
>
packageBases
=
packageBaseRepository
.
findByPlatAndStatus
(
platform
,
1
);
return
packageBases
;
}
...
...
@@ -2082,7 +2091,7 @@ public class ContractServiceImpl implements ContractService {
// while (sheetIter.hasNext()) {
// Sheet sheet = sheetIter.next();
// }
return
saveDataBySheet
(
workbook
.
getSheetAt
(
0
),
row_length
);
return
saveDataBySheet
(
workbook
.
getSheetAt
(
0
),
row_length
,
platform
);
}
catch
(
Exception
ex
)
{
logger
.
error
(
"批量上传合同错误"
,
ex
);
...
...
@@ -2091,12 +2100,16 @@ public class ContractServiceImpl implements ContractService {
}
public
ResultModel
saveDataBySheet
(
Sheet
sheet
,
int
row_length
)
{
public
ResultModel
saveDataBySheet
(
Sheet
sheet
,
int
row_length
,
String
platformexcl
)
{
String
sheetName
=
sheet
.
getSheetName
();
if
(!
SHEET_NAMES
.
containsKey
(
sheetName
))
{
return
ResultModel
.
ERROR
(
"模板标签页名称错误"
);
}
if
(
sheetName
.
equals
(
platformexcl
))
{
return
ResultModel
.
ERROR
(
"请上传对应项目模板处理的数据"
);
}
String
platform
=
SHEET_NAMES
.
get
(
sheetName
);
Map
<
String
,
Long
>
tradTypeMap
=
tradeTypeRepsitory
.
findAll
()
.
stream
().
collect
(
Collectors
.
toMap
(
TradeType:
:
getName
,
TradeType:
:
getId
));
...
...
@@ -2112,9 +2125,14 @@ public class ContractServiceImpl implements ContractService {
.
stream
().
collect
(
Collectors
.
toMap
(
PackageBase:
:
getPackageName
,
PackageBase:
:
getId
));
}
Map
<
String
,
String
>
cBodyMap
=
contractBodyRepository
.
findAllDis
()
.
stream
().
collect
(
Collectors
.
toMap
(
ContractBody:
:
getName
,
ContractBody:
:
getCode
));
Map
<
String
,
String
>
cBodyMap
=
null
;
if
(
"abtest"
.
equals
(
platform
)
||
"ads"
.
equals
(
platform
))
{
cBodyMap
=
contractBodyRepository
.
findByPlatform
(
platform
)
.
stream
().
collect
(
Collectors
.
toMap
(
ContractBody:
:
getName
,
ContractBody:
:
getCode
));
}
else
{
cBodyMap
=
contractBodyRepository
.
findAllDis
()
.
stream
().
collect
(
Collectors
.
toMap
(
ContractBody:
:
getName
,
ContractBody:
:
getCode
));
}
Row
row
=
sheet
.
getRow
(
0
);
List
<
String
>
titleKey
=
new
ArrayList
<>();
...
...
@@ -2189,7 +2207,7 @@ public class ContractServiceImpl implements ContractService {
DateTime
dateTime
=
DateTime
.
parse
(
dataSTR
,
DateTimeFormat
.
forPattern
(
pattern
));
s_data
[
w
]
=
dateTime
.
toString
(
"yyyy-MM-dd"
);
if
(
"start_date"
.
equals
(
sheetTitle
))
{
if
(
"start_date"
.
equals
(
sheetTitle
))
{
ds
=
s_data
[
w
].
toString
();
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/util/Constant.java
View file @
f2f1349e
...
...
@@ -23,6 +23,7 @@ public class Constant {
public
static
ResourceBundle
commonBundle
=
ResourceBundle
.
getBundle
(
"common"
);
public
static
String
reportUrl
=
commonBundle
.
getString
(
"report.url"
);
public
static
String
importTempUrl
=
commonBundle
.
getString
(
"import.temp.url"
);
public
static
ResourceBundle
redis
=
ResourceBundle
.
getBundle
(
"redis"
);
public
static
String
REDIS_KEY_VALID_TIME
=
redis
.
getString
(
"redis.key.validtime"
);
...
...
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