package org.jeecg.modules.demo.hzz.shjsgc.lhgc.lhb.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.jeecg.modules.demo.hzz.shjsgc.lhgc.lhb.entity.RmLhbqktjb; import org.jeecg.modules.demo.hzz.shjsgc.lhgc.lhb.geo.entity.RmLhbgeo; import org.jeecg.modules.demo.hzz.shjsgc.lhgc.lhb.geo.service.IRmLhbgeoService; import org.jeecg.modules.demo.hzz.shjsgc.lhgc.lhb.mapper.RmLhbqktjbMapper; import org.jeecg.modules.demo.hzz.shjsgc.lhgc.lhb.service.IRmLhbqktjbService; import org.jeecg.modules.demo.hzz.shjsgc.lhgc.ql.entity.RmQlqktjb; import org.jeecg.modules.demo.hzz.shjsgc.lhgc.ql.geo.entity.RmQlgeo; import org.jeecg.modules.demo.hzz.shjsgc.lhgc.sz.geo.service.IRmSzgeoService; import org.jeecg.modules.demo.untils.zbzh; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import java.util.List; /** * @Description: 拦河坝 * @Author: jeecg-boot * @Date: 2022-01-18 * @Version: V1.0 */ @Service public class RmLhbqktjbServiceImpl extends ServiceImpl implements IRmLhbqktjbService { @Autowired private IRmLhbgeoService rmLhbgeoService; @Autowired private RmLhbqktjbMapper rmLhbqktjbMapper; @Autowired private org.jeecg.modules.demo.untils.zbzh zbzh; @Override public void GenaratelhbgcGeo() { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(RmLhbqktjb::getFlag, 0); List dataList = this.baseMapper.selectList(queryWrapper); for (RmLhbqktjb rmLhbqktjb : dataList) { String a = rmLhbqktjb.getJd(); String b = rmLhbqktjb.getWd(); if (a != null && b != null) { Double jd = zbzh.tranformPos(a); Double wd = zbzh.tranformPos(b); if (jd > 180 && wd > 90) { rmLhbgeoService.addlhbgc("POINT(" + jd + " " + wd + ")", rmLhbqktjb.getId()); } else { rmLhbgeoService.addlhbgc2("POINT(" + jd + " " + wd + ")", rmLhbqktjb.getId()); } rmLhbqktjb.setFlag(1); this.updateById(rmLhbqktjb); } } } @Override public void delete(String id) { try { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(RmLhbgeo::getLhbid, id); Integer lhbgeoid = rmLhbgeoService.getOne(queryWrapper).getId(); rmLhbgeoService.removeById(lhbgeoid); } catch (Exception e) { } } @Override public void insertshxm(String id, String xzqh, String xmmc, String xmid, String xmlx, String gldw, String zgbm, String bz, String geoinfo, String sfwpgblxm, String szhl, String spzt) { rmLhbqktjbMapper.insertshxm(id, xzqh, xmmc, xmid, xmlx, gldw, zgbm, bz, geoinfo, sfwpgblxm, szhl, spzt); } @Override public void deshxm(String xmid) { rmLhbqktjbMapper.deshxm(xmid); } @Override public void updateshxm(String xmmc, String xzqh, String gldw, String zgbm, String bz, String geoinfo, String sfwpgblxm, String szhl, String spzt, String id) { rmLhbqktjbMapper.updateshxm(xmmc, xzqh, gldw, zgbm, bz, geoinfo, sfwpgblxm, szhl, spzt, id); } @Override public int deleteMany(String[] ids) { return rmLhbqktjbMapper.deleteMany(ids); } }