|
|
@@ -51,7 +51,9 @@ public class NoticeRecordServiceImpl implements NoticeRecordService {
|
|
|
record.setEnUU(enterprise.getUu());
|
|
|
record.setKind("end");
|
|
|
List<NoticeRecordDetail> details = new ArrayList<>();
|
|
|
- notifyList.forEach(notify -> details.add(covert(notify)));
|
|
|
+ int errorCount = 0;
|
|
|
+ notifyList.forEach(notify -> details.add(covert(notify, errorCount)));
|
|
|
+ record.setErrorCount(errorCount);
|
|
|
record.setDetails(details);
|
|
|
recordDao.save(record);
|
|
|
}
|
|
|
@@ -60,9 +62,10 @@ public class NoticeRecordServiceImpl implements NoticeRecordService {
|
|
|
* 将ERP发货提醒明细转成B2B记录明细
|
|
|
*
|
|
|
* @param notify ERP发货提醒明细
|
|
|
+ * @param errorCount 异常数
|
|
|
* @return NoticeRecordDetail
|
|
|
*/
|
|
|
- private NoticeRecordDetail covert(PurchaseNotify notify) {
|
|
|
+ private NoticeRecordDetail covert(PurchaseNotify notify, int errorCount) {
|
|
|
NoticeRecordDetail detail = new NoticeRecordDetail();
|
|
|
PurchaseNotice notice = noticeDao.findOne(notify.getPn_b2bid());
|
|
|
detail.setErpId(notify.getPn_id());
|
|
|
@@ -76,6 +79,8 @@ public class NoticeRecordServiceImpl implements NoticeRecordService {
|
|
|
detail.setNoDate(notice.getDate());
|
|
|
if (detail.getSendQty() == 0) {
|
|
|
detail.setOkStatus(Constant.YES);
|
|
|
+ } else {
|
|
|
+ errorCount++;
|
|
|
}
|
|
|
}
|
|
|
return detail;
|