Commit 58b2e93b8c654a6f03b3c34104342d3fa879f762
1 parent
f9171f77
调整根据库位重量分配库位逻辑
Showing
5 changed files
with
20 additions
and
16 deletions
src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationServiceImpl.java
@@ -210,8 +210,12 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | @@ -210,8 +210,12 @@ public class LocationAllocationServiceImpl implements LocationAllocationService | ||
210 | BigDecimal total_weight_bigdecimal=new BigDecimal(total_weight_config); | 210 | BigDecimal total_weight_bigdecimal=new BigDecimal(total_weight_config); |
211 | BigDecimal total_weight= total_weight_bigdecimal.subtract(new BigDecimal(weight)); | 211 | BigDecimal total_weight= total_weight_bigdecimal.subtract(new BigDecimal(weight)); |
212 | locationLambda.eq(Location::getZoneCode,QuantityConstant.ZONE_AGV); | 212 | locationLambda.eq(Location::getZoneCode,QuantityConstant.ZONE_AGV); |
213 | - locationLambda.inSql(Location::getIColumn, "select a.iColumn from (SELECT iColumn,ifnull(sum(weight),0) sum FROM `location` where zoneCode='B' group by iColumn) a where a.sum<="+total_weight); | ||
214 | - locationLambda.orderByAsc(Location::getIRow,Location::getILayer); | 213 | + locationLambda.last("and (iRow,iColumn) IN (select a.irow,a.iColumn\n" + |
214 | + " FROM (SELECT irow,iColumn,ifnull(sum(weight),0) sum\n" + | ||
215 | + " FROM `location`\n" + | ||
216 | + " WHERE zoneCode='B' group by irow,iColumn) a\n" + | ||
217 | + " WHERE a.sum<="+total_weight+")"); | ||
218 | + //locationLambda.orderByAsc(Location::getIRow,Location::getILayer); | ||
215 | } | 219 | } |
216 | 220 | ||
217 | List<Location> locationList = locationService.list(locationLambda); | 221 | List<Location> locationList = locationService.list(locationLambda); |
src/main/java/com/huaheng/common/constant/QuantityConstant.java
@@ -537,11 +537,11 @@ public class QuantityConstant { | @@ -537,11 +537,11 @@ public class QuantityConstant { | ||
537 | public static final int AGV_TASK_SEND_TYPE_CREATE = 1; | 537 | public static final int AGV_TASK_SEND_TYPE_CREATE = 1; |
538 | public static final int AGV_TASK_SEND_TYPE_CANCEL = 2; | 538 | public static final int AGV_TASK_SEND_TYPE_CANCEL = 2; |
539 | 539 | ||
540 | - //WCS任务下发 | 540 | + //AGV任务下发 |
541 | public static final String ADDRESS_AGV_TASK_ASSIGN = "AGV_TASK_ASSIGN"; | 541 | public static final String ADDRESS_AGV_TASK_ASSIGN = "AGV_TASK_ASSIGN"; |
542 | - //WCS任务取消 | 542 | + //AGV任务取消 |
543 | public static final String ADDRESS_AGV_TASK_CANCEL = "AGV_TASK_CANCEL"; | 543 | public static final String ADDRESS_AGV_TASK_CANCEL = "AGV_TASK_CANCEL"; |
544 | - //WCS任务更新 | 544 | + //AGV任务更新 |
545 | public static final String ADDRESS_AGV_TASK_UPDATE = "AGV_TASK_UPDATE"; | 545 | public static final String ADDRESS_AGV_TASK_UPDATE = "AGV_TASK_UPDATE"; |
546 | 546 | ||
547 | 547 |
src/main/java/com/huaheng/pc/monitor/job/task/RyTask.java
@@ -703,10 +703,10 @@ public class RyTask extends BaseController { | @@ -703,10 +703,10 @@ public class RyTask extends BaseController { | ||
703 | } | 703 | } |
704 | } | 704 | } |
705 | 705 | ||
706 | - /* | ||
707 | - ** 向AGV下发任务 | ||
708 | - * 更新wms库agv任务状态下发状态 | ||
709 | - * 三楼立库AGv任务 | 706 | + /** |
707 | + * 向AGV下发任务 | ||
708 | + * 更新wms库agv任务状态下发状态 | ||
709 | + * 三楼立库AGV任务 | ||
710 | */ | 710 | */ |
711 | public void autoSendAgvTask(String params) { | 711 | public void autoSendAgvTask(String params) { |
712 | AjaxResult ajaxResult = handleMultiProcess(new MultiProcessListener() { | 712 | AjaxResult ajaxResult = handleMultiProcess(new MultiProcessListener() { |
@@ -729,10 +729,10 @@ public class RyTask extends BaseController { | @@ -729,10 +729,10 @@ public class RyTask extends BaseController { | ||
729 | 729 | ||
730 | } | 730 | } |
731 | 731 | ||
732 | - /* | ||
733 | - ** 向AGV发送取消任务指令 | ||
734 | - * 更新wms库agv任务状态下发状态 | ||
735 | - * 三楼立库AGv任务 | 732 | + /** |
733 | + * 向AGV发送取消任务指令 | ||
734 | + * 更新wms库agv任务状态下发状态 | ||
735 | + * 三楼立库AGV任务 | ||
736 | */ | 736 | */ |
737 | public void autoCancelAgvTask(String params) { | 737 | public void autoCancelAgvTask(String params) { |
738 | AjaxResult ajaxResult = handleMultiProcess(new MultiProcessListener() { | 738 | AjaxResult ajaxResult = handleMultiProcess(new MultiProcessListener() { |
src/main/java/com/huaheng/pc/task/agvTask/domain/AgvTask.java
@@ -18,7 +18,6 @@ public class AgvTask { | @@ -18,7 +18,6 @@ public class AgvTask { | ||
18 | @TableId(value = "id", type = IdType.AUTO) | 18 | @TableId(value = "id", type = IdType.AUTO) |
19 | @ApiModelProperty(value="内部号") | 19 | @ApiModelProperty(value="内部号") |
20 | private Integer id; | 20 | private Integer id; |
21 | - | ||
22 | /** | 21 | /** |
23 | * 仓库编码 | 22 | * 仓库编码 |
24 | */ | 23 | */ |
@@ -29,12 +28,13 @@ public class AgvTask { | @@ -29,12 +28,13 @@ public class AgvTask { | ||
29 | @TableField(value = "zoneCode") | 28 | @TableField(value = "zoneCode") |
30 | @ApiModelProperty(value="库区编码") | 29 | @ApiModelProperty(value="库区编码") |
31 | private String zoneCode; | 30 | private String zoneCode; |
31 | + | ||
32 | //100 搬运任务,200行走任务,300 取货任务,400放货任务; | 32 | //100 搬运任务,200行走任务,300 取货任务,400放货任务; |
33 | @TableField(value = "taskType") | 33 | @TableField(value = "taskType") |
34 | @ApiModelProperty(value="任务类型") | 34 | @ApiModelProperty(value="任务类型") |
35 | private Integer taskType; | 35 | private Integer taskType; |
36 | 36 | ||
37 | - //agv任务状态 1生成 10下发 20执行 100 完成 0错误 | 37 | + //agv任务状态 1生成 10下发 20执行 100完成 0错误 |
38 | @TableField(value = "status") | 38 | @TableField(value = "status") |
39 | @ApiModelProperty(value="任务状态") | 39 | @ApiModelProperty(value="任务状态") |
40 | private Integer status; | 40 | private Integer status; |
src/main/java/com/huaheng/pc/task/agvTask/service/AgvTaskServiceImpl.java
@@ -55,7 +55,7 @@ public class AgvTaskServiceImpl extends ServiceImpl<AgvTaskMapper, AgvTask> impl | @@ -55,7 +55,7 @@ public class AgvTaskServiceImpl extends ServiceImpl<AgvTaskMapper, AgvTask> impl | ||
55 | } | 55 | } |
56 | //下发任务给ACS | 56 | //下发任务给ACS |
57 | AjaxResult ajaxResult = acsService.createAGVTask(agvTask); | 57 | AjaxResult ajaxResult = acsService.createAGVTask(agvTask); |
58 | - if (ajaxResult!=null&&!ajaxResult.hasErr()) { | 58 | + if (ajaxResult != null && !ajaxResult.hasErr()) { |
59 | agvTask.setStatus(QuantityConstant.AGV_TASK_STATUS_RELEASE); | 59 | agvTask.setStatus(QuantityConstant.AGV_TASK_STATUS_RELEASE); |
60 | agvTask.setLastUpdated(new Date()); | 60 | agvTask.setLastUpdated(new Date()); |
61 | agvTask.setLastUpdatedBy("Rytask"); | 61 | agvTask.setLastUpdatedBy("Rytask"); |