Commit 9ee034fa24eef445799e919d0171a73ff95f7197
1 parent
d46b7735
物料类型加库位行数,分配库位匹配行数
Showing
6 changed files
with
46 additions
and
3 deletions
src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationServiceImpl.java
... | ... | @@ -16,6 +16,8 @@ import com.huaheng.pc.config.location.domain.Location; |
16 | 16 | import com.huaheng.pc.config.location.service.LocationService; |
17 | 17 | import com.huaheng.pc.config.locationType.domain.LocationType; |
18 | 18 | import com.huaheng.pc.config.locationType.service.LocationTypeService; |
19 | +import com.huaheng.pc.config.materialType.domain.MaterialType; | |
20 | +import com.huaheng.pc.config.materialType.service.MaterialTypeService; | |
19 | 21 | import com.huaheng.pc.config.zone.domain.Zone; |
20 | 22 | import com.huaheng.pc.config.zone.service.ZoneService; |
21 | 23 | import com.huaheng.pc.task.taskHeader.service.TaskHeaderService; |
... | ... | @@ -48,6 +50,7 @@ public class LocationAllocationServiceImpl implements LocationAllocationService |
48 | 50 | @Resource |
49 | 51 | private ConfigService configService; |
50 | 52 | |
53 | + | |
51 | 54 | @Override |
52 | 55 | public String allocation(int locationRule, List<String> locationTypeCodeList, |
53 | 56 | int high, String area, List<String> raodWays, String warehouseCode, |
... | ... | @@ -181,10 +184,17 @@ public class LocationAllocationServiceImpl implements LocationAllocationService |
181 | 184 | // .in(StringUtils.isNotEmpty(roadWays), Location::getRoadway, roadWays) |
182 | 185 | .eq(Location::getStatus, QuantityConstant.STATUS_LOCATION_EMPTY) |
183 | 186 | .eq(high!=0,Location::getHigh,high) |
184 | - .eq(StringUtils.isNotEmpty(materialAreaCode), Location::getMaterialAreaCode, materialAreaCode) | |
187 | + | |
188 | +// .eq(StringUtils.isNotEmpty(materialAreaCode), Location::getMaterialAreaCode, materialAreaCode) | |
185 | 189 | .in(Location::getLocationType, locationTypeCodeList) |
186 | 190 | .eq(Location::getDeleted, 0) |
187 | 191 | .eq(Location::getContainerCode, ""); |
192 | + | |
193 | + if(StringUtils.isNotEmpty(materialAreaCode)){ | |
194 | + String[] split=materialAreaCode.split(","); | |
195 | + List<String> rowslist=Arrays.asList(split); | |
196 | + locationLambda.in(StringUtils.isNotEmpty(materialAreaCode), Location::getIRow, rowslist); | |
197 | + } | |
188 | 198 | //3楼agv查询库位 |
189 | 199 | if(StringUtils.isNotEmpty(weight)){ |
190 | 200 | /*locationLambda.in(Location::getIRow,12,13); |
... | ... |
src/main/java/com/huaheng/api/wcs/service/warecellAllocation/WarecellAllocationServiceImpl.java
... | ... | @@ -204,8 +204,10 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService |
204 | 204 | if(receiptContainerDetailList != null && receiptContainerDetailList.size() > 0) { |
205 | 205 | String materialCode = receiptContainerDetailList.get(0).getMaterialCode(); |
206 | 206 | Material material = materialService.findAllByCode(materialCode, warehouseCode); |
207 | - materialAreaCode = material.getMaterialAreaCode(); | |
208 | - } | |
207 | +// materialAreaCode = material.getMaterialAreaCode(); | |
208 | + String rows=materialTypeService.getMaterialTypeByCode(material.getType()); | |
209 | + materialAreaCode=rows; | |
210 | +; } | |
209 | 211 | //**************************** |
210 | 212 | List<String> roadwaylist=findTaskNoComplete(); |
211 | 213 | locationCode = locationAllocationService.allocation(allocationRule, |
... | ... |
src/main/java/com/huaheng/pc/config/materialType/domain/MaterialType.java
... | ... | @@ -265,5 +265,12 @@ public class MaterialType implements Serializable { |
265 | 265 | @ApiModelProperty(value="自定义字段8") |
266 | 266 | private String userDef8; |
267 | 267 | |
268 | + /** | |
269 | + * 对应库位行数,英文逗号隔开 | |
270 | + */ | |
271 | + @TableField(value = "rows") | |
272 | + @ApiModelProperty(value="对应库位行数") | |
273 | + private String rows; | |
274 | + | |
268 | 275 | private static final long serialVersionUID = 1L; |
269 | 276 | } |
270 | 277 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/config/materialType/service/MaterialTypeService.java
... | ... | @@ -27,4 +27,16 @@ public class MaterialTypeService extends ServiceImpl<MaterialTypeMapper, Materia |
27 | 27 | lambda.eq(MaterialType::getWarehouseCode, ShiroUtils.getWarehouseCode()); |
28 | 28 | return this.listMaps(lambda); |
29 | 29 | } |
30 | + | |
31 | + public String getMaterialTypeByCode(String code){ | |
32 | + LambdaQueryWrapper<MaterialType> lambda = Wrappers.lambdaQuery(); | |
33 | + lambda.eq(MaterialType::getCode, code); | |
34 | + lambda.last("limit 1"); | |
35 | + MaterialType materialType=this.getOne(lambda); | |
36 | + if(materialType!=null){ | |
37 | + return materialType.getRows(); | |
38 | + }else{ | |
39 | + return null; | |
40 | + } | |
41 | + } | |
30 | 42 | } |
... | ... |
src/main/resources/templates/config/materialType/add.html
... | ... | @@ -32,6 +32,12 @@ |
32 | 32 | </div> |
33 | 33 | </div> |
34 | 34 | <div class="form-group"> |
35 | + <label class="col-sm-3 control-label">库位行数:</label> | |
36 | + <div class="col-sm-8"> | |
37 | + <input id="rows" name="rows" class="form-control" type="text" placeholder="英文逗号隔开;比如:1,2"> | |
38 | + </div> | |
39 | + </div> | |
40 | + <div class="form-group"> | |
35 | 41 | <label class="col-sm-3 control-label">保质期(天):</label> |
36 | 42 | <div class="col-sm-8"> |
37 | 43 | <input id="daysToExpire" name="daysToExpire" class="form-control" type="number"> |
... | ... |
src/main/resources/templates/config/materialType/edit.html
... | ... | @@ -35,6 +35,12 @@ |
35 | 35 | </div> |
36 | 36 | </div> |
37 | 37 | <div class="form-group"> |
38 | + <label class="col-sm-3 control-label">库位行数:</label> | |
39 | + <div class="col-sm-8"> | |
40 | + <input id="rows" name="rows" class="form-control" type="text" placeholder="英文逗号隔开;比如:1,2" th:field="*{rows}"> | |
41 | + </div> | |
42 | + </div> | |
43 | + <div class="form-group"> | |
38 | 44 | <label class="col-sm-3 control-label">保质期(天):</label> |
39 | 45 | <div class="col-sm-8"> |
40 | 46 | <input id="daysToExpire" name="daysToExpire" class="form-control" type="number" th:field="*{daysToExpire}"> |
... | ... |