|
|
@@ -30,17 +30,23 @@ public class PurchaseNotifyTask extends AbstractTask {
|
|
|
PurchaseNotify.class);
|
|
|
if (!CollectionUtils.isEmpty(notifies)) {
|
|
|
ContextHolder.setDataSize(notifies.size());
|
|
|
- notifies = postForList("/erp/purchase/notice", PurchaseNotify.class, dataWrap(notifies));
|
|
|
- List<String> sqlList = new ArrayList<>();
|
|
|
- if (!CollectionUtils.isEmpty(notifies)) {
|
|
|
- for (PurchaseNotify notify : notifies) {
|
|
|
- if (null != notify.getPn_b2bid()) {
|
|
|
- sqlList.add("update purchaseNotify set pn_sendStatus = '已上传', pn_b2bid = " + notify.getPn_b2bid() + " where pn_id = " + notify.getPn_id());
|
|
|
+ // 增加上传中过滤状态
|
|
|
+ setSendStatusBeforeUpload("purchaseNotify", "pn_sendStatus", "pn_id", CollectionUtil.getKeyString(notifies));
|
|
|
+ try {
|
|
|
+ notifies = postForList("/erp/purchase/notice", PurchaseNotify.class, dataWrap(notifies));
|
|
|
+ List<String> sqlList = new ArrayList<>();
|
|
|
+ if (!CollectionUtils.isEmpty(notifies)) {
|
|
|
+ for (PurchaseNotify notify : notifies) {
|
|
|
+ if (null != notify.getPn_b2bid()) {
|
|
|
+ sqlList.add("update purchaseNotify set pn_sendStatus = '已上传', pn_b2bid = " + notify.getPn_b2bid() + " where pn_id = " + notify.getPn_id());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- if (!CollectionUtils.isEmpty(sqlList)) {
|
|
|
- jdbcTemplate.batchExecute(sqlList);
|
|
|
+ if (!CollectionUtils.isEmpty(sqlList)) {
|
|
|
+ jdbcTemplate.batchExecute(sqlList);
|
|
|
+ }
|
|
|
+ } catch (RuntimeException e) {
|
|
|
+ setSendStatusOnError("purchaseNotify", "pn_sendStatus", "pn_id", CollectionUtil.getKeyString(notifies));
|
|
|
}
|
|
|
}
|
|
|
}
|