forked from integrated_whb/integrated_whb
parent
5c93557bc9
commit
63dc4bb253
|
@ -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);
|
||||
|
|
|
@ -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); //返回结果
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<PageData> 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 去修改页面获取数据
|
||||
*
|
||||
|
|
|
@ -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<PageData> 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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue