|
|
@@ -20,6 +20,7 @@ import restcontroller.R;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
|
|
|
public class promotionItems extends Controller {
|
|
|
|
|
|
@@ -195,6 +196,36 @@ public class promotionItems extends Controller {
|
|
|
return queryPromotionItemsList();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 促销方案商品上下架
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @API(title = "促销方案商品上下架", apiversion = R.ID20230927135803.v1.class)
|
|
|
+ @CACHEING_CLEAN(apiClass = {promotionItems.class, promotion.class,restcontroller.sale.promotion.promotion.class})
|
|
|
+ public String release() throws YosException {
|
|
|
+ JSONArray sa_promotion_itemsids = content.getJSONArray("sa_promotion_itemsids");
|
|
|
+ boolean isonsale = content.getBooleanValue("isonsale");
|
|
|
+ List<Long> list = sa_promotion_itemsids.toJavaList(Long.class);
|
|
|
+ list.add(0l);
|
|
|
+ Long[] stringArray = list.toArray(new Long[0]);
|
|
|
+
|
|
|
+ SQLFactory sqlFactoryupdate = new SQLFactory(this, "商品组上架");
|
|
|
+ if(isonsale){
|
|
|
+ sqlFactoryupdate = new SQLFactory(this, "促销方案商品上架");
|
|
|
+ }else{
|
|
|
+ sqlFactoryupdate = new SQLFactory(this, "促销方案商品下架");
|
|
|
+ }
|
|
|
+ sqlFactoryupdate.addParameter("siteid", siteid);
|
|
|
+ sqlFactoryupdate.addParameter_in("sa_promotion_itemsids", stringArray);
|
|
|
+ dbConnect.runSqlUpdate(sqlFactoryupdate);
|
|
|
+// //发送消息
|
|
|
+// for (String id : stringArray) {
|
|
|
+// sendMsg(Long.parseLong(id));
|
|
|
+// }
|
|
|
+ return getSucReturnObject().toString();
|
|
|
+ }
|
|
|
+
|
|
|
@API(title = "促销方案商品列表", apiversion = R.ID20230102142503.v1.class)
|
|
|
@CACHEING
|
|
|
public String queryPromotionItemsList() throws YosException {
|