package org.jeecg.modules.demo.hzz.shjsgc.lhgc.ql.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import io.netty.util.internal.StringUtil; import org.jeecg.modules.demo.hzz.shjsgc.dfgc.mapper.RmDfgcMapper; 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.ql.geo.service.impl.RmQlgeoServiceImpl; import org.jeecg.modules.demo.hzz.shjsgc.lhgc.ql.mapper.RmQlqktjbMapper; import org.jeecg.modules.demo.hzz.shjsgc.lhgc.ql.service.IRmQlqktjbService; 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-19 * @Version: V1.0 */ @Service public class RmQlqktjbServiceImpl extends ServiceImpl implements IRmQlqktjbService { @Autowired private RmQlgeoServiceImpl rmQlgeoService; @Autowired private org.jeecg.modules.demo.untils.zbzh zbzh; @Autowired private RmQlqktjbMapper rmQlqktjbMapper; @Override public void GenarateQlgcGeo() { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(RmQlqktjb::getFlag, 0); List dataList = this.baseMapper.selectList(queryWrapper); for (RmQlqktjb rmQlqktjb : dataList) { String a = rmQlqktjb.getJd(); String b = rmQlqktjb.getWd(); if (StringUtil.isNullOrEmpty(a) || StringUtil.isNullOrEmpty(b)) { continue; } Double jd = zbzh.tranformPos(a); Double wd = zbzh.tranformPos(b); if (jd > 180 && wd > 90) { rmQlgeoService.addqlgc("POINT(" + jd + " " + wd + ")", rmQlqktjb.getId()); } else { rmQlgeoService.addqlgc2("POINT(" + jd + " " + wd + ")", rmQlqktjb.getId()); } rmQlqktjb.setFlag(1); this.updateById(rmQlqktjb); } } @Override public void delete(String id) { try { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(RmQlgeo::getQlid, id); Integer qlgeoid = rmQlgeoService.getOne(queryWrapper).getId(); rmQlgeoService.removeById(qlgeoid); } 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) { rmQlqktjbMapper.insertshxm(id, xzqh, xmmc, xmid, xmlx, gldw, zgbm, bz, geoinfo, sfwpgblxm, szhl, spzt); } @Override public void deshxm(String id) { rmQlqktjbMapper.deshxm(id); } @Override public void updateshxm(String xmmc, String jszt, String gldw, String zgbm, String bz, String geoinfo, String sfwpgblxm, String szhl, String spzt, String id) { rmQlqktjbMapper.updateshxm(xmmc, jszt, gldw, zgbm, bz, geoinfo, sfwpgblxm, szhl, spzt, id); } @Override public int deleteMany(String[] ids) { return rmQlqktjbMapper.deleteMany(ids); } @Override public List selectid(String[] id) { List selectid = rmQlqktjbMapper.selectid(id); return selectid; } }