|
@@ -0,0 +1,75 @@
|
|
|
|
+package com.fdkankan.manage_jp.controller;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
+import com.fdkankan.common.util.JwtUtil;
|
|
|
|
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
|
+import com.fdkankan.manage_jp.common.Result;
|
|
|
|
+import com.fdkankan.manage_jp.entity.ScenePlus;
|
|
|
|
+import com.fdkankan.manage_jp.entity.ScenePlusExt;
|
|
|
|
+import com.fdkankan.manage_jp.service.IScenePlusExtService;
|
|
|
|
+import com.fdkankan.manage_jp.service.IScenePlusService;
|
|
|
|
+import com.fdkankan.manage_jp.service.IUserService;
|
|
|
|
+import com.fdkankan.manage_jp.vo.request.LoginParam;
|
|
|
|
+import com.fdkankan.manage_jp.vo.request.UserListParam;
|
|
|
|
+import com.fdkankan.manage_jp.vo.request.UserParam;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
+import sun.rmi.runtime.Log;
|
|
|
|
+
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * <p>
|
|
|
|
+ * 用户信息表 前端控制器
|
|
|
|
+ * </p>
|
|
|
|
+ *
|
|
|
|
+ * @author
|
|
|
|
+ * @since 2022-12-23
|
|
|
|
+ */
|
|
|
|
+@RestController
|
|
|
|
+@Slf4j
|
|
|
|
+@RequestMapping("/manage_jp/test")
|
|
|
|
+public class TestController extends BaseController {
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private IScenePlusService scenePlusService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IScenePlusExtService scenePlusExtService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private FYunFileServiceInterface fYunFileServiceInterface;
|
|
|
|
+
|
|
|
|
+ @GetMapping("/updateUserId")
|
|
|
|
+ public Result updateUserId(){
|
|
|
|
+ LambdaQueryWrapper<ScenePlus> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ wrapper.isNull(ScenePlus::getUserId);
|
|
|
|
+ List<ScenePlus> list = scenePlusService.list(wrapper);
|
|
|
|
+ for (ScenePlus scenePlus : list) {
|
|
|
|
+ ScenePlusExt plusExt = scenePlusExtService.getByPlusId(scenePlus.getId());
|
|
|
|
+ if(plusExt !=null){
|
|
|
|
+ String fdage = plusExt.getDataSource().replace("/mnt/data","home") +"/data.fdage";
|
|
|
|
+ String fileContent = fYunFileServiceInterface.getFileContent(fdage);
|
|
|
|
+ if(StringUtils.isNotBlank(fileContent)){
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(fileContent);
|
|
|
|
+ String account = jsonObject.getString("account");
|
|
|
|
+ if(StringUtils.isNotBlank(account)){
|
|
|
|
+ Integer userId = Integer.parseInt(account);
|
|
|
|
+ log.info("更新userId---num:{},account:{}",scenePlus.getNum(),userId);
|
|
|
|
+ LambdaUpdateWrapper<ScenePlus> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
|
+ updateWrapper.set(ScenePlus::getUserId,userId);
|
|
|
|
+ updateWrapper.eq(ScenePlus::getId,scenePlus.getId());
|
|
|
|
+ scenePlusService.update(updateWrapper);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return Result.success();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|