| | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.jsh.erp.constants.BusinessConstants; |
| | | import com.jsh.erp.datasource.entities.ConfigSecurity; |
| | | import com.jsh.erp.datasource.entities.ConfigSecurityExample; |
| | | import com.jsh.erp.datasource.mappers.ConfigSecurityMapper; |
| | | import com.jsh.erp.datasource.mappers.ConfigSecurityMapperEx; |
| | | import com.jsh.erp.dto.ConfigSecurityQuery; |
| | | import com.jsh.erp.exception.JshException; |
| | | import com.jsh.erp.service.account.AccountService; |
| | |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private ConfigSecurityMapper configSecurityMapper; |
| | | |
| | | @Resource |
| | | private ConfigSecurityMapperEx configSecurityMapperEx; |
| | | |
| | | @Resource |
| | | private LogService logService; |
| | |
| | | @Override |
| | | public List<ConfigSecurity> findList(ConfigSecurityQuery configSecurityQuery) { |
| | | // 设置分页参数 |
| | | PageHelper.startPage(configSecurityQuery.getCurrentPage()-1, configSecurityQuery.getPageSize()); |
| | | |
| | | |
| | | ConfigSecurityExample example = new ConfigSecurityExample(); |
| | | ConfigSecurityExample.Criteria criteria = example.createCriteria(); |
| | |
| | | |
| | | example.setOrderByClause(" create_time desc "); |
| | | |
| | | PageHelper.startPage(configSecurityQuery.getCurrentPage(), configSecurityQuery.getPageSize()); |
| | | return configSecurityMapper.selectByExample(example); |
| | | } |
| | | |
| | |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<ConfigSecurity> findPageInfo(ConfigSecurityQuery configSecurityQuery) { |
| | | ConfigSecurityExample example = new ConfigSecurityExample(); |
| | | ConfigSecurityExample.Criteria criteria = example.createCriteria(); |
| | | criteria.andDeleteFlagEqualTo(false); |
| | | if (StringUtils.isNotEmpty(configSecurityQuery.getKeyword())) { |
| | | criteria.andKeywordLike("%" + configSecurityQuery.getKeyword() + "%"); |
| | | } |
| | | if (StringUtils.isNotEmpty(configSecurityQuery.getType())) { |
| | | criteria.andTypeEqualTo(configSecurityQuery.getType()); |
| | | } |
| | | if (!ObjectUtils.isEmpty(configSecurityQuery.getStatus())) { |
| | | criteria.andStatusEqualTo(configSecurityQuery.getStatus()); |
| | | } |
| | | |
| | | example.setOrderByClause(" create_time desc "); |
| | | |
| | | PageHelper.startPage(configSecurityQuery.getCurrentPage(), configSecurityQuery.getPageSize()); |
| | | List<ConfigSecurity> list = configSecurityMapper.selectByExample(example); |
| | | return new PageInfo<>(list); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<ConfigSecurity> getEnabledListAll() { |
| | | |
| | | return configSecurityMapperEx.getEnabledListAll(); |
| | | } |
| | | |
| | | |
| | | } |