|
@@ -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 {
|