shenjingwei 4 месяцев назад
Родитель
Сommit
9bdf22c9f1
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      src/custom/common/crm/bean/icstockbill.java

+ 2 - 1
src/custom/common/crm/bean/icstockbill.java

@@ -35,7 +35,7 @@ public class icstockbill extends CrmBase {
                 "inner join sa_agents t3 on t1.sys_enterpriseid=t3.sys_enterpriseid and t3.type='普通'\n" +
                 "where t1.siteid='MD' and t1.type='销售出库'and t1.rb = 1 and t1.isreceiver = 0 and t1.status = '审核' and t1.iswx=0 and t1.checkdate>='2022-01-01' and t1.checkdate<'" + enddate + "' \n" +
                 "group by t1.st_stockbillid\n" +
-                "order by t1.st_stockbillid desc\n" +
+                "order by t1.autoreceiveerrtimes,t1.st_stockbillid desc\n" +
                 "limit 100");
 
         QuerySQL itemQuery = SQLFactory.createQuerySQL(dbConnect, "st_stockbill_items", "st_stockbillid");
@@ -87,6 +87,7 @@ public class icstockbill extends CrmBase {
             logger.info("销售出库单" + billno + "自动收货成功");
         } else {
             logger.error("销售出库单" + billno + "自动收货失败;" + jsonObject);
+            new DBConnect().runSqlUpdate("update st_stockbill set autoreceiveerrtimes=autoreceiveerrtimes+1 where st_stockbillid=" + st_stockbillid);
         }
     }