Browse Source

刷订单保修状态及bug修复

wu 3 days ago
parent
commit
0274239f85

+ 5 - 3
src/custom/restcontroller/webmanage/sale/order/OrderItems.java

@@ -1870,8 +1870,8 @@ public class OrderItems extends Controller {
     public String updatebillingstatus() throws YosException {
         System.err.println(getDateTime_Str() + ":准备刷订单保修状态...");
 
-        String sql = "SELECT if(billdate BETWEEN begdate and enddate,if(price>0,'保内收费','保内免费'),'保外收费'  ) billingstatus,sa_orderitemsid ,verifiedqty,tobeoffqty,canoffqty from ( " +
-                "SELECT t1.sa_orderitemsid,t1.price,t2.billdate, IF(isvoid=1,voiddate,enddate) enddate,begdate,verifiedqty,tobeoffqty,canoffqty from  sa_orderitems t1 " +
+        String sql = "SELECT if(billdate BETWEEN begdate and enddate,if(price>0,'保内收费','保内免费'),'保外收费'  ) billingstatus,sa_orderitemsid ,verifiedqty,tobeoffqty,canoffqty,qty from ( " +
+                "SELECT t1.sa_orderitemsid,t1.price,t2.billdate, IF(isvoid=1,voiddate,enddate) enddate,begdate,verifiedqty,tobeoffqty,canoffqty,qty from  sa_orderitems t1 " +
                 "INNER JOIN sa_order t2 ON t2.sa_orderid=t1.sa_orderid " +
                 "LEFT JOIN sa_warrantycard t3 ON t3.cardno=t1.cardno " +
                 "WHERE t2.type='配件订单'  " +
@@ -1894,7 +1894,9 @@ public class OrderItems extends Controller {
             updateSQL.setSiteid(siteid);
             updateSQL.setUniqueid(row.getLong("sa_orderitemsid"));
             updateSQL.setValue("billingstatus", row.getString("billingstatus"));
-            updateSQL.setValue("canoffqty", 0);
+            updateSQL.setValue("canoffqty", row.getString("qty"));
+            updateSQL.setValue("tobeoffqty", 0);
+            updateSQL.setValue("oddstatus", 1);
 
             // 将生成的 SQL 加入列表
             sqlList.add(updateSQL.getSQL());

+ 3 - 0
src/custom/restcontroller/webmanage/sale/salestarget/enterprisetarget.java

@@ -183,6 +183,8 @@ public class enterprisetarget extends Controller {
                     where1.append(" t1.enterprisename like '%").append(content_where.getJSONObject("tablefilter").getStringValue("enterprisename")).append("%' ");
                     where1.append(")");
                 }
+            }
+            if(content_where.getJSONObject("tablefilter").containsKey("abbreviation")){
                 if(StringUtils.isNotBlank(content_where.getJSONObject("tablefilter").getStringValue("abbreviation"))){
                     where1.append(" and(");
                     where1.append(" t1.abbreviation like '%").append(content_where.getJSONObject("tablefilter").getStringValue("abbreviation")).append("%' ");
@@ -211,6 +213,7 @@ public class enterprisetarget extends Controller {
         sqlFactory.addParameter_in("sys_enterpriseids", sys_enterpriseids);
         sqlFactory.addParameter("siteid", siteid);
         String sql = sqlFactory.getSQL();
+        System.err.println( sql);
         Rows rows = dbConnect.runSqlQuery(sql);
         if (totalRows > 0) {
             rows.totalRows = totalRows;