Commit 8f9c59ee0c43cde5cab9d30da5d09213e336a9e5
1 parent
672e7fe2
定时检测超时任务
Showing
1 changed file
with
62 additions
and
122 deletions
src/main/java/com/order/erp/job/OrderOverTimeEventJob.java
1 | 1 | package com.order.erp.job; |
2 | + | |
2 | 3 | import cn.hutool.core.bean.BeanUtil; |
3 | 4 | import com.alibaba.fastjson.*; |
4 | 5 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
... | ... | @@ -17,6 +18,7 @@ import freemarker.template.TemplateException; |
17 | 18 | import lombok.extern.slf4j.Slf4j; |
18 | 19 | import org.springframework.scheduling.annotation.Scheduled; |
19 | 20 | import org.springframework.stereotype.Component; |
21 | + | |
20 | 22 | import javax.annotation.Resource; |
21 | 23 | import javax.mail.MessagingException; |
22 | 24 | import java.io.IOException; |
... | ... | @@ -25,13 +27,13 @@ import java.time.LocalDateTime; |
25 | 27 | import java.time.format.DateTimeFormatter; |
26 | 28 | import java.time.temporal.ChronoUnit; |
27 | 29 | import java.util.*; |
30 | +import java.util.concurrent.TimeUnit; | |
28 | 31 | import java.util.function.Function; |
29 | 32 | import java.util.regex.Matcher; |
30 | 33 | import java.util.regex.Pattern; |
31 | 34 | import java.util.stream.Collectors; |
32 | 35 | |
33 | 36 | |
34 | - | |
35 | 37 | /** |
36 | 38 | * @author: xms |
37 | 39 | * @description: TODO |
... | ... | @@ -69,17 +71,14 @@ public class OrderOverTimeEventJob { |
69 | 71 | @Resource |
70 | 72 | private RedisUtils redisUtils; |
71 | 73 | |
72 | - String dateFormatDay= com.order.erp.common.excel4j.utils.DateUtils.DATE_FORMAT_DAY; | |
73 | - String dateFormatSEC= com.order.erp.common.excel4j.utils.DateUtils.DATE_FORMAT_SEC; | |
74 | - | |
75 | 74 | /** |
76 | 75 | * 凌晨1点执行,一天一次 |
77 | 76 | */ |
78 | - @Scheduled(cron = "0 0 1 * * ?") | |
79 | - //存储的日期都必须为yyyy-MM-dd HH:mm:ss。 | |
77 | + @Scheduled(cron = "0 0 1 * * ?") | |
78 | + //存储的日期都必须为yyyy-MM-dd HH:mm:ss。 | |
80 | 79 | public void checkOverTimeExecuteV2() throws MessagingException, TemplateException, IOException { |
81 | 80 | List<OrderBaseInfoDO> orderBaseInfoDOList = orderBaseInfoService.getEventList(); |
82 | - if(CollectionUtils.isNotEmpty(orderBaseInfoDOList)){ | |
81 | + if (CollectionUtils.isNotEmpty(orderBaseInfoDOList)) { | |
83 | 82 | Set<Long> orderIds = orderBaseInfoDOList.stream().map(OrderBaseInfoDO::getId).collect(Collectors.toSet()); |
84 | 83 | List<OrderInspectionStageDO> orderInspectionStageDOList = inspectionStageService.list(new LambdaQueryWrapper<OrderInspectionStageDO>() |
85 | 84 | .in(OrderInspectionStageDO::getOrderId, orderIds)); |
... | ... | @@ -100,28 +99,23 @@ public class OrderOverTimeEventJob { |
100 | 99 | */ |
101 | 100 | //发送邮件。 |
102 | 101 | private void sendEmail4OrderEvent(OrderEventEnum eventEnum, List<OrderEventJobVO> eventJobVOS) throws MessagingException, TemplateException, IOException { |
103 | - List<ReceiveEmailMappingDO> allMappings = receiveEmailMappingService.list(); | |
104 | - //存储 customerCode | |
105 | - Set<String> customerCodes = new HashSet<>(); | |
106 | - // 遍历 eventJobVOS,添加不在 Redis 中的 customerCode | |
102 | + | |
103 | + HashSet<String> strings = new HashSet<>(); | |
107 | 104 | for (OrderEventJobVO orderEventJob : eventJobVOS) { |
108 | - String cacheKey = EmailTemplateEnum.byTemplate(eventEnum.getTemplateId()) | |
109 | - + Constant.CROSS_BAR_CHARACTER | |
110 | - + orderEventJob.getBaseInfo().getId(); | |
111 | - if (!redisUtils.hasKey(cacheKey)) { | |
112 | - customerCodes.add(orderEventJob.getBaseInfo().getCustomerCode()); | |
105 | + if (!redisUtils.hasKey(EmailTemplateEnum.byTemplate( | |
106 | + eventEnum.getTemplateId()) + Constant.CROSS_BAR_CHARACTER + orderEventJob.getBaseInfo().getId())) { | |
107 | + strings.add(orderEventJob.getBaseInfo().getCustomerCode()); | |
113 | 108 | } |
114 | 109 | } |
115 | - | |
116 | - // 过滤 ReceiveEmailMappingDO | |
117 | - List<ReceiveEmailMappingDO> receiveEmailMappingDOList = allMappings.stream() | |
118 | - .filter(mapping -> customerCodes.isEmpty() || customerCodes.contains(mapping.getTypeValue())) | |
119 | - .filter(mapping -> { | |
120 | - // 检查 config_infos 是否包含 eventEnum.getEvent() | |
121 | - String configInfos = mapping.getConfigInfos(); | |
122 | - return configInfos != null && configInfos.contains(eventEnum.getEvent()); | |
123 | - }) | |
124 | - .collect(Collectors.toList()); | |
110 | + LambdaQueryWrapper<ReceiveEmailMappingDO> queryWrapper = new LambdaQueryWrapper<>(); | |
111 | + queryWrapper.eq(ReceiveEmailMappingDO::getEnableFlag, Constant.ENABLE_TEN); | |
112 | + if (strings == null || strings.isEmpty()) { | |
113 | + queryWrapper.eq(ReceiveEmailMappingDO::getTypeValue, ""); | |
114 | + } else { | |
115 | + queryWrapper.in(ReceiveEmailMappingDO::getTypeValue, strings); | |
116 | + } | |
117 | + queryWrapper.apply("JSON_CONTAINS(JSON_EXTRACT(config_infos,'$[*].event'),JSON_QUOTE({0}),'$')", eventEnum.getEvent()); | |
118 | + List<ReceiveEmailMappingDO> receiveEmailMappingDOList = receiveEmailMappingService.list(queryWrapper); | |
125 | 119 | |
126 | 120 | Set<Map<String, List<String>>> set = receiveEmailMappingDOList.stream().map(x -> { |
127 | 121 | Map<String, List<String>> map = new HashMap<>(); |
... | ... | @@ -145,7 +139,7 @@ public class OrderOverTimeEventJob { |
145 | 139 | map.get(map.keySet().iterator().next()), orderEventJob); |
146 | 140 | redisUtils.set(EmailTemplateEnum.byTemplate( |
147 | 141 | eventEnum.getTemplateId()) + Constant.CROSS_BAR_CHARACTER + orderEventJob.getBaseInfo().getId(), |
148 | - orderEventJob); | |
142 | + orderEventJob, 90, TimeUnit.DAYS); | |
149 | 143 | } |
150 | 144 | } |
151 | 145 | } |
... | ... | @@ -176,7 +170,7 @@ public class OrderOverTimeEventJob { |
176 | 170 | orderEventJobVO.setBaseInfo(orderBaseInfoVO); |
177 | 171 | orderEventJobVO.setTrackStageInfo(orderTrackStageVO); |
178 | 172 | return orderEventJobVO; |
179 | - }else{ | |
173 | + } else { | |
180 | 174 | return null; |
181 | 175 | } |
182 | 176 | }).filter(Objects::nonNull) |
... | ... | @@ -237,7 +231,6 @@ public class OrderOverTimeEventJob { |
237 | 231 | if (filterEndCheckDateEvent(eventJobVO)) { |
238 | 232 | map.put(OrderEventEnum.END_CHECK_DATE_EVENT.getEvent(), eventJobVO); |
239 | 233 | } |
240 | - // todo 其他订单超期事件判断 中期验货报告和尾期验货报告。 | |
241 | 234 | return map; |
242 | 235 | } |
243 | 236 | |
... | ... | @@ -246,24 +239,13 @@ public class OrderOverTimeEventJob { |
246 | 239 | * @return |
247 | 240 | */ |
248 | 241 | private Boolean filterConfirmSampleOrderEvent(OrderEventJobVO eventJobVO) { |
249 | - | |
250 | - // todo 判断是否未能在规定的期限内完成以下货号的确认样确认 | |
251 | 242 | String orderHodTime = eventJobVO.getBaseInfo().getOrderHodTime(); |
243 | + String ppConfirmTime = eventJobVO.getTrackStageInfo().getPpConfirmTime(); | |
252 | 244 | String ppConfirmResult = eventJobVO.getTrackStageInfo().getPpConfirmResult(); |
253 | - if (StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(ppConfirmResult)) { | |
254 | - if (!ppConfirmResult.contains("ok") && org.apache.commons.lang3.StringUtils.countMatches(ppConfirmResult, "fail") == 3) { | |
245 | + if (StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(ppConfirmResult) && StringUtils.isNotBlank(ppConfirmTime)) { | |
246 | + int daysBetween = getDaysBetween(ppConfirmResult, ppConfirmTime, orderHodTime); | |
247 | + if (daysBetween == Constant.TWENTY_FIRST || daysBetween == Constant.NEGATIVE_ONE) { | |
255 | 248 | return true; |
256 | - } else if (ppConfirmResult.contains("ok") || org.apache.commons.lang3.StringUtils.countMatches(ppConfirmResult, "fail") < 3) { | |
257 | - LocalDate parse1 = findLatestDateBeforeOk(ppConfirmResult); | |
258 | - //把订单中的Hod时间yyyy-mm-dd HH:mm:ss改成yyyy-mm-dd。 | |
259 | - String[] hodTime = orderHodTime.split(" "); | |
260 | - String orderhodTime = hodTime[0]; | |
261 | - LocalDate parse2 = DateUtils.parseDate(orderhodTime, dateFormatDay); | |
262 | - long daysBetween = ChronoUnit.DAYS.between(parse1, parse2); | |
263 | - if (daysBetween == 21) { | |
264 | - return true; | |
265 | - | |
266 | - } | |
267 | 249 | } |
268 | 250 | } |
269 | 251 | return false; |
... | ... | @@ -273,16 +255,12 @@ public class OrderOverTimeEventJob { |
273 | 255 | String orderHodTime = eventJobVO.getBaseInfo().getOrderHodTime(); |
274 | 256 | String esoSampleSendTime = eventJobVO.getTrackStageInfo().getEsoSampleSendTime(); |
275 | 257 | if (StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(esoSampleSendTime)) { |
276 | - //把订单中的Hod时间yyyy-mm-dd HH:mm:ss改成yyyy-mm-dd。 | |
277 | - String[] hodTime = orderHodTime.split(" "); | |
278 | - String orderhodTime = hodTime[0]; | |
279 | - LocalDate parse2 = DateUtils.parseDate(orderhodTime, dateFormatDay); | |
280 | - LocalDateTime dateTime=LocalDateTime.parse(esoSampleSendTime, DateTimeFormatter.ofPattern(dateFormatSEC)); | |
281 | - String parse=dateTime.format(DateTimeFormatter.ofPattern(dateFormatDay)); | |
282 | - LocalDate parse1=DateUtils.parseDate(parse,dateFormatDay); | |
283 | - if (ChronoUnit.DAYS.between(parse1, parse2) == 7) { | |
258 | + LocalDate orderHodTimelocalDate = DateUtils.parseDate(orderHodTime); | |
259 | + LocalDate esoSampleSendTimelocalDate = DateUtils.parseDate(esoSampleSendTime); | |
260 | + if (ChronoUnit.DAYS.between(esoSampleSendTimelocalDate, orderHodTimelocalDate) == Constant.SEVEN) { | |
284 | 261 | return true; |
285 | 262 | } |
263 | + | |
286 | 264 | } |
287 | 265 | return false; |
288 | 266 | } |
... | ... | @@ -290,19 +268,11 @@ public class OrderOverTimeEventJob { |
290 | 268 | private Boolean filterBigSampleEvent(OrderEventJobVO eventJobVO) { |
291 | 269 | String orderHodTime = eventJobVO.getBaseInfo().getOrderHodTime(); |
292 | 270 | String shippmentSampleConfirmResult = eventJobVO.getTrackStageInfo().getShippmentSampleConfirmResult(); |
293 | - if (StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(shippmentSampleConfirmResult)) { | |
294 | - if (!shippmentSampleConfirmResult.contains("ok") && org.apache.commons.lang3.StringUtils.countMatches(shippmentSampleConfirmResult, "fail") == 3) { | |
271 | + String shippmentSampleConfirmTime = eventJobVO.getTrackStageInfo().getShippmentSampleSendTime(); | |
272 | + if (StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(shippmentSampleConfirmResult) && StringUtils.isNotBlank(shippmentSampleConfirmTime)) { | |
273 | + int daysBetween = getDaysBetween(shippmentSampleConfirmResult, shippmentSampleConfirmTime, orderHodTime); | |
274 | + if (daysBetween == Constant.SEVEN || daysBetween == Constant.NEGATIVE_ONE) { | |
295 | 275 | return true; |
296 | - } else if (shippmentSampleConfirmResult.contains("ok") || org.apache.commons.lang3.StringUtils.countMatches(shippmentSampleConfirmResult, "fail") < 3) { | |
297 | - //把订单中的Hod时间yyyy-mm-dd HH:mm:ss改成yyyy-mm-dd。 | |
298 | - String[] hodTime = orderHodTime.split(" "); | |
299 | - String orderhodTime = hodTime[0]; | |
300 | - LocalDate parse2 = DateUtils.parseDate(orderhodTime, dateFormatDay); | |
301 | - LocalDate parse1 = findLatestDateBeforeOk(shippmentSampleConfirmResult); | |
302 | - long daysBetween = ChronoUnit.DAYS.between(parse1, parse2); | |
303 | - if (daysBetween == 7) { | |
304 | - return true; | |
305 | - } | |
306 | 276 | } |
307 | 277 | } |
308 | 278 | return false; |
... | ... | @@ -311,28 +281,20 @@ public class OrderOverTimeEventJob { |
311 | 281 | |
312 | 282 | private Boolean filterAITEXSGSTestEvent(OrderEventJobVO eventJobVO) { |
313 | 283 | String orderHodTime = eventJobVO.getBaseInfo().getOrderHodTime(); |
314 | - String shippmentSampleConfirmResult = eventJobVO.getTrackStageInfo().getAitexTestFinishResult(); | |
284 | + String aitexTestFinishResult = eventJobVO.getTrackStageInfo().getAitexTestFinishResult(); | |
315 | 285 | String sgsTestFinishResult = eventJobVO.getTrackStageInfo().getSgsTestFinishResult(); |
316 | - if (StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(shippmentSampleConfirmResult) || | |
317 | - StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(sgsTestFinishResult)) { | |
318 | - if (!shippmentSampleConfirmResult.contains("ok") && org.apache.commons.lang3.StringUtils.countMatches(shippmentSampleConfirmResult, "fail") == 3 || | |
319 | - !shippmentSampleConfirmResult.contains("ok") && org.apache.commons.lang3.StringUtils.countMatches(sgsTestFinishResult, "fail") == 3) { | |
286 | + String sgsTestFinishTime = eventJobVO.getTrackStageInfo().getSgsTestFinishTime(); | |
287 | + String aitexTestFinishTime = eventJobVO.getTrackStageInfo().getAitexTestFinishTime(); | |
288 | + if (StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(aitexTestFinishResult) && StringUtils.isNotBlank(aitexTestFinishTime) || | |
289 | + StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(sgsTestFinishResult) && StringUtils.isNotBlank(sgsTestFinishTime)) { | |
290 | + int aitextestDaysBetween = getDaysBetween(aitexTestFinishResult, aitexTestFinishTime, orderHodTime); | |
291 | + int sgstestDaysBetween = getDaysBetween(sgsTestFinishResult, sgsTestFinishTime, orderHodTime); | |
292 | + if (aitextestDaysBetween == Constant.THREE || sgstestDaysBetween == Constant.LOCK_ERROR_TIMES || aitextestDaysBetween == Constant.NEGATIVE_ONE || sgstestDaysBetween == Constant.NEGATIVE_ONE) { | |
320 | 293 | return true; |
321 | - } else if ((shippmentSampleConfirmResult.contains("ok") || org.apache.commons.lang3.StringUtils.countMatches(shippmentSampleConfirmResult, "fail") < 3) || | |
322 | - (sgsTestFinishResult.contains("ok") || org.apache.commons.lang3.StringUtils.countMatches(sgsTestFinishResult, "fail") < 3)) { | |
323 | - String[] hodTime = orderHodTime.split(" "); | |
324 | - String orderhodTime=hodTime[0]; | |
325 | - LocalDate parse1 = findLatestDateBeforeOk(shippmentSampleConfirmResult); | |
326 | - LocalDate parse2 = DateUtils.parseDate(orderhodTime, dateFormatDay); | |
327 | - LocalDate parse3 = findLatestDateBeforeOk(sgsTestFinishResult); | |
328 | - long daysBetween = ChronoUnit.DAYS.between(parse1, parse2); | |
329 | - long daysBetween1 = ChronoUnit.DAYS.between(parse3, parse2); | |
330 | - if (daysBetween == 3 || daysBetween1 == 3) { | |
331 | - return true; | |
332 | - } | |
333 | 294 | } |
334 | 295 | } |
335 | 296 | return false; |
297 | + | |
336 | 298 | } |
337 | 299 | |
338 | 300 | |
... | ... | @@ -340,13 +302,9 @@ public class OrderOverTimeEventJob { |
340 | 302 | String orderHodTime = eventJobVO.getBaseInfo().getOrderHodTime(); |
341 | 303 | String lastArrivalTime = eventJobVO.getTrackStageInfo().getLatestArrivalTime(); |
342 | 304 | if (StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(lastArrivalTime)) { |
343 | - String[] hodTime = orderHodTime.split(" "); | |
344 | - String orderhodTime=hodTime[0]; | |
345 | - LocalDate parse2 = DateUtils.parseDate(orderhodTime, dateFormatDay); | |
346 | - LocalDateTime dateTime=LocalDateTime.parse(lastArrivalTime, DateTimeFormatter.ofPattern(dateFormatSEC)); | |
347 | - String parse=dateTime.format(DateTimeFormatter.ofPattern(dateFormatDay)); | |
348 | - LocalDate parse1=DateUtils.parseDate(parse,dateFormatDay); | |
349 | - if (ChronoUnit.DAYS.between(parse1, parse2) == 7) { | |
305 | + LocalDate orderHodTimelocalDate = DateUtils.parseDate(orderHodTime); | |
306 | + LocalDate lastArrivalTimelocalDate = DateUtils.parseDate(lastArrivalTime); | |
307 | + if (ChronoUnit.DAYS.between(lastArrivalTimelocalDate, orderHodTimelocalDate) == Constant.SEVEN) { | |
350 | 308 | return true; |
351 | 309 | } |
352 | 310 | } |
... | ... | @@ -357,56 +315,38 @@ public class OrderOverTimeEventJob { |
357 | 315 | String orderHodTime = eventJobVO.getBaseInfo().getOrderHodTime(); |
358 | 316 | String latestBkTime = eventJobVO.getTrackStageInfo().getLatestBkTime(); |
359 | 317 | if (StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(latestBkTime)) { |
360 | - String[] hodTime = orderHodTime.split(" "); | |
361 | - String orderhodTime=hodTime[0]; | |
362 | - LocalDate parse2 = DateUtils.parseDate(orderhodTime, dateFormatDay); | |
363 | - LocalDateTime dateTime=LocalDateTime.parse(latestBkTime, DateTimeFormatter.ofPattern(dateFormatSEC)); | |
364 | - String parse=dateTime.format(DateTimeFormatter.ofPattern(dateFormatDay)); | |
365 | - LocalDate parse1=DateUtils.parseDate(parse,dateFormatDay); | |
366 | - if (ChronoUnit.DAYS.between(parse1, parse2) == 10) { | |
318 | + LocalDate latestBkTimelocalDate = DateUtils.parseDate(latestBkTime); | |
319 | + LocalDate orderHodTimelocalDate = DateUtils.parseDate(orderHodTime); | |
320 | + if (ChronoUnit.DAYS.between(latestBkTimelocalDate, orderHodTimelocalDate) == Constant.ENABLE_TEN) { | |
367 | 321 | return true; |
368 | 322 | } |
369 | 323 | } |
370 | 324 | return false; |
325 | + | |
371 | 326 | } |
372 | 327 | |
373 | 328 | private Boolean filterEndCheckDateEvent(OrderEventJobVO eventJobVO) { |
374 | 329 | String orderHodTime = eventJobVO.getBaseInfo().getOrderHodTime(); |
375 | 330 | String endCheckApplyTime = eventJobVO.getInspectionStageInfo().getEndCheckApplyTime(); |
376 | 331 | if (StringUtils.isNotBlank(orderHodTime) && StringUtils.isNotBlank(endCheckApplyTime)) { |
377 | - String[] hodTime = orderHodTime.split(" "); | |
378 | - String orderhodTime=hodTime[0]; | |
379 | - LocalDate parse2 = DateUtils.parseDate(orderhodTime, dateFormatDay); | |
380 | - LocalDateTime dateTime=LocalDateTime.parse(endCheckApplyTime, DateTimeFormatter.ofPattern(dateFormatSEC)); | |
381 | - String parse=dateTime.format(DateTimeFormatter.ofPattern(dateFormatDay)); | |
382 | - LocalDate parse1=DateUtils.parseDate(parse,dateFormatDay); | |
383 | - if (ChronoUnit.DAYS.between(parse1, parse2) == 2) { | |
332 | + LocalDate endCheckApplyTimelocalDate = DateUtils.parseDate(endCheckApplyTime); | |
333 | + LocalDate orderHodTimelocalDate = DateUtils.parseDate(orderHodTime); | |
334 | + if (ChronoUnit.DAYS.between(endCheckApplyTimelocalDate, orderHodTimelocalDate) == Constant.TWO) { | |
384 | 335 | return true; |
385 | 336 | } |
386 | 337 | } |
387 | 338 | return false; |
388 | 339 | } |
389 | 340 | |
390 | - public LocalDate findLatestDateBeforeOk(String data){ | |
391 | - DateTimeFormatter formatter = DateTimeFormatter.ofPattern(dateFormatSEC); | |
392 | - LocalDateTime latestDateBeforeOk = null; | |
393 | - // 正则表达式提取日期和状态 | |
394 | - Pattern pattern = Pattern.compile("(\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2})\\s+(.*?)(?=\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}|$)"); | |
395 | - Matcher matcher = pattern.matcher(data); | |
396 | - while (matcher.find()) { | |
397 | - LocalDateTime eventDate = LocalDateTime.parse(matcher.group(1), formatter); | |
398 | - String status = matcher.group(2); | |
399 | - // 查找 "ok" 的位置 | |
400 | - int okIndex = data.indexOf("ok"); | |
401 | - if (okIndex != -1 && matcher.start() < okIndex) { | |
402 | - // 更新 latestDateBeforeOk 为当前事件的日期,如果当前日期晚于已知的日期 | |
403 | - if (latestDateBeforeOk == null || eventDate.isAfter(latestDateBeforeOk)) { | |
404 | - latestDateBeforeOk = eventDate; | |
405 | - } | |
406 | - } | |
341 | + | |
342 | + public int getDaysBetween(String resultStatus, String startDateStr, String orderHodTime) { | |
343 | + if (!resultStatus.contains("ok") && resultStatus.startsWith("3")) { | |
344 | + return Constant.NEGATIVE_ONE; | |
345 | + } else if (!resultStatus.contains("ok") && (resultStatus.startsWith("2") || resultStatus.startsWith("1"))) { | |
346 | + LocalDate ppConfirmTimeDate = DateUtils.parseDate(startDateStr); | |
347 | + LocalDate orderHodTimeDate = DateUtils.parseDate(orderHodTime); | |
348 | + return (int) ChronoUnit.DAYS.between(ppConfirmTimeDate, orderHodTimeDate); | |
407 | 349 | } |
408 | - // 转换为 LocalDate,去掉时分秒 | |
409 | - return (latestDateBeforeOk != null) ? latestDateBeforeOk.toLocalDate() : null; | |
350 | + return Constant.ZERO; | |
410 | 351 | } |
411 | - | |
412 | 352 | } | ... | ... |