|
@@ -1,88 +0,0 @@
|
|
-package com.ruoyi.zzb.base.service;
|
|
|
|
-
|
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
-import com.ruoyi.common.annotation.DataSource;
|
|
|
|
-import com.ruoyi.common.enums.DataSourceType;
|
|
|
|
-import com.ruoyi.common.utils.StringUtils;
|
|
|
|
-import com.ruoyi.zzb.base.domain.BasePersonInfo;
|
|
|
|
-import com.ruoyi.zzb.base.domain.BasePersonModule;
|
|
|
|
-import com.ruoyi.zzb.base.domain.req.QueryPersonInfoVO;
|
|
|
|
-import com.ruoyi.zzb.base.mapper.BasePersonInfoMapper;
|
|
|
|
-import com.ruoyi.zzb.base.mapper.BasePersonModuleMapper;
|
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
|
-
|
|
|
|
-import java.util.List;
|
|
|
|
-
|
|
|
|
-@Service
|
|
|
|
-@Slf4j
|
|
|
|
-@DataSource(value = DataSourceType.SLAVE)
|
|
|
|
-public class BaseInfoService {
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private BasePersonInfoMapper basePersonInfoMapper;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private BasePersonModuleMapper basePersonModuleMapper;
|
|
|
|
-
|
|
|
|
- public JSONObject findUserByUserInfo(QueryPersonInfoVO queryPersonInfoVO){
|
|
|
|
- JSONObject resultData = new JSONObject();
|
|
|
|
- LambdaQueryWrapper<BasePersonInfo> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
-
|
|
|
|
- if(!StringUtils.isEmpty(queryPersonInfoVO.getUserId())){
|
|
|
|
- queryWrapper.eq(BasePersonInfo::getUserId,queryPersonInfoVO.getUserId());
|
|
|
|
- }else if(!StringUtils.isEmpty(queryPersonInfoVO.getIdCard())){
|
|
|
|
- queryWrapper.eq(BasePersonInfo::getIdcard,queryPersonInfoVO.getIdCard());
|
|
|
|
- }else if(!StringUtils.isEmpty(queryPersonInfoVO.getPoliceNo())){
|
|
|
|
- queryWrapper.eq(BasePersonInfo::getPoliceNo,queryPersonInfoVO.getPoliceNo());
|
|
|
|
- }else{
|
|
|
|
- throw new RuntimeException("查询条件不能均为空,当前入参:"+JSONObject.toJSONString(queryPersonInfoVO));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- BasePersonInfo personInfo =basePersonInfoMapper.selectOne(queryWrapper);
|
|
|
|
- resultData.put("records",personInfo);
|
|
|
|
-
|
|
|
|
- return resultData;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- public JSONObject findUserModels(QueryPersonInfoVO queryPersonInfoVO){
|
|
|
|
- JSONObject resultData = new JSONObject();
|
|
|
|
- LambdaQueryWrapper<BasePersonModule> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
-
|
|
|
|
- if(!StringUtils.isEmpty(queryPersonInfoVO.getUserId())){
|
|
|
|
- queryWrapper.eq(BasePersonModule::getUserId,queryPersonInfoVO.getUserId());
|
|
|
|
- }else if(!StringUtils.isEmpty(queryPersonInfoVO.getPoliceNo())){
|
|
|
|
- queryWrapper.eq(BasePersonModule::getPoliceNo,queryPersonInfoVO.getPoliceNo());
|
|
|
|
- }else{
|
|
|
|
- throw new RuntimeException("查询条件不能为空,当前入参:"+JSONObject.toJSONString(queryPersonInfoVO));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- List<BasePersonModule> personModules =basePersonModuleMapper.selectList(queryWrapper);
|
|
|
|
- resultData.put("records",personModules);
|
|
|
|
-
|
|
|
|
- return resultData;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- public JSONObject findUserCurrentModelDetail(QueryPersonInfoVO queryPersonInfoVO){
|
|
|
|
- JSONObject resultData = new JSONObject();
|
|
|
|
- LambdaQueryWrapper<BasePersonModule> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
-
|
|
|
|
- if(StringUtils.isNotEmpty(queryPersonInfoVO.getPoliceNo()) && StringUtils.isNotEmpty(queryPersonInfoVO.getModuleCode()) ){
|
|
|
|
- queryWrapper.eq(BasePersonModule::getPoliceNo,queryPersonInfoVO.getPoliceNo());
|
|
|
|
- queryWrapper.eq(BasePersonModule::getModuleCode,queryPersonInfoVO.getModuleCode());
|
|
|
|
- }else{
|
|
|
|
- throw new RuntimeException("查询条件不能为空,当前入参:"+JSONObject.toJSONString(queryPersonInfoVO));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- BasePersonModule personModule =basePersonModuleMapper.selectOne(queryWrapper);
|
|
|
|
- resultData.put("records",personModule);
|
|
|
|
-
|
|
|
|
- return resultData;
|
|
|
|
- }
|
|
|
|
-}
|
|
|