Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
skboot-zhongye
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
c861f32c
由
康伟
编写于
2025-01-07 15:49:40 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
kangwei: 类别保存后,子类别不显示问题,级联修改子类的药剂属性
1 个父辈
60eb8789
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
41 行增加
和
5 行删除
sk-module-equipment/src/main/java/com/skua/modules/supplies/controller/web/EquipmentSparepartTypeController.java
sk-module-equipment/src/main/java/com/skua/modules/supplies/mapper/EquipmentSparepartTypeMapper.java
sk-module-equipment/src/main/java/com/skua/modules/supplies/mapper/xml/EquipmentSparepartTypeMapper.xml
sk-module-equipment/src/main/java/com/skua/modules/supplies/service/IEquipmentSparepartTypeService.java
sk-module-equipment/src/main/java/com/skua/modules/supplies/service/impl/EquipmentSparepartTypeServiceImpl.java
sk-module-equipment/src/main/java/com/skua/modules/supplies/controller/web/EquipmentSparepartTypeController.java
查看文件 @
c861f32
...
...
@@ -168,17 +168,24 @@ public class EquipmentSparepartTypeController {
equipmentSparepartTypeService.updateById( parentSparepartType );
}
}*/
//修改信息
boolean
ok
=
equipmentSparepartTypeService
.
updateById
(
equipmentSparepartType
);
/* //批量更改祖籍信息
equipmentSparepartTypeService.updateAncestors(equipmentSparepartTypeEntity.getAncestors(), equipmentSparepartType.getAncestors() );*/
String
parentAncestors
=
null
;
//更新父级叶子节点状态
String
parentId
=
equipmentSparepartType
.
getParentId
();
if
(
StringUtils
.
isNotEmpty
(
parentId
))
{
EquipmentSparepartType
parentEquipmentSparepartTypeEntity
=
equipmentSparepartTypeService
.
getById
(
parentId
);
parentEquipmentSparepartTypeEntity
.
putIsLeaf
(
false
);
equipmentSparepartTypeService
.
updateById
(
parentEquipmentSparepartTypeEntity
);
//获取祖籍信息
parentAncestors
=
parentEquipmentSparepartTypeEntity
.
getAncestors
();
}
//批量更改祖籍信息
//equipmentSparepartTypeService.updateAncestors(equipmentSparepartTypeEntity.getAncestors(), equipmentSparepartType.getAncestors() );
//修改信息
equipmentSparepartType
.
setAncestors
(
parentAncestors
+
","
+
equipmentSparepartType
.
getId
())
;
//批量修改是否药剂
equipmentSparepartTypeService
.
batchUpateMedicament
(
equipmentSparepartType
.
getId
()
,
equipmentSparepartType
.
getMedicament
());
boolean
ok
=
equipmentSparepartTypeService
.
updateById
(
equipmentSparepartType
);
if
(
ok
)
{
result
.
success
(
"修改成功!"
);
}
...
...
sk-module-equipment/src/main/java/com/skua/modules/supplies/mapper/EquipmentSparepartTypeMapper.java
查看文件 @
c861f32
...
...
@@ -15,4 +15,11 @@ public interface EquipmentSparepartTypeMapper extends BaseMapper<EquipmentSparep
* @param newAncestors
*/
public
void
updateAncestors
(
@Param
(
"oldAncestors"
)
String
oldAncestors
,
@Param
(
"newAncestors"
)
String
newAncestors
);
/***
* 批量修改子类的药剂属性
* @param parentId
* @return
*/
int
batchUpateMedicament
(
@Param
(
"parentId"
)
String
parentId
,
@Param
(
"medicament"
)
Boolean
medicament
);
}
...
...
sk-module-equipment/src/main/java/com/skua/modules/supplies/mapper/xml/EquipmentSparepartTypeMapper.xml
查看文件 @
c861f32
...
...
@@ -6,4 +6,12 @@
<update
id=
"updateAncestors"
>
update equipment_sparepart_type set ancestors = REPLACE(ancestors,#{oldAncestors}, #{newAncestors});
</update>
</mapper>
\ No newline at end of file
<!-- 批量修改子类的药剂属性 -->
<update
id=
"batchUpateMedicament"
>
update equipment_sparepart_type set medicament = #{medicament} where ancestors like CONCAT(CONCAT('%', #{parentId}),'%')
</update>
</mapper>
...
...
sk-module-equipment/src/main/java/com/skua/modules/supplies/service/IEquipmentSparepartTypeService.java
查看文件 @
c861f32
...
...
@@ -49,4 +49,10 @@ public interface IEquipmentSparepartTypeService extends IService<EquipmentSparep
* @return
*/
List
<
EquipmentSparepartTypeVO
>
querySparepartTypeListByTree
(
EquipmentSparepartType
equipmentSparepartType
);
/***
*批量修改子类的药剂属性
* @param parentId
*/
int
batchUpateMedicament
(
String
parentId
,
Boolean
medicament
);
}
...
...
sk-module-equipment/src/main/java/com/skua/modules/supplies/service/impl/EquipmentSparepartTypeServiceImpl.java
查看文件 @
c861f32
...
...
@@ -88,6 +88,14 @@ public class EquipmentSparepartTypeServiceImpl extends ServiceImpl<EquipmentSpar
return
voList
;
}
/***
* 批量修改子类的药剂属性
* @param parentId
*/
public
int
batchUpateMedicament
(
String
parentId
,
Boolean
medicament
){
return
this
.
baseMapper
.
batchUpateMedicament
(
parentId
,
medicament
);
}
/***
* 查询物料类别集合-返回列表
* @param equipmentSparepartType
* @return
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论