|
|
@@ -2210,7 +2210,6 @@ public class Order extends Controller {
|
|
|
|
|
|
|
|
|
String type = row.getString("type");
|
|
|
- String typemx = row.getString("typemx");
|
|
|
ArrayList<String> sqllist = new ArrayList<>();
|
|
|
Rows rowsdetailsGrade = dbConnect.runSqlQuery("select sum(t1.qty) qty,t2.grade from sa_orderitems t1 " +
|
|
|
"left join plm_item t2 on t1.itemid=t2.itemid and t1.siteid=t2.siteid " +
|
|
|
@@ -2690,48 +2689,48 @@ public class Order extends Controller {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- if (agentrows.get(0).getBoolean("submitautocheck") && type.equals("配件订单")) {
|
|
|
- boolean isautocheck = true;
|
|
|
- Rows countRows = dbConnect.runSqlQuery("SELECT sum(t1.amount) amount,count(t1.sa_orderitemsid) counts,sum(ispartorderautocheck) ispartorderautocheck,sum(IF(LENGTH(t1.remarks)> 0,1,0)) remarks FROM sa_orderitems t1 " + "INNER JOIN plm_item t2 ON t2.itemid=t1.itemid WHERE t1.sa_orderid=" + sa_orderid);
|
|
|
- if (countRows.isEmpty()) {
|
|
|
- isautocheck = false;
|
|
|
- }
|
|
|
- Row countRow = countRows.get(0);
|
|
|
- if (countRow.getLong("remarks") > 0) {
|
|
|
- isautocheck = false;
|
|
|
- }
|
|
|
- if (countRow.getLong("ispartorderautocheck") != countRow.getLong("counts")) {
|
|
|
- isautocheck = false;
|
|
|
- }
|
|
|
-
|
|
|
- Rows accountbalanceRows = dbConnect.runSqlQuery("SELECT IFNULL(balance,0)+IFNULL(creditquota,0)+IFNULL(discountamount,0)-IFNULL(freezamount,0) AS canuseamount FROM sa_accountbalance WHERE sys_enterpriseid=" + sys_enterpriseid + " AND sa_accountclassid=" + sa_accountclassid);
|
|
|
- if (accountbalanceRows.isEmpty()) {
|
|
|
- isautocheck = false;
|
|
|
- }
|
|
|
- BigDecimal canuseamount = accountbalanceRows.get(0).getBigDecimal("canuseamount");
|
|
|
- if (canuseamount.compareTo(countRow.getBigDecimal("amount")) < 0) {
|
|
|
- isautocheck = false;
|
|
|
- }
|
|
|
-
|
|
|
- Rows otherRows = dbConnect.runSqlQuery(" SELECT count(t3.sa_orderid) counts from sa_orderitems t1 " +
|
|
|
- " INNER JOIN sa_warrantycard t2 ON t2.cardno=t1.cardno " +
|
|
|
- " INNER JOIN sa_order t3 ON t3.sa_orderid=t1.sa_orderid " +
|
|
|
- " WHERE t1.billingstatus in ('保内收费') and t1.sa_orderid!='" + sa_orderid + "' " +
|
|
|
- " and t1.cardno in (SELECT cardno from sa_orderitems WHERE sa_orderid=" + sa_orderid + ") " +
|
|
|
- " and t3.submitdate> NOW() - INTERVAL " + Parameter.getLong("MD", "warrantywarndays") + " DAY and t3.status='提交' ");
|
|
|
-
|
|
|
- if (otherRows.get(0).getLong("counts") > 0) {
|
|
|
- isautocheck = false;
|
|
|
- }
|
|
|
-
|
|
|
- if (isautocheck) {
|
|
|
- String result = check();
|
|
|
- if (result.contains("成功")) {
|
|
|
- dbConnect.runSqlUpdate("update sa_order set checkby='自动审核' where sa_orderid=" + sa_orderid);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
+// if (agentrows.get(0).getBoolean("submitautocheck") && type.equals("配件订单")) {
|
|
|
+// boolean isautocheck = true;
|
|
|
+// Rows countRows = dbConnect.runSqlQuery("SELECT sum(t1.amount) amount,count(t1.sa_orderitemsid) counts,sum(ispartorderautocheck) ispartorderautocheck,sum(IF(LENGTH(t1.remarks)> 0,1,0)) remarks FROM sa_orderitems t1 " + "INNER JOIN plm_item t2 ON t2.itemid=t1.itemid WHERE t1.sa_orderid=" + sa_orderid);
|
|
|
+// if (countRows.isEmpty()) {
|
|
|
+// isautocheck = false;
|
|
|
+// }
|
|
|
+// Row countRow = countRows.get(0);
|
|
|
+// if (countRow.getLong("remarks") > 0) {
|
|
|
+// isautocheck = false;
|
|
|
+// }
|
|
|
+// if (countRow.getLong("ispartorderautocheck") != countRow.getLong("counts")) {
|
|
|
+// isautocheck = false;
|
|
|
+// }
|
|
|
+//
|
|
|
+// Rows accountbalanceRows = dbConnect.runSqlQuery("SELECT IFNULL(balance,0)+IFNULL(creditquota,0)+IFNULL(discountamount,0)-IFNULL(freezamount,0) AS canuseamount FROM sa_accountbalance WHERE sys_enterpriseid=" + sys_enterpriseid + " AND sa_accountclassid=" + sa_accountclassid);
|
|
|
+// if (accountbalanceRows.isEmpty()) {
|
|
|
+// isautocheck = false;
|
|
|
+// }
|
|
|
+// BigDecimal canuseamount = accountbalanceRows.get(0).getBigDecimal("canuseamount");
|
|
|
+// if (canuseamount.compareTo(countRow.getBigDecimal("amount")) < 0) {
|
|
|
+// isautocheck = false;
|
|
|
+// }
|
|
|
+//
|
|
|
+// Rows otherRows = dbConnect.runSqlQuery(" SELECT count(t3.sa_orderid) counts from sa_orderitems t1 " +
|
|
|
+// " INNER JOIN sa_warrantycard t2 ON t2.cardno=t1.cardno " +
|
|
|
+// " INNER JOIN sa_order t3 ON t3.sa_orderid=t1.sa_orderid " +
|
|
|
+// " WHERE t1.billingstatus in ('保内收费') and t1.sa_orderid!='" + sa_orderid + "' " +
|
|
|
+// " and t1.cardno in (SELECT cardno from sa_orderitems WHERE sa_orderid=" + sa_orderid + ") " +
|
|
|
+// " and t3.submitdate> NOW() - INTERVAL " + Parameter.getLong("MD", "warrantywarndays") + " DAY and t3.status='提交' ");
|
|
|
+//
|
|
|
+// if (otherRows.get(0).getLong("counts") > 0) {
|
|
|
+// isautocheck = false;
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (isautocheck) {
|
|
|
+// String result = check();
|
|
|
+// if (result.contains("成功")) {
|
|
|
+// dbConnect.runSqlUpdate("update sa_order set checkby='自动审核' where sa_orderid=" + sa_orderid);
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
return getSucReturnObject().toString();
|