Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
skboot-zhongye
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
7438018c
由
康伟
编写于
2024-12-17 16:08:41 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
kangwei: material_info 表添加:user_id 用户编号
1 个父辈
e8480097
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
15 行增加
和
7 行删除
sk-module-biz/src/main/java/com/skua/modules/material/controller/MaterialInfoController.java
sk-module-biz/src/main/java/com/skua/modules/material/entity/MaterialInfo.java
sk-module-biz/src/main/java/com/skua/modules/material/controller/MaterialInfoController.java
查看文件 @
7438018
...
...
@@ -154,6 +154,8 @@ public class MaterialInfoController {
Page
<
MaterialInfo
>
page
=
new
Page
<
MaterialInfo
>(
pageNo
,
pageSize
);
QueryWrapper
<
MaterialInfo
>
queryWrapper
=
getMaterialInfoQueryWrapper
(
materialInfo
);
//queryWrapper.in("status","'1','2'");
queryWrapper
.
eq
(
"user_id"
,
BaseContextHandler
.
getUserId
());
IPage
<
MaterialInfo
>
pageList
=
materialInfoService
.
page
(
page
,
queryWrapper
);
result
.
setSuccess
(
true
);
result
.
setResult
(
pageList
);
...
...
@@ -164,14 +166,16 @@ public class MaterialInfoController {
private
QueryWrapper
<
MaterialInfo
>
getMaterialInfoQueryWrapper
(
MaterialInfo
materialInfo
){
QueryWrapper
<
MaterialInfo
>
queryWrapper
=
new
QueryWrapper
();
String
departIds
=
null
;
if
(
StringUtils
.
isBlank
(
materialInfo
.
getDepartId
())&&
StringUtils
.
isNotBlank
(
BaseContextHandler
.
getDeparts
()))
{
departIds
=
departService
.
getChildDepartId
(
BaseContextHandler
.
getDeparts
());
}
else
{
if
(
StringUtils
.
isNotEmpty
(
materialInfo
.
getDepartId
()))
{
//departIds = departService.getChildDepartId(BaseContextHandler.getDeparts());
departIds
=
departService
.
getChildDepartId
(
materialInfo
.
getDepartId
());
}
else
{
departIds
=
BaseContextHandler
.
getDeparts
();
}
// Page<MaterialInfo> page = new Page<ErpSettlement>(pageNo, pageSize);
queryWrapper
.
eq
(
"del_flag"
,
"0"
);
queryWrapper
.
in
(
"depart_id"
,
JSUtils
.
quoteEach
(
departIds
,
","
));
// queryWrapper.eq("depart_id",materialInfo.getDepartId());
//queryWrapper.in("depart_id", JSUtils.quoteEach(departIds,","));
if
(
StringUtils
.
isNotEmpty
(
materialInfo
.
getFacInformationtype
())){
queryWrapper
.
eq
(
"fac_informationtype"
,
materialInfo
.
getFacInformationtype
());
}
...
...
@@ -188,6 +192,7 @@ public class MaterialInfoController {
if
(
StringUtils
.
isNotEmpty
(
materialInfo
.
getStandardsType
())){
queryWrapper
.
eq
(
"standards_type"
,
materialInfo
.
getStandardsType
());
}
queryWrapper
.
orderByDesc
(
"create_time"
);
return
queryWrapper
;
}
...
...
@@ -206,9 +211,10 @@ public class MaterialInfoController {
Result
<
MaterialInfo
>
result
=
new
Result
<
MaterialInfo
>();
try
{
if
(
StringUtils
.
isBlank
(
materialInfo
.
getDepartId
()))
{
String
userCode
=
BaseContextHandler
.
getUserId
();
//
String userCode = BaseContextHandler.getUserId();
//根据用户id查询所属厂区 只要第一个
materialInfo
.
setDepartId
(
materialInfoService
.
queryFacByUserId
(
userCode
));
//materialInfo.setDepartId(materialInfoService.queryFacByUserId(userCode));
materialInfo
.
setDepartId
(
BaseContextHandler
.
getRealDepartId
());
}
materialInfoService
.
save
(
materialInfo
);
result
.
success
(
"添加成功!"
);
...
...
sk-module-biz/src/main/java/com/skua/modules/material/entity/MaterialInfo.java
查看文件 @
7438018
...
...
@@ -41,6 +41,9 @@ public class MaterialInfo {
/**删除状态(0,正常,1已删除)*/
@ApiModelProperty
(
value
=
"删除状态(0,正常,1已删除)"
)
private
String
delFlag
;
@ApiModelProperty
(
value
=
"用户编号"
)
private
String
userId
;
/**创建人*/
@Excel
(
name
=
"创建人"
,
width
=
15
,
dictTable
=
"sys_user"
,
dicCode
=
"username"
,
dicText
=
"realname"
,
orderNum
=
"6"
)
@ApiModelProperty
(
value
=
"创建人"
)
...
...
@@ -56,7 +59,6 @@ public class MaterialInfo {
@ApiModelProperty
(
value
=
"更新人"
)
private
String
updateBy
;
/**更新时间*/
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
value
=
"更新时间"
)
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论