|
@@ -577,14 +577,32 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
|
|
|
String stringCellValue = steelStampNumberCell.getStringCellValue();
|
|
|
String[] split = stringCellValue.split("[|\\,\\,]");
|
|
|
for (String s : split) {
|
|
|
+ String[] targetSplit = s.split(",");
|
|
|
+ if(targetSplit.length!=2){
|
|
|
+ msg.setError("数据["+s+"]钢印号数组及下标错误");
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ String steelStampNum=split[0];
|
|
|
+ String indexNum=split[1];
|
|
|
PlanSteelStampNumber p=new PlanSteelStampNumber();
|
|
|
- if(s.contains("-")){
|
|
|
- String[] split1 = s.split("-");
|
|
|
+ if(steelStampNum.contains("-")){
|
|
|
+ String[] split1 = steelStampNum.split("-");
|
|
|
p.setSteelStampNumberStart(split1[0]);
|
|
|
p.setSteelStampNumberEnd(split1[1]);
|
|
|
}else {
|
|
|
- p.setSteelStampNumberStart(s);
|
|
|
- p.setSteelStampNumberEnd(s);
|
|
|
+ p.setSteelStampNumberStart(steelStampNum);
|
|
|
+ p.setSteelStampNumberEnd(steelStampNum);
|
|
|
+ }
|
|
|
+ if(indexNum.contains("-")){
|
|
|
+ String[] split2 = indexNum.split("-");
|
|
|
+ if(Integer.valueOf(split2[1])>Integer.valueOf(split2[0])){
|
|
|
+ msg.setError("钢印号数组["+s+"]下标异常,第二下标不能大于第一下标");
|
|
|
+ }
|
|
|
+ p.setRuleIndexStart(Integer.valueOf(split2[0]));
|
|
|
+ p.setRuleIndexEnd(Integer.valueOf(split2[1]));
|
|
|
+ }else {
|
|
|
+ p.setRuleIndexStart(Integer.valueOf(indexNum));
|
|
|
+ p.setRuleIndexEnd(Integer.valueOf(indexNum));
|
|
|
}
|
|
|
planSteelStampNumberList.add(p);
|
|
|
}
|