tianwu.sun 3 月之前
父節點
當前提交
cfb3aff1e6

+ 2 - 2
src/main/java/com/bootdo/datas/controller/DataController.java

@@ -136,7 +136,7 @@ public class DataController {
             } else {
                 return R.error("请使用excel导入!");
             }
-            return R.ok();
+            return R.ok("0");
         } catch (BDException e){
             return R.error(e.getMessage());
         } catch (Exception e) {
@@ -430,7 +430,7 @@ public class DataController {
             } else {
                 return R.error("请使用excel导入!");
             }
-            return R.ok();
+            return R.ok("0");
         } catch (BDException e){
             return R.error(e.getMessage());
          } catch (Exception e) {

+ 2 - 2
src/main/java/com/bootdo/datas/controller/DataSendProvinceController.java

@@ -180,7 +180,7 @@ public class DataSendProvinceController {
             } else {
                 return R.error("请使用excel导入!");
             }
-            return R.ok();
+            return R.ok("0");
         } catch (BDException e){
             return R.error(e.getMessage());
         }  catch (Exception e) {
@@ -230,7 +230,7 @@ public class DataSendProvinceController {
             } else {
                 return R.error("请使用excel导入!");
             }
-            return R.ok();
+            return R.ok("0");
         } catch (BDException e){
             return R.error(e.getMessage());
         } catch (Exception e) {

+ 1 - 1
src/main/java/com/bootdo/datas/controller/GyDataImportController.java

@@ -252,7 +252,7 @@ public class GyDataImportController {
             } else {
                 return R.error("请使用excel导入!");
             }
-            return R.ok();
+            return R.ok("0");
         } catch (BDException e){
             return R.error(e.getMessage());
         } catch (Exception e) {

+ 7 - 1
src/main/java/com/bootdo/datas/service/impl/GyDataServiceImpl.java

@@ -230,6 +230,7 @@ public class GyDataServiceImpl implements GyDataService {
         int otherCity = 0;
         int auditPass = 0;
         int unitNoAudit = 0;
+        int nonData = 0;
         XSSFWorkbook xssfWorkbook = new XSSFWorkbook(is);
         XSSFSheet xssfSheet = xssfWorkbook.getSheetAt(0);
         // 企业信息
@@ -337,11 +338,13 @@ public class GyDataServiceImpl implements GyDataService {
                 if (count == 0) {
                     try {
                         gyUnitDO.setCreateTime(new Date());
+                        gyUnitDO.setAuditStatus("0");
                         gyUnitDao.save(gyUnitDO);
                     } catch (Exception e) {
                         log.error("error enterprise-only : {}", e.getMessage());
                     }
                 }
+                nonData++;
                 break;
             }
 
@@ -496,7 +499,7 @@ public class GyDataServiceImpl implements GyDataService {
             gyDataDao.batchSave(dataList);
         }
         String result = null;
-        if ((otherProvince + otherCity + auditPass + unitNoAudit) > 0) {
+        if ((otherProvince + otherCity + auditPass + unitNoAudit + nonData) > 0) {
             StringBuilder sb = new StringBuilder();
             if (otherProvince > 0) {
                 sb.append(otherProvince).append("条非本省数据(已忽略导入)! <br/>");
@@ -510,6 +513,9 @@ public class GyDataServiceImpl implements GyDataService {
             if (unitNoAudit > 0) {
                 sb.append(unitNoAudit).append("条所属企业未注册或还没通过审核(已忽略导入)! <br/>");
             }
+            if (nonData > 0) {
+                sb.append(nonData).append("条仅导入企业(无数据导入)! <br/>");
+            }
             result = sb.toString();
         }
 

+ 13 - 8
src/main/resources/static/js/appjs/datas/data/dataImport.js

@@ -106,16 +106,21 @@ function initUpload() {
 				// parent.reLoad();
 				// var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
 				// parent.layer.close(index);
+				if(data.response.msg != null && data.response.msg != '0'){
+					parent.layer.open({
+						title: ['导入提示信息', 'text-align: center']
+						, icon: 7
+						, content: "操作成功, " + data.response.msg,
+						btnAlign: 'c'
+					});
+				} else {
+					console.log("2: " + data.toString())
+					parent.layer.msg("操作成功");
+				}
 
-				parent.layer.open({
-					title: ['导入提示信息', 'text-align: center']
-					, icon: 7
-					, content: "操作成功, " + data.response.msg,
-					btnAlign: 'c'
-				});
 				parent.reLoad();
-				var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
-				parent.layer.close(index);
+				var index2 = parent.layer.getFrameIndex(window.name); // 获取窗口索引
+				parent.layer.close(index2);
 			// }
 			// parent.layer.msg("操作成功");
 		} else {

+ 21 - 23
src/main/resources/static/js/appjs/datas/dataImport/batchAdd.js

@@ -101,36 +101,34 @@ function initUpload() {
         //处理结果
         if (data.response.code == 0) {
             // 成功时 有当前省外的数据 提示
-            if (data.response.msg != null && data.response.msg != '0') {
-                console.log("1; " + data.toString())
-
-                finalContent += data.response.msg;
-                // 有条数提示 并且全部完成
-                if (index == data.files.length) {
-                    // 提示窗
-                    parent.layer.open({
-                        title: ['导入提示信息', 'text-align: center']
-                        , icon: 7
-                        , content: "操作成功, " + finalContent,
-                        btnAlign: 'c'
-                    });
-                    parent.reLoad();
-                    var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
-                    parent.layer.close(index);
-                }
-            }
-            // 全部成功并且没有条数提示
-            if (index == data.files.length && finalContent == '') {
+            if(data.response.msg != null && data.response.msg != '0'){
+                parent.layer.open({
+                    title: ['导入提示信息', 'text-align: center']
+                    , icon: 7
+                    , content: "操作成功, " + data.response.msg,
+                    btnAlign: 'c'
+                });
+            } else {
                 console.log("2: " + data.toString())
                 parent.layer.msg("操作成功");
-                parent.reLoad();
-                var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
-                parent.layer.close(index);
             }
+            parent.reLoad();
+            var index2 = parent.layer.getFrameIndex(window.name); // 获取窗口索引
+            parent.layer.close(index2);
+
+            // // 全部成功并且没有条数提示
+            // if (index == data.files.length && finalContent == '') {
+            //     console.log("2: " + data.toString())
+            //     parent.layer.msg("操作成功");
+            //     parent.reLoad();
+            //     var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
+            //     parent.layer.close(index);
+            // }
             // parent.layer.msg("操作成功");
         } else {
             parent.layer.alert(data.response.msg)
         }
+
     }).on('fileerror', function (event, data, msg) {//异步上传错误结果处理
         console.log("fileerror");
         console.log("event" + event);

+ 8 - 4
src/main/resources/static/js/appjs/datas/dataSendProvince/dataImport.js

@@ -106,16 +106,20 @@ function initUpload() {
 				// parent.reLoad();
 				// var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
 				// parent.layer.close(index);
-
+			if(data.response.msg != null && data.response.msg != '0'){
 				parent.layer.open({
 					title: ['导入提示信息', 'text-align: center']
 					, icon: 7
-					, content:  "操作成功, " + data.response.msg,
+					, content: "操作成功, " + data.response.msg,
 					btnAlign: 'c'
 				});
+			} else {
+				console.log("2: " + data.toString())
+				parent.layer.msg("操作成功");
+			}
 				parent.reLoad();
-				var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
-				parent.layer.close(index);
+				var index2 = parent.layer.getFrameIndex(window.name); // 获取窗口索引
+				parent.layer.close(index2);
 			// }
 			// parent.layer.msg("操作成功");
 		} else {

+ 11 - 21
src/main/resources/static/js/appjs/datas/gyDataImport/batchAdd.js

@@ -100,30 +100,20 @@ function initUpload() {
         //处理结果
         if (data.response.code == 0) {
             // 成功时 有当前省外的数据 提示
-            if (data.response.msg != null && data.response.msg != '0') {
-                console.log("1; " + data.toString())
-                finalContent += data.response.msg;
-                // 有条数提示 并且全部完成
-                if (index == data.files.length) {
-                    parent.layer.open({
-                        title: ['导入提示信息', 'text-align: center']
-                        , icon: 7
-                        , content:  "操作成功, " + data.response.msg,
-                        btnAlign: 'c'
-                    });
-                    parent.reLoad();
-                    var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
-                    parent.layer.close(index);
-                }
-            }
-            // 全部成功并且没有条数提示
-            if (index == data.files.length && finalContent == '') {
+            if(data.response.msg != null && data.response.msg != '0'){
+                parent.layer.open({
+                    title: ['导入提示信息', 'text-align: center']
+                    , icon: 7
+                    , content: "操作成功, " + data.response.msg,
+                    btnAlign: 'c'
+                });
+            } else {
                 console.log("2: " + data.toString())
                 parent.layer.msg("操作成功");
-                parent.reLoad();
-                var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
-                parent.layer.close(index);
             }
+            parent.reLoad();
+            var index2 = parent.layer.getFrameIndex(window.name); // 获取窗口索引
+            parent.layer.close(index2);
         } else {
             parent.layer.alert(data.response.msg)
         }

+ 13 - 9
src/main/resources/static/js/appjs/datas/gyDataImport/dataImport.js

@@ -106,16 +106,20 @@ function initUpload() {
 				// parent.reLoad();
 				// var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
 				// parent.layer.close(index);
-
-				parent.layer.open({
-					title: ['导入提示信息', 'text-align: center']
-					, icon: 7
-					, content:  "操作成功, " + data.response.msg,
-					btnAlign: 'c'
-				});
+			if(data.response.msg != null && data.response.msg != '0'){
+					parent.layer.open({
+						title: ['导入提示信息', 'text-align: center']
+						, icon: 7
+						, content: "操作成功, " + data.response.msg,
+						btnAlign: 'c'
+					});
+				} else {
+					console.log("2: " + data.toString())
+					parent.layer.msg("操作成功");
+				}
 				parent.reLoad();
-				var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
-				parent.layer.close(index);
+				var index2 = parent.layer.getFrameIndex(window.name); // 获取窗口索引
+				parent.layer.close(index2);
 			// }
 			// parent.layer.msg("操作成功");
 		} else {