|
@@ -122,6 +122,9 @@ public class MixProportionInfoServiceImpl extends BaseServiceImpl<MixProportionI
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public R calculateWater(MoistureContentDTO dto) {
|
|
public R calculateWater(MoistureContentDTO dto) {
|
|
|
|
+ if (StringUtils.isBlank(dto.getDesignStrength())){
|
|
|
|
+ throw new ServiceException("请先选择设计强度");
|
|
|
|
+ }
|
|
//获取位置前缀后缀
|
|
//获取位置前缀后缀
|
|
String prefix= dto.getKey().replaceAll("__[\\d_]+", "");
|
|
String prefix= dto.getKey().replaceAll("__[\\d_]+", "");
|
|
String suffix = dto.getKey().replaceAll("key_\\d+__", "");
|
|
String suffix = dto.getKey().replaceAll("key_\\d+__", "");
|
|
@@ -138,34 +141,49 @@ public class MixProportionInfoServiceImpl extends BaseServiceImpl<MixProportionI
|
|
throw new ServiceException("获取配合比信息失败");
|
|
throw new ServiceException("获取配合比信息失败");
|
|
}
|
|
}
|
|
//含水量计算
|
|
//含水量计算
|
|
|
|
+ BigDecimal sand = new BigDecimal(0);
|
|
|
|
+ BigDecimal macadamOne = new BigDecimal(0);
|
|
|
|
+ BigDecimal macadamTwo = new BigDecimal(0);
|
|
|
|
+ BigDecimal macadamThree = new BigDecimal(0);
|
|
//黄砂
|
|
//黄砂
|
|
- BigDecimal sand = dto.getSand().divide(new BigDecimal(100)).multiply(info.getSand());
|
|
|
|
|
|
+ if (dto.getSand() != null) {
|
|
|
|
+ sand = dto.getSand().divide(new BigDecimal(100)).multiply(info.getSand());
|
|
|
|
+ //黄砂
|
|
|
|
+ BigDecimal sand2 = info.getSand().add(sand);
|
|
|
|
+ map.put(prefix + "__" + s1 + "_" + (s2 + 1), sand2);
|
|
|
|
+ }
|
|
//碎石1
|
|
//碎石1
|
|
- BigDecimal macadamOne = dto.getMacadamOne().divide(new BigDecimal(100)).multiply(info.getMacadamOne());
|
|
|
|
|
|
+ if (dto.getMacadamOne() != null) {
|
|
|
|
+ macadamOne = dto.getMacadamOne().divide(new BigDecimal(100)).multiply(info.getMacadamOne());
|
|
|
|
+ //碎石1
|
|
|
|
+ BigDecimal macadamOne2 = info.getMacadamOne().add(macadamOne);
|
|
|
|
+ map.put(prefix + "__" +s1 + "_" +(s2+2),macadamOne2);
|
|
|
|
+ }
|
|
//碎石2
|
|
//碎石2
|
|
- BigDecimal macadamTwo = dto.getMacadamTwo().divide(new BigDecimal(100)).multiply(info.getMacadamTwo());
|
|
|
|
|
|
+ if (dto.getMacadamTwo() != null) {
|
|
|
|
+ macadamTwo = dto.getMacadamTwo().divide(new BigDecimal(100)).multiply(info.getMacadamTwo());
|
|
|
|
+ //碎石2
|
|
|
|
+ BigDecimal macadamTwo2 = info.getMacadamTwo().add(macadamTwo);
|
|
|
|
+ map.put(prefix + "__" +s1 + "_" +(s2+3),macadamTwo2);
|
|
|
|
+ }
|
|
//碎石3
|
|
//碎石3
|
|
- BigDecimal macadamThree = dto.getMacadamThree().divide(new BigDecimal(100)).multiply(info.getMacadamThree());
|
|
|
|
|
|
+ if (dto.getMacadamThree() != null) {
|
|
|
|
+ macadamThree = dto.getMacadamThree().divide(new BigDecimal(100)).multiply(info.getMacadamThree());
|
|
|
|
+ //碎石3
|
|
|
|
+ BigDecimal macadamThree2 = info.getMacadamThree().add(macadamThree);
|
|
|
|
+ map.put(prefix + "__" +s1 + "_" +(s2+4),macadamThree2);
|
|
|
|
+ }
|
|
|
|
|
|
//施工配合比计算
|
|
//施工配合比计算
|
|
//水泥
|
|
//水泥
|
|
BigDecimal cement = info.getCement();
|
|
BigDecimal cement = info.getCement();
|
|
map.put(prefix + "__" +s1 + "_" +(s2),cement);
|
|
map.put(prefix + "__" +s1 + "_" +(s2),cement);
|
|
- //黄砂
|
|
|
|
- BigDecimal sand2 = info.getSand().add(sand);
|
|
|
|
- map.put(prefix + "__" +s1 + "_" +(s2+1),sand2);
|
|
|
|
- //碎石1
|
|
|
|
- BigDecimal macadamOne2 = info.getMacadamOne().add(macadamOne);
|
|
|
|
- map.put(prefix + "__" +s1 + "_" +(s2+2),macadamOne2);
|
|
|
|
- //碎石2
|
|
|
|
- BigDecimal macadamTwo2 = info.getMacadamTwo().add(macadamTwo);
|
|
|
|
- map.put(prefix + "__" +s1 + "_" +(s2+3),macadamTwo2);
|
|
|
|
- //碎石3
|
|
|
|
- BigDecimal macadamThree2 = info.getMacadamThree().add(macadamThree);
|
|
|
|
- map.put(prefix + "__" +s1 + "_" +(s2+4),macadamThree2);
|
|
|
|
|
|
+
|
|
//水
|
|
//水
|
|
- BigDecimal water = info.getWater().subtract(sand).subtract(macadamOne).subtract(macadamTwo).subtract(macadamThree);
|
|
|
|
- map.put(prefix + "__" +s1 + "_" +(s2+5),water);
|
|
|
|
|
|
+ if (dto.getSand() != null && dto.getMacadamOne() != null && dto.getMacadamTwo() != null && dto.getMacadamThree() != null) {
|
|
|
|
+ BigDecimal water = info.getWater().subtract(sand).subtract(macadamOne).subtract(macadamTwo).subtract(macadamThree);
|
|
|
|
+ map.put(prefix + "__" + s1 + "_" + (s2 + 5), water);
|
|
|
|
+ }
|
|
//掺加剂
|
|
//掺加剂
|
|
BigDecimal admixture = info.getAdmixture();
|
|
BigDecimal admixture = info.getAdmixture();
|
|
map.put(prefix + "__" +s1 + "_" +(s2+6),admixture);
|
|
map.put(prefix + "__" +s1 + "_" +(s2+6),admixture);
|