ソースを参照

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

shenjingwei 1 ヶ月 前
コミット
e99758c0a5

+ 19 - 9
src/custom/restcontroller/sale/serviceorder/serviceorder.java

@@ -205,7 +205,17 @@ public class serviceorder extends Controller {
             if(currentserviceagents.isEmpty()){
                 if (agents.isNotEmpty()) {
                     if (agents.get(0).getBoolean("isservice")) {
-                        sqlList.add("update sa_serviceorder set status='待受理',sys_enterpriseid_service=" + agents.get(0).getLong("sys_enterpriseid") + " where sa_serviceorderid=" + sa_serviceorderid);
+//                        sqlList.add("update sa_serviceorder set status='待受理',sys_enterpriseid_service=" + agents.get(0).getLong("sys_enterpriseid") + " where sa_serviceorderid=" + sa_serviceorderid);
+                        UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sa_serviceorder");
+                        updateSQL.setUniqueid(sa_serviceorderid);
+                        updateSQL.setSiteid(siteid);
+                        updateSQL.setValue("status", "待受理");
+                        updateSQL.setValue("sys_enterpriseid_service", agents.get(0).getLong("sys_enterpriseid"));
+                        updateSQL.setDateValue("allocationdate");
+                        updateSQL.setValue("allocationby", "自动分配");
+                        sqlList.add(updateSQL.getSQL());
+                        sqlList.add(
+                                DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
                     } else {
                         Rows serviceagents = dbConnect.runSqlQuery("select t1.sys_enterpriseid,t2.province,t2.city,t2.county from sa_agents t1 inner join sa_agents_salescope  t2  on  t1.sa_agentsid=t2.sa_agentsid and t1.siteid=t2.siteid where t1.siteid='" + siteid + "' and status=1 and signingstate!='停用(已止)' and t1.isservice=1");
                         RowsMap countyRowsMap = serviceagents.toRowsMap("county");
@@ -221,7 +231,7 @@ public class serviceorder extends Controller {
                                     updateSQL.setValue("status", "待受理");
                                     updateSQL.setValue("sys_enterpriseid_service", row.getLong("sys_enterpriseid"));
                                     updateSQL.setDateValue("allocationdate");
-                                    updateSQL.setValue("allocationby", username);
+                                    updateSQL.setValue("allocationby", "自动分配");
                                     sqlList.add(updateSQL.getSQL());
                                     sqlList.add(
                                             DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
@@ -237,7 +247,7 @@ public class serviceorder extends Controller {
                                     updateSQL.setValue("status", "待受理");
                                     updateSQL.setValue("sys_enterpriseid_service", row.getLong("sys_enterpriseid"));
                                     updateSQL.setDateValue("allocationdate");
-                                    updateSQL.setValue("allocationby", username);
+                                    updateSQL.setValue("allocationby", "自动分配");
                                     sqlList.add(updateSQL.getSQL());
                                     sqlList.add(
                                             DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
@@ -254,7 +264,7 @@ public class serviceorder extends Controller {
                                     updateSQL.setValue("status", "待受理");
                                     updateSQL.setValue("sys_enterpriseid_service", row.getLong("sys_enterpriseid"));
                                     updateSQL.setDateValue("allocationdate");
-                                    updateSQL.setValue("allocationby", username);
+                                    updateSQL.setValue("allocationby", "自动分配");
                                     sqlList.add(updateSQL.getSQL());
                                     sqlList.add(
                                             DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
@@ -263,7 +273,7 @@ public class serviceorder extends Controller {
                         }
                     }
                 }else {
-                    Rows serviceagents = dbConnect.runSqlQuery("select t1.sys_enterpriseid,t2.province,t2.city,t2.county from sa_agents t1 inner join sa_agents_salescope  t2  on  t1.sa_agentsid=t2.sa_agentsid and t1.siteid=t2.siteid where t1.siteid='" + siteid + "' and t1.isservice=1");
+                    Rows serviceagents = dbConnect.runSqlQuery("select t1.sys_enterpriseid,t2.province,t2.city,t2.county from sa_agents t1 inner join sa_agents_salescope  t2  on  t1.sa_agentsid=t2.sa_agentsid and t1.siteid=t2.siteid where t1.siteid='" + siteid + "' and status=1 and signingstate!='停用(已止)' and t1.isservice=1");
                     RowsMap countyRowsMap = serviceagents.toRowsMap("county");
                     RowsMap cityRowsMap = serviceagents.toRowsMap("city");
                     RowsMap provinceRowsMap = serviceagents.toRowsMap("province");
@@ -277,7 +287,7 @@ public class serviceorder extends Controller {
                                 updateSQL.setValue("status", "待受理");
                                 updateSQL.setValue("sys_enterpriseid_service", row.getLong("sys_enterpriseid"));
                                 updateSQL.setDateValue("allocationdate");
-                                updateSQL.setValue("allocationby", username);
+                                updateSQL.setValue("allocationby", "自动分配");
                                 sqlList.add(updateSQL.getSQL());
                                 sqlList.add(
                                         DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
@@ -293,7 +303,7 @@ public class serviceorder extends Controller {
                                 updateSQL.setValue("status", "待受理");
                                 updateSQL.setValue("sys_enterpriseid_service", row.getLong("sys_enterpriseid"));
                                 updateSQL.setDateValue("allocationdate");
-                                updateSQL.setValue("allocationby", username);
+                                updateSQL.setValue("allocationby", "自动分配");
                                 sqlList.add(updateSQL.getSQL());
                                 sqlList.add(
                                         DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
@@ -310,7 +320,7 @@ public class serviceorder extends Controller {
                                 updateSQL.setValue("status", "待受理");
                                 updateSQL.setValue("sys_enterpriseid_service", row.getLong("sys_enterpriseid"));
                                 updateSQL.setDateValue("allocationdate");
-                                updateSQL.setValue("allocationby", username);
+                                updateSQL.setValue("allocationby", "自动分配");
                                 sqlList.add(updateSQL.getSQL());
                                 sqlList.add(
                                         DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());
@@ -325,7 +335,7 @@ public class serviceorder extends Controller {
                 updateSQL.setSiteid(siteid);
                 updateSQL.setValue("status", "待受理");
                 updateSQL.setDateValue("allocationdate");
-                updateSQL.setValue("allocationby", username);
+                updateSQL.setValue("allocationby", "自动分配");
                 sqlList.add(updateSQL.getSQL());
                 sqlList.add(
                         DataContrlLog.createLog(this, "sa_serviceorder", sa_serviceorderid, "自动分配", "服务申请单自动分配成功").getSQL());

+ 2 - 0
src/custom/restcontroller/webmanage/sale/order/Order.java

@@ -2213,6 +2213,7 @@ public class Order extends Controller {
                         sqlList.add(insertSQL.getSQL());
                     }
                     String depname = departmenthrrows.isNotEmpty() ? departmenthrrows.get(0).getString("depname") : "";
+                    Long sys_enterpriseid =  orderdetailRows.get(0).getLong("sys_enterpriseid");
                     if (depname.equals("售后部")) {
                         if (accountbalancerowsMap.containsKey(sys_enterpriseid)) {
                             if (accountbalancerowsMap.get(sys_enterpriseid).get(0).getBigDecimal("discountamount").compareTo(BigDecimal.ZERO) > 0) {
@@ -2497,6 +2498,7 @@ public class Order extends Controller {
                         sqlList.add(insertSQL.getSQL());
                     }
                     String depname = departmenthrrows.isNotEmpty() ? departmenthrrows.get(0).getString("depname") : "";
+                    Long sys_enterpriseid =  orderdetailRows.get(0).getLong("sys_enterpriseid");
                     if (depname.equals("售后部")) {
                         if (accountbalancerowsMap.containsKey(sys_enterpriseid)) {
                             if (accountbalancerowsMap.get(sys_enterpriseid).get(0).getBigDecimal("discountamount").compareTo(BigDecimal.ZERO) > 0) {

+ 6 - 2
src/custom/restcontroller/webmanage/sale/order/OrderItems.java

@@ -1894,9 +1894,13 @@ public class OrderItems extends Controller {
             updateSQL.setSiteid(siteid);
             updateSQL.setUniqueid(row.getLong("sa_orderitemsid"));
             updateSQL.setValue("billingstatus", row.getString("billingstatus"));
-            updateSQL.setValue("canoffqty", row.getString("qty"));
             updateSQL.setValue("tobeoffqty", 0);
-            updateSQL.setValue("oddstatus", 1);
+            if (row.getString("billingstatus").equals("保内收费")) {
+                updateSQL.setValue("canoffqty", row.getString("qty"));
+                updateSQL.setValue("offstatus", 1);
+            } else {
+                updateSQL.setValue("canoffqty", 0);
+            }
 
             // 将生成的 SQL 加入列表
             sqlList.add(updateSQL.getSQL());