|  | @@ -43,16 +43,16 @@ public class UmsCompanyInfoServiceImpl implements UmsCompanyService {
 | 
											
												
													
														|  |      @Transactional(rollbackFor = Exception.class)
 |  |      @Transactional(rollbackFor = Exception.class)
 | 
											
												
													
														|  |      public void add(UmsCompanyDto dto) {
 |  |      public void add(UmsCompanyDto dto) {
 | 
											
												
													
														|  |          UmsCompanyInfo ums = new UmsCompanyInfo();
 |  |          UmsCompanyInfo ums = new UmsCompanyInfo();
 | 
											
												
													
														|  | -        BeanUtil.copyProperties(dto,ums);
 |  | 
 | 
											
												
													
														|  | 
 |  | +        BeanUtil.copyProperties(dto, ums);
 | 
											
												
													
														|  |          ums.setCreateTime(new Date());
 |  |          ums.setCreateTime(new Date());
 | 
											
												
													
														|  |          int i = umsCompanyInfoMapper.insertSelective(ums);
 |  |          int i = umsCompanyInfoMapper.insertSelective(ums);
 | 
											
												
													
														|  |          List<UmsCompanyFile> files = dto.getFiles();
 |  |          List<UmsCompanyFile> files = dto.getFiles();
 | 
											
												
													
														|  |          List<UmsCompanyShop> shops = dto.getShops();
 |  |          List<UmsCompanyShop> shops = dto.getShops();
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -        List<UmsCompanyFile> filesAdd = dto.getFiles();
 |  | 
 | 
											
												
													
														|  | -        List<UmsCompanyShop> shopsAdd = dto.getShops();
 |  | 
 | 
											
												
													
														|  | -        if (shops != null && shops.size()>0){
 |  | 
 | 
											
												
													
														|  | -            for (UmsCompanyShop shop:shops) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +        List<UmsCompanyFile> filesAdd = new ArrayList<>();
 | 
											
												
													
														|  | 
 |  | +        List<UmsCompanyShop> shopsAdd = new ArrayList<>();
 | 
											
												
													
														|  | 
 |  | +        if (shops != null && shops.size() > 0) {
 | 
											
												
													
														|  | 
 |  | +            for (UmsCompanyShop shop : shops) {
 | 
											
												
													
														|  |                  shop.setShopStatus(0);
 |  |                  shop.setShopStatus(0);
 | 
											
												
													
														|  |                  shop.setCreateTime(new Date());
 |  |                  shop.setCreateTime(new Date());
 | 
											
												
													
														|  |                  shop.setCreateId(dto.getCreateId());
 |  |                  shop.setCreateId(dto.getCreateId());
 | 
											
										
											
												
													
														|  | @@ -61,13 +61,13 @@ public class UmsCompanyInfoServiceImpl implements UmsCompanyService {
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |              umsCompanyShopDao.addUmsCompanyShopList(shopsAdd);
 |  |              umsCompanyShopDao.addUmsCompanyShopList(shopsAdd);
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  | -        if (files != null && files.size()>0){
 |  | 
 | 
											
												
													
														|  | -            for (UmsCompanyFile file:files) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +        if (files != null && files.size() > 0) {
 | 
											
												
													
														|  | 
 |  | +            for (UmsCompanyFile file : files) {
 | 
											
												
													
														|  |                  file.setFileStatus(0);
 |  |                  file.setFileStatus(0);
 | 
											
												
													
														|  |                  file.setCreateTime(new Date());
 |  |                  file.setCreateTime(new Date());
 | 
											
												
													
														|  |                  file.setCreateId(dto.getCreateId());
 |  |                  file.setCreateId(dto.getCreateId());
 | 
											
												
													
														|  |                  file.setCompId(ums.getId());
 |  |                  file.setCompId(ums.getId());
 | 
											
												
													
														|  | -                files.add(file);
 |  | 
 | 
											
												
													
														|  | 
 |  | +                filesAdd.add(file);
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |              umsCompanyShopDao.insertFile(filesAdd);
 |  |              umsCompanyShopDao.insertFile(filesAdd);
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
										
											
												
													
														|  | @@ -75,62 +75,110 @@ public class UmsCompanyInfoServiceImpl implements UmsCompanyService {
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  |      public void update(UmsCompanyDto dto) {
 |  |      public void update(UmsCompanyDto dto) {
 | 
											
												
													
														|  | -        UmsCompanyInfo umsCompanyInfo = new UmsCompanyInfo();
 |  | 
 | 
											
												
													
														|  | -        BeanUtil.copyProperties(dto, umsCompanyInfo);
 |  | 
 | 
											
												
													
														|  | -        umsCompanyInfoMapper.updateByPrimaryKeySelective(umsCompanyInfo);
 |  | 
 | 
											
												
													
														|  | 
 |  | +        UmsCompanyInfo ums = new UmsCompanyInfo();
 | 
											
												
													
														|  | 
 |  | +        BeanUtil.copyProperties(dto, ums);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        List<UmsCompanyFile> files = dto.getFiles();
 | 
											
												
													
														|  | 
 |  | +        List<UmsCompanyShop> shops = dto.getShops();
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +        List<UmsCompanyFile> filesAdd = new ArrayList<>();
 | 
											
												
													
														|  | 
 |  | +        List<UmsCompanyShop> shopsAdd = new ArrayList<>();
 | 
											
												
													
														|  | 
 |  | +        Long id = ums.getId();
 | 
											
												
													
														|  | 
 |  | +        if (shops != null && shops.size() > 0) {
 | 
											
												
													
														|  | 
 |  | +            for (UmsCompanyShop shop : shops) {
 | 
											
												
													
														|  | 
 |  | +                shop.setShopStatus(0);
 | 
											
												
													
														|  | 
 |  | +                shop.setCreateTime(new Date());
 | 
											
												
													
														|  | 
 |  | +                shop.setCreateId(dto.getCreateId());
 | 
											
												
													
														|  | 
 |  | +                shop.setCompId(ums.getId());
 | 
											
												
													
														|  | 
 |  | +                shopsAdd.add(shop);
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +            deleteCompanyShop(id);
 | 
											
												
													
														|  | 
 |  | +            umsCompanyShopDao.addUmsCompanyShopList(shopsAdd);
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +        if (files != null && files.size() > 0) {
 | 
											
												
													
														|  | 
 |  | +            for (UmsCompanyFile file : files) {
 | 
											
												
													
														|  | 
 |  | +                file.setFileStatus(0);
 | 
											
												
													
														|  | 
 |  | +                file.setCreateTime(new Date());
 | 
											
												
													
														|  | 
 |  | +                file.setCreateId(dto.getCreateId());
 | 
											
												
													
														|  | 
 |  | +                file.setCompId(ums.getId());
 | 
											
												
													
														|  | 
 |  | +                filesAdd.add(file);
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +            deleteCompanyFile(id);
 | 
											
												
													
														|  | 
 |  | +            umsCompanyShopDao.insertFile(filesAdd);
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +        umsCompanyInfoMapper.updateByPrimaryKeySelective(ums);
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |      @Autowired
 |  |      @Autowired
 | 
											
												
													
														|  |      private UmsCompanyInfoDao umsCompanyInfoDao;
 |  |      private UmsCompanyInfoDao umsCompanyInfoDao;
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  |      @Transactional(rollbackFor = Exception.class)
 |  |      @Transactional(rollbackFor = Exception.class)
 | 
											
												
													
														|  |      public void delete(Long id) {
 |  |      public void delete(Long id) {
 | 
											
												
													
														|  |          long i = umsCompanyInfoDao.deleteCheck(id);
 |  |          long i = umsCompanyInfoDao.deleteCheck(id);
 | 
											
												
													
														|  | -        if(i>0){
 |  | 
 | 
											
												
													
														|  | 
 |  | +        if (i > 0) {
 | 
											
												
													
														|  |              throw new GlobalException("该供应商的数据被用户~生产地~商品所引用无法删除!");
 |  |              throw new GlobalException("该供应商的数据被用户~生产地~商品所引用无法删除!");
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |          UmsCompanyInfo info = new UmsCompanyInfo();
 |  |          UmsCompanyInfo info = new UmsCompanyInfo();
 | 
											
												
													
														|  |          info.setCompStatus(2);
 |  |          info.setCompStatus(2);
 | 
											
												
													
														|  |          info.setId(id);
 |  |          info.setId(id);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |          umsCompanyInfoMapper.updateByPrimaryKeySelective(info);
 |  |          umsCompanyInfoMapper.updateByPrimaryKeySelective(info);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        deleteCompanyShop(id);
 | 
											
												
													
														|  | 
 |  | +        deleteCompanyFile(id);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +    }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +    private void deleteCompanyShop(Long compId){
 | 
											
												
													
														|  | 
 |  | +        UmsCompanyShopExample example=new UmsCompanyShopExample();
 | 
											
												
													
														|  | 
 |  | +        UmsCompanyShopExample.Criteria criteria = example.createCriteria();
 | 
											
												
													
														|  | 
 |  | +        criteria.andCompIdEqualTo(compId);
 | 
											
												
													
														|  | 
 |  | +        umsCompanyShopMapper.deleteByExample(example);
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +    private void deleteCompanyFile(Long compId){
 | 
											
												
													
														|  | 
 |  | +        UmsCompanyFileExample example=new UmsCompanyFileExample();
 | 
											
												
													
														|  | 
 |  | +        UmsCompanyFileExample.Criteria criteria = example.createCriteria();
 | 
											
												
													
														|  | 
 |  | +        criteria.andCompIdEqualTo(compId);
 | 
											
												
													
														|  | 
 |  | +        umsCompanyFileMapper.deleteByExample(example);
 | 
											
												
													
														|  | 
 |  | +    }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  |      @Transactional(rollbackFor = Exception.class)
 |  |      @Transactional(rollbackFor = Exception.class)
 | 
											
												
													
														|  |      public String importExcel(List<UmsCompanyInfoExcel> infoExcels) {
 |  |      public String importExcel(List<UmsCompanyInfoExcel> infoExcels) {
 | 
											
												
													
														|  | -      if (infoExcels == null || infoExcels.size()<1){
 |  | 
 | 
											
												
													
														|  | -          return null;
 |  | 
 | 
											
												
													
														|  | -      }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -      List<UmsCompanyShop> listShops = new ArrayList<>();
 |  | 
 | 
											
												
													
														|  | -      infoExcels.stream().forEach(item->{
 |  | 
 | 
											
												
													
														|  | -          UmsCompanyInfo umsCompanyInfo = new UmsCompanyInfo();
 |  | 
 | 
											
												
													
														|  | -          BeanUtil.copyProperties(item,umsCompanyInfo);
 |  | 
 | 
											
												
													
														|  | -          umsCompanyInfo.setCreateTime(new Date());
 |  | 
 | 
											
												
													
														|  | -          umsCompanyInfo.setCompStatus(0);
 |  | 
 | 
											
												
													
														|  | -          try {
 |  | 
 | 
											
												
													
														|  | -              int i = umsCompanyInfoMapper.insertSelective(umsCompanyInfo);
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -              item.setId(umsCompanyInfo.getId());
 |  | 
 | 
											
												
													
														|  | -              List<UmsCompanyShop> shops = getShopsFromUmsCompanyInfoExcel(item);
 |  | 
 | 
											
												
													
														|  | -              listShops.addAll(shops);
 |  | 
 | 
											
												
													
														|  | -          }catch (Exception e){
 |  | 
 | 
											
												
													
														|  | -                log.info("添加数据失败");
 |  | 
 | 
											
												
													
														|  | -          }
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | 
 |  | +        if (infoExcels == null || infoExcels.size() < 1) {
 | 
											
												
													
														|  | 
 |  | +            return null;
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -      });
 |  | 
 | 
											
												
													
														|  | -      if (listShops != null &&listShops.size()>0){
 |  | 
 | 
											
												
													
														|  | -          int i = umsCompanyShopDao.addUmsCompanyShopList(listShops);
 |  | 
 | 
											
												
													
														|  | -      }
 |  | 
 | 
											
												
													
														|  | -      return null;
 |  | 
 | 
											
												
													
														|  | 
 |  | +        List<UmsCompanyShop> listShops = new ArrayList<>();
 | 
											
												
													
														|  | 
 |  | +        infoExcels.stream().forEach(item -> {
 | 
											
												
													
														|  | 
 |  | +            UmsCompanyInfo umsCompanyInfo = new UmsCompanyInfo();
 | 
											
												
													
														|  | 
 |  | +            BeanUtil.copyProperties(item, umsCompanyInfo);
 | 
											
												
													
														|  | 
 |  | +            umsCompanyInfo.setCreateTime(new Date());
 | 
											
												
													
														|  | 
 |  | +            umsCompanyInfo.setCompStatus(0);
 | 
											
												
													
														|  | 
 |  | +            try {
 | 
											
												
													
														|  | 
 |  | +                int i = umsCompanyInfoMapper.insertSelective(umsCompanyInfo);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +                item.setId(umsCompanyInfo.getId());
 | 
											
												
													
														|  | 
 |  | +                List<UmsCompanyShop> shops = getShopsFromUmsCompanyInfoExcel(item);
 | 
											
												
													
														|  | 
 |  | +                listShops.addAll(shops);
 | 
											
												
													
														|  | 
 |  | +            } catch (Exception e) {
 | 
											
												
													
														|  | 
 |  | +                log.info("添加数据失败");
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +        });
 | 
											
												
													
														|  | 
 |  | +        if (listShops != null && listShops.size() > 0) {
 | 
											
												
													
														|  | 
 |  | +            int i = umsCompanyShopDao.addUmsCompanyShopList(listShops);
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +        return null;
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  | -    public Map<String,Object> getCompanyInfoList(int pageSize, int pageNo) {
 |  | 
 | 
											
												
													
														|  | -        Map<String,Object> hasp=new HashMap<>();
 |  | 
 | 
											
												
													
														|  | -        PageHelper.startPage(pageNo,pageSize);
 |  | 
 | 
											
												
													
														|  | 
 |  | +    public Map<String, Object> getCompanyInfoList(int pageSize, int pageNo) {
 | 
											
												
													
														|  | 
 |  | +        Map<String, Object> hasp = new HashMap<>();
 | 
											
												
													
														|  | 
 |  | +        PageHelper.startPage(pageNo, pageSize);
 | 
											
												
													
														|  |          UmsCompanyInfoExample example = new UmsCompanyInfoExample();
 |  |          UmsCompanyInfoExample example = new UmsCompanyInfoExample();
 | 
											
												
													
														|  |          UmsCompanyInfoExample.Criteria criteria = example.createCriteria();
 |  |          UmsCompanyInfoExample.Criteria criteria = example.createCriteria();
 | 
											
												
													
														|  |          criteria.andCompStatusEqualTo(0);
 |  |          criteria.andCompStatusEqualTo(0);
 | 
											
										
											
												
													
														|  | @@ -139,16 +187,15 @@ public class UmsCompanyInfoServiceImpl implements UmsCompanyService {
 | 
											
												
													
														|  |          CommonPage<UmsCompanyInfo> umsCompanyInfoCommonPage = CommonPage.restPage(companyInfos);
 |  |          CommonPage<UmsCompanyInfo> umsCompanyInfoCommonPage = CommonPage.restPage(companyInfos);
 | 
											
												
													
														|  |          List<UmsCompanyInfo> list = umsCompanyInfoCommonPage.getList();
 |  |          List<UmsCompanyInfo> list = umsCompanyInfoCommonPage.getList();
 | 
											
												
													
														|  |          List<UmsCompanyDto> dtos = new ArrayList<>();
 |  |          List<UmsCompanyDto> dtos = new ArrayList<>();
 | 
											
												
													
														|  | -        list.stream().forEach(comp->{
 |  | 
 | 
											
												
													
														|  | -            UmsCompanyDto dto= new UmsCompanyDto();
 |  | 
 | 
											
												
													
														|  | -            BeanUtil.copyProperties(comp,dto);
 |  | 
 | 
											
												
													
														|  | 
 |  | +        list.stream().forEach(comp -> {
 | 
											
												
													
														|  | 
 |  | +            UmsCompanyDto dto = new UmsCompanyDto();
 | 
											
												
													
														|  | 
 |  | +            BeanUtil.copyProperties(comp, dto);
 | 
											
												
													
														|  |              dto.setFiles(getCompanyFile(comp.getId()));
 |  |              dto.setFiles(getCompanyFile(comp.getId()));
 | 
											
												
													
														|  |              dto.setShops(getCompanyShop(comp.getId()));
 |  |              dto.setShops(getCompanyShop(comp.getId()));
 | 
											
												
													
														|  |              dtos.add(dto);
 |  |              dtos.add(dto);
 | 
											
												
													
														|  | -            dtos.add(dto);
 |  | 
 | 
											
												
													
														|  |          });
 |  |          });
 | 
											
												
													
														|  | -        hasp.put("total",umsCompanyInfoCommonPage.getTotal());
 |  | 
 | 
											
												
													
														|  | -        hasp.put("list",dtos);
 |  | 
 | 
											
												
													
														|  | 
 |  | +        hasp.put("total", umsCompanyInfoCommonPage.getTotal());
 | 
											
												
													
														|  | 
 |  | +        hasp.put("list", dtos);
 | 
											
												
													
														|  |          return hasp;
 |  |          return hasp;
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -156,14 +203,13 @@ public class UmsCompanyInfoServiceImpl implements UmsCompanyService {
 | 
											
												
													
														|  |      public UmsCompanyDto getDetailCompany(Long companyId) {
 |  |      public UmsCompanyDto getDetailCompany(Long companyId) {
 | 
											
												
													
														|  |          UmsCompanyInfo umsCompanyInfo = umsCompanyInfoMapper.selectByPrimaryKey(companyId);
 |  |          UmsCompanyInfo umsCompanyInfo = umsCompanyInfoMapper.selectByPrimaryKey(companyId);
 | 
											
												
													
														|  |          UmsCompanyDto ums = new UmsCompanyDto();
 |  |          UmsCompanyDto ums = new UmsCompanyDto();
 | 
											
												
													
														|  | -        BeanUtil.copyProperties(umsCompanyInfo,ums);
 |  | 
 | 
											
												
													
														|  | 
 |  | +        BeanUtil.copyProperties(umsCompanyInfo, ums);
 | 
											
												
													
														|  |          ums.setFiles(getCompanyFile(companyId));
 |  |          ums.setFiles(getCompanyFile(companyId));
 | 
											
												
													
														|  |          ums.setShops(getCompanyShop(companyId));
 |  |          ums.setShops(getCompanyShop(companyId));
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |          return ums;
 |  |          return ums;
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -    public List<UmsCompanyShop> getShopsFromUmsCompanyInfoExcel(UmsCompanyInfoExcel ums){
 |  | 
 | 
											
												
													
														|  | 
 |  | +    public List<UmsCompanyShop> getShopsFromUmsCompanyInfoExcel(UmsCompanyInfoExcel ums) {
 | 
											
												
													
														|  |          List<UmsCompanyShop> shops = new ArrayList<>();
 |  |          List<UmsCompanyShop> shops = new ArrayList<>();
 | 
											
												
													
														|  |          UmsCompanyShop shop = new UmsCompanyShop();
 |  |          UmsCompanyShop shop = new UmsCompanyShop();
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -171,33 +217,37 @@ public class UmsCompanyInfoServiceImpl implements UmsCompanyService {
 | 
											
												
													
														|  |          shop.setCreateId((long) 1);
 |  |          shop.setCreateId((long) 1);
 | 
											
												
													
														|  |          shop.setCreateTime(new Date());
 |  |          shop.setCreateTime(new Date());
 | 
											
												
													
														|  |          shop.setShopStatus(0);
 |  |          shop.setShopStatus(0);
 | 
											
												
													
														|  | -        if (!StringUtils.isEmpty(ums.getTbUrl())){
 |  | 
 | 
											
												
													
														|  | 
 |  | +        if (!StringUtils.isEmpty(ums.getTbUrl())) {
 | 
											
												
													
														|  |              UmsCompanyShop tbShop = new UmsCompanyShop();
 |  |              UmsCompanyShop tbShop = new UmsCompanyShop();
 | 
											
												
													
														|  | -            BeanUtil.copyProperties(shop,tbShop);
 |  | 
 | 
											
												
													
														|  | 
 |  | +            BeanUtil.copyProperties(shop, tbShop);
 | 
											
												
													
														|  |              tbShop.setShopType("taobao");
 |  |              tbShop.setShopType("taobao");
 | 
											
												
													
														|  |              tbShop.setShopUrl(ums.getTbUrl());
 |  |              tbShop.setShopUrl(ums.getTbUrl());
 | 
											
												
													
														|  | 
 |  | +            tbShop.setShopImg("http://fqn.hongweisoft.com/jingdong.jpg");
 | 
											
												
													
														|  |              shops.add(tbShop);
 |  |              shops.add(tbShop);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  | -        if (!StringUtils.isEmpty(ums.getJdUrl())){
 |  | 
 | 
											
												
													
														|  | 
 |  | +        if (!StringUtils.isEmpty(ums.getJdUrl())) {
 | 
											
												
													
														|  |              UmsCompanyShop jdShop = new UmsCompanyShop();
 |  |              UmsCompanyShop jdShop = new UmsCompanyShop();
 | 
											
												
													
														|  | -            BeanUtil.copyProperties(shop,jdShop);
 |  | 
 | 
											
												
													
														|  | 
 |  | +            BeanUtil.copyProperties(shop, jdShop);
 | 
											
												
													
														|  |              jdShop.setShopType("jd");
 |  |              jdShop.setShopType("jd");
 | 
											
												
													
														|  |              jdShop.setShopUrl(ums.getJdUrl());
 |  |              jdShop.setShopUrl(ums.getJdUrl());
 | 
											
												
													
														|  | 
 |  | +            jdShop.setShopImg("http://fqn.hongweisoft.com/taobao.jpg");
 | 
											
												
													
														|  |              shops.add(jdShop);
 |  |              shops.add(jdShop);
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -        if (StringUtils.isEmpty(ums.getOwnUrl())){
 |  | 
 | 
											
												
													
														|  | 
 |  | +        if (!StringUtils.isEmpty(ums.getOwnUrl())) {
 | 
											
												
													
														|  |              UmsCompanyShop ownShop = new UmsCompanyShop();
 |  |              UmsCompanyShop ownShop = new UmsCompanyShop();
 | 
											
												
													
														|  | -            BeanUtil.copyProperties(shop,ownShop);
 |  | 
 | 
											
												
													
														|  | 
 |  | +            BeanUtil.copyProperties(shop, ownShop);
 | 
											
												
													
														|  |              ownShop.setShopType("own");
 |  |              ownShop.setShopType("own");
 | 
											
												
													
														|  |              ownShop.setShopUrl(ums.getOwnUrl());
 |  |              ownShop.setShopUrl(ums.getOwnUrl());
 | 
											
												
													
														|  | 
 |  | +            ownShop.setShopImg("http://bpic.588ku.com/element_pic/20/06/30/65ed28bc8f14415778c878ecca4bacc8.jpg");
 | 
											
												
													
														|  |              shops.add(ownShop);
 |  |              shops.add(ownShop);
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |          return shops;
 |  |          return shops;
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  | -    public List<UmsCompanyFile> getCompanyFile(Long compId){
 |  | 
 | 
											
												
													
														|  | 
 |  | +    public List<UmsCompanyFile> getCompanyFile(Long compId) {
 | 
											
												
													
														|  |          UmsCompanyFileExample example = new UmsCompanyFileExample();
 |  |          UmsCompanyFileExample example = new UmsCompanyFileExample();
 | 
											
												
													
														|  |          UmsCompanyFileExample.Criteria criteria = example.createCriteria();
 |  |          UmsCompanyFileExample.Criteria criteria = example.createCriteria();
 | 
											
												
													
														|  |          criteria.andCompIdEqualTo(compId);
 |  |          criteria.andCompIdEqualTo(compId);
 | 
											
										
											
												
													
														|  | @@ -205,7 +255,8 @@ public class UmsCompanyInfoServiceImpl implements UmsCompanyService {
 | 
											
												
													
														|  |          List<UmsCompanyFile> files = umsCompanyFileMapper.selectByExample(example);
 |  |          List<UmsCompanyFile> files = umsCompanyFileMapper.selectByExample(example);
 | 
											
												
													
														|  |          return files;
 |  |          return files;
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  | -    public List<UmsCompanyShop> getCompanyShop(Long compId){
 |  | 
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +    public List<UmsCompanyShop> getCompanyShop(Long compId) {
 | 
											
												
													
														|  |          UmsCompanyShopExample example = new UmsCompanyShopExample();
 |  |          UmsCompanyShopExample example = new UmsCompanyShopExample();
 | 
											
												
													
														|  |          UmsCompanyShopExample.Criteria criteria = example.createCriteria();
 |  |          UmsCompanyShopExample.Criteria criteria = example.createCriteria();
 | 
											
												
													
														|  |          criteria.andCompIdEqualTo(compId);
 |  |          criteria.andCompIdEqualTo(compId);
 | 
											
										
											
												
													
														|  | @@ -216,7 +267,7 @@ public class UmsCompanyInfoServiceImpl implements UmsCompanyService {
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  |      public void updateCompanyFile(UmsCompanyFile umsCompanyFile) {
 |  |      public void updateCompanyFile(UmsCompanyFile umsCompanyFile) {
 | 
											
												
													
														|  | -        if (StringUtils.isEmpty(umsCompanyFile.getId())){
 |  | 
 | 
											
												
													
														|  | 
 |  | +        if (StringUtils.isEmpty(umsCompanyFile.getId())) {
 | 
											
												
													
														|  |              throw new GlobalException("缺失修改主体!");
 |  |              throw new GlobalException("缺失修改主体!");
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |          umsCompanyFile.setUpdateTime(new Date());
 |  |          umsCompanyFile.setUpdateTime(new Date());
 | 
											
										
											
												
													
														|  | @@ -225,8 +276,8 @@ public class UmsCompanyInfoServiceImpl implements UmsCompanyService {
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  |      public void deleteCompanyFile(Long shopId, Long userId) {
 |  |      public void deleteCompanyFile(Long shopId, Long userId) {
 | 
											
												
													
														|  | -        if (shopId == null){
 |  | 
 | 
											
												
													
														|  | -            throw  new GlobalException("缺失删除主体!");
 |  | 
 | 
											
												
													
														|  | 
 |  | +        if (shopId == null) {
 | 
											
												
													
														|  | 
 |  | +            throw new GlobalException("缺失删除主体!");
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |          UmsCompanyFile umsCompanyFile = new UmsCompanyFile();
 |  |          UmsCompanyFile umsCompanyFile = new UmsCompanyFile();
 | 
											
												
													
														|  |          umsCompanyFile.setId(shopId);
 |  |          umsCompanyFile.setId(shopId);
 | 
											
										
											
												
													
														|  | @@ -238,7 +289,7 @@ public class UmsCompanyInfoServiceImpl implements UmsCompanyService {
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  |      public void updateCompanyShop(UmsCompanyShop umsCompanyShop) {
 |  |      public void updateCompanyShop(UmsCompanyShop umsCompanyShop) {
 | 
											
												
													
														|  | -        if (StringUtils.isEmpty(umsCompanyShop.getId())){
 |  | 
 | 
											
												
													
														|  | 
 |  | +        if (StringUtils.isEmpty(umsCompanyShop.getId())) {
 | 
											
												
													
														|  |              throw new GlobalException("缺失修改主体!");
 |  |              throw new GlobalException("缺失修改主体!");
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |          umsCompanyShop.setUpdateTime(new Date());
 |  |          umsCompanyShop.setUpdateTime(new Date());
 | 
											
										
											
												
													
														|  | @@ -247,8 +298,8 @@ public class UmsCompanyInfoServiceImpl implements UmsCompanyService {
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  |      public void deleteCompanyShop(Long shopId, Long userId) {
 |  |      public void deleteCompanyShop(Long shopId, Long userId) {
 | 
											
												
													
														|  | -        if (shopId == null){
 |  | 
 | 
											
												
													
														|  | -            throw  new GlobalException("缺失删除主体");
 |  | 
 | 
											
												
													
														|  | 
 |  | +        if (shopId == null) {
 | 
											
												
													
														|  | 
 |  | +            throw new GlobalException("缺失删除主体");
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          UmsCompanyShop umsCompanyShop = new UmsCompanyShop();
 |  |          UmsCompanyShop umsCompanyShop = new UmsCompanyShop();
 | 
											
										
											
												
													
														|  | @@ -267,7 +318,7 @@ public class UmsCompanyInfoServiceImpl implements UmsCompanyService {
 | 
											
												
													
														|  |          file.setFileStatus(2);
 |  |          file.setFileStatus(2);
 | 
											
												
													
														|  |          file.setUpdateId(userId);
 |  |          file.setUpdateId(userId);
 | 
											
												
													
														|  |          file.setUpdateTime(new Date());
 |  |          file.setUpdateTime(new Date());
 | 
											
												
													
														|  | -        umsCompanyFileMapper.updateByExample(file,fileExampleW);
 |  | 
 | 
											
												
													
														|  | 
 |  | +        umsCompanyFileMapper.updateByExample(file, fileExampleW);
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
										
											
												
													
														|  | @@ -278,19 +329,19 @@ public class UmsCompanyInfoServiceImpl implements UmsCompanyService {
 | 
											
												
													
														|  |          UmsCompanyShopExample shopExample = new UmsCompanyShopExample();
 |  |          UmsCompanyShopExample shopExample = new UmsCompanyShopExample();
 | 
											
												
													
														|  |          UmsCompanyShopExample.Criteria criteria = shopExample.createCriteria();
 |  |          UmsCompanyShopExample.Criteria criteria = shopExample.createCriteria();
 | 
											
												
													
														|  |          criteria.andCompIdEqualTo(compId);
 |  |          criteria.andCompIdEqualTo(compId);
 | 
											
												
													
														|  | -        umsCompanyShopMapper.updateByExample(shop,shopExample);
 |  | 
 | 
											
												
													
														|  | 
 |  | +        umsCompanyShopMapper.updateByExample(shop, shopExample);
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  | -    public List<UmsCompanyInfo> searchCompanyInfo(String key,int pageNo,int pageSize,Long compId) {
 |  | 
 | 
											
												
													
														|  | -        PageHelper.startPage(pageNo,pageSize);
 |  | 
 | 
											
												
													
														|  | 
 |  | +    public List<UmsCompanyInfo> searchCompanyInfo(String key, int pageNo, int pageSize, Long compId) {
 | 
											
												
													
														|  | 
 |  | +        PageHelper.startPage(pageNo, pageSize);
 | 
											
												
													
														|  |          UmsCompanyInfoExample umsCompanyInfoExample = new UmsCompanyInfoExample();
 |  |          UmsCompanyInfoExample umsCompanyInfoExample = new UmsCompanyInfoExample();
 | 
											
												
													
														|  |          UmsCompanyInfoExample.Criteria criteria = umsCompanyInfoExample.createCriteria();
 |  |          UmsCompanyInfoExample.Criteria criteria = umsCompanyInfoExample.createCriteria();
 | 
											
												
													
														|  | -        if (compId != null){
 |  | 
 | 
											
												
													
														|  | 
 |  | +        if (compId != null) {
 | 
											
												
													
														|  |              criteria.andIdEqualTo(compId);
 |  |              criteria.andIdEqualTo(compId);
 | 
											
												
													
														|  | -        }else {
 |  | 
 | 
											
												
													
														|  | -            if (StringUtils.isEmpty(key)){
 |  | 
 | 
											
												
													
														|  | -                criteria.andCompNameLike("%"+key+"%");
 |  | 
 | 
											
												
													
														|  | 
 |  | +        } else {
 | 
											
												
													
														|  | 
 |  | +            if (StringUtils.isEmpty(key)) {
 | 
											
												
													
														|  | 
 |  | +                criteria.andCompNameLike("%" + key + "%");
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |  
 |  |  
 |