Browse Source

批量取消选择,同步场景

xiewenjie 4 years ago
parent
commit
bc0f1363a0

+ 8 - 1
sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/SceneStyleController.java

@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.fdkk.sxz.annotation.auth.NoAuthentication;
 import com.fdkk.sxz.annotation.log.AroundLog;
@@ -206,7 +207,13 @@ public class SceneStyleController extends BaseController {
         JSONObject jsonObject = JSON.parseObject(OkHttpUtils.httpGet(mainUrl + "api/scene/synsencecode?sceneNum=" + scene.getSceneNum() + "&vrsceneNum=" + scene.getVrsceneNum(), header));
         if (jsonObject.containsKey("code")) {
             if (jsonObject.getIntValue("code") == 0) {
-                //TODO 成功需要处理的逻辑 isDecoration
+                LambdaUpdateWrapper<SceneStyleEntity> updateWrapper = Wrappers.lambdaUpdate();
+                updateWrapper
+                        .eq(SceneStyleEntity::getSceneNum, styleEntity.getSceneNum())
+                        .eq(SceneStyleEntity::getRecStatus, "A")
+                        .eq(SceneStyleEntity::getIsDecoration, 1)
+                        .set(SceneStyleEntity::getIsDecoration, 0);
+                sceneStyleService.update(updateWrapper);
                 styleEntity.setIsDecoration(1);
                 sceneStyleService.updateById(styleEntity);
                 return Result.success("成功");