Explorar el Código

公式相关:G8自定义偏差范围;节点参数bug

yangyj hace 2 años
padre
commit
987b490c22

+ 2 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsParamController.java

@@ -158,14 +158,14 @@ public class WbsParamController {
                     for (WbsParamBean b : updateList) {
                         WbsParam old = this.service.getById(b.getId());
                         if (pb.isCommon()) {
-                            if (old != null && (!old.getV().equals(b.getV())||StringUtils.isNotEquals(old.getRemark(),b.getRemark()))) {
+                            if (old != null && (StringUtils.isNotEquals(old.getK(),b.getK())||StringUtils.isNotEquals(old.getRemark(),b.getRemark()))) {
                                 /*只有公式内容变化的时候才需要更新*/
                                 old.setIsDeleted(0);
                                 BeanUtils.copyProperties(b, old);
                                 ul.add(old);
                             }
                         } else {
-                            if (old != null && (!old.getV().equals(b.getV())||StringUtils.isNotEquals(old.getRemark(),b.getRemark()))) {
+                            if (old != null && (StringUtils.isNotEquals(old.getV(),b.getV())||StringUtils.isNotEquals(old.getRemark(),b.getRemark()))) {
                                 /*只有公式内容变化的时候才需要更新*/
                                 old.setIsDeleted(0);
                                 BeanUtils.copyProperties(b, old);

+ 5 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/formula/ITurnPointCalculator.java

@@ -8,6 +8,7 @@ import org.springblade.manager.formula.impl.TableElementConverter;
 
 import java.math.BigDecimal;
 import java.util.*;
+import java.util.concurrent.ThreadLocalRandom;
 import java.util.stream.Collectors;
 
 import static com.mixsmart.utils.CustomFunction.rangeList;
@@ -90,7 +91,8 @@ public interface ITurnPointCalculator {
                         TurnPoint close = new TurnPoint(levelInfo, new HashMap<>());
                         close.setName(levelInfo.getBmdName());
                         close.setSj(levelInfo.getBmdSj());
-                        double ldx = Double.parseDouble(rangeList(1, 0, levelInfo.getDx(), 0.001, 3, 1).get(0).toString());
+                        /*闭合点的偏差范围是±3mm*/
+                        double ldx=Arrays.asList(-3,-2,-1,1,2,3).get(ThreadLocalRandom.current().nextInt(6));
                         close.setSc(close.getSj0L() + ldx);
                         close.setDx(ldx);
                         close.setType(TurnPoint.CLOSE);
@@ -114,6 +116,8 @@ public interface ITurnPointCalculator {
         return Collections.emptyList();
     }
 
+
+
     static List<TurnPoint> fill(List<TurnPoint> turnPointList) {
         if (ListUtils.isNotEmpty(turnPointList)) {
             Random rd = new Random();