智慧保安后台管理项目备份
Administrator
2021-08-13 70ab81f5211897dc0733535a933631b59df9964f
src/main/java/org/springblade/modules/system/controller/UserController.java
@@ -25,6 +25,9 @@
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springblade.common.utils.InvestigateUtil;
import org.springblade.core.cache.utils.CacheUtil;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.launch.constant.AppConstant;
@@ -147,6 +150,19 @@
   //@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
   public R submit(@Valid @RequestBody User user) {
      CacheUtil.clear(USER_CACHE);
      //资格审查
      String body = InvestigateUtil.httpGet(user.getCardid());
      JSONObject jsonObject = new JSONObject(body);
      String data = jsonObject.get("data").toString();
      JSONObject jsonData = new JSONObject(data);
      JSONArray res = jsonData.getJSONArray("res");
      if (res.length()==0){
         //没有数据正常
         user.setExaminationType("0");
      }else {
         user.setExaminationType("1");
         user.setExaminationMx(res.getJSONObject(0).get("zdxsfzqkry").toString());
      }
      return R.status(userService.submit(user));
   }
@@ -300,7 +316,7 @@
   @ApiOperationSupport(order = 17)
   @ApiOperation(value = "查看平台详情", notes = "传入id")
   @GetMapping("/platform-detail")
   @PreAuth(RoleConstant.HAS_ROLE_ADMIN)
   //@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
   public R<UserVO> platformDetail(User user) {
      return R.data(userService.platformDetail(user));
   }