package com.elephant.framework.galaxy.aroad.module.zhjc.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.elephant.framework.galaxy.aroad.module.zhjc.entity.ZhjcGhjhFghjdzb;
import com.elephant.framework.galaxy.aroad.module.zhjc.entity.ZhjcGhjhGhjdzb;
import com.elephant.framework.galaxy.aroad.module.zhjc.mapper.ZhjcGhjhFghjdzbMapper;
import com.elephant.framework.galaxy.aroad.module.zhjc.service.ZhjcGhjhFghjdzbService;
import com.elephant.framework.galaxy.aroad.module.zhjc.service.ZhjcGhjhGhjdzbService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.UUID;

/**
 * 智慧决策_规划计划_非规划阶段坐标表
 *
 * @author wangjian
 * @date 2019-05-23 19:00:32
 */
@Service
@AllArgsConstructor
public class ZhjcGhjhFghjdzbServiceImpl extends ServiceImpl<ZhjcGhjhFghjdzbMapper, ZhjcGhjhFghjdzb> implements ZhjcGhjhFghjdzbService {

    final ZhjcGhjhFghjdzbMapper zhjcGhjhFghjdzbMapper;
    final ZhjcGhjhGhjdzbService zhjcGhjhGhjdzbService;

    /**
     * 新增非规划阶段坐标
     * @return
     */
    public Boolean addFGhjdzb(ZhjcGhjhFghjdzb zhjcfGhjhGhjdzb) {
        zhjcfGhjhGhjdzb.setId(UUID.randomUUID().toString().replaceAll("-",""));
        String shape = zhjcGhjhGhjdzbService.shapeConversion(zhjcfGhjhGhjdzb.getGeomfeature());
        zhjcfGhjhGhjdzb.setGeomfeature(shape.substring(1, shape.length()-1));
        return zhjcGhjhFghjdzbMapper.insert(zhjcfGhjhGhjdzb)>0;
    }
}
