diff --git a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java index 4e967b4..c0caa8b 100644 --- a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java +++ b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityWaybillRegistrationController.java @@ -9,6 +9,7 @@ import com.zcloud.service.comprehensive.*; import com.zcloud.service.operatingvehicles.OperatingVehiclesService; import com.zcloud.service.system.UsersService; import com.zcloud.util.*; +import freemarker.template.SimpleDate; import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.StringUtils; import org.jose4j.lang.StringUtil; @@ -20,6 +21,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; +import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -125,8 +127,12 @@ public class TrafficSecurityWaybillRegistrationController extends BaseController pd.put("CREATETIME", DateUtil.date2Str(new Date())); // 添加时间 pd.put("ISDELETE", "0"); + Date date = new Date(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String format = sdf.format(date); + Date toDay = DateUtil.fomatDate(format); Date shippingDate = DateUtil.fomatDate(pd.getString("SHIPPINGDATE")); - if (shippingDate != null && shippingDate.after(new Date())) { + if (shippingDate != null && (shippingDate.after(new Date()) || String.valueOf(shippingDate).equals(String.valueOf(toDay)))) { pd.put("WAYBILLSTATUS", "3"); } else { pd.put("WAYBILLSTATUS", "1"); @@ -284,8 +290,13 @@ public class TrafficSecurityWaybillRegistrationController extends BaseController if(!ObjectUtil.isEmpty(vehicle)) { pd.put("TRANSPORTVEHICLE", vehicle.getString("OPERATING_ID")); } + + Date date = new Date(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String format = sdf.format(date); + Date toDay = DateUtil.fomatDate(format); Date shippingDate = DateUtil.fomatDate(pd.getString("SHIPPINGDATE")); - if (shippingDate != null && shippingDate.after(new Date())) { + if (shippingDate != null && (shippingDate.after(new Date()) || String.valueOf(shippingDate).equals(String.valueOf(toDay)))) { pd.put("WAYBILLSTATUS", "3"); } else { pd.put("WAYBILLSTATUS", "1");