|
@@ -3,6 +3,7 @@ package restcontroller.webmanage.sale.dispatch;
|
|
|
import beans.data.BatchDeleteErr;
|
|
|
import beans.dispatch.Dispatch;
|
|
|
import beans.parameter.Parameter;
|
|
|
+import beans.salearea.SaleArea;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import common.Controller;
|
|
@@ -18,6 +19,7 @@ import org.apache.poi.xssf.usermodel.XSSFCellStyle;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import restcontroller.R;
|
|
|
+import restcontroller.sale.promotion.promotion;
|
|
|
import restcontroller.webmanage.sale.order.Order;
|
|
|
import restcontroller.webmanage.sale.order.OrderItems;
|
|
|
import utility.ERPDocking;
|
|
@@ -529,6 +531,82 @@ public class dispatchItems extends Controller {
|
|
|
Rows rows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
|
|
|
|
|
|
+// if (isExport) {
|
|
|
+// //去除不需要导出项
|
|
|
+// rows.getFieldList().remove("sa_dispatch_itemsid");
|
|
|
+// rows.getFieldList().remove("sa_dispatchid");
|
|
|
+// rows.getFieldList().remove("sa_orderitemsid");
|
|
|
+// rows.getFieldList().remove("sa_orderid");
|
|
|
+// rows.getFieldList().remove("sys_enterpriseid");
|
|
|
+// rows.getFieldList().remove("isclose");
|
|
|
+// rows.getFieldList().remove("rowno");
|
|
|
+// rows.getFieldList().remove("itemid");
|
|
|
+// rows.getFieldList().remove("batchno");
|
|
|
+// Rows rowsrolename= dbConnect.runSqlQuery("select * from sys_userrole t1 inner join sys_role t2 on t1.roleid=t2.roleid and t1.siteid=t2.siteid where t2.rolename='经销商员工' and t1.userid="+userid);
|
|
|
+// if(!rowsrolename.isEmpty()){
|
|
|
+// rows.getFieldList().remove("price");
|
|
|
+// rows.getFieldList().remove("amount");
|
|
|
+// }
|
|
|
+// rows.getFieldList().remove("undeliqty");
|
|
|
+// rows.getFieldList().remove("deliedqty");
|
|
|
+// rows.getFieldList().remove("outwarehousedate");
|
|
|
+// Rows uploadRows = uploadExcelToObs("dispatch", "发货单明细列表", rows, getTitleMap());
|
|
|
+// return getSucReturnObject().setData(uploadRows).toString();
|
|
|
+// }
|
|
|
+ return getSucReturnObject().setData(rows).toString();
|
|
|
+ }
|
|
|
+
|
|
|
+ @API(title = "工厂发货/退货明细(区域经理)", apiversion = R.ID20231030091403.v1.class)
|
|
|
+ @CACHEING
|
|
|
+ public String queryDispatchAndAftersalesmagItemsManagerList() throws YosException, IOException {
|
|
|
+ /*
|
|
|
+ * 过滤条件设置
|
|
|
+ */
|
|
|
+ StringBuffer where = new StringBuffer(" 1=1 ");
|
|
|
+
|
|
|
+
|
|
|
+ if (content.containsKey("where")) {
|
|
|
+ JSONObject whereObject = content.getJSONObject("where");
|
|
|
+ if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
|
|
|
+ where.append(" and(");
|
|
|
+ where.append("t.sonum like'%").append(whereObject.getString("condition")).append("%' ");
|
|
|
+ where.append("or t.itemno like'%").append(whereObject.getString("condition")).append("%' ");
|
|
|
+ where.append("or t.itemname like'%").append(whereObject.getString("condition")).append("%' ");
|
|
|
+ where.append("or t.remarks like'%").append(whereObject.getString("condition")).append("%' ");
|
|
|
+ where.append(")");
|
|
|
+ }
|
|
|
+ if (whereObject.containsKey("type") && !"".equals(whereObject.getString("type"))) {
|
|
|
+ where.append(" and(");
|
|
|
+ where.append("t.type ='").append(whereObject.getString("type")).append("' ");
|
|
|
+ where.append(")");
|
|
|
+ }
|
|
|
+ if (whereObject.containsKey("begindate") && !"".equals(whereObject.getString("begindate"))) {
|
|
|
+ where.append(" and DATE_FORMAT(t.date, '%Y-%m-%d') >='").append(whereObject.getString("begindate")).append("' ");
|
|
|
+ }
|
|
|
+ if (whereObject.containsKey("enddate") && !"".equals(whereObject.getString("enddate"))) {
|
|
|
+ where.append(" and DATE_FORMAT(t.date, '%Y-%m-%d') <='").append(whereObject.getString("enddate")).append("' ");
|
|
|
+ }
|
|
|
+ if (whereObject.containsKey("status") && !"".equals(whereObject.getString("status"))) {
|
|
|
+ where.append(" and t.status ='").append(whereObject.getString("status")).append("' ");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ boolean isExport = content.getBooleanValue("isExport");
|
|
|
+
|
|
|
+
|
|
|
+ SQLFactory areasqlFactory = new SQLFactory(new promotion(content), "区域经理查询下属营销区域");
|
|
|
+ areasqlFactory.addParameter("siteid", siteid);
|
|
|
+ areasqlFactory.addParameter("hrid", hrid);
|
|
|
+ Rows arearows = dbConnect.runSqlQuery(areasqlFactory);
|
|
|
+ ArrayList<Long> arrayList =arearows.toArrayList("sa_saleareaid", new ArrayList<Long>());
|
|
|
+ arrayList.addAll(SaleArea.getSubSaleAreaIds(this, arrayList));
|
|
|
+
|
|
|
+ SQLFactory sqlFactory = new SQLFactory(this, "工厂发货及退货明细(区域经理)", pageSize, pageNumber, pageSorting);
|
|
|
+ sqlFactory.addParameter_in("sa_saleareaids", arrayList);
|
|
|
+ sqlFactory.addParameter_SQL("where", where);
|
|
|
+ sqlFactory.addParameter("siteid", siteid);
|
|
|
+ Rows rows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
+
|
|
|
+
|
|
|
// if (isExport) {
|
|
|
// //去除不需要导出项
|
|
|
// rows.getFieldList().remove("sa_dispatch_itemsid");
|