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);