shiqian il y a 3 ans
Parent
commit
90f2ec9f96

+ 1 - 1
boman-web-core/src/main/java/com/boman/web/core/domain/RowResult.java → boman-api/boman-domain/src/main/java/com/boman/domain/dto/RowResult.java

@@ -1,4 +1,4 @@
-package com.boman.web.core.domain;
+package com.boman.domain.dto;
 
 /**
  * @author shiqian

+ 13 - 0
boman-modules/boman-gen/pom.xml

@@ -71,12 +71,25 @@
             <groupId>com.boman</groupId>
             <artifactId>boman-common-swagger</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>com.boman</groupId>
+            <artifactId>boman-api-web-core</artifactId>
+            <version>2.5.0-SNAPSHOT</version>
+        </dependency>
+
         <dependency>
             <groupId>com.boman</groupId>
             <artifactId>boman-domain</artifactId>
             <version>2.5.0-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
+
+<!--        <dependency>-->
+<!--            <groupId>com.google.code.gson</groupId>-->
+<!--            <artifactId>gson</artifactId>-->
+<!--            <version>2.7</version>-->
+<!--        </dependency>-->
     </dependencies>
 
     <build>

+ 37 - 0
boman-modules/boman-gen/src/main/java/com/boman/gen/controller/MoveDataController.java

@@ -0,0 +1,37 @@
+package com.boman.gen.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.boman.gen.mapper.MoveDataMapper;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @author shiqian
+ * @date 2021年09月06日 18:24
+ **/
+@RestController
+@RequestMapping
+public class MoveDataController {
+
+    @Resource
+    MoveDataMapper moveDataMapper;
+
+
+    @GetMapping("/hj/{limit}/{offset}")
+    public String moveData(@PathVariable("limit") int limit, @PathVariable("offset") int offset){
+        List<JSONObject> select = moveDataMapper.select(limit, offset);
+        return JSON.toJSONString(select);
+    }
+
+    @GetMapping("/selectY/{limit}/{offset}")
+    public String selectY(@PathVariable("limit") int limit, @PathVariable("offset") int offset){
+        List<JSONObject> select = moveDataMapper.select(limit, offset);
+        return JSON.toJSONString(select);
+    }
+}

+ 187 - 0
boman-modules/boman-gen/src/main/java/com/boman/gen/domain/HjHj.java

@@ -0,0 +1,187 @@
+package com.boman.gen.domain;
+
+
+public class HjHj {
+
+  private String zjlx;
+  private String zjhm;
+  private String hh;
+  private String xz;
+  private String hjdxz;
+  private String yhzgx;
+  private String hzxm;
+  private String hzzjlx;
+  private String hzsfhm;
+  private String xm;
+  private String csrq;
+  private String xb;
+  private String hhid;
+  private String hklx;
+  private String swrq;
+  private String akmlxdh;
+  private String lxdh;
+  private String akmdz;
+
+
+  public String getZjlx() {
+    return zjlx;
+  }
+
+  public void setZjlx(String zjlx) {
+    this.zjlx = zjlx;
+  }
+
+
+  public String getZjhm() {
+    return zjhm;
+  }
+
+  public void setZjhm(String zjhm) {
+    this.zjhm = zjhm;
+  }
+
+
+  public String getHh() {
+    return hh;
+  }
+
+  public void setHh(String hh) {
+    this.hh = hh;
+  }
+
+
+  public String getXz() {
+    return xz;
+  }
+
+  public void setXz(String xz) {
+    this.xz = xz;
+  }
+
+
+  public String getHjdxz() {
+    return hjdxz;
+  }
+
+  public void setHjdxz(String hjdxz) {
+    this.hjdxz = hjdxz;
+  }
+
+
+  public String getYhzgx() {
+    return yhzgx;
+  }
+
+  public void setYhzgx(String yhzgx) {
+    this.yhzgx = yhzgx;
+  }
+
+
+  public String getHzxm() {
+    return hzxm;
+  }
+
+  public void setHzxm(String hzxm) {
+    this.hzxm = hzxm;
+  }
+
+
+  public String getHzzjlx() {
+    return hzzjlx;
+  }
+
+  public void setHzzjlx(String hzzjlx) {
+    this.hzzjlx = hzzjlx;
+  }
+
+
+  public String getHzsfhm() {
+    return hzsfhm;
+  }
+
+  public void setHzsfhm(String hzsfhm) {
+    this.hzsfhm = hzsfhm;
+  }
+
+
+  public String getXm() {
+    return xm;
+  }
+
+  public void setXm(String xm) {
+    this.xm = xm;
+  }
+
+
+  public String getCsrq() {
+    return csrq;
+  }
+
+  public void setCsrq(String csrq) {
+    this.csrq = csrq;
+  }
+
+
+  public String getXb() {
+    return xb;
+  }
+
+  public void setXb(String xb) {
+    this.xb = xb;
+  }
+
+
+  public String getHhid() {
+    return hhid;
+  }
+
+  public void setHhid(String hhid) {
+    this.hhid = hhid;
+  }
+
+
+  public String getHklx() {
+    return hklx;
+  }
+
+  public void setHklx(String hklx) {
+    this.hklx = hklx;
+  }
+
+
+  public String getSwrq() {
+    return swrq;
+  }
+
+  public void setSwrq(String swrq) {
+    this.swrq = swrq;
+  }
+
+
+  public String getAkmlxdh() {
+    return akmlxdh;
+  }
+
+  public void setAkmlxdh(String akmlxdh) {
+    this.akmlxdh = akmlxdh;
+  }
+
+
+  public String getLxdh() {
+    return lxdh;
+  }
+
+  public void setLxdh(String lxdh) {
+    this.lxdh = lxdh;
+  }
+
+
+  public String getAkmdz() {
+    return akmdz;
+  }
+
+  public void setAkmdz(String akmdz) {
+    this.akmdz = akmdz;
+  }
+
+}

+ 19 - 0
boman-modules/boman-gen/src/main/java/com/boman/gen/mapper/MoveDataMapper.java

@@ -0,0 +1,19 @@
+package com.boman.gen.mapper;
+
+import com.alibaba.fastjson.JSONObject;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * @author shiqian
+ * @date 2021年09月06日 18:32
+ **/
+@Repository
+public interface MoveDataMapper {
+
+
+    List<JSONObject> select(@Param("limit") int limit, @Param("offset") int offset);
+    List<JSONObject> selectY(@Param("limit") int limit, @Param("offset") int offset);
+}

+ 17 - 0
boman-modules/boman-gen/src/main/resources/mapper/generator/MoveDataMapper.xml

@@ -0,0 +1,17 @@
+<?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.boman.gen.mapper.MoveDataMapper">
+
+
+    <select id="select"  resultType="com.alibaba.fastjson.JSONObject">
+        select * from hj limit #{limit}, #{offset}
+    </select>
+
+    <select id="selectY"  resultType="com.alibaba.fastjson.JSONObject">
+        select * from hj ymjz #{limit}, #{offset}
+    </select>
+
+
+</mapper> 

+ 11 - 0
boman-report/src/main/java/com/boman/report/mapper/MoveDataMapper.java

@@ -0,0 +1,11 @@
+package com.boman.report.mapper;
+
+import org.springframework.stereotype.Repository;
+
+/**
+ * @author shiqian
+ * @date 2021年09月06日 18:32
+ **/
+@Repository
+public interface MoveDataMapper {
+}

+ 28 - 0
boman-report/src/main/resources/mapper/MoveDataMapper.xml

@@ -0,0 +1,28 @@
+<?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.boman.report.mapper.MoveDataMapper">
+
+
+    <insert id="insert" resultType="int">
+        insert into sys_config (
+        <if test="configName != null and configName != '' ">config_name,</if>
+        <if test="configKey != null and configKey != '' ">config_key,</if>
+        <if test="configValue != null and configValue != '' ">config_value,</if>
+        <if test="configType != null and configType != '' ">config_type,</if>
+        <if test="createBy != null and createBy != ''">create_by,</if>
+        <if test="remark != null and remark != ''">remark,</if>
+        create_time
+        )values(
+        <if test="configName != null and configName != ''">#{configName},</if>
+        <if test="configKey != null and configKey != ''">#{configKey},</if>
+        <if test="configValue != null and configValue != ''">#{configValue},</if>
+        <if test="configType != null and configType != ''">#{configType},</if>
+        <if test="createBy != null and createBy != ''">#{createBy},</if>
+        <if test="remark != null and remark != ''">#{remark},</if>
+        sysdate()
+        )
+    </insert>
+
+</mapper> 

+ 5 - 3
boman-web-core/src/main/java/com/boman/web/core/mapper/StandardMapper.java

@@ -263,18 +263,20 @@ public interface StandardMapper {
             stringBuilder.append(String.join(", ", keySet.keySet()));
             stringBuilder.append(" ) ").append("values ");
 
-            for (JSONObject data : dataList) {
+            for (int i = 0; i < dataList.size(); i++) {
+                JSONObject data = dataList.get(i);
                 StringBuilder values = new StringBuilder();
                 values.append(" ( ");
                 for (Map.Entry<String, Object> entry : data.entrySet()) {
-                    values.append("#{model.").append(entry.getKey()).append("}, ");
+                    values.append("#{dataList[" + i + "].").append(entry.getKey()).append("}, ");
                 }
 
                 String beforeLast = StringUtils.substringBeforeLast(values.toString(), ", ");
-                stringBuilder.append(beforeLast).append(" ) ");
+                stringBuilder.append(beforeLast).append(" ), ");
             }
 
             String sqlStr = stringBuilder.toString();
+            sqlStr = sqlStr.substring(0, sqlStr.lastIndexOf(","));
             LOGGER.info("批量新增的sql语句为: {} \r\n 新增的数据为: {}", sqlStr, dataList);
             return sqlStr;
         }

+ 1 - 3
boman-web-core/src/main/java/com/boman/web/core/service/TableServiceCmdService.java

@@ -3,7 +3,6 @@ package com.boman.web.core.service;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
 import com.aliyuncs.exceptions.ClientException;
 import com.boman.common.core.utils.DateUtils;
 import com.boman.common.core.utils.SecurityUtils;
@@ -26,7 +25,7 @@ import com.boman.jflow.api.RemoteJflowProcessService;
 import com.boman.system.api.RemoteMenuService;
 import com.boman.system.api.RemoteUserService;
 import com.boman.web.core.domain.ActionType;
-import com.boman.web.core.domain.RowResult;
+import com.boman.domain.dto.RowResult;
 import com.boman.web.core.domain.TableContext;
 import com.boman.web.core.service.delete.IBaseDeleteService;
 import com.boman.web.core.service.save.IBaseSaveService;
@@ -44,7 +43,6 @@ import org.apache.commons.lang3.BooleanUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.aop.framework.AopContext;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;

+ 1 - 1
boman-web-core/src/main/java/com/boman/web/core/service/delete/BaseDeleteServiceImpl.java

@@ -5,7 +5,7 @@ import com.boman.common.redis.RedisKey;
 import com.boman.common.redis.service.RedisService;
 import com.boman.domain.GenTable;
 import com.boman.domain.GenTableColumn;
-import com.boman.web.core.domain.RowResult;
+import com.boman.domain.dto.RowResult;
 import com.boman.web.core.mapper.StandardMapper;
 import com.boman.web.core.utils.ColumnUtils;
 import com.google.common.collect.Lists;

+ 1 - 1
boman-web-core/src/main/java/com/boman/web/core/service/save/BaseSaveServiceImpl.java

@@ -10,7 +10,7 @@ import com.boman.domain.constant.TableNameConst;
 import com.boman.domain.dto.AjaxResult;
 import com.boman.domain.dto.WxMsgDto;
 import com.boman.system.api.RemoteUserService;
-import com.boman.web.core.domain.RowResult;
+import com.boman.domain.dto.RowResult;
 import com.boman.web.core.mapper.StandardMapper;
 import com.boman.web.core.utils.ColumnUtils;
 import com.boman.web.core.utils.IdUtils;