Min 1 year ago
parent
commit
287bf06d83

+ 22 - 4
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/PlanServiceImpl.java

@@ -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);
                         }

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue

@@ -1152,7 +1152,7 @@
                 </el-table-column>
                 <el-table-column prop="manDay" width="200" label="预估工时" >
                     <template slot-scope="scope">
-                        <el-input v-model="scope.row.manDay" type="number"  :placeholder="$t('peaseenterthe')" maxlength="10" :max="99999" style="width:120px;"></el-input>&nbsp;人天&nbsp;<i @click="changeBudget(scope.row)"  class="el-icon-circle-plus-outline"></i>
+                        <el-input v-model="scope.row.manDay" type="number"  :placeholder="$t('peaseenterthe')" maxlength="10" :max="99999" style="width:120px;"></el-input>&nbsp;人天&nbsp;<i v-if="user.companyId=3092"  @click="changeBudget(scope.row)"  class="el-icon-circle-plus-outline"></i>
                     </template>
                 </el-table-column>
             </el-table>