|
@@ -0,0 +1,126 @@
|
|
|
+package com.onemap.apply.service.gdbh.impl;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.onemap.apply.domain.gdbh.*;
|
|
|
+import com.onemap.apply.mapper.gdbh.TGdbhJctbFileMapper;
|
|
|
+import com.onemap.apply.mapper.gdbh.TGdbhJctbMapper;
|
|
|
+import com.onemap.apply.mapper.gdbh.TGdbhYjjbntMapper;
|
|
|
+import com.onemap.apply.mapper.gdbh.TGdbhYjjbntServerMapper;
|
|
|
+import com.onemap.apply.service.gdbh.ITGdbhJctbService;
|
|
|
+import com.onemap.apply.service.gdbh.ITGdbhYjjbntService;
|
|
|
+import com.onemap.common.core.utils.DateUtils;
|
|
|
+import com.onemap.common.core.web.domain.RequestResult;
|
|
|
+import com.onemap.system.api.RemoteFileService;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.io.File;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 耕地保护-永久基本农田Service业务层处理
|
|
|
+ *
|
|
|
+ * @author ruoyi
|
|
|
+ * @date 2024-11-26
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class TGdbhYjjbntServiceImpl implements ITGdbhYjjbntService {
|
|
|
+ @Resource
|
|
|
+ private TGdbhYjjbntServerMapper tGdbhYjjbntServerMapper;
|
|
|
+ @Resource
|
|
|
+ private TGdbhYjjbntMapper tGdbhYjjbntMapper;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<TGdbhYjjbntServerDTO> selectTGdbhYjjbntServerList(TGdbhYjjbntServerDTO tGdbhYjjbntServer) {
|
|
|
+ return tGdbhYjjbntServerMapper.selectTGdbhYjjbntServerList(tGdbhYjjbntServer);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> ntzllist(String yaer, String xzqhdm, String dlbm) {
|
|
|
+ TGdbhYjjbntServerDTO d0_tGdbhYjjbntServer = new TGdbhYjjbntServerDTO();
|
|
|
+ d0_tGdbhYjjbntServer.setYear(yaer);
|
|
|
+ List<TGdbhYjjbntServerDTO> d1 = selectTGdbhYjjbntServerList(d0_tGdbhYjjbntServer);
|
|
|
+ if (d1 == null || d1.size() == 0) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ TGdbhYjjbntServerDTO d2 = d1.get(0);
|
|
|
+ String areacolumn = d2.getAreaColumn();
|
|
|
+ String sjy = d2.getSjy();
|
|
|
+ Map<String, Object> retMap = tGdbhYjjbntMapper.ntzl(sjy, areacolumn, yaer, xzqhdm, dlbm);
|
|
|
+ return retMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<Map<String, Object>> ntzlfl(String yaer, String xzqhdm, String dlbm) {
|
|
|
+ TGdbhYjjbntServerDTO d0_tGdbhYjjbntServer = new TGdbhYjjbntServerDTO();
|
|
|
+ d0_tGdbhYjjbntServer.setYear(yaer);
|
|
|
+ List<TGdbhYjjbntServerDTO> d1 = selectTGdbhYjjbntServerList(d0_tGdbhYjjbntServer);
|
|
|
+ if (d1 == null || d1.size() == 0) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ TGdbhYjjbntServerDTO d2 = d1.get(0);
|
|
|
+ String areacolumn = d2.getAreaColumn();
|
|
|
+ String sjy = d2.getSjy();
|
|
|
+ List<Map<String, Object>> retMap = tGdbhYjjbntMapper.ntzlfl(sjy, areacolumn, yaer, xzqhdm, dlbm);
|
|
|
+ return retMap;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> ntzlbhqk(String sourceyaer, String targetyaer, String xzqhdm, String dlbm) {
|
|
|
+ Map<String, Object> d0old = ntzllist(sourceyaer, xzqhdm, dlbm);
|
|
|
+ Map<String, Object> d1new = ntzllist(targetyaer, xzqhdm, dlbm);
|
|
|
+ BigDecimal d0_mj_m = (BigDecimal) d0old.get("mj_m");
|
|
|
+ Long d0_gs = (Long) d0old.get("gs");
|
|
|
+ BigDecimal d0_mj = (BigDecimal) d0old.get("mj");
|
|
|
+ BigDecimal d0_mj_gq = (BigDecimal) d0old.get("mj_gq");
|
|
|
+ BigDecimal d0_mj_qm = (BigDecimal) d0old.get("mj_qm");
|
|
|
+ BigDecimal d1_mj_m = (BigDecimal) d1new.get("mj_m");
|
|
|
+ Long d1_gs = (Long) d1new.get("gs");
|
|
|
+ BigDecimal d1_mj = (BigDecimal) d1new.get("mj");
|
|
|
+ BigDecimal d1_mj_gq = (BigDecimal) d1new.get("mj_gq");
|
|
|
+ BigDecimal d1_mj_qm = (BigDecimal) d1new.get("mj_qm");
|
|
|
+ Map<String, Object> retMap = new HashMap<>();
|
|
|
+ retMap.put("mj_m", d0_mj_m.subtract(d1_mj_m));
|
|
|
+ retMap.put("d1_gs", d0_gs - d1_gs);
|
|
|
+ retMap.put("d1_mj", d0_mj.subtract(d1_mj));
|
|
|
+ retMap.put("d1_mj_gq", d0_mj_gq.subtract(d1_mj_gq));
|
|
|
+ retMap.put("d1_mj_qm", d0_mj_qm.subtract(d1_mj_qm));
|
|
|
+ retMap.put("mjbh", d0_mj_m.subtract(d1_mj_m).divide(d0_mj_m, 2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ return retMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<Map<String, Object>> ntzllnbhqk(String xzqhdm, String dlbm) {
|
|
|
+ TGdbhYjjbntServerDTO d0_tGdbhYjjbntServer = new TGdbhYjjbntServerDTO();
|
|
|
+ List<TGdbhYjjbntServerDTO> d1 = selectTGdbhYjjbntServerList(d0_tGdbhYjjbntServer);
|
|
|
+ if (d1 == null || d1.size() == 0) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ List<Map<String, Object>> retList = new ArrayList<>();
|
|
|
+
|
|
|
+ for (int i = 0; i < d1.size(); i++) {
|
|
|
+ if (i > 0) {
|
|
|
+ Map<String, Object> d3map = ntzlbhqk(d1.get(i).getYear(), d1.get(i - 1).getYear(), xzqhdm, dlbm);
|
|
|
+ d3map.put("year", d1.get(i - 1).getYear());
|
|
|
+ retList.add(d3map);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, Object> d4map = new HashMap<>();
|
|
|
+ d4map.put("mj_m", 0);
|
|
|
+ d4map.put("d1_gs", 0);
|
|
|
+ d4map.put("d1_mj", 0);
|
|
|
+ d4map.put("d1_mj_gq", 0);
|
|
|
+ d4map.put("d1_mj_qm", 0);
|
|
|
+ d4map.put("mjbh", 0);
|
|
|
+ d4map.put("year", d1.get(d1.size() - 1).getYear());
|
|
|
+ retList.add(d4map);
|
|
|
+ return retList;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|