package com.xintong.visualinspection.visuallnspection_fjq.service.impl;

import com.xintong.visualinspection.bean.CheckAppeal_F;
import com.xintong.visualinspection.service.CheckAppealService_F;
import com.xintong.visualinspection.service.UserService;
import com.xintong.visualinspection.util.CacheUtil;
import com.xintong.visualinspection.visuallnspection_fjq.dao.CheckAppealDao;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 文件名：UserServiceImpl
 * 版本信息：日期：2017/3/30 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
 */
@Service
@com.alibaba.dubbo.config.annotation.Service(
        version = "1.0.0",
        application = "${dubbo.application.id}",
        protocol = "${dubbo.protocol.id}",
        registry = "${dubbo.registry.id}"
)
public class CheckAppealServiceImpl implements CheckAppealService_F {

    private static final org.slf4j.Logger logger = LoggerFactory.getLogger(CheckAppealServiceImpl.class);


    @Autowired
    private CheckAppealDao checkAppealDao;


	@Override
	public List<CheckAppeal_F> getList(CheckAppeal_F param) {
		List<CheckAppeal_F> list = checkAppealDao.getList(param);
		return getList(list) ;
	}
	public List<CheckAppeal_F> getList(List<CheckAppeal_F> checkAppeallist){
		for (CheckAppeal_F checkAppeal : checkAppeallist) {
			checkAppeal.setAppeal_man_name(CacheUtil.getUserTurenameFromMap(checkAppeal.getAppeal_man()));
			checkAppeal.setVerify_person_name(CacheUtil.getUserTurenameFromMap(checkAppeal.getVerify_person()));
			checkAppeal.setCheckman_name(CacheUtil.getUserTurenameFromMap(checkAppeal.getCheckman()));
			checkAppeal.setRecheckman_name(CacheUtil.getUserTurenameFromMap(checkAppeal.getRecheckman()));
			checkAppeal.setAppeal_dept_name(CacheUtil.getOrgannameFromMap(checkAppeal.getAppeal_dept()));
		}
		return checkAppeallist;
	}

	@Override
	public CheckAppeal_F getById(Long id) {
		return checkAppealDao.getOne(id);
	}


	@Override
	public void insert(CheckAppeal_F checkAppeal) {
		checkAppealDao.insert(checkAppeal);
	}


	@Override
	public void update(CheckAppeal_F checkAppeal) {
		checkAppealDao.update(checkAppeal);
	}


	@Override
	public void delete(Long id) {
		checkAppealDao.delete(id);
	}
	@Override
	public CheckAppeal_F getByTaskId(Long id) {
		// TODO Auto-generated method stub
		return checkAppealDao.getByTaskId(id);
	}

}
