|
@@ -36,6 +36,7 @@ import java.math.RoundingMode;
|
|
|
import java.text.DecimalFormat;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
+import java.util.concurrent.atomic.AtomicReference;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
@@ -240,7 +241,7 @@ public class QcsMdfFormServiceImpl extends ServiceImpl<QcsMdfFormDao, QcsMdfForm
|
|
|
List<SysUserDo> sysUserDos = qcsMdfFormDao.getAllUsers();//人员信息
|
|
|
List<Map<String, String>> unitMap = qcsMdfFormDao.getUnitMap();//基地信息
|
|
|
List<Map<String, String>> resDutyMap = qcsMdfFormDao.getResDuty();//修改原因与责任单位配置信息
|
|
|
- List<QcsMdfFormDo> qcsMdfFormDos = qcsMdfFormDao.getMdfForms();//已存在的修改单
|
|
|
+ List<ImportMdfVo> qcsMdfFormDos = qcsMdfFormDao.getMdfForms();//已存在的修改单
|
|
|
String deptName = "";
|
|
|
List<Map<String, String>> unitList = unitMap.stream()
|
|
|
.filter(umap -> {
|
|
@@ -258,12 +259,12 @@ public class QcsMdfFormServiceImpl extends ServiceImpl<QcsMdfFormDao, QcsMdfForm
|
|
|
List<QcsMdfRowDo> qcsMdfRowDoList = new ArrayList<>();
|
|
|
List<QcsMdfDetailDo> qcsMdfDetailDoList = new ArrayList<>();
|
|
|
List<String> formids = new ArrayList<>();
|
|
|
- List<Map<String, String>> resDutyList = new ArrayList<>();
|
|
|
+ List<Map<String, String>> resDutyList = new ArrayList<>();//修改原因与责任单位关系
|
|
|
|
|
|
Sheet sheet = new XSSFWorkbook(file.getInputStream()).getSheetAt(0);
|
|
|
int lastRowNum = sheet.getLastRowNum();
|
|
|
String ropJson = "{\"dataSource\":\"导入\"}";
|
|
|
- for (int i = 2; i <= lastRowNum; i++) {
|
|
|
+ for (int i = 1; i <= lastRowNum; i++) {
|
|
|
Row row = sheet.getRow(i);
|
|
|
if (ExcelUtils.isRowEmpty(row)) {
|
|
|
continue;
|
|
@@ -272,13 +273,16 @@ public class QcsMdfFormServiceImpl extends ServiceImpl<QcsMdfFormDao, QcsMdfForm
|
|
|
StringBuilder stringBuilder = new StringBuilder();
|
|
|
ImportMdfVo importMdfVo = new ImportMdfVo();
|
|
|
|
|
|
+ String endCell = row.getCell(0).toString().replaceAll("\\s+", "");
|
|
|
+ if (endCell.equals("小计")) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
//项目工号
|
|
|
- String procode = row.getCell(0).toString().replaceAll("\\s+", "");
|
|
|
+ String procode = row.getCell(2).toString().replaceAll("\\s+", "");
|
|
|
List<QcsPartNoDo> codeParts = new ArrayList<>();
|
|
|
if (StringUtils.isEmpty(procode)) {
|
|
|
- stringBuilder.append("项目工号不能为空,");
|
|
|
- } else if (procode.equals("小计")) {
|
|
|
- break;
|
|
|
+ stringBuilder.append("项目工号必填,");
|
|
|
} else {
|
|
|
if (StringUtil.isScience(procode)) {
|
|
|
BigDecimal formatProjectCode = new BigDecimal(procode);
|
|
@@ -295,23 +299,19 @@ public class QcsMdfFormServiceImpl extends ServiceImpl<QcsMdfFormDao, QcsMdfForm
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //修改原因
|
|
|
- String sourcename = row.getCell(2).toString().replaceAll("\\s+", "");
|
|
|
- if (StringUtils.isEmpty(sourcename)) {
|
|
|
- stringBuilder.append("修改原因不能为空,");
|
|
|
- } else {
|
|
|
- //有配置责任单位
|
|
|
- resDutyList = resDutyMap.stream()
|
|
|
- .filter(um -> {
|
|
|
- String reason = um.get("REASON");
|
|
|
- return reason.equals(sourcename);
|
|
|
- }).collect(Collectors.toList());
|
|
|
- importMdfVo.setSourcename(sourcename);
|
|
|
+ //产品类型
|
|
|
+ String typename = row.getCell(4).toString().replaceAll("\\s+", "");
|
|
|
+ if (StringUtils.isNotEmpty(typename)) {
|
|
|
+ if (StringUtil.isScience(typename)) {
|
|
|
+ BigDecimal formatProjectCode = new BigDecimal(typename);
|
|
|
+ typename = formatProjectCode.setScale(0, BigDecimal.ROUND_HALF_UP).toPlainString();
|
|
|
+ }
|
|
|
}
|
|
|
- importMdfVo.setNumbername(row.getCell(3).toString().replaceAll("\\s+", ""));//专业
|
|
|
+ importMdfVo.setTypename(typename);
|
|
|
+ importMdfVo.setNumbername(row.getCell(5).toString().replaceAll("\\s+", ""));//专业/类别
|
|
|
|
|
|
//修改单编号
|
|
|
- String lossno = row.getCell(4).toString().replaceAll("\\s+", "");
|
|
|
+ String lossno = row.getCell(6).toString().replaceAll("\\s+", "");
|
|
|
if (StringUtils.isNotEmpty(lossno)) {
|
|
|
if (StringUtil.isScience(lossno)) {
|
|
|
BigDecimal formatProjectCode = new BigDecimal(lossno);
|
|
@@ -319,21 +319,33 @@ public class QcsMdfFormServiceImpl extends ServiceImpl<QcsMdfFormDao, QcsMdfForm
|
|
|
}
|
|
|
importMdfVo.setSourcenumbercode(lossno);
|
|
|
} else {
|
|
|
- stringBuilder.append("修改单编号不能为空,");
|
|
|
+ stringBuilder.append("修改单编号必填,");
|
|
|
}
|
|
|
|
|
|
+ //修改原因
|
|
|
+ String sourcename = row.getCell(9).toString().replaceAll("\\s+", "");
|
|
|
+ if (StringUtils.isNotEmpty(sourcename)) {
|
|
|
+ //有配置责任单位
|
|
|
+ resDutyList = resDutyMap.stream()
|
|
|
+ .filter(um -> {
|
|
|
+ String reason = um.get("REASON");
|
|
|
+ return reason.equals(sourcename);
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ importMdfVo.setSourcename(sourcename);
|
|
|
+
|
|
|
//整改编号
|
|
|
- String rectifycode = row.getCell(5).toString().replaceAll("\\s+", "");
|
|
|
+ String rectifycode = row.getCell(19).toString().replaceAll("\\s+", "");
|
|
|
if (StringUtils.isNotEmpty(rectifycode)) {
|
|
|
if (StringUtil.isScience(rectifycode)) {
|
|
|
BigDecimal formatProjectCode = new BigDecimal(rectifycode);
|
|
|
rectifycode = formatProjectCode.setScale(0, BigDecimal.ROUND_HALF_UP).toPlainString();
|
|
|
}
|
|
|
- importMdfVo.setRectifycode(rectifycode);
|
|
|
}
|
|
|
+ importMdfVo.setRectifycode(rectifycode);
|
|
|
|
|
|
//项目总工
|
|
|
- String managename = row.getCell(6).toString().replaceAll("\\s+", "");
|
|
|
+ String managename = row.getCell(20).toString().replaceAll("\\s+", "");
|
|
|
if (StringUtils.isNotEmpty(managename)) {
|
|
|
if (StringUtil.isScience(managename)) {
|
|
|
BigDecimal formatProjectCode = new BigDecimal(managename);
|
|
@@ -344,14 +356,42 @@ public class QcsMdfFormServiceImpl extends ServiceImpl<QcsMdfFormDao, QcsMdfForm
|
|
|
SysUserDo sysUserDo = sysUserDos.stream().filter(u -> u.getName().equals(finalManagename)).findFirst().orElse(null);
|
|
|
if (sysUserDo != null) {
|
|
|
importMdfVo.setManageadminid(sysUserDo.getId());
|
|
|
- importMdfVo.setManageadminnickname(managename);
|
|
|
+ } else {
|
|
|
+ stringBuilder.append("项目总工" + managename + "不在人员表里,");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ importMdfVo.setManageadminnickname(managename);
|
|
|
+ importMdfVo.setProducename(row.getCell(21).toString().replaceAll("\\s+", ""));//项目生产阶段
|
|
|
+
|
|
|
+ //内容序号
|
|
|
+ String sectionsn = row.getCell(7).toString().replaceAll("\\s+", "");
|
|
|
+ if (StringUtils.isNotEmpty(sectionsn)) {
|
|
|
+ if (StringUtil.isScience(sectionsn)) {
|
|
|
+ BigDecimal formatProjectCode = new BigDecimal(sectionsn);
|
|
|
+ sectionsn = formatProjectCode.setScale(0, BigDecimal.ROUND_HALF_UP).toPlainString();
|
|
|
+ }
|
|
|
+ if (!isPositiveInteger(sectionsn)) {
|
|
|
+ stringBuilder.append("内容序号" + sectionsn + "必须为正整数,");
|
|
|
}
|
|
|
}
|
|
|
+ importMdfVo.setSectionsn(sectionsn);
|
|
|
|
|
|
- importMdfVo.setProducename(row.getCell(7).toString().replaceAll("\\s+", ""));//项目生产阶段
|
|
|
+ //修改责任方
|
|
|
+ String modifyby = row.getCell(8).toString().replaceAll("\\s+", "");
|
|
|
+ if (StringUtils.isNotEmpty(modifyby)) {
|
|
|
+ List<Map<String, String>> mapList = unitMap.stream()
|
|
|
+ .filter(umap -> {
|
|
|
+ String fullname = umap.get("FULLNAME");
|
|
|
+ return fullname.equals(modifyby);
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ if (mapList.size() == 0) {
|
|
|
+ stringBuilder.append("修改责任方" + modifyby + "不在组织表里,");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ importMdfVo.setModifyby(modifyby);
|
|
|
|
|
|
//错误源头图号
|
|
|
- String partno = row.getCell(8).toString().replaceAll("\\s+", "");
|
|
|
+ String partno = row.getCell(22).toString().replaceAll("\\s+", "");
|
|
|
if (StringUtils.isNotEmpty(partno)) {
|
|
|
if (StringUtil.isScience(partno)) {
|
|
|
BigDecimal formatProjectCode = new BigDecimal(partno);
|
|
@@ -362,15 +402,13 @@ public class QcsMdfFormServiceImpl extends ServiceImpl<QcsMdfFormDao, QcsMdfForm
|
|
|
if (partNos.size() == 0) {
|
|
|
stringBuilder.append("错误源头图号" + partno + "与项目工号" + procode + "不匹配,");
|
|
|
} else {
|
|
|
- importMdfVo.setErrordesigndtdrawingno(partno);
|
|
|
importMdfVo.setErrordesigndtpartname(partNos.get(0).getDtpartname());
|
|
|
}
|
|
|
- } else {
|
|
|
- importMdfVo.setErrordesigndtdrawingno(partno);
|
|
|
}
|
|
|
+ importMdfVo.setErrordesigndtdrawingno(partno);
|
|
|
|
|
|
//设计人
|
|
|
- String dtdesigner = row.getCell(10).toString().replaceAll("\\s+", "");
|
|
|
+ String dtdesigner = row.getCell(24).toString().replaceAll("\\s+", "");
|
|
|
if (StringUtils.isNotEmpty(dtdesigner)) {
|
|
|
if (StringUtil.isScience(dtdesigner)) {
|
|
|
BigDecimal formatProjectCode = new BigDecimal(dtdesigner);
|
|
@@ -381,12 +419,14 @@ public class QcsMdfFormServiceImpl extends ServiceImpl<QcsMdfFormDao, QcsMdfForm
|
|
|
SysUserDo sysUserDo = sysUserDos.stream().filter(u -> u.getName().equals(finaldtdesigner)).findFirst().orElse(null);
|
|
|
if (sysUserDo != null) {
|
|
|
importMdfVo.setDtdesigneruseradminid(sysUserDo.getId());
|
|
|
- importMdfVo.setDtdesigner(dtdesigner);
|
|
|
+ } else {
|
|
|
+ stringBuilder.append("设计人" + dtdesigner + "不在人员表里,");
|
|
|
}
|
|
|
}
|
|
|
+ importMdfVo.setDtdesigner(dtdesigner);
|
|
|
|
|
|
//校对人
|
|
|
- String dtwhocollate = row.getCell(11).toString().replaceAll("\\s+", "");
|
|
|
+ String dtwhocollate = row.getCell(25).toString().replaceAll("\\s+", "");
|
|
|
if (StringUtils.isNotEmpty(dtwhocollate)) {
|
|
|
if (StringUtil.isScience(dtwhocollate)) {
|
|
|
BigDecimal formatProjectCode = new BigDecimal(dtwhocollate);
|
|
@@ -397,12 +437,14 @@ public class QcsMdfFormServiceImpl extends ServiceImpl<QcsMdfFormDao, QcsMdfForm
|
|
|
SysUserDo sysUserDo = sysUserDos.stream().filter(u -> u.getName().equals(finaldtwhocollate)).findFirst().orElse(null);
|
|
|
if (sysUserDo != null) {
|
|
|
importMdfVo.setDtwhocollateuseradminid(sysUserDo.getId());
|
|
|
- importMdfVo.setDtwhocollate(dtwhocollate);
|
|
|
+ } else {
|
|
|
+ stringBuilder.append("校对人" + dtwhocollate + "不在人员表里,");
|
|
|
}
|
|
|
}
|
|
|
+ importMdfVo.setDtwhocollate(dtwhocollate);
|
|
|
|
|
|
//审核人
|
|
|
- String dtwhoapprove = row.getCell(12).toString().replaceAll("\\s+", "");
|
|
|
+ String dtwhoapprove = row.getCell(26).toString().replaceAll("\\s+", "");
|
|
|
if (StringUtils.isNotEmpty(dtwhoapprove)) {
|
|
|
if (StringUtil.isScience(dtwhoapprove)) {
|
|
|
BigDecimal formatProjectCode = new BigDecimal(dtwhoapprove);
|
|
@@ -413,37 +455,61 @@ public class QcsMdfFormServiceImpl extends ServiceImpl<QcsMdfFormDao, QcsMdfForm
|
|
|
SysUserDo sysUserDo = sysUserDos.stream().filter(u -> u.getName().equals(finaldtwhoapprove)).findFirst().orElse(null);
|
|
|
if (sysUserDo != null) {
|
|
|
importMdfVo.setDtwhoapproveuseradminid(sysUserDo.getId());
|
|
|
- importMdfVo.setDtwhoapprove(dtwhoapprove);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //修改责任方
|
|
|
- String modifyby = row.getCell(13).toString().replaceAll("\\s+", "");
|
|
|
- if (StringUtils.isNotEmpty(modifyby)) {
|
|
|
- List<Map<String, String>> mapList = unitMap.stream()
|
|
|
- .filter(umap -> {
|
|
|
- String fullname = umap.get("FULLNAME");
|
|
|
- return fullname.equals(modifyby);
|
|
|
- }).collect(Collectors.toList());
|
|
|
- if (mapList.size() > 0) {
|
|
|
- importMdfVo.setModifyby(modifyby);
|
|
|
+ } else {
|
|
|
+ stringBuilder.append("审核人" + dtwhoapprove + "不在人员表里,");
|
|
|
}
|
|
|
}
|
|
|
+ importMdfVo.setDtwhoapprove(dtwhoapprove);
|
|
|
|
|
|
- importMdfVo.setErrorroutine(row.getCell(14).toString().replaceAll("\\s+", ""));//常规错误
|
|
|
- importMdfVo.setErroragain(row.getCell(15).toString().replaceAll("\\s+", ""));//二过错误
|
|
|
- importMdfVo.setErrorhard(row.getCell(16).toString().replaceAll("\\s+", ""));//较难发现错误
|
|
|
+ importMdfVo.setErrorroutine(row.getCell(27).toString().replaceAll("\\s+", ""));//常规错误
|
|
|
+ importMdfVo.setErroragain(row.getCell(28).toString().replaceAll("\\s+", ""));//二过错误
|
|
|
+ importMdfVo.setErrorhard(row.getCell(29).toString().replaceAll("\\s+", ""));//较难发现错误
|
|
|
|
|
|
//校对表错误
|
|
|
- String errortable = row.getCell(17).toString().replaceAll("\\s+", "");
|
|
|
+ String errortable = row.getCell(30).toString().replaceAll("\\s+", "");
|
|
|
if (errortable.equals("是")) {
|
|
|
importMdfVo.setErrortable("1");
|
|
|
} else {
|
|
|
importMdfVo.setErrortable("0");
|
|
|
}
|
|
|
|
|
|
+ //修改内容
|
|
|
+ String content = row.getCell(10).toString().replaceAll("\\s+", "");
|
|
|
+ if (StringUtils.isNotEmpty(content)) {
|
|
|
+ if (StringUtil.isScience(content)) {
|
|
|
+ BigDecimal formatProjectCode = new BigDecimal(content);
|
|
|
+ content = formatProjectCode.setScale(0, BigDecimal.ROUND_HALF_UP).toPlainString();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ stringBuilder.append("修改内容必填,");
|
|
|
+ }
|
|
|
+ importMdfVo.setContent(content);
|
|
|
+
|
|
|
+ //排号
|
|
|
+ String rowsn = row.getCell(11).toString().replaceAll("\\s+", "");
|
|
|
+ if (StringUtils.isNotEmpty(rowsn)) {
|
|
|
+ if (StringUtil.isScience(rowsn)) {
|
|
|
+ BigDecimal formatProjectCode = new BigDecimal(rowsn);
|
|
|
+ rowsn = formatProjectCode.setScale(0, BigDecimal.ROUND_HALF_UP).toPlainString();
|
|
|
+ }
|
|
|
+ if (!isPositiveInteger(rowsn)) {
|
|
|
+ stringBuilder.append("排号" + rowsn + "必须为正整数,");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ importMdfVo.setRowsn(rowsn);
|
|
|
+
|
|
|
+ //备注
|
|
|
+ String remark = row.getCell(12).toString().replaceAll("\\s+", "");
|
|
|
+ if (StringUtils.isNotEmpty(remark)) {
|
|
|
+ if (StringUtil.isScience(remark)) {
|
|
|
+ BigDecimal formatProjectCode = new BigDecimal(remark);
|
|
|
+ remark = formatProjectCode.setScale(0, BigDecimal.ROUND_HALF_UP).toPlainString();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ importMdfVo.setRemark(remark);
|
|
|
+
|
|
|
//修改图号(任务单部件)
|
|
|
- String taskdesign = row.getCell(18).toString().replaceAll("\\s+", "");
|
|
|
+ String taskdesign = row.getCell(31).toString().replaceAll("\\s+", "");
|
|
|
if (StringUtils.isNotEmpty(taskdesign)) {
|
|
|
if (StringUtil.isScience(taskdesign)) {
|
|
|
BigDecimal formatProjectCode = new BigDecimal(taskdesign);
|
|
@@ -454,22 +520,20 @@ public class QcsMdfFormServiceImpl extends ServiceImpl<QcsMdfFormDao, QcsMdfForm
|
|
|
if (taskdesigns.size() == 0) {
|
|
|
stringBuilder.append("修改图号(任务单部件)" + taskdesign + "与项目工号" + procode + "不匹配,");
|
|
|
} else {
|
|
|
- importMdfVo.setTaskdesigndtdrawingno(taskdesign);
|
|
|
importMdfVo.setTaskdesigndtpartname(taskdesigns.get(0).getDtpartname());
|
|
|
}
|
|
|
- } else {
|
|
|
- importMdfVo.setTaskdesigndtdrawingno(taskdesign);
|
|
|
}
|
|
|
+ importMdfVo.setTaskdesigndtdrawingno(taskdesign);
|
|
|
|
|
|
//修改图号(次级部件)
|
|
|
- String xgth = row.getCell(20).toString().replaceAll("\\s+", "");
|
|
|
+ String xgth = row.getCell(33).toString().replaceAll("\\s+", "");
|
|
|
if (StringUtils.isNotEmpty(xgth)) {
|
|
|
if (StringUtil.isScience(xgth)) {
|
|
|
BigDecimal formatProjectCode = new BigDecimal(xgth);
|
|
|
xgth = formatProjectCode.setScale(0, BigDecimal.ROUND_HALF_UP).toPlainString();
|
|
|
}
|
|
|
- importMdfVo.setMinordesigndtdrawingno(xgth);
|
|
|
}
|
|
|
+ importMdfVo.setMinordesigndtdrawingno(xgth);
|
|
|
|
|
|
//修改图名(次级部件)
|
|
|
String xgtm = row.getCell(21).toString().replaceAll("\\s+", "");
|
|
@@ -478,21 +542,27 @@ public class QcsMdfFormServiceImpl extends ServiceImpl<QcsMdfFormDao, QcsMdfForm
|
|
|
BigDecimal formatProjectCode = new BigDecimal(xgtm);
|
|
|
xgtm = formatProjectCode.setScale(0, BigDecimal.ROUND_HALF_UP).toPlainString();
|
|
|
}
|
|
|
- importMdfVo.setMinordesigndtpartname(xgtm);
|
|
|
}
|
|
|
+ importMdfVo.setMinordesigndtpartname(xgtm);
|
|
|
|
|
|
- //修改内容
|
|
|
- String content = row.getCell(22).toString().replaceAll("\\s+", "");
|
|
|
- if (StringUtils.isNotEmpty(content)) {
|
|
|
- if (StringUtil.isScience(content)) {
|
|
|
- BigDecimal formatProjectCode = new BigDecimal(content);
|
|
|
- content = formatProjectCode.setScale(0, BigDecimal.ROUND_HALF_UP).toPlainString();
|
|
|
+ //责任单位
|
|
|
+ String dutydeptname = row.getCell(13).toString().replaceAll("\\s+", "");
|
|
|
+ if (StringUtils.isNotEmpty(dutydeptname)) {
|
|
|
+ List<Map<String, String>> mapList = unitMap.stream()
|
|
|
+ .filter(umap -> {
|
|
|
+ String fullname = umap.get("FULLNAME");
|
|
|
+ return fullname.equals(dutydeptname);
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ if (mapList.size() > 0) {
|
|
|
+ importMdfVo.setDutydeptid(mapList.get(0).get("ID"));
|
|
|
+ } else {
|
|
|
+ stringBuilder.append("责任单位" + dutydeptname + "不在组织表里,");
|
|
|
}
|
|
|
- importMdfVo.setContent(content);
|
|
|
}
|
|
|
+ importMdfVo.setDutydeptname(dutydeptname);
|
|
|
|
|
|
//人工
|
|
|
- String mandayStr = row.getCell(23).toString().replaceAll("\\s+", "");
|
|
|
+ String mandayStr = row.getCell(14).toString().replaceAll("\\s+", "");
|
|
|
if (mandayStr != null && StringUtils.isNotEmpty(mandayStr)) {
|
|
|
String toAmount = convertToTwoDecimalPlaces(mandayStr);
|
|
|
if (toAmount.equals("金额要为数字,")) {
|
|
@@ -503,7 +573,7 @@ public class QcsMdfFormServiceImpl extends ServiceImpl<QcsMdfFormDao, QcsMdfForm
|
|
|
}
|
|
|
|
|
|
//材料
|
|
|
- String materStr = row.getCell(24).toString().replaceAll("\\s+", "");
|
|
|
+ String materStr = row.getCell(15).toString().replaceAll("\\s+", "");
|
|
|
if (materStr != null && StringUtils.isNotEmpty(materStr)) {
|
|
|
String toAmount = convertToTwoDecimalPlaces(materStr);
|
|
|
if (toAmount.equals("金额要为数字,")) {
|
|
@@ -514,7 +584,7 @@ public class QcsMdfFormServiceImpl extends ServiceImpl<QcsMdfFormDao, QcsMdfForm
|
|
|
}
|
|
|
|
|
|
//设备
|
|
|
- String equipStr = row.getCell(25).toString().replaceAll("\\s+", "");
|
|
|
+ String equipStr = row.getCell(16).toString().replaceAll("\\s+", "");
|
|
|
if (equipStr != null && StringUtils.isNotEmpty(equipStr)) {
|
|
|
String toAmount = convertToTwoDecimalPlaces(equipStr);
|
|
|
if (toAmount.equals("金额要为数字,")) {
|
|
@@ -525,7 +595,7 @@ public class QcsMdfFormServiceImpl extends ServiceImpl<QcsMdfFormDao, QcsMdfForm
|
|
|
}
|
|
|
|
|
|
//其他
|
|
|
- String otherStr = row.getCell(26).toString().replaceAll("\\s+", "");
|
|
|
+ String otherStr = row.getCell(17).toString().replaceAll("\\s+", "");
|
|
|
if (otherStr != null && StringUtils.isNotEmpty(otherStr)) {
|
|
|
String toAmount = convertToTwoDecimalPlaces(otherStr);
|
|
|
if (toAmount.equals("金额要为数字,")) {
|
|
@@ -555,77 +625,228 @@ public class QcsMdfFormServiceImpl extends ServiceImpl<QcsMdfFormDao, QcsMdfForm
|
|
|
));
|
|
|
List<Map<String, String>> finalResDutyList = resDutyList;
|
|
|
formList.forEach((fm, flist) -> {
|
|
|
- List<QcsMdfFormDo> hasMdfForms = qcsMdfFormDos.stream().filter(hm -> hm.getProjectdlprojid().equals(fm.getProjectdlprojid()) && hm.getSourcenumbercode().equals(fm.getSourcenumbercode())).collect(Collectors.toList());
|
|
|
- if (hasMdfForms.size() > 0) {
|
|
|
- allStrBuilder.append("项目工号" + fm.getProjectdlprojid() + ",修改单编号" + fm.getSourcenumbercode() + "系统已存在,请确认");
|
|
|
+ //修改单分组
|
|
|
+ Map<ImportMdfVo, List<ImportMdfVo>> formListMap = flist.stream().collect(Collectors.groupingBy(
|
|
|
+ f -> new ImportMdfVo(f.getTypename(), f.getSourcename(), f.getNumbername(), f.getRectifycode(), f.getManageadminnickname(), f.getProducename())
|
|
|
+ ));
|
|
|
+ if (formListMap.size() > 1) {
|
|
|
+ allStrBuilder.append("项目工号" + fm.getProjectdlprojid() + ",修改单编号" + fm.getSourcenumbercode() + "有" + formListMap.size() + "行,但主表列数据产品类型、类别、修改原因、整改编号、项目总工、项目生产阶段有不同,请检查<br>");
|
|
|
} else {
|
|
|
- //修改单分组
|
|
|
- Map<ImportMdfVo, List<ImportMdfVo>> formListMap = flist.stream().collect(Collectors.groupingBy(
|
|
|
- f -> new ImportMdfVo(f.getSourcename(), f.getNumbername(), f.getRectifycode(), f.getManageadminnickname(), f.getProducename())
|
|
|
- ));
|
|
|
- if (formListMap.size() > 1) {
|
|
|
- allStrBuilder.append("项目工号" + fm.getProjectdlprojid() + ",修改单编号" + fm.getSourcenumbercode() + "有" + formListMap.size() + "行数据重复,请检查");
|
|
|
+ //主表数据
|
|
|
+ ImportMdfVo mdfVo = qcsMdfFormDos.stream().filter(mv -> fm.getProjectdlprojid().equals(mv.getProjectdlprojid()) && fm.getSourcenumbercode().equals(mv.getSourcenumbercode())).findAny().orElse(null);
|
|
|
+ String formid = "";
|
|
|
+ if (mdfVo == null) {
|
|
|
+ formid = SecurityUtil.getUUID();
|
|
|
} else {
|
|
|
- String formid = SecurityUtil.getUUID();
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ if (!flist.get(0).getTypename().equals(mdfVo.getTypename())) {
|
|
|
+ sb.append("产品类型" + flist.get(0).getTypename() + "与系统产品类型" + mdfVo.getTypename() + "不同,");
|
|
|
+ }
|
|
|
+ if (!flist.get(0).getNumbername().equals(mdfVo.getNumbername())) {
|
|
|
+ sb.append("类别" + flist.get(0).getNumbername() + "与系统类别" + mdfVo.getNumbername() + "不同,");
|
|
|
+ }
|
|
|
+ if (!flist.get(0).getSourcename().equals(mdfVo.getSourcename())) {
|
|
|
+ sb.append("修改原因" + flist.get(0).getSourcename() + "与系统修改原因" + mdfVo.getSourcename() + "不同,");
|
|
|
+ }
|
|
|
+ if (!flist.get(0).getRectifycode().equals(mdfVo.getRectifycode())) {
|
|
|
+ sb.append("整改编号" + flist.get(0).getRectifycode() + "与系统整改编号" + mdfVo.getRectifycode() + "不同,");
|
|
|
+ }
|
|
|
+ if (!flist.get(0).getManageadminnickname().equals(mdfVo.getManageadminnickname())) {
|
|
|
+ sb.append("项目总工" + flist.get(0).getManageadminnickname() + "与系统项目总工" + mdfVo.getManageadminnickname() + "不同,");
|
|
|
+ }
|
|
|
+ if (!flist.get(0).getProducename().equals(mdfVo.getProducename())) {
|
|
|
+ sb.append("项目生产阶段" + flist.get(0).getProducename() + "与系统项目生产阶段" + mdfVo.getProducename() + "不同,");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(sb.toString())) {
|
|
|
+ allStrBuilder.append("项目工号" + fm.getProjectdlprojid() + ",修改单编号" + fm.getSourcenumbercode() + "已存在,但导入的主表数据" + sb.toString() + "请检查<br>");
|
|
|
+ } else {
|
|
|
+ formid = mdfVo.getId();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(allStrBuilder.toString())) {
|
|
|
+ AtomicReference<Integer> maxSectionSn = new AtomicReference<>(0);
|
|
|
//序号分组
|
|
|
Map<ImportMdfVo, List<ImportMdfVo>> mdfVoListMap = flist.stream().collect(Collectors.groupingBy(
|
|
|
- p -> new ImportMdfVo(p.getErrordesigndtdrawingno(), p.getDtdesigner(), p.getDtwhocollate(), p.getDtwhoapprove(), p.getModifyby(), p.getErrorroutine(), p.getErroragain(), p.getErrorhard(), p.getErrortable())
|
|
|
+ p -> new ImportMdfVo(p.getSectionsn(), p.getModifyby(), p.getErrordesigndtdrawingno(), p.getDtdesigner(), p.getDtwhocollate(), p.getDtwhoapprove(), p.getErrorroutine(), p.getErroragain(), p.getErrorhard(), p.getErrortable())
|
|
|
));
|
|
|
+ String finalFormid = formid;
|
|
|
+ String finalFormid1 = formid;
|
|
|
mdfVoListMap.forEach((mvo, slist) -> {
|
|
|
- for (int s = 0; s < slist.size(); s++) {
|
|
|
- String sectionid = SecurityUtil.getUUID();
|
|
|
+// for (int s = 0; s < slist.size(); s++) {
|
|
|
+ List<ImportMdfVo> secVos;
|
|
|
+ String sectionid = "";
|
|
|
+ if (StringUtils.isBlank(mvo.getSectionsn())) {
|
|
|
+ sectionid = SecurityUtil.getUUID();
|
|
|
+ secVos = qcsMdfFormDos.stream().filter(sv -> fm.getProjectdlprojid().equals(sv.getProjectdlprojid()) && fm.getSourcenumbercode().equals(sv.getSourcenumbercode())).collect(Collectors.toList());
|
|
|
+ if (secVos.size() == 0) {
|
|
|
+ maxSectionSn.getAndSet(maxSectionSn.get() + 1);
|
|
|
+ } else {
|
|
|
+ maxSectionSn.getAndSet(Integer.parseInt(secVos.get(secVos.size() - 1).getSectionsn()) + 1);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ secVos = qcsMdfFormDos.stream().filter(sv -> fm.getProjectdlprojid().equals(sv.getProjectdlprojid()) && fm.getSourcenumbercode().equals(sv.getSourcenumbercode()) && mvo.getSectionsn().equals(sv.getSectionsn())).collect(Collectors.toList());
|
|
|
+ if (secVos.size() == 0) {
|
|
|
+ sectionid = SecurityUtil.getUUID();
|
|
|
+ maxSectionSn.getAndSet(Integer.parseInt(mvo.getSectionsn()));
|
|
|
+ } else {
|
|
|
+ ImportMdfVo secVo = secVos.get(0);
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ if (!mvo.getModifyby().equals(secVo.getModifyby())) {
|
|
|
+ sb.append("修改责任方" + mvo.getModifyby() + "与系统修改责任方" + secVo.getModifyby() + "不同,");
|
|
|
+ }
|
|
|
+ if (!mvo.getErrordesigndtdrawingno().equals(secVo.getErrordesigndtdrawingno())) {
|
|
|
+ sb.append("错误源头图号" + mvo.getErrordesigndtdrawingno() + "与系统错误源头图号" + secVo.getErrordesigndtdrawingno() + "不同,");
|
|
|
+ }
|
|
|
+ if (!mvo.getDtdesigner().equals(secVo.getDtdesigner())) {
|
|
|
+ sb.append("设计人" + mvo.getDtdesigner() + "与系统设计人" + secVo.getDtdesigner() + "不同,");
|
|
|
+ }
|
|
|
+ if (!mvo.getDtwhocollate().equals(secVo.getDtwhocollate())) {
|
|
|
+ sb.append("校对人" + mvo.getDtwhocollate() + "与系统校对人" + secVo.getDtwhocollate() + "不同,");
|
|
|
+ }
|
|
|
+ if (!mvo.getDtwhoapprove().equals(secVo.getDtwhoapprove())) {
|
|
|
+ sb.append("审核人" + mvo.getDtwhoapprove() + "与系统审核人" + secVo.getDtwhoapprove() + "不同,");
|
|
|
+ }
|
|
|
+ if (!mvo.getErrorroutine().equals(secVo.getErrorroutine())) {
|
|
|
+ sb.append("常规错误" + mvo.getErrorroutine() + "与系统常规错误" + secVo.getErrorroutine() + "不同,");
|
|
|
+ }
|
|
|
+ if (!mvo.getErroragain().equals(secVo.getErroragain())) {
|
|
|
+ sb.append("二过错误" + mvo.getErroragain() + "与系统二过错误" + secVo.getErroragain() + "不同,");
|
|
|
+ }
|
|
|
+ if (!mvo.getErrorhard().equals(secVo.getErrorhard())) {
|
|
|
+ sb.append("较难发现错误" + mvo.getErrorhard() + "与系统较难发现错误" + secVo.getErrorhard() + "不同,");
|
|
|
+ }
|
|
|
+ if (!mvo.getErrortable().equals(secVo.getErrortable())) {
|
|
|
+ sb.append("校对表错误" + mvo.getErrortable() + "与系统校对表错误" + secVo.getErrortable() + "不同,");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(sb.toString())) {
|
|
|
+ allStrBuilder.append("项目工号" + fm.getProjectdlprojid() + ",修改单编号" + fm.getSourcenumbercode() + ",内容序号" + mvo.getSectionsn() + "已存在,但导入的数据" + sb.toString() + "请检查<br>");
|
|
|
+ } else {
|
|
|
+ sectionid = secVo.getSectionid();
|
|
|
+ maxSectionSn.getAndSet(Integer.parseInt(mvo.getSectionsn()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ slist.get(0).setSectionsn(maxSectionSn.toString());
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(allStrBuilder.toString())) {
|
|
|
+ AtomicReference<Integer> maxRowSn = new AtomicReference<>(0);
|
|
|
//修改图号(任务单部件)分组
|
|
|
Map<ImportMdfVo, List<ImportMdfVo>> rowListMap = slist.stream().collect(Collectors.groupingBy(
|
|
|
- m -> new ImportMdfVo(mvo.getTaskdesigndtdrawingno(), m.getMinordesigndtdrawingno(), m.getMinordesigndtpartname(), m.getContent(), m.getManday(), m.getMater(), m.getEquip(), m.getOther())
|
|
|
+ m -> new ImportMdfVo(m.getContent(), m.getRowsn(), m.getRemark(), mvo.getTaskdesigndtdrawingno(), m.getMinordesigndtdrawingno(), m.getMinordesigndtpartname(), m.getDutydeptname(), m.getManday(), m.getMater(), m.getEquip(), m.getOther())
|
|
|
));
|
|
|
+ String finalSectionid = sectionid;
|
|
|
rowListMap.forEach((rvo, rlist) -> {
|
|
|
for (int r = 0; r < rlist.size(); r++) {
|
|
|
- String rowid = SecurityUtil.getUUID();
|
|
|
- QcsMdfRowDo qcsMdfRowDo = BeanUtil.toBean(rlist.get(r), QcsMdfRowDo.class);
|
|
|
- qcsMdfRowDo.setId(rowid);
|
|
|
- qcsMdfRowDo.setFormid(formid);
|
|
|
- qcsMdfRowDo.setSectionid(sectionid);
|
|
|
- qcsMdfRowDo.setRoption(ropJson);
|
|
|
- qcsMdfRowDoList.add(qcsMdfRowDo);
|
|
|
-
|
|
|
- QcsMdfDetailDo qcsMdfDetailDo = BeanUtil.toBean(rlist.get(r), QcsMdfDetailDo.class);
|
|
|
- qcsMdfDetailDo.setId(SecurityUtil.getUUID());
|
|
|
- qcsMdfDetailDo.setRowid(rowid);
|
|
|
- qcsMdfDetailDo.setFormid(formid);
|
|
|
- qcsMdfDetailDo.setSectionid(sectionid);
|
|
|
- qcsMdfDetailDo.setRoption(ropJson);
|
|
|
- qcsMdfDetailDo.setDeptid(unitId);
|
|
|
- qcsMdfDetailDo.setDeptname(finalDeptName);
|
|
|
- qcsMdfDetailDo.setMdfreason(flist.get(0).getSourcename());
|
|
|
- if (rlist.get(r).getProducename().equals("未下料")) {
|
|
|
- qcsMdfDetailDo.setManday(null);
|
|
|
- qcsMdfDetailDo.setMater(null);
|
|
|
- qcsMdfDetailDo.setEquip(null);
|
|
|
- qcsMdfDetailDo.setOther(null);
|
|
|
+ String rowid = "";
|
|
|
+ String detailid = SecurityUtil.getUUID();
|
|
|
+ List<ImportMdfVo> rowVos;
|
|
|
+ if (StringUtils.isBlank(rlist.get(r).getRowsn())) {
|
|
|
+ rowid = SecurityUtil.getUUID();
|
|
|
+ rowVos = qcsMdfFormDos.stream().filter(rv -> fm.getProjectdlprojid().equals(rv.getProjectdlprojid()) && fm.getSourcenumbercode().equals(rv.getSourcenumbercode()) && slist.get(0).getSectionsn().equals(rv.getSectionsn())).collect(Collectors.toList());
|
|
|
+ if (rowVos.size() == 0) {
|
|
|
+ maxRowSn.getAndSet(maxRowSn.get() + 1);
|
|
|
+ } else {
|
|
|
+ maxRowSn.getAndSet(Integer.parseInt(rowVos.get(rowVos.size() - 1).getRowsn()) + 1);
|
|
|
+ }
|
|
|
} else {
|
|
|
- BigDecimal total = sumTotal(qcsMdfDetailDo);
|
|
|
- qcsMdfDetailDo.setTotalamount(total);
|
|
|
- qcsMdfDetailDo.setActamount(total);
|
|
|
+ int finalR = r;
|
|
|
+ rowVos = qcsMdfFormDos.stream().filter(rv -> fm.getProjectdlprojid().equals(rv.getProjectdlprojid()) && fm.getSourcenumbercode().equals(rv.getSourcenumbercode()) && slist.get(0).getSectionsn().equals(rv.getSectionsn()) && rlist.get(finalR).getRowsn().equals(rv.getRowsn())).collect(Collectors.toList());
|
|
|
+ if (rowVos.size() == 0) {
|
|
|
+ rowid = SecurityUtil.getUUID();
|
|
|
+ maxRowSn.getAndSet(Integer.parseInt(rlist.get(r).getRowsn()));
|
|
|
+ } else {
|
|
|
+ ImportMdfVo rowVo = qcsMdfFormDos.stream().filter(rv -> fm.getProjectdlprojid().equals(rv.getProjectdlprojid()) && fm.getSourcenumbercode().equals(rv.getSourcenumbercode()) && slist.get(0).getSectionsn().equals(rv.getSectionsn()) && rlist.get(finalR).getRowsn().equals(rv.getRowsn()) && unitId.equals(rv.getDeptid())).findAny().orElse(null);
|
|
|
+ if (rowVo == null) {
|
|
|
+ rowid = SecurityUtil.getUUID();
|
|
|
+ maxRowSn.getAndSet(Integer.parseInt(rowVos.get(rowVos.size() - 1).getRowsn()) + 1);
|
|
|
+ } else {
|
|
|
+ if (!rlist.get(r).getRemark().equals(rowVo.getRemark())) {
|
|
|
+ rowid = SecurityUtil.getUUID();
|
|
|
+ maxRowSn.getAndSet(Integer.parseInt(rowVos.get(rowVos.size() - 1).getRowsn()) + 1);
|
|
|
+ } else {
|
|
|
+ if (rowVo.getStatus().equals("已提交")) {
|
|
|
+ allStrBuilder.append("项目工号" + fm.getProjectdlprojid() + ",修改单编号" + fm.getSourcenumbercode() + ",内容序号" + mvo.getSectionsn() + ",排号" + rlist.get(r).getRowsn() + "数据已提交,请检查<br>");
|
|
|
+ } else {
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ if (!rlist.get(r).getContent().equals(rowVo.getContent())) {
|
|
|
+ sb.append("修改内容" + rlist.get(r).getContent() + "与系统修改内容" + rowVo.getContent() + "不同,");
|
|
|
+ }
|
|
|
+ if (!rlist.get(r).getTaskdesigndtdrawingno().equals(rowVo.getTaskdesigndtdrawingno())) {
|
|
|
+ sb.append("修改图号(任务单部件)" + rlist.get(r).getTaskdesigndtdrawingno() + "与系统修改图号(任务单部件)" + rowVo.getTaskdesigndtdrawingno() + "不同,");
|
|
|
+ }
|
|
|
+ if (!rlist.get(r).getMinordesigndtdrawingno().equals(rowVo.getMinordesigndtdrawingno())) {
|
|
|
+ sb.append("修改图号(次级部件)" + rlist.get(r).getMinordesigndtdrawingno() + "与系统修改图号(次级部件)" + rowVo.getMinordesigndtdrawingno() + "不同,");
|
|
|
+ }
|
|
|
+ if (!rlist.get(r).getMinordesigndtpartname().equals(rowVo.getMinordesigndtpartname())) {
|
|
|
+ sb.append("修改图名(次级部件)" + rlist.get(r).getMinordesigndtpartname() + "与系统修改图名(次级部件)" + rowVo.getMinordesigndtpartname() + "不同,");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotBlank(sb.toString())) {
|
|
|
+ allStrBuilder.append("项目工号" + fm.getProjectdlprojid() + ",修改单编号" + fm.getSourcenumbercode() + ",内容序号" + mvo.getSectionsn() + ",排号" + rlist.get(r).getRowsn() + "已存在,但导入的数据" + sb.toString() + "请检查<br>");
|
|
|
+ } else {
|
|
|
+ rowid = rowVo.getRowid();
|
|
|
+ detailid = rowVo.getDetailid();
|
|
|
+ maxRowSn.getAndSet(Integer.parseInt(rlist.get(r).getRowsn()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- if (finalResDutyList.size() > 0) {
|
|
|
- qcsMdfDetailDo.setDutydeptid(finalResDutyList.get(0).get("DUTYDEPTID"));
|
|
|
- qcsMdfDetailDo.setDutydeptname(finalResDutyList.get(0).get("DUTYDEPTNAME"));
|
|
|
- } else if (flist.get(0).getSourcename().equals("基地要求")) {
|
|
|
- qcsMdfDetailDo.setDutydeptid(unitId);
|
|
|
- qcsMdfDetailDo.setDutydeptname(finalDeptName);
|
|
|
+ rlist.get(r).setRowsn(maxRowSn.toString());
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(allStrBuilder.toString())) {
|
|
|
+ QcsMdfRowDo qcsMdfRowDo = BeanUtil.toBean(rlist.get(r), QcsMdfRowDo.class);
|
|
|
+ qcsMdfRowDo.setId(rowid);
|
|
|
+ qcsMdfRowDo.setRowsn(slist.get(0).getSectionsn() + "-" + qcsMdfRowDo.getRowsn());
|
|
|
+ qcsMdfRowDo.setFormid(finalFormid);
|
|
|
+ qcsMdfRowDo.setSectionid(finalSectionid);
|
|
|
+ qcsMdfRowDo.setRoption(ropJson);
|
|
|
+ qcsMdfRowDoList.add(qcsMdfRowDo);
|
|
|
+
|
|
|
+ QcsMdfDetailDo qcsMdfDetailDo = BeanUtil.toBean(rlist.get(r), QcsMdfDetailDo.class);
|
|
|
+ qcsMdfDetailDo.setId(detailid);
|
|
|
+ qcsMdfDetailDo.setRowid(rowid);
|
|
|
+ qcsMdfDetailDo.setFormid(finalFormid);
|
|
|
+ qcsMdfDetailDo.setSectionid(finalSectionid);
|
|
|
+ qcsMdfDetailDo.setRoption(ropJson);
|
|
|
+ qcsMdfDetailDo.setDeptid(unitId);
|
|
|
+ qcsMdfDetailDo.setDeptname(finalDeptName);
|
|
|
+ qcsMdfDetailDo.setMdfreason(flist.get(0).getSourcename());
|
|
|
+ if (rlist.get(r).getProducename().equals("未下料")) {
|
|
|
+ qcsMdfDetailDo.setManday(null);
|
|
|
+ qcsMdfDetailDo.setMater(null);
|
|
|
+ qcsMdfDetailDo.setEquip(null);
|
|
|
+ qcsMdfDetailDo.setOther(null);
|
|
|
+ } else {
|
|
|
+ BigDecimal total = sumTotal(qcsMdfDetailDo);
|
|
|
+ qcsMdfDetailDo.setTotalamount(total);
|
|
|
+ qcsMdfDetailDo.setActamount(total);
|
|
|
+ }
|
|
|
+ if (finalResDutyList.size() > 0) {
|
|
|
+ qcsMdfDetailDo.setDutydeptid(finalResDutyList.get(0).get("DUTYDEPTID"));
|
|
|
+ qcsMdfDetailDo.setDutydeptname(finalResDutyList.get(0).get("DUTYDEPTNAME"));
|
|
|
+ } else if (flist.get(0).getSourcename() != null && flist.get(0).getSourcename().equals("基地要求")) {
|
|
|
+ qcsMdfDetailDo.setDutydeptid(unitId);
|
|
|
+ qcsMdfDetailDo.setDutydeptname(finalDeptName);
|
|
|
+ }
|
|
|
+ qcsMdfDetailDoList.add(qcsMdfDetailDo);
|
|
|
}
|
|
|
- qcsMdfDetailDoList.add(qcsMdfDetailDo);
|
|
|
}
|
|
|
});
|
|
|
+ }
|
|
|
|
|
|
- if (StringUtils.isBlank(allStrBuilder.toString())) {
|
|
|
- QcsMdfSectionDo qcsMdfSectionDo = BeanUtil.toBean(slist.get(s), QcsMdfSectionDo.class);
|
|
|
- qcsMdfSectionDo.setId(sectionid);
|
|
|
- qcsMdfSectionDo.setFormid(formid);
|
|
|
- qcsMdfSectionDo.setRoption(ropJson);
|
|
|
- qcsMdfSectionDoList.add(qcsMdfSectionDo);
|
|
|
- }
|
|
|
+ if (StringUtils.isBlank(allStrBuilder.toString())) {
|
|
|
+ QcsMdfSectionDo qcsMdfSectionDo = BeanUtil.toBean(slist.get(0), QcsMdfSectionDo.class);
|
|
|
+ qcsMdfSectionDo.setId(sectionid);
|
|
|
+ qcsMdfSectionDo.setFormid(finalFormid1);
|
|
|
+ qcsMdfSectionDo.setRoption(ropJson);
|
|
|
+ qcsMdfSectionDoList.add(qcsMdfSectionDo);
|
|
|
}
|
|
|
+// }
|
|
|
});
|
|
|
if (StringUtils.isBlank(allStrBuilder.toString())) {
|
|
|
QcsMdfFormDo qcsMdfFormDo = BeanUtil.toBean(flist.get(0), QcsMdfFormDo.class);
|
|
@@ -648,10 +869,10 @@ public class QcsMdfFormServiceImpl extends ServiceImpl<QcsMdfFormDao, QcsMdfForm
|
|
|
if (StringUtils.isNotBlank(allStrBuilder.toString())) {
|
|
|
return R.error(allStrBuilder.toString());
|
|
|
} else {
|
|
|
- Boolean bool1 = qcsMdfFormService.saveBatch(qcsMdfFormDoList);
|
|
|
- Boolean bool2 = qcsMdfSectionService.saveBatch(qcsMdfSectionDoList);
|
|
|
- Boolean bool3 = qcsMdfRowService.saveBatch(qcsMdfRowDoList);
|
|
|
- Boolean bool4 = qcsMdfDetailService.saveBatch(qcsMdfDetailDoList);
|
|
|
+ Boolean bool1 = qcsMdfFormService.saveOrUpdateBatch(qcsMdfFormDoList);
|
|
|
+ Boolean bool2 = qcsMdfSectionService.saveOrUpdateBatch(qcsMdfSectionDoList);
|
|
|
+ Boolean bool3 = qcsMdfRowService.saveOrUpdateBatch(qcsMdfRowDoList);
|
|
|
+ Boolean bool4 = qcsMdfDetailService.saveOrUpdateBatch(qcsMdfDetailDoList);
|
|
|
if (bool1 && bool2 && bool3 && bool4) {
|
|
|
for (String fid : formids) {
|
|
|
Map<String, String> aMap = new HashMap<>();
|
|
@@ -668,6 +889,11 @@ public class QcsMdfFormServiceImpl extends ServiceImpl<QcsMdfFormDao, QcsMdfForm
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //正整数
|
|
|
+ public static boolean isPositiveInteger(String str) {
|
|
|
+ return str != null && str.matches("\\d+") && !str.startsWith("0");
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void excelExport(Map<String, String> params, HttpServletResponse response) throws IOException {
|
|
|
logger.info("Excel导出开始...");
|