|
@@ -144,11 +144,9 @@ public class MaterialServiceImpl implements MaterialService {
|
|
|
//1-查询物料对象
|
|
|
BaseMaterial material = baseMaterialMapper.selectById(req.getId());
|
|
|
AssertUtil.isNull(material, "物料不存在");
|
|
|
-
|
|
|
//转化出参
|
|
|
- GetMaterialRes res = PojoConverterUtils.copy(material, GetMaterialRes.class);
|
|
|
+ return PojoConverterUtils.copy(material, GetMaterialRes.class);
|
|
|
|
|
|
- return res;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -158,17 +156,15 @@ public class MaterialServiceImpl implements MaterialService {
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void enableMaterial(EnableMaterialReq req) {
|
|
|
List<Long> ids = req.getIds();
|
|
|
-
|
|
|
//循环启用
|
|
|
+ // fixme 这里使用批量操作
|
|
|
for (Long id : ids) {
|
|
|
//1-查询活动对象
|
|
|
BaseMaterial material = baseMaterialMapper.selectById(id);
|
|
|
AssertUtil.isNull(material, "物料不存在");
|
|
|
-
|
|
|
if (!ValidEnum.NOT_VALID.is(material.getValid())) {
|
|
|
continue;
|
|
|
}
|
|
|
-
|
|
|
//2-修改状态
|
|
|
material.setValid(ValidEnum.VALID.getCode());
|
|
|
baseMaterialMapper.updateById(material);
|
|
@@ -182,7 +178,7 @@ public class MaterialServiceImpl implements MaterialService {
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void disableMaterial(DisableMaterialReq req) {
|
|
|
List<Long> ids = req.getIds();
|
|
|
-
|
|
|
+ // fixme 这里使用批量操作
|
|
|
//循环禁用
|
|
|
for (Long id : ids) {
|
|
|
//1-查询活动对象
|