Commit da997d493b5c8a8a57fbcdcfe64ad9b75a24975a
1 parent
ad1cb22b
库存填充度功能提交,暂时移除激活码验证
Signed-off-by: TanYibin <5491541@qq.com>
Showing
8 changed files
with
33 additions
and
11 deletions
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/containerCapacity/service/IContainerCapacityService.java
@@ -11,4 +11,14 @@ import org.jeecg.modules.wms.config.containerCapacity.entity.ContainerCapacity; | @@ -11,4 +11,14 @@ import org.jeecg.modules.wms.config.containerCapacity.entity.ContainerCapacity; | ||
11 | */ | 11 | */ |
12 | public interface IContainerCapacityService extends IService<ContainerCapacity> { | 12 | public interface IContainerCapacityService extends IService<ContainerCapacity> { |
13 | 13 | ||
14 | + /** | ||
15 | + * 容器物品容量查询 | ||
16 | + * @author TanYibin | ||
17 | + * @createDate 2023年4月10日 | ||
18 | + * @param warehouseCode | ||
19 | + * @param containerTypeCode | ||
20 | + * @param materialCode | ||
21 | + * @return | ||
22 | + */ | ||
23 | + public ContainerCapacity queryOne(String warehouseCode, String containerTypeCode, String materialCode); | ||
14 | } | 24 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/containerCapacity/service/impl/ContainerCapacityServiceImpl.java
@@ -3,8 +3,12 @@ package org.jeecg.modules.wms.config.containerCapacity.service.impl; | @@ -3,8 +3,12 @@ package org.jeecg.modules.wms.config.containerCapacity.service.impl; | ||
3 | import org.jeecg.modules.wms.config.containerCapacity.entity.ContainerCapacity; | 3 | import org.jeecg.modules.wms.config.containerCapacity.entity.ContainerCapacity; |
4 | import org.jeecg.modules.wms.config.containerCapacity.mapper.ContainerCapacityMapper; | 4 | import org.jeecg.modules.wms.config.containerCapacity.mapper.ContainerCapacityMapper; |
5 | import org.jeecg.modules.wms.config.containerCapacity.service.IContainerCapacityService; | 5 | import org.jeecg.modules.wms.config.containerCapacity.service.IContainerCapacityService; |
6 | +import org.jeecg.utils.StringUtils; | ||
7 | +import org.springframework.cache.annotation.Cacheable; | ||
6 | import org.springframework.stereotype.Service; | 8 | import org.springframework.stereotype.Service; |
7 | 9 | ||
10 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
11 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||
8 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 12 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
9 | 13 | ||
10 | /** | 14 | /** |
@@ -16,4 +20,15 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | @@ -16,4 +20,15 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
16 | @Service | 20 | @Service |
17 | public class ContainerCapacityServiceImpl extends ServiceImpl<ContainerCapacityMapper, ContainerCapacity> implements IContainerCapacityService { | 21 | public class ContainerCapacityServiceImpl extends ServiceImpl<ContainerCapacityMapper, ContainerCapacity> implements IContainerCapacityService { |
18 | 22 | ||
23 | + @Override | ||
24 | + @Cacheable(cacheNames = "queryContainerCapacity#60", | ||
25 | + key = "#root.methodName + '_' + #warehouseCode + '_' + #containerTypeCode + '_' + #materialCode") | ||
26 | + public ContainerCapacity queryOne(String warehouseCode, String containerTypeCode, String materialCode) { | ||
27 | + LambdaQueryWrapper<ContainerCapacity> containerCapacityWrapper = Wrappers.lambdaQuery(); | ||
28 | + containerCapacityWrapper.eq(ContainerCapacity::getWarehouseCode, warehouseCode) | ||
29 | + .eq(StringUtils.isNotEmpty(containerTypeCode), ContainerCapacity::getContainerTypeCode, containerTypeCode) | ||
30 | + .eq(StringUtils.isNotEmpty(materialCode), ContainerCapacity::getMaterialCode, materialCode); | ||
31 | + return getOne(containerCapacityWrapper); | ||
32 | + } | ||
33 | + | ||
19 | } | 34 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryDetail/controller/InventoryDetailController.java
@@ -54,7 +54,7 @@ public class InventoryDetailController extends JeecgController<InventoryDetail, | @@ -54,7 +54,7 @@ public class InventoryDetailController extends JeecgController<InventoryDetail, | ||
54 | HuahengJwtUtil.setWarehouseCode(req, inventoryDetail); | 54 | HuahengJwtUtil.setWarehouseCode(req, inventoryDetail); |
55 | QueryWrapper<InventoryDetail> queryWrapper = QueryGenerator.initQueryWrapper(inventoryDetail, req.getParameterMap()); | 55 | QueryWrapper<InventoryDetail> queryWrapper = QueryGenerator.initQueryWrapper(inventoryDetail, req.getParameterMap()); |
56 | Page<InventoryDetail> page = new Page<InventoryDetail>(pageNo, pageSize); | 56 | Page<InventoryDetail> page = new Page<InventoryDetail>(pageNo, pageSize); |
57 | - return Result.OK(inventoryDetailService.queryInventoryDetailPage(page, queryWrapper)); | 57 | + return Result.OK(inventoryDetailService.queryPage(page, queryWrapper)); |
58 | } | 58 | } |
59 | 59 | ||
60 | /** | 60 | /** |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/controller/InventoryHeaderController.java
@@ -178,7 +178,7 @@ public class InventoryHeaderController extends JeecgController<InventoryHeader, | @@ -178,7 +178,7 @@ public class InventoryHeaderController extends JeecgController<InventoryHeader, | ||
178 | HuahengJwtUtil.setWarehouseCode(request, inventoryDetail); | 178 | HuahengJwtUtil.setWarehouseCode(request, inventoryDetail); |
179 | QueryWrapper<InventoryDetail> queryWrapper = QueryGenerator.initQueryWrapper(inventoryDetail, request.getParameterMap()); | 179 | QueryWrapper<InventoryDetail> queryWrapper = QueryGenerator.initQueryWrapper(inventoryDetail, request.getParameterMap()); |
180 | Page<InventoryDetail> page = new Page<InventoryDetail>(pageNo, pageSize); | 180 | Page<InventoryDetail> page = new Page<InventoryDetail>(pageNo, pageSize); |
181 | - return Result.OK(inventoryDetailService.queryInventoryDetailPage(page, queryWrapper)); | 181 | + return Result.OK(inventoryDetailService.queryPage(page, queryWrapper)); |
182 | } | 182 | } |
183 | 183 | ||
184 | /** | 184 | /** |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/IInventoryDetailService.java
@@ -40,5 +40,5 @@ public interface IInventoryDetailService extends IService<InventoryDetail> { | @@ -40,5 +40,5 @@ public interface IInventoryDetailService extends IService<InventoryDetail> { | ||
40 | * @param queryWrapper | 40 | * @param queryWrapper |
41 | * @return | 41 | * @return |
42 | */ | 42 | */ |
43 | - IPage<InventoryDetail> queryInventoryDetailPage(Page<InventoryDetail> page, QueryWrapper<InventoryDetail> queryWrapper); | 43 | + IPage<InventoryDetail> queryPage(Page<InventoryDetail> page, QueryWrapper<InventoryDetail> queryWrapper); |
44 | } | 44 | } |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryDetailServiceImpl.java
@@ -109,7 +109,7 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe | @@ -109,7 +109,7 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe | ||
109 | } | 109 | } |
110 | 110 | ||
111 | @Override | 111 | @Override |
112 | - public IPage<InventoryDetail> queryInventoryDetailPage(Page<InventoryDetail> page, QueryWrapper<InventoryDetail> queryWrapper) { | 112 | + public IPage<InventoryDetail> queryPage(Page<InventoryDetail> page, QueryWrapper<InventoryDetail> queryWrapper) { |
113 | IPage<InventoryDetail> pageResult = this.page(page, queryWrapper); | 113 | IPage<InventoryDetail> pageResult = this.page(page, queryWrapper); |
114 | List<InventoryDetail> inventoryDetailList = pageResult.getRecords(); | 114 | List<InventoryDetail> inventoryDetailList = pageResult.getRecords(); |
115 | if (!CollectionUtils.isEmpty(inventoryDetailList)) { | 115 | if (!CollectionUtils.isEmpty(inventoryDetailList)) { |
@@ -137,11 +137,8 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe | @@ -137,11 +137,8 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe | ||
137 | Map<String, Container> containerMap = containerList.stream().collect(Collectors.toMap(Container::getCode, Function.identity(), (key1, key2) -> key2)); | 137 | Map<String, Container> containerMap = containerList.stream().collect(Collectors.toMap(Container::getCode, Function.identity(), (key1, key2) -> key2)); |
138 | for (InventoryDetail inventoryDetail : warehouseInventoryDetailList) { | 138 | for (InventoryDetail inventoryDetail : warehouseInventoryDetailList) { |
139 | Container container = containerMap.get(inventoryDetail.getContainerCode()); | 139 | Container container = containerMap.get(inventoryDetail.getContainerCode()); |
140 | - LambdaQueryWrapper<ContainerCapacity> containerCapacityWrapper = Wrappers.lambdaQuery(); | ||
141 | - containerCapacityWrapper.eq(ContainerCapacity::getWarehouseCode, warehouseCode) | ||
142 | - .eq(StringUtils.isNotEmpty(container.getContainerTypeCode()), ContainerCapacity::getContainerTypeCode, container.getContainerTypeCode()) | ||
143 | - .eq(StringUtils.isNotEmpty(inventoryDetail.getMaterialCode()), ContainerCapacity::getMaterialCode, inventoryDetail.getMaterialCode()); | ||
144 | - ContainerCapacity containerCapacity = containerCapacityService.getOne(containerCapacityWrapper); | 140 | + ContainerCapacity containerCapacity = |
141 | + containerCapacityService.queryOne(warehouseCode, container.getContainerTypeCode(), inventoryDetail.getMaterialCode()); | ||
145 | if (containerCapacity != null && containerCapacity.getQty() != null && containerCapacity.getQty().compareTo(BigDecimal.ZERO) > 0) { | 142 | if (containerCapacity != null && containerCapacity.getQty() != null && containerCapacity.getQty().compareTo(BigDecimal.ZERO) > 0) { |
146 | // 进行填充度计算 保留2位小数 | 143 | // 进行填充度计算 保留2位小数 |
147 | BigDecimal fillDensity = inventoryDetail.getQty().divide(containerCapacity.getQty(), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100)); | 144 | BigDecimal fillDensity = inventoryDetail.getQty().divide(containerCapacity.getQty(), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100)); |
huaheng-wms-core/src/main/java/org/jeecg/utils/config/HuahengRedisConfig.java
@@ -38,7 +38,7 @@ public class HuahengRedisConfig { | @@ -38,7 +38,7 @@ public class HuahengRedisConfig { | ||
38 | // 配置序列化(解决乱码的问题) | 38 | // 配置序列化(解决乱码的问题) |
39 | RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig().entryTtl(Duration.ofMillis(-1)) | 39 | RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig().entryTtl(Duration.ofMillis(-1)) |
40 | .serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(redisSerializer)) | 40 | .serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(redisSerializer)) |
41 | - .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(jackson2JsonRedisSerializer)).disableCachingNullValues(); | 41 | + .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(jackson2JsonRedisSerializer)); |
42 | RedisCacheWriter cacheWriter = RedisCacheWriter.nonLockingRedisCacheWriter(factory); | 42 | RedisCacheWriter cacheWriter = RedisCacheWriter.nonLockingRedisCacheWriter(factory); |
43 | 43 | ||
44 | /* | 44 | /* |
huaheng-wms-core/src/main/resources/application.yml
@@ -8,4 +8,4 @@ huaheng: | @@ -8,4 +8,4 @@ huaheng: | ||
8 | system: | 8 | system: |
9 | verson: '@project.version@' | 9 | verson: '@project.version@' |
10 | artifactId: '@project.artifactId@' | 10 | artifactId: '@project.artifactId@' |
11 | - checkSystemActivationCode: true | ||
12 | \ No newline at end of file | 11 | \ No newline at end of file |
12 | + checkSystemActivationCode: false | ||
13 | \ No newline at end of file | 13 | \ No newline at end of file |