Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
project-manage
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
吴迪
project-manage
Commits
453bb7ab
Commit
453bb7ab
authored
Jul 16, 2023
by
吴迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改】投资计划、字典表相关代码
parent
2289b252
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
202 additions
and
36 deletions
+202
-36
pom.xml
pom.xml
+12
-0
DateUtils.java
src/main/java/com/wangtian/common/utils/DateUtils.java
+3
-5
InvestmentPlanController.java
...n/modules/manage/controller/InvestmentPlanController.java
+1
-2
SysDictController.java
...wangtian/modules/manage/controller/SysDictController.java
+38
-12
SysDictItemController.java
...tian/modules/manage/controller/SysDictItemController.java
+2
-2
InvestmentPlanEntity.java
.../wangtian/modules/manage/entity/InvestmentPlanEntity.java
+1
-1
SysDictEntity.java
...ava/com/wangtian/modules/manage/entity/SysDictEntity.java
+5
-4
SysDictItemEntity.java
...com/wangtian/modules/manage/entity/SysDictItemEntity.java
+7
-5
InvestmentPlanForm.java
.../com/wangtian/modules/manage/form/InvestmentPlanForm.java
+73
-0
SysDictForm.java
...in/java/com/wangtian/modules/manage/form/SysDictForm.java
+42
-0
InvestmentPlanServiceImpl.java
...odules/manage/service/impl/InvestmentPlanServiceImpl.java
+4
-4
SysDictItemServiceImpl.java
...n/modules/manage/service/impl/SysDictItemServiceImpl.java
+1
-1
SysDictServiceImpl.java
...gtian/modules/manage/service/impl/SysDictServiceImpl.java
+3
-0
application.yml
src/main/resources/application.yml
+10
-0
No files found.
pom.xml
View file @
453bb7ab
...
...
@@ -231,6 +231,18 @@
<artifactId>
lombok
</artifactId>
<version>
${lombok.version}
</version>
</dependency>
<dependency>
<groupId>
com.sitech
</groupId>
<artifactId>
idwork-starter
</artifactId>
<version>
0.0.1
</version>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-devtools
</artifactId>
<optional>
true
</optional>
</dependency>
</dependencies>
<build>
...
...
src/main/java/com/wangtian/common/utils/DateUtils.java
View file @
453bb7ab
/**
* Copyright (c) 2016-2019 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有,侵权必究!
*GS1OfficeWebSit
*/
package
com
.
wangtian
.
common
.
utils
;
...
...
@@ -25,6 +21,8 @@ import java.util.Date;
public
class
DateUtils
{
/** 时间格式(yyyy-MM-dd) */
public
final
static
String
DATE_PATTERN
=
"yyyy-MM-dd"
;
public
final
static
String
DATE_PATTERN_1
=
"yyyy/MM/dd"
;
/** 时间格式(yyyy-MM-dd HH:mm:ss) */
public
final
static
String
DATE_TIME_PATTERN
=
"yyyy-MM-dd HH:mm:ss"
;
...
...
src/main/java/com/wangtian/modules/manage/controller/InvestmentPlanController.java
View file @
453bb7ab
...
...
@@ -4,7 +4,6 @@ import com.wangtian.common.utils.PageUtils;
import
com.wangtian.common.utils.R
;
import
com.wangtian.modules.manage.entity.InvestmentPlanEntity
;
import
com.wangtian.modules.manage.service.InvestmentPlanService
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -42,7 +41,7 @@ public class InvestmentPlanController {
* 信息
*/
@RequestMapping
(
"/info/{id}"
)
@RequiresPermissions
(
"manage:investmentplan:info"
)
//
@RequiresPermissions("manage:investmentplan:info")
public
R
info
(
@PathVariable
(
"id"
)
Long
id
){
InvestmentPlanEntity
investmentPlan
=
investmentPlanService
.
getById
(
id
);
...
...
src/main/java/com/wangtian/modules/manage/controller/SysDictController.java
View file @
453bb7ab
package
com
.
wangtian
.
modules
.
manage
.
controller
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.sitech.idworkstarter.IdWorkService
;
import
com.wangtian.common.utils.PageUtils
;
import
com.wangtian.common.utils.R
;
import
com.wangtian.common.validator.ValidatorUtils
;
import
com.wangtian.common.validator.group.AddGroup
;
import
com.wangtian.common.validator.group.UpdateGroup
;
import
com.wangtian.modules.manage.entity.SysDictEntity
;
import
com.wangtian.modules.manage.form.SysDictForm
;
import
com.wangtian.modules.manage.service.SysDictService
;
import
com.wangtian.modules.sys.controller.AbstractController
;
import
com.wangtian.modules.sys.entity.SysUserEntity
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.Map
;
...
...
@@ -21,9 +30,11 @@ import java.util.Map;
*/
@RestController
@RequestMapping
(
"manage/sysdict"
)
public
class
SysDictController
{
public
class
SysDictController
extends
AbstractController
{
@Autowired
private
SysDictService
sysDictService
;
@Autowired
private
IdWorkService
idWorkService
;
/**
* 列表
...
...
@@ -32,7 +43,6 @@ public class SysDictController {
//@RequiresPermissions("manage:sysdict:list")
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
){
PageUtils
page
=
sysDictService
.
queryPage
(
params
);
return
R
.
ok
().
put
(
"page"
,
page
);
}
...
...
@@ -42,9 +52,8 @@ public class SysDictController {
*/
@RequestMapping
(
"/info/{id}"
)
//@RequiresPermissions("manage:sysdict:info")
public
R
info
(
@PathVariable
(
"id"
)
Lo
ng
id
){
public
R
info
(
@PathVariable
(
"id"
)
Stri
ng
id
){
SysDictEntity
sysDict
=
sysDictService
.
getById
(
id
);
return
R
.
ok
().
put
(
"sysDict"
,
sysDict
);
}
...
...
@@ -53,9 +62,19 @@ public class SysDictController {
*/
@RequestMapping
(
"/save"
)
// @RequiresPermissions("manage:sysdict:save")
public
R
save
(
@RequestBody
SysDictEntity
sysDict
){
sysDictService
.
save
(
sysDict
);
public
R
save
(
@RequestBody
SysDictForm
sysDict
){
//校验参数
ValidatorUtils
.
validateEntity
(
sysDict
,
AddGroup
.
class
);
//转化实体对象
SysDictEntity
sysDictEntity
=
new
SysDictEntity
();
BeanUtil
.
copyProperties
(
sysDict
,
sysDictEntity
);
sysDictEntity
.
setId
(
idWorkService
.
getSEQByKey
(
"id_seq"
));
//获取登录用户信息
SysUserEntity
loginUser
=
getUser
();
sysDictEntity
.
setCreateUserId
(
loginUser
.
getUserId
());
sysDictEntity
.
setCreateUserName
(
loginUser
.
getUsername
());
sysDictEntity
.
setCreateTime
(
new
Date
());
sysDictService
.
save
(
sysDictEntity
);
return
R
.
ok
();
}
...
...
@@ -64,9 +83,17 @@ public class SysDictController {
*/
@RequestMapping
(
"/update"
)
//@RequiresPermissions("manage:sysdict:update")
public
R
update
(
@RequestBody
SysDictEntity
sysDict
){
sysDictService
.
updateById
(
sysDict
);
public
R
update
(
@RequestBody
SysDictForm
sysDict
){
ValidatorUtils
.
validateEntity
(
sysDict
,
UpdateGroup
.
class
);
//转化实体对象
SysDictEntity
sysDictEntity
=
new
SysDictEntity
();
BeanUtil
.
copyProperties
(
sysDict
,
sysDictEntity
);
//获取登录用户信息
SysUserEntity
loginUser
=
getUser
();
sysDictEntity
.
setUpdateTime
(
new
Date
());
sysDictEntity
.
setUpdateUserName
(
loginUser
.
getUsername
());
sysDictEntity
.
setUpdateUserId
(
loginUser
.
getUserId
());
sysDictService
.
updateById
(
sysDictEntity
);
return
R
.
ok
();
}
...
...
@@ -75,9 +102,8 @@ public class SysDictController {
*/
@RequestMapping
(
"/delete"
)
//@RequiresPermissions("manage:sysdict:delete")
public
R
delete
(
@RequestBody
Lo
ng
[]
ids
){
public
R
delete
(
@RequestBody
Stri
ng
[]
ids
){
sysDictService
.
removeByIds
(
Arrays
.
asList
(
ids
));
return
R
.
ok
();
}
...
...
src/main/java/com/wangtian/modules/manage/controller/SysDictItemController.java
View file @
453bb7ab
...
...
@@ -42,7 +42,7 @@ public class SysDictItemController {
*/
@RequestMapping
(
"/info/{id}"
)
//@RequiresPermissions("manage:sysdictitem:info")
public
R
info
(
@PathVariable
(
"id"
)
Lo
ng
id
){
public
R
info
(
@PathVariable
(
"id"
)
Stri
ng
id
){
SysDictItemEntity
sysDictItem
=
sysDictItemService
.
getById
(
id
);
return
R
.
ok
().
put
(
"sysDictItem"
,
sysDictItem
);
...
...
@@ -75,7 +75,7 @@ public class SysDictItemController {
*/
@RequestMapping
(
"/delete"
)
// @RequiresPermissions("manage:sysdictitem:delete")
public
R
delete
(
@RequestBody
Lo
ng
[]
ids
){
public
R
delete
(
@RequestBody
Stri
ng
[]
ids
){
sysDictItemService
.
removeByIds
(
Arrays
.
asList
(
ids
));
return
R
.
ok
();
...
...
src/main/java/com/wangtian/modules/manage/entity/InvestmentPlanEntity.java
View file @
453bb7ab
...
...
@@ -25,7 +25,7 @@ public class InvestmentPlanEntity implements Serializable {
* 主键,通过idwork-starter生成
*/
@TableId
private
Lo
ng
id
;
private
Stri
ng
id
;
/**
* 投资计划名称
*/
...
...
src/main/java/com/wangtian/modules/manage/entity/SysDictEntity.java
View file @
453bb7ab
package
com
.
wangtian
.
modules
.
manage
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.*
;
import
lombok.Data
;
import
java.io.Serializable
;
...
...
@@ -22,8 +21,8 @@ public class SysDictEntity implements Serializable {
/**
* 主键,idwork-starter生成
*/
@TableId
private
Lo
ng
id
;
@TableId
(
type
=
IdType
.
INPUT
)
private
Stri
ng
id
;
/**
* 字典名称
*/
...
...
@@ -64,6 +63,7 @@ public class SysDictEntity implements Serializable {
/**
* 修改时间
*/
private
Date
updateTime
;
/**
* 创建时间
...
...
@@ -72,6 +72,7 @@ public class SysDictEntity implements Serializable {
/**
* 是否删除 0/未删除,1/删除
*/
@TableLogic
private
Integer
isDelete
;
}
src/main/java/com/wangtian/modules/manage/entity/SysDictItemEntity.java
View file @
453bb7ab
package
com
.
wangtian
.
modules
.
manage
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableLogic
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
import
lombok.Data
;
/**
* 数据字段条目表
*
*
* @author wudi
* @email 632132852@qq.com
* @date 2023-07-16 08:23:26
...
...
@@ -20,14 +21,14 @@ public class SysDictItemEntity implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
/**
*
*
*/
@TableId
private
Lo
ng
id
;
private
Stri
ng
id
;
/**
* 字典id
*/
private
Lo
ng
dictId
;
private
Stri
ng
dictId
;
/**
* 字典项文本
*/
...
...
@@ -76,6 +77,7 @@ public class SysDictItemEntity implements Serializable {
/**
* 是否删除 0/未删除,1/删除
*/
@TableLogic
private
Integer
isDelete
;
}
src/main/java/com/wangtian/modules/manage/form/InvestmentPlanForm.java
0 → 100644
View file @
453bb7ab
package
com
.
wangtian
.
modules
.
manage
.
form
;
import
com.wangtian.common.validator.group.AddGroup
;
import
com.wangtian.common.validator.group.UpdateGroup
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* @author wudi
* @date 2023/7/16
* @comment
*/
@Data
public
class
InvestmentPlanForm
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@NotNull
(
message
=
"投资计划ID不能为空"
,
groups
=
{
UpdateGroup
.
class
})
private
String
id
;
/**
* 投资计划名称
*/
@NotBlank
(
message
=
"投资计划名称不能为空"
,
groups
=
{
AddGroup
.
class
,
UpdateGroup
.
class
})
private
String
planName
;
/**
* 投资计划类型,使用Java枚举类维护
*/
@NotBlank
(
message
=
"投资计划类型不能为空"
,
groups
=
{
AddGroup
.
class
,
UpdateGroup
.
class
})
private
Integer
planType
;
/**
* 年度
*/
@NotBlank
(
message
=
"年度不能为空"
,
groups
=
{
AddGroup
.
class
,
UpdateGroup
.
class
})
private
String
planYear
;
/**
* 批次
*/
@NotBlank
(
message
=
"批次不能为空"
,
groups
=
{
AddGroup
.
class
,
UpdateGroup
.
class
})
private
String
planBatchNumber
;
/**
* 计划文号
*/
@NotBlank
(
message
=
"计划文号不能为空"
,
groups
=
{
AddGroup
.
class
,
UpdateGroup
.
class
})
private
String
planNumber
;
/**
* 资本性金额(万元)
*/
@NotBlank
(
message
=
"资本性金额不能为空"
,
groups
=
{
AddGroup
.
class
,
UpdateGroup
.
class
})
private
BigDecimal
planCapitalAmount
;
/**
* 成本性金额(万元)
*/
@NotBlank
(
message
=
"成本性金额不能为空"
,
groups
=
{
AddGroup
.
class
,
UpdateGroup
.
class
})
private
BigDecimal
planCostAmount
;
/**
* 投资计划下达时间
*/
@NotBlank
(
message
=
"投资计划下达时间不能为空"
,
groups
=
{
AddGroup
.
class
,
UpdateGroup
.
class
})
private
Date
planDeliveryTime
;
/**
* 下达备注
*/
private
String
planRemarks
;
}
src/main/java/com/wangtian/modules/manage/form/SysDictForm.java
0 → 100644
View file @
453bb7ab
package
com
.
wangtian
.
modules
.
manage
.
form
;
import
com.wangtian.common.validator.group.AddGroup
;
import
com.wangtian.common.validator.group.UpdateGroup
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
/**
* @author wudi
* @date 2023/7/16
* @comment
*/
@Data
public
class
SysDictForm
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@NotNull
(
message
=
"商品分类ID不能为空"
,
groups
=
{
UpdateGroup
.
class
})
private
String
id
;
/**
* 字典名称
*/
@NotBlank
(
message
=
"字典名称"
,
groups
=
{
AddGroup
.
class
,
UpdateGroup
.
class
})
private
String
dictName
;
/**
* 字典编码
*/
@NotBlank
(
message
=
"字典编码"
,
groups
=
{
AddGroup
.
class
,
UpdateGroup
.
class
})
private
String
dictCode
;
/**
* 描述
*/
@NotBlank
(
message
=
"字典编码"
,
groups
=
{
AddGroup
.
class
,
UpdateGroup
.
class
})
private
String
description
;
}
src/main/java/com/wangtian/modules/manage/service/impl/InvestmentPlanServiceImpl.java
View file @
453bb7ab
package
com
.
wangtian
.
modules
.
manage
.
service
.
impl
;
import
org.springframework.stereotype.Service
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.wangtian.common.utils.PageUtils
;
import
com.wangtian.common.utils.Query
;
import
com.wangtian.modules.manage.dao.InvestmentPlanDao
;
import
com.wangtian.modules.manage.entity.InvestmentPlanEntity
;
import
com.wangtian.modules.manage.service.InvestmentPlanService
;
import
org.springframework.stereotype.Service
;
import
java.util.Map
;
@Service
(
"investmentPlanService"
)
...
...
@@ -20,7 +20,7 @@ public class InvestmentPlanServiceImpl extends ServiceImpl<InvestmentPlanDao, In
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
IPage
<
InvestmentPlanEntity
>
page
=
this
.
page
(
new
Query
<
InvestmentPlanEntity
>().
getPage
(
params
),
new
QueryWrapper
<
InvestmentPlanEntity
>()
new
QueryWrapper
<
InvestmentPlanEntity
>()
.
eq
(
"is_publish"
,
1
)
);
return
new
PageUtils
(
page
);
...
...
src/main/java/com/wangtian/modules/manage/service/impl/SysDictItemServiceImpl.java
View file @
453bb7ab
...
...
@@ -20,7 +20,7 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemDao, SysDictI
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
IPage
<
SysDictItemEntity
>
page
=
this
.
page
(
new
Query
<
SysDictItemEntity
>().
getPage
(
params
),
new
QueryWrapper
<
SysDictItemEntity
>()
new
QueryWrapper
<
SysDictItemEntity
>()
.
eq
(
"is_publish"
,
1
)
);
return
new
PageUtils
(
page
);
...
...
src/main/java/com/wangtian/modules/manage/service/impl/SysDictServiceImpl.java
View file @
453bb7ab
...
...
@@ -8,6 +8,7 @@ import com.wangtian.common.utils.Query;
import
com.wangtian.modules.manage.dao.SysDictDao
;
import
com.wangtian.modules.manage.entity.SysDictEntity
;
import
com.wangtian.modules.manage.service.SysDictService
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.stereotype.Service
;
import
java.util.Map
;
...
...
@@ -21,6 +22,8 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictDao, SysDictEntity> i
IPage
<
SysDictEntity
>
page
=
this
.
page
(
new
Query
<
SysDictEntity
>().
getPage
(
params
),
new
QueryWrapper
<
SysDictEntity
>()
.
eq
(
"is_publish"
,
1
)
.
like
((
null
!=
params
.
get
(
"dictName"
)
&&
StringUtils
.
isNotBlank
(
params
.
get
(
"dictName"
).
toString
())),
"dict_name"
,
params
.
get
(
"dictName"
))
);
return
new
PageUtils
(
page
);
...
...
src/main/resources/application.yml
View file @
453bb7ab
...
...
@@ -81,3 +81,13 @@ renren:
# token有效时长,7天,单位秒
expire
:
604800
header
:
token
#idwork要初始化的key名称,如果是多个,号隔开(集合)
id.work.idWorkKeyList
:
id_seq
#需要初始化的大小,单位(个)
id.work.size
:
10000
#机器的序号 0-31都可用,如果是分布式部署,需要定义不同的workerId
id.work.workerId
:
0
#机器的数据中心 0-31都可用,如果是分布式部署,需要定义不同的datacenterId
id.work.datacenterId
:
1
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