|
|
@@ -7,7 +7,6 @@ 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.commons.lang3.time.FastDateFormat;
|
|
|
import org.apache.http.client.methods.HttpRequestBase;
|
|
|
import org.apache.log4j.Logger;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -27,9 +26,10 @@ import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
/**
|
|
|
- * 每天定时更新发货提醒异常的数据
|
|
|
+ * 发货提醒任务
|
|
|
*
|
|
|
- * Created by hejq on 2018-06-21.
|
|
|
+ * @author hejq
|
|
|
+ * @date 2018-06-21
|
|
|
*/
|
|
|
@Component
|
|
|
public class SendNoticeTask {
|
|
|
@@ -72,17 +72,21 @@ public class SendNoticeTask {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 每天6点和12点定时更新下发货提醒备料状态
|
|
|
+ * 每天6点、12点、18点定时更新发货提醒备料状态
|
|
|
*/
|
|
|
- @Scheduled(cron = "0 0 6,12 * * ? ")
|
|
|
+ @Scheduled(cron = "0 0 6,12,18 * * ? ")
|
|
|
public void updateWaitingStatus() {
|
|
|
// 更新备料状态
|
|
|
String sql = "update purc$notice " +
|
|
|
"left join purc$orderitems on pn_pdid = pd_id " +
|
|
|
"set is_waiting = purc_notice_wait_to_send(pn_delivery, coalesce(pr_ltinstock, 0)) " +
|
|
|
- "where purc_notice_wait_to_send(pn_delivery, coalesce(pr_ltinstock, 0)) <> is_waiting and pn_status = 200 and is_waiting = 1";
|
|
|
- jdbcTemplate.update(sql);
|
|
|
- communalLogDao.save(new CommunalLog("更新发货提醒备料状态", "定时任务自动更新备料数据", "时间: " + sdf.format(new Date()), DEFAULT_ENUU));
|
|
|
+ "where pn_status = 200 and is_waiting = 1 and purc_notice_wait_to_send(pn_delivery, coalesce(pr_ltinstock, 0)) <> is_waiting";
|
|
|
+ try {
|
|
|
+ int size = jdbcTemplate.update(sql);
|
|
|
+ communalLogDao.save(new CommunalLog("更新发货提醒备料状态", "定时任务自动更新备料数据", "时间: " + sdf.format(new Date()) + ",大小: " + size, DEFAULT_ENUU));
|
|
|
+ } catch (RuntimeException e) {
|
|
|
+ communalLogDao.save(new CommunalLog("更新发货提醒备料状态", "定时任务自动更新备料数据(失败)", e.getMessage(), DEFAULT_ENUU));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|