no message

This commit is contained in:
cb 2025-06-20 16:14:10 +08:00
parent c726bf91d4
commit a82b513755
2 changed files with 7 additions and 3 deletions

View File

@ -48,7 +48,8 @@
<label class="col-sm-3 control-label">类目类别:</label> <label class="col-sm-3 control-label">类目类别:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('goods_category_type')}"> <div class="radio-box" th:each="dict : ${@dict.getType('goods_category_type')}">
<input type="radio" th:id="${dict.dictCode}" name="type" th:value="${dict.dictValue}" th:checked="${dict.default}"> <input type="radio" th:id="${dict.dictCode}" name="type" th:value="${dict.dictValue}"
th:checked="${goodsCategory.type != null ? goodsCategory.type.toString() == dict.dictValue : dict.default}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label> <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div> </div>
</div> </div>

View File

@ -159,8 +159,11 @@ public class DeptGoodsCategoryServiceImpl implements DeptGoodsCategoryService {
GoodsCategory goodsCategory = goodsCategoryService.selectById(checked[0]); GoodsCategory goodsCategory = goodsCategoryService.selectById(checked[0]);
Assert.notNull(goodsCategory, "不存在该类目: " + checked[0]); Assert.notNull(goodsCategory, "不存在该类目: " + checked[0]);
List<DeptGoodsCategory> oldList = deptGoodsCategoryMapper.selectByDeptId(parentId); List<DeptGoodsCategory> oldList = deptGoodsCategoryMapper.selectByDeptId(parentId);
Map<Long, Long> oldMap = oldList.stream().filter(x -> x.getType().equals(goodsCategory.getType()))
.collect(Collectors.toMap(GoodsCategory::getGoodsCategoryId, DeptGoodsCategory::getDeptGoodsCategoryId)); Map<Long, Long> oldMap = oldList.stream()
.filter(x -> x.getType() != null && goodsCategory.getType() != null && x.getType().equals(goodsCategory.getType()))
.collect(Collectors.toMap(DeptGoodsCategory::getGoodsCategoryId, DeptGoodsCategory::getDeptGoodsCategoryId));
HashSet<Long> newSet = new HashSet<>(Arrays.asList(checked)); HashSet<Long> newSet = new HashSet<>(Arrays.asList(checked));
Set<Long> intersection = oldList.stream().map(DeptGoodsCategory::getGoodsCategoryId).collect(Collectors.toSet()); Set<Long> intersection = oldList.stream().map(DeptGoodsCategory::getGoodsCategoryId).collect(Collectors.toSet());
intersection.addAll(Arrays.asList(checked)); intersection.addAll(Arrays.asList(checked));