|
@@ -6,35 +6,35 @@ import cn.hutool.core.lang.Assert;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
-import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
|
|
|
+import com.github.pagehelper.Page;
|
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
|
+import com.google.common.collect.Lists;
|
|
import com.ruoyi.ams.bionutrition.org.bean.dto.OrgDTO;
|
|
import com.ruoyi.ams.bionutrition.org.bean.dto.OrgDTO;
|
|
import com.ruoyi.ams.bionutrition.org.bean.entity.OrgEntity;
|
|
import com.ruoyi.ams.bionutrition.org.bean.entity.OrgEntity;
|
|
import com.ruoyi.ams.bionutrition.org.mapper.OrgMapper;
|
|
import com.ruoyi.ams.bionutrition.org.mapper.OrgMapper;
|
|
import com.ruoyi.ams.bionutrition.org.service.IOrgSevice;
|
|
import com.ruoyi.ams.bionutrition.org.service.IOrgSevice;
|
|
-import com.ruoyi.base.constant.type.BizEnum;
|
|
|
|
import com.ruoyi.common.utils.ConvertUtils;
|
|
import com.ruoyi.common.utils.ConvertUtils;
|
|
|
|
+import com.ruoyi.common.utils.PageUtil;
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
import com.ruoyi.framework.service.impl.CrudServiceImpl;
|
|
import com.ruoyi.framework.service.impl.CrudServiceImpl;
|
|
-import org.apache.commons.compress.utils.Lists;
|
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
-import java.util.Objects;
|
|
|
|
|
|
|
|
@Service
|
|
@Service
|
|
public class OrgServiceImpl extends CrudServiceImpl<OrgMapper, OrgEntity, OrgDTO> implements IOrgSevice {
|
|
public class OrgServiceImpl extends CrudServiceImpl<OrgMapper, OrgEntity, OrgDTO> implements IOrgSevice {
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private OrgMapper orgMapper;
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public PageInfo<OrgDTO> getOrgPageInfo(OrgDTO orgDTO) {
|
|
|
|
+ Page<OrgEntity> orgEntitiesPage = (Page<OrgEntity>)baseDao.selectOrgs(BeanUtil.beanToMap(orgDTO));
|
|
|
|
+ return PageUtil.convert(orgEntitiesPage, OrgDTO.class) ;
|
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<OrgDTO> getOrgDTOList(OrgDTO orgDTO) {
|
|
public List<OrgDTO> getOrgDTOList(OrgDTO orgDTO) {
|
|
List<OrgEntity> orgEntities = baseDao.selectList(getWrapper(BeanUtil.beanToMap(orgDTO)));
|
|
List<OrgEntity> orgEntities = baseDao.selectList(getWrapper(BeanUtil.beanToMap(orgDTO)));
|
|
-// List<OrgEntity> orgEntities = orgMapper.selectOrgs(BeanUtil.beanToMap(orgDTO));
|
|
|
|
return CollectionUtil.isNotEmpty(orgEntities)?
|
|
return CollectionUtil.isNotEmpty(orgEntities)?
|
|
ConvertUtils.sourceToTarget(orgEntities, OrgDTO.class) : Lists.newArrayList();
|
|
ConvertUtils.sourceToTarget(orgEntities, OrgDTO.class) : Lists.newArrayList();
|
|
}
|
|
}
|