|
@@ -166,6 +166,69 @@ public class promotion extends Controller {
|
|
|
return getSucReturnObject().setData(rows).toString();
|
|
|
}
|
|
|
|
|
|
+ @API(title = "查询促销方案销售排行(经销商)", apiversion = R.ID20231007101703.v1.class)
|
|
|
+ @CACHEING
|
|
|
+ public String queryAgentSalesRanking() throws YosException {
|
|
|
+ long sa_promotionid =content.getLongValue("sa_promotionid");
|
|
|
+ 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("t1.agentnum like'%").append(whereObject.getString("condition")).append("%' ");
|
|
|
+ where.append("or t3.abbreviation like'%").append(whereObject.getString("condition")).append("%' ");
|
|
|
+ where.append(")");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ SQLFactory sqlFactory = new SQLFactory(this, "促销方案销售排行查询(经销商)", pageSize, pageNumber, pageSorting);
|
|
|
+ sqlFactory.addParameter("siteid", siteid);
|
|
|
+ sqlFactory.addParameter("sa_promotionid", sa_promotionid);
|
|
|
+ sqlFactory.addParameter_SQL("where", where);
|
|
|
+ Rows rows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
+
|
|
|
+
|
|
|
+ return getSucReturnObject().setData(rows).toString();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @API(title = "查询促销方案销售排行(商品)", apiversion = R.ID20231007101803.v1.class)
|
|
|
+ @CACHEING
|
|
|
+ public String queryItemSalesRanking() throws YosException {
|
|
|
+ long sa_promotionid =content.getLongValue("sa_promotionid");
|
|
|
+ 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("t1.itemno like'%").append(whereObject.getString("condition")).append("%' ");
|
|
|
+ where.append("or t1.itemname like'%").append(whereObject.getString("condition")).append("%' ");
|
|
|
+ where.append(")");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ SQLFactory sqlFactory = new SQLFactory(this, "促销方案销售排行查询(商品)", pageSize, pageNumber, pageSorting);
|
|
|
+ sqlFactory.addParameter("siteid", siteid);
|
|
|
+ sqlFactory.addParameter("sa_promotionid", sa_promotionid);
|
|
|
+ sqlFactory.addParameter_SQL("where", where);
|
|
|
+ Rows rows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
+
|
|
|
+
|
|
|
+// //附件
|
|
|
+// ArrayList<Long> ids = rows.toArrayList("sa_promotionid", new ArrayList<>());
|
|
|
+// RowsMap attRowsMap = getAttachmentUrl("sa_promotion", ids);
|
|
|
+// for (Row row : rows) {
|
|
|
+// if (!StringUtils.isBlank(row.getString("tradefield"))) {
|
|
|
+// row.put("tradefield", JSONArray.parseArray(row.getString("tradefield")));
|
|
|
+// } else {
|
|
|
+// row.put("tradefield", new JSONArray());
|
|
|
+// }
|
|
|
+// row.put("attinfos", attRowsMap.getOrDefault(row.getString("sa_promotionid"), new Rows()));
|
|
|
+// }
|
|
|
+
|
|
|
+ return getSucReturnObject().setData(rows).toString();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@API(title = "删除", apiversion = R.ID20221230144903.v1.class)
|
|
|
@CACHEING_CLEAN(apiversions = {R.ID20221230144703.v1.class, R.ID20221230144803.v1.class, R.ID20220103140003.v1.class})
|
|
|
public String delete() throws YosException {
|