Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bailuntec-cost
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
huluobin
bailuntec-cost
Commits
4ccca3b9
Commit
4ccca3b9
authored
Mar 01, 2021
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
# 更新
parent
43a7083f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
243 additions
and
58 deletions
+243
-58
README.md
README.md
+239
-58
CostApiController.java
...m/blt/other/module/cost/controller/CostApiController.java
+4
-0
No files found.
README.md
View file @
4ccca3b9
## 百伦费用系统
项目流转: 符式酉 -> 李灿浩 ->吴通 ->尹勇
### 操作
[
管理成本费用单明细SQL
](
http://code.bailuntec.com/bltdc/dc-cost-system/wikis/%E7%AE%A1%E7%90%86%E6%88%90%E6%9C%AC%E8%B4%B9%E7%94%A8%E5%8D%95%E6%98%8E%E7%BB%86SQL
)
[
管理成本接口增加公司主体
](
http://code.bailuntec.com/bltdc/dc-cost-system/wikis/%E7%AE%A1%E7%90%86%E6%88%90%E6%9C%AC%E6%8E%A5%E5%8F%A3%E5%A2%9E%E5%8A%A0%E5%85%AC%E5%8F%B8%E4%B8%BB%E4%BD%93
)
[
物流费导出SQL财务对账
](
http://code.bailuntec.com/bltdc/dc-cost-system/wikis/%E7%89%A9%E6%B5%81%E8%B4%B9%E5%AF%BC%E5%87%BA(%E8%B4%A2%E5%8A%A1%E5%AF%B9%E8%B4%A6
)
)
[
物流费导出SQL财务对账
](
http://code.bailuntec.com/bltdc/dc-cost-system/wikis/%E7%89%A9%E6%B5%81%E8%B4%B9%E5%AF%BC%E5%87%BA(%E8%B4%A2%E5%8A%A1%E5%AF%B9%E8%B4%A6
)
)
### 一、服务器
IP:193.112.167.175:22 ubuntu 密码:!@#blt
*
nix123
Nginx安装在docker上(创建命令:sudo docker run -it -d --name nginx -v /etc/nginx/nginx.conf:/etc/nginx/nginx.conf -v /srv/www/otherweb:/srv/www/otherweb --privileged --net=host nginx),配置文件位置:/etc/nginx/nginx.conf。
-
费用系统前端位置:/srv/www/otherweb
-
费用系统Jar包位置:/home/ubuntu/data/other
-
费用系统存放文件位置:/home/bailuntec/other
-
费用系统日志路径:/home/ubuntu/data/other/other/log
-
数据中心程序jar包位置:/srv/java/
### 二、gitlab
-
费用系统前端:blt / other-web 其他采购系统 web
-
费用系统后端:blt / other 其他采购系统
-
资产负债表取数:blt / balance-sheet 资产负债表取数
-
ebay报表英国:blt/ ebay-uk-report ebay uk发货分析报表
-
亚马逊会计分录自动化:blt/ accounting-entry 亚马逊会计分录自动化处理
### 三、程序
#### 费用系统
1.
流程:从左到右依次为:①采购单流程;②费用单(付款、收款、借支)流程;③费用单(借还)流程。
2.
数据库:bailun_other
3.
对接财务系统出纳接口
新财务系统(cw.bailuntec.com) 基础配置->申请来源:新其他采购(对应采购单出纳),费用系统(对应费用单出纳),详细配置可咨询财务系统负责人泽凯。
4.
管理成本接口
提供给数据中心实时查询,前端负责人振山。
数据库映射表:type_relation
取数SQL:在Java项目cost.xml中有注释。
# 百伦费用系统
百伦内部费用系统
## 一、如何使用
### 1.1 项目架构
`api.fee.bailuntec.com`
->
`nginx(193.112.167.175)`
->
`java api(193.112.167.175)`
### 1.2 java应用主要三方库
-
springboot
-
mybatis
-
mybatis plus
-
mysql
### 1.3 云服务器
正式环境:IP:193.112.167.175:22 ubuntu 密码:!@#blt
*
nix123
测试环境:腾讯云k8s(bailun)/blt-cost/bailuntec-cost
### 1.4 nginx
```
shell script
docker run \
-it -d \
--name nginx \
-v /etc/nginx/nginx.conf:/etc/nginx/nginx.conf \
-v /srv:/srv \
-v /home/bailuntec:/home/bailuntec \
--privileged=true \
--net=host nginx
```
### 1.5 Java发布
正式环境发布:
```
shell script
sh deploy-cost-prod.sh
```
测试环境发布
IDEA docker 插件发布或者用腾讯云coding(见项目Jenkinsfile)
### 1.6 文档地址
[
费用系统线正式环境api
](
http://api.fee.bailuntec.com/purchase/other/doc.html
)
[
费用系统测试环境api
](
http://api.test.fee.bailuntec.com/purchase/other/doc.html
)
### 1.7 其他
费用系统前端位置:/srv/www/otherweb
费用系统Jar包位置:/home/ubuntu/bailuntec-cost/cost-service/target
费用系统存放文件位置:/home/bailuntec/other
费用系统日志路径:/home/ubuntu/bailuntec-cost/cost-service/log
## 二、项目结构
cost-interfaces 模块
```
cost-interfaces/src/main/java/
└── com
└── bailuntec
├── auth
│ └── api
│ ├── request
│ └── response
├── commons
│ └── api
└── cost
└── api //暴露给外部的接口
├── dto //应用数据对象
├── request //API 入参
└── response //API 出参
```
cost-service 模块
```
cost-interfaces/src/main/java/
└── com
└── bailuntec
├── auth
│ └── api
│ ├── request
│ └── response
├── commons
│ └── api
└── cost
└── api
├── domain
├── dto
├── request
└── response
14 directories
huluobindeMacBook-Pro:bailuntec-cost huluobin$
huluobindeMacBook-Pro:bailuntec-cost huluobin$
huluobindeMacBook-Pro:bailuntec-cost huluobin$ tree -d cost-service/src/main/java/
cost-service/src/main/java/
└── com
└── blt
└── other
├── common //应用通用类库
│ ├── annotation //自定义注解
│ ├── base //通用父类
│ ├── config //应用配置
│ │ └── property //应用属性
│ ├── exception //应用异常和全局异常处理
│ ├── filter //过滤器
│ ├── interceptor //拦截器
│ │ └── mail //邮件服务
│ │ └── impl
│ ├── job //应用定时任务
│ ├── lock //锁的应用实现
│ ├── util //应用工具类
│ └── wrapper //备份流
├── database //遗留模块
│ ├── mapper
│ ├── model
│ └── service
└── module //具体应用模块
├── cost
│ ├── controller //rest接口
│ ├── dao //dao层
│ ├── dto //数据传输对象 有些没放到interfaces模块的懒得移过去了
│ │ ├── request
│ │ └── response
│ ├── model //实体领域对象
│ ├── service //服务层
│ │ └── impl
│ │ ├── cost
│ │ ├── costcheck
│ │ └── costplan
│ ├── utils //一些模块工具类
│ └── vo //值对象
...
```
## 三、如何开发
一个新的表如何开发接口
### 3.1 代码生成器
位置: bailuntec-cost/cost-service/src/test/com/blt/other/CodeGenerator.java
根据命令行提示输入模块名和表名
### 3.2 controller开发
controller
```
java
@Api
(
tags
=
"oa公司主体接口"
)
@RestController
@RequestMapping
(
"/oaCompany"
)
public
class
OaCompanyController
{
@Resource
IOaCompanyService
oaCompanyService
;
@ApiOperation
(
"获取百伦公司主体"
)
@GetMapping
(
"/oaCompanyList"
)
public
CostResult
<
List
<
OaCompany
>>
oaCompanyList
()
{
List
<
OaCompany
>
oaCompanyList
=
oaCompanyService
.
oaCompanyList
();
return
CostResult
.
success
(
oaCompanyList
);
}
}
```
### 3.3 service
接口
```
java
public
interface
IOaCompanyService
extends
IService
<
OaCompany
>
{
/**
* <p>
* 获取百伦公司主体
* </p>
*
* @return 百伦公司主体
*/
List
<
OaCompany
>
oaCompanyList
();
}
```
实现
```
java
@Service
public
class
OaCompanyServiceImpl
extends
ServiceImpl
<
OaCompanyMapper
,
OaCompany
>
implements
IOaCompanyService
{
@Resource
CostReviewerMapper
costReviewerMapper
;
@Override
public
List
<
OaCompany
>
oaCompanyList
()
{
return
this
.
list
();
}
//...
}
```
### 3.4 mapper
```
java
public
interface
OaCompanyMapper
extends
BaseMapper
<
OaCompany
>
{
//...
}
```
### 3.5 异常处理
直接在业务代码向上抛异常,全局异常处理会处理。
```
java
@ControllerAdvice
@ResponseBody
@Slf4j
public
class
GlobalExceptionHandler
{
/**
* 自定义异常
*/
@ResponseBody
@ExceptionHandler
(
BizRuntimeException
.
class
)
public
Map
<
String
,
Object
>
handleBizRuntimeException
(
HttpServletRequest
request
,
BizRuntimeException
e
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
.
put
(
"success"
,
false
);
result
.
put
(
"msg"
,
e
.
getMessage
());
result
.
put
(
"message"
,
e
.
getMessage
());
result
.
put
(
"code"
,
e
.
getCode
());
log
.
error
(
e
.
getMessage
(),
e
);
return
result
;
}
//...
}
```
### 3.6 通用返回结果
```
java
@Data
public
class
CostResult
<
T
>
{
private
String
message
;
private
Boolean
success
;
private
T
data
;
private
String
code
;
// ...
}
```
cost-service/src/main/java/com/blt/other/module/cost/controller/CostApiController.java
View file @
4ccca3b9
...
...
@@ -22,10 +22,14 @@ import java.io.IOException;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @author robbendev
*/
@Api
(
tags
=
"外部调用api"
)
@RestController
@RequestMapping
(
"/cost/api"
)
public
class
CostApiController
implements
CostApi
{
@Resource
private
CostApiService
costApiService
;
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
CostApiController
.
class
);
...
...
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