|
|
@ -20,10 +20,13 @@ package com.elink.esua.epdc.modules.consult.service.impl; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.elink.esua.epdc.commons.tools.exception.RenException; |
|
|
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
import com.elink.esua.epdc.dto.consult.MajorFunctionConfDTO; |
|
|
|
import com.elink.esua.epdc.dto.consult.result.CheckStateResultDTO; |
|
|
|
import com.elink.esua.epdc.modules.consult.dao.MajorFunctionConfDao; |
|
|
|
import com.elink.esua.epdc.modules.consult.entity.MajorFunctionConfEntity; |
|
|
|
import com.elink.esua.epdc.modules.consult.redis.MajorFunctionConfRedis; |
|
|
@ -65,8 +68,8 @@ public class MajorFunctionConfServiceImpl extends BaseServiceImpl<MajorFunctionC |
|
|
|
return ConvertUtils.sourceToTarget(entityList, MajorFunctionConfDTO.class); |
|
|
|
} |
|
|
|
|
|
|
|
private QueryWrapper<MajorFunctionConfEntity> getWrapper(Map<String, Object> params){ |
|
|
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
|
|
|
private QueryWrapper<MajorFunctionConfEntity> getWrapper(Map<String, Object> params) { |
|
|
|
String id = (String) params.get(FieldConstant.ID_HUMP); |
|
|
|
|
|
|
|
QueryWrapper<MajorFunctionConfEntity> wrapper = new QueryWrapper<>(); |
|
|
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|
|
@ -84,6 +87,13 @@ public class MajorFunctionConfServiceImpl extends BaseServiceImpl<MajorFunctionC |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void save(MajorFunctionConfDTO dto) { |
|
|
|
MajorFunctionConfEntity entity = ConvertUtils.sourceToTarget(dto, MajorFunctionConfEntity.class); |
|
|
|
QueryWrapper queryWrapper = new QueryWrapper(); |
|
|
|
queryWrapper.eq(StringUtils.isNotBlank(dto.getCode()), "code", dto.getCode()); |
|
|
|
|
|
|
|
Integer integer = baseDao.selectCount(queryWrapper); |
|
|
|
if (integer > 0) { |
|
|
|
throw new RenException("功能编码重复"); |
|
|
|
} |
|
|
|
insert(entity); |
|
|
|
} |
|
|
|
|
|
|
@ -101,4 +111,12 @@ public class MajorFunctionConfServiceImpl extends BaseServiceImpl<MajorFunctionC |
|
|
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Result<List<CheckStateResultDTO>> getCheckState() { |
|
|
|
QueryWrapper queryWrapper = new QueryWrapper(); |
|
|
|
List list = baseDao.selectList(queryWrapper); |
|
|
|
List<CheckStateResultDTO> checkStateResultDTOS = ConvertUtils.sourceToTarget(list, CheckStateResultDTO.class); |
|
|
|
return new Result<List<CheckStateResultDTO>>().ok(checkStateResultDTOS); |
|
|
|
} |
|
|
|
|
|
|
|
} |