|
|
@@ -1,6 +1,7 @@
|
|
|
package cn.iocoder.yudao.module.iscs.service.sop;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
+import cn.hutool.core.lang.Assert;
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
import cn.iocoder.yudao.module.iscs.controller.admin.sop.vo.SopPointsPageReqVO;
|
|
|
@@ -30,13 +31,15 @@ public class SopPointsServiceImpl extends ServiceImpl<SopPointsMapper, SopPoints
|
|
|
private SopPointsMapper sopPointsMapper;
|
|
|
|
|
|
@Override
|
|
|
- public Long createSopPoints(SopPointsSaveReqVO createReqVO) {
|
|
|
- // 插入
|
|
|
- SopPointsDO sopPoints = BeanUtils.toBean(createReqVO, SopPointsDO.class);
|
|
|
- sopPointsMapper.insert(sopPoints);
|
|
|
-
|
|
|
+ public Boolean createSopPoints(List<SopPointsSaveReqVO> list) {
|
|
|
+ Assert.isFalse(list.isEmpty(), "请给我点位信息!");
|
|
|
+ for (SopPointsSaveReqVO vo : list) {
|
|
|
+ // 插入
|
|
|
+ SopPointsDO sopPoints = BeanUtils.toBean(vo, SopPointsDO.class);
|
|
|
+ sopPointsMapper.insert(sopPoints);
|
|
|
+ }
|
|
|
// 返回
|
|
|
- return sopPoints.getId();
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -48,20 +51,12 @@ public class SopPointsServiceImpl extends ServiceImpl<SopPointsMapper, SopPoints
|
|
|
sopPointsMapper.updateById(updateObj);
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public void deleteSopPoints(Long id) {
|
|
|
- // 校验存在
|
|
|
- validateSopPointsExists(id);
|
|
|
- // 删除
|
|
|
- sopPointsMapper.deleteById(id);
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public void deleteSopPointsListByIds(List<Long> ids) {
|
|
|
// 校验存在
|
|
|
validateSopPointsExists(ids);
|
|
|
// 删除
|
|
|
- sopPointsMapper.deleteByIds(ids);
|
|
|
+ sopPointsMapper.physicalDeleteByIds(ids);
|
|
|
}
|
|
|
|
|
|
private void validateSopPointsExists(List<Long> ids) {
|