修复BUG
This commit is contained in:
parent
faa93f5d7b
commit
79d23c9e99
@ -1,31 +1,29 @@
|
||||
package com.ktg.mes.wm.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import com.ktg.mes.md.mapper.BaseKnifeMapper;
|
||||
import com.ktg.mes.wm.domain.WmStorageArea;
|
||||
import com.ktg.mes.wm.domain.WmStorageLocation;
|
||||
import com.ktg.mes.wm.domain.vo.WmStorageLocationVo;
|
||||
import com.ktg.mes.wm.mapper.WmStorageAreaMapper;
|
||||
import org.apache.catalina.User;
|
||||
import com.ktg.mes.wm.mapper.WmStorageLocationMapper;
|
||||
import com.ktg.mes.wm.service.IWmStorageLocationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.wm.mapper.WmStorageLocationMapper;
|
||||
import com.ktg.mes.wm.domain.WmStorageLocation;
|
||||
import com.ktg.mes.wm.service.IWmStorageLocationService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 库区设置Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-07
|
||||
*/
|
||||
@Service
|
||||
public class WmStorageLocationServiceImpl implements IWmStorageLocationService
|
||||
{
|
||||
public class WmStorageLocationServiceImpl implements IWmStorageLocationService {
|
||||
@Autowired
|
||||
private WmStorageLocationMapper wmStorageLocationMapper;
|
||||
|
||||
@ -37,13 +35,12 @@ public class WmStorageLocationServiceImpl implements IWmStorageLocationService
|
||||
|
||||
/**
|
||||
* 查询库区设置
|
||||
*
|
||||
*
|
||||
* @param locationId 库区设置主键
|
||||
* @return 库区设置
|
||||
*/
|
||||
@Override
|
||||
public WmStorageLocation selectWmStorageLocationByLocationId(Long locationId)
|
||||
{
|
||||
public WmStorageLocation selectWmStorageLocationByLocationId(Long locationId) {
|
||||
return wmStorageLocationMapper.selectWmStorageLocationByLocationId(locationId);
|
||||
}
|
||||
|
||||
@ -54,10 +51,10 @@ public class WmStorageLocationServiceImpl implements IWmStorageLocationService
|
||||
* @return 库区设置
|
||||
*/
|
||||
@Override
|
||||
public WmStorageLocationVo selectWmStorageLocationVoByLocationId(Long locationId)
|
||||
{
|
||||
public WmStorageLocationVo selectWmStorageLocationVoByLocationId(Long locationId) {
|
||||
return wmStorageLocationMapper.selectWmStorageLocationByVoLocationId(locationId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WmStorageLocation selectWmStorageLocationByLocationCode(String locationCode) {
|
||||
return wmStorageLocationMapper.selectWmStorageLocationByLocationCode(locationCode);
|
||||
@ -65,13 +62,12 @@ public class WmStorageLocationServiceImpl implements IWmStorageLocationService
|
||||
|
||||
/**
|
||||
* 查询库区设置列表
|
||||
*
|
||||
*
|
||||
* @param wmStorageLocation 库区设置
|
||||
* @return 库区设置
|
||||
*/
|
||||
@Override
|
||||
public List<WmStorageLocation> selectWmStorageLocationList(WmStorageLocation wmStorageLocation)
|
||||
{
|
||||
public List<WmStorageLocation> selectWmStorageLocationList(WmStorageLocation wmStorageLocation) {
|
||||
return wmStorageLocationMapper.selectWmStorageLocationList(wmStorageLocation);
|
||||
}
|
||||
|
||||
@ -82,16 +78,15 @@ public class WmStorageLocationServiceImpl implements IWmStorageLocationService
|
||||
* @return 库区设置
|
||||
*/
|
||||
@Override
|
||||
public List<WmStorageLocationVo> selectWmStorageLocationListVo(WmStorageLocation wmStorageLocation)
|
||||
{
|
||||
public List<WmStorageLocationVo> selectWmStorageLocationListVo(WmStorageLocation wmStorageLocation) {
|
||||
return wmStorageLocationMapper.selectWmStorageLocationListVo(wmStorageLocation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkLocationCodeUnique(WmStorageLocation wmStorageLocation) {
|
||||
WmStorageLocation location = wmStorageLocationMapper.checkLocationCodeUnique(wmStorageLocation);
|
||||
Long locationId = wmStorageLocation.getLocationId()==null?-1L:wmStorageLocation.getLocationId();
|
||||
if(StringUtils.isNotNull(location) && location.getLocationId().longValue() != locationId.longValue()){
|
||||
Long locationId = wmStorageLocation.getLocationId() == null ? -1L : wmStorageLocation.getLocationId();
|
||||
if (StringUtils.isNotNull(location) && location.getLocationId().longValue() != locationId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
@ -100,8 +95,8 @@ public class WmStorageLocationServiceImpl implements IWmStorageLocationService
|
||||
@Override
|
||||
public String checkLocationNameUnique(WmStorageLocation wmStorageLocation) {
|
||||
WmStorageLocation location = wmStorageLocationMapper.checkLocationNameUnique(wmStorageLocation);
|
||||
Long locationId = wmStorageLocation.getLocationId()==null?-1L:wmStorageLocation.getLocationId();
|
||||
if(StringUtils.isNotNull(location) && location.getLocationId().longValue() != locationId.longValue()){
|
||||
Long locationId = wmStorageLocation.getLocationId() == null ? -1L : wmStorageLocation.getLocationId();
|
||||
if (StringUtils.isNotNull(location) && location.getLocationId().longValue() != locationId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
@ -109,51 +104,47 @@ public class WmStorageLocationServiceImpl implements IWmStorageLocationService
|
||||
|
||||
/**
|
||||
* 新增库区设置
|
||||
*
|
||||
*
|
||||
* @param wmStorageLocation 库区设置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWmStorageLocation(WmStorageLocation wmStorageLocation)
|
||||
{
|
||||
public int insertWmStorageLocation(WmStorageLocation wmStorageLocation) {
|
||||
wmStorageLocation.setCreateTime(DateUtils.getNowDate());
|
||||
return wmStorageLocationMapper.insertWmStorageLocation(wmStorageLocation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改库区设置
|
||||
*
|
||||
*
|
||||
* @param wmStorageLocation 库区设置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWmStorageLocation(WmStorageLocation wmStorageLocation)
|
||||
{
|
||||
public int updateWmStorageLocation(WmStorageLocation wmStorageLocation) {
|
||||
wmStorageLocation.setUpdateTime(DateUtils.getNowDate());
|
||||
return wmStorageLocationMapper.updateWmStorageLocation(wmStorageLocation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除库区设置
|
||||
*
|
||||
*
|
||||
* @param locationIds 需要删除的库区设置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWmStorageLocationByLocationIds(Long[] locationIds)
|
||||
{
|
||||
public int deleteWmStorageLocationByLocationIds(Long[] locationIds) {
|
||||
return wmStorageLocationMapper.deleteWmStorageLocationByLocationIds(locationIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除库区设置信息
|
||||
*
|
||||
*
|
||||
* @param locationId 库区设置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWmStorageLocationByLocationId(Long locationId)
|
||||
{
|
||||
public int deleteWmStorageLocationByLocationId(Long locationId) {
|
||||
return wmStorageLocationMapper.deleteWmStorageLocationByLocationId(locationId);
|
||||
}
|
||||
|
||||
@ -174,7 +165,7 @@ public class WmStorageLocationServiceImpl implements IWmStorageLocationService
|
||||
// 获取库位列表
|
||||
WmStorageArea wmStorageAreaQuery = new WmStorageArea();
|
||||
wmStorageAreaQuery.setLocationId(wmStorageLocationByCode.getLocationId());
|
||||
if (isBig) wmStorageAreaQuery.setAttr3(1L);
|
||||
wmStorageAreaQuery.setAttr3(isBig ? 1L : 0L);
|
||||
List<WmStorageArea> wmStorageAreaList = this.wmStorageAreaMapper.selectWmStorageAreaList(wmStorageAreaQuery).stream()
|
||||
// 过滤掉全部存在物品的库位
|
||||
.filter(it -> !selectNotEmptyAreaCodeList.contains(it.getAreaCode()))
|
||||
|
@ -92,6 +92,9 @@
|
||||
<if test="maxLoa != null">
|
||||
and max_loa = #{maxLoa}
|
||||
</if>
|
||||
<if test="attr3 != null">
|
||||
and attr3 = #{attr3}
|
||||
</if>
|
||||
<if test="positionX != null and positionX != 0">
|
||||
and position_x = #{positionX}
|
||||
</if>
|
||||
|
Loading…
Reference in New Issue
Block a user