|
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
import com.glxp.api.dao.basic.SysWorkplaceFreightMapper;
|
|
|
|
|
import com.glxp.api.entity.basic.SysWorkplaceFreight;
|
|
|
|
|
import com.glxp.api.entity.basic.SysWorkplaceLayer;
|
|
|
|
|
import com.glxp.api.entity.basic.SysWorkplaceQueue;
|
|
|
|
|
import com.glxp.api.exception.JsonException;
|
|
|
|
|
import com.glxp.api.req.basic.SysWorkplaceFreightRequest;
|
|
|
|
@ -29,6 +30,9 @@ public class SysWorkplaceFreightService extends ServiceImpl<SysWorkplaceFreightM
|
|
|
|
|
@Resource
|
|
|
|
|
private SysWorkplaceQueueService sysWorkplaceQueueService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private SysWorkplaceLayerService sysWorkplaceLayerService;
|
|
|
|
|
|
|
|
|
|
public boolean WorkplaceFreight(SysWorkplaceFreight workplaceFreight) {
|
|
|
|
|
SysWorkplaceFreight sysWorkplaceFreight = sysWorkplaceFreightMapper.selectOne(new LambdaQueryWrapper<SysWorkplaceFreight>().eq(SysWorkplaceFreight::getName, workplaceFreight.getName()));
|
|
|
|
|
if (sysWorkplaceFreight != null) {
|
|
|
|
@ -52,10 +56,11 @@ public class SysWorkplaceFreightService extends ServiceImpl<SysWorkplaceFreightM
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean removeFreight(SysWorkplaceFreight workplaceFreight) {
|
|
|
|
|
//如果有货位 是直接删除下面货位 还是不让删除
|
|
|
|
|
List<SysWorkplaceQueue> list = sysWorkplaceQueueService.list(new LambdaQueryWrapper<SysWorkplaceQueue>().eq(SysWorkplaceQueue::getFreightCode, workplaceFreight.getCode()));
|
|
|
|
|
//如果有摆货层 不可以删除
|
|
|
|
|
List<SysWorkplaceLayer> list = sysWorkplaceLayerService.list(new LambdaQueryWrapper<SysWorkplaceLayer>().eq(SysWorkplaceLayer::getFreightCode, workplaceFreight.getCode()));
|
|
|
|
|
// List<SysWorkplaceQueue> list = sysWorkplaceQueueService.list(new LambdaQueryWrapper<SysWorkplaceQueue>().eq(SysWorkplaceQueue::getFreightCode, workplaceFreight.getCode()));
|
|
|
|
|
if (list.size() > 0 ){
|
|
|
|
|
throw new JsonException(500,"当前货架已有货位,请先移除货位!");
|
|
|
|
|
throw new JsonException(500,"删除失败,请先删除摆货层!");
|
|
|
|
|
}
|
|
|
|
|
int i = sysWorkplaceFreightMapper.deleteById(workplaceFreight);
|
|
|
|
|
return true;
|
|
|
|
|