|
|
@@ -20,11 +20,11 @@ public class CheckTransTask extends AbstractTask {
|
|
|
|
|
|
@TaskMapping(title = "采购询价单", fixedDelay = 60000)
|
|
|
public void uploadInquiry() {
|
|
|
- List<Inquiry> inquiries = jdbcTemplate.queryForBeanList("select * from (select in_id from Inquiry left join employee on in_recorderid = em_id where in_statuscode='AUDITED' and IN_SENDSTATUS='已上传' and in_b2bid is null and nvl(in_class,' ')<>'主动报价' and exists (select 1 from InquiryDetail left join vendor on id_vendcode=ve_code where id_inid=in_id and ve_uu is not null and nvl(ve_b2benable,0)=1) order by in_date desc) where rownum <= 100",
|
|
|
+ List<Inquiry> inquiryList = jdbcTemplate.queryForBeanList("select * from (select in_id from Inquiry left join employee on in_recorderid = em_id where in_statuscode='AUDITED' and IN_SENDSTATUS='已上传' and in_b2bid is null and nvl(in_class,' ')<>'主动报价' and exists (select 1 from InquiryDetail left join vendor on id_vendcode=ve_code where id_inid=in_id and ve_uu is not null and nvl(ve_b2benable,0)=1) order by in_date desc) where rowNum <= 100",
|
|
|
Inquiry.class);
|
|
|
- if (!CollectionUtils.isEmpty(inquiries)) {
|
|
|
- ContextHolder.setDataSize(inquiries.size());
|
|
|
- List<Inquiry> inquiryList = postForList("/erp/buyer/inquiry", Inquiry.class, dataWrap(inquiries));
|
|
|
+ if (!CollectionUtils.isEmpty(inquiryList)) {
|
|
|
+ ContextHolder.setDataSize(inquiryList.size());
|
|
|
+ inquiryList = postForList("/erp/buyer/inquiry", Inquiry.class, dataWrap(inquiryList));
|
|
|
if (!CollectionUtils.isEmpty(inquiryList)) {
|
|
|
List<String> sqls = new ArrayList<>();
|
|
|
for (Inquiry inquiry : inquiryList) {
|
|
|
@@ -43,7 +43,7 @@ public class CheckTransTask extends AbstractTask {
|
|
|
|
|
|
@TaskMapping(title = "采购订单", fixedDelay = 60000)
|
|
|
public void uploadPurchase() {
|
|
|
- List<Purchase> purchaseList = jdbcTemplate.queryForBeanList("select * from (select pu_id from purchase left join vendor on pu_vendcode=ve_code left join employee on pu_buyerid=em_id where PU_SENDSTATUS='已上传' and pu_statuscode='AUDITED' and nvl(pu_ordertype,' ')<>'B2C' and ve_uu is not null and nvl(ve_b2benable,0)=1 and not exists (select 1 from purchasedetail,product where pd_puid=pu_id and pr_code=pd_prodcode and pr_sendstatus<>'已上传' and pu_b2bid is null) order by pu_code) where rownum <= 100",
|
|
|
+ List<Purchase> purchaseList = jdbcTemplate.queryForBeanList("select * from (select pu_id from purchase left join vendor on pu_vendcode=ve_code left join employee on pu_buyerid=em_id where PU_SENDSTATUS='已上传' and pu_statuscode='AUDITED' and nvl(pu_ordertype,' ')<>'B2C' and ve_uu is not null and nvl(ve_b2benable,0)=1 and not exists (select 1 from purchasedetail,product where pd_puid=pu_id and pr_code=pd_prodcode and pr_sendstatus<>'已上传' and pu_b2bid is null) order by pu_code) where rowNum <= 100",
|
|
|
Purchase.class);
|
|
|
if (!CollectionUtils.isEmpty(purchaseList)) {
|
|
|
ContextHolder.setDataSize(purchaseList.size());
|
|
|
@@ -64,4 +64,26 @@ public class CheckTransTask extends AbstractTask {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @TaskMapping(title = "发货提醒", fixedDelay = 60000)
|
|
|
+ public void uploadPurchaseNotify() {
|
|
|
+ List<PurchaseNotify> notifyList = jdbcTemplate.queryForBeanList("select * from (select pu_id from purchaseNotify left join purchase on pn_orderCode=pu_code left join vendor on pu_vendCode=ve_code left join product on pr_code=pn_prodCode where nvl(PN_SENDSTATUS,' ')='已上传' and pn_b2bid is null and pn_status<>'已取消' and pu_sendStatus='已上传' and nvl(pu_orderType,' ')<>'B2C' and ve_uu is not null and nvl(ve_b2bEnable, 0)=1 order by pn_inDate) where rowNum <= 100",
|
|
|
+ PurchaseNotify.class);
|
|
|
+ if (!CollectionUtils.isEmpty(notifyList)) {
|
|
|
+ ContextHolder.setDataSize(notifyList.size());
|
|
|
+ notifyList = postForList("/erp/buyer/notify", PurchaseNotify.class, dataWrap(notifyList));
|
|
|
+ if (!CollectionUtils.isEmpty(notifyList)) {
|
|
|
+ List<String> sqls = new ArrayList<>();
|
|
|
+ for (PurchaseNotify notify : notifyList) {
|
|
|
+ if (null != notify.getPn_b2bid()) {
|
|
|
+ sqls.add("update purchaseNotify set pn_b2bid = " + notify.getPn_b2bid() + " where pn_id = " + notify.getPn_id());
|
|
|
+ } else {
|
|
|
+ sqls.add("update purchaseNotify set pn_sendStatus = '待上传' where pn_id = " + notify.getPn_id());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!CollectionUtils.isEmpty(sqls)) {
|
|
|
+ jdbcTemplate.batchExecute(sqls);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|