Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
smart-rack-base
Project
Project
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
耿迪迪
smart-rack-base
Commits
1fe1e635
Commit
1fe1e635
authored
Oct 16, 2025
by
耿迪迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
物料信息维护新增及关联关系表修改
parent
cc149f0a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
87 additions
and
49 deletions
+87
-49
TRackMaterialInfo.java
.../com/zehong/system/domain/material/TRackMaterialInfo.java
+11
-0
TRackMaterialRelation.java
.../zehong/system/domain/material/TRackMaterialRelation.java
+14
-1
TRackMaterialInfoServiceImpl.java
...m/service/impl/material/TRackMaterialInfoServiceImpl.java
+3
-0
TRackMaterialInfoMapper.xml
...ain/resources/mapper/material/TRackMaterialInfoMapper.xml
+7
-2
TRackMaterialRelationMapper.xml
...resources/mapper/material/TRackMaterialRelationMapper.xml
+22
-15
index.vue
smart-rack-base-web/src/views/materialmanage/info/index.vue
+25
-26
index.vue
...rack-base-web/src/views/materialmanage/relation/index.vue
+5
-5
No files found.
smart-rack-base-system/src/main/java/com/zehong/system/domain/material/TRackMaterialInfo.java
View file @
1fe1e635
...
...
@@ -30,6 +30,9 @@ public class TRackMaterialInfo extends BaseEntity
@Excel
(
name
=
"规格型号"
)
private
String
materialSpecifications
;
/** 是否删除 */
private
String
isDel
;
public
void
setMaterialId
(
Long
materialId
)
{
this
.
materialId
=
materialId
;
...
...
@@ -67,6 +70,14 @@ public class TRackMaterialInfo extends BaseEntity
return
materialSpecifications
;
}
public
String
getIsDel
()
{
return
isDel
;
}
public
void
setIsDel
(
String
isDel
)
{
this
.
isDel
=
isDel
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
...
...
smart-rack-base-system/src/main/java/com/zehong/system/domain/material/TRackMaterialRelation.java
View file @
1fe1e635
...
...
@@ -22,6 +22,9 @@ public class TRackMaterialRelation extends BaseEntity
@Excel
(
name
=
"料盘码"
)
private
String
rackCode
;
/** 物料主键 */
private
Long
materialId
;
/** 物料代码 */
@Excel
(
name
=
"物料代码"
)
private
String
materialCode
;
...
...
@@ -52,7 +55,16 @@ public class TRackMaterialRelation extends BaseEntity
{
return
rackCode
;
}
public
void
setMaterialCode
(
String
materialCode
)
public
Long
getMaterialId
()
{
return
materialId
;
}
public
void
setMaterialId
(
Long
materialId
)
{
this
.
materialId
=
materialId
;
}
public
void
setMaterialCode
(
String
materialCode
)
{
this
.
materialCode
=
materialCode
;
}
...
...
@@ -85,6 +97,7 @@ public class TRackMaterialRelation extends BaseEntity
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"relationId"
,
getRelationId
())
.
append
(
"rackCode"
,
getRackCode
())
.
append
(
"materialId"
,
getMaterialId
())
.
append
(
"materialCode"
,
getMaterialCode
())
.
append
(
"materialName"
,
getMaterialName
())
.
append
(
"materialSpecifications"
,
getMaterialSpecifications
())
...
...
smart-rack-base-system/src/main/java/com/zehong/system/service/impl/material/TRackMaterialInfoServiceImpl.java
View file @
1fe1e635
...
...
@@ -2,6 +2,7 @@ package com.zehong.system.service.impl.material;
import
java.util.List
;
import
com.zehong.common.utils.DateUtils
;
import
com.zehong.common.utils.SecurityUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.zehong.system.mapper.material.TRackMaterialInfoMapper
;
...
...
@@ -54,6 +55,7 @@ public class TRackMaterialInfoServiceImpl implements ITRackMaterialInfoService
public
int
insertTRackMaterialInfo
(
TRackMaterialInfo
tRackMaterialInfo
)
{
tRackMaterialInfo
.
setCreateTime
(
DateUtils
.
getNowDate
());
tRackMaterialInfo
.
setCreateBy
(
SecurityUtils
.
getLoginUser
().
getUser
().
getNickName
());
return
tRackMaterialInfoMapper
.
insertTRackMaterialInfo
(
tRackMaterialInfo
);
}
...
...
@@ -67,6 +69,7 @@ public class TRackMaterialInfoServiceImpl implements ITRackMaterialInfoService
public
int
updateTRackMaterialInfo
(
TRackMaterialInfo
tRackMaterialInfo
)
{
tRackMaterialInfo
.
setUpdateTime
(
DateUtils
.
getNowDate
());
tRackMaterialInfo
.
setUpdateBy
(
SecurityUtils
.
getLoginUser
().
getUser
().
getNickName
());
return
tRackMaterialInfoMapper
.
updateTRackMaterialInfo
(
tRackMaterialInfo
);
}
...
...
smart-rack-base-system/src/main/resources/mapper/material/TRackMaterialInfoMapper.xml
View file @
1fe1e635
...
...
@@ -13,6 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateBy"
column=
"update_by"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"isDel"
column=
"is_del"
/>
</resultMap>
<sql
id=
"selectTRackMaterialInfoVo"
>
...
...
@@ -21,8 +22,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"selectTRackMaterialInfoList"
parameterType=
"TRackMaterialInfo"
resultMap=
"TRackMaterialInfoResult"
>
<include
refid=
"selectTRackMaterialInfoVo"
/>
<where>
<if
test=
"materialCode != null and materialCode != ''"
>
and material_code = #{materialCode}
</if>
<where>
is_del = '0'
<if
test=
"materialCode != null and materialCode != ''"
>
and material_code like concat('%', #{materialCode}, '%')
</if>
<if
test=
"materialName != null and materialName != ''"
>
and material_name like concat('%', #{materialName}, '%')
</if>
<if
test=
"materialSpecifications != null and materialSpecifications != ''"
>
and material_specifications = #{materialSpecifications}
</if>
</where>
...
...
@@ -43,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateBy != null"
>
update_by,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
" isDel != null and isDel != ''"
>
is_del,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"materialCode != null and materialCode != ''"
>
#{materialCode},
</if>
...
...
@@ -52,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"createTime != null"
>
#{createTime},
</if>
<if
test=
"updateBy != null"
>
#{updateBy},
</if>
<if
test=
"updateTime != null"
>
#{updateTime},
</if>
<if
test=
" isDel != null and isDel != ''"
>
#{isDel},
</if>
</trim>
</insert>
...
...
@@ -65,6 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
<if
test=
"updateBy != null"
>
update_by = #{updateBy},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
<if
test=
"isDel != null and isDel != ''"
>
is_del = #{isDel},
</if>
</trim>
where material_id = #{materialId}
</update>
...
...
smart-rack-base-system/src/main/resources/mapper/material/TRackMaterialRelationMapper.xml
View file @
1fe1e635
...
...
@@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap
type=
"TRackMaterialRelation"
id=
"TRackMaterialRelationResult"
>
<result
property=
"relationId"
column=
"relation_id"
/>
<result
property=
"rackCode"
column=
"rack_code"
/>
<result
property=
"materialId"
column=
"material_id"
/>
<result
property=
"materialCode"
column=
"material_code"
/>
<result
property=
"materialName"
column=
"material_name"
/>
<result
property=
"materialSpecifications"
column=
"material_specifications"
/>
...
...
@@ -17,31 +18,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql
id=
"selectTRackMaterialRelationVo"
>
select relation_id, rack_code, material_code, material_name, material_specifications, create_by, create_time, update_by, update_time from t_rack_material_relation
SELECT
relation.relation_id,
relation.rack_code,
info.material_code,
info.material_name,
info.material_specifications,
relation.create_by,
relation.create_time,
relation.update_by,
relation.update_time
FROM
t_rack_material_relation relation
LEFT JOIN t_rack_material_info info ON info.material_id = relation.material_id
</sql>
<select
id=
"selectTRackMaterialRelationList"
parameterType=
"TRackMaterialRelation"
resultMap=
"TRackMaterialRelationResult"
>
<include
refid=
"selectTRackMaterialRelationVo"
/>
<where>
<if
test=
"rackCode != null and rackCode != ''"
>
and rack_code like concat('%', #{rackCode}, '%')
</if>
<if
test=
"materialCode != null and materialCode != ''"
>
and material_code like concat('%', #{materialCode}, '%')
</if>
<if
test=
"materialName != null and materialName != ''"
>
and material_name like concat('%', #{materialName}, '%')
</if>
<if
test=
"materialSpecifications != null and materialSpecifications != ''"
>
and material_specifications = #{materialSpecifications}
</if>
<if
test=
"rackCode != null and rackCode != ''"
>
and r
elation.r
ack_code like concat('%', #{rackCode}, '%')
</if>
<if
test=
"materialCode != null and materialCode != ''"
>
and
info.
material_code like concat('%', #{materialCode}, '%')
</if>
<if
test=
"materialName != null and materialName != ''"
>
and
info.
material_name like concat('%', #{materialName}, '%')
</if>
<if
test=
"materialSpecifications != null and materialSpecifications != ''"
>
and
info.
material_specifications = #{materialSpecifications}
</if>
</where>
</select>
<select
id=
"selectTRackMaterialRelationById"
parameterType=
"Long"
resultMap=
"TRackMaterialRelationResult"
>
<include
refid=
"selectTRackMaterialRelationVo"
/>
where relation_id = #{relationId}
where relation
.relation
_id = #{relationId}
</select>
<insert
id=
"insertTRackMaterialRelation"
parameterType=
"TRackMaterialRelation"
useGeneratedKeys=
"true"
keyProperty=
"relationId"
>
insert into t_rack_material_relation
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"rackCode != null and rackCode != ''"
>
rack_code,
</if>
<if
test=
"materialCode != null and materialCode != ''"
>
material_code,
</if>
<if
test=
"materialName != null"
>
material_name,
</if>
<if
test=
"materialSpecifications != null"
>
material_specifications,
</if>
<if
test=
"materialId != null and materialId != ''"
>
material_id,
</if>
<if
test=
"createBy != null"
>
create_by,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateBy != null"
>
update_by,
</if>
...
...
@@ -49,9 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"rackCode != null and rackCode != ''"
>
#{rackCode},
</if>
<if
test=
"materialCode != null and materialCode != ''"
>
#{materialCode},
</if>
<if
test=
"materialName != null"
>
#{materialName},
</if>
<if
test=
"materialSpecifications != null"
>
#{materialSpecifications},
</if>
<if
test=
"materialId != null and materialId != ''"
>
#{materialId},
</if>
<if
test=
"createBy != null"
>
#{createBy},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
<if
test=
"updateBy != null"
>
#{updateBy},
</if>
...
...
@@ -63,9 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update t_rack_material_relation
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"rackCode != null and rackCode != ''"
>
rack_code = #{rackCode},
</if>
<if
test=
"materialCode != null and materialCode != ''"
>
material_code = #{materialCode},
</if>
<if
test=
"materialName != null"
>
material_name = #{materialName},
</if>
<if
test=
"materialSpecifications != null"
>
material_specifications = #{materialSpecifications},
</if>
<if
test=
"materialId != null and materialId != ''"
>
material_id = #{materialId},
</if>
<if
test=
"createBy != null"
>
create_by = #{createBy},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
<if
test=
"updateBy != null"
>
update_by = #{updateBy},
</if>
...
...
smart-rack-base-web/src/views/materialmanage/info/index.vue
View file @
1fe1e635
...
...
@@ -10,19 +10,10 @@
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"名称"
prop=
"materialName"
>
<el-form-item
label=
"
物料
名称"
prop=
"materialName"
>
<el-input
v-model=
"queryParams.materialName"
placeholder=
"请输入名称"
clearable
size=
"small"
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"规格型号"
prop=
"materialSpecifications"
>
<el-input
v-model=
"queryParams.materialSpecifications"
placeholder=
"请输入规格型号"
placeholder=
"请输入物料名称"
clearable
size=
"small"
@
keyup
.
enter
.
native=
"handleQuery"
...
...
@@ -42,7 +33,6 @@
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
v-hasPermi=
"['system:info:add']"
>
新增
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
...
...
@@ -53,7 +43,6 @@
size=
"mini"
:disabled=
"single"
@
click=
"handleUpdate"
v-hasPermi=
"['system:info:edit']"
>
修改
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
...
...
@@ -64,7 +53,6 @@
size=
"mini"
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['system:info:remove']"
>
删除
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
...
...
@@ -75,7 +63,6 @@
size=
"mini"
:loading=
"exportLoading"
@
click=
"handleExport"
v-hasPermi=
"['system:info:export']"
>
导出
</el-button>
</el-col>
<right-toolbar
:showSearch
.
sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
...
...
@@ -83,10 +70,15 @@
<el-table
v-loading=
"loading"
:data=
"infoList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"主键"
align=
"center"
prop=
"materialId"
/>
<el-table-column
label=
"物料代码"
align=
"center"
prop=
"materialCode"
/>
<el-table-column
label=
"名称"
align=
"center"
prop=
"materialName"
/>
<el-table-column
label=
"
物料
名称"
align=
"center"
prop=
"materialName"
/>
<el-table-column
label=
"规格型号"
align=
"center"
prop=
"materialSpecifications"
/>
<el-table-column
label=
"创建时间"
align=
"center"
prop=
"createTime"
width=
"180"
>
<template
slot-scope=
"scope"
>
<span>
{{
parseTime
(
scope
.
row
.
createTime
,
'{y
}
-{m
}
-{d
}
{h
}
:{i
}
:{s
}
'
)
}}
<
/span
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"创建人"
align
=
"center"
prop
=
"createBy"
/>
<
el
-
table
-
column
label
=
"操作"
align
=
"center"
class
-
name
=
"small-padding fixed-width"
>
<
template
slot
-
scope
=
"scope"
>
<
el
-
button
...
...
@@ -94,19 +86,17 @@
type
=
"text"
icon
=
"el-icon-edit"
@
click
=
"handleUpdate(scope.row)"
v-hasPermi=
"['system:info:edit']"
>
修改
<
/el-button
>
<
el
-
button
size
=
"mini"
type
=
"text"
icon
=
"el-icon-delete"
@
click
=
"handleDelete(scope.row)"
v-hasPermi=
"['system:info:remove']"
>
删除
<
/el-button
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
<
pagination
v
-
show
=
"total>0"
:
total
=
"total"
...
...
@@ -121,7 +111,7 @@
<
el
-
form
-
item
label
=
"物料代码"
prop
=
"materialCode"
>
<
el
-
input
v
-
model
=
"form.materialCode"
placeholder
=
"请输入物料代码"
/>
<
/el-form-item
>
<el-form-item
label=
"名称"
prop=
"materialName"
>
<
el
-
form
-
item
label
=
"
物料
名称"
prop
=
"materialName"
>
<
el
-
input
v
-
model
=
"form.materialName"
placeholder
=
"请输入名称"
/>
<
/el-form-item
>
<
el
-
form
-
item
label
=
"规格型号"
prop
=
"materialSpecifications"
>
...
...
@@ -137,7 +127,7 @@
<
/template
>
<
script
>
import
{
listInfo
,
getInfo
,
delInfo
,
addInfo
,
updateInfo
,
exportInfo
}
from
"@/api/
system
/info"
;
import
{
listInfo
,
getInfo
,
delInfo
,
addInfo
,
updateInfo
,
exportInfo
}
from
"@/api/
material
/info"
;
export
default
{
name
:
"Info"
,
...
...
@@ -151,6 +141,7 @@ export default {
exportLoading
:
false
,
// 选中数组
ids
:
[],
materialCodes
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
...
...
@@ -180,6 +171,12 @@ export default {
materialCode
:
[
{
required
:
true
,
message
:
"物料代码不能为空"
,
trigger
:
"blur"
}
],
materialName
:
[
{
required
:
true
,
message
:
"物料名称不能为空"
,
trigger
:
"blur"
}
],
materialSpecifications
:
[
{
required
:
true
,
message
:
"规格型号不能为空"
,
trigger
:
"blur"
}
],
}
}
;
}
,
...
...
@@ -227,7 +224,8 @@ export default {
}
,
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
materialId
)
this
.
ids
=
selection
.
map
(
item
=>
item
.
materialId
);
this
.
materialCodes
=
selection
.
map
(
item
=>
item
.
materialCode
);
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
}
,
...
...
@@ -269,13 +267,14 @@ export default {
}
,
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
materialIds
=
row
.
materialId
||
this
.
ids
;
this
.
$confirm
(
'是否确认删除物料维护编号为"'
+
materialIds
+
'"的数据项?'
,
"警告"
,
{
//const materialIds = row.materialId || this.ids;
const
materialCodes
=
row
.
materialCode
||
this
.
materialCodes
;
this
.
$confirm
(
'是否确认删除物料维护代码为"'
+
materialCodes
+
'"的数据项?'
,
"警告"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
}
).
then
(
function
()
{
return
delInfo
(
materialIds
);
return
updateInfo
({
materialId
:
row
.
materialId
,
isDel
:
"1"
}
);
}
).
then
(()
=>
{
this
.
getList
();
this
.
msgSuccess
(
"删除成功"
);
...
...
smart-rack-base-web/src/views/materialmanage/relation/index.vue
View file @
1fe1e635
...
...
@@ -35,7 +35,7 @@
</el-form>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<!--
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
plain
...
...
@@ -63,7 +63,7 @@
:disabled=
"multiple"
@
click=
"handleDelete"
>
删除
</el-button>
</el-col>
</el-col>
-->
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
...
...
@@ -83,7 +83,7 @@
<el-table-column
label=
"物料代码"
align=
"center"
prop=
"materialCode"
/>
<el-table-column
label=
"名称"
align=
"center"
prop=
"materialName"
/>
<el-table-column
label=
"规格型号"
align=
"center"
prop=
"materialSpecifications"
/>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
!--
<
el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<template
slot-scope=
"scope"
>
<el-button
size=
"mini"
...
...
@@ -98,7 +98,7 @@
@
click=
"handleDelete(scope.row)"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table-column>
-->
</el-table>
<pagination
...
...
@@ -140,7 +140,7 @@
</template>
<
script
>
import
{
relationListInfo
,
listRelation
,
getRelation
,
delRelation
,
addRelation
,
updateRelation
,
exportRelation
}
from
"@/api/
shelf
/relation"
;
import
{
relationListInfo
,
listRelation
,
getRelation
,
delRelation
,
addRelation
,
updateRelation
,
exportRelation
}
from
"@/api/
material
/relation"
;
export
default
{
name
:
"Relation"
,
...
...
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