|
@@ -187,6 +187,77 @@ public class TCheckCheckpointsController extends BaseController {
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('check:checkpoints:edit')")
|
|
|
+ @Log(title = "审核检测结果", businessType = BusinessType.UPDATE)
|
|
|
+ @PutMapping("/approveAll")
|
|
|
+ public AjaxResult approveAll(@RequestBody TCheckCheckpoints tCheckCheckpoints) {
|
|
|
+ long status = tCheckCheckpoints.getApproveStatus();
|
|
|
+ tCheckCheckpoints.setApproveStatus(null);
|
|
|
+ List<TCheckCheckpoints> list = tCheckCheckpointsService.selectTCheckCheckpointsList(tCheckCheckpoints);
|
|
|
+ if (list.size() == 0) {
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+ List<Long> ids = new ArrayList<>();
|
|
|
+ for (TCheckCheckpoints t: list
|
|
|
+ ) {
|
|
|
+ ids.add(t.getCheckId());
|
|
|
+ }
|
|
|
+ TCheckCheckpoints newCheckpoints = new TCheckCheckpoints();
|
|
|
+ newCheckpoints.setApproveStatus(status);
|
|
|
+ newCheckpoints.setCheckIds(ids.toArray(new Long[ids.size()]));
|
|
|
+ int i = tCheckCheckpointsService.updateApproveStatusByIds(newCheckpoints);
|
|
|
+ List<TCheckRepairpoints> tCheckRepairpoints = new ArrayList<>();
|
|
|
+ if (i > 0) {
|
|
|
+ if (2 == status) {
|
|
|
+ TTaskInspection tTaskInspection = taskInspectionService.selectTTaskInspectionById(tCheckCheckpoints.getInspectionId());
|
|
|
+ List<TCheckCheckpoints> points = tCheckCheckpointsService.selectPointsByIds(newCheckpoints.getCheckIds());
|
|
|
+ tTaskInspection.setTaskDoneNum(new BigDecimal(StringUtils.isNotEmpty(tTaskInspection.getTaskDoneNum()) ? tTaskInspection.getTaskDoneNum() : "0").add(new BigDecimal(points.size())).toString());
|
|
|
+ tTaskInspection.setTaskUndoneNum(new BigDecimal(tTaskInspection.getTaskNum()).subtract(new BigDecimal(tTaskInspection.getTaskDoneNum())).toString());
|
|
|
+ taskInspectionService.updateTTaskInspection(tTaskInspection);
|
|
|
+ for (TCheckCheckpoints point : points) {
|
|
|
+ if (!point.getLeakageDegree().equals("1")) {
|
|
|
+ TCheckRepairpoints tCheckRepairpoint = new TCheckRepairpoints();
|
|
|
+ tCheckRepairpoint.setPointId(point.getPointId());
|
|
|
+ tCheckRepairpoint.setNetTestValue(point.getNetTestValue());
|
|
|
+ tCheckRepairpoint.setPlantName(point.getPlantName());
|
|
|
+ tCheckRepairpoint.setRegionName(point.getRegionName());
|
|
|
+ tCheckRepairpoint.setLayer(point.getLayer());
|
|
|
+ tCheckRepairpoint.setDevName(point.getDevName());
|
|
|
+ tCheckRepairpoint.setDevCode(point.getDevCode());
|
|
|
+ tCheckRepairpoint.setGroupCode(point.getGroupCode());
|
|
|
+ tCheckRepairpoint.setExtendCode(point.getExtendCode());
|
|
|
+ tCheckRepairpoint.setPointType(point.getPointType());
|
|
|
+ tCheckRepairpoint.setInstrumentCode(point.getInstrumentCode());
|
|
|
+ tCheckRepairpoint.setLeakagePosition(point.getLeakagePosition());
|
|
|
+ tCheckRepairpoint.setLeakageDegree(point.getLeakageDegree());
|
|
|
+// tCheckRepairpoint.setApproveStatus(0L);
|
|
|
+ tCheckRepairpoint.setCreaterCode(getUserId());
|
|
|
+ tCheckRepairpoint.setCreatedate(new Date());
|
|
|
+ tCheckRepairpoint.setUpdaterCode(getUserId());
|
|
|
+ tCheckRepairpoint.setUpdatedate(new Date());
|
|
|
+ tCheckRepairpoint.setPlantId(point.getPlantId());
|
|
|
+ tCheckRepairpoint.setRegionId(point.getRegionId());
|
|
|
+ tCheckRepairpoint.setDevId(point.getDevId());
|
|
|
+ tCheckRepairpoint.setInstrumentId(point.getInstrumentId());
|
|
|
+ tCheckRepairpoint.setPlantType(point.getPlantType());
|
|
|
+ tCheckRepairpoint.setMediumType(point.getMediumType());
|
|
|
+ tCheckRepairpoints.add(tCheckRepairpoint);
|
|
|
+ }
|
|
|
+ TBasePoint tBasePoint = new TBasePoint();
|
|
|
+ tBasePoint.setPointId(point.getPointId());
|
|
|
+ tBasePoint.setNetTestValue(point.getNetTestValue());
|
|
|
+ tBasePoint.setLeakageDegree(point.getLeakageDegree());
|
|
|
+ tBasePointService.updateTBasePoint(tBasePoint);// 更新密封点数据
|
|
|
+ }
|
|
|
+ if (CollectionUtils.isNotEmpty(tCheckRepairpoints)) {
|
|
|
+ tCheckRepairpointsService.insertTCheckRepairpointsByList(tCheckRepairpoints);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else
|
|
|
+ return AjaxResult.error();
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 删除检测点
|
|
|
*/
|
|
@@ -252,7 +323,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));
|
|
|
}
|
|
|
}
|