|
|
@@ -1,6 +1,7 @@
|
|
|
package com.uas.erp.schedular.b2b.task;
|
|
|
|
|
|
import com.uas.erp.schedular.b2b.domain.ProdInOutRefreshPrice;
|
|
|
+import com.uas.erp.schedular.b2b.domain.ProdIoPay;
|
|
|
import com.uas.erp.schedular.b2b.domain.PurchaseProdInOut;
|
|
|
import com.uas.erp.schedular.b2b.domain.PurchaseProdInOutDetail;
|
|
|
import com.uas.erp.schedular.task.support.Role;
|
|
|
@@ -37,7 +38,7 @@ public class PurchaseProdInOutTask extends AbstractTask {
|
|
|
*/
|
|
|
private List<PurchaseProdInOut> getProInOutUpload() {
|
|
|
List<PurchaseProdInOut> prodInOuts = jdbcTemplate.queryForBeanList(
|
|
|
- "select * from (select prodinout.*, ve_uu pi_vendoruu from prodinout left join vendor on prodinout.pi_cardcode = vendor.ve_code where pi_class='采购验收单' and pi_status = '已过账' and (pi_sendstatus = '待上传' or pi_sendstatus='上传中') and coalesce(ve_uu, '0') <> '0' and nvl(ve_b2benable,0)=1 ) where rownum <= 2 and exists (select 1 from purchase,prodiodetail where pd_piid=pi_id and pu_sendstatus='已上传')",
|
|
|
+ "select * from (select prodinout.*, ve_uu pi_vendoruu from prodinout left join vendor on prodinout.pi_cardcode = vendor.ve_code where pi_class='采购验收单' and pi_status = '已过账' and (pi_sendstatus = '待上传' or pi_sendstatus='上传中') and coalesce(ve_uu, '0') <> '0' and nvl(ve_b2benable,0)=1 ) where rownum <= 20 and exists (select 1 from purchase,prodiodetail where pd_piid=pi_id and pu_sendstatus='已上传')",
|
|
|
PurchaseProdInOut.class);
|
|
|
System.out.println(CollectionUtil.getKeyString(prodInOuts));
|
|
|
for (PurchaseProdInOut prodInOut : prodInOuts) {
|
|
|
@@ -251,4 +252,18 @@ public class PurchaseProdInOutTask extends AbstractTask {
|
|
|
jdbcTemplate.batchExecute(sqlList);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @TaskMapping(title = "更新出入单付款金额", fixedDelay = 60000)
|
|
|
+ public void uploadUpdateProdIoPayment() {
|
|
|
+ String sql = "select * from (select piCode,piClass,piDetNo,amount,inDate,status,pdId from prodIoPay where status = '待上传' " +
|
|
|
+ "and piClass in ('采购验收单', '采购验退单', '不良品入库单', '不良品出库单', '委外验收单', '委外验退单', '其它应付单')" +
|
|
|
+ " order by inDate) where rowNum <= 400";
|
|
|
+ List<ProdIoPay> payList = jdbcTemplate.queryForBeanList(sql, ProdIoPay.class);
|
|
|
+ if (!CollectionUtils.isEmpty(payList)) {
|
|
|
+ ContextHolder.setDataSize(payList.size());
|
|
|
+ post("/erp/prodIoPay", dataWrap(payList));
|
|
|
+ String idStr = CollectionUtil.getKeyString(payList);
|
|
|
+ jdbcTemplate.execute("update prodIoPay set status = '已上传' where pdId in (" + idStr + ")");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|