|
@@ -32,7 +32,9 @@ import utility.ERPDocking;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
|
|
|
import static beans.order.Order.*;
|
|
@@ -626,6 +628,34 @@ public class OrderItems extends Controller {
|
|
|
}
|
|
|
|
|
|
if (whereObject.containsKey("isuncheckout") && !"".equals(whereObject.getString("isuncheckout"))) {
|
|
|
+ String begindate = "";
|
|
|
+ String enddate = "";
|
|
|
+ if(whereObject.containsKey("datetype") && !"".equals(whereObject.getString("datetype"))) {
|
|
|
+ String datetype = whereObject.getStringValue("datetype");
|
|
|
+ switch (datetype) {
|
|
|
+ case "月":
|
|
|
+ begindate = getMonthFirstDay();
|
|
|
+ enddate = getMonthLastDay();
|
|
|
+ break;
|
|
|
+ case "年":
|
|
|
+ begindate = new SimpleDateFormat("yyyy").format(new Date()) + "-01-01";
|
|
|
+ enddate = new SimpleDateFormat("yyyy").format(new Date()) + "-12-31";
|
|
|
+ break;
|
|
|
+ case "周":
|
|
|
+ begindate = getWeekFirstDay();
|
|
|
+ enddate = getWeekLastDay();
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (begindate != "") {
|
|
|
+ where.append(" and DATE_FORMAT(t5.submitdate, '%Y-%m-%d') >='").append(begindate).append("' ");
|
|
|
+ }
|
|
|
+ if (enddate != "") {
|
|
|
+ where.append(" and DATE_FORMAT(t5.submitdate, '%Y-%m-%d') <='").append(enddate).append("' ");
|
|
|
+ }
|
|
|
+
|
|
|
String isuncheckout = whereObject.getStringValue("isuncheckout");
|
|
|
if (isuncheckout.equals("1")) {
|
|
|
where.append(" and t1.sa_orderitemsid in (select t1.sa_orderitemsid from sa_orderitems t1 inner join (select t2.sa_orderitemsid,t2.siteid,sum(outwarehouseqty) sumoutwarehouseqty from sa_dispatch_items t2 inner join sa_dispatch t3 on t2.sa_dispatchid=t3.sa_dispatchid and t2.siteid=t3.siteid GROUP BY sa_orderitemsid,siteid) t2 on t1.sa_orderitemsid=t2.sa_orderitemsid and t1.siteid=t2.siteid where t1.qty>t2.sumoutwarehouseqty or t1.undeliqty>0)");
|