Commit 551480fa0a55f90eebb3476985b499d7865ecd1d
1 parent
a47a0234
agv送达异常
Showing
4 changed files
with
45 additions
and
2 deletions
src/main/java/com/huaheng/api/acs/controller/AgvTaskController.java
... | ... | @@ -161,6 +161,17 @@ public class AgvTaskController extends BaseController { |
161 | 161 | return ajaxResult; |
162 | 162 | } |
163 | 163 | |
164 | + @Log(title = "回传MES异常", operating = "回传MES异常", action = BusinessType.UPDATE) | |
165 | + @PostMapping( "/huichuan") | |
166 | + @ResponseBody | |
167 | + public AjaxResult huichuan(String taskId) throws Exception { | |
168 | + if (StringUtils.isEmpty(taskId)){ | |
169 | + return AjaxResult.error("taskId不能为空"); | |
170 | + } | |
171 | + AjaxResult<AgvTask> ajaxResult = acsService.huichuanMesError(Convert.toIntArray(taskId)); | |
172 | + return ajaxResult; | |
173 | + } | |
174 | + | |
164 | 175 | |
165 | 176 | @GetMapping( "/editagv/{id}") |
166 | 177 | public String edit(@PathVariable("id") Integer id, ModelMap mmap){ |
... | ... |
src/main/java/com/huaheng/api/acs/service/AcsService.java
... | ... | @@ -105,4 +105,6 @@ public interface AcsService extends IService<AgvTask>{ |
105 | 105 | void shipmentAgvPortContext(TaskHeader task); |
106 | 106 | |
107 | 107 | AjaxResult emptyContainer(AgvTask agvTask); |
108 | + | |
109 | + AjaxResult<AgvTask> huichuanMesError(Integer[] toIntArray) throws Exception; | |
108 | 110 | } |
... | ... |
src/main/java/com/huaheng/api/acs/service/AcsServiceImpl.java
... | ... | @@ -11,6 +11,8 @@ import com.huaheng.api.acs.domain.AgvTask; |
11 | 11 | import com.huaheng.api.acs.domain.StateInfoUploadModel; |
12 | 12 | import com.huaheng.api.acs.domain.ToAgvTask; |
13 | 13 | import com.huaheng.api.acs.mapper.AcsMapper; |
14 | +import com.huaheng.api.mes.domain.AgvPortMES; | |
15 | +import com.huaheng.api.mes.service.MESHelper; | |
14 | 16 | import com.huaheng.common.constant.HttpConstant; |
15 | 17 | import com.huaheng.common.constant.QuantityConstant; |
16 | 18 | import com.huaheng.common.exception.service.ServiceException; |
... | ... | @@ -109,6 +111,8 @@ public class AcsServiceImpl extends ServiceImpl<AcsMapper,AgvTask> implements Ac |
109 | 111 | private ReceiptTaskService receiptTaskService; |
110 | 112 | @Resource |
111 | 113 | private ReceiptDetailService receiptDetailService; |
114 | + @Resource | |
115 | + private MESHelper mesHelper; | |
112 | 116 | |
113 | 117 | /** |
114 | 118 | * agv 信息上传 |
... | ... | @@ -1112,4 +1116,20 @@ public class AcsServiceImpl extends ServiceImpl<AcsMapper,AgvTask> implements Ac |
1112 | 1116 | agvTask.setWarehouseCode("CS0001"); |
1113 | 1117 | return createAGVTask(agvTask); |
1114 | 1118 | } |
1119 | + | |
1120 | + @Override | |
1121 | + public AjaxResult<AgvTask> huichuanMesError(Integer[] toIntArray) throws Exception { | |
1122 | + for (Integer integer : toIntArray) { | |
1123 | + AgvTask agvTask = acsService.getById(integer); | |
1124 | + AgvPortMES agvPortMES=new AgvPortMES(); | |
1125 | + agvPortMES.setCode(agvTask.getCode()); | |
1126 | + agvPortMES.setStatus("error"); | |
1127 | + String s = JSONObject.toJSONString(agvPortMES); | |
1128 | + mesHelper.returnMESEmptyFinsh(s); | |
1129 | + agvTask.setSendToMes(1); | |
1130 | + agvTask.setStatus(110); | |
1131 | + acsService.updateById(agvTask); | |
1132 | + } | |
1133 | + return AjaxResult.success(""); | |
1134 | + } | |
1115 | 1135 | } |
... | ... |
src/main/resources/templates/task/taskHeader/agvHeader.html
... | ... | @@ -135,11 +135,14 @@ |
135 | 135 | 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> '); |
136 | 136 | actions.push('<a class="btn btn-info btn-xs' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); |
137 | 137 | actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>取消</a> '); |
138 | - actions.push('<a class="btn btn-primary btn-xs ' + completeFlag + '" href="#" onclick="complete(\'' + row.id + '\')"><i class="fa fa-check"></i>完成</a>'); | |
138 | + // actions.push('<a class="btn btn-primary btn-xs ' + completeFlag + '" href="#" onclick="complete(\'' + row.id + '\')"><i class="fa fa-check"></i>完成</a>'); | |
139 | 139 | } |
140 | 140 | if (row.status >= 10 && row.status < 100) { |
141 | 141 | actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>取消</a> '); |
142 | - actions.push('<a class="btn btn-primary btn-xs ' + completeFlag + '" href="#" onclick="complete(\'' + row.id + '\')"><i class="fa fa-check"></i>完成</a>'); | |
142 | + // actions.push('<a class="btn btn-primary btn-xs ' + completeFlag + '" href="#" onclick="complete(\'' + row.id + '\')"><i class="fa fa-check"></i>完成</a>'); | |
143 | + } | |
144 | + if(row.status < 100 && row.status>=10){ | |
145 | + actions.push('<a class="btn btn-info btn-xs ' + removeFlag + '" href="#" onclick="huichuan(\'' + row.id + '\')"><i class="fa fa-remove"></i>异常回传</a> '); | |
143 | 146 | } |
144 | 147 | return actions.join(''); |
145 | 148 | } |
... | ... | @@ -258,6 +261,13 @@ |
258 | 261 | $.operate.post(url, data); |
259 | 262 | }); |
260 | 263 | } |
264 | + function huichuan(taskId) { | |
265 | + $.modal.confirm("确定回传?", function() { | |
266 | + var url = ctx + 'agv/huichuan'; | |
267 | + var data = { "taskId" : taskId }; | |
268 | + $.operate.post(url, data); | |
269 | + }); | |
270 | + } | |
261 | 271 | function complete(taskId) { |
262 | 272 | $.modal.confirm("确定完成任务?", function() { |
263 | 273 | var url = ctx + 'agv/completeTaskByWMS'; |
... | ... |