Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-api-boot
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-api-boot
Commits
306331f2
提交
306331f2
authored
4月 14, 2022
作者:
谭志磊
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
style: 车辆字典类型来访信息注释、代码修改,excel工具类代码格式优化
上级
038eaa6b
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
177 行增加
和
216 行删除
+177
-216
CarParam.java
app/src/main/java/com/yiring/app/param/car/CarParam.java
+1
-1
CarService.java
app/src/main/java/com/yiring/app/service/car/CarService.java
+1
-1
CarServiceImpl.java
.../java/com/yiring/app/service/car/impl/CarServiceImpl.java
+5
-5
DictService.java
...rc/main/java/com/yiring/app/service/dict/DictService.java
+4
-3
DictTypeService.java
...ain/java/com/yiring/app/service/dict/DictTypeService.java
+17
-25
DictTypeServiceImpl.java
...com/yiring/app/service/dict/impl/DictTypeServiceImpl.java
+106
-127
CarController.java
app/src/main/java/com/yiring/app/web/car/CarController.java
+3
-3
DictController.java
...src/main/java/com/yiring/app/web/dict/DictController.java
+1
-0
DictTypeController.java
...main/java/com/yiring/app/web/dict/DictTypeController.java
+35
-46
ExcelUtils.java
.../src/main/java/com/yiring/common/util/poi/ExcelUtils.java
+4
-5
没有找到文件。
app/src/main/java/com/yiring/app/param/car/CarParam.java
浏览文件 @
306331f2
...
...
@@ -27,7 +27,7 @@ public class CarParam {
@Pattern
(
regexp
=
RegEx
.
CARNUM
,
message
=
"车牌号码格式不正确"
)
String
carNum
;
@ApiModelProperty
(
value
=
"车辆类型"
,
example
=
"
轿车
"
)
@ApiModelProperty
(
value
=
"车辆类型"
,
example
=
"
1
"
)
String
carType
;
@ApiModelProperty
(
value
=
"司机名称"
,
example
=
"张三"
,
required
=
true
)
...
...
app/src/main/java/com/yiring/app/service/car/CarService.java
浏览文件 @
306331f2
...
...
@@ -71,7 +71,7 @@ public interface CarService {
* @param carParam CarParam
* @return 车辆来访信息分页数据
*/
Result
<
PageVo
<
CarVo
>>
P
ageCarInfo
(
CarQueryParam
carParam
,
PageParam
param
);
Result
<
PageVo
<
CarVo
>>
p
ageCarInfo
(
CarQueryParam
carParam
,
PageParam
param
);
/**
* 导出excel
...
...
app/src/main/java/com/yiring/app/service/car/impl/CarServiceImpl.java
浏览文件 @
306331f2
...
...
@@ -52,7 +52,7 @@ public class CarServiceImpl implements CarService {
}
Car
car
=
Car
.
builder
()
.
labelCardStatus
(
"
未发卡
"
)
.
labelCardStatus
(
"
1
"
)
.
carNum
(
carParam
.
getCarNum
())
.
carType
(
carParam
.
getCarType
())
.
driverMobile
(
carParam
.
getDriverMobile
())
...
...
@@ -101,7 +101,7 @@ public class CarServiceImpl implements CarService {
return
Result
.
no
(
Status
.
NOT_FOUND
);
}
Car
car
=
optional
.
get
();
car
.
setLabelCardStatus
(
"
已收卡
"
);
car
.
setLabelCardStatus
(
"
3
"
);
car
.
setCardRecTime
(
LocalDateTime
.
now
());
Car
carReuslt
=
carRepository
.
saveAndFlush
(
car
);
return
Result
.
ok
(
carReuslt
.
getId
());
...
...
@@ -114,7 +114,7 @@ public class CarServiceImpl implements CarService {
return
Result
.
no
(
Status
.
NOT_FOUND
);
}
Car
car
=
optional
.
get
();
car
.
setLabelCardStatus
(
"
使用中
"
);
car
.
setLabelCardStatus
(
"
2
"
);
car
.
setCardSendTime
(
LocalDateTime
.
now
());
car
.
setLabelCard
(
labelCard
);
Car
carReuslt
=
carRepository
.
saveAndFlush
(
car
);
...
...
@@ -130,7 +130,7 @@ public class CarServiceImpl implements CarService {
//正在使用中的信息无法删除
Car
entity
=
optional
.
get
();
if
(
entity
.
getLabelCardStatus
().
equals
(
"使用中"
))
{
if
(
"使用中"
.
equals
(
entity
.
getLabelCardStatus
()
))
{
return
Result
.
no
(
Status
.
BAD_REQUEST
,
"标签卡使用中,信息无法删除"
);
}
carRepository
.
delete
(
entity
);
...
...
@@ -151,7 +151,7 @@ public class CarServiceImpl implements CarService {
}
@Override
public
Result
<
PageVo
<
CarVo
>>
P
ageCarInfo
(
CarQueryParam
carParam
,
PageParam
param
)
{
public
Result
<
PageVo
<
CarVo
>>
p
ageCarInfo
(
CarQueryParam
carParam
,
PageParam
param
)
{
Page
<
Car
>
all
=
carRepository
.
findAll
(
condition
(
carParam
),
PageParam
.
toPageable
(
param
));
List
<
CarVo
>
data
=
all
.
get
()
...
...
app/src/main/java/com/yiring/app/service/dict/DictService.java
浏览文件 @
306331f2
...
...
@@ -36,8 +36,9 @@ public interface DictService {
/**
* 从缓存中获取字典
* @param dictType
* @return
*
* @param dictType 字典类型
* @return 字典数据集合
*/
Result
<
ArrayList
<
Dict
>>
selectDict
(
String
dictType
);
...
...
@@ -84,7 +85,7 @@ public interface DictService {
/**
* 是否该类型字典已有该字典值
*
* @param dictType String
* @param dictType
String
* @param dictValue String
* @return 是否存在
*/
...
...
app/src/main/java/com/yiring/app/service/dict/DictTypeService.java
浏览文件 @
306331f2
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
service
.
dict
;
import
com.yiring.app.param.dict.DictTypeParam
;
import
com.yiring.app.param.dict.DictTypeQueryParam
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.dict.DictType
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
/**
* @author tzl
* 2022/4/14 14:10
*/
public
interface
DictTypeService
{
/**
* 根据条件分页查询字典类型
*
* @param dictTypeQueryParam DictTypeQueryParam
* @return 字典类型分页信息
*/
Result
<
PageVo
<
DictType
>>
pageDictTypeInfo
(
DictTypeQueryParam
dictTypeQueryParam
,
PageParam
param
);
Result
<
DictType
>
getDictTypeInfo
(
Long
id
);
Result
<
String
>
delecteById
(
Long
id
);
Result
<
String
>
saveDictTypeInfo
(
DictTypeParam
dictTypeParam
);
Result
<
String
>
updateDictTypeInfo
(
DictTypeParam
dictTypeParam
,
IdParam
idParam
);
boolean
has
(
String
param
);
/
/ /
**
//
* 根据条件分页查询字典类型
//
*
//
* @param dictTypeQueryParam DictTypeQueryParam
//
* @return 字典类型分页信息
//
*/
//
Result<PageVo<DictType>> pageDictTypeInfo(DictTypeQueryParam dictTypeQueryParam, PageParam param);
//
//
Result<DictType> getDictTypeInfo(Long id);
//
//
Result<String> delecteById(Long id);
//
//
Result<String> saveDictTypeInfo(DictTypeParam dictTypeParam);
//
//
Result<String> updateDictTypeInfo(DictTypeParam dictTypeParam, IdParam idParam);
//
//
boolean has(String param);
}
app/src/main/java/com/yiring/app/service/dict/impl/DictTypeServiceImpl.java
浏览文件 @
306331f2
差异被折叠。
点击展开。
app/src/main/java/com/yiring/app/web/car/CarController.java
浏览文件 @
306331f2
...
...
@@ -79,9 +79,9 @@ public class CarController {
}
@ApiOperation
(
value
=
"查看车辆来访信息(分页)"
)
@GetMapping
(
"
P
ageCarInfo"
)
public
Result
<
PageVo
<
CarVo
>>
P
ageCarInfo
(
@Valid
CarQueryParam
carParam
,
@Valid
PageParam
param
)
{
return
carService
.
P
ageCarInfo
(
carParam
,
param
);
@GetMapping
(
"
p
ageCarInfo"
)
public
Result
<
PageVo
<
CarVo
>>
p
ageCarInfo
(
@Valid
CarQueryParam
carParam
,
@Valid
PageParam
param
)
{
return
carService
.
p
ageCarInfo
(
carParam
,
param
);
}
@ApiOperation
(
value
=
"导出车辆来访信息"
)
...
...
app/src/main/java/com/yiring/app/web/dict/DictController.java
浏览文件 @
306331f2
...
...
@@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.RestController;
/**
* 字典数据控制器
*
* @author tzl
* 2022/4/13 17:10
*/
...
...
app/src/main/java/com/yiring/app/web/dict/DictTypeController.java
浏览文件 @
306331f2
/* (C) 2022 YiRing, Inc. */
package
com
.
yiring
.
app
.
web
.
dict
;
import
com.yiring.app.param.dict.DictTypeParam
;
import
com.yiring.app.param.dict.DictTypeQueryParam
;
import
com.yiring.app.service.dict.DictTypeService
;
import
com.yiring.common.core.Result
;
import
com.yiring.common.dict.DictType
;
import
com.yiring.common.param.IdParam
;
import
com.yiring.common.param.PageParam
;
import
com.yiring.common.vo.PageVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
javax.annotation.Resource
;
import
javax.validation.Valid
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 字典类型控制器
*
* @author tzl
* 2022/4/14 15:14
*/
@Slf4j
@Validated
@Api
(
tags
=
"DictType"
)
@RestController
@RequestMapping
(
"/DictType/"
)
public
class
DictTypeController
{
@Resource
DictTypeService
dictTypeService
;
@ApiOperation
(
value
=
"新增字典类型信息"
)
@PostMapping
(
"saveDictTypeInfo"
)
public
Result
<
String
>
saveDictTypeInfo
(
@Valid
DictTypeParam
dictTypeParam
)
{
return
dictTypeService
.
saveDictTypeInfo
(
dictTypeParam
);
}
@ApiOperation
(
value
=
"修改字典类型信息"
)
@PostMapping
(
"updateDictTypeInfo"
)
public
Result
<
String
>
updateDictTypeInfo
(
@Valid
DictTypeParam
dictTypeParam
,
@Valid
IdParam
idParam
)
{
return
dictTypeService
.
updateDictTypeInfo
(
dictTypeParam
,
idParam
);
}
@ApiOperation
(
value
=
"删除字典类型信息"
)
@PostMapping
(
"delecteById"
)
public
Result
<
String
>
delecteById
(
@Valid
IdParam
idParam
)
{
return
dictTypeService
.
delecteById
(
idParam
.
getId
());
}
@ApiOperation
(
value
=
"查看字典类型信息(分页)"
)
@GetMapping
(
"pageDictTypeInfo"
)
public
Result
<
PageVo
<
DictType
>>
pageDictInfo
(
@Valid
DictTypeQueryParam
queryParam
,
@Valid
PageParam
param
)
{
return
dictTypeService
.
pageDictTypeInfo
(
queryParam
,
param
);
}
@ApiOperation
(
value
=
"查看字典类型信息详情"
)
@GetMapping
(
"getDictTypeInfo"
)
public
Result
<
DictType
>
getDictTypeInfo
(
@Valid
IdParam
idParam
)
{
return
dictTypeService
.
getDictTypeInfo
(
idParam
.
getId
());
}
//
//
@Resource
//
DictTypeService dictTypeService;
//
//
@ApiOperation(value = "新增字典类型信息")
//
@PostMapping("saveDictTypeInfo")
//
public Result<String> saveDictTypeInfo(@Valid DictTypeParam dictTypeParam) {
//
return dictTypeService.saveDictTypeInfo(dictTypeParam);
//
}
//
//
@ApiOperation(value = "修改字典类型信息")
//
@PostMapping("updateDictTypeInfo")
//
public Result<String> updateDictTypeInfo(@Valid DictTypeParam dictTypeParam, @Valid IdParam idParam) {
//
return dictTypeService.updateDictTypeInfo(dictTypeParam, idParam);
//
}
//
//
@ApiOperation(value = "删除字典类型信息")
//
@PostMapping("delecteById")
//
public Result<String> delecteById(@Valid IdParam idParam) {
//
return dictTypeService.delecteById(idParam.getId());
//
}
//
//
@ApiOperation(value = "查看字典类型信息(分页)")
//
@GetMapping("pageDictTypeInfo")
//
public Result<PageVo<DictType>> pageDictInfo(@Valid DictTypeQueryParam queryParam, @Valid PageParam param) {
//
return dictTypeService.pageDictTypeInfo(queryParam, param);
//
}
//
//
@ApiOperation(value = "查看字典类型信息详情")
//
@GetMapping("getDictTypeInfo")
//
public Result<DictType> getDictTypeInfo(@Valid IdParam idParam) {
//
return dictTypeService.getDictTypeInfo(idParam.getId());
//
}
}
basic-common/util/src/main/java/com/yiring/common/util/poi/ExcelUtils.java
浏览文件 @
306331f2
...
...
@@ -12,7 +12,6 @@ import com.yiring.common.util.date.DateUtils;
import
com.yiring.common.util.file.FileTypeUtils
;
import
com.yiring.common.util.file.ImageUtils
;
import
com.yiring.common.util.reflect.ReflectUtils
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.lang.reflect.Field
;
...
...
@@ -362,10 +361,10 @@ public class ExcelUtils<T> {
public
void
exportExcel
(
HttpServletResponse
response
)
{
try
{
writeSheet
();
//
wb.write(response.getOutputStream());
FileOutputStream
fos
=
new
FileOutputStream
(
"D:/a.xls"
);
wb
.
write
(
fos
);
fos
.
close
();
wb
.
write
(
response
.
getOutputStream
());
//
FileOutputStream fos = new FileOutputStream("D:/a.xls");
//
wb.write(fos);
//
fos.close();
}
catch
(
Exception
e
)
{
log
.
error
(
"导出Excel异常{}"
,
e
.
getMessage
());
}
finally
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论