ly 2 лет назад
Родитель
Сommit
3b071c21b4

+ 4 - 3
master/src/main/java/com/ruoyi/project/base/controller/TBasePointController.java

@@ -152,6 +152,9 @@ public class TBasePointController extends BaseController {
         tBasePoint.setApproveStatus(null);
         //查询需要审核数据
         List<TBasePoint> list = tBasePointService.selectTBasePointList(tBasePoint);
+        if (list.size() == 0) {
+            return AjaxResult.success();
+        }
         List<Long> ids = new ArrayList<>();
         for (TBasePoint t: list
              ) {
@@ -185,7 +188,7 @@ public class TBasePointController extends BaseController {
     }
 
 
-    @Log(title = "受控设备台账导入", businessType = BusinessType.INSERT)
+    @Log(title = "密封点台账导入", businessType = BusinessType.INSERT)
     @PostMapping("/importData")
     public AjaxResult importData(@RequestParam("file") MultipartFile file) throws IOException {
         //获取操作人员ID
@@ -197,12 +200,10 @@ public class TBasePointController extends BaseController {
         Workbook workbook = ExcelUtils.getWorkBook(file);
         Sheet sheet = workbook.getSheetAt(0);
         List<TBasePoint> list = new ArrayList<>();
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         int rowNum = sheet.getPhysicalNumberOfRows();
         //线程池
         ExecutorService executorService = Executors.newFixedThreadPool(30);
         final CountDownLatch latch = new CountDownLatch(rowNum - 1); //相同线程数量的计数
-        AtomicInteger failNumber = new AtomicInteger();
         AtomicInteger successNumber = new AtomicInteger();
         for (int i = 1; i < rowNum; i++) {
             int finalI = i;

+ 13 - 9
master/src/main/java/com/ruoyi/project/check/controller/TCheckCheckpointsController.java

@@ -15,6 +15,8 @@ import com.ruoyi.project.check.domain.TCheckCheckpoints;
 import com.ruoyi.project.check.domain.TCheckEnvironment;
 import com.ruoyi.project.check.domain.TCheckLawitems;
 import com.ruoyi.project.check.domain.TCheckRepairpoints;
+import com.ruoyi.project.check.mapper.TCheckCheckpointsMapper;
+import com.ruoyi.project.check.mapper.TCheckEnvironmentMapper;
 import com.ruoyi.project.check.service.ITCheckCheckpointsService;
 import com.ruoyi.project.check.service.ITCheckEnvironmentService;
 import com.ruoyi.project.check.service.ITCheckLawitemsService;
@@ -31,6 +33,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.math.BigDecimal;
@@ -56,10 +59,12 @@ import java.util.concurrent.atomic.AtomicInteger;
 public class TCheckCheckpointsController extends BaseController {
     @Autowired
     private ITCheckCheckpointsService tCheckCheckpointsService;
-
+    @Resource
+    private TCheckCheckpointsMapper tCheckCheckpointsMapper;
     @Autowired
     private ITCheckEnvironmentService tCheckEnvironmentService;
-
+    @Resource
+    private TCheckEnvironmentMapper tCheckEnvironmentMapper;
     @Autowired
     private ITBasePointService tBasePointService;
 
@@ -204,9 +209,8 @@ public class TCheckCheckpointsController extends BaseController {
         List<TCheckCheckpoints> list = new ArrayList<>();
         int rowNum = sheet.getPhysicalNumberOfRows();
         //线程池
-        ExecutorService executorService = Executors.newFixedThreadPool(1);
+        ExecutorService executorService = Executors.newFixedThreadPool(50);
         final CountDownLatch latch = new CountDownLatch(rowNum - 1); //相同线程数量的计数
-        AtomicInteger failNumber = new AtomicInteger();
 
         List<TCheckLawitems> tCheckLawitems = tCheckLawitemsService.selectTCheckLawitemsByLawStatus();
         AtomicInteger successNumber = new AtomicInteger();
@@ -248,7 +252,7 @@ public class TCheckCheckpointsController extends BaseController {
                             entity.setChecker(cellValue);
                         } else if (j == 7) {
                             // 检测日期
-                            SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
+                            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                             entity.setCheckDate(sdf.parse(cellValue));
                         }
                     }
@@ -258,7 +262,7 @@ public class TCheckCheckpointsController extends BaseController {
                     environment.setPlantName(entity.getPlantName());
                     environment.setInstrumentCode(entity.getInstrumentCode());
                     environment.setTestTime(entity.getCheckDate());
-                    List<TCheckEnvironment> tCheckEnvironments = tCheckEnvironmentService.selectTCheckEnvironmentList(environment);
+                    List<TCheckEnvironment> tCheckEnvironments = tCheckEnvironmentMapper.selectTCheckEnvironmentList(environment);
                     if (CollectionUtils.isEmpty(tCheckEnvironments)) {
                         logger.info("环境本底值数据不存在");
                         failRow.add(finalI + 1);
@@ -283,8 +287,8 @@ public class TCheckCheckpointsController extends BaseController {
                         entity.setInstrumentId(tCheckEnvironment.getInstrumentId());// 仪器id
                         entity.setInspectionId(inspectionId);// 任务id
                         entity.setApproveStatus(0l);// 任务id
-                        tCheckCheckpointsService.updateTCheckCheckpointsByUpload(entity); //更新检测点数据
-                        TCheckCheckpoints tCheckCheckpoint = tCheckCheckpointsService.selectTCheckCheckpointByEntity(entity);
+//                        tCheckCheckpointsMapper.updateTCheckCheckpointsByUpload(entity); //更新检测点数据
+                        TCheckCheckpoints tCheckCheckpoint = tCheckCheckpointsMapper.selectTCheckCheckpointByEntity(entity);
                         for (TCheckLawitems tCheckLawitem : tCheckLawitems) {
                             if (tCheckLawitem.getPlantType().equals(tCheckCheckpoint.getPlantType())
                                     && tCheckLawitem.getPointType().equals(tCheckCheckpoint.getPointType())
@@ -301,7 +305,7 @@ public class TCheckCheckpointsController extends BaseController {
                                 }
                             }
                         }
-                        int upload = tCheckCheckpointsService.updateTCheckCheckpointsByUpload(entity); //更新检测点数据
+                        int upload = tCheckCheckpointsMapper.updateTCheckCheckpointsByUpload(entity); //更新检测点数据
                         if (upload == 1) {
                             successNumber.getAndIncrement();
                         } else {

+ 3 - 2
ui/src/views/base/point/index.vue

@@ -1146,7 +1146,7 @@ export default {
         this.getList();
       });
     },
-    handleApprove(status) {
+    handleApprove() {
       let data = {}
       data.pointIds = this.ids;
       data.approveStatus = 2;
@@ -1157,7 +1157,8 @@ export default {
     handleApproveAll(status) {
        let data = deepClone(this.queryParams);
        data.approveStatus = status
-      handleApproveAll(data).then(() => {
+      handleApproveAll(data).then(response => {
+        this.$modal.msgSuccess(response.msg);
         this.getList();
       });
     },