|
|
@@ -1,6 +1,5 @@
|
|
|
package com.uas.erp.schedular.b2b.task;
|
|
|
|
|
|
-import com.uas.erp.schedular.b2b.domain.Prod;
|
|
|
import com.uas.erp.schedular.b2b.domain.ProdInOutRefreshPrice;
|
|
|
import com.uas.erp.schedular.b2b.domain.PurchaseProdInOut;
|
|
|
import com.uas.erp.schedular.b2b.domain.PurchaseProdInOutDetail;
|
|
|
@@ -56,7 +55,6 @@ public class PurchaseProdInOutTask extends AbstractTask {
|
|
|
|
|
|
@TaskMapping(title = "上传采购验退单", fixedDelay = 60000)
|
|
|
public void uploadProdReturn() {
|
|
|
- uploadProduct();
|
|
|
List<PurchaseProdInOut> prodReturns = getProdReturnUpload();
|
|
|
if (!CollectionUtils.isEmpty(prodReturns)) {
|
|
|
ContextHolder.setDataSize(prodReturns.size());
|
|
|
@@ -65,21 +63,6 @@ public class PurchaseProdInOutTask extends AbstractTask {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 上传物料资料
|
|
|
- */
|
|
|
- private void uploadProduct() {
|
|
|
- final List<Prod> prods = jdbcTemplate.queryForBeanList("select * from (select pr_id,pr_code,pr_detail,pr_spec,pr_unit,pr_zxbzs,pr_zxdhl,pr_leadtime,pr_ltinstock,pr_brand from product where exists (select 1 from prodinout left join vendor on prodinout.pi_cardcode = vendor.ve_code left join prodiodetail on pi_id=pd_piid where pi_class='采购验退单' and pi_status = '已过账' and (pi_sendstatus = '待上传' or pi_sendstatus='上传中') and ve_uu is not null and nvl(ve_b2benable,0)=1 and pd_prodcode=pr_code) and nvl(pr_sendstatus,' ')<>'已上传' order by pr_id) where rownum <= 500",
|
|
|
- Prod.class);
|
|
|
- if (!CollectionUtils.isEmpty(prods)) {
|
|
|
- new ProductHandler(prods).run();
|
|
|
- if (prods.size() == DATA_SIZE_LIMIT) {
|
|
|
- // 递归,直到相关物料全部传完
|
|
|
- uploadProduct();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 获取需要上传的采购验退单
|
|
|
*
|
|
|
@@ -235,7 +218,7 @@ public class PurchaseProdInOutTask extends AbstractTask {
|
|
|
* @return
|
|
|
*/
|
|
|
List<ProdInOutRefreshPrice> getPriceBatchUpdate(String type) {
|
|
|
- String sql = "select pbu_pdNo,pbu_inoutNo,pbu_orderPrice,pbu_id,pbu_taxRate,pd_prodCode,pd_orderDetNo from PriceBatchUpdate " +
|
|
|
+ String sql = "select pbu_detno pbu_pdNo,pbu_inoutNo,pbu_orderPrice,pbu_id,pbu_taxRate,pd_prodCode,pd_orderDetNo from PriceBatchUpdate " +
|
|
|
"left join prodIoDetail on pbu_pdId = pd_id " +
|
|
|
"where pbu_piClass = '" + type + "' and pbu_status = '99' and pbu_sendStatus = '待上传' and rowNum < 200";
|
|
|
return jdbcTemplate.queryForBeanList(sql, ProdInOutRefreshPrice.class);
|