a6531862809dfc26a4062d53c5f6228d6f4b479b.svn-base 3.41 KB
/**
 * Copyright © 2015-2018 ODM All rights reserved.
 */
package com.thinkgem.jeesite.modules.reg.service.bus;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.config.Global;
import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.modules.reg.entity.base.RegBasePerson;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusBdcqzsdjxx;
import com.thinkgem.jeesite.modules.reg.entity.bus.RegBusDyaq;
import com.thinkgem.jeesite.modules.reg.service.base.RegBasePersonService;
import com.thinkgem.jeesite.modules.reg.dao.bus.RegBusDyaqDao;

/**
 * 抵押权信息维护Service
 * @author xuyg
 * @version 2015-10-15
 */
@Service
@Transactional(readOnly = true)
public class RegBusDyaqService extends CrudService<RegBusDyaqDao, RegBusDyaq> {
	@Autowired
	private RegBasePersonService regBasePersonService;
	
	public RegBusDyaq get(String id) {
		return super.get(id);
	}
	
	public RegBusDyaq getByZxywh(String zxdyywh) {
		return dao.getByZxywh(zxdyywh);
	}
	public List<RegBusDyaq> finddyxxs(RegBusDyaq regBusDyaq) {
		if("oracle".equals(Global.getDbName())){
			return dao.OracleFinddyxxs(regBusDyaq);
		}else {
			return dao.finddyxxs(regBusDyaq);
		}
	}
	
	@Transactional(readOnly = false)
	public void insert(RegBusDyaq regBusDyaq) {
		regBusDyaq.preInsert();
		dao.insert(regBusDyaq);
	}
	
	@Transactional(readOnly = false)
	public void update(RegBusDyaq regBusDyaq) {
		regBusDyaq.preUpdate();
		dao.update(regBusDyaq);
	}
	
	@Transactional(readOnly = false)
	public void updatedbze(Map<String, String> map) {
		if("oracle".equals(Global.getDbName())){
			dao.OracleUpdatedbze(map);
		}else {
			dao.updatedbze(map);
		}
	}
	
	@Transactional(readOnly = false)
	public void updatezwr(Map<String, String> map) {
		dao.updatezwr(map);
	}

	public List<RegBusDyaq> findFdsjList(RegBusDyaq regBusDyaq) {
		return dao.findFdsjList(regBusDyaq);
	}
	
	public List<RegBusDyaq> findList(RegBusDyaq regBusDyaq) {
		return super.findList(regBusDyaq);
	}
	
	public List<RegBusDyaq> findListxf(RegBusDyaq regBusDyaq) {
		return super.findListxf(regBusDyaq);
	}
	
	public Page<RegBusDyaq> findPage(Page<RegBusDyaq> page, RegBusDyaq regBusDyaq) {
		return super.findPage(page, regBusDyaq);
	}
	
	@Transactional(readOnly = false)
	public void save(RegBusDyaq regBusDyaq) {
		//修改人员信息的状态为已引用
		if(StringUtils.isNotBlank(regBusDyaq.getZwr())){
			RegBasePerson regBasePerson = new RegBasePerson();
			regBasePerson.setZjh(regBusDyaq.getZwrzjh());
			regBasePerson.setZjzl(regBusDyaq.getZwrzjzl());
			List<RegBasePerson> findList = regBasePersonService.findList(regBasePerson);
			if(findList.size() > 0){
				regBasePerson = findList.get(0);
				regBasePerson.setIsaudit("2");
				regBasePersonService.save(regBasePerson);
			}
		}
		super.save(regBusDyaq);
	}
	
	@Transactional(readOnly = false)
	public void delete(RegBusDyaq regBusDyaq) {
		super.delete(regBusDyaq);
	}

	@Transactional(readOnly = false)
	public void deletexfdy(RegBusDyaq regBusDyaq) {
		super.deletexfdy(regBusDyaq);
	}

	public RegBusDyaq getQlxxByDyzmh(String string) {
		// TODO Auto-generated method stub
		return dao.getQlxxByDyzmh(string);
	}

	
}