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
4ebc7ff3
Commit
4ebc7ff3
authored
Oct 26, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
bdf1b53e
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
94 additions
and
41 deletions
+94
-41
PathUtil.java
...ore/src/main/java/com/blt/other/common/util/PathUtil.java
+9
-9
FileController.java
...m/blt/other/module/commons/controller/FileController.java
+38
-0
CostPlanNewController.java
...odule/cost/controller/costplan/CostPlanNewController.java
+2
-2
CostPlanTempApiDto.java
...ava/com/blt/other/module/cost/dto/CostPlanTempApiDto.java
+1
-1
CostTemplateBaseCol.java
.../com/blt/other/module/cost/model/CostTemplateBaseCol.java
+0
-6
AbstractCostPlanService.java
...e/cost/service/impl/costplan/AbstractCostPlanService.java
+8
-10
CostPlanNewReceiptServiceImpl.java
.../service/impl/costplan/CostPlanNewReceiptServiceImpl.java
+0
-1
CostPlanTempServiceImpl.java
...e/cost/service/impl/costplan/CostPlanTempServiceImpl.java
+1
-8
CostTemplateColServiceImpl.java
...service/impl/costtemplate/CostTemplateColServiceImpl.java
+8
-0
CostAttach.java
.../java/com/blt/other/module/database/model/CostAttach.java
+22
-0
CostPlanDomain.java
...a/com/blt/other/module/database/model/CostPlanDomain.java
+5
-4
No files found.
bailuntec-cost-core/src/main/java/com/blt/other/common/util/PathUtil.java
View file @
4ebc7ff3
...
...
@@ -9,36 +9,36 @@ public class PathUtil {
/**
* 获取项目图片根路径
*
* @return basePath
*/
public
static
String
getBasePath
()
{
/**
* 获取操作系统的类型
*/
String
os
=
System
.
getProperty
(
"os.name"
);
String
basePath
=
""
;
if
(
os
.
toLowerCase
().
startsWith
(
"win"
))
{
// basePath = "E:/library/Documents/file/bailuntec/other/";
basePath
=
"C:/FeeSystemFiles/other/"
;
}
else
if
(
os
.
toLowerCase
().
startsWith
(
"mac"
))
{
}
else
if
(
os
.
toLowerCase
().
startsWith
(
"mac"
))
{
basePath
=
"/Users/bailuntec/other/"
;
}
else
{
}
else
{
basePath
=
"/home/bailuntec/other/"
;
}
return
basePath
.
replace
(
"/"
,
separator
);
return
basePath
.
replace
(
"/"
,
separator
);
}
/**
* 根据业务需求返回相对应的子路径
*
* @return 系统格式化后的文件路径
*/
public
static
String
getPath
(
String
path
){
String
filePath
=
String
.
format
(
path
);
return
filePath
.
replace
(
"/"
,
separator
);
public
static
String
getPath
(
String
path
)
{
return
path
.
replace
(
"/"
,
separator
);
}
/**
* 获取文件名
*
* @param filePath
* @return
*/
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/commons/controller/FileController.java
0 → 100644
View file @
4ebc7ff3
package
com
.
blt
.
other
.
module
.
commons
.
controller
;
import
com.bailuntec.cost.api.response.CostResult
;
import
com.blt.other.common.exception.BizRuntimeException
;
import
com.blt.other.common.util.PathUtil
;
import
com.blt.other.module.cost.utils.CostFileUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/10/26 2:04 下午
*/
@Api
(
tags
=
"文件服务接口"
)
@RestController
public
class
FileController
{
@ApiOperation
(
"文件上传接口"
)
@PostMapping
(
"/file/upload"
)
public
CostResult
<
String
>
upload
(
MultipartFile
file
)
{
/*附件字段*/
if
(
file
!=
null
)
{
// 文件上传的路径
String
filePath
=
PathUtil
.
getBasePath
()
+
PathUtil
.
getPath
(
"cost/"
);
// 调用工具类执行保存,并返回 path
String
path
=
CostFileUtil
.
upload
(
file
,
filePath
);
return
CostResult
.
success
(
path
);
}
throw
new
BizRuntimeException
(
"文件不能为空"
);
}
}
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/controller/costplan/CostPlanNewController.java
View file @
4ebc7ff3
...
...
@@ -78,7 +78,7 @@ public class CostPlanNewController {
@ApiOperation
(
"更新费用计划"
)
@PostMapping
(
value
=
{
"/reset"
,
"resetNoFile"
,
"resetFile"
})
public
CostPlanNewApiDto
.
RestResp
reset
(
CostPlanDomain
costPlanDomain
)
{
public
CostPlanNewApiDto
.
RestResp
reset
(
@RequestBody
CostPlanDomain
costPlanDomain
)
{
CostPlanService
costPlanService
=
CostPlanServiceFactory
.
getCostPlanService
(
costPlanDomain
);
costPlanService
.
update
(
costPlanDomain
);
...
...
@@ -90,7 +90,7 @@ public class CostPlanNewController {
@ApiOperation
(
"新增费用计划"
)
@PostMapping
(
value
=
{
"/save"
,
"saveNoFile"
,
"saveFile"
})
public
CostPlanNewApiDto
.
SaveResp
save
(
CostPlanDomain
costPlanDomain
)
{
public
CostPlanNewApiDto
.
SaveResp
save
(
@RequestBody
CostPlanDomain
costPlanDomain
)
{
CostPlanService
costPlanService
=
CostPlanServiceFactory
.
getCostPlanService
(
costPlanDomain
);
costPlanService
.
save
(
costPlanDomain
);
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/dto/CostPlanTempApiDto.java
View file @
4ebc7ff3
...
...
@@ -43,7 +43,7 @@ public final class CostPlanTempApiDto {
private
String
typeNo
;
// 大类编号
private
BigDecimal
planAmount
;
private
MultipartFile
fileSelect
;
//
private MultipartFile fileSelect;
}
@ApiModel
(
"获取费用计划编号对应的费用计划子项出参"
)
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/model/CostTemplateBaseCol.java
View file @
4ebc7ff3
...
...
@@ -43,12 +43,6 @@ public class CostTemplateBaseCol implements Serializable {
@ApiModelProperty
(
value
=
"表单字段数据来源 1. input 人工输入 2. api 网络请求 3. enum 枚举"
)
private
Integer
colDataSource
;
@ApiModelProperty
(
value
=
"如果字段数据来源是api网络请求(colDateSource = 2) 这里记获取可选值的api全链接。"
)
private
String
colApi
;
@ApiModelProperty
(
value
=
"如果费用单字段记录是enum枚举(colDateSource = 3),这里可选的枚举值,用逗号分隔。"
)
private
String
colEnum
;
@ApiModelProperty
(
"是否扩展字段"
)
private
Boolean
isExtension
;
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costplan/AbstractCostPlanService.java
View file @
4ebc7ff3
package
com
.
blt
.
other
.
module
.
cost
.
service
.
impl
.
costplan
;
import
com.bailuntec.cost.api.dto.CostPlanDto
;
import
com.blt.other.common.util.PathUtil
;
import
com.blt.other.module.auth.dao.UserDao
;
import
com.blt.other.module.cost.dao.*
;
import
com.blt.other.module.cost.dto.CostPlanApiDto
;
import
com.blt.other.module.cost.service.*
;
import
com.blt.other.module.cost.utils.CostFileUtil
;
import
com.blt.other.module.cost.utils.CostUtils
;
import
com.blt.other.module.database.model.*
;
import
com.github.pagehelper.PageHelper
;
...
...
@@ -91,14 +89,14 @@ public abstract class AbstractCostPlanService implements CostPlanService {
costPlanDomain
.
setPayCur
(
costPlanDomain
.
getCur
());
/*附件字段*/
if
(
costPlanDomain
.
getFileSelect
()
!=
null
)
{
// 文件上传的路径
String
filePath
=
PathUtil
.
getBasePath
()
+
PathUtil
.
getPath
(
"cost/"
+
costPlanDomain
.
getCostPlanNo
()
+
"/"
);
// 调用工具类执行保存,并返回 path
String
path
=
CostFileUtil
.
upload
(
costPlanDomain
.
getFileSelect
(),
filePath
);
costPlanDomain
.
setFilePath
(
path
);
}
//
/*附件字段*/
//
if (costPlanDomain.getFileSelect() != null) {
//
// 文件上传的路径
//
String filePath = PathUtil.getBasePath() + PathUtil.getPath("cost/" + costPlanDomain.getCostPlanNo() + "/");
//
// 调用工具类执行保存,并返回 path
//
String path = CostFileUtil.upload(costPlanDomain.getFileSelect(), filePath);
//
costPlanDomain.setFilePath(path);
//
}
}
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costplan/CostPlanNewReceiptServiceImpl.java
View file @
4ebc7ff3
...
...
@@ -35,7 +35,6 @@ public class CostPlanNewReceiptServiceImpl extends AbstractCostPlanService imple
planDomain
.
setTypeNo
(
costTypeKindDomain
.
getTypeNo
());
planDomain
.
setTypeName
(
costTypeKindDomain
.
getTypeName
());
costPlanDao
.
insert
(
planDomain
);
}
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costplan/CostPlanTempServiceImpl.java
View file @
4ebc7ff3
...
...
@@ -80,14 +80,7 @@ public class CostPlanTempServiceImpl implements CostPlanTempService {
costPlanTempDomain
.
setTempNo
(
this
.
createNo
());
this
.
checkDic
(
costPlanTempDomain
);
/*附件字段*/
if
(
req
.
getFileSelect
()
!=
null
)
{
// 文件上传的路径
String
filePath
=
PathUtil
.
getBasePath
()
+
PathUtil
.
getPath
(
"cost/"
+
costPlanTempDomain
.
getTempNo
()
+
"/"
);
// 调用工具类执行保存,并返回 path
String
path
=
CostFileUtil
.
upload
(
req
.
getFileSelect
(),
filePath
);
costPlanTempDomain
.
setFilePath
(
path
);
}
//新增付款子项目
costPlanTempDao
.
insert
(
costPlanTempDomain
);
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/cost/service/impl/costtemplate/CostTemplateColServiceImpl.java
View file @
4ebc7ff3
...
...
@@ -3,6 +3,7 @@ package com.blt.other.module.cost.service.impl.costtemplate;
import
com.bailuntec.common.ListUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.blt.other.common.exception.BizRuntimeException
;
import
com.blt.other.module.cost.dao.CostTemplateColMapper
;
import
com.blt.other.module.cost.model.CostTemplate
;
import
com.blt.other.module.cost.model.CostTemplateCol
;
...
...
@@ -32,11 +33,18 @@ public class CostTemplateColServiceImpl extends ServiceImpl<CostTemplateColMappe
@Override
public
void
delete
(
Integer
id
)
{
CostTemplateCol
costTemplateCol
=
this
.
getById
(
id
);
if
(
costTemplateCol
.
getIsDefault
())
{
throw
new
BizRuntimeException
(
"unable to remove default costTemplateCol"
);
}
this
.
removeById
(
id
);
}
@Override
public
void
modify
(
CostTemplateCol
costTemplateCol
)
{
if
(
costTemplateCol
.
getIsDefault
())
{
throw
new
BizRuntimeException
(
"unable to modify default costTemplateCol"
);
}
this
.
updateById
(
costTemplateCol
);
}
...
...
bailuntec-cost-core/src/main/java/com/blt/other/module/database/model/CostAttach.java
0 → 100644
View file @
4ebc7ff3
package
com
.
blt
.
other
.
module
.
database
.
model
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* <p>
* 费用单附加字段
* </p>
*
* @author robbendev
* @since 2020/10/26 1:21 下午
*/
@Data
public
class
CostAttach
{
@ApiModelProperty
(
"附加字段名"
)
private
String
name
;
@ApiModelProperty
(
"附加字段值"
)
private
String
value
;
}
bailuntec-cost-core/src/main/java/com/blt/other/module/database/model/CostPlanDomain.java
View file @
4ebc7ff3
...
...
@@ -6,15 +6,15 @@ import com.baomidou.mybatisplus.annotation.IdType;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler
;
import
com.blt.other.module.database.mapper.StatusMapper
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
lombok.Data
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
@TableName
(
"cost_plan"
)
@Data
...
...
@@ -83,10 +83,11 @@ public class CostPlanDomain {
private
Integer
isTax
;
// 0 不抵扣个税 1 抵扣个税
private
Integer
companyValue
;
// 公司主体value
@TableField
(
typeHandler
=
JacksonTypeHandler
.
class
)
private
List
<
CostAttach
>
attach
;
@JsonIgnore
@TableField
(
exist
=
false
)
private
MultipartFile
fileSelect
;
private
String
costTemplateId
;
public
CostPlanDto
castToDto
()
{
StatusMapper
statusMapper
=
SpringContextUtil
.
getBean
(
StatusMapper
.
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