| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- package cn.com.goldenwater.dcproj.service.impl.vill;
- import cn.com.goldenwater.dcproj.dao.AttEngResDao;
- import cn.com.goldenwater.dcproj.dto.BisInspBaseDto;
- import cn.com.goldenwater.dcproj.model.AttAdBase;
- import cn.com.goldenwater.dcproj.model.AttEngRes;
- import cn.com.goldenwater.dcproj.model.AttEngResAssociated;
- import cn.com.goldenwater.dcproj.model.ObjInspPblms;
- import cn.com.goldenwater.dcproj.param.AttEngResParam;
- import cn.com.goldenwater.dcproj.service.AttEngResService;
- import cn.com.goldenwater.core.service.AbstractCrudService;
- import cn.com.goldenwater.dcproj.service.OlBisInspOrgService;
- import cn.com.goldenwater.dcproj.utils.AdLevelUtil;
- import com.github.pagehelper.PageHelper;
- import com.github.pagehelper.PageInfo;
- import org.apache.commons.lang3.StringUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- import org.springframework.transaction.annotation.Transactional;
- import java.util.ArrayList;
- import java.util.List;
- /**
- * @author lune
- * @date 2019-2-18
- */
- @Service
- @Transactional(rollbackFor = Exception.class)
- public class AttEngResServiceImpl extends AbstractCrudService<AttEngRes, AttEngResParam> implements AttEngResService {
- @Autowired
- private AttEngResDao attEngResDao;
- @Autowired
- private OlBisInspOrgService olBisInspOrgService;
- public AttEngResServiceImpl(AttEngResDao attEngResDao) {
- super(attEngResDao);
- this.attEngResDao = attEngResDao;
- }
- @Override
- public PageInfo<AttEngResAssociated> getListByAdCode(String adCode, int pageIndex, int pageSize,String orgId) {
- //设置分页
- PageHelper.startPage(pageIndex, pageSize);
- List<AttEngResAssociated> list = new ArrayList<AttEngResAssociated>();
- if (StringUtils.isNotEmpty(adCode) && !"000000000000".equals(adCode)) {
- //处理行政区划编码,查询所有下级
- adCode = AdLevelUtil.getAllLowerLevelAdCode(adCode);
- //查下级所有
- list = attEngResDao.getListByAdCode(adCode);
- } else {
- //查所有
- list = attEngResDao.getListByAdCode(null);
- }
- return new PageInfo<AttEngResAssociated>(list);
- }
- @Override
- public Object getObjListByGroupIdAndType(String inspGroupId, String objType, int pageIndex, int pageSize,String orgId) {
- //设置分页
- PageHelper.startPage(pageIndex, pageSize);
- List<Object> list = new ArrayList<Object>();
- String province=olBisInspOrgService.getProvince(orgId);
- //根据type分流
- if ("1".equalsIgnoreCase(objType)) {
- List<AttEngRes> result = attEngResDao.getListByInspGroupIdObjType(inspGroupId, objType,orgId,province);
- return new PageInfo<AttEngRes>(result);
- } else if ("2".equalsIgnoreCase(objType)) {
- return null;
- } else if ("3".equalsIgnoreCase(objType)) {
- return null;
- } else if ("4".equalsIgnoreCase(objType)) {
- return null;
- }
- return null;
- }
- @Override
- public Object getObjListNotInspGroupId(String inspGroupId, String objType, String name, int pageIndex, int pageSize,String orgId) {
- //设置分页
- PageHelper.startPage(pageIndex, pageSize);
- List<Object> list = new ArrayList<Object>();
- //处理name
- if (null != name && "" != name) {
- name = "%" + name + "%";
- }
- //根据type分流
- if ("1".equalsIgnoreCase(objType)) {
- List<BisInspBaseDto> result = attEngResDao.getObjListNotInspGroupId(inspGroupId, objType, name);
- return new PageInfo<BisInspBaseDto>(result);
- } else if ("2".equalsIgnoreCase(objType)) {
- return null;
- } else if ("3".equalsIgnoreCase(objType)) {
- return null;
- } else if ("4".equalsIgnoreCase(objType)) {
- return null;
- }
- return null;
- }
- @Override
- public Object getObjListByGroupIdAndTypeNew(String inspGroupId, String objType, String name, int pageIndex, int pageSize,String orgId) {
- PageHelper.startPage(pageIndex, pageSize);
- String province=olBisInspOrgService.getProvince(orgId);
- List<AttEngRes> attAdBases = attEngResDao.getObjListByGroupIdAndTypeNew(inspGroupId, objType, name,orgId,province);
- PageInfo page = new PageInfo(attAdBases);
- return page;
- }
- }
|