kangwei: 类别保存后,子类别不显示问题
正在显示
4 个修改的文件
包含
32 行增加
和
16 行删除
... | @@ -159,26 +159,26 @@ public class EquipmentSparepartTypeController { | ... | @@ -159,26 +159,26 @@ public class EquipmentSparepartTypeController { |
159 | if (equipmentSparepartTypeEntity == null) { | 159 | if (equipmentSparepartTypeEntity == null) { |
160 | result.error500("未找到对应实体"); | 160 | result.error500("未找到对应实体"); |
161 | } else { | 161 | } else { |
162 | if(StringUtils.isNotEmpty( equipmentSparepartType.getParentId() )){ | 162 | /*if(StringUtils.isNotEmpty( equipmentSparepartType.getParentId() )){ |
163 | EquipmentSparepartType parentSparepartType = equipmentSparepartTypeService.getById( equipmentSparepartType.getParentId() ); | 163 | EquipmentSparepartType parentSparepartType = equipmentSparepartTypeService.getById( equipmentSparepartType.getParentId() ); |
164 | equipmentSparepartType.setAncestors( parentSparepartType.getAncestors() +","+ equipmentSparepartType.getId()) ; | 164 | equipmentSparepartType.setAncestors( parentSparepartType.getAncestors() +","+ equipmentSparepartType.getId()) ; |
165 | // 跟新父节点节点状态 | 165 | //更新父级叶子节点状态 |
166 | if( parentSparepartType.getIsLeaf()){ | 166 | if( parentSparepartType.getIsLeaf()){ |
167 | parentSparepartType.setIsLeaf(false); | 167 | parentSparepartType.setIsLeaf(false); |
168 | equipmentSparepartTypeService.updateById( parentSparepartType ); | 168 | equipmentSparepartTypeService.updateById( parentSparepartType ); |
169 | } | 169 | } |
170 | } | 170 | }*/ |
171 | //修改信息 | ||
171 | boolean ok = equipmentSparepartTypeService.updateById(equipmentSparepartType); | 172 | boolean ok = equipmentSparepartTypeService.updateById(equipmentSparepartType); |
172 | 173 | /* //批量更改祖籍信息 | |
173 | //批量更改祖籍信息 | 174 | equipmentSparepartTypeService.updateAncestors(equipmentSparepartTypeEntity.getAncestors(), equipmentSparepartType.getAncestors() );*/ |
174 | equipmentSparepartTypeService.updateAncestors(equipmentSparepartTypeEntity.getAncestors(), equipmentSparepartType.getAncestors() ); | ||
175 | //更新父级叶子节点状态 | 175 | //更新父级叶子节点状态 |
176 | /* String parentId = equipmentSparepartType.getParentId(); | 176 | String parentId = equipmentSparepartType.getParentId(); |
177 | if(StringUtils.isNotEmpty(parentId)) { | 177 | if(StringUtils.isNotEmpty(parentId)) { |
178 | EquipmentSparepartType parentEquipmentSparepartTypeEntity = equipmentSparepartTypeService.getById(parentId); | 178 | EquipmentSparepartType parentEquipmentSparepartTypeEntity = equipmentSparepartTypeService.getById(parentId); |
179 | parentEquipmentSparepartTypeEntity.putIsLeaf(false); | 179 | parentEquipmentSparepartTypeEntity.putIsLeaf(false); |
180 | equipmentSparepartTypeService.updateById(parentEquipmentSparepartTypeEntity); | 180 | equipmentSparepartTypeService.updateById(parentEquipmentSparepartTypeEntity); |
181 | }*/ | 181 | } |
182 | if (ok) { | 182 | if (ok) { |
183 | result.success("修改成功!"); | 183 | result.success("修改成功!"); |
184 | } | 184 | } | ... | ... |
... | @@ -3,6 +3,7 @@ package com.skua.modules.supplies.entity; | ... | @@ -3,6 +3,7 @@ package com.skua.modules.supplies.entity; |
3 | import java.util.Date; | 3 | import java.util.Date; |
4 | 4 | ||
5 | import com.baomidou.mybatisplus.annotation.TableField; | 5 | import com.baomidou.mybatisplus.annotation.TableField; |
6 | import org.apache.commons.lang3.StringUtils; | ||
6 | import org.jeecgframework.poi.excel.annotation.Excel; | 7 | import org.jeecgframework.poi.excel.annotation.Excel; |
7 | import org.springframework.format.annotation.DateTimeFormat; | 8 | import org.springframework.format.annotation.DateTimeFormat; |
8 | 9 | ||
... | @@ -71,11 +72,11 @@ public class EquipmentSparepartType { | ... | @@ -71,11 +72,11 @@ public class EquipmentSparepartType { |
71 | */ | 72 | */ |
72 | @Excel(name = "是否叶子节点,1:是 0:不是", width = 15) | 73 | @Excel(name = "是否叶子节点,1:是 0:不是", width = 15) |
73 | @ApiModelProperty(value = "是否叶子节点,1:是 0:不是") | 74 | @ApiModelProperty(value = "是否叶子节点,1:是 0:不是") |
74 | private boolean isLeaf = true; | 75 | private Boolean isLeaf = true; |
75 | 76 | ||
76 | @Excel(name = "是否药剂,1:是 0:不是", width = 15) | 77 | @Excel(name = "是否药剂,1:是 0:不是", width = 15) |
77 | @ApiModelProperty(value = "是否药剂,1:是 0:不是") | 78 | @ApiModelProperty(value = "是否药剂,1:是 0:不是") |
78 | private boolean medicament = false; | 79 | private Boolean medicament ; |
79 | 80 | ||
80 | /** | 81 | /** |
81 | * 创建人 | 82 | * 创建人 |
... | @@ -112,12 +113,20 @@ public class EquipmentSparepartType { | ... | @@ -112,12 +113,20 @@ public class EquipmentSparepartType { |
112 | @ApiModelProperty(value = "删除状态 0正常 1已删除") | 113 | @ApiModelProperty(value = "删除状态 0正常 1已删除") |
113 | private Integer delFlag; | 114 | private Integer delFlag; |
114 | 115 | ||
115 | public boolean getIsLeaf() { | 116 | public Boolean getLeaf() { |
116 | return isLeaf; | 117 | return isLeaf; |
117 | } | 118 | } |
118 | 119 | ||
119 | public void setIsLeaf(boolean isLeaf) { | 120 | public void setLeaf(Boolean leaf) { |
120 | this.isLeaf = isLeaf; | 121 | isLeaf = leaf; |
122 | } | ||
123 | |||
124 | public Boolean getMedicament() { | ||
125 | return medicament; | ||
126 | } | ||
127 | |||
128 | public void setMedicament(Boolean medicament) { | ||
129 | this.medicament = medicament; | ||
121 | } | 130 | } |
122 | 131 | ||
123 | public void putIsLeaf(Boolean isLeaf) { | 132 | public void putIsLeaf(Boolean isLeaf) { |
... | @@ -126,4 +135,10 @@ public class EquipmentSparepartType { | ... | @@ -126,4 +135,10 @@ public class EquipmentSparepartType { |
126 | } | 135 | } |
127 | } | 136 | } |
128 | 137 | ||
138 | public String getAncestors() { | ||
139 | if(StringUtils.isEmpty(ancestors)){ | ||
140 | ancestors = id; | ||
141 | } | ||
142 | return ancestors; | ||
143 | } | ||
129 | } | 144 | } | ... | ... |
... | @@ -100,8 +100,8 @@ public class EquipmentSparepartTypeServiceImpl extends ServiceImpl<EquipmentSpar | ... | @@ -100,8 +100,8 @@ public class EquipmentSparepartTypeServiceImpl extends ServiceImpl<EquipmentSpar |
100 | queryWrapper.like("item_text",itemText); | 100 | queryWrapper.like("item_text",itemText); |
101 | } | 101 | } |
102 | List<EquipmentSparepartType> equipmentSparepartTypeList = this.list(queryWrapper); | 102 | List<EquipmentSparepartType> equipmentSparepartTypeList = this.list(queryWrapper); |
103 | if (equipmentSparepartType.isMedicament()) {//查询药剂类别 | 103 | if (equipmentSparepartType.getMedicament() != null) {//查询药剂类别 |
104 | queryWrapper.eq("medicament",equipmentSparepartType.isMedicament()); | 104 | queryWrapper.eq("medicament",equipmentSparepartType.getMedicament()); |
105 | //药剂的物料分类 | 105 | //药剂的物料分类 |
106 | List<EquipmentSparepartType> medicamentList = this.list(queryWrapper); | 106 | List<EquipmentSparepartType> medicamentList = this.list(queryWrapper); |
107 | equipmentSparepartTypeList = this.equipmentSparepartTypeListByMedicament(equipmentSparepartTypeList , medicamentList ); | 107 | equipmentSparepartTypeList = this.equipmentSparepartTypeListByMedicament(equipmentSparepartTypeList , medicamentList ); | ... | ... |
... | @@ -3,6 +3,7 @@ package com.skua.modules.supplies.vo; | ... | @@ -3,6 +3,7 @@ package com.skua.modules.supplies.vo; |
3 | import java.util.ArrayList; | 3 | import java.util.ArrayList; |
4 | import java.util.List; | 4 | import java.util.List; |
5 | 5 | ||
6 | import com.skua.core.util.ConvertUtils; | ||
6 | import com.skua.modules.supplies.entity.EquipmentSparepartType; | 7 | import com.skua.modules.supplies.entity.EquipmentSparepartType; |
7 | 8 | ||
8 | import io.swagger.annotations.ApiModelProperty; | 9 | import io.swagger.annotations.ApiModelProperty; |
... | @@ -41,7 +42,7 @@ public class EquipmentSparepartTypeVO { | ... | @@ -41,7 +42,7 @@ public class EquipmentSparepartTypeVO { |
41 | this.remark = entity.getRemark(); | 42 | this.remark = entity.getRemark(); |
42 | this.sort = entity.getSort(); | 43 | this.sort = entity.getSort(); |
43 | this.isLeaf = entity.getIsLeaf(); | 44 | this.isLeaf = entity.getIsLeaf(); |
44 | this.medicament = entity.isMedicament(); | 45 | this.medicament = entity.getMedicament(); |
45 | if (!entity.getIsLeaf()) { | 46 | if (!entity.getIsLeaf()) { |
46 | this.children = new ArrayList<>(); | 47 | this.children = new ArrayList<>(); |
47 | } | 48 | } | ... | ... |
-
请 注册 或 登录 后发表评论