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
c9f2c1b7
Commit
c9f2c1b7
authored
Jul 16, 2023
by
吴迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改】投资计划、字典表相关代码
parent
32894af0
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
70 additions
and
30 deletions
+70
-30
SysDictController.java
...wangtian/modules/manage/controller/SysDictController.java
+2
-15
SysDictItemController.java
...tian/modules/manage/controller/SysDictItemController.java
+2
-15
SysDictItemService.java
...m/wangtian/modules/manage/service/SysDictItemService.java
+5
-0
SysDictService.java
...a/com/wangtian/modules/manage/service/SysDictService.java
+9
-0
SysDictItemServiceImpl.java
...n/modules/manage/service/impl/SysDictItemServiceImpl.java
+27
-0
SysDictServiceImpl.java
...gtian/modules/manage/service/impl/SysDictServiceImpl.java
+25
-0
No files found.
src/main/java/com/wangtian/modules/manage/controller/SysDictController.java
View file @
c9f2c1b7
...
...
@@ -12,12 +12,10 @@ 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
;
...
...
@@ -70,13 +68,7 @@ public class SysDictController extends AbstractController {
//转化实体对象
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
);
sysDictService
.
saveSysDict
(
sysDictEntity
,
getUser
());
return
R
.
ok
();
}
...
...
@@ -91,12 +83,7 @@ public class SysDictController extends AbstractController {
//转化实体对象
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
);
sysDictService
.
updateSysDictById
(
sysDictEntity
,
getUser
());
return
R
.
ok
();
}
...
...
src/main/java/com/wangtian/modules/manage/controller/SysDictItemController.java
View file @
c9f2c1b7
...
...
@@ -12,12 +12,10 @@ import com.wangtian.modules.manage.entity.SysDictItemEntity;
import
com.wangtian.modules.manage.form.SysDictItemForm
;
import
com.wangtian.modules.manage.service.SysDictItemService
;
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
;
...
...
@@ -72,13 +70,7 @@ public class SysDictItemController extends AbstractController {
//转化实体对象
SysDictItemEntity
sysDictItemEntity
=
new
SysDictItemEntity
();
BeanUtil
.
copyProperties
(
sysDictItemForm
,
sysDictItemEntity
);
sysDictItemEntity
.
setId
(
idWorkService
.
getSEQByKey
(
"id_seq"
));
//获取登录用户信息
SysUserEntity
loginUser
=
getUser
();
sysDictItemEntity
.
setCreateUserId
(
loginUser
.
getUserId
());
sysDictItemEntity
.
setCreateUserName
(
loginUser
.
getUsername
());
sysDictItemEntity
.
setCreateTime
(
new
Date
());
sysDictItemService
.
save
(
sysDictItemEntity
);
sysDictItemService
.
saveDictItem
(
sysDictItemEntity
,
getUser
());
return
R
.
ok
();
}
...
...
@@ -93,12 +85,7 @@ public class SysDictItemController extends AbstractController {
//转化实体对象
SysDictItemEntity
sysDictItemEntity
=
new
SysDictItemEntity
();
BeanUtil
.
copyProperties
(
sysDictItemForm
,
sysDictItemEntity
);
//获取登录用户信息
SysUserEntity
loginUser
=
getUser
();
sysDictItemEntity
.
setUpdateTime
(
new
Date
());
sysDictItemEntity
.
setUpdateUserName
(
loginUser
.
getUsername
());
sysDictItemEntity
.
setUpdateUserId
(
loginUser
.
getUserId
());
sysDictItemService
.
updateById
(
sysDictItemEntity
);
sysDictItemService
.
updateSysDictItemById
(
sysDictItemEntity
,
getUser
());
return
R
.
ok
();
}
...
...
src/main/java/com/wangtian/modules/manage/service/SysDictItemService.java
View file @
c9f2c1b7
...
...
@@ -3,6 +3,7 @@ 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.SysDictItemEntity
;
import
com.wangtian.modules.sys.entity.SysUserEntity
;
import
java.util.Map
;
...
...
@@ -16,5 +17,9 @@ import java.util.Map;
public
interface
SysDictItemService
extends
IService
<
SysDictItemEntity
>
{
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
);
void
updateSysDictItemById
(
SysDictItemEntity
sysDictItem
,
SysUserEntity
loginUser
);
void
saveDictItem
(
SysDictItemEntity
sysDictItem
,
SysUserEntity
loginUser
);
}
src/main/java/com/wangtian/modules/manage/service/SysDictService.java
View file @
c9f2c1b7
...
...
@@ -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.SysDictEntity
;
import
com.wangtian.modules.sys.entity.SysUserEntity
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Map
;
...
...
@@ -16,5 +18,12 @@ import java.util.Map;
public
interface
SysDictService
extends
IService
<
SysDictEntity
>
{
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
);
@Transactional
void
saveSysDict
(
SysDictEntity
sysDictEntity
,
SysUserEntity
loginUser
);
@Transactional
void
updateSysDictById
(
SysDictEntity
sysDictEntity
,
SysUserEntity
loginUser
);
}
src/main/java/com/wangtian/modules/manage/service/impl/SysDictItemServiceImpl.java
View file @
c9f2c1b7
...
...
@@ -3,19 +3,26 @@ 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.SysDictItemDao
;
import
com.wangtian.modules.manage.entity.SysDictItemEntity
;
import
com.wangtian.modules.manage.service.SysDictItemService
;
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
(
"sysDictItemService"
)
public
class
SysDictItemServiceImpl
extends
ServiceImpl
<
SysDictItemDao
,
SysDictItemEntity
>
implements
SysDictItemService
{
@Autowired
IdWorkService
idWorkService
;
@Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
IPage
<
SysDictItemEntity
>
page
=
this
.
page
(
...
...
@@ -28,4 +35,24 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemDao, SysDictI
return
new
PageUtils
(
page
);
}
@Override
public
void
updateSysDictItemById
(
SysDictItemEntity
sysDictItem
,
SysUserEntity
loginUser
)
{
sysDictItem
.
setId
(
idWorkService
.
getSEQByKey
(
"id_seq"
));
//获取登录用户信息
sysDictItem
.
setCreateUserId
(
loginUser
.
getUserId
());
sysDictItem
.
setCreateUserName
(
loginUser
.
getUsername
());
sysDictItem
.
setCreateTime
(
new
Date
());
baseMapper
.
updateById
(
sysDictItem
);
}
@Override
public
void
saveDictItem
(
SysDictItemEntity
sysDictItem
,
SysUserEntity
loginUser
)
{
sysDictItem
.
setId
(
idWorkService
.
getSEQByKey
(
"id_seq"
));
//获取登录用户信息
sysDictItem
.
setCreateUserId
(
loginUser
.
getUserId
());
sysDictItem
.
setCreateUserName
(
loginUser
.
getUsername
());
sysDictItem
.
setCreateTime
(
new
Date
());
baseMapper
.
insert
(
sysDictItem
);
}
}
src/main/java/com/wangtian/modules/manage/service/impl/SysDictServiceImpl.java
View file @
c9f2c1b7
...
...
@@ -3,19 +3,26 @@ 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.SysDictDao
;
import
com.wangtian.modules.manage.entity.SysDictEntity
;
import
com.wangtian.modules.manage.service.SysDictService
;
import
com.wangtian.modules.sys.entity.SysUserEntity
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.Map
;
@Service
(
"sysDictService"
)
public
class
SysDictServiceImpl
extends
ServiceImpl
<
SysDictDao
,
SysDictEntity
>
implements
SysDictService
{
@Autowired
IdWorkService
idWorkService
;
@Override
public
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
)
{
...
...
@@ -29,4 +36,22 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictDao, SysDictEntity> i
return
new
PageUtils
(
page
);
}
@Override
public
void
saveSysDict
(
SysDictEntity
sysDictEntity
,
SysUserEntity
loginUser
)
{
sysDictEntity
.
setId
(
idWorkService
.
getSEQByKey
(
"id_seq"
));
//获取登录用户信息
sysDictEntity
.
setCreateUserId
(
loginUser
.
getUserId
());
sysDictEntity
.
setCreateUserName
(
loginUser
.
getUsername
());
sysDictEntity
.
setCreateTime
(
new
Date
());
baseMapper
.
insert
(
sysDictEntity
);
}
@Override
public
void
updateSysDictById
(
SysDictEntity
sysDictEntity
,
SysUserEntity
loginUser
)
{
sysDictEntity
.
setUpdateTime
(
new
Date
());
sysDictEntity
.
setUpdateUserName
(
loginUser
.
getUsername
());
sysDictEntity
.
setUpdateUserId
(
loginUser
.
getUserId
());
baseMapper
.
updateById
(
sysDictEntity
);
}
}
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