From 63dc4bb253251b9508a8f80f7316872912870011 Mon Sep 17 00:00:00 2001 From: xiepeng Date: Sat, 11 May 2024 18:00:17 +0800 Subject: [PATCH] =?UTF-8?q?BUG=E4=BC=98=E5=8C=96=20=E8=A1=8C=E8=BD=A6?= =?UTF-8?q?=E4=B8=89=E6=A3=80=20=E7=8A=B6=E6=80=81=E8=B0=83=E6=95=B4=20?= =?UTF-8?q?=E6=9C=BA=E5=8A=A1=E6=A1=A3=E6=A1=88=20=E7=9A=84=E5=88=B0?= =?UTF-8?q?=E6=9C=9F=E6=97=A5=E6=9C=9F=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/beidou/BeidouController.java | 39 ++++++++++++ .../AppTrafficSecurityNoticeController.java | 4 +- ...SecurityWaybillRegistrationController.java | 2 +- .../InspectAnnuallyController.java | 59 +++++++++++++++---- .../controller/insure/InsureController.java | 43 +++++++++++++- .../maintenance/MaintenanceController.java | 40 +++++++++++++ .../operations/OperationsController.java | 40 +++++++++++++ 7 files changed, 212 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/zcloud/controller/beidou/BeidouController.java b/src/main/java/com/zcloud/controller/beidou/BeidouController.java index 295ccb7..d768dcb 100644 --- a/src/main/java/com/zcloud/controller/beidou/BeidouController.java +++ b/src/main/java/com/zcloud/controller/beidou/BeidouController.java @@ -25,6 +25,8 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -235,6 +237,43 @@ public class BeidouController extends BaseController { } return false; }); + varList.forEach(data -> { + Date dueDate = DateUtil.fomatDate(data.getString("DUE_DATE")); + Date reminderDate = DateUtil.fomatDate(data.getString("REMINDER_DATE")); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String toDay = sdf.format(new Date()); + Date date = null; + try { + date = sdf.parse(toDay); + } catch (ParseException e) { + throw new RuntimeException(e); + } + // 已到期 + if(dueDate.before(date)) { + data.put("REVERT", "0"); + try { + beidouService.edit(data); + } catch (Exception e) { + throw new RuntimeException(e); + } + // 即将到期 + } else if ((dueDate.after(date) || dueDate.equals(date)) && (reminderDate.before(date) || reminderDate.equals(date))) { + data.put("REVERT", "2"); + try { + beidouService.edit(data); + } catch (Exception e) { + throw new RuntimeException(e); + } + // 未到期 + }else{ + data.put("REVERT", "1"); + try { + beidouService.edit(data); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + }); map.put("varList", varList); map.put("page", page); map.put("result", errInfo); diff --git a/src/main/java/com/zcloud/controller/comprehensive/AppTrafficSecurityNoticeController.java b/src/main/java/com/zcloud/controller/comprehensive/AppTrafficSecurityNoticeController.java index 5085afb..6cd798a 100644 --- a/src/main/java/com/zcloud/controller/comprehensive/AppTrafficSecurityNoticeController.java +++ b/src/main/java/com/zcloud/controller/comprehensive/AppTrafficSecurityNoticeController.java @@ -47,8 +47,8 @@ public class AppTrafficSecurityNoticeController extends BaseController { String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); - pd.put("DELETOR", Jurisdiction.getCORPINFO_ID()); //删除人id - pd.put("DELETORNAME", Jurisdiction.getUsername()); //删除人姓名 + pd.put("DELETOR", pd.getString("USER_ID")); //删除人id + pd.put("DELETORNAME", pd.getString("USERNAME")); //删除人姓名 pd.put("DELETETIME", DateUtil.date2Str(new Date())); //删除时间 securityNoticeService.delete(pd); map.put("result", errInfo); //返回结果 diff --git a/src/main/java/com/zcloud/controller/comprehensive/AppTrafficSecurityWaybillRegistrationController.java b/src/main/java/com/zcloud/controller/comprehensive/AppTrafficSecurityWaybillRegistrationController.java index 617d537..7d6f1b2 100644 --- a/src/main/java/com/zcloud/controller/comprehensive/AppTrafficSecurityWaybillRegistrationController.java +++ b/src/main/java/com/zcloud/controller/comprehensive/AppTrafficSecurityWaybillRegistrationController.java @@ -122,7 +122,7 @@ public class AppTrafficSecurityWaybillRegistrationController extends BaseControl if (shippingDate != null && shippingDate.after(new Date())) { pd.put("WAYBILLSTATUS", "1"); } else { - pd.put("WAYBILLSTATUS", "0"); + pd.put("WAYBILLSTATUS", "3"); } trafficSecurityWaybillRegistrationService.save(pd); diff --git a/src/main/java/com/zcloud/controller/inspectAnnually/InspectAnnuallyController.java b/src/main/java/com/zcloud/controller/inspectAnnually/InspectAnnuallyController.java index b1acf22..47bf071 100644 --- a/src/main/java/com/zcloud/controller/inspectAnnually/InspectAnnuallyController.java +++ b/src/main/java/com/zcloud/controller/inspectAnnually/InspectAnnuallyController.java @@ -1,6 +1,7 @@ package com.zcloud.controller.inspectAnnually; import cn.hutool.core.bean.BeanUtil; +import com.alibaba.excel.util.DateUtils; import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; @@ -21,6 +22,9 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; +import javax.xml.crypto.Data; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -176,21 +180,56 @@ public class InspectAnnuallyController extends BaseController { pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业ID page.setPd(pd); List varList = inspectAnnuallyService.list(page); //列出年检列表 - varList.stream().anyMatch(InspectAnnuallyController::vehicleType); + varList.stream().anyMatch(data -> { + if ("1".equals(data.getString("OPEAR_ISSCRAP")) || "1".equals(data.getString("FREIGHT_ISSCRAP"))) { + data.put("ARCHIVES_TYPE", "2"); + } else if ("1".equals(data.getString("OPEAR_ISASSIGNED")) || "1".equals(data.getString("FREIGHT_ISASSIGNED"))) { + data.put("ARCHIVES_TYPE", "1"); + } + return false; + }); + varList.forEach(data -> { + Date dueDate = DateUtil.fomatDate(data.getString("DUE_DATE")); + Date reminderDate = DateUtil.fomatDate(data.getString("REMINDER_DATE")); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String toDay = sdf.format(new Date()); + Date date = null; + try { + date = sdf.parse(toDay); + } catch (ParseException e) { + throw new RuntimeException(e); + } + // 已到期 + if(dueDate.before(date)) { + data.put("REVERT", "0"); + try { + inspectAnnuallyService.edit(data); + } catch (Exception e) { + throw new RuntimeException(e); + } + // 即将到期 + } else if ((dueDate.after(date) || dueDate.equals(date)) && (reminderDate.before(date) || reminderDate.equals(date))) { + data.put("REVERT", "2"); + try { + inspectAnnuallyService.edit(data); + } catch (Exception e) { + throw new RuntimeException(e); + } + // 未到期 + }else{ + data.put("REVERT", "1"); + try { + inspectAnnuallyService.edit(data); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + }); map.put("varList", varList); map.put("page", page); map.put("result", errInfo); return map; } - private static boolean vehicleType (PageData data) { - if ("1".equals(data.getString("OPEAR_ISSCRAP")) || "1".equals(data.getString("FREIGHT_ISSCRAP"))) { - data.put("ARCHIVES_TYPE", "2"); - } else if ("1".equals(data.getString("OPEAR_ISASSIGNED")) || "1".equals(data.getString("FREIGHT_ISASSIGNED"))) { - data.put("ARCHIVES_TYPE", "1"); - } - return false; - } - /** * 去修改页面获取数据 * diff --git a/src/main/java/com/zcloud/controller/insure/InsureController.java b/src/main/java/com/zcloud/controller/insure/InsureController.java index f51502a..9f59996 100644 --- a/src/main/java/com/zcloud/controller/insure/InsureController.java +++ b/src/main/java/com/zcloud/controller/insure/InsureController.java @@ -20,6 +20,8 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -175,7 +177,44 @@ public class InsureController extends BaseController { page.setPd(pd); List varList = insureService.list(page); //列出Question列表 // 到期状态 - varList.stream().forEach(data -> { + varList.forEach(data -> { + Date dueDate = DateUtil.fomatDate(data.getString("DUE_DATE")); + Date reminderDate = DateUtil.fomatDate(data.getString("REMINDER_DATE")); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String toDay = sdf.format(new Date()); + Date date = null; + try { + date = sdf.parse(toDay); + } catch (ParseException e) { + throw new RuntimeException(e); + } + // 已到期 + if(dueDate.before(date)) { + data.put("REVERT", "0"); + try { + insureService.edit(data); + } catch (Exception e) { + throw new RuntimeException(e); + } + // 即将到期 + } else if ((dueDate.after(date) || dueDate.equals(date)) && (reminderDate.before(date) || reminderDate.equals(date))) { + data.put("REVERT", "2"); + try { + insureService.edit(data); + } catch (Exception e) { + throw new RuntimeException(e); + } + // 未到期 + }else{ + data.put("REVERT", "1"); + try { + insureService.edit(data); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + }); + /*varList.stream().forEach(data -> { if (DateUtil.compareDate(data.getString("DUE_DATE"), DateUtil.getDay()) && DateUtil.compareDate(DateUtil.getDay(), data.getString("REMINDER_DATE"))) { data.put("DUE_DATE_TYPE", 2); } else if (DateUtil.compareDate(DateUtil.getDay(), data.getString("DUE_DATE"))) { @@ -183,7 +222,7 @@ public class InsureController extends BaseController { } else if (DateUtil.compareDate(data.getString("DUE_DATE"), DateUtil.getDay())) { data.put("DUE_DATE_TYPE", 1); } - }); + });*/ map.put("varList", varList); map.put("page", page); diff --git a/src/main/java/com/zcloud/controller/maintenance/MaintenanceController.java b/src/main/java/com/zcloud/controller/maintenance/MaintenanceController.java index 8b6ac26..69c4868 100644 --- a/src/main/java/com/zcloud/controller/maintenance/MaintenanceController.java +++ b/src/main/java/com/zcloud/controller/maintenance/MaintenanceController.java @@ -17,6 +17,8 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -181,6 +183,44 @@ public class MaintenanceController extends BaseController { return false; }); + varList.forEach(data -> { + Date dueDate = DateUtil.fomatDate(data.getString("DUE_DATE")); + Date reminderDate = DateUtil.fomatDate(data.getString("REMINDER_DATE")); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String toDay = sdf.format(new Date()); + Date date = null; + try { + date = sdf.parse(toDay); + } catch (ParseException e) { + throw new RuntimeException(e); + } + // 已到期 + if(dueDate.before(date)) { + data.put("REVERT", "0"); + try { + maintenanceService.edit(data); + } catch (Exception e) { + throw new RuntimeException(e); + } + // 即将到期 + } else if ((dueDate.after(date) || dueDate.equals(date)) && (reminderDate.before(date) || reminderDate.equals(date))) { + data.put("REVERT", "2"); + try { + maintenanceService.edit(data); + } catch (Exception e) { + throw new RuntimeException(e); + } + // 未到期 + }else{ + data.put("REVERT", "1"); + try { + maintenanceService.edit(data); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + }); + map.put("varList", varList); map.put("page", page); map.put("result", errInfo); diff --git a/src/main/java/com/zcloud/controller/operations/OperationsController.java b/src/main/java/com/zcloud/controller/operations/OperationsController.java index 7daf26e..4e25fa9 100644 --- a/src/main/java/com/zcloud/controller/operations/OperationsController.java +++ b/src/main/java/com/zcloud/controller/operations/OperationsController.java @@ -17,6 +17,8 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -180,6 +182,44 @@ public class OperationsController extends BaseController { return false; }); + varList.forEach(data -> { + Date dueDate = DateUtil.fomatDate(data.getString("DUE_DATE")); + Date reminderDate = DateUtil.fomatDate(data.getString("REMINDER_DATE")); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String toDay = sdf.format(new Date()); + Date date = null; + try { + date = sdf.parse(toDay); + } catch (ParseException e) { + throw new RuntimeException(e); + } + // 已到期 + if(dueDate.before(date)) { + data.put("REVERT", "0"); + try { + operationsService.edit(data); + } catch (Exception e) { + throw new RuntimeException(e); + } + // 即将到期 + } else if ((dueDate.after(date) || dueDate.equals(date)) && (reminderDate.before(date) || reminderDate.equals(date))) { + data.put("REVERT", "2"); + try { + operationsService.edit(data); + } catch (Exception e) { + throw new RuntimeException(e); + } + // 未到期 + }else{ + data.put("REVERT", "1"); + try { + operationsService.edit(data); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + }); + map.put("varList", varList); map.put("page", page); map.put("result", errInfo);