Commit 192d04cbfdb82c083a1e51d05e4372fa5ffd81cc
Merge remote-tracking branch 'origin/develop' into develop
Showing
40 changed files
with
298 additions
and
367 deletions
src/main/java/com/huaheng/HuaHengApplication.java
... | ... | @@ -31,41 +31,20 @@ public class HuaHengApplication |
31 | 31 | SpringApplication.run(HuaHengApplication.class, args); |
32 | 32 | System.out.println("*************** 华恒WMS启动成功JAR ***************\n" + |
33 | 33 | " >>> WMS启动成功JAR! <<< \n"+ |
34 | - " ▀▄▄ ▀▄▄\n" + | |
35 | - " ▄▄▄▄▄▄▓▌ ▐██▄ ▓█▄ ▀▄\n" + | |
36 | - " ░▓▓███████▀ ▄████▌▐██▌ ▐▓\n" + | |
37 | - " ▄▄▄▄▄▄ ▄ █▀██████▓░▄▓█████▄███▓ ░█▌▄▄▄ ▄ ▄▄▄▄▄▄\n" + | |
38 | - " █ ▐▌▐▌▐██████▌▐████████████▌ █▌ ▐▌ █\n" + | |
39 | - " █ ▓ ▓███████▄████████████▌▐██ ▓ █\n" + | |
40 | - " █ ▄ ▐▌ ▐▓███████████████████▄███ ▐▌ ▄ █\n" + | |
41 | - " █ ▐▌▐█ ▀▀▀▀▀▓▓█████████▀▀▀ ▓▓░ █▌▐▌ █\n" + | |
42 | - " █ █░▓▌ ▄▓▄ █████░ ░█▌ ▐▓░█ █\n" + | |
43 | - " ▌▄ ▐▌ ▐█ ▀ ▓▓▄▄▄▄▓▓ █▄▄██████▌ ▀ █▌ ▐▌ ▄▐\n" + | |
44 | - " ▐▌ ▓▄ ▀▓▄ ███████ ███████▓▓ ▄▓▀ ▄▓ ▐▌\n" + | |
45 | - " ▌▀▄ ▀▀▄▄░▀▄ ▀▀▓▓███▌ ▐█░▄▄▄▄ ▀▀ ▄▀░▄▄▀▀ ▄▀▐\n" + | |
46 | - " ▄ █ ▀▀▄▄ ▀▀▄▀▄ ███▀▀▀▀▀▀ ▓███░ ▄▀▄▀▀ ▄▄▀▀ █\n" + | |
47 | - " ▐▌ █ ▀▓▓▄ ▐▌▐▌ ▄▄▄ ▐███▌ ▐██▓▌▐▌▐▌ ▄▓▀ █ ▄ ▄\n" + | |
48 | - " ▄▀ █ ▄ ▐██▌░█▓ ▐█▓▌ ░▓██▓ ▓█░▐█▄ █ ▐▌ ▐▌\n" + | |
49 | - " ▄▀▄▄▀ █ ▐▌ ██▐▓▄▀ ▄▄▀▀▀██▄▄ ▀▄▓▌▐▌ ▀▄▄█░ ▄▀\n" + | |
50 | - " ▐▌▓█▌ ▀ ▄▄█░▐█▓▀ ▄███ ██▓▓ ▓▀ ▄▓██▀ ▄▀▄▄▀\n" + | |
51 | - " ▓███▓ ▄▓██▀ ██▌ ▓▓██▌ ▐████▌ ▄▀▄▄▀ ▐███▌ ▐▌▓█▌\n" + | |
52 | - " ▐████▌ ▐███▌ ▐▓▓ ▐████ █████ ▐▌▓█▌ ░▓███ ▓███▓\n" + | |
53 | - " █████ ░▓███ ░██▌ ▄▄▄▄████████ ▐████▌ ▓███▓ ▄▄███▓░ ▐████▌\n" + | |
54 | - " ░█████ ▄▄███▓▐██▌ ░███▓▓▀ ▀████▌ █████ ▐████▌░██████▀ ▐███████▓\n" + | |
55 | - " ▓▓█▌ ▐████▌▓▓███▀ ███ ▓▓███ ▄████████████▓▓██████▓▐█████▌ ▐███░█████\n" + | |
56 | - " ████ █████████▌ ░███ ▐████▌ ▓▓████▌ ▐████████░██████████ ▐█▓▓ ▐████▓\n" + | |
57 | - " ████ ▐████████ ▐███░▐████▌ ▐███████ ▓███████ ▐█████████▌ ███▌ █████▌\n" + | |
58 | - " ████▌▄█████████▌ ▐███▌▓▓███ ██████▓▓ ▀▀▓▓██▌ ██████████▄▄███▌ ▐████▓\n" + | |
59 | - " ▐███████▓▓▀▓████▄▓▓████████ █████▌ ░███▌ ▐████▓ ▀▀▀▓▓███▌ ▄█████▌\n" + | |
60 | - " ▐███▓▓███▄▄▄░░▀▀▀██████████▄▄▄███▓▓▀ ▐███▌ ▄█████▌ █ ▐████████▓▓▀\n" + | |
61 | - " ████ ▀▀▀████▄▄▄▄▄░░ ▀▀▀▀▀ ▐████████▓▓▀ █ ▐▓▓████▀▀▀\n" + | |
62 | - " ▀▀▀▀ ▄▀▀▀██████ ▐▓▓████▀▀▀ █\n" + | |
63 | - " █ ▓▓██ █\n" + | |
64 | - " █ █\n" + | |
65 | - " █ ▄▀▀█ ▄▀▀ ▓ ▄▀▀▄ ▄▀▀▄ ▄▀▄ ▄▀▀ ▄▀▄ █\n" + | |
66 | - " █▄▄▄ █▀▓ ▓▀ ▄ █ █ ▓ █▀▀▓ ▓ █ ▓▀ ▄ █ ▓ ▄▄▄█\n" + | |
67 | - " █ ▀▀▀▀ ▀▀▀ ▀▀ ▀ ▀▀▀ ▀▀▀▀ ▀▀▀\n" | |
34 | + " へ /|▓\n"+ | |
35 | + " /\7 ∠_/\n"+ | |
36 | + " / │ / /\n"+ | |
37 | + " │ Z _,< / 〈ヽ\n"+ | |
38 | + " │ ` ヽ / 〉\n"+ | |
39 | + " Y `/ / 〉\n"+ | |
40 | + " ( ● ヽ ● /. 〈 /\n"+ | |
41 | + " () ( | \ 〈 \\n"+ | |
42 | + " >_ ' _ . '│ //\n"+ | |
43 | + " /へ / )<| \\\n"+ | |
44 | + " ヽ_) (_/ │//\n"+ | |
45 | + " 7 | /\n"+ | |
46 | + " >―r` ̄ ̄` `―_' \n" | |
68 | 47 | |
69 | 48 | ); |
70 | 49 | } |
71 | 50 | -} |
51 | +} | |
72 | 52 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/api/wcs/service/overrideHandle/OverrideHandleServiceImpl.java
... | ... | @@ -73,22 +73,22 @@ public class OverrideHandleServiceImpl implements OverrideHandleService { |
73 | 73 | @Override |
74 | 74 | @Transactional |
75 | 75 | public AjaxResult OverrideHandle(TaskFinishDomain taskFinishDomain) { |
76 | - Boolean flag = true; | |
76 | + | |
77 | + String taskNo = taskFinishDomain.getTaskNo(); | |
77 | 78 | |
78 | 79 | //1、判断非空字段 |
79 | - if(StringUtils.isEmpty(taskFinishDomain.getTaskNo())){ | |
80 | + if(StringUtils.isEmpty(taskNo)){ | |
80 | 81 | return AjaxResult.error("任务号为空"); |
81 | 82 | } |
82 | - | |
83 | - | |
84 | - | |
85 | 83 | |
86 | 84 | //2、根据任务号查找任务 |
87 | - TaskHeader taskHeader = taskHeaderService.getById(Integer.valueOf(taskFinishDomain.getTaskNo())); | |
85 | + TaskHeader taskHeader = taskHeaderService.getById(taskNo); | |
88 | 86 | if(taskHeader == null){ |
89 | 87 | return AjaxResult.error("任务号错误,没有找到该任务"); |
90 | 88 | } |
91 | - if(taskHeader.getStatus() == 100){ | |
89 | + | |
90 | + int status = taskHeader.getStatus(); | |
91 | + if(status == QuantityConstant.TASK_STATUS_COMPLETED){ | |
92 | 92 | return AjaxResult.error("任务已完成"); |
93 | 93 | } |
94 | 94 | |
... | ... | @@ -98,12 +98,12 @@ public class OverrideHandleServiceImpl implements OverrideHandleService { |
98 | 98 | locationLam.eq(Location::getCode,taskHeader.getToLocation()) |
99 | 99 | .eq(Location::getWarehouseCode, ShiroUtils.getWarehouseCode()); |
100 | 100 | Location location = locationService.getOne(locationLam); |
101 | - if(location == null){ | |
101 | + if(location == null) { | |
102 | 102 | return AjaxResult.error("此任务的原目的库位在系统中不存在"); |
103 | 103 | } |
104 | 104 | location.setStatus(QuantityConstant.STATUS_EMPTY); |
105 | 105 | location.setContainerCode(""); |
106 | - flag = locationService.updateById(location); | |
106 | + Boolean flag = locationService.updateById(location); | |
107 | 107 | if(flag == false){ |
108 | 108 | return AjaxResult.error("修改此任务的原目的库位错误"); |
109 | 109 | } |
... | ... | @@ -117,11 +117,11 @@ public class OverrideHandleServiceImpl implements OverrideHandleService { |
117 | 117 | |
118 | 118 | Location newlocation = new Location(); |
119 | 119 | String newLocationCode = null; |
120 | - String code=ShiroUtils.getWarehouseCode(); | |
120 | + String redirectionLocation = taskFinishDomain.getRedirectionLocationCode(); | |
121 | 121 | //重入的库位由wcs提供 |
122 | - if(!"0".equals(taskFinishDomain.getRedirectionLocationCode())) { | |
122 | + if(!"0".equals(redirectionLocation)) { | |
123 | 123 | LambdaQueryWrapper<Location> locationLa = Wrappers.lambdaQuery(); |
124 | - locationLa.eq(Location::getCode, taskFinishDomain.getRedirectionLocationCode()) | |
124 | + locationLa.eq(Location::getCode, redirectionLocation) | |
125 | 125 | .eq(Location::getStatus,QuantityConstant.STATUS_EMPTY) |
126 | 126 | .eq(Location::getWarehouseCode, ShiroUtils.getWarehouseCode()); |
127 | 127 | newlocation = locationService.getOne(locationLa); |
... | ... | @@ -175,7 +175,7 @@ public class OverrideHandleServiceImpl implements OverrideHandleService { |
175 | 175 | Container container = containerService.findAllByCode(taskHeader.getContainerCode()); |
176 | 176 | String locationCode = receivingService.filter(locationList, locationTypeList, container); |
177 | 177 | newLocationCode = locationCode; |
178 | - if (taskHeader.getInternalTaskType().equals(QuantityConstant.TASK_INTENERTYPE_SHELF)) { | |
178 | + if (taskHeader.getInternalTaskType().equals(QuantityConstant.TASK_INTENERTYPE_RECEIPT)) { | |
179 | 179 | //查询入库组盘明细 |
180 | 180 | List<ReceiptContainerDetail> receiptContainerDetailList = new ArrayList<>(); |
181 | 181 | for (TaskDetail taskDetail : taskDetailList) { |
... | ... |
src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationService.java
... | ... | @@ -6,7 +6,7 @@ import java.util.List; |
6 | 6 | |
7 | 7 | public interface LocationAllocationService { |
8 | 8 | |
9 | - String allocation(String locationRule, String roadWay, String warehouseCode, String containerCode); | |
9 | + String allocation(String locationRule, String roadWay, String warehouseCode, String containerCode, Integer materialAreas); | |
10 | 10 | |
11 | 11 | |
12 | 12 | } |
... | ... |
src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationServiceImpl.java
... | ... | @@ -37,7 +37,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService |
37 | 37 | private TaskHeaderService taskHeaderService; |
38 | 38 | |
39 | 39 | @Override |
40 | - public String allocation(String locationRule, String area, String warehouseCode, String containerCode) { | |
40 | + public String allocation(String locationRule, String area, String warehouseCode, String containerCode, Integer materialAreas) { | |
41 | 41 | if (StringUtils.isEmpty(locationRule)) { |
42 | 42 | return null; |
43 | 43 | } |
... | ... | @@ -70,9 +70,9 @@ public class LocationAllocationServiceImpl implements LocationAllocationService |
70 | 70 | } |
71 | 71 | switch (locationRule) { |
72 | 72 | case Constants.DOUBLE_RK: |
73 | - return doubleRk(area, warehouseCode, locationTypeList); | |
73 | + return doubleRk(area, warehouseCode, locationTypeList, materialAreas); | |
74 | 74 | case Constants.SINGER_RK: |
75 | - return singleRk(area, warehouseCode, locationTypeList); | |
75 | + return singleRk(area, warehouseCode, locationTypeList, materialAreas); | |
76 | 76 | } |
77 | 77 | return null; |
78 | 78 | } |
... | ... | @@ -80,7 +80,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService |
80 | 80 | /* |
81 | 81 | * 双伸位库位入库分配库位 |
82 | 82 | */ |
83 | - private String doubleRk(String area, String warehouseCode, List<LocationType> locationTypeList) { | |
83 | + private String doubleRk(String area, String warehouseCode, List<LocationType> locationTypeList, Integer materialAreas) { | |
84 | 84 | LambdaQueryWrapper<Location> locationLambda = Wrappers.lambdaQuery(); |
85 | 85 | locationLambda.eq(Location::getArea, area). |
86 | 86 | eq(Location::getWarehouseCode, warehouseCode) |
... | ... | @@ -92,8 +92,10 @@ public class LocationAllocationServiceImpl implements LocationAllocationService |
92 | 92 | for (Location location1 : locationList) { |
93 | 93 | if (taskHeaderService.getUncompleteTaskInNear(location1) > 0) { |
94 | 94 | removeLocaationList.add(location1); |
95 | - } else { | |
96 | - break; | |
95 | + } | |
96 | + Integer areas = location1.getMaterialAreas(); | |
97 | + if(areas.intValue() != materialAreas.intValue()) { | |
98 | + removeLocaationList.add(location1); | |
97 | 99 | } |
98 | 100 | } |
99 | 101 | locationList.removeAll(removeLocaationList); |
... | ... | @@ -109,8 +111,6 @@ public class LocationAllocationServiceImpl implements LocationAllocationService |
109 | 111 | for (Location location1 : locationList) { |
110 | 112 | if (taskHeaderService.getUncompleteTaskInNear(location1) > 0) { |
111 | 113 | removeLocaationList.add(location1); |
112 | - } else { | |
113 | - break; | |
114 | 114 | } |
115 | 115 | } |
116 | 116 | locationList.removeAll(removeLocaationList); |
... | ... | @@ -122,13 +122,21 @@ public class LocationAllocationServiceImpl implements LocationAllocationService |
122 | 122 | /* |
123 | 123 | * 单伸位库位入库分配库位 |
124 | 124 | */ |
125 | - private String singleRk(String area, String warehouseCode, List<LocationType> locationTypeList) { | |
125 | + private String singleRk(String area, String warehouseCode, List<LocationType> locationTypeList, Integer materialAreas) { | |
126 | 126 | LambdaQueryWrapper<Location> locationLambda = Wrappers.lambdaQuery(); |
127 | 127 | locationLambda.eq(Location::getArea, area). |
128 | 128 | eq(Location::getWarehouseCode, warehouseCode) |
129 | 129 | .eq(Location::getStatus, QuantityConstant.STATUS_EMPTY) |
130 | 130 | .eq(Location::getContainerCode, ""); |
131 | 131 | List<Location> locationList = locationService.list(locationLambda); |
132 | + List<Location> removeLocaationList = new ArrayList<>(); | |
133 | + for (Location location1 : locationList) { | |
134 | + Integer areas = location1.getMaterialAreas(); | |
135 | + if(areas.intValue() != materialAreas.intValue()) { | |
136 | + removeLocaationList.add(location1); | |
137 | + } | |
138 | + } | |
139 | + locationList.removeAll(removeLocaationList); | |
132 | 140 | String locationCode = filter(locationList, locationTypeList, area); |
133 | 141 | return locationCode; |
134 | 142 | } |
... | ... |
src/main/java/com/huaheng/api/wcs/service/warecellAllocation/WarecellAllocationService.java
src/main/java/com/huaheng/api/wcs/service/warecellAllocation/WarecellAllocationServiceImpl.java
... | ... | @@ -120,13 +120,14 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService |
120 | 120 | } |
121 | 121 | |
122 | 122 | public AjaxResult verticalWarehouseAllocation(WcsTask wcsTask) { |
123 | + String warehouseCode = wcsTask.getWarehouseCode(); | |
123 | 124 | //查询满足条件的库位类型 |
124 | 125 | LambdaQueryWrapper<LocationType> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
125 | 126 | lambdaQueryWrapper.gt(LocationType::getLength, wcsTask.getLength()) |
126 | 127 | .gt(LocationType::getWidth, wcsTask.getWidth()) |
127 | 128 | .gt(LocationType::getHeight, wcsTask.getHeight()) |
128 | 129 | .gt(LocationType::getMaxWeight, wcsTask.getWidth()) |
129 | - .eq(LocationType::getWarehouseCode, wcsTask.getWarehouseCode()); | |
130 | + .eq(LocationType::getWarehouseCode, warehouseCode); | |
130 | 131 | List<LocationType> locationTypeList = locationTypeService.list(lambdaQueryWrapper); |
131 | 132 | |
132 | 133 | String locationCode = null; |
... | ... | @@ -144,7 +145,10 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService |
144 | 145 | /* 循环查询入库组盘明细*/ |
145 | 146 | List<ReceiptContainerDetail> receiptContainerDetailList = new ArrayList<>(); |
146 | 147 | for (TaskDetail taskDetail : taskDetailList) { |
147 | - receiptContainerDetailList.add(receiptContainerDetailService.getById(taskDetail.getAllocationId())); | |
148 | + ReceiptContainerDetail receiptContainerDetail = receiptContainerDetailService.getById(taskDetail.getAllocationId()); | |
149 | + if (receiptContainerDetail != null) { | |
150 | + receiptContainerDetailList.add(receiptContainerDetail); | |
151 | + } | |
148 | 152 | } |
149 | 153 | //去重 |
150 | 154 | receiptContainerDetailList = receiptContainerDetailList.stream().distinct().collect(Collectors.toList()); |
... | ... | @@ -154,13 +158,13 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService |
154 | 158 | if (StringUtils.isEmpty(locatingRule)) { |
155 | 159 | //物料类别中定位规则为空时,查询入库首选项 |
156 | 160 | LambdaQueryWrapper<ConfigValue> configValueLambda = Wrappers.lambdaQuery(); |
157 | - configValueLambda.eq(ConfigValue::getWarehouseCode, wcsTask.getWarehouseCode()) | |
161 | + configValueLambda.eq(ConfigValue::getWarehouseCode, warehouseCode) | |
158 | 162 | .eq(ConfigValue::getModuleType, "receipt") |
159 | 163 | .eq(ConfigValue::getRecordType, "入库首选项"); |
160 | 164 | ConfigValue configValue = configValueService.getOne(configValueLambda); |
161 | 165 | LambdaQueryWrapper<ReceiptPreference> receiptPreferenceLambda = Wrappers.lambdaQuery(); |
162 | 166 | receiptPreferenceLambda.eq(ReceiptPreference::getCode, configValue.getValue()) |
163 | - .eq(ReceiptPreference::getWarehouseCode, wcsTask.getWarehouseCode()); | |
167 | + .eq(ReceiptPreference::getWarehouseCode, warehouseCode); | |
164 | 168 | ReceiptPreference receiptPreference = receiptPreferenceService.getOne(receiptPreferenceLambda); |
165 | 169 | locatingRule = receiptPreference.getLocationRule(); |
166 | 170 | } |
... | ... | @@ -168,16 +172,21 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService |
168 | 172 | if (StringUtils.isEmpty(locatingRule)){ |
169 | 173 | throw new ServiceException("未绑定定位规则"); |
170 | 174 | } |
171 | - | |
172 | - locationCode = locationAllocationService.allocation(locatingRule, wcsTask.getDestination(), wcsTask.getWarehouseCode(), containerCode); | |
175 | + Integer materialAreas = 0; | |
176 | + if(receiptContainerDetailList != null && receiptContainerDetailList.size() > 0) { | |
177 | + String materialCode = receiptContainerDetailList.get(0).getMaterialCode(); | |
178 | + Material material = materialService.findAllByCode(materialCode, warehouseCode); | |
179 | + materialAreas = material.getMaterialAreas(); | |
180 | + } | |
181 | + locationCode = locationAllocationService.allocation(locatingRule, wcsTask.getDestination(), warehouseCode, containerCode, materialAreas); | |
173 | 182 | if (StringUtils.isEmpty(locationCode)) { |
174 | 183 | return AjaxResult.error("没有库位可分配"); |
175 | 184 | } |
176 | 185 | |
177 | 186 | if (StringUtils.isNotEmpty(locationCode)) { |
178 | - locationService.updateStatus(locationCode, QuantityConstant.STATUS_LOCK, wcsTask.getWarehouseCode()); | |
187 | + locationService.updateStatus(locationCode, QuantityConstant.STATUS_LOCK, warehouseCode); | |
179 | 188 | if (StringUtils.isNotEmpty(taskHeader.getToLocation()) && !locationCode.equals(taskHeader.getToLocation())) { |
180 | - locationService.updateStatus(taskHeader.getToLocation(), QuantityConstant.STATUS_EMPTY, wcsTask.getWarehouseCode()); | |
189 | + locationService.updateStatus(taskHeader.getToLocation(), QuantityConstant.STATUS_EMPTY, warehouseCode); | |
181 | 190 | } |
182 | 191 | } else { |
183 | 192 | throw new ServiceException("定位失败,请检查定位规则是否正确"); |
... | ... | @@ -195,7 +204,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService |
195 | 204 | //把库位编码赋到该入库组盘头表下的所有明细 |
196 | 205 | LambdaQueryWrapper<ReceiptContainerDetail> lambda = Wrappers.lambdaQuery(); |
197 | 206 | lambda.eq(ReceiptContainerDetail::getReceiptContainerId, receiptContainerHeader.getId()) |
198 | - .eq(ReceiptContainerDetail::getWarehouseCode, wcsTask.getWarehouseCode()); | |
207 | + .eq(ReceiptContainerDetail::getWarehouseCode, warehouseCode); | |
199 | 208 | List<ReceiptContainerDetail> receiptContainerDetails = receiptContainerDetailService.list(lambda); |
200 | 209 | for (ReceiptContainerDetail receiptContainerDetail2 : receiptContainerDetails) { |
201 | 210 | receiptContainerDetail2.setLocationCode(locationCode); |
... | ... | @@ -216,7 +225,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService |
216 | 225 | //修改任务明细目标库位 |
217 | 226 | LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery(); |
218 | 227 | locationLambdaQueryWrapper.eq(Location::getCode, locationCode) |
219 | - .eq(Location::getWarehouseCode, wcsTask.getWarehouseCode()); | |
228 | + .eq(Location::getWarehouseCode, warehouseCode); | |
220 | 229 | Location location = locationService.getOne(locationLambdaQueryWrapper); |
221 | 230 | int rowFlag = location.getRowFlag().intValue(); |
222 | 231 | Integer preTaskNo = 0; |
... | ... |
src/main/java/com/huaheng/common/constant/QuantityConstant.java
... | ... | @@ -327,25 +327,16 @@ public class QuantityConstant { |
327 | 327 | //13、任务内部类型 |
328 | 328 | |
329 | 329 | /** 上架任务*/ |
330 | - public static final Integer TASK_INTENERTYPE_SHELF = 100; | |
330 | + public static final Integer TASK_INTENERTYPE_RECEIPT = 100; | |
331 | 331 | |
332 | 332 | /** 拣货任务*/ |
333 | - public static final Integer TASK_INTENERTYPE_PICKING = 200; | |
334 | - | |
335 | - /** 补货任务*/ | |
336 | - public static final Integer TASK_INTENERTYPE_SUPPLEMENT = 300; | |
333 | + public static final Integer TASK_INTENERTYPE_SHIPMENT = 200; | |
337 | 334 | |
338 | 335 | /** 工作任务*/ |
339 | - public static final Integer TASK_INTENERTYPE_WORK = 400; | |
340 | - | |
341 | - //质检任务 | |
342 | - public static final Integer TASK_INTENERTYPE_CHECK = 500; | |
343 | - | |
344 | - /** 移库任务 */ | |
345 | - public static final Integer TASK_INTENERTYPE_TRANSFER = 600; | |
336 | + public static final Integer TASK_INTENERTYPE_WORK = 300; | |
346 | 337 | |
347 | 338 | //盘点任务 |
348 | - public static final Integer TASK_INTENERTYPE_CYCLECOUNT = 700; | |
339 | + public static final Integer TASK_INTENERTYPE_CYCLECOUNT = 400; | |
349 | 340 | |
350 | 341 | |
351 | 342 | |
... | ... |
src/main/java/com/huaheng/mobile/receipt/MobileBatchReceiptController.java
... | ... | @@ -569,11 +569,11 @@ public class MobileBatchReceiptController { |
569 | 569 | taskHeader.setWarehouseCode(loc.getWarehouseCode()); |
570 | 570 | taskHeader.setCompanyCode(companyCode);//货主 |
571 | 571 | if(type == QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT) { |
572 | - taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_SHELF); | |
572 | + taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_RECEIPT); | |
573 | 573 | taskHeader.setTaskType(QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT); |
574 | 574 | } else { |
575 | - taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_PICKING); | |
576 | - taskHeader.setTaskType(QuantityConstant.TASK_TYPE_SORTINGSHIPMENT); | |
575 | + taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_RECEIPT); | |
576 | + taskHeader.setTaskType(QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT); | |
577 | 577 | } |
578 | 578 | taskHeader.setContainerCode(container.getCode()); |
579 | 579 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); |
... | ... |
src/main/java/com/huaheng/pc/config/location/controller/LocationController.java
... | ... | @@ -17,6 +17,8 @@ import com.huaheng.framework.web.page.PageDomain; |
17 | 17 | import com.huaheng.framework.web.page.TableDataInfo; |
18 | 18 | import com.huaheng.framework.web.page.TableSupport; |
19 | 19 | import com.huaheng.pc.common.JasperPrint.Print; |
20 | +import com.huaheng.pc.config.container.domain.Container; | |
21 | +import com.huaheng.pc.config.container.service.ContainerService; | |
20 | 22 | import com.huaheng.pc.config.location.domain.Location; |
21 | 23 | import com.huaheng.pc.config.location.domain.LocationStatus; |
22 | 24 | import com.huaheng.pc.config.location.service.LocationService; |
... | ... | @@ -47,6 +49,8 @@ public class LocationController extends BaseController { |
47 | 49 | private String prefix = "config/location"; |
48 | 50 | |
49 | 51 | @Resource |
52 | + private ContainerService containerService; | |
53 | + @Resource | |
50 | 54 | private LocationService locationService; |
51 | 55 | @Resource |
52 | 56 | private InventoryDetailService inventoryDetailService; |
... | ... | @@ -155,17 +159,6 @@ public class LocationController extends BaseController { |
155 | 159 | return prefix + "/addBatch"; |
156 | 160 | } |
157 | 161 | |
158 | - // /** | |
159 | - // * 批量新增保存库位 | |
160 | - // */ | |
161 | - // @RequiresPermissions("config:location:addBatch") | |
162 | - // @ApiOperation(value="新增库位", notes="批量新增库位", httpMethod = "POST") | |
163 | - // @Log(title = "配置-库存资料-库位管理", operating = "新增库位", action = BusinessType.INSERT) | |
164 | - // @PostMapping("/addBatchSave") | |
165 | - // @ResponseBody | |
166 | - // public AjaxResult addBatchSave(Location lastLocation) { | |
167 | - // return toAjax(locationService.insertLocation(lastLocation)); | |
168 | - // } | |
169 | 162 | |
170 | 163 | /** |
171 | 164 | * 批量新增保存库位 |
... | ... | @@ -210,9 +203,12 @@ public class LocationController extends BaseController { |
210 | 203 | @PostMapping("/edit") |
211 | 204 | @ResponseBody |
212 | 205 | public AjaxResult editSave (Location location) { |
213 | - Location locationCurrent = locationService.getById(location.getId()); | |
214 | - if (!locationCurrent.getStatus().equals(QuantityConstant.STATUS_EMPTY)&&!locationCurrent.getStatus().equals("disable")){ | |
215 | - return AjaxResult.success("只有在空闲或禁用状态下才能更改库位"); | |
206 | + String containerCode = location.getContainerCode(); | |
207 | + if (StringUtils.isNotEmpty(containerCode)) { | |
208 | + Container container = containerService.findAllByCode(containerCode); | |
209 | + if (container == null) { | |
210 | + return AjaxResult.error("容器编码输入错误"); | |
211 | + } | |
216 | 212 | } |
217 | 213 | location.setLastUpdatedBy(ShiroUtils.getLoginName()); |
218 | 214 | return toAjax(locationService.updateById(location)); |
... | ... |
src/main/java/com/huaheng/pc/config/location/domain/Location.java
... | ... | @@ -97,6 +97,12 @@ public class Location implements Serializable { |
97 | 97 | private String area; |
98 | 98 | |
99 | 99 | /** |
100 | + * 物料分区 | |
101 | + */ | |
102 | + @TableField(value = "materialAreas") | |
103 | + private Integer materialAreas; | |
104 | + | |
105 | + /** | |
100 | 106 | * 名称 |
101 | 107 | */ |
102 | 108 | @TableField(value = "name") |
... | ... |
src/main/java/com/huaheng/pc/config/material/controller/MaterialController.java
... | ... | @@ -164,7 +164,7 @@ public class MaterialController extends BaseController { |
164 | 164 | String[] idArray = Convert.toStrArray(ids); |
165 | 165 | LambdaUpdateWrapper<Material> wrapper = Wrappers.lambdaUpdate(); |
166 | 166 | wrapper.in(Material::getId, idArray) |
167 | - .set(Material::getArea, area); | |
167 | + .set(Material::getMaterialAreas, Integer.parseInt(area)); | |
168 | 168 | return toAjax(materialService.update(wrapper)); |
169 | 169 | } |
170 | 170 | |
... | ... |
src/main/java/com/huaheng/pc/config/material/domain/Material.java
... | ... | @@ -312,7 +312,10 @@ public class Material implements Serializable { |
312 | 312 | /** 打印机名称 */ |
313 | 313 | // private static final String printName = "Gprinter GP-1424D"; |
314 | 314 | |
315 | - @TableField(value = "area") | |
316 | - @ApiModelProperty(value = "物料分区") | |
317 | - private String area; | |
315 | + /** | |
316 | + * 物料分区 | |
317 | + */ | |
318 | + @TableField(value = "materialAreas") | |
319 | + private Integer materialAreas; | |
320 | + | |
318 | 321 | } |
319 | 322 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/config/material/service/MaterialService.java
src/main/java/com/huaheng/pc/config/material/service/MaterialServiceImpl.java
... | ... | @@ -62,13 +62,11 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i |
62 | 62 | int count = 0; |
63 | 63 | for (Integer id : Convert.toIntArray(ids)) { |
64 | 64 | Material material = this.getById(id); |
65 | - | |
66 | 65 | LambdaQueryWrapper<ReceiptDetail> lambda = Wrappers.lambdaQuery(); |
67 | 66 | lambda.eq(ReceiptDetail::getWarehouseCode, ShiroUtils.getWarehouseCode()) |
68 | - .eq(ReceiptDetail::getMaterialCode, material.getCode()) | |
69 | - .eq(ReceiptDetail::getDeleted, false) | |
70 | - .last("LIMIT 1"); | |
71 | - | |
67 | + .eq(ReceiptDetail::getMaterialCode, material.getCode()) | |
68 | + .eq(ReceiptDetail::getDeleted, false) | |
69 | + .last("LIMIT 1"); | |
72 | 70 | Map<String, Object> map = receiptDetailService.getMap(lambda); |
73 | 71 | if (map != null) { |
74 | 72 | return AjaxResult.error("物料编码(" + material.getCode() +")存在入库单,不能删除!"); |
... | ... | @@ -177,10 +175,21 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i |
177 | 175 | |
178 | 176 | @Override |
179 | 177 | public Material findAllByCode(String code) { |
178 | + String warehouseCode = ShiroUtils.getWarehouseCode(); | |
179 | + LambdaQueryWrapper<Material> queryWrapper = Wrappers.lambdaQuery(); | |
180 | + queryWrapper.eq(Material::getCode, code); | |
181 | + queryWrapper.eq(Material::getWarehouseCode, warehouseCode); | |
182 | + Material material = getOne(queryWrapper); | |
183 | + return material; | |
184 | + } | |
185 | + | |
186 | + @Override | |
187 | + public Material findAllByCode(String code, String warehouseCode) { | |
180 | 188 | LambdaQueryWrapper<Material> queryWrapper = Wrappers.lambdaQuery(); |
181 | 189 | queryWrapper.eq(Material::getCode, code); |
182 | - queryWrapper.eq(Material::getWarehouseCode, ShiroUtils.getWarehouseCode()); | |
183 | - return getOne(queryWrapper); | |
190 | + queryWrapper.eq(Material::getWarehouseCode, warehouseCode); | |
191 | + Material material = getOne(queryWrapper); | |
192 | + return material; | |
184 | 193 | } |
185 | 194 | |
186 | 195 | |
... | ... |
src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailServiceImpl.java
... | ... | @@ -93,7 +93,7 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe |
93 | 93 | TaskHeader taskHeader = new TaskHeader(); |
94 | 94 | taskHeader.setWarehouseCode(inventoryDetail.getWarehouseCode()); |
95 | 95 | taskHeader.setCompanyCode(inventoryDetail.getCompanyCode()); |
96 | - taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_PICKING); | |
96 | + taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_WORK); | |
97 | 97 | taskHeader.setTaskType(QuantityConstant.TASK_TYPE_VIEW); |
98 | 98 | taskHeader.setContainerCode(inventoryDetail.getContainerCode()); |
99 | 99 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); |
... | ... |
src/main/java/com/huaheng/pc/inventory/inventoryHeader/controller/InventoryHeaderController.java
... | ... | @@ -24,6 +24,7 @@ import com.huaheng.pc.task.taskHeader.service.TaskHeaderService; |
24 | 24 | import com.huaheng.pc.task.taskHeader.service.TaskHeaderServiceImpl; |
25 | 25 | import org.apache.shiro.authz.annotation.RequiresPermissions; |
26 | 26 | import org.springframework.stereotype.Controller; |
27 | +import org.springframework.ui.ModelMap; | |
27 | 28 | import org.springframework.web.bind.annotation.*; |
28 | 29 | import javax.annotation.Resource; |
29 | 30 | import java.util.ArrayList; |
... | ... | @@ -204,8 +205,12 @@ public class InventoryHeaderController extends BaseController |
204 | 205 | /** |
205 | 206 | * 出库查看页面 |
206 | 207 | */ |
207 | - @GetMapping("/checkOut") | |
208 | - public String checkOut(){ | |
208 | + @GetMapping("/checkOut/{id}") | |
209 | + public String checkOut(@PathVariable("id") String id, ModelMap modelMap){ | |
210 | + InventoryHeader inventoryHeader = inventoryHeaderService.getById(id); | |
211 | + modelMap.put("id", id); | |
212 | + modelMap.put("locationCode", inventoryHeader.getLocationCode()); | |
213 | + modelMap.put("containerCode", inventoryHeader.getContainerCode()); | |
209 | 214 | return prefix+"/checkOut"; |
210 | 215 | } |
211 | 216 | |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/controller/ReceiptContainerHeaderController.java
... | ... | @@ -79,7 +79,7 @@ public class ReceiptContainerHeaderController extends BaseController { |
79 | 79 | Integer pageNum = pageDomain.getPageNum(); |
80 | 80 | Integer pageSize = pageDomain.getPageSize(); |
81 | 81 | String sql = null; |
82 | - if (StringUtils.isNotEmpty(receiptCode)){ | |
82 | + if (StringUtils.isNotEmpty(receiptCode)) { | |
83 | 83 | sql = "select receiptContainerId from receipt_container_detail where receiptCode = \'"+receiptCode+"\'"; |
84 | 84 | } |
85 | 85 | lambdaQueryWrapper.ge(StringUtils.isNotEmpty(createdBegin), ReceiptContainerHeader::getCreated, createdBegin) |
... | ... | @@ -91,12 +91,10 @@ public class ReceiptContainerHeaderController extends BaseController { |
91 | 91 | .eq(StringUtils.isNotNull(receiptContainerHeader.getStatus()),ReceiptContainerHeader::getStatus, receiptContainerHeader.getStatus()) |
92 | 92 | .eq(StringUtils.isNotEmpty(receiptContainerHeader.getCreatedBy()),ReceiptContainerHeader::getCreatedBy, receiptContainerHeader.getCreatedBy()) |
93 | 93 | .inSql(StringUtils.isNotEmpty(receiptCode), ReceiptContainerHeader::getId, sql) |
94 | + .orderByAsc(ReceiptContainerHeader::getStatus) | |
94 | 95 | .orderByDesc(ReceiptContainerHeader::getId); |
95 | 96 | |
96 | 97 | if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){ |
97 | - /** | |
98 | - * 使用分页查询 | |
99 | - */ | |
100 | 98 | Page<ReceiptContainerHeader> page = new Page<>(pageNum, pageSize); |
101 | 99 | IPage<ReceiptContainerHeader> iPage = receiptContainerHeaderService.page(page, lambdaQueryWrapper); |
102 | 100 | return getMpDataTable(iPage.getRecords(),iPage.getTotal()); |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/service/ReceiptContainerHeaderServiceImpl.java
... | ... | @@ -420,7 +420,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
420 | 420 | } |
421 | 421 | if (QuantityConstant.TASK_TYPE_WHOLERECEIPT == taskType.intValue()) { |
422 | 422 | if (com.huaheng.common.utils.StringUtils.isNotEmpty(location.getContainerCode())) { |
423 | - throw new ServiceException("库位(" + containerCode + ")有容器(" + location.getContainerCode() + "),不能整盘入库!"); | |
423 | + throw new ServiceException("库位(" + locationCode + ")有容器(" + location.getContainerCode() + "),不能整盘入库!"); | |
424 | 424 | } |
425 | 425 | } |
426 | 426 | if(QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT== taskType.intValue()) { |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiving/service/ReceivingService.java
... | ... | @@ -155,11 +155,9 @@ public class ReceivingService { |
155 | 155 | if (StringUtils.isEmpty(locatingRule)){ |
156 | 156 | throw new ServiceException("未绑定定位规则"); |
157 | 157 | } |
158 | - if (StringUtils.isEmpty(area)) { | |
159 | - Material material = materialService.findAllByCode(receiptContainerDetail.getMaterialCode()); | |
160 | - area = material.getArea(); | |
161 | - } | |
162 | - String locationCode = locationAllocationService.allocation(locatingRule, area, ShiroUtils.getWarehouseCode(),container.getCode() ); | |
158 | + Material material = materialService.findAllByCode(receiptContainerDetail.getMaterialCode()); | |
159 | + Integer materialAreas = material.getMaterialAreas(); | |
160 | + String locationCode = locationAllocationService.allocation(locatingRule, area, ShiroUtils.getWarehouseCode(),container.getCode(), materialAreas); | |
163 | 161 | |
164 | 162 | if (StringUtils.isNotEmpty(locationCode)){ |
165 | 163 | locationService.updateStatus(locationCode, QuantityConstant.STATUS_LOCK); |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/controller/ShipmentContainerHeaderController.java
... | ... | @@ -14,6 +14,7 @@ import com.huaheng.framework.web.domain.AjaxResult; |
14 | 14 | import com.huaheng.framework.web.page.PageDomain; |
15 | 15 | import com.huaheng.framework.web.page.TableDataInfo; |
16 | 16 | import com.huaheng.framework.web.page.TableSupport; |
17 | +import com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerHeader; | |
17 | 18 | import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader; |
18 | 19 | import com.huaheng.pc.shipment.shipmentContainerHeader.service.ShipmentContainerHeaderService; |
19 | 20 | import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader; |
... | ... | @@ -71,12 +72,10 @@ public class ShipmentContainerHeaderController extends BaseController |
71 | 72 | .eq(StringUtils.isNotEmpty(shipmentContainerHeader.getContainerCode()), ShipmentContainerHeader::getContainerCode, shipmentContainerHeader.getContainerCode()) |
72 | 73 | .eq(StringUtils.isNotEmpty(shipmentContainerHeader.getLocationCode()), ShipmentContainerHeader::getLocationCode, shipmentContainerHeader.getLocationCode()) |
73 | 74 | .eq(StringUtils.isNotEmpty(shipmentContainerHeader.getCreatedBy()), ShipmentContainerHeader::getCreatedBy, shipmentContainerHeader.getCreatedBy()) |
74 | - .le(shipmentContainerHeader.getStatus()==null,ShipmentContainerHeader::getStatus,20) | |
75 | - .eq(shipmentContainerHeader.getStatus()!=null,ShipmentContainerHeader::getStatus,shipmentContainerHeader.getStatus()); | |
75 | + .eq(shipmentContainerHeader.getStatus()!=null, ShipmentContainerHeader::getStatus,shipmentContainerHeader.getStatus()) | |
76 | + .orderByAsc(ShipmentContainerHeader::getStatus) | |
77 | + .orderByDesc(ShipmentContainerHeader::getId); | |
76 | 78 | if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){ |
77 | - /** | |
78 | - * 使用分页查询 | |
79 | - */ | |
80 | 79 | Page<ShipmentContainerHeader> page = new Page<>(pageNum, pageSize); |
81 | 80 | IPage<ShipmentContainerHeader> iPage = shipmentContainerHeaderService.page(page, lambdaQueryWrapper); |
82 | 81 | return getMpDataTable(iPage.getRecords(),iPage.getTotal()); |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderServiceImpl.java
... | ... | @@ -303,7 +303,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
303 | 303 | if(shipmentContainerHeader.getStatus()>=QuantityConstant.SHIPMENT_CONTAINER_TASK && shipmentContainerHeader.getStatus()<QuantityConstant.SHIPMENT_CONTAINER_REVIEWSUCCESS){ |
304 | 304 | LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper=Wrappers.lambdaQuery(); |
305 | 305 | taskHeaderLambdaQueryWrapper.eq(TaskHeader::getWarehouseCode,shipmentContainerHeader.getWarehouseCode()) |
306 | - .eq(TaskHeader::getInternalTaskType,QuantityConstant.TASK_INTENERTYPE_PICKING) | |
306 | + .in(TaskHeader::getTaskType, QuantityConstant.TASK_TYPE_SORTINGSHIPMENT, QuantityConstant.TASK_TYPE_WHOLESHIPMENT) | |
307 | 307 | .eq(TaskHeader::getAllocationHeadId,shipmentContainerHeader.getId()); |
308 | 308 | TaskHeader taskHeader=taskHeaderService.getOne(taskHeaderLambdaQueryWrapper); |
309 | 309 | if(taskHeader==null){ |
... | ... | @@ -317,7 +317,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
317 | 317 | taskDetailLam.eq(TaskDetail::getWarehouseCode,shipmentContainerDetail.getWarehouseCode()) |
318 | 318 | .eq(TaskDetail::getAllocationId,shipmentContainerDetail.getId()) |
319 | 319 | .eq(TaskDetail::getTaskId,taskHeader.getId()) |
320 | - .eq(TaskDetail::getInternalTaskType,QuantityConstant.TASK_INTENERTYPE_PICKING); | |
320 | + .in(TaskDetail::getTaskType, QuantityConstant.TASK_TYPE_SORTINGSHIPMENT, QuantityConstant.TASK_TYPE_WHOLESHIPMENT); | |
321 | 321 | TaskDetail taskDetail = taskDetailService.getOne(taskDetailLam); |
322 | 322 | if(taskDetail == null){ |
323 | 323 | throw new ServiceException("找不到对应的任务明细"); |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/controller/TaskHeaderController.java
... | ... | @@ -69,14 +69,14 @@ public class TaskHeaderController extends BaseController { |
69 | 69 | @ApiParam(name="createdBegin",value="类型") String createdBegin,@ApiParam(name="createdEnd",value="类型") String createdEnd) { |
70 | 70 | LambdaQueryWrapper<TaskHeader> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
71 | 71 | lambdaQueryWrapper.eq(TaskHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()) |
72 | - | |
73 | 72 | .eq(StringUtils.isNotNull(InternalTaskType),TaskHeader::getInternalTaskType,InternalTaskType) |
74 | 73 | .eq(StringUtils.isNotNull(taskHeader.getId()),TaskHeader::getId,taskHeader.getId()) |
75 | 74 | .eq(StringUtils.isNotEmpty(taskHeader.getContainerCode()),TaskHeader::getContainerCode,taskHeader.getContainerCode()) |
76 | 75 | .eq(StringUtils.isNotEmpty(taskHeader.getToLocation()),TaskHeader::getToLocation,taskHeader.getToLocation()) |
77 | 76 | .gt(StringUtils.isNotEmpty(createdBegin),TaskHeader::getCreated,createdBegin) |
78 | 77 | .lt(StringUtils.isNotEmpty(createdEnd),TaskHeader::getCreated,createdEnd) |
79 | - .orderByDesc(TaskHeader::getId); | |
78 | + .orderByDesc(TaskHeader::getId) | |
79 | + .orderByAsc(TaskHeader::getStatus); | |
80 | 80 | |
81 | 81 | PageDomain pageDomain = TableSupport.buildPageRequest(); |
82 | 82 | Integer pageNum = pageDomain.getPageNum(); |
... | ... | @@ -88,15 +88,9 @@ public class TaskHeaderController extends BaseController { |
88 | 88 | Page<TaskHeader> page = new Page<>(pageNum, pageSize); |
89 | 89 | IPage<TaskHeader> iPage = taskHeaderService.page(page, lambdaQueryWrapper); |
90 | 90 | List<TaskHeader> iPages = iPage.getRecords(); |
91 | -// if(InternalTaskType == 700){ | |
92 | -// iPages = taskHeaderService.preferenceRealize(iPages) ; | |
93 | -// } | |
94 | 91 | return getMpDataTable(iPages, iPage.getTotal()); |
95 | 92 | } else { |
96 | 93 | List<TaskHeader> list = taskHeaderService.list(lambdaQueryWrapper); |
97 | - if(InternalTaskType == 700){ | |
98 | - list = taskHeaderService.preferenceRealize(list); | |
99 | - } | |
100 | 94 | return getDataTable(list); |
101 | 95 | } |
102 | 96 | } |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/service/CycleCountTaskService.java
... | ... | @@ -117,25 +117,23 @@ public class CycleCountTaskService { |
117 | 117 | } |
118 | 118 | |
119 | 119 | } |
120 | - if (taskHeader.getInternalTaskType().equals(QuantityConstant.TASK_INTENERTYPE_SHELF) || taskHeader.getInternalTaskType().equals(QuantityConstant.TASK_INTENERTYPE_PICKING)) { | |
121 | - if (taskHeader.getToLocation() != null) { | |
122 | - //更新托盘、库位状态 | |
123 | - locationService.updateStatus(taskHeader.getToLocation(), QuantityConstant.STATUS_EMPTY); | |
124 | - } | |
125 | - LambdaQueryWrapper<InventoryHeader> inventoryHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
126 | - inventoryHeaderLambdaQueryWrapper.eq(InventoryHeader::getContainerCode, taskHeader.getContainerCode()); | |
127 | - InventoryHeader inventoryHeader = inventoryHeaderService.getOne(inventoryHeaderLambdaQueryWrapper); | |
128 | - Container container = new Container(); | |
129 | - container.setStatus(QuantityConstant.STATUS_EMPTY); | |
130 | - if(inventoryHeader != null) { | |
131 | - if(inventoryHeader.getContainerStatus().equals(QuantityConstant.STATUS_SOME)) { | |
132 | - container.setStatus(QuantityConstant.STATUS_SOME); | |
133 | - } | |
120 | + if (taskHeader.getToLocation() != null) { | |
121 | + //更新托盘、库位状态 | |
122 | + locationService.updateStatus(taskHeader.getToLocation(), QuantityConstant.STATUS_EMPTY); | |
123 | + } | |
124 | + LambdaQueryWrapper<InventoryHeader> inventoryHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
125 | + inventoryHeaderLambdaQueryWrapper.eq(InventoryHeader::getContainerCode, taskHeader.getContainerCode()); | |
126 | + InventoryHeader inventoryHeader = inventoryHeaderService.getOne(inventoryHeaderLambdaQueryWrapper); | |
127 | + Container container = new Container(); | |
128 | + container.setStatus(QuantityConstant.STATUS_EMPTY); | |
129 | + if(inventoryHeader != null) { | |
130 | + if(inventoryHeader.getContainerStatus().equals(QuantityConstant.STATUS_SOME)) { | |
131 | + container.setStatus(QuantityConstant.STATUS_SOME); | |
134 | 132 | } |
135 | - LambdaUpdateWrapper<Container> containerUpdateWrapper = Wrappers.lambdaUpdate(); | |
136 | - containerUpdateWrapper.eq(Container::getCode, taskHeader.getContainerCode()); | |
137 | - containerService.update(container, containerUpdateWrapper); | |
138 | 133 | } |
134 | + LambdaUpdateWrapper<Container> containerUpdateWrapper = Wrappers.lambdaUpdate(); | |
135 | + containerUpdateWrapper.eq(Container::getCode, taskHeader.getContainerCode()); | |
136 | + containerService.update(container, containerUpdateWrapper); | |
139 | 137 | |
140 | 138 | } |
141 | 139 | return AjaxResult.success("取消任务成功!"); |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/service/ReceiptTaskService.java
... | ... | @@ -146,7 +146,7 @@ public class ReceiptTaskService { |
146 | 146 | //添加任务主表 |
147 | 147 | TaskHeader task = new TaskHeader(); |
148 | 148 | task.setAllocationHeadId(receiptContainerHeader.getId()); |
149 | - task.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_SHELF); | |
149 | + task.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_RECEIPT); | |
150 | 150 | task.setWarehouseCode(receiptContainerHeader.getWarehouseCode()); |
151 | 151 | task.setCompanyCode(receiptContainerHeader.getCompanyCode()); |
152 | 152 | task.setTaskType(receiptContainerHeader.getTaskType()); |
... | ... | @@ -162,7 +162,7 @@ public class ReceiptTaskService { |
162 | 162 | TaskDetail taskDetail = new TaskDetail(); |
163 | 163 | taskDetail.setTaskId(task.getId()); |
164 | 164 | taskDetail.setTaskType(task.getTaskType()); |
165 | - taskDetail.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_SHELF); | |
165 | + taskDetail.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_RECEIPT); | |
166 | 166 | taskDetail.setWarehouseCode(task.getWarehouseCode()); |
167 | 167 | taskDetail.setAllocationId(item.getId()); |
168 | 168 | taskDetail.setCompanyCode(task.getCompanyCode()); |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/service/ShipmentTaskService.java
... | ... | @@ -171,7 +171,7 @@ public class ShipmentTaskService { |
171 | 171 | } |
172 | 172 | |
173 | 173 | |
174 | - task.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_PICKING); | |
174 | + task.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_SHIPMENT); | |
175 | 175 | task.setAllocationHeadId(shipmentContainerHeader.getId()); |
176 | 176 | task.setWarehouseCode(shipmentContainerHeader.getWarehouseCode()); |
177 | 177 | task.setAssignedUser(ShiroUtils.getLoginName()); |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
... | ... | @@ -194,91 +194,22 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
194 | 194 | //删除主任务 |
195 | 195 | taskHeaderService.removeById(taskHeader.getId()); |
196 | 196 | // 更改库位状态(整盘入库任务除外) |
197 | - if (taskHeader.getInternalTaskType().equals(QuantityConstant.TASK_INTENERTYPE_SHELF)) { | |
197 | + if (taskHeader.getInternalTaskType().equals(QuantityConstant.TASK_INTENERTYPE_RECEIPT)) { | |
198 | 198 | receiptContainerHeaderService.cancelReceipt(taskHeader.getAllocationHeadId()); |
199 | 199 | } |
200 | 200 | //根据任务类型来更新货箱状态 |
201 | 201 | //修改关联的货箱状态 |
202 | - if (taskHeader.getInternalTaskType().equals(QuantityConstant.TASK_INTENERTYPE_PICKING)) { | |
202 | + if (taskHeader.getInternalTaskType().equals(QuantityConstant.TASK_INTENERTYPE_SHIPMENT)) { | |
203 | 203 | ShipmentContainerHeader shipmentContainerHeader = new ShipmentContainerHeader(); |
204 | 204 | shipmentContainerHeader.setId(taskHeader.getAllocationHeadId()); |
205 | 205 | shipmentContainerHeader.setStatus(QuantityConstant.SHIPMENT_CONTAINER_BUILD); |
206 | 206 | shipmentContainerHeaderService.updateById(shipmentContainerHeader); |
207 | 207 | } |
208 | 208 | //盘点取消任务,恢复明细状态为1 |
209 | - if (taskHeader.getInternalTaskType().equals(QuantityConstant.TASK_INTENERTYPE_CYCLECOUNT)) { | |
210 | - | |
211 | - CycleCountDetail cycleCountDetail = new CycleCountDetail(); | |
212 | - cycleCountDetail.setCompanyCode(taskDetail.getCompanyCode()); | |
213 | - cycleCountDetail.setWarehouseCode(taskDetail.getWarehouseCode()); | |
214 | - cycleCountDetail.setLocationCode(taskDetail.getFromLocation()); | |
215 | - cycleCountDetail.setContainerCode(taskDetail.getContainerCode()); | |
216 | - cycleCountDetail.setCycleCountHeadCode(taskDetail.getBillCode());//盘点单Code | |
217 | - cycleCountDetail.setId(taskDetail.getBillDetailId());//盘点细单ID | |
218 | - LambdaQueryWrapper<CycleCountDetail> lam = Wrappers.lambdaQuery(cycleCountDetail); | |
219 | - List<CycleCountDetail> cycleCountDetailList = cycleCountDetailService.list(lam);// | |
220 | - for (CycleCountDetail item : cycleCountDetailList) { | |
221 | - item.setTaskHeaderId(null); | |
222 | - item.setTaskHeaderId(null); | |
223 | - item.setLastUpdated(new Date()); | |
224 | - item.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
225 | - item.setEnableStatus(1); | |
226 | - cycleCountDetailService.saveOrUpdate(item); | |
227 | - } | |
228 | - | |
229 | - } | |
230 | - if (taskHeader.getInternalTaskType().equals(QuantityConstant.TASK_INTENERTYPE_TRANSFER)) { | |
231 | - if (taskHeader.getFromLocation() != null) { | |
232 | - //更新托盘、库位状态 | |
233 | - locationService.updateStatus(taskHeader.getFromLocation(), QuantityConstant.STATUS_EMPTY); | |
234 | - } | |
235 | - if (taskHeader.getToLocation() != null) { | |
236 | - //更新托盘、库位状态 | |
237 | - locationService.updateStatus(taskHeader.getToLocation(), QuantityConstant.STATUS_EMPTY); | |
238 | - } | |
239 | - LambdaQueryWrapper<InventoryHeader> inventoryHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
240 | - inventoryHeaderLambdaQueryWrapper.eq(InventoryHeader::getContainerCode, taskHeader.getContainerCode()); | |
241 | - InventoryHeader inventoryHeader = inventoryHeaderService.getOne(inventoryHeaderLambdaQueryWrapper); | |
242 | - Container container = new Container(); | |
243 | - container.setStatus(QuantityConstant.STATUS_EMPTY); | |
244 | - if(inventoryHeader != null) { | |
245 | - if(QuantityConstant.STATUS_SOME.equals(inventoryHeader.getContainerStatus())) { | |
246 | - container.setStatus(QuantityConstant.STATUS_SOME); | |
247 | - } | |
248 | - } | |
249 | - container.setLocationCode(taskHeader.getFromLocation()); | |
250 | - LambdaUpdateWrapper<Container> containerUpdateWrapper = Wrappers.lambdaUpdate(); | |
251 | - containerUpdateWrapper.eq(Container::getCode, taskHeader.getContainerCode()); | |
252 | - containerService.update(container, containerUpdateWrapper); | |
253 | - } | |
254 | - if (taskHeader.getInternalTaskType().equals(QuantityConstant.TASK_INTENERTYPE_WORK)) { | |
255 | - if (taskHeader.getFromLocation() != null) { | |
256 | - //更新托盘、库位状态 | |
257 | - locationService.updateStatus(taskHeader.getFromLocation(), QuantityConstant.STATUS_EMPTY); | |
258 | - } | |
259 | - if (taskHeader.getToLocation() != null) { | |
260 | - //更新托盘、库位状态 | |
261 | - locationService.updateStatus(taskHeader.getToLocation(), QuantityConstant.STATUS_EMPTY); | |
262 | - } | |
263 | - LambdaQueryWrapper<InventoryHeader> inventoryHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
264 | - inventoryHeaderLambdaQueryWrapper.eq(InventoryHeader::getContainerCode, taskHeader.getContainerCode()); | |
265 | - InventoryHeader inventoryHeader = inventoryHeaderService.getOne(inventoryHeaderLambdaQueryWrapper); | |
266 | - Container container = new Container(); | |
267 | - container.setStatus(QuantityConstant.STATUS_EMPTY); | |
268 | - if(inventoryHeader != null) { | |
269 | - if(QuantityConstant.STATUS_SOME.equals(inventoryHeader.getContainerStatus())) { | |
270 | - container.setStatus(QuantityConstant.STATUS_SOME); | |
271 | - } | |
272 | - } | |
273 | - container.setLocationCode(taskHeader.getFromLocation()); | |
274 | - LambdaUpdateWrapper<Container> containerUpdateWrapper = Wrappers.lambdaUpdate(); | |
275 | - containerUpdateWrapper.eq(Container::getCode, taskHeader.getContainerCode()); | |
276 | - containerService.update(container, containerUpdateWrapper); | |
277 | - } | |
278 | - if (taskHeader.getInternalTaskType().equals(QuantityConstant.TASK_INTENERTYPE_SHELF) || taskHeader.getInternalTaskType().equals(QuantityConstant.TASK_INTENERTYPE_PICKING)) { | |
279 | - if (StringUtils.isNotEmpty(taskHeader.getToLocation()) && taskHeader.getInternalTaskType().equals(QuantityConstant.TASK_INTENERTYPE_SHELF) ) { | |
280 | - //更新托盘、库位状态 | |
281 | - locationService.updateStatus(taskHeader.getToLocation(), QuantityConstant.STATUS_EMPTY); | |
209 | + int taskType = taskHeader.getTaskType().intValue(); | |
210 | + switch (taskType) { | |
211 | + case QuantityConstant.TASK_TYPE_WHOLERECEIPT: | |
212 | + case QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT: | |
282 | 213 | LambdaQueryWrapper<ReceiptContainerHeader> lambda = Wrappers.lambdaQuery(); |
283 | 214 | lambda.eq(ReceiptContainerHeader::getContainerCode, taskHeader.getContainerCode()) |
284 | 215 | .ne(ReceiptContainerHeader::getStatus, QuantityConstant.RECEIPT_CONTAINER_FINISHED) |
... | ... | @@ -295,33 +226,63 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
295 | 226 | receiptContainerDetail.setLocationCode(""); |
296 | 227 | receiptContainerDetailService.update(receiptContainerDetail, receiptContainerDetailLambdaQueryWrapper1); |
297 | 228 | } |
298 | - } | |
299 | - if (StringUtils.isNotEmpty(taskHeader.getFromLocation())) { | |
300 | - //更新托盘、库位状态 | |
301 | - locationService.updateStatus(taskHeader.getFromLocation(), QuantityConstant.STATUS_EMPTY); | |
302 | - } | |
303 | - LambdaQueryWrapper<InventoryHeader> inventoryHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
304 | - inventoryHeaderLambdaQueryWrapper.eq(InventoryHeader::getContainerCode, taskHeader.getContainerCode()); | |
305 | - InventoryHeader inventoryHeader = inventoryHeaderService.getOne(inventoryHeaderLambdaQueryWrapper); | |
306 | - Container container = new Container(); | |
307 | - container.setStatus(QuantityConstant.STATUS_EMPTY); | |
308 | - if(inventoryHeader != null) { | |
309 | - if(QuantityConstant.STATUS_SOME.equals(inventoryHeader.getContainerStatus())) { | |
310 | - container.setStatus(QuantityConstant.STATUS_SOME); | |
229 | + break; | |
230 | + case QuantityConstant.TASK_TYPE_WHOLESHIPMENT: | |
231 | + case QuantityConstant.TASK_TYPE_SORTINGSHIPMENT: | |
232 | + | |
233 | + break; | |
234 | + case QuantityConstant.TASK_TYPE_CYCLECOUNT: | |
235 | + CycleCountDetail cycleCountDetail = new CycleCountDetail(); | |
236 | + cycleCountDetail.setCompanyCode(taskDetail.getCompanyCode()); | |
237 | + cycleCountDetail.setWarehouseCode(taskDetail.getWarehouseCode()); | |
238 | + cycleCountDetail.setLocationCode(taskDetail.getFromLocation()); | |
239 | + cycleCountDetail.setContainerCode(taskDetail.getContainerCode()); | |
240 | + cycleCountDetail.setCycleCountHeadCode(taskDetail.getBillCode());//盘点单Code | |
241 | + cycleCountDetail.setId(taskDetail.getBillDetailId());//盘点细单ID | |
242 | + LambdaQueryWrapper<CycleCountDetail> lam = Wrappers.lambdaQuery(cycleCountDetail); | |
243 | + List<CycleCountDetail> cycleCountDetailList = cycleCountDetailService.list(lam);// | |
244 | + for (CycleCountDetail item : cycleCountDetailList) { | |
245 | + item.setTaskHeaderId(null); | |
246 | + item.setTaskHeaderId(null); | |
247 | + item.setLastUpdated(new Date()); | |
248 | + item.setLastUpdatedBy(ShiroUtils.getLoginName()); | |
249 | + item.setEnableStatus(1); | |
250 | + cycleCountDetailService.saveOrUpdate(item); | |
311 | 251 | } |
312 | - } | |
313 | - LambdaUpdateWrapper<Container> containerUpdateWrapper = Wrappers.lambdaUpdate(); | |
314 | - containerUpdateWrapper.eq(Container::getCode, taskHeader.getContainerCode()); | |
315 | - containerService.update(container, containerUpdateWrapper); | |
252 | + break; | |
253 | + default: | |
254 | + break; | |
316 | 255 | } |
317 | -// if(task.getType()==900){ | |
318 | -// //出库查看任务没有关联的货箱,不做处理 | |
319 | -// } | |
256 | + cancelLocationAndContainerStatus(taskHeader); | |
320 | 257 | } |
321 | - | |
322 | 258 | return AjaxResult.success("取消任务成功!"); |
323 | 259 | } |
324 | 260 | |
261 | + private void cancelLocationAndContainerStatus(TaskHeader taskHeader) { | |
262 | + if (taskHeader.getFromLocation() != null) { | |
263 | + //更新托盘、库位状态 | |
264 | + locationService.updateStatus(taskHeader.getFromLocation(), QuantityConstant.STATUS_EMPTY); | |
265 | + } | |
266 | + if (taskHeader.getToLocation() != null) { | |
267 | + //更新托盘、库位状态 | |
268 | + locationService.updateStatus(taskHeader.getToLocation(), QuantityConstant.STATUS_EMPTY); | |
269 | + } | |
270 | + LambdaQueryWrapper<InventoryHeader> inventoryHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
271 | + inventoryHeaderLambdaQueryWrapper.eq(InventoryHeader::getContainerCode, taskHeader.getContainerCode()); | |
272 | + InventoryHeader inventoryHeader = inventoryHeaderService.getOne(inventoryHeaderLambdaQueryWrapper); | |
273 | + Container container = new Container(); | |
274 | + container.setStatus(QuantityConstant.STATUS_EMPTY); | |
275 | + if(inventoryHeader != null) { | |
276 | + if(QuantityConstant.STATUS_SOME.equals(inventoryHeader.getContainerStatus())) { | |
277 | + container.setStatus(QuantityConstant.STATUS_SOME); | |
278 | + } | |
279 | + } | |
280 | + container.setLocationCode(taskHeader.getFromLocation()); | |
281 | + LambdaUpdateWrapper<Container> containerUpdateWrapper = Wrappers.lambdaUpdate(); | |
282 | + containerUpdateWrapper.eq(Container::getCode, taskHeader.getContainerCode()); | |
283 | + containerService.update(container, containerUpdateWrapper); | |
284 | + } | |
285 | + | |
325 | 286 | /** |
326 | 287 | * 下发WCS执行任务 |
327 | 288 | * 执行任务 |
... | ... | @@ -338,13 +299,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
338 | 299 | } |
339 | 300 | |
340 | 301 | // 给wcs传递任务 |
341 | - | |
342 | 302 | AjaxResult ajaxResult = taskAssignService.wcsTaskAssign(task); |
343 | 303 | if(ajaxResult != null && ajaxResult.hasErr()) { |
344 | 304 | return AjaxResult.error(ajaxResult.getMsg()); |
345 | 305 | } |
346 | 306 | |
347 | - | |
348 | 307 | //修改任务头表 |
349 | 308 | task.setId(taskId); |
350 | 309 | task.setStatus(QuantityConstant.TASK_STATUS_RELEASE); |
... | ... | @@ -425,36 +384,39 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
425 | 384 | * @param task |
426 | 385 | */ |
427 | 386 | public void completeTask(TaskHeader task) { |
387 | + int taskType = task.getTaskType().intValue(); | |
428 | 388 | //区分任务类型 |
429 | - if (task.getInternalTaskType().equals(QuantityConstant.TASK_INTENERTYPE_SHELF) ) { | |
430 | - //入库任务 | |
431 | - receiptTaskService.completeReceiptTask(task); | |
432 | - combineInventory(task); | |
433 | - } | |
434 | - if (task.getInternalTaskType().equals(QuantityConstant.TASK_INTENERTYPE_PICKING) && | |
435 | - (task.getTaskType().equals(QuantityConstant.TASK_TYPE_WHOLESHIPMENT) || task.getTaskType().equals(QuantityConstant.TASK_TYPE_SORTINGSHIPMENT))) { | |
436 | - //出库任务 | |
437 | - shipmentTaskService.completeShipmentTask(task); | |
438 | - } | |
439 | - // 900 出库查看,空托出库查看 | |
440 | - if (task.getTaskType().equals( QuantityConstant.TASK_TYPE_VIEW)) { | |
441 | - workTaskService.completeCheckOutTask(task); | |
442 | - } | |
443 | - // 700 盘点 | |
444 | - if (task.getTaskType().equals(QuantityConstant.TASK_TYPE_CYCLECOUNT)) { | |
445 | - cycleCountTaskService.completeCycleCountTask(task); | |
446 | - } | |
447 | - if (task.getTaskType().equals( QuantityConstant.TASK_TYPE_TRANSFER)) { | |
448 | -// //移库 | |
449 | - transferTaskService.completeTransferTask(task); | |
450 | - } | |
451 | - if (task.getTaskType().equals( QuantityConstant.TASK_TYPE_EMPTYRECEIPT)) { | |
452 | - //空托盘入库 | |
453 | - workTaskService.completeEmptyIn(task); | |
454 | - } | |
455 | - if (task.getTaskType().equals(QuantityConstant.TASK_TYPE_EMPTYSHIPMENT) ) { | |
456 | - //空托盘出库 | |
457 | - workTaskService.completeEmptyOut(task); | |
389 | + switch(taskType) { | |
390 | + //整盘入库、补充入库 | |
391 | + case QuantityConstant.TASK_TYPE_WHOLERECEIPT: | |
392 | + case QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT: | |
393 | + receiptTaskService.completeReceiptTask(task); | |
394 | + combineInventory(task); | |
395 | + break; | |
396 | + //整盘出库、分拣出库 | |
397 | + case QuantityConstant.TASK_TYPE_WHOLESHIPMENT: | |
398 | + case QuantityConstant.TASK_TYPE_SORTINGSHIPMENT: | |
399 | + shipmentTaskService.completeShipmentTask(task); | |
400 | + break; | |
401 | + //空托入库 | |
402 | + case QuantityConstant.TASK_TYPE_EMPTYRECEIPT: | |
403 | + workTaskService.completeEmptyIn(task); | |
404 | + break; | |
405 | + //空托出库 | |
406 | + case QuantityConstant.TASK_TYPE_EMPTYSHIPMENT: | |
407 | + workTaskService.completeEmptyOut(task); | |
408 | + break; | |
409 | + case QuantityConstant.TASK_TYPE_CYCLECOUNT: | |
410 | + cycleCountTaskService.completeCycleCountTask(task); | |
411 | + break; | |
412 | + case QuantityConstant.TASK_TYPE_TRANSFER: | |
413 | + transferTaskService.completeTransferTask(task); | |
414 | + break; | |
415 | + case QuantityConstant.TASK_TYPE_VIEW: | |
416 | + workTaskService.completeCheckOutTask(task); | |
417 | + break; | |
418 | + default: | |
419 | + throw new ServiceException("不支持的任务类型"); | |
458 | 420 | } |
459 | 421 | } |
460 | 422 | |
... | ... | @@ -469,7 +431,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
469 | 431 | @Transactional(rollbackFor = Exception.class) |
470 | 432 | public AjaxResult completeTask(String locationCode) { |
471 | 433 | LambdaQueryWrapper<TaskHeader> taskQueryWrapper = Wrappers.lambdaQuery(); |
472 | - taskQueryWrapper.eq(TaskHeader::getToLocation, locationCode); | |
434 | + taskQueryWrapper.eq(TaskHeader::getToLocation, locationCode) | |
435 | + .lt(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_COMPLETED); | |
473 | 436 | List<TaskHeader> list = this.list(taskQueryWrapper); |
474 | 437 | if (list.isEmpty()) { |
475 | 438 | throw new ServiceException("库位(" + locationCode + ")没有任务!"); |
... | ... | @@ -477,9 +440,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
477 | 440 | //如果已完成则不管 |
478 | 441 | throw new ServiceException("库位(" + locationCode + ")任务已经完成!"); |
479 | 442 | } |
480 | - if(list.get(0).getInternalTaskType().equals(QuantityConstant.TASK_INTENERTYPE_SHELF)){ | |
443 | + TaskHeader taskHeader = list.get(0); | |
444 | + int taskType = taskHeader.getTaskType().intValue(); | |
445 | + if(taskType == QuantityConstant.TASK_TYPE_WHOLERECEIPT | |
446 | + || taskType == QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT){ | |
481 | 447 | //入库任务 |
482 | - return receiptTaskService.completeReceiptTask((list.get(0))); | |
448 | + return receiptTaskService.completeReceiptTask(taskHeader); | |
483 | 449 | } else { |
484 | 450 | throw new ServiceException("库位(" + locationCode + ")的任务不是上架,不能完成!"); |
485 | 451 | } |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/service/TransferTaskService.java
... | ... | @@ -98,6 +98,10 @@ public class TransferTaskService { |
98 | 98 | return AjaxResult.error("目标库位和源库位不在同一个巷道"); |
99 | 99 | } |
100 | 100 | |
101 | + if(!sourceLocation.getArea().equals(desLocation.getArea())) { | |
102 | + return AjaxResult.error("目标库位和源库位不在同一个区域"); | |
103 | + } | |
104 | + | |
101 | 105 | if(sourceLocation.getRowFlag() == 1) { |
102 | 106 | Location location1 = locationService.getNear(sourceLocation); //内侧库位 |
103 | 107 | String locationCode = location1.getCode(); |
... | ... | @@ -125,7 +129,7 @@ public class TransferTaskService { |
125 | 129 | TaskHeader taskHeader = new TaskHeader(); |
126 | 130 | taskHeader.setWarehouseCode(ShiroUtils.getWarehouseCode()); |
127 | 131 | taskHeader.setTaskType(QuantityConstant.TASK_TYPE_TRANSFER); |
128 | - taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_TRANSFER); | |
132 | + taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_WORK); | |
129 | 133 | taskHeader.setContainerCode(sourceLocation.getContainerCode()); |
130 | 134 | taskHeader.setFromLocation(sourceLocationCode); |
131 | 135 | taskHeader.setToLocation(desLocationCode); |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/service/WorkTaskService.java
... | ... | @@ -133,8 +133,7 @@ public class WorkTaskService { |
133 | 133 | TaskHeader taskHeader = new TaskHeader(); |
134 | 134 | taskHeader.setWarehouseCode(ShiroUtils.getWarehouseCode()); |
135 | 135 | taskHeader.setTaskType(QuantityConstant.TASK_TYPE_EMPTYRECEIPT); |
136 | - | |
137 | - taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_WORK); | |
136 | + taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_RECEIPT); | |
138 | 137 | taskHeader.setContainerCode(containerCode); |
139 | 138 | taskHeader.setToLocation(destinationLocation); |
140 | 139 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); |
... | ... | @@ -146,20 +145,7 @@ public class WorkTaskService { |
146 | 145 | } else { |
147 | 146 | throw new ServiceException("空托入库主表生成失败!"); |
148 | 147 | } |
149 | - //写入任务细表 | |
150 | - TaskDetail taskDetail = new TaskDetail(); | |
151 | - taskDetail.setTaskId(taskHeader.getId()); | |
152 | - taskDetail.setTaskType(taskHeader.getTaskType()); | |
153 | - taskDetail.setInternalTaskType(taskHeader.getInternalTaskType()); | |
154 | - taskDetail.setWarehouseCode(taskHeader.getWarehouseCode()); | |
155 | - taskDetail.setCompanyCode(container.getCompanyCode()); | |
156 | - taskDetail.setFromLocation(taskHeader.getFromLocation()); | |
157 | - taskDetail.setToLocation(taskHeader.getToLocation()); | |
158 | - taskDetail.setContainerCode(taskHeader.getContainerCode()); | |
159 | 148 | |
160 | - if(!taskDetailService.save(taskDetail)){ | |
161 | - throw new ServiceException("空托入库任务明细生成失败!"); | |
162 | - } | |
163 | 149 | //锁库位 |
164 | 150 | if (StringUtils.isNotEmpty(destinationLocation)) { |
165 | 151 | locationService.updateStatus(destinationLocation, QuantityConstant.STATUS_LOCK); |
... | ... | @@ -231,15 +217,14 @@ public class WorkTaskService { |
231 | 217 | if (inventoryDetailService.count(queryWrapper) > 0) { |
232 | 218 | return AjaxResult.error("该库位上有库存,无法空托出库!"); |
233 | 219 | } |
234 | - | |
235 | 220 | locationCode = location.getCode(); |
236 | 221 | conCode = location.getContainerCode(); |
237 | 222 | } |
238 | 223 | |
239 | 224 | TaskHeader taskHeader = new TaskHeader(); |
240 | 225 | taskHeader.setWarehouseCode(ShiroUtils.getWarehouseCode()); |
241 | - taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_WORK); | |
242 | 226 | taskHeader.setTaskType(QuantityConstant.TASK_TYPE_EMPTYSHIPMENT); |
227 | + taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_SHIPMENT); | |
243 | 228 | taskHeader.setContainerCode(conCode); |
244 | 229 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); |
245 | 230 | taskHeader.setFromLocation(locationCode); |
... | ... | @@ -279,12 +264,7 @@ public class WorkTaskService { |
279 | 264 | */ |
280 | 265 | public AjaxResult completeEmptyIn(TaskHeader taskHeader) { |
281 | 266 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); |
282 | - List<TaskDetail> taskDetailList = taskDetailService.findByTaskId(taskHeader.getId()); | |
283 | - for (TaskDetail item : taskDetailList) { | |
284 | - item.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); | |
285 | - } | |
286 | - if (!taskDetailService.updateBatchById(taskDetailList) || | |
287 | - !taskHeaderService.updateById(taskHeader)) { | |
267 | + if (!taskHeaderService.updateById(taskHeader)) { | |
288 | 268 | throw new ServiceException("任务单据状态更新失败!"); |
289 | 269 | } |
290 | 270 | |
... | ... | @@ -302,12 +282,7 @@ public class WorkTaskService { |
302 | 282 | */ |
303 | 283 | public AjaxResult completeEmptyOut(TaskHeader taskHeader) { |
304 | 284 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); |
305 | - List<TaskDetail> taskDetailList = taskDetailService.findByTaskId(taskHeader.getId()); | |
306 | - for (TaskDetail item : taskDetailList) { | |
307 | - item.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); | |
308 | - } | |
309 | - if (!taskDetailService.updateBatchById(taskDetailList) || | |
310 | - !taskHeaderService.updateById(taskHeader)) { | |
285 | + if (!taskHeaderService.updateById(taskHeader)) { | |
311 | 286 | throw new ServiceException("任务单据状态更新失败!"); |
312 | 287 | } |
313 | 288 | //解锁容器,更新库位 |
... | ... | @@ -525,8 +500,8 @@ public class WorkTaskService { |
525 | 500 | } |
526 | 501 | TaskHeader taskHeader = new TaskHeader(); |
527 | 502 | taskHeader.setWarehouseCode(ShiroUtils.getWarehouseCode()); |
528 | - taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_WORK); | |
529 | 503 | taskHeader.setTaskType(QuantityConstant.TASK_TYPE_VIEW); |
504 | + taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_WORK); | |
530 | 505 | taskHeader.setContainerCode(conCode); |
531 | 506 | taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); |
532 | 507 | taskHeader.setFromLocation(locationCode); |
... | ... |
src/main/resources/templates/admin/adminLogin.html
src/main/resources/templates/config/container/container.html
... | ... | @@ -190,7 +190,7 @@ |
190 | 190 | align: 'center', |
191 | 191 | formatter: function(value, row, index) { |
192 | 192 | var actions = []; |
193 | - //actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.checklook(\'' + row.id + '\')"><i class="fa fa-search"></i>查看</a> '); | |
193 | + actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); | |
194 | 194 | actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a>'); |
195 | 195 | return actions.join(''); |
196 | 196 | } |
... | ... |
src/main/resources/templates/config/container/edit.html
... | ... | @@ -12,14 +12,6 @@ |
12 | 12 | <input id="code" name="code" th:field="*{code}" class="form-control" type="text" readonly="true"> |
13 | 13 | </div> |
14 | 14 | </div> |
15 | - <div class="form-group"> | |
16 | - <label class="col-sm-3 control-label">容器类型:</label> | |
17 | - <div class="col-sm-8"> | |
18 | - <select id="type" class="form-control m-b" th:with="containerType=${@containerType.getPrefix()}" readonly="true" disabled="disabled"> | |
19 | - <option th:each="item : ${containerType}" th:text="${item['name']}" th:value="${item['prefix']}" th:field="*{type}"></option> | |
20 | - </select> | |
21 | - </div> | |
22 | - </div> | |
23 | 15 | <!--<div class="form-group"> --> |
24 | 16 | <!--<label class="col-sm-3 control-label">库位id:</label>--> |
25 | 17 | <!--<div class="col-sm-8">--> |
... | ... | @@ -29,30 +21,18 @@ |
29 | 21 | <div class="form-group"> |
30 | 22 | <label class="col-sm-3 control-label">库位编码:</label> |
31 | 23 | <div class="col-sm-8"> |
32 | - <input id="locationCode" name="locationCode" th:field="*{locationCode}" class="form-control" type="text" readonly="true"> | |
24 | + <input id="locationCode" name="locationCode" th:field="*{locationCode}" class="form-control" type="text"> | |
33 | 25 | </div> |
34 | 26 | </div> |
35 | 27 | <div class="form-group"> |
36 | 28 | <label class="col-sm-3 control-label">状态:</label> |
37 | 29 | <div class="col-sm-8"> |
38 | - <select name="type" id="status" class="form-control m-b" th:with="dictLabel=${@dict.getType('containerStatus')}" disabled="disabled"> | |
30 | + <select name="type" id="status" class="form-control m-b" th:with="dictLabel=${@dict.getType('containerStatus')}"> | |
39 | 31 | <option th:each="dict : ${dictLabel}" th:text="${dict['dictLabel']}" |
40 | 32 | th:value="${dict['dictValue']}" th:field="*{status}"></option> |
41 | 33 | </select> |
42 | 34 | </div> |
43 | 35 | </div> |
44 | - <div class="form-group"> | |
45 | - <label class="col-sm-3 control-label">AGV货架:</label> | |
46 | - <div class="col-sm-8"> | |
47 | - <input id="goodsShlfNo" name="goodsShlfNo" th:field="*{goodsShlfNo}" class="form-control" type="text" > | |
48 | - </div> | |
49 | - </div> | |
50 | - <div class="form-group"> | |
51 | - <label class="col-sm-3 control-label">打印次数:</label> | |
52 | - <div class="col-sm-8"> | |
53 | - <input id="printCount" name="printCount" th:field="*{printCount}" class="form-control" type="text" readonly="true"> | |
54 | - </div> | |
55 | - </div> | |
56 | 36 | <!--<div class="form-group"> --> |
57 | 37 | <!--<label class="col-sm-3 control-label">创建时间:</label>--> |
58 | 38 | <!--<div class="col-sm-8">--> |
... | ... | @@ -121,7 +101,7 @@ |
121 | 101 | <!--</div>--> |
122 | 102 | <div class="form-group"> |
123 | 103 | <div class="form-control-static col-sm-offset-9"> |
124 | - <!--<button type="submit" class="btn btn-primary">提交</button>--> | |
104 | + <button type="submit" class="btn btn-primary">提交</button> | |
125 | 105 | <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button> |
126 | 106 | </div> |
127 | 107 | </div> |
... | ... |
src/main/resources/templates/config/location/edit.html
... | ... | @@ -57,24 +57,17 @@ |
57 | 57 | </div> |
58 | 58 | </div> |
59 | 59 | <div class="form-group"> |
60 | - <label class="col-sm-3 control-label">容器编码:</label> | |
60 | + <label class="col-sm-3 control-label">容器编号:</label> | |
61 | 61 | <div class="col-sm-8"> |
62 | - <input id="containerCode" name="containerCode" th:field="*{containerCode}" class="form-control" type="text" readonly="true"> | |
62 | + <input id="containerCode" name="containerCode" th:field="*{containerCode}" class="form-control" type="text"> | |
63 | 63 | </div> |
64 | 64 | </div> |
65 | -<!-- <div class="form-group">--> | |
66 | -<!-- <label class="col-sm-3 control-label">库区编码:</label>--> | |
67 | -<!-- <div class="col-sm-8">--> | |
68 | -<!-- <select id="zoneCode" class="form-control" th:with="zone=${@zone.getZoneCodeList()}" readonly="true" disabled="disabled">--> | |
69 | -<!-- <option th:each="item : ${zone}" th:text="${item['name']}" th:value="${item['code']}" th:field="*{zoneCode}" ></option>--> | |
70 | -<!-- </select>--> | |
71 | -<!-- </div>--> | |
72 | -<!-- </div>--> | |
73 | 65 | <div class="form-group"> |
74 | - <label class="col-sm-3 control-label">状态:</label> | |
66 | + <label class="col-sm-3 control-label">库位状态:</label> | |
75 | 67 | <div class="col-sm-8"> |
76 | - <select id="status" class="form-control m-b" th:with="type=${@dict.getType('locationStatus')}" readonly="true" disabled="disabled"> | |
68 | + <select id="status" name="status" class="form-control"> | |
77 | 69 | <option value="empty">空闲</option> |
70 | + <option value="lock">占用</option> | |
78 | 71 | <option value="disable">禁用</option> |
79 | 72 | </select> |
80 | 73 | </div> |
... | ... | @@ -98,7 +91,8 @@ |
98 | 91 | url : prefix + "/edit", |
99 | 92 | data : { |
100 | 93 | "id": $("input[name='id']").val(), |
101 | - "enable" : $("input[name='enable']").is(':checked') | |
94 | + "containerCode" : $("input[name='containerCode']").val(), | |
95 | + "status" : $("#status option:selected").val(), | |
102 | 96 | }, |
103 | 97 | async : false, |
104 | 98 | error : function(request) { |
... | ... |
src/main/resources/templates/config/location/editBatch.html
... | ... | @@ -9,7 +9,7 @@ |
9 | 9 | <div class="form-group"> |
10 | 10 | <label class="col-sm-3 control-label">区域:</label> |
11 | 11 | <div class="col-sm-8"> |
12 | - <select id="area" name="area" class="form-control" th:with="areas=${@dict.getType('areas')}"> | |
12 | + <select id="area" name="area" class="form-control" th:with="areas=${@dict.getType('material_areas')}"> | |
13 | 13 | <option th:each="item : ${areas}" th:text="${item['dictLabel']}" th:value="${item['dictValue']}"></option> |
14 | 14 | </select> |
15 | 15 | </div> |
... | ... |
src/main/resources/templates/config/material/editBatch.html
... | ... | @@ -9,7 +9,7 @@ |
9 | 9 | <div class="form-group"> |
10 | 10 | <label class="col-sm-3 control-label">物料分区</label> |
11 | 11 | <div class="col-sm-8"> |
12 | - <select id="area" name="area" class="form-control" th:with="areas=${@dict.getType('areas')}"> | |
12 | + <select id="area" name="area" class="form-control" th:with="areas=${@dict.getType('material_areas')}"> | |
13 | 13 | <option th:each="item : ${areas}" th:text="${item['dictLabel']}" th:value="${item['dictValue']}"></option> |
14 | 14 | </select> |
15 | 15 | </div> |
... | ... |
src/main/resources/templates/inventory/inventoryHeader/checkOut.html
... | ... | @@ -11,10 +11,21 @@ |
11 | 11 | <div class="form-group"> |
12 | 12 | <label class="col-sm-3 control-label">库存ID:</label> |
13 | 13 | <div class="col-sm-8"> |
14 | - <input id="ids" name="ids" class="form-control" type="text" oninput="myFunction()"> | |
14 | + <input id="ids" name="ids" class="form-control" type="text" oninput="myFunction()" th:value="${id}" readonly> | |
15 | + </div> | |
16 | + </div> | |
17 | + <div class="form-group"> | |
18 | + <label class="col-sm-3 control-label">容器编码:</label> | |
19 | + <div class="col-sm-8"> | |
20 | + <input id="containerCode" name="containerCode" class="form-control" type="text" th:value="${locationCode}" readonly> | |
21 | + </div> | |
22 | + </div> | |
23 | + <div class="form-group"> | |
24 | + <label class="col-sm-3 control-label">库位编码:</label> | |
25 | + <div class="col-sm-8"> | |
26 | + <input id="sourceLocation" name="sourceLocation" class="form-control" type="text" th:value="${containerCode}" readonly> | |
15 | 27 | </div> |
16 | 28 | </div> |
17 | - | |
18 | 29 | <div class="form-group"> |
19 | 30 | <label class="col-sm-3 control-label">出库站台:</label> |
20 | 31 | <div class="col-sm-8"> |
... | ... |
src/main/resources/templates/inventory/inventoryHeader/emptyOut.html
src/main/resources/templates/inventory/inventoryHeader/inventoryHeader.html
... | ... | @@ -99,7 +99,7 @@ |
99 | 99 | search: false, |
100 | 100 | columns: [ |
101 | 101 | { |
102 | - checkbox: true | |
102 | + radio: true | |
103 | 103 | }, |
104 | 104 | { |
105 | 105 | field: 'id', |
... | ... | @@ -278,7 +278,12 @@ |
278 | 278 | } |
279 | 279 | |
280 | 280 | function checkOut() { |
281 | - $.modal.open("出库查看",prefix+"/checkOut") | |
281 | + let rows = $("#bootstrap-table").bootstrapTable('getSelections') | |
282 | + if (rows.length != 1) { | |
283 | + $.modal.alertWarning("请选择一条记录"); | |
284 | + return; | |
285 | + } | |
286 | + $.modal.open("出库查看", prefix+"/checkOut/"+rows[0].id) | |
282 | 287 | } |
283 | 288 | |
284 | 289 | function emptyCheckOut() { |
... | ... |
src/main/resources/templates/login.html
src/main/resources/templates/receipt/reservation/view.html
src/main/resources/templates/task/taskHeader/taskHeader.html
... | ... | @@ -164,7 +164,7 @@ |
164 | 164 | var actions = []; |
165 | 165 | actions.push('<a class="btn btn-info btn-xs " href="#" onclick="detail(\'' + row.id + '\')"><i class="fa fa-list-ul"></i>明细</a> '); |
166 | 166 | if (row.status < 10) { |
167 | - if(row.taskType == 300 || row.taskType == 400 || row.taskType == 900) { | |
167 | + if(row.taskType == 200 || row.taskType == 300 || row.taskType == 400 || row.taskType == 900) { | |
168 | 168 | actions.push('<a class="btn btn-success btn-xs ' + executeFlag + '" href="#" onclick="chooseStation(\'' + row.id + '\')"><i class="fa fa-send" style="padding-right: 1px;"></i>执行</a> '); |
169 | 169 | } else { |
170 | 170 | actions.push('<a class="btn btn-success btn-xs ' + executeFlag + '" href="#" onclick="execute(\'' + row.id + '\')"><i class="fa fa-send" style="padding-right: 1px;"></i>执行</a> '); |
... | ... | @@ -173,6 +173,7 @@ |
173 | 173 | actions.push('<a class="btn btn-primary btn-xs ' + completeFlag + '" href="#" onclick="complete(\'' + row.id + '\')"><i class="fa fa-check"></i>完成</a>'); |
174 | 174 | } |
175 | 175 | if (row.status >= 10 && row.status < 100) { |
176 | + actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>取消</a> '); | |
176 | 177 | actions.push('<a class="btn btn-primary btn-xs ' + completeFlag + '" href="#" onclick="complete(\'' + row.id + '\')"><i class="fa fa-check"></i>完成</a>'); |
177 | 178 | } |
178 | 179 | return actions.join(''); |
... | ... |