package org.jeecg.modules.demo.hzz.shjsgc.lhgc.sz.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.jeecg.modules.demo.hzz.shjsgc.bzgc.geo.entity.RmBzgcgeo; import org.jeecg.modules.demo.hzz.shjsgc.lhgc.ql.entity.RmQlqktjb; import org.jeecg.modules.demo.hzz.shjsgc.lhgc.ql.geo.service.impl.RmQlgeoServiceImpl; import org.jeecg.modules.demo.hzz.shjsgc.lhgc.sz.entity.RmSzqktjb; import org.jeecg.modules.demo.hzz.shjsgc.lhgc.sz.geo.entity.RmSzgeo; import org.jeecg.modules.demo.hzz.shjsgc.lhgc.sz.geo.service.impl.RmSzgeoServiceImpl; import org.jeecg.modules.demo.hzz.shjsgc.lhgc.sz.mapper.RmSzqktjbMapper; import org.jeecg.modules.demo.hzz.shjsgc.lhgc.sz.service.IRmSzqktjbService; 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-20 * @Version: V1.0 */ @Service public class RmSzqktjbServiceImpl extends ServiceImpl implements IRmSzqktjbService { @Autowired private RmSzgeoServiceImpl rmSzgeoService; @Autowired private RmSzqktjbMapper rmSzqktjbMapper; @Autowired private zbzh zbzh; @Override public void GenarateSzgcGeo() { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(RmSzqktjb::getFlag, 0); List dataList = this.baseMapper.selectList(queryWrapper); for (RmSzqktjb rmSzqktjb : dataList) { String a = rmSzqktjb.getJd(); String b = rmSzqktjb.getWd(); if (a != null && b != null) { Double jd = zbzh.tranformPos(a); Double wd = zbzh.tranformPos(b); if (jd > 180 && wd > 90) { rmSzgeoService.addszgc("POINT(" + jd + " " + wd + ")", rmSzqktjb.getId()); } else { rmSzgeoService.addszgc2("POINT(" + jd + " " + wd + ")", rmSzqktjb.getId()); } } rmSzqktjb.setFlag(1); this.updateById(rmSzqktjb); } } @Override public void delete(String id) { try { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(RmSzgeo::getSzid, id); Integer bzgeoid = rmSzgeoService.getOne(queryWrapper).getId(); rmSzgeoService.removeById(bzgeoid); } 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) { rmSzqktjbMapper.insertshxm(id, xzqh, xmmc, xmid, xmlx, gldw, zgbm, bz, geoinfo, sfwpgblxm, szhl, spzt); } @Override public void deshxm(String xmid) { rmSzqktjbMapper.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) { rmSzqktjbMapper.updateshxm(xmmc, xzqh, gldw, zgbm, bz, geoinfo, sfwpgblxm, szhl, spzt, id); } @Override public int deleteMany(String[] ids) { return rmSzqktjbMapper.deleteMany(ids); } }