Commit 170dec92bf53a656e1426916a560e4bad20a53b9
1 parent
3d824c02
定时任务回传问题调试
Showing
2 changed files
with
28 additions
and
22 deletions
src/main/java/com/huaheng/api/erp/service/TaskReturnServiceImpl.java
... | ... | @@ -156,9 +156,9 @@ public class TaskReturnServiceImpl implements TaskReturnService { |
156 | 156 | String str = gson.toJson(erpInfo); |
157 | 157 | String execute = null; |
158 | 158 | try { |
159 | - log.info("__1_____________成品入库回传erp__________start____________________________"+str); | |
159 | + //log.info("__1_____________成品入库回传erp__________start____________________________"+str); | |
160 | 160 | execute = InvokeHelper.Execute("Kingdee.JY.QR.WebApi.ServicesStub.Api.KDService.Interface", str); |
161 | - log.info("****2***********成品入库回传erp************ end **************************"); | |
161 | + //log.info("****2***********成品入库回传erp************ end **************************"); | |
162 | 162 | } catch (Exception e) { |
163 | 163 | e.printStackTrace(); |
164 | 164 | } |
... | ... | @@ -176,7 +176,7 @@ public class TaskReturnServiceImpl implements TaskReturnService { |
176 | 176 | apiLog.setResponseBody(responseBody); |
177 | 177 | apiLogService.save(apiLog); |
178 | 178 | ERPAjaxResult<ErpInfoId> erpAjaxResult = gson.fromJson(execute, ERPAjaxResult.class); |
179 | - log.info("____3___________成品入库回传erp__________result____________________________"+erpAjaxResult.isResult()); | |
179 | + //log.info("____3___________成品入库回传erp__________result____________________________"+erpAjaxResult.isResult()); | |
180 | 180 | if (erpAjaxResult.isResult()) { |
181 | 181 | barCodeHeader.setLocked(3);//回传成功 |
182 | 182 | barCodeHeaderService.updateById(barCodeHeader); |
... | ... |
src/main/java/com/huaheng/pc/monitor/job/task/RyTask.java
... | ... | @@ -3,6 +3,7 @@ package com.huaheng.pc.monitor.job.task; |
3 | 3 | |
4 | 4 | import com.alibaba.fastjson.JSON; |
5 | 5 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
6 | +import com.huaheng.api.erp.service.TaskReturnServiceImpl; | |
6 | 7 | import com.huaheng.common.support.Convert; |
7 | 8 | import com.huaheng.common.utils.Wrappers; |
8 | 9 | import com.google.gson.Gson; |
... | ... | @@ -67,11 +68,15 @@ import com.huaheng.pc.task.taskHeader.service.TaskHeaderService; |
67 | 68 | import com.huaheng.pc.task.taskHeader.service.WorkTaskService; |
68 | 69 | |
69 | 70 | import org.apache.commons.collections.MapUtils; |
71 | +import org.slf4j.Logger; | |
72 | +import org.slf4j.LoggerFactory; | |
70 | 73 | import org.springframework.stereotype.Component; |
71 | 74 | |
72 | 75 | import javax.annotation.Resource; |
73 | 76 | |
74 | 77 | import java.math.BigDecimal; |
78 | +import java.time.Duration; | |
79 | +import java.time.LocalDateTime; | |
75 | 80 | import java.util.*; |
76 | 81 | |
77 | 82 | /** |
... | ... | @@ -81,6 +86,8 @@ import java.util.*; |
81 | 86 | */ |
82 | 87 | @Component("RyTask") |
83 | 88 | public class RyTask extends BaseController { |
89 | + | |
90 | + private static final Logger log = LoggerFactory.getLogger(RyTask.class); | |
84 | 91 | @Resource |
85 | 92 | private AddressService addressService; |
86 | 93 | @Resource |
... | ... | @@ -262,6 +269,21 @@ public class RyTask extends BaseController { |
262 | 269 | * 3.Fbillno生产订单单据编码 |
263 | 270 | */ |
264 | 271 | public void proReceiptReturn(String params) { |
272 | + LocalDateTime beginTime = LocalDateTime.now(); | |
273 | + log.info("-===========开始============="); | |
274 | + AjaxResult ajaxResult = handleMultiProcess(new MultiProcessListener() { | |
275 | + @Override | |
276 | + public AjaxResult doProcess() { | |
277 | + AjaxResult ajaxResult =proReceiptReturnTo(); | |
278 | + return ajaxResult; | |
279 | + } | |
280 | + }); | |
281 | + Long timeConsuming = Duration.between(beginTime ,LocalDateTime.now()).toMillis(); | |
282 | + log.info("===========结束=========="+timeConsuming); | |
283 | + | |
284 | + } | |
285 | + | |
286 | + public AjaxResult proReceiptReturnTo(){ | |
265 | 287 | List<BarCodeHeader> barCodeHeaderList = barCodeHeaderService.list(new LambdaQueryWrapper<BarCodeHeader>() |
266 | 288 | .lt(BarCodeHeader::getPushErrorCount, 3) |
267 | 289 | .in(BarCodeHeader::getLocked, 2, 4) |
... | ... | @@ -295,28 +317,12 @@ public class RyTask extends BaseController { |
295 | 317 | datas.setFProductType(barCodeHeader.getProType()); |
296 | 318 | datas.setFbillno(barCodeHeader.getFbillno()); |
297 | 319 | |
298 | - AjaxResult ajaxResult = handleMultiProcess(new MultiProcessListener() { | |
299 | - @Override | |
300 | - public AjaxResult doProcess() { | |
301 | - AjaxResult ajaxResult = taskReturnService.sendTaskReturnId(datas,barCodeHeader); | |
302 | - return ajaxResult; | |
303 | - } | |
304 | - }); | |
305 | - // AjaxResult ajaxResult = taskReturnService.sendTaskReturnId(datas); | |
306 | - /* if (ajaxResult.getCode() != 200) { | |
307 | - //回传失败,修改回传次数 | |
308 | - Integer pushErrorCount = barCodeHeader.getPushErrorCount() == null ? 0 : barCodeHeader.getPushErrorCount(); | |
309 | - barCodeHeader.setPushErrorCount(pushErrorCount + 1); | |
310 | - barCodeHeader.setLocked(4);//回传失败 | |
311 | - barCodeHeaderService.updateById(barCodeHeader); | |
312 | - } else { | |
313 | - barCodeHeader.setLocked(3);//回传成功 | |
314 | - } | |
315 | - barCodeHeaderService.updateById(barCodeHeader);*/ | |
320 | + AjaxResult ajaxResult = taskReturnService.sendTaskReturnId(datas,barCodeHeader); | |
321 | + | |
316 | 322 | } |
323 | + return AjaxResult.success(); | |
317 | 324 | } |
318 | 325 | |
319 | - | |
320 | 326 | /** |
321 | 327 | * 拆解电池包,电池类原料出库完成,回传给MES,带生产订单号和电池包号、原料批号、重量 |
322 | 328 | */ |
... | ... |