f2dc71ee53508fd0ac65672793fd5dc49e2ac36c.svn-base 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. package org.jeecg.modules.demo.hzz.shjsgc.lhgc.sz.service.impl;
  2. import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  3. import org.jeecg.modules.demo.hzz.shjsgc.bzgc.geo.entity.RmBzgcgeo;
  4. import org.jeecg.modules.demo.hzz.shjsgc.lhgc.ql.entity.RmQlqktjb;
  5. import org.jeecg.modules.demo.hzz.shjsgc.lhgc.ql.geo.service.impl.RmQlgeoServiceImpl;
  6. import org.jeecg.modules.demo.hzz.shjsgc.lhgc.sz.entity.RmSzqktjb;
  7. import org.jeecg.modules.demo.hzz.shjsgc.lhgc.sz.geo.entity.RmSzgeo;
  8. import org.jeecg.modules.demo.hzz.shjsgc.lhgc.sz.geo.service.impl.RmSzgeoServiceImpl;
  9. import org.jeecg.modules.demo.hzz.shjsgc.lhgc.sz.mapper.RmSzqktjbMapper;
  10. import org.jeecg.modules.demo.hzz.shjsgc.lhgc.sz.service.IRmSzqktjbService;
  11. import org.jeecg.modules.demo.untils.zbzh;
  12. import org.springframework.beans.factory.annotation.Autowired;
  13. import org.springframework.stereotype.Service;
  14. import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  15. import java.util.List;
  16. /**
  17. * @Description: 水闸
  18. * @Author: jeecg-boot
  19. * @Date: 2022-01-20
  20. * @Version: V1.0
  21. */
  22. @Service
  23. public class RmSzqktjbServiceImpl extends ServiceImpl<RmSzqktjbMapper, RmSzqktjb> implements IRmSzqktjbService {
  24. @Autowired
  25. private RmSzgeoServiceImpl rmSzgeoService;
  26. @Autowired
  27. private RmSzqktjbMapper rmSzqktjbMapper;
  28. @Autowired
  29. private zbzh zbzh;
  30. @Override
  31. public void GenarateSzgcGeo() {
  32. LambdaQueryWrapper<RmSzqktjb> queryWrapper = new LambdaQueryWrapper<>();
  33. queryWrapper.eq(RmSzqktjb::getFlag, 0);
  34. List<RmSzqktjb> dataList = this.baseMapper.selectList(queryWrapper);
  35. for (RmSzqktjb rmSzqktjb : dataList) {
  36. String a = rmSzqktjb.getJd();
  37. String b = rmSzqktjb.getWd();
  38. if (a != null && b != null) {
  39. Double jd = zbzh.tranformPos(a);
  40. Double wd = zbzh.tranformPos(b);
  41. if (jd > 180 && wd > 90) {
  42. rmSzgeoService.addszgc("POINT(" + jd + " " + wd + ")", rmSzqktjb.getId());
  43. } else {
  44. rmSzgeoService.addszgc2("POINT(" + jd + " " + wd + ")", rmSzqktjb.getId());
  45. }
  46. }
  47. rmSzqktjb.setFlag(1);
  48. this.updateById(rmSzqktjb);
  49. }
  50. }
  51. @Override
  52. public void delete(String id) {
  53. try {
  54. LambdaQueryWrapper<RmSzgeo> queryWrapper = new LambdaQueryWrapper<>();
  55. queryWrapper.eq(RmSzgeo::getSzid, id);
  56. Integer bzgeoid = rmSzgeoService.getOne(queryWrapper).getId();
  57. rmSzgeoService.removeById(bzgeoid);
  58. } catch (Exception e) {
  59. }
  60. }
  61. @Override
  62. 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) {
  63. rmSzqktjbMapper.insertshxm(id, xzqh, xmmc, xmid, xmlx, gldw, zgbm, bz, geoinfo, sfwpgblxm, szhl, spzt);
  64. }
  65. @Override
  66. public void deshxm(String xmid) {
  67. rmSzqktjbMapper.deshxm(xmid);
  68. }
  69. @Override
  70. public void updateshxm(String xmmc, String xzqh, String gldw, String zgbm, String bz, String geoinfo, String sfwpgblxm, String szhl, String spzt, String id) {
  71. rmSzqktjbMapper.updateshxm(xmmc, xzqh, gldw, zgbm, bz, geoinfo, sfwpgblxm, szhl, spzt, id);
  72. }
  73. @Override
  74. public int deleteMany(String[] ids) {
  75. return rmSzqktjbMapper.deleteMany(ids);
  76. }
  77. }