Commit aad647a8880631026f8be86bc8b7634d9c721d1a
Merge branch 'develop4' of http://172.16.29.40:8010/wms/wms4.git into develop4
Showing
8 changed files
with
102 additions
and
50 deletions
ant-design-vue-jeecg/src/views/system/config/AddressList.vue
... | ... | @@ -148,7 +148,7 @@ export default { |
148 | 148 | { |
149 | 149 | title: '编码', |
150 | 150 | align: "center", |
151 | - dataIndex: 'code' | |
151 | + dataIndex: 'param' | |
152 | 152 | }, |
153 | 153 | { |
154 | 154 | title: '库区', |
... | ... | @@ -161,6 +161,11 @@ export default { |
161 | 161 | dataIndex: 'url' |
162 | 162 | }, |
163 | 163 | { |
164 | + title: '备注', | |
165 | + align: "center", | |
166 | + dataIndex: 'remark' | |
167 | + }, | |
168 | + { | |
164 | 169 | title: '创建人', |
165 | 170 | align: "center", |
166 | 171 | dataIndex: 'createBy' |
... | ... |
ant-design-vue-jeecg/src/views/system/config/modules/AddressForm.vue
... | ... | @@ -5,7 +5,7 @@ |
5 | 5 | <a-row> |
6 | 6 | <a-col :span="24"> |
7 | 7 | <a-form-model-item label="编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code"> |
8 | - <a-input v-model="model.code" placeholder="请输入编码"></a-input> | |
8 | + <a-input v-model="model.param" placeholder="请输入编码"></a-input> | |
9 | 9 | </a-form-model-item> |
10 | 10 | </a-col> |
11 | 11 | <a-col :span="24"> |
... | ... | @@ -18,6 +18,11 @@ |
18 | 18 | <a-input v-model="model.url" placeholder="请输入接口地址"></a-input> |
19 | 19 | </a-form-model-item> |
20 | 20 | </a-col> |
21 | + <a-col :span="24"> | |
22 | + <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark"> | |
23 | + <a-input v-model="model.remark" placeholder="请输入备注"></a-input> | |
24 | + </a-form-model-item> | |
25 | + </a-col> | |
21 | 26 | </a-row> |
22 | 27 | </a-form-model> |
23 | 28 | </j-form-container> |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/address/entity/Address.java
1 | 1 | package org.jeecg.modules.wms.config.address.entity; |
2 | 2 | |
3 | 3 | import java.io.Serializable; |
4 | -import java.io.UnsupportedEncodingException; | |
5 | 4 | import java.util.Date; |
6 | -import java.math.BigDecimal; | |
5 | + | |
6 | +import org.jeecgframework.poi.excel.annotation.Excel; | |
7 | + | |
7 | 8 | import com.baomidou.mybatisplus.annotation.IdType; |
8 | 9 | import com.baomidou.mybatisplus.annotation.TableId; |
9 | 10 | import com.baomidou.mybatisplus.annotation.TableName; |
10 | -import lombok.Data; | |
11 | -import com.fasterxml.jackson.annotation.JsonFormat; | |
12 | -import org.springframework.format.annotation.DateTimeFormat; | |
13 | -import org.jeecgframework.poi.excel.annotation.Excel; | |
14 | -import org.jeecg.common.aspect.annotation.Dict; | |
11 | + | |
15 | 12 | import io.swagger.annotations.ApiModel; |
16 | 13 | import io.swagger.annotations.ApiModelProperty; |
14 | +import lombok.Data; | |
17 | 15 | import lombok.EqualsAndHashCode; |
18 | 16 | import lombok.experimental.Accessors; |
19 | 17 | |
... | ... | @@ -51,6 +49,10 @@ public class Address implements Serializable { |
51 | 49 | @Excel(name = "接口地址", width = 15) |
52 | 50 | @ApiModelProperty(value = "接口地址") |
53 | 51 | private String url; |
52 | + /** 备注 */ | |
53 | + @Excel(name = "备注", width = 15) | |
54 | + @ApiModelProperty(value = "备注") | |
55 | + private String remark; | |
54 | 56 | /** 备用字段1 */ |
55 | 57 | @Excel(name = "备用字段1", width = 15) |
56 | 58 | @ApiModelProperty(value = "备用字段1") |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/service/IContainerService.java
1 | 1 | package org.jeecg.modules.wms.config.container.service; |
2 | 2 | |
3 | -import com.baomidou.mybatisplus.extension.service.IService; | |
3 | +import java.util.List; | |
4 | + | |
4 | 5 | import org.jeecg.common.api.vo.Result; |
5 | 6 | import org.jeecg.modules.wms.config.container.entity.Container; |
6 | 7 | |
7 | -import java.util.List; | |
8 | +import com.baomidou.mybatisplus.extension.service.IService; | |
8 | 9 | |
9 | 10 | /** |
10 | 11 | * @Description: 容器管理 |
... | ... | @@ -26,4 +27,9 @@ public interface IContainerService extends IService<Container> { |
26 | 27 | Container createLSContainer(String warehouseCode); |
27 | 28 | |
28 | 29 | List<Container> getContainerListByStatus(String status, String warehouseCode); |
30 | + | |
31 | + /** | |
32 | + * 判断系统是否已经有同样的库位号,如果有证明数据混乱了 | |
33 | + */ | |
34 | + boolean havaLocationCodeByContainer(String locationCode, String warehouseCode); | |
29 | 35 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/container/service/impl/ContainerServiceImpl.java
1 | 1 | package org.jeecg.modules.wms.config.container.service.impl; |
2 | 2 | |
3 | -import com.aliyun.oss.ServiceException; | |
4 | -import com.baomidou.mybatisplus.core.conditions.Wrapper; | |
5 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
6 | -import com.baomidou.mybatisplus.core.metadata.IPage; | |
7 | -import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
8 | -import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; | |
9 | -import com.baomidou.mybatisplus.extension.conditions.query.QueryChainWrapper; | |
10 | -import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; | |
11 | -import com.baomidou.mybatisplus.extension.conditions.update.UpdateChainWrapper; | |
12 | -import com.baomidou.mybatisplus.extension.kotlin.KtQueryChainWrapper; | |
13 | -import com.baomidou.mybatisplus.extension.kotlin.KtUpdateChainWrapper; | |
3 | +import java.text.MessageFormat; | |
4 | +import java.util.ArrayList; | |
5 | +import java.util.Calendar; | |
6 | +import java.util.List; | |
7 | + | |
8 | +import javax.annotation.Resource; | |
9 | + | |
14 | 10 | import org.jeecg.common.api.vo.Result; |
15 | 11 | import org.jeecg.modules.wms.config.container.entity.Container; |
16 | 12 | import org.jeecg.modules.wms.config.container.mapper.ContainerMapper; |
... | ... | @@ -19,14 +15,11 @@ import org.jeecg.modules.wms.config.containerType.service.IContainerTypeService; |
19 | 15 | import org.jeecg.utils.constant.QuantityConstant; |
20 | 16 | import org.springframework.stereotype.Service; |
21 | 17 | |
18 | +import com.aliyun.oss.ServiceException; | |
19 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
20 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
22 | 21 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
23 | 22 | |
24 | -import javax.annotation.Resource; | |
25 | -import java.io.Serializable; | |
26 | -import java.text.MessageFormat; | |
27 | -import java.util.*; | |
28 | -import java.util.function.Function; | |
29 | - | |
30 | 23 | /** |
31 | 24 | * @Description: 容器管理 |
32 | 25 | * @Author: jeecg-boot |
... | ... | @@ -89,10 +82,14 @@ public class ContainerServiceImpl extends ServiceImpl<ContainerMapper, Container |
89 | 82 | if (container == null) { |
90 | 83 | return false; |
91 | 84 | } |
85 | + boolean success = havaLocationCodeByContainer(locationCode, warehouseCode); | |
86 | + if (!success) { | |
87 | + throw new ServiceException("取消任务时, 库位表已经存在这个容器号,不能再写入"); | |
88 | + } | |
92 | 89 | container.setStatus(status); |
93 | 90 | container.setLocationCode(locationCode); |
94 | - boolean result = updateById(container); | |
95 | - return result; | |
91 | + success = updateById(container); | |
92 | + return success; | |
96 | 93 | } |
97 | 94 | |
98 | 95 | @Override |
... | ... | @@ -116,6 +113,17 @@ public class ContainerServiceImpl extends ServiceImpl<ContainerMapper, Container |
116 | 113 | return containerList; |
117 | 114 | } |
118 | 115 | |
116 | + @Override | |
117 | + public boolean havaLocationCodeByContainer(String locationCode, String warehouseCode) { | |
118 | + LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
119 | + containerLambdaQueryWrapper.eq(Container::getLocationCode, locationCode).eq(Container::getWarehouseCode, warehouseCode); | |
120 | + Container container = getOne(containerLambdaQueryWrapper); | |
121 | + if (container == null) { | |
122 | + return false; | |
123 | + } | |
124 | + return true; | |
125 | + } | |
126 | + | |
119 | 127 | private int getStartNumber(String containerTypeCode, String warehouseCode) { |
120 | 128 | LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); |
121 | 129 | containerLambdaQueryWrapper.eq(Container::getContainerTypeCode, containerTypeCode).eq(Container::getWarehouseCode, warehouseCode) |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/service/ILocationService.java
1 | 1 | package org.jeecg.modules.wms.config.location.service; |
2 | 2 | |
3 | -import com.baomidou.mybatisplus.core.metadata.IPage; | |
4 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
5 | -import com.baomidou.mybatisplus.extension.service.IService; | |
3 | +import java.util.List; | |
4 | + | |
6 | 5 | import org.jeecg.common.api.vo.Result; |
7 | 6 | import org.jeecg.modules.wms.config.location.entity.BatchLocation; |
8 | 7 | import org.jeecg.modules.wms.config.location.entity.Location; |
9 | 8 | import org.jeecg.modules.wms.config.location.entity.LocationInfo; |
10 | 9 | |
11 | -import java.util.List; | |
10 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
11 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
12 | +import com.baomidou.mybatisplus.extension.service.IService; | |
12 | 13 | |
13 | 14 | /** |
14 | 15 | * @Description: 库位管理 |
... | ... | @@ -45,4 +46,9 @@ public interface ILocationService extends IService<Location> { |
45 | 46 | LocationInfo getAllLocation(String type); |
46 | 47 | |
47 | 48 | IPage<Location> listEmptyContainerInLocation(Page<Location> page, Location location); |
49 | + | |
50 | + /** | |
51 | + * 判断系统是否已经有同样的托盘号,如果有证明数据混乱了 | |
52 | + */ | |
53 | + boolean havaContainerCodeInLocation(String containerCode, String warehouseCode); | |
48 | 54 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/service/impl/LocationServiceImpl.java
1 | 1 | package org.jeecg.modules.wms.config.location.service.impl; |
2 | 2 | |
3 | -import com.aliyun.oss.ServiceException; | |
4 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
5 | -import com.baomidou.mybatisplus.core.metadata.IPage; | |
6 | -import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
7 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
8 | -import org.apache.ibatis.annotations.Param; | |
3 | +import java.text.MessageFormat; | |
4 | +import java.util.ArrayList; | |
5 | +import java.util.Collections; | |
6 | +import java.util.Comparator; | |
7 | +import java.util.List; | |
8 | + | |
9 | +import javax.annotation.Resource; | |
10 | + | |
9 | 11 | import org.jeecg.common.api.vo.Result; |
10 | 12 | import org.jeecg.modules.wms.config.location.entity.BatchLocation; |
11 | 13 | import org.jeecg.modules.wms.config.location.entity.Location; |
... | ... | @@ -20,16 +22,14 @@ import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService; |
20 | 22 | import org.jeecg.utils.StringUtils; |
21 | 23 | import org.jeecg.utils.constant.QuantityConstant; |
22 | 24 | import org.springframework.stereotype.Service; |
23 | - | |
24 | -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
25 | 25 | import org.springframework.transaction.annotation.Transactional; |
26 | 26 | |
27 | -import javax.annotation.Resource; | |
28 | -import java.text.MessageFormat; | |
29 | -import java.util.ArrayList; | |
30 | -import java.util.Collections; | |
31 | -import java.util.Comparator; | |
32 | -import java.util.List; | |
27 | +import com.aliyun.oss.ServiceException; | |
28 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
29 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
30 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
31 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
32 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
33 | 33 | |
34 | 34 | /** |
35 | 35 | * @Description: 库位管理 |
... | ... | @@ -84,10 +84,15 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
84 | 84 | if (location == null) { |
85 | 85 | return false; |
86 | 86 | } |
87 | + // 如果这个托盘号已经在库位表里,那么不能再写入 | |
88 | + boolean success = havaContainerCodeInLocation(containerCode, warehouseCode); | |
89 | + if (success) { | |
90 | + throw new ServiceException("库位表已经存在这个容器号,不能再写入"); | |
91 | + } | |
87 | 92 | location.setContainerCode(containerCode); |
88 | 93 | location.setStatus(status); |
89 | - boolean result = updateById(location); | |
90 | - return result; | |
94 | + success = updateById(location); | |
95 | + return success; | |
91 | 96 | } |
92 | 97 | |
93 | 98 | @Override |
... | ... | @@ -335,6 +340,17 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i |
335 | 340 | } |
336 | 341 | |
337 | 342 | @Override |
343 | + public boolean havaContainerCodeInLocation(String containerCode, String warehouseCode) { | |
344 | + LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
345 | + locationLambdaQueryWrapper.eq(Location::getContainerCode, containerCode).eq(Location::getWarehouseCode, warehouseCode); | |
346 | + Location location = getOne(locationLambdaQueryWrapper); | |
347 | + if (location == null) { | |
348 | + return false; | |
349 | + } | |
350 | + return true; | |
351 | + } | |
352 | + | |
353 | + @Override | |
338 | 354 | public IPage<Location> listEmptyContainerInLocation(Page page, Location location) { |
339 | 355 | return locationMapper.listEmptyContainerInLocation(page, location); |
340 | 356 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... | ... | @@ -1805,6 +1805,10 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1805 | 1805 | if (StringUtils.isNotEmpty(lastStatus)) { |
1806 | 1806 | container.setStatus(lastStatus); // 解决空托盘组移库问题 |
1807 | 1807 | } |
1808 | + success = containerService.havaLocationCodeByContainer(fromLocationCode, warehouseCode); | |
1809 | + if (!success) { | |
1810 | + throw new ServiceException("取消任务时, 库位表已经存在这个容器号,不能再写入"); | |
1811 | + } | |
1808 | 1812 | container.setLastStatus(QuantityConstant.EMPTY_STRING); |
1809 | 1813 | container.setLocationCode(fromLocationCode); |
1810 | 1814 | success = containerService.updateById(container); |
... | ... |