|
@@ -10,6 +10,7 @@ import com.ruoyi.framework.web.domain.AjaxResult;
|
|
|
import com.ruoyi.framework.web.page.TableDataInfo;
|
|
|
import com.ruoyi.project.sems.domain.TMeasureRecord;
|
|
|
import com.ruoyi.project.sems.domain.TMeasureThickness;
|
|
|
+import com.ruoyi.project.sems.mapper.TMeasureThicknessMapper;
|
|
|
import com.ruoyi.project.sems.service.ITMeasureRecordService;
|
|
|
import com.ruoyi.project.sems.service.ITMeasureThicknessService;
|
|
|
import org.apache.poi.ss.usermodel.Cell;
|
|
@@ -20,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.text.DateFormat;
|
|
@@ -41,6 +43,8 @@ public class TMeasureRecordController extends BaseController {
|
|
|
private ITMeasureRecordService tMeasureRecordService;
|
|
|
@Autowired
|
|
|
private ITMeasureThicknessService tMeasureThicknessService;
|
|
|
+ @Resource
|
|
|
+ private TMeasureThicknessMapper tMeasureThicknessMapper;
|
|
|
|
|
|
/**
|
|
|
* 查询测厚记录列表
|
|
@@ -205,13 +209,19 @@ public class TMeasureRecordController extends BaseController {
|
|
|
}
|
|
|
String cellValue = ExcelUtils.getCellValue(cell);
|
|
|
logger.info("cellValue:" + cellValue);
|
|
|
- if (j == 0) {
|
|
|
- entity.setMeasureId(cellValue);
|
|
|
- } else if (j == 1) {
|
|
|
- entity.setMeasureId(entity.getMeasureId() + "," + cellValue);
|
|
|
- } else if (j == 2) {
|
|
|
+ if (j == 0) { //装置
|
|
|
+ entity.setPlantCode(cellValue);
|
|
|
+ }else if (j == 1) {//单元
|
|
|
+ entity.setUnitCode(cellValue);
|
|
|
+ }else if (j == 2) {//单位内编号
|
|
|
+ entity.setTagno(cellValue);
|
|
|
+ }else if (j == 3) {//侧厚部位
|
|
|
+ entity.setTagno(cellValue);
|
|
|
+ } else if (j == 4) {//检测编号
|
|
|
+ entity.setMeasureNo(cellValue);
|
|
|
+ } else if (j == 5) {//数值
|
|
|
entity.setMeasureValue(Double.parseDouble(cellValue));
|
|
|
- } else if (j == 3) {
|
|
|
+ } else if (j == 6) {//时间
|
|
|
entity.setMeasureDate(sdf.parse(cellValue));
|
|
|
}
|
|
|
}
|
|
@@ -230,9 +240,7 @@ public class TMeasureRecordController extends BaseController {
|
|
|
failNum++;
|
|
|
try {
|
|
|
//保存测厚记录
|
|
|
- String measureId = t.getMeasureId();
|
|
|
- String[] split = measureId.split(",");
|
|
|
- Long id = this.tMeasureThicknessService.selectByTagNo(split[0], split[1]);
|
|
|
+ Long id = this.tMeasureThicknessMapper.selectByRecord(t);
|
|
|
logger.info(id.toString());
|
|
|
t.setMeasureId(id.toString());
|
|
|
this.tMeasureRecordService.insertTMeasureRecord(t);
|