From 79d23c9e99a8e1abfd427fcd5816d1da99bd8080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=90=8D=E5=96=9C?= Date: Wed, 18 Dec 2024 11:25:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/WmStorageLocationServiceImpl.java | 65 ++++++++----------- .../mapper/wm/WmStorageAreaMapper.xml | 3 + 2 files changed, 31 insertions(+), 37 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmStorageLocationServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmStorageLocationServiceImpl.java index 55a50da..5b3ebb5 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmStorageLocationServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmStorageLocationServiceImpl.java @@ -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 selectWmStorageLocationList(WmStorageLocation wmStorageLocation) - { + public List selectWmStorageLocationList(WmStorageLocation wmStorageLocation) { return wmStorageLocationMapper.selectWmStorageLocationList(wmStorageLocation); } @@ -82,16 +78,15 @@ public class WmStorageLocationServiceImpl implements IWmStorageLocationService * @return 库区设置 */ @Override - public List selectWmStorageLocationListVo(WmStorageLocation wmStorageLocation) - { + public List 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 wmStorageAreaList = this.wmStorageAreaMapper.selectWmStorageAreaList(wmStorageAreaQuery).stream() // 过滤掉全部存在物品的库位 .filter(it -> !selectNotEmptyAreaCodeList.contains(it.getAreaCode())) diff --git a/ktg-mes/src/main/resources/mapper/wm/WmStorageAreaMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmStorageAreaMapper.xml index 85d08b6..e38919f 100644 --- a/ktg-mes/src/main/resources/mapper/wm/WmStorageAreaMapper.xml +++ b/ktg-mes/src/main/resources/mapper/wm/WmStorageAreaMapper.xml @@ -92,6 +92,9 @@ and max_loa = #{maxLoa} + + and attr3 = #{attr3} + and position_x = #{positionX}