|
@@ -1,24 +1,18 @@
|
|
|
package com.onemap.apply.service.gdbh.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
-import com.onemap.apply.domain.config.fzss.FzxzFactorDTO;
|
|
|
-import com.onemap.apply.domain.config.fzss.HgxfxScxDTO;
|
|
|
-import com.onemap.apply.domain.gdbh.GdbhDto;
|
|
|
-import com.onemap.apply.domain.gdbh.GdbhMxDto;
|
|
|
-import com.onemap.apply.domain.gdbh.GdbhMxYzDto;
|
|
|
-import com.onemap.apply.domain.gdbh.GdbhYzDTO;
|
|
|
-import com.onemap.apply.mapper.gdbh.GdbhMapper;
|
|
|
-import com.onemap.apply.mapper.gdbh.GdbhMxMapper;
|
|
|
-import com.onemap.apply.mapper.gdbh.GdbhMxYzMapper;
|
|
|
-import com.onemap.apply.mapper.gdbh.GdbhYzMapper;
|
|
|
+import com.onemap.apply.domain.gdbh.*;
|
|
|
+import com.onemap.apply.mapper.gdbh.*;
|
|
|
import com.onemap.apply.service.gdbh.IGdbhService;
|
|
|
import com.onemap.common.core.utils.StringUtils;
|
|
|
import com.onemap.common.core.web.domain.RequestResult;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@Service
|
|
|
public class GdbhServiceImpl implements IGdbhService {
|
|
@@ -28,10 +22,15 @@ public class GdbhServiceImpl implements IGdbhService {
|
|
|
@Autowired
|
|
|
private GdbhMxYzMapper gdbhMxYzMapper;
|
|
|
@Autowired
|
|
|
+ private GdbhRwMxMapper gdbhRwMxMapper;
|
|
|
+ @Autowired
|
|
|
+ private GdbhRwMxYzMapper gdbhRwMxYzMapper;
|
|
|
+ @Autowired
|
|
|
private GdbhYzMapper gdbhYzMapper;
|
|
|
@Autowired
|
|
|
private GdbhMapper gdbhMapper;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private GdbhHandleService gdbhHandleService;
|
|
|
|
|
|
@Override
|
|
|
public RequestResult GetMxList(String param) {
|
|
@@ -40,13 +39,19 @@ public class GdbhServiceImpl implements IGdbhService {
|
|
|
gdbhWrapper.eq("status", 1);
|
|
|
gdbhWrapper.orderByAsc("xssx").orderByAsc("kzxjb");
|
|
|
List<GdbhMxDto> resGdbhMx = gdbhMxMapper.selectList(gdbhWrapper);
|
|
|
-
|
|
|
for (GdbhMxDto gdbhMx : resGdbhMx) {
|
|
|
QueryWrapper<GdbhMxYzDto> gdbhyzwrapper = new QueryWrapper<GdbhMxYzDto>();
|
|
|
gdbhyzwrapper.eq("status", 1);
|
|
|
gdbhyzwrapper.eq("mx_bsm", gdbhMx.getBsm());
|
|
|
List<GdbhMxYzDto> resGdbhyz = gdbhMxYzMapper.selectList(gdbhyzwrapper);
|
|
|
- gdbhMx.setGdbhMxYz(resGdbhyz);
|
|
|
+ List<GdbhYzDTO> resGdbhyzRet = new ArrayList<GdbhYzDTO>();
|
|
|
+ for (GdbhMxYzDto resGdbhyzObj : resGdbhyz) {
|
|
|
+ QueryWrapper<GdbhYzDTO> gdbhyz2wrapper = new QueryWrapper<GdbhYzDTO>();
|
|
|
+ gdbhyz2wrapper.eq("id", resGdbhyzObj.getBsm());
|
|
|
+ resGdbhyzRet.add(gdbhYzMapper.selectOne(gdbhyz2wrapper));
|
|
|
+ }
|
|
|
+// gdbhMx.setGdbhMxYz(resGdbhyz);
|
|
|
+ gdbhMx.setGdbhMxYzRet(resGdbhyzRet);
|
|
|
}
|
|
|
return RequestResult.success("查询成功", resGdbhMx);
|
|
|
} catch (Exception e) {
|
|
@@ -73,11 +78,32 @@ public class GdbhServiceImpl implements IGdbhService {
|
|
|
@Override
|
|
|
public RequestResult AddGdbh(GdbhDto gdbhDto) {
|
|
|
try {
|
|
|
- gdbhDto.setBsm(StringUtils.getUUID());
|
|
|
+ Map xzfw = gdbhMapper.selectGdbhXzfw(gdbhDto.getXzfw());
|
|
|
+ if (StringUtils.isEmpty(xzfw)) {
|
|
|
+ return RequestResult.error("选址范围参数为空");
|
|
|
+ }
|
|
|
+ Double area = Double.valueOf(xzfw.get("area").toString());
|
|
|
+ String ewkt = (String) xzfw.get("geom");
|
|
|
+ if (StringUtils.isEmpty(ewkt)) {
|
|
|
+ return RequestResult.error("选址范围参数为空");
|
|
|
+ }
|
|
|
+ String rebsm = StringUtils.getUUID();
|
|
|
+ gdbhDto.setGeom(ewkt);
|
|
|
+ gdbhDto.setXzmj(area);
|
|
|
+ gdbhDto.setBsm(rebsm);
|
|
|
gdbhDto.setStatus(1);
|
|
|
gdbhDto.setRwcjsj(new Date());
|
|
|
gdbhDto.setRwzt(0);
|
|
|
gdbhMapper.insert(gdbhDto);
|
|
|
+ for (GdbhRwMxDto mxDto : gdbhDto.getMxlist()) {
|
|
|
+ mxDto.setRwbsm(rebsm);
|
|
|
+ for (GdbhRwMxYzDto gdbhMxYz : mxDto.getGdbhMxYz()) {
|
|
|
+ gdbhMxYz.setRwbsm(rebsm);
|
|
|
+ gdbhRwMxYzMapper.insert(gdbhMxYz);
|
|
|
+ }
|
|
|
+ gdbhRwMxMapper.insert(mxDto);
|
|
|
+ }
|
|
|
+ gdbhHandleService.gdbhAnalysisHandle(gdbhDto);
|
|
|
return RequestResult.success("添加成功", 0);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|