1.字典解析调整

2.用户对外接口添加
This commit is contained in:
2023-09-26 20:37:02 +08:00
parent 081d499c03
commit 08f3564292
7 changed files with 39 additions and 6 deletions

View File

@@ -112,7 +112,7 @@ public class EleEpdPqdController extends BaseController {
@ApiImplicitParam(name = "dataType", value = "数据模型", required = true)
@ApiIgnore
public HttpResult<List<EleEpdPqd>> dictMarkByDataType(@RequestParam("dataType") @Validated String dataType) {
String methodDescribe = getMethodDescribe("dictMark");
String methodDescribe = getMethodDescribe("dictMarkByDataType");
List<EleEpdPqd> list = eleEpdPqdService.dictMarkByDataType(dataType);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
}
@@ -187,7 +187,7 @@ public class EleEpdPqdController extends BaseController {
@ApiImplicitParam(name = "phase", value = "相别", required = true)
})
public HttpResult<EleEpdPqd> findByParam(@RequestParam("name") @Validated String name, @RequestParam("dataType") @Validated String dataType, @RequestParam("phase") @Validated String phase){
String methodDescribe = getMethodDescribe("judgeExist");
String methodDescribe = getMethodDescribe("findByParam");
LogUtil.njcnDebug(log, "{},根据条件查询字典数据:", methodDescribe);
EleEpdPqd eleEpdPqd = eleEpdPqdService.findByParam(name,dataType,phase);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, eleEpdPqd, methodDescribe);

View File

@@ -70,9 +70,6 @@ public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd
if (CollectionUtil.isNotEmpty(eleEpdPqdParam.getStatMethod())){
eleEpdPqd.setStatMethod(String.join(",", eleEpdPqdParam.getStatMethod()));
}
if (Objects.isNull(eleEpdPqdParam.getResourcesId())){
eleEpdPqd.setResourcesId(eleEpdPqdParam.getClassId());
}
if (Objects.isNull(eleEpdPqdParam.getPhase())){
eleEpdPqd.setPhase("M");
}

View File

@@ -65,5 +65,6 @@ public interface UserFeignClient {
@PostMapping("/userByIdList")
HttpResult<List<User>> getUserByIdList(@RequestBody List<String> ids);
@PostMapping("/getAdminInfo")
HttpResult<List<User>> getAdminInfo();
}

View File

@@ -67,6 +67,12 @@ public class UserFeignClientFallbackFactory implements FallbackFactory<UserFeign
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<List<User>> getAdminInfo() {
log.error("{}异常,降级处理,异常为:{}","获取业务管理员信息",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -8,6 +8,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.common.utils.LogUtil;
import com.njcn.user.pojo.po.User;
import com.njcn.user.service.IAppUserService;
import com.njcn.web.annotation.ReturnMsg;
import com.njcn.web.controller.BaseController;
@@ -28,6 +29,7 @@ import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Objects;
/**
@@ -177,4 +179,16 @@ public class AppUserController extends BaseController {
appUserService.updateDevCode(userId,devCode);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
/**
* 获取业务管理员信息
*/
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
@PostMapping("getAdminInfo")
@ApiOperation("获取业务管理员信息")
public HttpResult<List<User>> getAdminInfo() {
String methodDescribe = getMethodDescribe("getAdminInfo");
List<User> list = appUserService.getAdminInfo();
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
}
}

View File

@@ -1,5 +1,9 @@
package com.njcn.user.service;
import com.njcn.user.pojo.po.User;
import java.util.List;
/**
* @author xuyang
*/
@@ -46,4 +50,9 @@ public interface IAppUserService {
*/
void updateDevCode(String userId, String devCode);
/**
* 获取业务管理员信息
*/
List<User> getAdminInfo();
}

View File

@@ -32,6 +32,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Random;
@@ -254,6 +255,11 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, User> impleme
this.update(lambdaUpdateWrapper);
}
@Override
public List<User> getAdminInfo() {
return this.lambdaQuery().eq(User::getLoginName,"njcnyw").eq(User::getState,1).list();
}
/**
* 自定义获取验证码,固定为字母和数字的组合
*/