Merge remote-tracking branch 'origin/master' into master
正在显示
7 个修改的文件
包含
69 行增加
和
17 行删除
... | @@ -159,26 +159,33 @@ public class EquipmentSparepartTypeController { | ... | @@ -159,26 +159,33 @@ 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 | boolean ok = equipmentSparepartTypeService.updateById(equipmentSparepartType); | ||
172 | 171 | ||
173 | //批量更改祖籍信息 | 172 | String parentAncestors = null; |
174 | equipmentSparepartTypeService.updateAncestors(equipmentSparepartTypeEntity.getAncestors(), equipmentSparepartType.getAncestors() ); | ||
175 | //更新父级叶子节点状态 | 173 | //更新父级叶子节点状态 |
176 | /* String parentId = equipmentSparepartType.getParentId(); | 174 | String parentId = equipmentSparepartType.getParentId(); |
177 | if(StringUtils.isNotEmpty(parentId)) { | 175 | if(StringUtils.isNotEmpty(parentId)) { |
178 | EquipmentSparepartType parentEquipmentSparepartTypeEntity = equipmentSparepartTypeService.getById(parentId); | 176 | EquipmentSparepartType parentEquipmentSparepartTypeEntity = equipmentSparepartTypeService.getById(parentId); |
179 | parentEquipmentSparepartTypeEntity.putIsLeaf(false); | 177 | parentEquipmentSparepartTypeEntity.putIsLeaf(false); |
180 | equipmentSparepartTypeService.updateById(parentEquipmentSparepartTypeEntity); | 178 | equipmentSparepartTypeService.updateById(parentEquipmentSparepartTypeEntity); |
181 | }*/ | 179 | //获取祖籍信息 |
180 | parentAncestors = parentEquipmentSparepartTypeEntity.getAncestors(); | ||
181 | } | ||
182 | //批量更改祖籍信息 | ||
183 | //equipmentSparepartTypeService.updateAncestors(equipmentSparepartTypeEntity.getAncestors(), equipmentSparepartType.getAncestors() ); | ||
184 | //修改信息 | ||
185 | equipmentSparepartType.setAncestors( parentAncestors +","+ equipmentSparepartType.getId()) ; | ||
186 | //批量修改是否药剂 | ||
187 | equipmentSparepartTypeService.batchUpateMedicament( equipmentSparepartType.getId() ,equipmentSparepartType.getMedicament()); | ||
188 | boolean ok = equipmentSparepartTypeService.updateById(equipmentSparepartType); | ||
182 | if (ok) { | 189 | if (ok) { |
183 | result.success("修改成功!"); | 190 | result.success("修改成功!"); |
184 | } | 191 | } | ... | ... |
... | @@ -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 | } | ... | ... |
sk-module-equipment/src/main/java/com/skua/modules/supplies/mapper/EquipmentSparepartTypeMapper.java
... | @@ -15,4 +15,11 @@ public interface EquipmentSparepartTypeMapper extends BaseMapper<EquipmentSparep | ... | @@ -15,4 +15,11 @@ public interface EquipmentSparepartTypeMapper extends BaseMapper<EquipmentSparep |
15 | * @param newAncestors | 15 | * @param newAncestors |
16 | */ | 16 | */ |
17 | public void updateAncestors(@Param("oldAncestors") String oldAncestors,@Param("newAncestors") String newAncestors); | 17 | public void updateAncestors(@Param("oldAncestors") String oldAncestors,@Param("newAncestors") String newAncestors); |
18 | |||
19 | /*** | ||
20 | * 批量修改子类的药剂属性 | ||
21 | * @param parentId | ||
22 | * @return | ||
23 | */ | ||
24 | int batchUpateMedicament(@Param("parentId") String parentId,@Param("medicament") Boolean medicament); | ||
18 | } | 25 | } | ... | ... |
... | @@ -6,4 +6,12 @@ | ... | @@ -6,4 +6,12 @@ |
6 | <update id="updateAncestors"> | 6 | <update id="updateAncestors"> |
7 | update equipment_sparepart_type set ancestors = REPLACE(ancestors,#{oldAncestors}, #{newAncestors}); | 7 | update equipment_sparepart_type set ancestors = REPLACE(ancestors,#{oldAncestors}, #{newAncestors}); |
8 | </update> | 8 | </update> |
9 | </mapper> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
9 | |||
10 | |||
11 | <!-- 批量修改子类的药剂属性 --> | ||
12 | <update id="batchUpateMedicament"> | ||
13 | update equipment_sparepart_type set medicament = #{medicament} where ancestors like CONCAT(CONCAT('%', #{parentId}),'%') | ||
14 | </update> | ||
15 | |||
16 | |||
17 | </mapper> | ... | ... |
... | @@ -49,4 +49,10 @@ public interface IEquipmentSparepartTypeService extends IService<EquipmentSparep | ... | @@ -49,4 +49,10 @@ public interface IEquipmentSparepartTypeService extends IService<EquipmentSparep |
49 | * @return | 49 | * @return |
50 | */ | 50 | */ |
51 | List<EquipmentSparepartTypeVO> querySparepartTypeListByTree(EquipmentSparepartType equipmentSparepartType); | 51 | List<EquipmentSparepartTypeVO> querySparepartTypeListByTree(EquipmentSparepartType equipmentSparepartType); |
52 | |||
53 | /*** | ||
54 | *批量修改子类的药剂属性 | ||
55 | * @param parentId | ||
56 | */ | ||
57 | int batchUpateMedicament(String parentId,Boolean medicament); | ||
52 | } | 58 | } | ... | ... |
... | @@ -88,6 +88,14 @@ public class EquipmentSparepartTypeServiceImpl extends ServiceImpl<EquipmentSpar | ... | @@ -88,6 +88,14 @@ public class EquipmentSparepartTypeServiceImpl extends ServiceImpl<EquipmentSpar |
88 | return voList; | 88 | return voList; |
89 | } | 89 | } |
90 | /*** | 90 | /*** |
91 | * 批量修改子类的药剂属性 | ||
92 | * @param parentId | ||
93 | */ | ||
94 | public int batchUpateMedicament(String parentId,Boolean medicament){ | ||
95 | return this.baseMapper.batchUpateMedicament(parentId,medicament); | ||
96 | } | ||
97 | |||
98 | /*** | ||
91 | * 查询物料类别集合-返回列表 | 99 | * 查询物料类别集合-返回列表 |
92 | * @param equipmentSparepartType | 100 | * @param equipmentSparepartType |
93 | * @return | 101 | * @return |
... | @@ -100,8 +108,8 @@ public class EquipmentSparepartTypeServiceImpl extends ServiceImpl<EquipmentSpar | ... | @@ -100,8 +108,8 @@ public class EquipmentSparepartTypeServiceImpl extends ServiceImpl<EquipmentSpar |
100 | queryWrapper.like("item_text",itemText); | 108 | queryWrapper.like("item_text",itemText); |
101 | } | 109 | } |
102 | List<EquipmentSparepartType> equipmentSparepartTypeList = this.list(queryWrapper); | 110 | List<EquipmentSparepartType> equipmentSparepartTypeList = this.list(queryWrapper); |
103 | if (equipmentSparepartType.isMedicament()) {//查询药剂类别 | 111 | if (equipmentSparepartType.getMedicament() != null) {//查询药剂类别 |
104 | queryWrapper.eq("medicament",equipmentSparepartType.isMedicament()); | 112 | queryWrapper.eq("medicament",equipmentSparepartType.getMedicament()); |
105 | //药剂的物料分类 | 113 | //药剂的物料分类 |
106 | List<EquipmentSparepartType> medicamentList = this.list(queryWrapper); | 114 | List<EquipmentSparepartType> medicamentList = this.list(queryWrapper); |
107 | equipmentSparepartTypeList = this.equipmentSparepartTypeListByMedicament(equipmentSparepartTypeList , medicamentList ); | 115 | 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 | } | ... | ... |
-
请 注册 或 登录 后发表评论