修改OTA
This commit is contained in:
+5
-1
@@ -292,6 +292,8 @@ public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl<OtaBaCxJsfzbacsMappe
|
||||
ComparisonUtil cu = new ComparisonUtil();
|
||||
if (ObjectUtils.isEmpty(otaBaCxJsfzbacsOld)) {
|
||||
otaBaCxJsfzbacsOld = new OtaBaCxJsfzbacs();
|
||||
}else{
|
||||
deleteById(otaBaCxJsfzbacsOld.getId());
|
||||
}
|
||||
List<OtaBaCxTxjl> reList = cu.comparisonRecord(otaId, OtaModuleEnum.CX_JSFZXTJCBACS, otaBaCxJsfzbacsOld, basc, sysDictService);
|
||||
saveOrUpdate(basc);
|
||||
@@ -314,7 +316,7 @@ public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl<OtaBaCxJsfzbacsMappe
|
||||
Workbook wb = ImportFileUtil.readExcel(upFile);
|
||||
Sheet s = wb.getSheetAt(0);
|
||||
int rows = s.getPhysicalNumberOfRows();
|
||||
for (int i = 63; i < rows; i++) {
|
||||
for (int i = 64; i < rows; i++) {
|
||||
Row row = s.getRow(i);
|
||||
Cell cell = row.getCell(0);
|
||||
String str = ImportFileUtil.getCellValue(cell, wb);
|
||||
@@ -605,6 +607,8 @@ public class OtaBaCxJsfzbacsServiceImpl extends ServiceImpl<OtaBaCxJsfzbacsMappe
|
||||
row = s.getRow(59);
|
||||
cell = row.getCell(4);
|
||||
bass.setEdrScqy(ImportFileUtil.getCellValue(cell, wb));
|
||||
ComparisonUtil cu = new ComparisonUtil();
|
||||
cu.checkError(bass, errMsg, sysDictService, cut);
|
||||
return bass;
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -201,17 +201,17 @@ public class ComparisonUtil<T> {
|
||||
if ("0".equals(ote.getType())) {
|
||||
if (str.length() > ote.getLen()) {
|
||||
errMsg.append(title + " 的长度超过了 " + ote.getLen() + ", ");
|
||||
field.set(clazz, "");
|
||||
field.set(clazz, null);
|
||||
}
|
||||
} else if ("1".equals(ote.getType())) {
|
||||
if (!"1".equals(str) && !"2".equals(str)) {
|
||||
errMsg.append(title + " 必须填写有或无, ");
|
||||
field.set(clazz, "");
|
||||
field.set(clazz, null);
|
||||
}
|
||||
} else if ("2".equals(ote.getType())) {
|
||||
if (!"1".equals(str) && !"2".equals(str)) {
|
||||
errMsg.append(title + " 必须填写是或否, ");
|
||||
field.set(clazz, "");
|
||||
field.set(clazz, null);
|
||||
}
|
||||
} else if ("3".equals(ote.getType())) {
|
||||
//不处理
|
||||
@@ -221,7 +221,7 @@ public class ComparisonUtil<T> {
|
||||
String res = sysDictService.queryDictTextByKeyEn(ote.getType(), s, cut);
|
||||
if (StringUtils.isEmpty(res)) {
|
||||
errMsg.append(title + " 填写了无法识别的选项, ");
|
||||
field.set(clazz, "");
|
||||
field.set(clazz, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+6
-6
@@ -166,7 +166,7 @@ public class ImportFileUtil {
|
||||
|
||||
|
||||
public static String getCellValueHaveOrNot(Cell cell, Workbook workbook) throws Exception {
|
||||
String res = "";
|
||||
String res = "3";
|
||||
String str = getCellValue(cell, workbook);
|
||||
if (StringUtils.isNotEmpty(str)) {
|
||||
if (str.equals("有")) {
|
||||
@@ -179,7 +179,7 @@ public class ImportFileUtil {
|
||||
}
|
||||
|
||||
public static String getCellValueHaveOrNotInt(Integer val) throws Exception {
|
||||
String res = "";
|
||||
String res = "3";
|
||||
if (ObjectUtils.isNotEmpty(val)) {
|
||||
if (val.equals(1)) {
|
||||
res = "有";
|
||||
@@ -191,7 +191,7 @@ public class ImportFileUtil {
|
||||
}
|
||||
|
||||
public static String getCellValueYesOrNo(Cell cell, Workbook workbook) throws Exception {
|
||||
String res = "";
|
||||
String res = "3";
|
||||
String str = getCellValue(cell, workbook);
|
||||
if (StringUtils.isNotEmpty(str)) {
|
||||
if (str.equals("是")) {
|
||||
@@ -204,7 +204,7 @@ public class ImportFileUtil {
|
||||
}
|
||||
|
||||
public static String getCellValueYesOrNoInt(Integer val) throws Exception {
|
||||
String res = "";
|
||||
String res = "3";
|
||||
if (ObjectUtils.isNotEmpty(val)) {
|
||||
if (val.equals(1)) {
|
||||
res = "是";
|
||||
@@ -216,7 +216,7 @@ public class ImportFileUtil {
|
||||
}
|
||||
|
||||
public static String getCellValueHaveOrNot(String str) throws Exception {
|
||||
String res = "";
|
||||
String res = "3";
|
||||
if (StringUtils.isNotEmpty(str)) {
|
||||
if (str.equals("1")) {
|
||||
res = "有";
|
||||
@@ -228,7 +228,7 @@ public class ImportFileUtil {
|
||||
}
|
||||
|
||||
public static String getCellValueYesOrNo(String str) throws Exception {
|
||||
String res = "";
|
||||
String res = "3";
|
||||
if (StringUtils.isNotEmpty(str)) {
|
||||
if (str.equals("1")) {
|
||||
res = "是";
|
||||
|
||||
Reference in New Issue
Block a user