重复验证
This commit is contained in:
@@ -2,6 +2,7 @@ package com.cnbm.packing.service;
|
||||
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.service.CrudService;
|
||||
import com.cnbm.packing.dto.IdVo;
|
||||
import com.cnbm.packing.dto.ProductLevelDTO;
|
||||
import com.cnbm.packing.entity.ProductLevel;
|
||||
|
||||
@@ -27,5 +28,8 @@ public interface ProductLevelServiceBiz extends CrudService<ProductLevel, Produc
|
||||
void delete(Long[] ids);
|
||||
|
||||
List<ProductLevelDTO> list();
|
||||
|
||||
|
||||
IdVo add(ProductLevelDTO dto);
|
||||
|
||||
IdVo edit(ProductLevelDTO dto);
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.cnbm.packing.service;
|
||||
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.service.CrudService;
|
||||
import com.cnbm.packing.dto.IdVo;
|
||||
import com.cnbm.packing.dto.ScenesDTO;
|
||||
import com.cnbm.packing.entity.Scenes;
|
||||
|
||||
@@ -22,10 +23,14 @@ public interface ScenesServiceBiz extends CrudService<Scenes, ScenesDTO> {
|
||||
|
||||
void save(ScenesDTO dto);
|
||||
|
||||
IdVo add(ScenesDTO dto);
|
||||
|
||||
void update(ScenesDTO dto);
|
||||
|
||||
IdVo edit(ScenesDTO dto);
|
||||
|
||||
void delete(Long[] ids);
|
||||
|
||||
List<ScenesDTO> list();
|
||||
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.cnbm.packing.service;
|
||||
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.service.CrudService;
|
||||
import com.cnbm.packing.dto.IdVo;
|
||||
import com.cnbm.packing.dto.WorkingTimeDTO;
|
||||
import com.cnbm.packing.dto.WorkingTimeDTO;
|
||||
import com.cnbm.packing.entity.WorkingTime;
|
||||
@@ -31,4 +32,8 @@ public interface WorkingTimeServiceBiz extends CrudService<WorkingTime, WorkingT
|
||||
List<WorkingTimeDTO> list();
|
||||
|
||||
String getOrderName(LocalDateTime time);
|
||||
|
||||
IdVo add(WorkingTimeDTO dto);
|
||||
|
||||
IdVo edit(WorkingTimeDTO dto);
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import com.cnbm.admin.utils.BaseSupportUtils;
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||
import com.cnbm.common.utils.ConvertUtils;
|
||||
import com.cnbm.packing.dto.IdVo;
|
||||
import com.cnbm.packing.dto.ProductLevelDTO;
|
||||
import com.cnbm.packing.entity.ProductLevel;
|
||||
import com.cnbm.packing.mapper.ProductLevelMapper;
|
||||
@@ -64,6 +65,16 @@ public class ProductLevelServiceBizImpl extends CrudServiceImpl<ProductLevelMapp
|
||||
insert(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public IdVo add(ProductLevelDTO dto) {
|
||||
ProductLevel entity = ConvertUtils.sourceToTarget(dto, ProductLevel.class);
|
||||
BaseSupportUtils.setCommonField(entity);
|
||||
insert(entity);
|
||||
return IdVo.builder().id(entity.getId()).build();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(ProductLevelDTO dto) {
|
||||
@@ -72,6 +83,15 @@ public class ProductLevelServiceBizImpl extends CrudServiceImpl<ProductLevelMapp
|
||||
updateById(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public IdVo edit(ProductLevelDTO dto) {
|
||||
ProductLevel entity = ConvertUtils.sourceToTarget(dto, ProductLevel.class);
|
||||
BaseSupportUtils.setUpdateCommonField(entity);
|
||||
updateById(entity);
|
||||
return IdVo.builder().id(entity.getId()).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Long[] ids) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.cnbm.admin.utils.BaseSupportUtils;
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||
import com.cnbm.common.utils.ConvertUtils;
|
||||
import com.cnbm.packing.dto.IdVo;
|
||||
import com.cnbm.packing.dto.ScenesDTO;
|
||||
import com.cnbm.packing.entity.Scenes;
|
||||
import com.cnbm.packing.mapper.ScenesMapper;
|
||||
@@ -86,5 +87,22 @@ public class ScenesServiceBizImpl extends CrudServiceImpl<ScenesMapper, Scenes,
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public IdVo add(ScenesDTO dto) {
|
||||
Scenes entity = ConvertUtils.sourceToTarget(dto, Scenes.class);
|
||||
BaseSupportUtils.setCommonField(entity);
|
||||
insert(entity);
|
||||
return IdVo.builder().id(entity.getId()).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public IdVo edit(ScenesDTO dto) {
|
||||
Scenes entity = ConvertUtils.sourceToTarget(dto, Scenes.class);
|
||||
BaseSupportUtils.setUpdateCommonField(entity);
|
||||
updateById(entity);
|
||||
return IdVo.builder().id(entity.getId()).build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||
|
||||
import com.cnbm.common.utils.ConvertUtils;
|
||||
import com.cnbm.packing.dto.IdVo;
|
||||
import com.cnbm.packing.dto.WorkingTimeDTO;
|
||||
import com.cnbm.packing.entity.WorkingTime;
|
||||
import com.cnbm.packing.mapper.WorkingTimeMapper;
|
||||
@@ -72,6 +73,17 @@ public class WorkingTimeServiceBizImpl extends CrudServiceImpl<WorkingTimeMapper
|
||||
insert(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public IdVo add(WorkingTimeDTO dto) {
|
||||
//验证时间段不重合
|
||||
timeOverlap(dto);
|
||||
WorkingTime entity = ConvertUtils.sourceToTarget(dto, WorkingTime.class);
|
||||
BaseSupportUtils.setCommonField(entity);
|
||||
insert(entity);
|
||||
return IdVo.builder().id(entity.getId()).build();
|
||||
}
|
||||
|
||||
public void timeOverlap(WorkingTimeDTO newTime){
|
||||
List<WorkingTimeDTO> dtoList = list();
|
||||
LocalTime newBeginTime = newTime.getBeginTime().toLocalTime();
|
||||
@@ -115,6 +127,18 @@ public class WorkingTimeServiceBizImpl extends CrudServiceImpl<WorkingTimeMapper
|
||||
updateById(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public IdVo edit(WorkingTimeDTO dto) {
|
||||
//验证时间段不重合
|
||||
timeOverlap(dto);
|
||||
WorkingTime entity = ConvertUtils.sourceToTarget(dto, WorkingTime.class);
|
||||
BaseSupportUtils.setUpdateCommonField(entity);
|
||||
updateById(entity);
|
||||
return IdVo.builder().id(entity.getId()).build();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Long[] ids) {
|
||||
@@ -154,5 +178,4 @@ public class WorkingTimeServiceBizImpl extends CrudServiceImpl<WorkingTimeMapper
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user