浏览代码

Merge branch 'dev' into dev-2.0

lyq 1 年之前
父节点
当前提交
ba19b20ee9

+ 10 - 6
data-ui/src/views/data/common/ISuperMapAreaMarker.vue

@@ -41,10 +41,11 @@
         </div>
 
         <div style="width: 80%; float: left;">
-          <Supermap ref="areaSupermap" style="width: 100%;height:75vh"
-                    :mapDiv="uuid" :mapSite="{doubleClickZoom:false}" :codes="['9fa5']"
-                    :isSideBySide="false" :showAreaLatLng="showAreaLatLng"></Supermap>
+            <Supermap ref="areaSupermap" style="width: 100%;height:75vh"
+                      :mapDiv="uuid" :mapSite="{doubleClickZoom:false}" :codes="['9fa5']"
+                      :isSideBySide="false" :showAreaLatLng="showAreaLatLng"></Supermap>
         </div>
+
       </div>
       <el-button type="primary" @click="closeDialog">确定</el-button>
       <el-button @click="clearAway">清除</el-button>
@@ -81,11 +82,14 @@
         </div>
 
         <div style="width: 80%; float: left;">
-          <supermap ref="supermap" style="width: 100%; height: 75vh;" :putSmUserID_layer="putSmUserID_layer" @showLatLng="showLatLng"></supermap>
+           <supermap ref="supermap" style="width: 100%; height: 75vh;" :putSmUserID_layer="putSmUserID_layer" @showLatLng="showLatLng"></supermap>
         </div>
       </div>
-            <el-button type="primary" @click="closeDialog">确定</el-button>
-            <el-button @click="clearAway">清除</el-button>
+
+
+        <el-button type="primary" @click="closeDialog">确定</el-button>
+        <el-button @click="clearAway">清除</el-button>
+      <span style="float: none; margin-left: 200px;">操作提示:鼠标右击完成标记,点击【确定】按钮,为标记区域命名</span>
     </el-dialog>
 
 

+ 3 - 0
data-ui/src/views/data/digitalagriculture/along/index.vue

@@ -257,6 +257,9 @@
           soyaBladeNum: [
             {validator: checkPositiveDecimal, trigger: 'blur'}
           ],
+          time: [
+            {required: true, message: "时间不能为空", trigger: "change"}
+          ],
         }
       };
     },

+ 3 - 3
data-ui/src/views/data/digitalagriculture/schedule/index.vue

@@ -292,9 +292,9 @@ export default {
         deptId: [
           {required: true, message: "所属部门不能为空", trigger: "change"}
         ],
-        // time: [
-        //   {required: true, message: "时间不能为空", trigger: "change"}
-        // ],
+        time: [
+          {required: true, message: "时间不能为空", trigger: "change"}
+        ],
         cornReapArea: [
           // {required: true, message: "玉米收获面积不能为空", trigger: "blur"},
           {validator: checkPositiveDecimal, trigger: 'blur'}

+ 3 - 0
data-ui/src/views/data/digitalagriculture/seedingProgress/index.vue

@@ -284,6 +284,9 @@
             // {required: true, message: "占计划育秧或插秧面积的百分比不能为空", trigger: "blur"},
             {validator: checkPositiveDecimal, trigger: 'blur'}
           ],
+          time: [
+            {required: true, message: "时间不能为空", trigger: "change"}
+          ],
         }
       };
     },

+ 1 - 1
src/main/java/com/sooka/sponest/data/system/attach/service/ICenterdataTAttachService.java

@@ -65,7 +65,7 @@ public interface ICenterdataTAttachService {
 
     List<Map<String, Object>> selectFailUpattah();
 
-    void updateEventAttachSchedule(Map<String, Object> paramMap, SysFile sysFile) throws Exception;
+    void updateEventAttachSchedule(Map<String, Object> paramMap, SysFile sysFile);
 
     int deleteListCenterdataTAttach(String busId, List<CenterdataTAttach> list);
 

+ 1 - 1
src/main/java/com/sooka/sponest/data/system/attach/service/impl/CenterdataTAttachServiceImpl.java

@@ -135,7 +135,7 @@ public class CenterdataTAttachServiceImpl extends BaseServiceImpl implements ICe
 
     @Transactional
     @Override
-    public void updateEventAttachSchedule(Map<String, Object> paramMap, SysFile sysFile) throws Exception {
+    public void updateEventAttachSchedule(Map<String, Object> paramMap, SysFile sysFile) {
         CenterdataTAttach centerdataTAttach = new CenterdataTAttach();
         centerdataTAttach.setFileName(MapUtils.getString(paramMap, "url"));
         centerdataTAttach.setAttachPath(sysFile.getUrl());

+ 11 - 78
src/main/java/com/sooka/sponest/data/utils/ScheduleAtachUtil.java

@@ -9,8 +9,6 @@ import com.ruoyi.system.api.RemoteFileService;
 import com.ruoyi.system.api.domain.SysFile;
 import com.sooka.sponest.data.system.attach.service.ICenterdataTAttachService;
 import org.apache.commons.collections4.MapUtils;
-import org.apache.commons.fileupload.FileItem;
-import org.apache.commons.fileupload.disk.DiskFileItemFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -19,10 +17,9 @@ import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.multipart.MultipartFile;
-import org.springframework.web.multipart.commons.CommonsMultipartFile;
 
 import javax.annotation.Resource;
-import java.io.*;
+import java.io.File;
 import java.net.HttpURLConnection;
 import java.net.URL;
 import java.util.Arrays;
@@ -44,18 +41,16 @@ public class ScheduleAtachUtil {
 
     // 文件前缀
     public static final String FILE_PREFIX_LOCAL = "fileUrl";
-    public static final String FILE_PREFIX_APP = "appUrl";
     public static final String FILE_PREFIX_HIK1 = "HIK_1";
     public static final String FILE_PREFIX_HIK2 = "HIK_2";
     public static final String FILE_PREFIX_DH1 = "DH_1";
     public static final String FILE_PREFIX_DH2 = "DH_2";
-    public static final String FILE_DOWNLOAD = "downloadUrl";
 
     @GetMapping("/attach")
-    public void runAtach() throws Exception {
+    public void runAtach() {
         logger.info("执行定时任务大华图片本地上传开始=>{}", DateUtils.dateTimeNow());
         Map<String, String> paramMap = SpringUtils.getBean(RemoteConfigService.class).remotegetConfigMap(Arrays.asList(FILE_PREFIX_LOCAL, FILE_PREFIX_HIK1, FILE_PREFIX_HIK2, FILE_PREFIX_DH1, FILE_PREFIX_DH2)).getData();
-        //paramMap.put("token",  redisService.getCacheObject("DH_TOKEN"));// 大华token
+//        paramMap.put("token", redisService.getCacheObject("DH_TOKEN"));// 大华token
         List<Map<String, Object>> list = centerdataTAttachService.selectFailUpattah();
         int i = 0;
         for (Map map : list) {
@@ -74,15 +69,13 @@ public class ScheduleAtachUtil {
     //每周的周日晚上8点开始运行
     @Scheduled(cron = "0 0 20 ? * 1")
     @GetMapping("/urlToMultipartFile")
-    public void urlToMultipartFile() throws Exception {
+    public void urlToMultipartFile() {
         logger.info("执行定时任务大华图片本地上传开始=>{}", DateUtils.dateTimeNow());
         Map<String, String> paramMap = SpringUtils.getBean(RemoteConfigService.class).remotegetConfigMap(Arrays.asList(FILE_PREFIX_LOCAL, FILE_PREFIX_HIK1, FILE_PREFIX_HIK2, FILE_PREFIX_DH1, FILE_PREFIX_DH2)).getData();
         List<Map<String, Object>> attaches = centerdataTAttachService.selectFailUpattah();
         logger.info("此次需要更新的图片的总数==================>" + attaches.size());
         int i = 0;
         for (Map<String, Object> item : attaches) {
-            logger.info("event_name-------------->" + MapUtils.getString(item, "event_name"));
-            logger.info("create_time-------------->" + MapUtils.getString(item, "create_time"));
             logger.info("busId==================>" + MapUtils.getString(item, "busId") + "当前序号" + i);
             paramMap.put("token", redisService.getCacheObject("DH_TOKEN"));// 大华token
             File file = null;
@@ -101,85 +94,25 @@ public class ScheduleAtachUtil {
                 // 设置读取超时时间为10秒
                 httpUrl.setReadTimeout(10000);
                 httpUrl.connect();
-                logger.info("url===>" + url);
-                logger.info("Code===>" + httpUrl.getResponseCode());
-                logger.info("meaasge===>" + httpUrl.getResponseMessage());
-                httpUrl.connect();
-                file = inputStreamToFile(httpUrl.getInputStream(), System.currentTimeMillis() + ".jpg");
-                multipartFile = fileToMultipartFile(file);
-                httpUrl.disconnect();
+                file = FilePrefixUtils.inputStreamToFile(httpUrl.getInputStream(), System.currentTimeMillis() + ".jpg");
+                multipartFile = FilePrefixUtils.fileToMultipartFile(file);
             } catch (Exception e) {
                 logger.info(e.getMessage());
             } finally {
-                httpUrl.disconnect();
+                if (null != httpUrl) {
+                    httpUrl.disconnect();
+                }
             }
-            long l = System.currentTimeMillis();
-            logger.info("-------------<>" + l);
-            logger.info("multipartFile-------------" + multipartFile);
-            logger.info("getOriginalFilename---------------------------->" + multipartFile.getOriginalFilename());
             if (null != multipartFile) {
                 SysFile sysFile = SpringUtils.getBean(RemoteFileService.class).upload(multipartFile).getData();
                 try {
                     Thread.sleep(30000);
                 } catch (InterruptedException e) {
-                    e.printStackTrace();
+                    logger.error(e.getMessage());
+                    Thread.currentThread().interrupt();
                 }
-                logger.info("sysFile===========>" + sysFile);
-                logger.info("getWebUrl===========>" + sysFile.getWebUrl());
-                logger.info("====>" + (System.currentTimeMillis() - l));
                 centerdataTAttachService.updateEventAttachSchedule(item, sysFile);
             }
         }
     }
-
-    public static File inputStreamToFile(InputStream ins, String name) {
-        File file = new File(System.getProperty("java.io.tmpdir") + File.separator + name);
-        int len = 8192;
-        byte[] buffer = new byte[len];
-        OutputStream os = null;
-        int bytesRead;
-        try {
-            os = new FileOutputStream(file);
-            while ((bytesRead = ins.read(buffer, 0, len)) != -1) {
-                os.write(buffer, 0, bytesRead);
-            }
-        } catch (IOException e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                os.close();
-                ins.close();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-        return file;
-    }
-
-    public static MultipartFile fileToMultipartFile(File file) {
-        DiskFileItemFactory diskFileItemFactory = new DiskFileItemFactory(16, null);
-        FileItem item = diskFileItemFactory.createItem(file.getName(), "text/plain", true, file.getName());
-        int len = 8192;
-        byte[] buffer = new byte[len];
-        FileInputStream fis = null;
-        OutputStream os = null;
-        int bytesRead;
-        try {
-            fis = new FileInputStream(file);
-            os = item.getOutputStream();
-            while ((bytesRead = fis.read(buffer, 0, len)) != -1) {
-                os.write(buffer, 0, bytesRead);
-            }
-        } catch (IOException e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                os.close();
-                fis.close();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-        return new CommonsMultipartFile(item);
-    }
 }

+ 1 - 1
src/main/resources/mapper/other/CenterdataSink.xml

@@ -41,7 +41,7 @@
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
             <if test="idCode != null  and idCode != ''">and identifiedcode like concat('%', #{idCode}, '%')</if>
             <if test="phone != null  and phone != ''">and phone like concat('%',#{phone},'%')</if>
-            <if test="userType != null  and userType != ''">and user_type = #{userType}</if>
+            <if test="userType != null  and userType != ''">and a.user_type = #{userType}</if>
         </where>
     </select>