|
@@ -310,7 +310,7 @@ public class PlanServiceImpl implements PlanService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public int planPushUpDown(String appkey, String planId) {
|
|
|
+ public int planPushUpDown(String appkey, List<String> planIds) {
|
|
|
// app是否可用
|
|
|
App app = appMapper.selectOne(new QueryWrapper<App>()
|
|
|
.eq("appkey", appkey)
|
|
@@ -321,10 +321,31 @@ public class PlanServiceImpl implements PlanService {
|
|
|
// 校验
|
|
|
Map<String, Object> params = Dict.create()
|
|
|
.set("appkey", appkey)
|
|
|
- .set("planId", planId);
|
|
|
+ .set("planIds", planIds);
|
|
|
if (!SignUtil.verify(params, app.getAppSecret()))
|
|
|
return -3;
|
|
|
- return planUpDown(planId);
|
|
|
+ for (String planId : planIds){
|
|
|
+ Plan plan = planMapper.selectOne(new QueryWrapper<Plan>()
|
|
|
+ .eq("plan_id", planId)
|
|
|
+ .eq("deleted", "0"));
|
|
|
+ if (plan == null)
|
|
|
+ continue;
|
|
|
+ // 改变状态,1:上架;0:下架
|
|
|
+ plan.setOnState(plan.getOnState() + 1);
|
|
|
+ if (plan.getOnState() >= 2) {
|
|
|
+ plan.setOnState(0);
|
|
|
+ // 发送下架信息
|
|
|
+ try {
|
|
|
+ Map<String, Object> map = Dict.create()
|
|
|
+ .set("msg", "您的广告\"" + plan.getPlanName() + "\"已下架")
|
|
|
+ .set("time", DateUtil.date());
|
|
|
+ SendCallBackUtil.sendCallBack(app.getCallBack(), map);
|
|
|
+ } catch (Exception e) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ planMapper.updateById(plan);
|
|
|
+ }
|
|
|
+ return 1;
|
|
|
}
|
|
|
|
|
|
@Override
|