package com.mosty.wzzx.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mosty.base.model.entity.wzzx.TbWzSblswz;
import com.mosty.base.model.entity.wzzx.TbWzSbsswz;
import com.mosty.base.utils.JtsUtils;
import com.mosty.wzzx.mapper.TbWzSblswzMapper;
import com.mosty.wzzx.service.TbWzSblswzService;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;


@Service
public class TbWzSblswzServiceImpl extends ServiceImpl<TbWzSblswzMapper, TbWzSblswz>
        implements TbWzSblswzService {

    public void saveSblswz(TbWzSbsswz sbsswz) {
        if (ObjectUtils.isNotEmpty(sbsswz)) {
            TbWzSblswz wz = new TbWzSblswz();
            BeanUtils.copyProperties(sbsswz, wz);
            wz.setZb(JtsUtils.getPoint(wz.getJd(), wz.getWd()));
            this.baseMapper.insertEntity(wz);
        }
    }
}
