Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dc-cost-system
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bltdc
dc-cost-system
Commits
5c5fd847
Commit
5c5fd847
authored
Jan 04, 2021
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
0322bb0d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
22 deletions
+25
-22
RestConfiguration.java
...n/java/com/blt/other/common/config/RestConfiguration.java
+2
-6
UserCostFinansysSyncJob.java
...ava/com/blt/other/common/job/UserCostFinansysSyncJob.java
+1
-0
CurUtils.java
...ore/src/main/java/com/blt/other/common/util/CurUtils.java
+4
-0
GetDeparmentListServiceImpl.java
...module/auth/service/impl/GetDeparmentListServiceImpl.java
+2
-2
FileController.java
...m/blt/other/module/commons/controller/FileController.java
+3
-0
CostPlanNewController.java
...t/other/module/cost/controller/CostPlanNewController.java
+11
-12
logback-spring.xml
bailuntec-cost-core/src/main/resources/logback-spring.xml
+2
-2
No files found.
bailuntec-cost-core/src/main/java/com/blt/other/common/config/RestConfiguration.java
View file @
5c5fd847
package
com
.
blt
.
other
.
common
.
config
;
package
com
.
blt
.
other
.
common
.
config
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.web.client.RestTemplateBuilder
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.client.RestTemplate
;
...
@@ -12,11 +10,9 @@ import org.springframework.web.client.RestTemplate;
...
@@ -12,11 +10,9 @@ import org.springframework.web.client.RestTemplate;
@Configuration
@Configuration
public
class
RestConfiguration
{
public
class
RestConfiguration
{
@Autowired
private
RestTemplateBuilder
restTemplateBuilder
;
@Bean
@Bean
public
RestTemplate
restTemplate
(){
public
RestTemplate
restTemplate
()
{
return
restTemplateBuilder
.
build
();
return
new
RestTemplate
();
}
}
}
}
bailuntec-cost-core/src/main/java/com/blt/other/common/job/UserCostFinansysSyncJob.java
View file @
5c5fd847
...
@@ -14,6 +14,7 @@ public class UserCostFinansysSyncJob extends QuartzJobBean {
...
@@ -14,6 +14,7 @@ public class UserCostFinansysSyncJob extends QuartzJobBean {
@Autowired
@Autowired
private
UserCostFinansysService
userCostFinansysService
;
private
UserCostFinansysService
userCostFinansysService
;
@Override
@Override
protected
void
executeInternal
(
JobExecutionContext
jobExecutionContext
)
throws
JobExecutionException
{
protected
void
executeInternal
(
JobExecutionContext
jobExecutionContext
)
throws
JobExecutionException
{
String
result
=
userCostFinansysService
.
syncUserFinance
();
String
result
=
userCostFinansysService
.
syncUserFinance
();
...
...
bailuntec-cost-core/src/main/java/com/blt/other/common/util/CurUtils.java
View file @
5c5fd847
...
@@ -3,6 +3,7 @@ package com.blt.other.common.util;
...
@@ -3,6 +3,7 @@ package com.blt.other.common.util;
import
com.bailuntec.common.SpringContextUtil
;
import
com.bailuntec.common.SpringContextUtil
;
import
com.blt.other.common.config.property.CostUrlProperties
;
import
com.blt.other.common.config.property.CostUrlProperties
;
import
com.blt.other.module.cost.vo.CurVo
;
import
com.blt.other.module.cost.vo.CurVo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.client.RestTemplate
;
...
@@ -10,6 +11,7 @@ import java.math.BigDecimal;
...
@@ -10,6 +11,7 @@ import java.math.BigDecimal;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
@Slf4j
public
class
CurUtils
{
public
class
CurUtils
{
/**
/**
...
@@ -21,6 +23,8 @@ public class CurUtils {
...
@@ -21,6 +23,8 @@ public class CurUtils {
*/
*/
public
static
BigDecimal
getCur
(
String
fromCur
,
String
toCur
)
{
public
static
BigDecimal
getCur
(
String
fromCur
,
String
toCur
)
{
log
.
info
(
fromCur
);
log
.
info
(
toCur
);
CostUrlProperties
costUrlProperties
=
SpringContextUtil
.
getBean
(
CostUrlProperties
.
class
);
CostUrlProperties
costUrlProperties
=
SpringContextUtil
.
getBean
(
CostUrlProperties
.
class
);
String
getExchangeRateApi
=
costUrlProperties
.
getExchangeRateApi
;
String
getExchangeRateApi
=
costUrlProperties
.
getExchangeRateApi
;
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/auth/service/impl/GetDeparmentListServiceImpl.java
View file @
5c5fd847
...
@@ -18,13 +18,13 @@ public class GetDeparmentListServiceImpl implements GetDeparmentListService {
...
@@ -18,13 +18,13 @@ public class GetDeparmentListServiceImpl implements GetDeparmentListService {
Logger
logger
=
LoggerFactory
.
getLogger
(
GetDeparmentListServiceImpl
.
class
);
Logger
logger
=
LoggerFactory
.
getLogger
(
GetDeparmentListServiceImpl
.
class
);
@Autowired
private
RestTemplate
restTemplate
;
@Resource
@Resource
CostUrlProperties
costUrlProperties
;
CostUrlProperties
costUrlProperties
;
@Override
@Override
public
List
<
DepartmentMsg
>
getList
()
{
public
List
<
DepartmentMsg
>
getList
()
{
RestTemplate
restTemplate
=
new
RestTemplate
();
String
response
=
restTemplate
.
getForEntity
(
costUrlProperties
.
getDepartmentListApi
,
String
.
class
).
getBody
();
String
response
=
restTemplate
.
getForEntity
(
costUrlProperties
.
getDepartmentListApi
,
String
.
class
).
getBody
();
return
JsonUtilByFsJson
.
jsonToList
(
response
,
DepartmentMsg
.
class
);
return
JsonUtilByFsJson
.
jsonToList
(
response
,
DepartmentMsg
.
class
);
}
}
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/commons/controller/FileController.java
View file @
5c5fd847
package
com
.
blt
.
other
.
module
.
commons
.
controller
;
package
com
.
blt
.
other
.
module
.
commons
.
controller
;
import
com.bailuntec.cost.api.response.CostResult
;
import
com.bailuntec.cost.api.response.CostResult
;
import
com.blt.other.common.annotation.LoginIgnore
;
import
com.blt.other.common.exception.BizRuntimeException
;
import
com.blt.other.common.exception.BizRuntimeException
;
import
com.blt.other.common.util.PathUtil
;
import
com.blt.other.common.util.PathUtil
;
import
com.blt.other.module.cost.utils.CostFileUtil
;
import
com.blt.other.module.cost.utils.CostFileUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.java.Log
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
...
@@ -22,6 +24,7 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -22,6 +24,7 @@ import org.springframework.web.multipart.MultipartFile;
@RestController
@RestController
public
class
FileController
{
public
class
FileController
{
@LoginIgnore
@ApiOperation
(
"文件上传接口"
)
@ApiOperation
(
"文件上传接口"
)
@PostMapping
(
"/file/upload"
)
@PostMapping
(
"/file/upload"
)
public
CostResult
<
String
>
upload
(
MultipartFile
file
)
{
public
CostResult
<
String
>
upload
(
MultipartFile
file
)
{
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/controller/CostPlanNewController.java
View file @
5c5fd847
package
com
.
blt
.
other
.
module
.
cost
.
controller
;
package
com
.
blt
.
other
.
module
.
cost
.
controller
;
import
com.blt.other.common.lock.CostPlanNoLock
;
import
com.blt.other.common.util.CurUtils
;
import
com.blt.other.common.util.CurUtils
;
import
com.blt.other.database.model.CostPlanDomain
;
import
com.blt.other.database.model.CostPlanDomain
;
import
com.blt.other.module.cost.dto.response.RestResp
;
import
com.blt.other.module.cost.dto.response.RestResp
;
...
@@ -42,19 +41,19 @@ public class CostPlanNewController {
...
@@ -42,19 +41,19 @@ public class CostPlanNewController {
@PostMapping
(
"/affirm"
)
@PostMapping
(
"/affirm"
)
public
Map
<
String
,
Object
>
affirm
(
@RequestParam
String
costPlanNo
)
{
public
Map
<
String
,
Object
>
affirm
(
@RequestParam
String
costPlanNo
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
CostPlanNoLock
lock
=
CostPlanNoLock
.
getInstance
();
//
CostPlanNoLock lock = CostPlanNoLock.getInstance();
try
{
//
try {
lock
.
lock
(
Math
.
abs
(
costPlanNo
.
hashCode
()));
//
lock.lock(Math.abs(costPlanNo.hashCode()));
CostPlanService
costPlanService
=
CostPlanServiceFactory
.
getCostPlanService
(
costPlanNo
);
CostPlanService
costPlanService
=
CostPlanServiceFactory
.
getCostPlanService
(
costPlanNo
);
Integer
affirm
=
costPlanService
.
affirm
(
costPlanNo
);
Integer
affirm
=
costPlanService
.
affirm
(
costPlanNo
);
result
.
put
(
"success"
,
true
);
result
.
put
(
"success"
,
true
);
result
.
put
(
"msg"
,
"已生成 "
+
affirm
+
" 张费用单"
);
result
.
put
(
"msg"
,
"已生成 "
+
affirm
+
" 张费用单"
);
return
result
;
return
result
;
}
finally
{
//
} finally {
lock
.
unlock
(
Math
.
abs
(
costPlanNo
.
hashCode
()));
//
lock.unlock(Math.abs(costPlanNo.hashCode()));
}
//
}
}
}
...
...
bailuntec-cost-core/src/main/resources/logback-spring.xml
View file @
5c5fd847
...
@@ -115,8 +115,8 @@
...
@@ -115,8 +115,8 @@
<!-- 正式环境日志级别为INFO -->
<!-- 正式环境日志级别为INFO -->
<springProfile
name=
"prod"
>
<springProfile
name=
"prod"
>
<logger
name=
"com.
gogirl
"
level=
"DEBUG"
/>
<logger
name=
"com.
blt.other
"
level=
"DEBUG"
/>
<logger
name=
"org.springframework"
level=
"
INFO
"
/>
<logger
name=
"org.springframework"
level=
"
DEBUG
"
/>
<!--日志打印的包的范围,及分类日志文件存储 -->
<!--日志打印的包的范围,及分类日志文件存储 -->
<logger
name=
"com.blt.other"
additivity=
"false"
>
<logger
name=
"com.blt.other"
additivity=
"false"
>
...
...
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