|
|
@@ -1,9 +1,11 @@
|
|
|
package com.uas.platform.b2b.task;
|
|
|
|
|
|
+import com.uas.platform.b2b.core.util.DateUtils;
|
|
|
import com.uas.platform.b2b.dao.CommunalLogDao;
|
|
|
import com.uas.platform.b2b.dao.PurchaseNoticeDao;
|
|
|
import com.uas.platform.b2b.dao.PurchaseOrderDao;
|
|
|
import com.uas.platform.b2b.model.CommunalLog;
|
|
|
+import com.uas.platform.core.model.Constant;
|
|
|
import com.uas.platform.core.util.HttpUtil;
|
|
|
import org.apache.http.client.methods.HttpRequestBase;
|
|
|
import org.apache.log4j.Logger;
|
|
|
@@ -20,6 +22,7 @@ import java.util.ArrayList;
|
|
|
import java.util.Calendar;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
/**
|
|
|
* 每天定时更新发货提醒异常的数据
|
|
|
@@ -127,4 +130,30 @@ public class SendNoticeTask {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private Short checkNoticeWaitStaus(Date delivery, Integer stock) {
|
|
|
+ Integer nowYear = DateUtils.getYear(new Date());
|
|
|
+ Integer delYear = DateUtils.getYear(delivery);
|
|
|
+ if (Objects.equals(nowYear, delYear)) {
|
|
|
+ if (stock == -1) {
|
|
|
+ Integer nowMonth = DateUtils.getMonth(new Date());
|
|
|
+ Integer delMonth = DateUtils.getMonth(delivery);
|
|
|
+ if (nowMonth >= delMonth) {
|
|
|
+ return Constant.NO;
|
|
|
+ } else if (nowMonth + 1 == delMonth) {
|
|
|
+ Integer nowDay = DateUtils.getDay(new Date());
|
|
|
+ // 本月临界值
|
|
|
+ Integer maxDay = 25;
|
|
|
+ if (nowDay > maxDay) {
|
|
|
+ return Constant.NO;
|
|
|
+ } else {
|
|
|
+ return Constant.YES;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return Constant.YES;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return Constant.NO;
|
|
|
+ }
|
|
|
}
|