瀏覽代碼

合规性分析

LAPTOP-BJJ3IV5R\SIWEI 1 年之前
父節點
當前提交
2aeeb4ade1

+ 21 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/config/fzss/HgxfxDTO.java

@@ -1,12 +1,15 @@
 package com.onemap.apply.domain.config.fzss;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 
 import java.util.Date;
+import java.util.List;
 
 @TableName("t_fzss_hgxfx")
 public class HgxfxDTO {
     private String bsm;
+    private String xzfw;//选址范围
     private Double fxmj;
     private String xmmc;
     private String xmlx;
@@ -18,6 +21,8 @@ public class HgxfxDTO {
     private Date rwjssj;
     private String cjyh;
     private Date cjsj;
+    @TableField(exist = false)
+    private List<HgxfxScxRwDTO> scxList;
 
     public String getBsm() {
         return bsm;
@@ -27,6 +32,14 @@ public class HgxfxDTO {
         this.bsm = bsm;
     }
 
+    public String getXzfw() {
+        return xzfw;
+    }
+
+    public void setXzfw(String xzfw) {
+        this.xzfw = xzfw;
+    }
+
     public Double getFxmj() {
         return fxmj;
     }
@@ -114,4 +127,12 @@ public class HgxfxDTO {
     public void setCjsj(Date cjsj) {
         this.cjsj = cjsj;
     }
+
+    public List<HgxfxScxRwDTO> getScxList() {
+        return scxList;
+    }
+
+    public void setScxList(List<HgxfxScxRwDTO> scxList) {
+        this.scxList = scxList;
+    }
 }

+ 9 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/config/fzss/HgxfxScxDTO.java

@@ -12,6 +12,7 @@ public class HgxfxScxDTO {
     private Integer xssx;
     private String tjzd;
     private Integer status;
+    private String pbsm;
 
     public Integer getStatus() {
         return status;
@@ -76,4 +77,12 @@ public class HgxfxScxDTO {
     public void setTjzd(String tjzd) {
         this.tjzd = tjzd;
     }
+
+    public String getPbsm() {
+        return pbsm;
+    }
+
+    public void setPbsm(String pbsm) {
+        this.pbsm = pbsm;
+    }
 }

+ 55 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/config/fzss/HgxfxScxRwDTO.java

@@ -0,0 +1,55 @@
+package com.onemap.apply.domain.config.fzss;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.util.Date;
+
+//合规性审查项与分析任务对应关系表
+@TableName("t_fzss_hgxfx_scx_rw")
+public class HgxfxScxRwDTO {
+    private String bsm;
+    private String rwbsm;
+    private String scxbsm;
+    private Date rwkssj;
+    private Date rwjssj;
+
+    public String getBsm() {
+        return bsm;
+    }
+
+    public void setBsm(String bsm) {
+        this.bsm = bsm;
+    }
+
+    public String getRwbsm() {
+        return rwbsm;
+    }
+
+    public void setRwbsm(String rwbsm) {
+        this.rwbsm = rwbsm;
+    }
+
+    public String getScxbsm() {
+        return scxbsm;
+    }
+
+    public void setScxbsm(String scxbsm) {
+        this.scxbsm = scxbsm;
+    }
+
+    public Date getRwkssj() {
+        return rwkssj;
+    }
+
+    public void setRwkssj(Date rwkssj) {
+        this.rwkssj = rwkssj;
+    }
+
+    public Date getRwjssj() {
+        return rwjssj;
+    }
+
+    public void setRwjssj(Date rwjssj) {
+        this.rwjssj = rwjssj;
+    }
+}

+ 1 - 12
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/fzss/HgxfxMapper.java

@@ -14,17 +14,6 @@ import java.util.List;
  *
  * @author onemap
  */
-public interface HgxfxMapper extends BaseMapper<HgxfxScxDTO> {
-
+public interface HgxfxMapper extends BaseMapper<HgxfxDTO> {
     List<HgxfxDTO> GetPage(@Param("kssj") String kssj, @Param("jssj") String jssj, @Param("xmmc") String xmmc, @Param("username") String username);
-
-    List<HgxfxJcxsDTO> getJcxs(String bsm);
-
-    List<HgxfxFxtbDTO> getFxtb(String bsm);
-
-    void deleteResourceScx();
-
-    void unionResourceScx();
-
-    Integer getScrwCount();
 }

+ 19 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/fzss/HgxfxScxMapper.java

@@ -0,0 +1,19 @@
+package com.onemap.apply.mapper.fzss;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.onemap.apply.domain.config.fzss.HgxfxDTO;
+import com.onemap.apply.domain.config.fzss.HgxfxFxtbDTO;
+import com.onemap.apply.domain.config.fzss.HgxfxJcxsDTO;
+import com.onemap.apply.domain.config.fzss.HgxfxScxDTO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 数据层
+ *
+ * @author onemap
+ */
+public interface HgxfxScxMapper extends BaseMapper<HgxfxScxDTO> {
+
+}

+ 2 - 3
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/fzss/HgxfxEntityMapper.java → onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/fzss/HgxfxScxRwMapper.java

@@ -1,13 +1,12 @@
 package com.onemap.apply.mapper.fzss;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.onemap.apply.domain.config.fzss.HgxfxDTO;
+import com.onemap.apply.domain.config.fzss.HgxfxScxRwDTO;
 
 /**
  * 数据层
  *
  * @author onemap
  */
-public interface HgxfxEntityMapper extends BaseMapper<HgxfxDTO> {
-
+public interface HgxfxScxRwMapper extends BaseMapper<HgxfxScxRwDTO> {
 }

+ 9 - 5
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/fzss/IHgxfxService.java

@@ -8,13 +8,17 @@ import java.util.List;
 public interface IHgxfxService {
     RequestResult GetScxList(String param);
 
-    List<HgxfxDTO> GetPage(String kssj, String jssj, String xmmc);
+    RequestResult AddHgxfx(HgxfxDTO hgxfxDTO);
 
     RequestResult GetLog(String bsm);
 
-    RequestResult GetFxjg(String bsm);
+    List<HgxfxDTO> GetPage(String kssj, String jssj, String xmmc, String username);
+//
 
-    RequestResult DeleteFxjg(String bsm);
-
-    RequestResult UpdateScx(String params);
+//
+//    RequestResult GetFxjg(String bsm);
+//
+//    RequestResult DeleteFxjg(String bsm);
+//
+//    RequestResult UpdateScx(String params);
 }

+ 123 - 97
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/impl/fzss/HgxfxServiceImpl.java

@@ -9,7 +9,9 @@ import com.onemap.common.core.web.domain.RequestResult;
 import com.onemap.common.security.utils.SecurityUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
+import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -17,30 +19,22 @@ import java.util.Map;
 
 @Service
 public class HgxfxServiceImpl implements IHgxfxService {
-
     @Autowired
-    private HgxfxMapper hgxfxMapper;
+    private HgxfxScxMapper hgxfxScxMapper;
     @Autowired
-    private FxrwrzMapper fxrwrzMapper;
+    private HgxfxScxRwMapper hgxfxScxRwMapper;
     @Autowired
-    private HgxfxEntityMapper hgxfxEntityMapper;
-    @Autowired
-    private HgxfxHgscxMapper hgxfxHgscxMapper;
+    private HgxfxMapper hgxfxMapper;
     @Autowired
-    private HgxfxGisMapper hgxfxGisMapper;
-
+    private FxrwrzMapper fxrwrzMapper;
 
     @Override
     public RequestResult GetScxList(String param) {
         try {
             QueryWrapper<HgxfxScxDTO> wrapper = new QueryWrapper<HgxfxScxDTO>();
-            wrapper.gt("kzxjb", 0).eq("status", 1);
+            wrapper.ne("kzxjb", 2).eq("status", 1);
             wrapper.orderByAsc("kzxjb").orderByAsc("xssx");
-            String xzqh = SecurityUtils.getLoginUserXzq();
-            if (StringUtils.isNotEmpty(xzqh) && xzqh.length() > 4) {
-                wrapper.like("sjy", xzqh);
-            }
-            List<HgxfxScxDTO> res = hgxfxMapper.selectList(wrapper);
+            List<HgxfxScxDTO> res = hgxfxScxMapper.selectList(wrapper);
             return RequestResult.success("查询成功", res);
         } catch (Exception e) {
             e.printStackTrace();
@@ -49,10 +43,34 @@ public class HgxfxServiceImpl implements IHgxfxService {
     }
 
     @Override
-    public List<HgxfxDTO> GetPage(String kssj, String jssj, String xmmc) {
-        String username = SecurityUtils.getUsername();
-        List<HgxfxDTO> res = hgxfxMapper.GetPage(kssj, jssj, xmmc, username);
-        return res;
+    @Transactional(rollbackFor = Exception.class)
+    public RequestResult AddHgxfx(HgxfxDTO hgxfxDTO) {
+        if (StringUtils.isEmpty(hgxfxDTO.getXmmc())) {
+            return RequestResult.error("项目参数为空");
+        }
+        if (StringUtils.isEmpty(hgxfxDTO.getXzfw())) {
+            return RequestResult.error("选址范围参数为空");
+        }
+        if (StringUtils.isEmpty(hgxfxDTO.getScxList())) {
+            return RequestResult.error("分析因子为空");
+        }
+        //TODO 时间未添加
+//        hgxfxDTO.setCjsj(DatetimeU);
+        hgxfxDTO.setBsm(StringUtils.getUUID());
+        //合规性分析项目
+        hgxfxMapper.insert(hgxfxDTO);
+
+        //添加审查项
+        List<HgxfxScxRwDTO> scxList = hgxfxDTO.getScxList();
+        for (HgxfxScxRwDTO scxRw : scxList) {
+            if (StringUtils.isEmpty(scxRw.getScxbsm())) {
+                continue;
+            }
+            scxRw.setRwbsm(hgxfxDTO.getBsm());
+            scxRw.setBsm(StringUtils.getUUID());
+            hgxfxScxRwMapper.insert(scxRw);
+        }
+        return RequestResult.success(hgxfxDTO.getBsm());
     }
 
     @Override
@@ -73,86 +91,94 @@ public class HgxfxServiceImpl implements IHgxfxService {
     }
 
     @Override
-    public RequestResult GetFxjg(String bsm) {
-        if (StringUtils.isEmpty(bsm)) {
-            return RequestResult.error("标识码未传递!", null);
-        }
-        //任务详情信息
-        QueryWrapper<HgxfxDTO> wrapper = new QueryWrapper<HgxfxDTO>();
-        wrapper.eq("bsm", bsm);
-        HgxfxDTO entity = hgxfxEntityMapper.selectOne(wrapper);
-        if (entity == null) {
-            return RequestResult.error("检查任务不存在!", null);
-        }
-        //分析审查项相关信息
-        List<HgxfxJcxsDTO> jcxs = hgxfxMapper.getJcxs(bsm);
-        if (jcxs != null && jcxs.size() > 0) {
-            for (HgxfxJcxsDTO jcx : jcxs) {
-                QueryWrapper<HgxfxGisDTO> query = new QueryWrapper<HgxfxGisDTO>();
-                query.eq("scxbsm", jcx.getBsm()).orderByDesc("yzmj");
-                List<HgxfxGisDTO> gis = hgxfxGisMapper.selectList(query);
-                if (gis != null && gis.size() > 0) {
-                    jcx.setJgs(gis);
-                }
-            }
-        } else {
-            jcxs = new ArrayList<>();
-        }
-        //现状数据组织
-        //现状审查项是否为空
-        QueryWrapper<HgxfxScxDTO> scx = new QueryWrapper();
-        scx.eq("kzxjb", 0);
-        HgxfxScxDTO xzscx = hgxfxMapper.selectOne(scx);
-        List<HgxfxFxtbDTO> fxtb = new ArrayList<>();
-        if (xzscx != null) {
-            fxtb = hgxfxMapper.getFxtb(bsm);
-        }
-        Map<String, Object> result = new HashMap<>();
-        result.put("task", entity);//任务相关信息
-        result.put("jcxs", jcxs);//检查项集合
-        result.put("fxtb", fxtb);//分析结果图斑信息
-        return RequestResult.success("查询成功", result);
+    public List<HgxfxDTO> GetPage(String kssj, String jssj, String xmmc,String username) {
+        List<HgxfxDTO> res = hgxfxMapper.GetPage(kssj, jssj, xmmc, username);
+        return res;
     }
 
-    @Override
-    public RequestResult DeleteFxjg(String bsm) {
-        QueryWrapper<HgxfxDTO> wrapper = new QueryWrapper<HgxfxDTO>();
-        wrapper.eq("bsm", bsm);
-        hgxfxEntityMapper.delete(wrapper);
-        //分析因子表
-        QueryWrapper<HgxfxHgscxDTO> wrapper1 = new QueryWrapper<HgxfxHgscxDTO>();
-        wrapper1.eq("rwbsm", bsm);
-        hgxfxHgscxMapper.delete(wrapper1);
-        //分析范围sde表
-        QueryWrapper<HgxfxGisDTO> wrapper4 = new QueryWrapper<HgxfxGisDTO>();
-        wrapper4.eq("rwbsm", bsm);
-        hgxfxGisMapper.delete(wrapper4);
-//        QueryWrapper<HgxfxRwGisDTO> wrapper2 = new QueryWrapper<HgxfxRwGisDTO>();
-//        wrapper2.eq("rwbsm", bsm);
-//        hgxfxRwGisMapper.delete(wrapper2);
-        //分析日志
-        QueryWrapper<FxrwrzDTO> wrapper3 = new QueryWrapper<FxrwrzDTO>();
-        wrapper3.eq("rwbsm", bsm);
-        fxrwrzMapper.delete(wrapper3);
-        return RequestResult.success("删除成功", 1);
-    }
 
-    @Override
-    public RequestResult UpdateScx(String params) {
-        try {
-            //检查是否有未执行或者执行中的审查任务
-            Integer count = hgxfxMapper.getScrwCount();
-            if (count > 0) {
-                return RequestResult.error("有未执行或者执行中的审查任务,请稍后再试!");
-            }
-            //删除已有资源目录审查因子项
-            hgxfxMapper.deleteResourceScx();
-            //关联资源目录扩展审查因子项
-            hgxfxMapper.unionResourceScx();
-            return RequestResult.success("关联成功");
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return RequestResult.error("关联失败");
-    }
+//
+//    @Override
+//    public RequestResult GetFxjg(String bsm) {
+//        if (StringUtils.isEmpty(bsm)) {
+//            return RequestResult.error("标识码未传递!", null);
+//        }
+//        //任务详情信息
+//        QueryWrapper<HgxfxDTO> wrapper = new QueryWrapper<HgxfxDTO>();
+//        wrapper.eq("bsm", bsm);
+//        HgxfxDTO entity = hgxfxEntityMapper.selectOne(wrapper);
+//        if (entity == null) {
+//            return RequestResult.error("检查任务不存在!", null);
+//        }
+//        //分析审查项相关信息
+//        List<HgxfxJcxsDTO> jcxs = hgxfxMapper.getJcxs(bsm);
+//        if (jcxs != null && jcxs.size() > 0) {
+//            for (HgxfxJcxsDTO jcx : jcxs) {
+//                QueryWrapper<HgxfxGisDTO> query = new QueryWrapper<HgxfxGisDTO>();
+//                query.eq("scxbsm", jcx.getBsm()).orderByDesc("yzmj");
+//                List<HgxfxGisDTO> gis = hgxfxGisMapper.selectList(query);
+//                if (gis != null && gis.size() > 0) {
+//                    jcx.setJgs(gis);
+//                }
+//            }
+//        } else {
+//            jcxs = new ArrayList<>();
+//        }
+//        //现状数据组织
+//        //现状审查项是否为空
+//        QueryWrapper<HgxfxScxDTO> scx = new QueryWrapper();
+//        scx.eq("kzxjb", 0);
+//        HgxfxScxDTO xzscx = hgxfxMapper.selectOne(scx);
+//        List<HgxfxFxtbDTO> fxtb = new ArrayList<>();
+//        if (xzscx != null) {
+//            fxtb = hgxfxMapper.getFxtb(bsm);
+//        }
+//        Map<String, Object> result = new HashMap<>();
+//        result.put("task", entity);//任务相关信息
+//        result.put("jcxs", jcxs);//检查项集合
+//        result.put("fxtb", fxtb);//分析结果图斑信息
+//        return RequestResult.success("查询成功", result);
+//    }
+//
+//    @Override
+//    public RequestResult DeleteFxjg(String bsm) {
+//        QueryWrapper<HgxfxDTO> wrapper = new QueryWrapper<HgxfxDTO>();
+//        wrapper.eq("bsm", bsm);
+//        hgxfxEntityMapper.delete(wrapper);
+//        //分析因子表
+//        QueryWrapper<HgxfxHgscxDTO> wrapper1 = new QueryWrapper<HgxfxHgscxDTO>();
+//        wrapper1.eq("rwbsm", bsm);
+//        hgxfxHgscxMapper.delete(wrapper1);
+//        //分析范围sde表
+//        QueryWrapper<HgxfxGisDTO> wrapper4 = new QueryWrapper<HgxfxGisDTO>();
+//        wrapper4.eq("rwbsm", bsm);
+//        hgxfxGisMapper.delete(wrapper4);
+////        QueryWrapper<HgxfxRwGisDTO> wrapper2 = new QueryWrapper<HgxfxRwGisDTO>();
+////        wrapper2.eq("rwbsm", bsm);
+////        hgxfxRwGisMapper.delete(wrapper2);
+//        //分析日志
+//        QueryWrapper<FxrwrzDTO> wrapper3 = new QueryWrapper<FxrwrzDTO>();
+//        wrapper3.eq("rwbsm", bsm);
+//        fxrwrzMapper.delete(wrapper3);
+//        return RequestResult.success("删除成功", 1);
+//    }
+//
+//    @Override
+//    public RequestResult UpdateScx(String params) {
+//        try {
+//            //检查是否有未执行或者执行中的审查任务
+//            Integer count = hgxfxMapper.getScrwCount();
+//            if (count > 0) {
+//                return RequestResult.error("有未执行或者执行中的审查任务,请稍后再试!");
+//            }
+//            //删除已有资源目录审查因子项
+//            hgxfxMapper.deleteResourceScx();
+//            //关联资源目录扩展审查因子项
+//            hgxfxMapper.unionResourceScx();
+//            return RequestResult.success("关联成功");
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//        return RequestResult.error("关联失败");
+//    }
 }

+ 1 - 1
onemap-modules/onemap-apply/src/main/resources/mapper/oracle/fzss/HgxfxMapper.xml

@@ -5,7 +5,7 @@
 <mapper namespace="com.onemap.apply.mapper.fzss.HgxfxMapper">
 
 
-    <select id="GetPage" parameterType="java.lang.String" resultType="com.onemap.apply.domain.config.fzss.HgxfxDTO">
+    <select id="GetPage" resultType="com.onemap.apply.domain.config.fzss.HgxfxDTO">
         select t.bsm as "bsm",
         t.fxmj as "fxmj",
         t.xmmc as "xmmc",