|
|
@ -3,18 +3,18 @@ package com.gaotao.modules.toolman.service.impl; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
|
import com.gaotao.common.exception.XJException; |
|
|
import com.gaotao.common.utils.PageUtils; |
|
|
import com.gaotao.common.utils.PageUtils; |
|
|
import com.gaotao.common.utils.R; |
|
|
import com.gaotao.common.utils.R; |
|
|
import com.gaotao.modules.toolman.dao.LocationMapper; |
|
|
import com.gaotao.modules.toolman.dao.LocationMapper; |
|
|
|
|
|
import com.gaotao.modules.toolman.dao.ToolDetailMapper; |
|
|
|
|
|
import com.gaotao.modules.toolman.dao.ToolTransDetailMapper; |
|
|
import com.gaotao.modules.toolman.entity.Location; |
|
|
import com.gaotao.modules.toolman.entity.Location; |
|
|
import com.gaotao.modules.toolman.query.LocationQuery; |
|
|
import com.gaotao.modules.toolman.query.LocationQuery; |
|
|
import com.gaotao.modules.toolman.service.LocationService; |
|
|
import com.gaotao.modules.toolman.service.LocationService; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Auther: Zuowenwen |
|
|
* @Auther: Zuowenwen |
|
|
* @Date:2021/07/07 10:39 |
|
|
* @Date:2021/07/07 10:39 |
|
|
@ -26,6 +26,12 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
|
|
@Autowired |
|
|
@Autowired |
|
|
private LocationMapper locationMapper; |
|
|
private LocationMapper locationMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ToolDetailMapper toolDetailMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ToolTransDetailMapper transDetailDao; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public PageUtils getLocationList(LocationQuery locationQuery) { |
|
|
public PageUtils getLocationList(LocationQuery locationQuery) { |
|
|
|
|
|
|
|
|
@ -55,9 +61,15 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
|
|
return R.ok("操作成功!"); |
|
|
return R.ok("操作成功!"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void delLocation(LocationQuery locationQuery) { |
|
|
public void delLocation(LocationQuery locationQuery) { |
|
|
|
|
|
|
|
|
|
|
|
// 工具使用库位数量 |
|
|
|
|
|
int toolCount = toolDetailMapper.getLocationCount(locationQuery); |
|
|
|
|
|
int transCount = transDetailDao.getLocationCount(locationQuery); |
|
|
|
|
|
if (toolCount > 0 || transCount > 0) { |
|
|
|
|
|
throw new XJException("该库位,还存在工具不能删除"); |
|
|
|
|
|
} |
|
|
locationMapper.deleteLocation(locationQuery); |
|
|
locationMapper.deleteLocation(locationQuery); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|