Browse Source

新增:表单管理-新增/修改 ,添加字段keyValue

wuweihao 4 years ago
parent
commit
7e1ecd6eb3

+ 1 - 0
gis_application/src/main/resources/application.properties

@@ -1,4 +1,5 @@
 server.port=8108
+#server.port=8115
 
 spring.profiles.active=dev
 

+ 4 - 0
gis_domain/src/main/java/com/gis/domain/entity/FormEntity.java

@@ -27,6 +27,10 @@ public class FormEntity extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "类型")
     private String type;
 
+    @ApiModelProperty(value = "类型名称" )
+    private String typeValue;
+
+
     @ApiModelProperty(value = "是否展示,1:是, 0:否")
     private Integer display;
 

+ 15 - 4
gis_web/src/main/java/com/gis/web/controller/ApiController.java

@@ -1,5 +1,6 @@
 package com.gis.web.controller;
 
+import cn.hutool.core.img.Img;
 import cn.hutool.crypto.SecureUtil;
 import cn.hutool.crypto.asymmetric.Sign;
 import cn.hutool.crypto.asymmetric.SignAlgorithm;
@@ -14,11 +15,9 @@ import io.swagger.annotations.ApiOperation;
 import lombok.extern.log4j.Log4j2;
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
+import java.io.File;
 import java.util.List;
 
 /**
@@ -47,4 +46,16 @@ public class ApiController extends BaseController {
     }
 
 
+//    @ApiOperation("生成缩略图")
+//    @PostMapping("cov")
+//    public Result cov() {
+//        String inPath = "/root/user/owen_test/jar/100m.jpg";
+//        String outPath = "/root/user/owen_test/jar/100m_t.jpg";
+//        log.info("start cov");
+//        Img.from(new File(inPath)).scale(300, 150).write(new File(outPath));
+//        log.info("end cov");
+//        return Result.success();
+//    }
+
+
 }

+ 7 - 3
gis_web/src/main/java/com/gis/web/controller/FormController.java

@@ -13,6 +13,7 @@ import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.log4j.Log4j2;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -52,9 +53,12 @@ public class FormController extends BaseController {
             entity = new FormEntity();
             BeanUtils.copyProperties(param, entity);
 
-            // 处理二维码
-            String qrCodeUrl = QrCodeUtils.generateQrCode(param.getSampleUrl(), FILE_PATH, OSS_PATH, OSS_DOMAIN);
-            entity.setQrCodeUrl(qrCodeUrl);
+            // 处理二维码, 没有示例表单不生成二维码
+            if (StringUtils.isNotBlank(param.getSampleUrl())) {
+                String qrCodeUrl = QrCodeUtils.generateQrCode(param.getSampleUrl(), FILE_PATH, OSS_PATH, OSS_DOMAIN);
+                entity.setQrCodeUrl(qrCodeUrl);
+            }
+
 
             formService.save(entity);
         } else {

+ 6 - 1
remark.md

@@ -11,4 +11,9 @@
     目前使用jar启动
     jar: 192.168.0.44/root/user/java/cms_wuhu_gov_8018 
     doc:http://192.168.0.44:8108/doc.html   
-    web: http://192.168.0.44/zhengwu   
+    web: http://192.168.0.44/zhengwu   
+    
+# 更新
+ 1. 添加typeValue字段 
+    
+