|
|
@@ -200,6 +200,8 @@ public class dispatchItems extends Controller {
|
|
|
return queryDispatchItemsList();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
@API(title = "发货单商品明细列表", apiversion = R.ID20221115104703.v1.class)
|
|
|
@CACHEING
|
|
|
public String queryDispatchItemsList() throws YosException {
|
|
|
@@ -389,6 +391,74 @@ public class dispatchItems extends Controller {
|
|
|
}
|
|
|
return getSucReturnObject().setData(rows).toString();
|
|
|
}
|
|
|
+ @API(title = "工厂发货/退货明细", apiversion = R.ID20230626104003.v1.class)
|
|
|
+ @CACHEING
|
|
|
+ public String queryDispatchAndAftersalesmagItemsList() 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(")");
|
|
|
+ }
|
|
|
+ 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 sqlFactory = new SQLFactory(this, "工厂发货及退货明细(经销商)", pageSize, pageNumber, pageSorting);
|
|
|
+ if (isExport) {
|
|
|
+ sqlFactory = new SQLFactory(this, "工厂发货及退货明细(经销商)");
|
|
|
+ }
|
|
|
+ sqlFactory.addParameter("sys_enterpriseid", sys_enterpriseid);
|
|
|
+ sqlFactory.addParameter_SQL("where", where);
|
|
|
+ sqlFactory.addParameter("siteid", siteid);
|
|
|
+ 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();
|
|
|
+ }
|
|
|
|
|
|
//返回导出的标题
|
|
|
public HashMap<String, String> getTitleMap() throws YosException {
|