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
86b4cbee
Commit
86b4cbee
authored
Jul 16, 2023
by
吴迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改】投资计划、字典表相关代码
parent
c9f2c1b7
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
78 additions
and
29 deletions
+78
-29
InvestmentPlanController.java
...n/modules/manage/controller/InvestmentPlanController.java
+34
-18
InvestmentPlanDao.java
...va/com/wangtian/modules/manage/dao/InvestmentPlanDao.java
+1
-1
InvestmentPlanEntity.java
.../wangtian/modules/manage/entity/InvestmentPlanEntity.java
+3
-5
InvestmentPlanForm.java
.../com/wangtian/modules/manage/form/InvestmentPlanForm.java
+4
-4
InvestmentPlanService.java
...angtian/modules/manage/service/InvestmentPlanService.java
+9
-1
InvestmentPlanServiceImpl.java
...odules/manage/service/impl/InvestmentPlanServiceImpl.java
+27
-0
No files found.
src/main/java/com/wangtian/modules/manage/controller/InvestmentPlanController.java
View file @
86b4cbee
package
com
.
wangtian
.
modules
.
manage
.
controller
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.wangtian.common.annotation.SysLog
;
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.InvestmentPlanEntity
;
import
com.wangtian.modules.manage.form.InvestmentPlanForm
;
import
com.wangtian.modules.manage.service.InvestmentPlanService
;
import
com.wangtian.modules.sys.controller.AbstractController
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -11,17 +18,16 @@ import java.util.Arrays;
import
java.util.Map
;
/**
* 投资计划管理表
*
* @author wudi
* @email 632132852@qq.com
* @date 2023-07-16
08:23:26
* @date 2023-07-16
17:09:57
*/
@RestController
@RequestMapping
(
"manage/investmentplan"
)
public
class
InvestmentPlanController
{
public
class
InvestmentPlanController
extends
AbstractController
{
@Autowired
private
InvestmentPlanService
investmentPlanService
;
...
...
@@ -29,8 +35,8 @@ public class InvestmentPlanController {
* 列表
*/
@RequestMapping
(
"/list"
)
//
@RequiresPermissions("manage:investmentplan:list")
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
){
//
@RequiresPermissions("manage:investmentplan:list")
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
PageUtils
page
=
investmentPlanService
.
queryPage
(
params
);
return
R
.
ok
().
put
(
"data"
,
page
);
...
...
@@ -42,42 +48,52 @@ public class InvestmentPlanController {
*/
@RequestMapping
(
"/info/{id}"
)
//@RequiresPermissions("manage:investmentplan:info")
public
R
info
(
@PathVariable
(
"id"
)
Long
id
)
{
public
R
info
(
@PathVariable
(
"id"
)
String
id
)
{
InvestmentPlanEntity
investmentPlan
=
investmentPlanService
.
getById
(
id
);
return
R
.
ok
().
put
(
"data"
,
investmentPlan
);
}
/**
* 保存
*/
@SysLog
(
"保存投资计划管理"
)
@RequestMapping
(
"/save"
)
// @RequiresPermissions("manage:investmentplan:save")
public
R
save
(
@RequestBody
InvestmentPlanEntity
investmentPlan
){
investmentPlanService
.
save
(
investmentPlan
);
//@RequiresPermissions("manage:investmentplan:save")
public
R
save
(
@RequestBody
InvestmentPlanForm
investmentPlan
)
{
//校验参数
ValidatorUtils
.
validateEntity
(
investmentPlan
,
AddGroup
.
class
);
//转化实体对象
InvestmentPlanEntity
investmentPlanEntity
=
new
InvestmentPlanEntity
();
BeanUtil
.
copyProperties
(
investmentPlan
,
investmentPlanEntity
);
investmentPlanService
.
saveInvestmentPlan
(
investmentPlanEntity
,
getUser
());
return
R
.
ok
();
}
/**
* 修改
*/
@SysLog
(
"修改投资计划管理"
)
@RequestMapping
(
"/update"
)
// @RequiresPermissions("manage:investmentplan:update")
public
R
update
(
@RequestBody
InvestmentPlanEntity
investmentPlan
){
investmentPlanService
.
updateById
(
investmentPlan
);
//@RequiresPermissions("manage:investmentplan:update")
public
R
update
(
@RequestBody
InvestmentPlanForm
investmentPlan
)
{
ValidatorUtils
.
validateEntity
(
investmentPlan
,
UpdateGroup
.
class
);
//转化实体对象
InvestmentPlanEntity
investmentPlanEntity
=
new
InvestmentPlanEntity
();
BeanUtil
.
copyProperties
(
investmentPlan
,
investmentPlanEntity
);
investmentPlanService
.
updateInvestmentPlanById
(
investmentPlanEntity
,
getUser
());
return
R
.
ok
();
}
/**
* 删除
*/
@SysLog
(
"删除投资计划管理"
)
@RequestMapping
(
"/delete"
)
//
@RequiresPermissions("manage:investmentplan:delete")
public
R
delete
(
@RequestBody
Long
[]
ids
)
{
//
@RequiresPermissions("manage:investmentplan:delete")
public
R
delete
(
@RequestBody
String
[]
ids
)
{
investmentPlanService
.
removeByIds
(
Arrays
.
asList
(
ids
));
return
R
.
ok
();
}
...
...
src/main/java/com/wangtian/modules/manage/dao/InvestmentPlanDao.java
View file @
86b4cbee
...
...
@@ -9,7 +9,7 @@ import org.apache.ibatis.annotations.Mapper;
*
* @author wudi
* @email 632132852@qq.com
* @date 2023-07-16
08:23:26
* @date 2023-07-16
17:09:57
*/
@Mapper
public
interface
InvestmentPlanDao
extends
BaseMapper
<
InvestmentPlanEntity
>
{
...
...
src/main/java/com/wangtian/modules/manage/entity/InvestmentPlanEntity.java
View file @
86b4cbee
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.math.BigDecimal
;
import
java.io.Serializable
;
import
java.util.Date
;
import
lombok.Data
;
/**
* 投资计划管理表
*
* @author wudi
* @email 632132852@qq.com
* @date 2023-07-16
08:23:26
* @date 2023-07-16
17:09:57
*/
@Data
@TableName
(
"pm_investment_plan"
)
...
...
@@ -99,7 +98,6 @@ public class InvestmentPlanEntity implements Serializable {
* 是否删除 0/未删除,1/删除
*/
@TableLogic
private
Integer
isDelete
;
}
src/main/java/com/wangtian/modules/manage/form/InvestmentPlanForm.java
View file @
86b4cbee
package
com
.
wangtian
.
modules
.
manage
.
form
;
import
com.wangtian.common.validator.group.AddGroup
;
import
com.wangtian.common.validator.group.UpdateGroup
;
import
lombok.Data
;
...
...
@@ -12,13 +11,14 @@ import java.math.BigDecimal;
import
java.util.Date
;
/**
* 投资计划管理表
*
* @author wudi
* @
date 2023/7/16
* @
comment
* @
email 632132852@qq.com
* @
date 2023-07-16 17:09:57
*/
@Data
public
class
InvestmentPlanForm
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@NotNull
(
message
=
"投资计划ID不能为空"
,
groups
=
{
UpdateGroup
.
class
})
...
...
src/main/java/com/wangtian/modules/manage/service/InvestmentPlanService.java
View file @
86b4cbee
...
...
@@ -3,6 +3,8 @@ package com.wangtian.modules.manage.service;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.wangtian.common.utils.PageUtils
;
import
com.wangtian.modules.manage.entity.InvestmentPlanEntity
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.wangtian.modules.sys.entity.SysUserEntity
;
import
java.util.Map
;
...
...
@@ -11,10 +13,16 @@ import java.util.Map;
*
* @author wudi
* @email 632132852@qq.com
* @date 2023-07-16
08:23:26
* @date 2023-07-16
17:09:57
*/
public
interface
InvestmentPlanService
extends
IService
<
InvestmentPlanEntity
>
{
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
);
@Transactional
void
saveInvestmentPlan
(
InvestmentPlanEntity
investmentPlanEntity
,
SysUserEntity
loginUser
);
@Transactional
void
updateInvestmentPlanById
(
InvestmentPlanEntity
investmentPlanEntity
,
SysUserEntity
loginUser
);
}
src/main/java/com/wangtian/modules/manage/service/impl/InvestmentPlanServiceImpl.java
View file @
86b4cbee
...
...
@@ -3,19 +3,28 @@ package com.wangtian.modules.manage.service.impl;
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.sitech.idworkstarter.IdWorkService
;
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
com.wangtian.modules.sys.entity.SysUserEntity
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.Map
;
@Service
(
"investmentPlanService"
)
public
class
InvestmentPlanServiceImpl
extends
ServiceImpl
<
InvestmentPlanDao
,
InvestmentPlanEntity
>
implements
InvestmentPlanService
{
@Autowired
IdWorkService
idWorkService
;
@Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
IPage
<
InvestmentPlanEntity
>
page
=
this
.
page
(
...
...
@@ -26,4 +35,22 @@ public class InvestmentPlanServiceImpl extends ServiceImpl<InvestmentPlanDao, In
return
new
PageUtils
(
page
);
}
@Override
public
void
updateInvestmentPlanById
(
InvestmentPlanEntity
investmentPlanEntity
,
SysUserEntity
loginUser
)
{
investmentPlanEntity
.
setUpdateTime
(
new
Date
());
investmentPlanEntity
.
setUpdateUserName
(
loginUser
.
getUsername
());
investmentPlanEntity
.
setUpdateUserId
(
loginUser
.
getUserId
());
baseMapper
.
updateById
(
investmentPlanEntity
);
}
@Override
public
void
saveInvestmentPlan
(
InvestmentPlanEntity
investmentPlanEntity
,
SysUserEntity
loginUser
)
{
investmentPlanEntity
.
setId
(
idWorkService
.
getSEQByKey
(
"id_seq"
));
investmentPlanEntity
.
setCreateUserId
(
loginUser
.
getUserId
());
investmentPlanEntity
.
setCreateUserName
(
loginUser
.
getUsername
());
investmentPlanEntity
.
setCreateTime
(
new
Date
());
baseMapper
.
insert
(
investmentPlanEntity
);
}
}
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