Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
cebd7c16
提交
cebd7c16
authored
12月 23, 2020
作者:
吴德鹏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
属性管理
上级
0a1c16a2
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
30 行增加
和
22 行删除
+30
-22
AttributesController.java
...in/java/com/platform/controller/AttributesController.java
+2
-2
AttributesService.java
...src/main/java/com/platform/service/AttributesService.java
+2
-2
AttributesServiceImpl.java
...java/com/platform/service/impl/AttributesServiceImpl.java
+26
-18
没有找到文件。
platform-admin/src/main/java/com/platform/controller/AttributesController.java
浏览文件 @
cebd7c16
...
...
@@ -86,7 +86,7 @@ public class AttributesController {
@RequestMapping
(
"/save"
)
@RequiresPermissions
(
"attributes:save"
)
@ResponseBody
public
R
save
(
@RequestBody
AttributesE
xtends
attributes
)
{
public
R
save
(
@RequestBody
AttributesE
ntity
attributes
)
{
attributesService
.
save
(
attributes
);
return
R
.
ok
();
...
...
@@ -98,7 +98,7 @@ public class AttributesController {
@RequestMapping
(
"/update"
)
@RequiresPermissions
(
"attributes:update"
)
@ResponseBody
public
R
update
(
@RequestBody
AttributesE
xtends
attributes
)
{
public
R
update
(
@RequestBody
AttributesE
ntity
attributes
)
{
attributesService
.
update
(
attributes
);
return
R
.
ok
();
...
...
platform-admin/src/main/java/com/platform/service/AttributesService.java
浏览文件 @
cebd7c16
...
...
@@ -44,7 +44,7 @@ public interface AttributesService {
* @param attributes 实体
* @return 保存条数
*/
int
save
(
AttributesE
xtends
attributes
);
int
save
(
AttributesE
ntity
attributes
);
/**
* 根据主键更新实体
...
...
@@ -52,7 +52,7 @@ public interface AttributesService {
* @param attributes 实体
* @return 更新条数
*/
int
update
(
AttributesE
xtends
attributes
);
int
update
(
AttributesE
ntity
attributes
);
/**
* 根据主键删除
...
...
platform-admin/src/main/java/com/platform/service/impl/AttributesServiceImpl.java
浏览文件 @
cebd7c16
...
...
@@ -43,7 +43,7 @@ public class AttributesServiceImpl implements AttributesService {
}
@Override
public
int
save
(
AttributesE
xtends
attributes
)
{
public
int
save
(
AttributesE
ntity
attributes
)
{
//属性
String
id
=
IdUtil
.
createIdbyUUID
();
attributes
.
setId
(
id
);
...
...
@@ -53,30 +53,38 @@ public class AttributesServiceImpl implements AttributesService {
int
res1
=
attributesDao
.
save
(
attributes
);
//属性描述
AttributesDescEntity
descEntity
=
new
AttributesDescEntity
();
descEntity
.
setAttrDescId
(
IdUtil
.
createIdbyUUID
());
descEntity
.
setAttrId
(
id
);
descEntity
.
setAttrValue
(
attributes
.
getAttrValue
());
descEntity
.
setAttrDesc
(
attributes
.
getAttrDesc
());
descEntity
.
setStatus
(
1
);
descEntity
.
setCreateTime
(
date
);
descEntity
.
setUpdateTime
(
date
);
int
res2
=
attributesDescDao
.
save
(
descEntity
);
List
<
AttributesDescEntity
>
descs
=
attributes
.
getDescs
();
descs
.
forEach
(
desc
->
{
AttributesDescEntity
descEntity
=
new
AttributesDescEntity
();
descEntity
.
setAttrDescId
(
IdUtil
.
createIdbyUUID
());
descEntity
.
setAttrId
(
id
);
descEntity
.
setAttrValue
(
desc
.
getAttrValue
());
descEntity
.
setAttrDesc
(
desc
.
getAttrDesc
());
descEntity
.
setStatus
(
1
);
descEntity
.
setCreateTime
(
date
);
descEntity
.
setUpdateTime
(
date
);
attributesDescDao
.
save
(
descEntity
);
});
return
(
res1
>
0
&&
res2
>
0
)
?
1
:
0
;
return
res1
;
}
@Override
public
int
update
(
AttributesE
xtends
attributes
)
{
public
int
update
(
AttributesE
ntity
attributes
)
{
Date
date
=
new
Date
();
attributes
.
setUpdateTime
(
date
);
int
res1
=
attributesDao
.
update
(
attributes
);
AttributesDescEntity
descEntity
=
attributesDescDao
.
queryObject
(
attributes
.
getAttrDescId
());
descEntity
.
setAttrValue
(
attributes
.
getAttrValue
());
descEntity
.
setAttrDesc
(
attributes
.
getAttrDesc
());
descEntity
.
setUpdateTime
(
date
);
int
res2
=
attributesDescDao
.
update
(
descEntity
);
return
(
res1
>
0
&&
res2
>
0
)
?
1
:
0
;
List
<
AttributesDescEntity
>
descs
=
attributes
.
getDescs
();
descs
.
forEach
(
attr
->
{
AttributesDescEntity
descEntity
=
attributesDescDao
.
queryObject
(
attr
.
getAttrDescId
());
descEntity
.
setAttrValue
(
attr
.
getAttrValue
());
descEntity
.
setAttrDesc
(
attr
.
getAttrDesc
());
descEntity
.
setUpdateTime
(
date
);
attributesDescDao
.
update
(
descEntity
);
});
return
res1
;
}
@Override
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论