浏览代码

Merge branch 'dev'

gushoubang 10 月之前
父节点
当前提交
5c9334c27e
共有 20 个文件被更改,包括 381 次插入94 次删除
  1. 42 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/controller/fcfh/FcfhController.java
  2. 0 9
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/controller/jsc/JscController.java
  3. 35 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/fcfh/HouseDTO.java
  4. 10 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/fcfh/FcfhMapper.java
  5. 0 1
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/fxpj/TGhwbMapper.java
  6. 2 2
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/jsc/JscMapper.java
  7. 3 3
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/jsc/provider/JscSqlProvider.java
  8. 12 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/fcfh/FcfhService.java
  9. 84 0
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/impl/fcfh/FcfhServiceImpl.java
  10. 0 2
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/impl/jsc/JscServiceImpl.java
  11. 4 5
      onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/jsc/JscService.java
  12. 29 0
      onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/fcfh/GdMapper.xml
  13. 9 16
      onemap-modules/onemap-system/src/main/java/com/onemap/system/controller/TJscSqlController.java
  14. 13 0
      onemap-modules/onemap-system/src/main/java/com/onemap/system/domain/TJscSql.java
  15. 15 9
      onemap-modules/onemap-system/src/main/java/com/onemap/system/mapper/TJscSqlMapper.java
  16. 9 9
      onemap-modules/onemap-system/src/main/java/com/onemap/system/service/ITJscSqlService.java
  17. 36 23
      onemap-modules/onemap-system/src/main/java/com/onemap/system/service/impl/TJscSqlServiceImpl.java
  18. 16 3
      onemap-modules/onemap-system/src/main/resources/mapper/postgresql/system/TJscSqlMapper.xml
  19. 46 0
      sql/pgsql/0_init.sql
  20. 16 12
      sql/pgsql/t_jsc_sql.sql

+ 42 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/controller/fcfh/FcfhController.java

@@ -0,0 +1,42 @@
+package com.onemap.apply.controller.fcfh;
+
+import com.onemap.apply.domain.fcfh.HouseDTO;
+import com.onemap.apply.service.fcfh.FcfhService;
+import com.onemap.common.core.web.domain.RequestResult;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.io.IOException;
+
+@RestController
+@RequestMapping("fcfh")
+public class FcfhController {
+    @Autowired
+    FcfhService fcfhService;
+
+    /**
+     * 通过excel插入全部的住户数据
+     *
+     * @return
+     * @throws IOException
+     */
+    @GetMapping("/AddHouseInfo")
+    public RequestResult AddList() throws IOException {
+        RequestResult requestResult = fcfhService.insertData();
+        return requestResult;
+    }
+
+    @GetMapping("/GetHouseInfo")
+    public RequestResult GetList(@Valid @NotNull String id) {
+        HouseDTO houseDTO = fcfhService.getById(id);
+        if (houseDTO == null) {
+            return RequestResult.error("查询失败");
+        }
+        return RequestResult.success("查询成功", houseDTO);
+    }
+}

+ 0 - 9
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/controller/jsc/JscController.java

@@ -1,21 +1,12 @@
 package com.onemap.apply.controller.jsc;
 
-import com.onemap.apply.domain.zbmx.TZbmxZbxDTO;
-import com.onemap.apply.domain.zbmx.vo.ZbmxZbxQueryByZbbhVo;
-import com.onemap.apply.mapper.jsc.JscMapper;
 import com.onemap.apply.service.jsc.JscService;
 import com.onemap.common.core.web.controller.BaseController;
 import com.onemap.common.core.web.domain.RequestResult;
-import com.onemap.common.core.web.page.RecordTableDataInfo;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
 /**
  * 功能菜单 驾驶舱
  *

+ 35 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/domain/fcfh/HouseDTO.java

@@ -0,0 +1,35 @@
+package com.onemap.apply.domain.fcfh;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+// 分层分户房屋信息
+@TableName("t_yzt_house")
+@Data
+public class HouseDTO {
+    private String id;
+    // 小区名称
+    private String community;
+    // 栋
+    private String building;
+    // 楼层
+    private Integer floor;
+    // 房间
+    private String room;
+    // 权利人,住户名称
+    @TableField(value = "resident_name")
+    private String residentName;
+    // 证件号,身份证/军官证/营业执照
+    @TableField(value = "id_number")
+    private String idNumber;
+    // 套内面积
+    @TableField(value = "inner_area")
+    private Float innerArea;
+    // 证书号
+    @TableField(value = "certificate_number")
+    private String certificateNumber;
+    // 房号
+    @TableField(value = "room_info")
+    private String roomInfo;
+}

+ 10 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/fcfh/FcfhMapper.java

@@ -0,0 +1,10 @@
+package com.onemap.apply.mapper.fcfh;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.onemap.apply.domain.fcfh.HouseDTO;
+
+public interface FcfhMapper extends BaseMapper<HouseDTO> {
+    HouseDTO getById(String id);
+
+    void delAll();
+}

+ 0 - 1
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/fxpj/TGhwbMapper.java

@@ -11,6 +11,5 @@ import java.util.List;
  */
 @Mapper
 public interface TGhwbMapper extends BaseMapper<TGhwbDo> {
-
     List<TGhwbDo> selectByYsdm(String str);
 }

+ 2 - 2
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/jsc/JscMapper.java

@@ -1,6 +1,6 @@
 package com.onemap.apply.mapper.jsc;
 
-import com.onemap.apply.mapper.jsc.provider.JscrSqlProvider;
+import com.onemap.apply.mapper.jsc.provider.JscSqlProvider;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.SelectProvider;
 
@@ -14,7 +14,7 @@ import java.util.Map;
 @Mapper
 public interface JscMapper {
 
-    @SelectProvider(value = JscrSqlProvider.class, method = "getSqlListByMap")
+    @SelectProvider(value = JscSqlProvider.class, method = "getSqlListByMap")
     public List<Map<String, Object>> getBeanListByEntity(Map<String, Object> map);
 
 }

+ 3 - 3
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/jsc/provider/JscrSqlProvider.java → onemap-modules/onemap-apply/src/main/java/com/onemap/apply/mapper/jsc/provider/JscSqlProvider.java

@@ -9,7 +9,7 @@ import java.util.Set;
  * @author lvhp
  * * @date 2024/5/21
  */
-public class JscrSqlProvider {
+public class JscSqlProvider {
 
     public String getSqlListByMap(Map<String, Object> map) {
         StringBuilder sqlBuilder = new StringBuilder("");
@@ -27,9 +27,9 @@ public class JscrSqlProvider {
                                 sqlBuilder.append(" and ");
                             }
                             if ("begin_time".equals(key)) {
-                                sqlBuilder.append(" a.").append(key.trim()).append(">= #{").append(key.trim()).append("} ");
+                                sqlBuilder.append(" a.").append("create_time").append(" >= #{").append(key.trim()).append("} ");
                             } else if ("end_time".equals(key)) {
-                                sqlBuilder.append(" a.").append(key.trim()).append("< #{").append(key.trim()).append("} ");
+                                sqlBuilder.append(" a.").append("create_time").append(" < #{").append(key.trim()).append("} ");
                             } else {
                                 sqlBuilder.append(" a.").append(key.trim()).append("= #{").append(key.trim()).append("} ");
                             }

+ 12 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/fcfh/FcfhService.java

@@ -0,0 +1,12 @@
+package com.onemap.apply.service.fcfh;
+
+import com.onemap.apply.domain.fcfh.HouseDTO;
+import com.onemap.common.core.web.domain.RequestResult;
+
+import java.io.IOException;
+
+public interface FcfhService {
+    RequestResult insertData() throws IOException;
+
+    HouseDTO getById(String id);
+}

+ 84 - 0
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/impl/fcfh/FcfhServiceImpl.java

@@ -0,0 +1,84 @@
+package com.onemap.apply.service.impl.fcfh;
+
+import com.onemap.apply.domain.fcfh.HouseDTO;
+import com.onemap.apply.mapper.fcfh.FcfhMapper;
+import com.onemap.apply.service.fcfh.FcfhService;
+import com.onemap.common.core.utils.uuid.IdUtils;
+import com.onemap.common.core.web.domain.RequestResult;
+import org.apache.poi.hssf.usermodel.HSSFRow;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class FcfhServiceImpl implements FcfhService {
+    @Autowired(required = false)
+    FcfhMapper gdMapper;
+
+    // 数据导入
+    @Override
+    public RequestResult insertData() throws IOException {
+        String fileName = "F:/project/sanya-data-management-back/data/excel/三亚山水国际峰秀阁10栋.xlsx";
+        File file = new File(fileName);
+        if (!file.exists()) {
+            return RequestResult.error("文件不存在");
+        }
+        // 清空全部的
+        gdMapper.delAll();
+
+        InputStream fin = new FileInputStream(file);
+        // 获取工作簿
+        XSSFWorkbook workbook = new XSSFWorkbook(fin);
+        // 获取sheet页
+        Sheet sheet = workbook.getSheetAt(0);
+        // 获取标题行数据
+        Map<String, Integer> headMap = new HashMap<>();
+        if (sheet.getLastRowNum() != 0) {
+            Row head = sheet.getRow(0);
+            for (Cell cell : head) {
+                headMap.put(cell.getStringCellValue(), cell.getColumnIndex());
+            }
+        }
+        for (int i = 1; i < sheet.getLastRowNum(); i++) {
+            Row row = sheet.getRow(i);
+            HouseDTO houseDTO = new HouseDTO();
+            houseDTO.setId(IdUtils.fastUUID());
+            String roomInfo = row.getCell(headMap.get("房号")).getStringCellValue();
+            String[] infos = roomInfo.split("-");
+            houseDTO.setBuilding(infos[0]);
+            // houseDTO.setFloor();
+            houseDTO.setRoom(infos[1]);
+            houseDTO.setResidentName(row.getCell(headMap.get("权利人")).getStringCellValue());
+            houseDTO.setIdNumber(row.getCell(headMap.get("身份证/军官证/营业执照")).getStringCellValue());
+            String areaInfo = row.getCell(headMap.get("套内面积")).getStringCellValue();
+            areaInfo = areaInfo.replaceAll("㎡", "");
+            houseDTO.setInnerArea(Float.parseFloat(areaInfo));
+            houseDTO.setCertificateNumber(row.getCell(headMap.get("证书号")).getStringCellValue());
+            houseDTO.setRoomInfo(roomInfo);
+            gdMapper.insert(houseDTO);
+        }
+        // 数据入库
+        return RequestResult.success();
+    }
+
+    @Override
+    public HouseDTO getById(String id) {
+        HouseDTO houseDTO = gdMapper.getById(id);
+        return houseDTO;
+    }
+}

+ 0 - 2
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/impl/jsc/JscServiceImpl.java

@@ -1,7 +1,6 @@
 package com.onemap.apply.service.impl.jsc;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.onemap.apply.domain.fzss.PzwjstdDTO;
 import com.onemap.apply.domain.jsc.TjscsqlDTO;
 import com.onemap.apply.mapper.jsc.JscMapper;
 import com.onemap.apply.mapper.jsc.TjscsqlMapper;
@@ -10,7 +9,6 @@ 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 org.springframework.web.bind.annotation.RequestMapping;
 
 import java.util.HashMap;
 import java.util.List;

+ 4 - 5
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/jsc/JscService.java

@@ -2,9 +2,6 @@ package com.onemap.apply.service.jsc;
 
 import com.onemap.common.core.web.domain.RequestResult;
 
-import java.util.List;
-import java.util.Map;
-
 /**
  * 驾驶舱相关业务接口
  *
@@ -14,7 +11,8 @@ import java.util.Map;
 public interface JscService {
 
     /**
-     *查询返回单条记录
+     * 查询返回单条记录
+     *
      * @param jscType   驾驶舱类型,跟前端对应(必填)
      * @param id        查询数据的id(必填)
      * @param beginTime 查询数据的开始时间 (大于等于)
@@ -24,10 +22,11 @@ public interface JscService {
      * @param val2      备用字段2
      * @return
      */
-    public RequestResult QueryOne(String jscType, String id, String beginTime, String endTime,String val0,String val1,String val2);
+    public RequestResult QueryOne(String jscType, String id, String beginTime, String endTime, String val0, String val1, String val2);
 
     /**
      * 查询返回多条记录
+     *
      * @param jscType   驾驶舱类型,跟前端对应(必填)
      * @param id        查询数据的id(必填)
      * @param beginTime 查询数据的开始时间 (大于等于)

+ 29 - 0
onemap-modules/onemap-apply/src/main/resources/mapper/postgresql/fcfh/GdMapper.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.onemap.apply.mapper.fcfh.FcfhMapper">
+
+    <!-- 可根据自己的需求,是否要使用 -->
+    <resultMap type="com.onemap.apply.domain.fcfh.HouseDTO" id="tHouseMap">
+        <result property="id" column="id"/>
+        <result property="community" column="community"/>
+        <result property="building" column="building"/>
+        <result property="floor" column="floor"/>
+        <result property="room" column="room"/>
+        <result property="residentName" column="resident_name"/>
+        <result property="idNumber" column="id_number"/>
+        <result property="innerArea" column="inner_area"/>
+        <result property="certificateNumber" column="certificate_number"/>
+        <result property="roomInfo" column="room_info"/>
+    </resultMap>
+
+    <select id="getById" resultMap="tHouseMap">
+        SELECT *
+        FROM t_yzt_house
+        WHERE id = #{id}
+    </select>
+    <delete id="delAll" >
+        delete
+        from t_yzt_house
+    </delete>
+</mapper>

+ 9 - 16
onemap-modules/onemap-system/src/main/java/com/onemap/system/controller/TJscSqlController.java

@@ -25,14 +25,13 @@ import org.springframework.web.bind.annotation.RestController;
 
 /**
  * 驾驶舱数据处理Controller
- * 
+ *
  * @author ruoyi
  * @date 2024-05-30
  */
 @RestController
 @RequestMapping("/jscsql")
-public class TJscSqlController extends BaseController
-{
+public class TJscSqlController extends BaseController {
     @Autowired
     private ITJscSqlService tJscSqlService;
 
@@ -41,8 +40,7 @@ public class TJscSqlController extends BaseController
      */
     @RequiresPermissions("@ss.hasPermi('system:jsc:data:list')")
     @GetMapping("/list")
-    public TableDataInfo list(TJscSql tJscSql)
-    {
+    public TableDataInfo list(TJscSql tJscSql) {
         startPage();
         List<TJscSql> list = tJscSqlService.selectTJscSqlList(tJscSql);
         return getDataTable(list);
@@ -54,8 +52,7 @@ public class TJscSqlController extends BaseController
     @RequiresPermissions("@ss.hasPermi('system:jsc:data:export')")
     @Log(title = "驾驶舱数据处理", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, TJscSql tJscSql)
-    {
+    public void export(HttpServletResponse response, TJscSql tJscSql) {
         List<TJscSql> list = tJscSqlService.selectTJscSqlList(tJscSql);
         ExcelUtil<TJscSql> util = new ExcelUtil<TJscSql>(TJscSql.class);
         util.exportExcel(response, list, "驾驶舱数据处理数据");
@@ -66,8 +63,7 @@ public class TJscSqlController extends BaseController
      */
     @RequiresPermissions("@ss.hasPermi('system:jsc:data:query')")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") String id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") String id) {
         return success(tJscSqlService.selectTJscSqlById(id));
     }
 
@@ -77,8 +73,7 @@ public class TJscSqlController extends BaseController
     @RequiresPermissions("@ss.hasPermi('system:jsc:data:add')")
     @Log(title = "驾驶舱数据处理", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody TJscSql tJscSql)
-    {
+    public AjaxResult add(@RequestBody TJscSql tJscSql) {
         Long userId = SecurityUtils.getUserId();
         tJscSql.setCreateBy(String.valueOf(userId));
         return toAjax(tJscSqlService.insertTJscSql(tJscSql));
@@ -90,8 +85,7 @@ public class TJscSqlController extends BaseController
     @RequiresPermissions("@ss.hasPermi('system:jsc:data:edit')")
     @Log(title = "驾驶舱数据处理", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody TJscSql tJscSql)
-    {
+    public AjaxResult edit(@RequestBody TJscSql tJscSql) {
         Long userId = SecurityUtils.getUserId();
         tJscSql.setUpdateBy(String.valueOf(userId));
         return toAjax(tJscSqlService.updateTJscSql(tJscSql));
@@ -102,9 +96,8 @@ public class TJscSqlController extends BaseController
      */
     @RequiresPermissions("@ss.hasPermi('system:jsc:data:remove')")
     @Log(title = "驾驶舱数据处理", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable String[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids) {
         return toAjax(tJscSqlService.deleteTJscSqlByIds(ids));
     }
 }

+ 13 - 0
onemap-modules/onemap-system/src/main/java/com/onemap/system/domain/TJscSql.java

@@ -17,10 +17,15 @@ public class TJscSql extends BaseEntity
     /** id */
     private String id;
 
+    /** 处理数据名称 */
+    @Excel(name = "处理数据名称")
+    private String jscName;
+
     /** 处理数据类型 */
     @Excel(name = "处理数据类型")
     private String jscType;
 
+
     /** 处理数据视图 */
     @Excel(name = "处理数据视图")
     private String jscView;
@@ -79,4 +84,12 @@ public class TJscSql extends BaseEntity
             .append("updateTime", getUpdateTime())
             .toString();
     }
+
+    public String getJscName() {
+        return jscName;
+    }
+
+    public void setJscName(String jscName) {
+        this.jscName = jscName;
+    }
 }

+ 15 - 9
onemap-modules/onemap-system/src/main/java/com/onemap/system/mapper/TJscSqlMapper.java

@@ -6,15 +6,14 @@ import java.util.List;
 
 /**
  * 驾驶舱数据处理Mapper接口
- * 
+ *
  * @author ruoyi
  * @date 2024-05-30
  */
-public interface TJscSqlMapper 
-{
+public interface TJscSqlMapper {
     /**
      * 查询驾驶舱数据处理
-     * 
+     *
      * @param id 驾驶舱数据处理主键
      * @return 驾驶舱数据处理
      */
@@ -22,7 +21,7 @@ public interface TJscSqlMapper
 
     /**
      * 查询驾驶舱数据处理列表
-     * 
+     *
      * @param tJscSql 驾驶舱数据处理
      * @return 驾驶舱数据处理集合
      */
@@ -30,7 +29,7 @@ public interface TJscSqlMapper
 
     /**
      * 新增驾驶舱数据处理
-     * 
+     *
      * @param tJscSql 驾驶舱数据处理
      * @return 结果
      */
@@ -38,7 +37,7 @@ public interface TJscSqlMapper
 
     /**
      * 修改驾驶舱数据处理
-     * 
+     *
      * @param tJscSql 驾驶舱数据处理
      * @return 结果
      */
@@ -46,7 +45,7 @@ public interface TJscSqlMapper
 
     /**
      * 删除驾驶舱数据处理
-     * 
+     *
      * @param id 驾驶舱数据处理主键
      * @return 结果
      */
@@ -54,9 +53,16 @@ public interface TJscSqlMapper
 
     /**
      * 批量删除驾驶舱数据处理
-     * 
+     *
      * @param ids 需要删除的数据主键集合
      * @return 结果
      */
     public int deleteTJscSqlByIds(String[] ids);
+
+
+    /**
+     * 执行视图
+     * @param view 视图
+     */
+    public void handleView(String view);
 }

+ 9 - 9
onemap-modules/onemap-system/src/main/java/com/onemap/system/service/ITJscSqlService.java

@@ -2,19 +2,19 @@ package com.onemap.system.service;
 
 
 import com.onemap.system.domain.TJscSql;
+
 import java.util.List;
 
 /**
  * 驾驶舱数据处理Service接口
- * 
+ *
  * @author ruoyi
  * @date 2024-05-30
  */
-public interface ITJscSqlService 
-{
+public interface ITJscSqlService {
     /**
      * 查询驾驶舱数据处理
-     * 
+     *
      * @param id 驾驶舱数据处理主键
      * @return 驾驶舱数据处理
      */
@@ -22,7 +22,7 @@ public interface ITJscSqlService
 
     /**
      * 查询驾驶舱数据处理列表
-     * 
+     *
      * @param tJscSql 驾驶舱数据处理
      * @return 驾驶舱数据处理集合
      */
@@ -30,7 +30,7 @@ public interface ITJscSqlService
 
     /**
      * 新增驾驶舱数据处理
-     * 
+     *
      * @param tJscSql 驾驶舱数据处理
      * @return 结果
      */
@@ -38,7 +38,7 @@ public interface ITJscSqlService
 
     /**
      * 修改驾驶舱数据处理
-     * 
+     *
      * @param tJscSql 驾驶舱数据处理
      * @return 结果
      */
@@ -46,7 +46,7 @@ public interface ITJscSqlService
 
     /**
      * 批量删除驾驶舱数据处理
-     * 
+     *
      * @param ids 需要删除的驾驶舱数据处理主键集合
      * @return 结果
      */
@@ -54,7 +54,7 @@ public interface ITJscSqlService
 
     /**
      * 删除驾驶舱数据处理信息
-     * 
+     *
      * @param id 驾驶舱数据处理主键
      * @return 结果
      */

+ 36 - 23
onemap-modules/onemap-system/src/main/java/com/onemap/system/service/impl/TJscSqlServiceImpl.java

@@ -3,97 +3,110 @@ package com.onemap.system.service.impl;
 import java.util.List;
 
 import com.onemap.common.core.utils.DateUtils;
+import com.onemap.common.core.utils.StringUtils;
 import com.onemap.common.core.utils.uuid.UUID;
 import com.onemap.system.domain.TJscSql;
 import com.onemap.system.mapper.TJscSqlMapper;
 import com.onemap.system.service.ITJscSqlService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 /**
  * 驾驶舱数据处理Service业务层处理
- * 
+ *
  * @author ruoyi
  * @date 2024-05-30
  */
 @Service
-public class TJscSqlServiceImpl implements ITJscSqlService
-{
+public class TJscSqlServiceImpl implements ITJscSqlService {
     @Autowired
     private TJscSqlMapper tJscSqlMapper;
 
     /**
      * 查询驾驶舱数据处理
-     * 
+     *
      * @param id 驾驶舱数据处理主键
      * @return 驾驶舱数据处理
      */
     @Override
-    public TJscSql selectTJscSqlById(String id)
-    {
+    public TJscSql selectTJscSqlById(String id) {
         return tJscSqlMapper.selectTJscSqlById(id);
     }
 
     /**
      * 查询驾驶舱数据处理列表
-     * 
+     *
      * @param tJscSql 驾驶舱数据处理
      * @return 驾驶舱数据处理
      */
     @Override
-    public List<TJscSql> selectTJscSqlList(TJscSql tJscSql)
-    {
+    public List<TJscSql> selectTJscSqlList(TJscSql tJscSql) {
         return tJscSqlMapper.selectTJscSqlList(tJscSql);
     }
 
     /**
      * 新增驾驶舱数据处理
-     * 
+     *
      * @param tJscSql 驾驶舱数据处理
      * @return 结果
      */
     @Override
-    public int insertTJscSql(TJscSql tJscSql)
-    {
+    @Transactional(rollbackFor = Exception.class)
+    public int insertTJscSql(TJscSql tJscSql) {
         tJscSql.setId(UUID.randomUUID().toString());
         tJscSql.setCreateTime(DateUtils.getNowDate());
-        return tJscSqlMapper.insertTJscSql(tJscSql);
+        int i = tJscSqlMapper.insertTJscSql(tJscSql);
+        if (i > 0 && StringUtils.isNotEmpty(tJscSql.getJscView())) {
+            handleView(tJscSql.getJscView());
+        }
+        return i;
     }
 
     /**
      * 修改驾驶舱数据处理
-     * 
+     *
      * @param tJscSql 驾驶舱数据处理
      * @return 结果
      */
     @Override
-    public int updateTJscSql(TJscSql tJscSql)
-    {
+    @Transactional(rollbackFor = Exception.class)
+    public int updateTJscSql(TJscSql tJscSql) {
         tJscSql.setUpdateTime(DateUtils.getNowDate());
-        return tJscSqlMapper.updateTJscSql(tJscSql);
+        int i = tJscSqlMapper.updateTJscSql(tJscSql);
+        if (i > 0 && StringUtils.isNotEmpty(tJscSql.getJscView())) {
+            handleView(tJscSql.getJscView());
+        }
+        return i;
     }
 
     /**
      * 批量删除驾驶舱数据处理
-     * 
+     *
      * @param ids 需要删除的驾驶舱数据处理主键
      * @return 结果
      */
     @Override
-    public int deleteTJscSqlByIds(String[] ids)
-    {
+    @Transactional(rollbackFor = Exception.class)
+    public int deleteTJscSqlByIds(String[] ids) {
         return tJscSqlMapper.deleteTJscSqlByIds(ids);
     }
 
     /**
      * 删除驾驶舱数据处理信息
-     * 
+     *
      * @param id 驾驶舱数据处理主键
      * @return 结果
      */
     @Override
-    public int deleteTJscSqlById(String id)
-    {
+    @Transactional(rollbackFor = Exception.class)
+    public int deleteTJscSqlById(String id) {
         return tJscSqlMapper.deleteTJscSqlById(id);
     }
+
+
+    private void handleView(String view) {
+        tJscSqlMapper.handleView(view);
+    }
+
 }

+ 16 - 3
onemap-modules/onemap-system/src/main/resources/mapper/postgresql/system/TJscSqlMapper.xml

@@ -5,7 +5,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 <mapper namespace="com.onemap.system.mapper.TJscSqlMapper">
     
     <resultMap type="TJscSql" id="TJscSqlResult">
-        <result property="id"    column="id"    />
+        <result property="id"    column="id"/>
+        <result property="jscName"    column="jsc_Name"    />
         <result property="jscType"    column="jsc_type"    />
         <result property="jscView"    column="jsc_view"    />
         <result property="jscSql"    column="jsc_sql"    />
@@ -13,16 +14,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="createTime"    column="create_time"    />
         <result property="updateBy"    column="update_by"    />
         <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
     </resultMap>
 
     <sql id="selectTJscSqlVo">
-        select id, jsc_type, jsc_view, jsc_sql, create_by, create_time, update_by, update_time from t_jsc_sql
+        select id, jsc_name,jsc_type, jsc_view, jsc_sql, create_by, create_time, update_by, update_time,remark from t_jsc_sql
     </sql>
 
     <select id="selectTJscSqlList" parameterType="TJscSql" resultMap="TJscSqlResult">
         <include refid="selectTJscSqlVo"/>
         <where>  
-            <if test="jscType != null  and jscType != ''"> and jsc_type = #{jscType}</if>
+            <if test="jscType != null  and jscType != ''"> and jsc_type &gt; #{jscType}  </if>
             <if test="jscView != null  and jscView != ''"> and jsc_view = #{jscView}</if>
             <if test="jscSql != null  and jscSql != ''"> and jsc_sql = #{jscSql}</if>
         </where>
@@ -37,6 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         insert into t_jsc_sql
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="id != null and id != ''">id,</if>
+            <if test="jscName != null and jscName != ''">jsc_name,</if>
             <if test="jscType != null and jscType != ''">jsc_type,</if>
             <if test="jscView != null">jsc_view,</if>
             <if test="jscSql != null and jscSql != ''">jsc_sql,</if>
@@ -44,9 +47,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">create_time,</if>
             <if test="updateBy != null">update_by,</if>
             <if test="updateTime != null">update_time,</if>
+            <if test="remark != null and remark != ''">remark,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null and id != ''">#{id},</if>
+            <if test="jscName != null and jscName != ''">#{jscName},</if>
             <if test="jscType != null and jscType != ''">#{jscType},</if>
             <if test="jscView != null">#{jscView},</if>
             <if test="jscSql != null and jscSql != ''">#{jscSql},</if>
@@ -54,12 +59,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
          </trim>
     </insert>
 
     <update id="updateTJscSql" parameterType="TJscSql">
         update t_jsc_sql
         <trim prefix="SET" suffixOverrides=",">
+            <if test="jscName != null and jscName != ''">jsc_name = #{jscName},</if>
             <if test="jscType != null and jscType != ''">jsc_type = #{jscType},</if>
             <if test="jscView != null">jsc_view = #{jscView},</if>
             <if test="jscSql != null and jscSql != ''">jsc_sql = #{jscSql},</if>
@@ -67,6 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
         </trim>
         where id = #{id}
     </update>
@@ -81,4 +89,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </delete>
+
+    <update id="handleView" parameterType="String">
+        ${view}
+    </update>
+
 </mapper>

+ 46 - 0
sql/pgsql/0_init.sql

@@ -0,0 +1,46 @@
+-- 驾驶舱数据管理
+-- delete from base.sys_menu where menu_id=3000;
+-- delete from base.sys_menu where menu_id=3001;
+-- delete from base.sys_menu where menu_id=3002;
+-- delete from base.sys_menu where menu_id=3003;
+-- delete from base.sys_menu where menu_id=3004;
+-- delete from base.sys_menu where menu_id=3005;
+
+-- 菜单 SQL
+insert into base.sys_menu (menu_id,menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+values(3000,'驾驶舱数据管理', '1065', '9', 'sql', 'system/jsc/data/index', 1, 0, 'C', '0', '0', 'system:jsc:data:list', 'edit', 'admin', now(), '', null, '驾驶舱数据管理菜单');
+
+-- 按钮 SQL
+insert into base.sys_menu (menu_id,menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+values(3001,'数据查询', 3000, '1',  '#', '', 1, 0, 'F', '0', '0', 'system:jsc:data:query',        '#', 'admin', now(), '', null, '');
+
+insert into base.sys_menu (menu_id,menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+values(3002,'数据新增', 3000, '2',  '#', '', 1, 0, 'F', '0', '0', 'system:jsc:data:add',          '#', 'admin', now(), '', null, '');
+
+insert into base.sys_menu (menu_id,menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+values(3003,'数据修改', 3000, '3',  '#', '', 1, 0, 'F', '0', '0', 'system:jsc:data:edit',         '#', 'admin', now(), '', null, '');
+
+insert into base.sys_menu (menu_id,menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+values(3004,'数据删除', 3000, '4',  '#', '', 1, 0, 'F', '0', '0', 'system:jsc:data:remove',       '#', 'admin', now(), '', null, '');
+
+insert into base.sys_menu (menu_id,menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+values(3005,'数据导出', 3000, '5',  '#', '', 1, 0, 'F', '0', '0', 'system:jsc:data:export',       '#', 'admin', now(), '', null, '');
+
+-- 土地卫片执法遥感监测分类表
+-- delete from base.business_dic where "type"='土地卫片执法遥感监测分类表';
+INSERT INTO base.business_dic ("name", value, "type", title, status) VALUES('新增线性地物','11', '土地卫片执法遥感监测分类表', '新增线性地物', '1');
+INSERT INTO base.business_dic ("name", value, "type", title, status) VALUES('新增公路','111', '土地卫片执法遥感监测分类表', '新增公路', '1');
+INSERT INTO base.business_dic ("name", value, "type", title, status) VALUES('新增铁路','112', '土地卫片执法遥感监测分类表', '新增铁路', '1');
+INSERT INTO base.business_dic ("name", value, "type", title, status) VALUES('新增建(构)筑物','12', '土地卫片执法遥感监测分类表', '新增建(构)筑物', '1');
+INSERT INTO base.business_dic ("name", value, "type", title, status) VALUES('新增建筑物','121', '土地卫片执法遥感监测分类表', '新增建筑物', '1');
+INSERT INTO base.business_dic ("name", value, "type", title, status) VALUES('新增构筑物','122', '土地卫片执法遥感监测分类表', '新增构筑物', '1');
+INSERT INTO base.business_dic ("name", value, "type", title, status) VALUES('新增高尔夫运动用地','13', '土地卫片执法遥感监测分类表', '新增高尔夫运动用地', '1');
+INSERT INTO base.business_dic ("name", value, "type", title, status) VALUES('新增推堆土','21', '土地卫片执法遥感监测分类表', '新增推堆土', '1');
+INSERT INTO base.business_dic ("name", value, "type", title, status) VALUES('新增其他道路','22', '土地卫片执法遥感监测分类表', '新增其他道路', '1');
+INSERT INTO base.business_dic ("name", value, "type", title, status) VALUES('新增点状地物','23', '土地卫片执法遥感监测分类表', '新增点状地物', '1');
+INSERT INTO base.business_dic ("name", value, "type", title, status) VALUES('新增其他线形地物','31', '土地卫片执法遥感监测分类表', '新增其他线形地物', '1');
+INSERT INTO base.business_dic ("name", value, "type", title, status) VALUES('新增库塘','32', '土地卫片执法遥感监测分类表', '新增库塘', '1');
+INSERT INTO base.business_dic ("name", value, "type", title, status) VALUES('新增林业园地','33', '土地卫片执法遥感监测分类表', '新增林业园地', '1');
+INSERT INTO base.business_dic ("name", value, "type", title, status) VALUES('建筑物翻建、续建','34', '土地卫片执法遥感监测分类表', '建筑物翻建、续建', '1');
+INSERT INTO base.business_dic ("name", value, "type", title, status) VALUES('新增光伏方阵用地','35', '土地卫片执法遥感监测分类表', '新增光伏方阵用地', '1');
+INSERT INTO base.business_dic ("name", value, "type", title, status) VALUES('年度内续建','41', '土地卫片执法遥感监测分类表', '年度内续建', '1');

+ 16 - 12
sql/pgsql/t_jsc_sql.sql

@@ -1,28 +1,32 @@
 -- 删除表 "t_jsc_sql"(如果存在)
-DROP TABLE IF EXISTS "t_jsc_sql";
+DROP TABLE IF EXISTS base."t_jsc_sql";
 
 -- 创建表 "t_jsc_sql"
-CREATE TABLE "t_jsc_sql"
+CREATE TABLE base."t_jsc_sql"
 (
     "id"          VARCHAR(50) NOT NULL PRIMARY KEY,  -- ID,UUID
+    "jsc_name"    VARCHAR(50) NOT NULL ,  -- 驾驶舱处理数据说明
     "jsc_type"    VARCHAR(30) NOT NULL UNIQUE,    -- 驾驶舱处理数据类型
     "jsc_view"    VARCHAR(1000),           -- 驾驶舱处理数据视图
     "jsc_sql"     VARCHAR(1000)  NOT NULL, -- 驾驶舱处理数据SQL
     "create_by"   VARCHAR(30) NOT NULL,    -- 创建者
     "create_time" TIMESTAMP  NOT NULL,     -- 创建时间
     "update_by"   VARCHAR(30),    -- 更新者
-    "update_time" TIMESTAMP    -- 更新时间
+    "update_time" TIMESTAMP,    -- 更新时间
+    "remark"      VARCHAR(500)    default null   -- 更新时间
 );
 
 -- 添加表注释
-COMMENT ON TABLE "t_jsc_sql" IS '驾驶舱数据处理表';
+COMMENT ON TABLE base."t_jsc_sql" IS '驾驶舱数据处理表';
 
 -- 添加字段注释
-COMMENT ON COLUMN "t_jsc_sql"."id" IS 'ID,暂用UUID';
-COMMENT ON COLUMN "t_jsc_sql"."jsc_type" IS '驾驶舱处理数据类型';
-COMMENT ON COLUMN "t_jsc_sql"."jsc_view" IS '驾驶舱处理数据视图';
-COMMENT ON COLUMN "t_jsc_sql"."jsc_sql" IS '驾驶舱处理数据SQL';
-COMMENT ON COLUMN "t_jsc_sql"."create_by" IS '创建者';
-COMMENT ON COLUMN "t_jsc_sql"."create_time" IS '创建时间';
-COMMENT ON COLUMN "t_jsc_sql"."update_by" IS '更新者';
-COMMENT ON COLUMN "t_jsc_sql"."update_time" IS '更新时间';
+COMMENT ON COLUMN base."t_jsc_sql"."id" IS 'ID,暂用UUID';
+COMMENT ON COLUMN base."t_jsc_sql"."jsc_name" IS '驾驶舱处理数据说明';
+COMMENT ON COLUMN base."t_jsc_sql"."jsc_type" IS '驾驶舱处理数据类型';
+COMMENT ON COLUMN base."t_jsc_sql"."jsc_view" IS '驾驶舱处理数据视图';
+COMMENT ON COLUMN base."t_jsc_sql"."jsc_sql" IS '驾驶舱处理数据SQL';
+COMMENT ON COLUMN base."t_jsc_sql"."create_by" IS '创建者';
+COMMENT ON COLUMN base."t_jsc_sql"."create_time" IS '创建时间';
+COMMENT ON COLUMN base."t_jsc_sql"."update_by" IS '更新者';
+COMMENT ON COLUMN base."t_jsc_sql"."update_time" IS '更新时间';
+COMMENT ON COLUMN base."t_jsc_sql"."remark" IS '备注';