Procházet zdrojové kódy

Merge remote-tracking branch 'origin/develop-test' into develop-test

shenjingwei před 4 týdny
rodič
revize
7a8e43e4a6

+ 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());

+ 21 - 5
src/custom/restcontroller/webmanage/sale/salestarget/enterprisetarget.java

@@ -177,15 +177,30 @@ public class enterprisetarget extends Controller {
             sys_enterpriseids.add(content_where.getLong("sys_enterpriseid"));
         }
         if (content_where.containsKey("tablefilter")) {
-            if(content_where.getJSONObject("tablefilter").containsKey("enterprisename")){
-                if(StringUtils.isNotBlank(content_where.getJSONObject("tablefilter").getStringValue("enterprisename"))){
+            if (content_where.getJSONObject("tablefilter").containsKey("enterprisename")) {
+                String enterprisename = content_where.getJSONObject("tablefilter").getStringValue("enterprisename");
+                if (StringUtils.isNotBlank(enterprisename)) {
+                    enterprisename = enterprisename.replace("=", "");
                     where1.append(" and(");
-                    where1.append(" t1.enterprisename like '%").append(content_where.getJSONObject("tablefilter").getStringValue("enterprisename")).append("%' ");
+                    where1.append(" t1.enterprisename like '%").append(enterprisename).append("%' ");
                     where1.append(")");
                 }
-                if(StringUtils.isNotBlank(content_where.getJSONObject("tablefilter").getStringValue("abbreviation"))){
+            }
+            if (content_where.getJSONObject("tablefilter").containsKey("agentnum")) {
+                String agentnum = content_where.getJSONObject("tablefilter").getStringValue("agentnum");
+                if (StringUtils.isNotBlank(agentnum)) {
+                    agentnum = agentnum.replace("=", "");
+                    where1.append(" and(");
+                    where1.append(" t2.agentnum like '%").append(agentnum).append("%' ");
+                    where1.append(")");
+                }
+            }
+            if (content_where.getJSONObject("tablefilter").containsKey("abbreviation")) {
+                String abbreviation = content_where.getJSONObject("tablefilter").getStringValue("abbreviation");
+                if (StringUtils.isNotBlank(abbreviation)) {
+                    abbreviation = abbreviation.replace("=", "");
                     where1.append(" and(");
-                    where1.append(" t1.abbreviation like '%").append(content_where.getJSONObject("tablefilter").getStringValue("abbreviation")).append("%' ");
+                    where1.append(" t1.abbreviation like '%").append(abbreviation).append("%' ");
                     where1.append(")");
                 }
             }
@@ -211,6 +226,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;