package com.zcloud.service.bus.impl;

import java.util.List;

import com.zcloud.mapper.dsno2.corp.CorpInfoMapper;
import com.zcloud.mapper.dsno2.corp.ImplementationManagementMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.service.bus.CorpInfoService;

/**
 * 说明：企业管理
 * 作者：luoxiaobao
 * 时间：2020-12-24
 * 官网：www.zcloudchina.com
 */
@Service
@Transactional //开启事物
public class CorpInfoServiceImpl implements CorpInfoService{

	@Autowired
	private CorpInfoMapper corpinfoMapper;

	@Autowired
	private ImplementationManagementMapper implementationManagementMapper;

	/**新增
	 * @param pd
	 * @throws Exception
	 */
	public void save(PageData pd)throws Exception{
		corpinfoMapper.save(pd);
	}
	public void saveTrial(PageData pd)throws Exception{
		corpinfoMapper.saveTrial(pd);
	}
	/**删除
	 * @param pd
	 * @throws Exception
	 */
	public void delete(PageData pd)throws Exception{
		corpinfoMapper.delete(pd);
	}

	/**修改
	 * @param pd
	 * @throws Exception
	 */
	public void edit(PageData pd)throws Exception{
		corpinfoMapper.edit(pd);
	}
	public void editIsReceive(PageData pd)throws Exception{
		corpinfoMapper.editIsReceive(pd);
	}
	public void updateISuse(PageData pd)throws Exception{
		corpinfoMapper.updateISuse(pd);
	}
	public void updateuse(PageData pd)throws Exception{
		corpinfoMapper.updateuse(pd);
	}
	public void editStatus(PageData pd)throws Exception{
		corpinfoMapper.editStatus(pd);
	}
	public void goStop(PageData pd)throws Exception{
		corpinfoMapper.goStop(pd);
	}
	public void deleteStop(PageData pd)throws Exception{
		corpinfoMapper.deleteStop(pd);
	}
	public void goFormal(PageData pd)throws Exception{
		corpinfoMapper.goFormal(pd);
	}
	public void deleteTrial(PageData pd)throws Exception{
		corpinfoMapper.deleteTrial(pd);
	}



	public PageData findBytrialId(PageData pd)throws Exception{
		return corpinfoMapper.findBytrialId(pd);
	}
	public void editStartStatus(PageData pd)throws Exception{
		corpinfoMapper.editStartStatus(pd);
	}
	public void editTrialStatus(PageData pd)throws Exception{
		corpinfoMapper.editTrialStatus(pd);
	}
	public void goStart(PageData pd)throws Exception{
		corpinfoMapper.goStart(pd);
	}
	public void deleteStart(PageData pd)throws Exception{
		corpinfoMapper.deleteStart(pd);
	}

	/**列表
	 * @param page
	 * @throws Exception
	 */
	public List<PageData> list(Page page)throws Exception{
		return corpinfoMapper.datalistPage(page);
	}

	public List<PageData> usedCorpList(Page page)throws Exception{
		return corpinfoMapper.usedCorplistPage(page);
	}

	/**列表
	 * @param page
	 * @throws Exception
	 */
	public List<PageData> corpstoplistPage(Page page)throws Exception{
		return corpinfoMapper.corpstoplistPage(page);
	}

	public List<PageData> corplistPage(Page page)throws Exception{
		return corpinfoMapper.corplistPage(page);
	}
	public List<PageData> smallAuditlistPage(Page page)throws Exception{
		return corpinfoMapper.smallAuditlistPage(page);
	}


	/**资源库企业列表
	 * @param page
	 * @throws Exception
	 */
	public List<PageData> resList(Page page)throws Exception{
		return corpinfoMapper.reslistPage(page);
	}

	/**列表(全部)
	 * @param pd
	 * @throws Exception
	 */
	public List<PageData> listAll(PageData pd)throws Exception{
		return corpinfoMapper.listAll(pd);
	}

	/**通过id获取数据
	 * @param pd
	 * @throws Exception
	 */
	public PageData findById(PageData pd)throws Exception{
		return corpinfoMapper.findById(pd);
	}

	/**批量删除
	 * @param ArrayDATA_IDS
	 * @throws Exception
	 */
	public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
		corpinfoMapper.deleteAll(ArrayDATA_IDS);
	}

	public PageData findByName(PageData pd) {
		return corpinfoMapper.findByName(pd);
	}

	@Override
	public List<PageData> listByCorpType(PageData pd) throws Exception {
		// TODO Auto-generated method stub
		return corpinfoMapper.listByCorpType(pd);
	}

	@Override
	public Integer findCount(String string) throws Exception {
		// TODO Auto-generated method stub
		return corpinfoMapper.findCount(string);
	}

	/**查询所有企业ID
	 * @param pd
	 * @throws Exception
	 */
	@Override
	public List<PageData> getAllCorpId(PageData pd)throws Exception{
		return corpinfoMapper.getAllCorpId(pd);
	}

	/**修改交付信息
	 * @param pd
	 * @throws Exception
	 */
	@Override
	public void editDeliver(PageData pd)throws Exception{
		corpinfoMapper.editDeliver(pd);
	}

	/**查询所有交付企业
	 * @param pd
	 * @throws Exception
	 */
	@Override
	public List<PageData> findAllUsedCorp(PageData pd)throws Exception{
		return corpinfoMapper.findAllUsedCorp(pd);
	}

	/**
	 * 实施人员管理列表
	 * @param page
	 * @return
	 * @throws Exception
	 */
	@Override
	public List<PageData> listPageForImplManagementList(Page page) throws Exception {
		return implementationManagementMapper.listPageForImplManagementList(page);
	}

	/**
	 * 实施人员管理查询机构列表
	 * @param pd
	 * @return
	 * @throws Exception
	 */
	@Override
	public List<PageData> getAgencyListForImplManagement(PageData pd) throws Exception {
		return implementationManagementMapper.getAgencyListForImplManagement(pd);
	}

	/**
	 * 实施人员管理查询项目负责人列表
	 * @param pd
	 * @return
	 * @throws Exception
	 */
	@Override
	public List<PageData> getProjectLeaderListForImplManagement(PageData pd) throws Exception {
		return implementationManagementMapper.getProjectLeaderListForImplManagement(pd);
	}

	/**
	 * 实施人员管理查询运维人员列表
	 * @param pd
	 * @return
	 * @throws Exception
	 */
	@Override
	public List<PageData> getMaintenancePersonListForImplManagement(PageData pd) throws Exception {
		return implementationManagementMapper.getMaintenancePersonListForImplManagement(pd);
	}

	/**
	 * 根据企业id查询
	 * @param pd
	 * @return
	 * @throws Exception
	 */
	@Override
	public PageData getCorpInfoByCorpInfoId(PageData pd) throws Exception {
		return implementationManagementMapper.getCorpInfoByCorpInfoId(pd);
	}

	/**市场管理-指定人员-获取项目负责人下拉列表
	 * @throws Exception
	 */
	@Override
	public List<PageData> getProjectLeadersList(PageData pd) throws Exception{
		return corpinfoMapper.getProjectLeadersList(pd);
	}

	/**市场管理-指定人员-修改项目负责人
	 * @throws Exception
	 */
	@Override
	public void editProjectLeader(PageData pd) throws Exception {
		corpinfoMapper.editProjectLeader(pd);
	}

	/**市场管理-充值-获取剩余时长和短信剩余
	 * @throws Exception
	 */
	@Override
	public List<PageData> getMonEditInfo(PageData pd) throws Exception {
		return corpinfoMapper.getMonEditInfo(pd);
	}

	/**市场管理-获取会员等级列表
	 * @throws Exception
	 */
	@Override
	public List<PageData> getVipLevelList() throws Exception {
		return corpinfoMapper.getVipLevelList();
	}

	/**市场管理-会员调整
	 * @throws Exception
	 */
	@Override
	public void editVipLevel(PageData pd) throws Exception {
		corpinfoMapper.editVipLevel(pd);
	}

	/**
	 * 更改交付日期
	 * @param pd
	 */
	@Override
	public void updateDeliveryDate(PageData pd) throws Exception {
		corpinfoMapper.updateDeliveryDate(pd);
	}

	/**
	 * 根据id查询企业可新建用户数
	 * @param pd
	 * @return
	 */
	@Override
	public PageData findUserNumById(PageData pd) {
		return corpinfoMapper.findUserNumById(pd);
	}

	@Override
	public List<PageData> getAllList(PageData request) {
		return corpinfoMapper.getAllList(request);
	}

	/**
	 * 市场管理-会员调整(机构)
	 * @param pd
	 * @throws Exception
	 */
	@Override
	public void editVipGearLevel(PageData pd) throws Exception {
		corpinfoMapper.editVipGearLevel(pd);
	}

	/**
	 * 停用企业-修改企业信息表
	 * @param stopCorpIds
	 */
	@Override
	public void stopCorp(List<String> stopCorpIds) {
		corpinfoMapper.stopCorp(stopCorpIds);
	}

	/**
	 * 批量添加停用企业
	 * @param stopListData
	 */
	@Override
	public void batchGoStop(List<PageData> stopListData) {
		corpinfoMapper.batchGoStop(stopListData);
	}

	/**
	 * 启用企业-修改企业信息表
	 * @param enableCorpIds
	 */
	@Override
	public void enableCorp(List<String> enableCorpIds) {
		corpinfoMapper.enableCorp(enableCorpIds);
	}

	/**
	 * 批量添加停用企业
	 * @param enableListData
	 */
	@Override
	public void batchGoStart(List<PageData> enableListData) throws Exception {
		corpinfoMapper.batchGoStart(enableListData);
	}

	/**
	 * 获取企业停用记录
	 * @param pd
	 * @return
	 * @throws Exception
	 */
	@Override
	public List<PageData> getDeacivateRecordList(PageData pd) throws Exception {
		return corpinfoMapper.getDeacivateRecordList(pd);
	}

	/**
	 * 停用企业-修改企业停用表
	 * @param stopCorpIds
	 */
	@Override
	public void stopCorpInfo(List<String> stopCorpIds) throws Exception {
		corpinfoMapper.stopCorpInfo(stopCorpIds);
	}

	/**
	 * 启用企业-修改企业信息表
	 * @param enableCorpIds
	 */
	@Override
	public void enableCorpInfo(List<String> enableCorpIds) throws Exception {
		corpinfoMapper.enableCorpInfo(enableCorpIds);
	}

	/**
	 * 运维管理-移除企业停用记录
	 * @throws Exception
	 */
	@Override
	public void removeStopRecord(PageData pd) throws Exception {
		corpinfoMapper.removeStopRecord(pd);
	}

	/**
	 * 根据企业id获取开始时间结束时间在此企业停用期间内的
	 * @param pd
	 * @return
	 * @throws Exception
	 */
	@Override
	public List<PageData> getEffectDeactivateListByCorpId(PageData pd) throws Exception {
		return corpinfoMapper.getEffectDeactivateListByCorpId(pd);
	}
}

