Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张雷
/
skboot-zhongye
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
1cf23567
由
张雷
编写于
2025-01-07 16:39:33 +0800
浏览文件
选项
浏览文件
标签
下载
差异文件
Merge remote-tracking branch 'origin/master' into master
2 个父辈
20a50c69
c861f32c
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
69 行增加
和
17 行删除
sk-module-equipment/src/main/java/com/skua/modules/supplies/controller/web/EquipmentSparepartTypeController.java
sk-module-equipment/src/main/java/com/skua/modules/supplies/entity/EquipmentSparepartType.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/vo/EquipmentSparepartTypeVO.java
sk-module-equipment/src/main/java/com/skua/modules/supplies/controller/web/EquipmentSparepartTypeController.java
查看文件 @
1cf2356
...
...
@@ -159,26 +159,33 @@ public class EquipmentSparepartTypeController {
if
(
equipmentSparepartTypeEntity
==
null
)
{
result
.
error500
(
"未找到对应实体"
);
}
else
{
if
(
StringUtils
.
isNotEmpty
(
equipmentSparepartType
.
getParentId
()
)){
/*
if(StringUtils.isNotEmpty( equipmentSparepartType.getParentId() )){
EquipmentSparepartType parentSparepartType = equipmentSparepartTypeService.getById( equipmentSparepartType.getParentId() );
equipmentSparepartType.setAncestors( parentSparepartType.getAncestors() +","+ equipmentSparepartType.getId()) ;
//
跟新父节点
节点状态
//
更新父级叶子
节点状态
if( parentSparepartType.getIsLeaf()){
parentSparepartType.setIsLeaf(false);
equipmentSparepartTypeService.updateById( parentSparepartType );
}
}
boolean
ok
=
equipmentSparepartTypeService
.
updateById
(
equipmentSparepartType
);
}*/
//批量更改祖籍信息
equipmentSparepartTypeService
.
updateAncestors
(
equipmentSparepartTypeEntity
.
getAncestors
(),
equipmentSparepartType
.
getAncestors
()
);
String
parentAncestors
=
null
;
//更新父级叶子节点状态
/*
String parentId = equipmentSparepartType.getParentId();
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/entity/EquipmentSparepartType.java
查看文件 @
1cf2356
...
...
@@ -3,6 +3,7 @@ package com.skua.modules.supplies.entity;
import
java.util.Date
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
org.apache.commons.lang3.StringUtils
;
import
org.jeecgframework.poi.excel.annotation.Excel
;
import
org.springframework.format.annotation.DateTimeFormat
;
...
...
@@ -71,11 +72,11 @@ public class EquipmentSparepartType {
*/
@Excel
(
name
=
"是否叶子节点,1:是 0:不是"
,
width
=
15
)
@ApiModelProperty
(
value
=
"是否叶子节点,1:是 0:不是"
)
private
b
oolean
isLeaf
=
true
;
private
B
oolean
isLeaf
=
true
;
@Excel
(
name
=
"是否药剂,1:是 0:不是"
,
width
=
15
)
@ApiModelProperty
(
value
=
"是否药剂,1:是 0:不是"
)
private
boolean
medicament
=
false
;
private
Boolean
medicament
;
/**
* 创建人
...
...
@@ -112,12 +113,20 @@ public class EquipmentSparepartType {
@ApiModelProperty
(
value
=
"删除状态 0正常 1已删除"
)
private
Integer
delFlag
;
public
boolean
getIs
Leaf
()
{
public
Boolean
get
Leaf
()
{
return
isLeaf
;
}
public
void
setIsLeaf
(
boolean
isLeaf
)
{
this
.
isLeaf
=
isLeaf
;
public
void
setLeaf
(
Boolean
leaf
)
{
isLeaf
=
leaf
;
}
public
Boolean
getMedicament
()
{
return
medicament
;
}
public
void
setMedicament
(
Boolean
medicament
)
{
this
.
medicament
=
medicament
;
}
public
void
putIsLeaf
(
Boolean
isLeaf
)
{
...
...
@@ -126,4 +135,10 @@ public class EquipmentSparepartType {
}
}
public
String
getAncestors
()
{
if
(
StringUtils
.
isEmpty
(
ancestors
)){
ancestors
=
id
;
}
return
ancestors
;
}
}
...
...
sk-module-equipment/src/main/java/com/skua/modules/supplies/mapper/EquipmentSparepartTypeMapper.java
查看文件 @
1cf2356
...
...
@@ -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
查看文件 @
1cf2356
...
...
@@ -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
查看文件 @
1cf2356
...
...
@@ -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
查看文件 @
1cf2356
...
...
@@ -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
...
...
@@ -100,8 +108,8 @@ public class EquipmentSparepartTypeServiceImpl extends ServiceImpl<EquipmentSpar
queryWrapper
.
like
(
"item_text"
,
itemText
);
}
List
<
EquipmentSparepartType
>
equipmentSparepartTypeList
=
this
.
list
(
queryWrapper
);
if
(
equipmentSparepartType
.
isMedicament
()
)
{
//查询药剂类别
queryWrapper
.
eq
(
"medicament"
,
equipmentSparepartType
.
is
Medicament
());
if
(
equipmentSparepartType
.
getMedicament
()
!=
null
)
{
//查询药剂类别
queryWrapper
.
eq
(
"medicament"
,
equipmentSparepartType
.
get
Medicament
());
//药剂的物料分类
List
<
EquipmentSparepartType
>
medicamentList
=
this
.
list
(
queryWrapper
);
equipmentSparepartTypeList
=
this
.
equipmentSparepartTypeListByMedicament
(
equipmentSparepartTypeList
,
medicamentList
);
...
...
sk-module-equipment/src/main/java/com/skua/modules/supplies/vo/EquipmentSparepartTypeVO.java
查看文件 @
1cf2356
...
...
@@ -3,6 +3,7 @@ package com.skua.modules.supplies.vo;
import
java.util.ArrayList
;
import
java.util.List
;
import
com.skua.core.util.ConvertUtils
;
import
com.skua.modules.supplies.entity.EquipmentSparepartType
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -41,7 +42,7 @@ public class EquipmentSparepartTypeVO {
this
.
remark
=
entity
.
getRemark
();
this
.
sort
=
entity
.
getSort
();
this
.
isLeaf
=
entity
.
getIsLeaf
();
this
.
medicament
=
entity
.
is
Medicament
();
this
.
medicament
=
entity
.
get
Medicament
();
if
(!
entity
.
getIsLeaf
())
{
this
.
children
=
new
ArrayList
<>();
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论