/**
* 文件：AreaServiceImpl.java
* 版本：1.0.0
* 日期：
* Copyright &reg; 
* All right reserved.
*/

package com.mortals.xhx.base.system.area.service.impl;

import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import org.springframework.stereotype.Service;

import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.base.system.area.dao.AreaDao;
import com.mortals.xhx.base.system.area.model.AreaEntity;
import com.mortals.xhx.base.system.area.service.AreaService;

/**
 * <p>Title: 区域信息</p>
 * <p>Description: AreaServiceImpl service接口 </p>
 * <p>Copyright: Copyright &reg;  </p>
 * <p>Company: </p>
 * @author 
 * @version 1.0.0
 */
@Service("areaService")
public class AreaServiceImpl extends AbstractCRUDCacheServiceImpl<AreaDao,AreaEntity,Long> implements AreaService {



    /**
     * 格式化区域ID
     * @param areaId
     * @return
     */
    @Override
    public Long formatAreaId(Long areaId) {



        Long id = areaId;
        if(id != null){
            String area = String.valueOf(id);
            if(area.endsWith("00")){
                area = area.substring(0, 4);
            }
            if(area.endsWith("00")){
                area = area.substring(0, 2);
            }
            id = (Long.valueOf(area));
        }
        return id;
    }
	
	
}