Explorar o código

测试数据-原材-配合比,还有含水率

qianxb %!s(int64=2) %!d(string=hai) anos
pai
achega
670beee9d5
Modificáronse 17 ficheiros con 831 adicións e 1 borrados
  1. 33 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/MoistureContentDTO.java
  2. 73 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/MixProportionInfo.java
  3. 44 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/RawMaterialsInfo.java
  4. 3 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreeContractLazyVO.java
  5. 126 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/MixProportionInfoController.java
  6. 117 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/RawMaterialsInfoController.java
  7. 67 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/excel/MixProportionInfoExcel.java
  8. 40 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/excel/RawMaterialsInfoExcel.java
  9. 44 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/MixProportionInfoMapper.java
  10. 26 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/MixProportionInfoMapper.xml
  11. 30 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/RawMaterialsInfoMapper.java
  12. 6 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/RawMaterialsInfoMapper.xml
  13. 22 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IMixProportionInfoService.java
  14. 16 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IRawMaterialsInfoService.java
  15. 165 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/MixProportionInfoServiceImpl.java
  16. 18 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/RawMaterialsInfoServiceImpl.java
  17. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeContractServiceImpl.java

+ 33 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/MoistureContentDTO.java

@@ -0,0 +1,33 @@
+package org.springblade.manager.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * @Param  含水率
+ * @Author wangwl
+ * @Date 2023/8/22 16:00
+ **/
+@Data
+public class MoistureContentDTO {
+
+    @ApiModelProperty(value = "当前位置")
+    private String key ;
+
+    @ApiModelProperty(value = "配合比id")
+    private Long mixProportionId ;
+
+    @ApiModelProperty(value = "黄砂含水率")
+    private BigDecimal sand ;
+
+    @ApiModelProperty(value = "碎石1含水率")
+    private BigDecimal macadamOne ;
+
+    @ApiModelProperty(value = "碎石2含水率")
+    private BigDecimal macadamTwo ;
+
+    @ApiModelProperty(value = "碎石3含水率")
+    private BigDecimal macadamThree ;
+}

+ 73 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/MixProportionInfo.java

@@ -0,0 +1,73 @@
+package org.springblade.manager.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+import java.math.BigDecimal;
+
+/**
+ * @Param   配合比信息表
+ * @Author wangwl
+ * @Date 2023/8/21 16:21
+ **/
+@Data
+@TableName("m_mix_proportion_info")
+@EqualsAndHashCode(callSuper = true)
+public class MixProportionInfo extends BaseEntity {
+
+
+    @ApiModelProperty(value = "项目id")
+    private Long projectId;
+
+    @ApiModelProperty(value = "合同id")
+    private Long contractId;
+
+    @ApiModelProperty(value = "配合比报告编号")
+    private String reportNumber;
+
+    @ApiModelProperty(value = "设计强度")
+    private String designStrength;
+
+    @ApiModelProperty(value = "水胶比")
+    private String waterBinderRatio;
+
+    @ApiModelProperty(value = "水泥")
+    private BigDecimal cement ;
+
+    @ApiModelProperty(value = "砂")
+    private BigDecimal sand;
+
+    @ApiModelProperty(value = "碎石1")
+    private BigDecimal macadamOne ;
+
+    @ApiModelProperty(value = "碎石2")
+    private BigDecimal macadamTwo;
+
+    @ApiModelProperty(value = "碎石3")
+    private BigDecimal macadamThree;
+
+    @ApiModelProperty(value = "水")
+    private BigDecimal water;
+
+    @ApiModelProperty(value = "掺加剂")
+    private BigDecimal admixture ;
+
+    @ApiModelProperty(value = "粉煤灰")
+    private BigDecimal coalAsh;
+
+    @ApiModelProperty(value = "矿渣粉")
+    private BigDecimal slagPowder;
+
+    @ApiModelProperty(value = "坍落度")
+    private BigDecimal slumps;
+
+    @ApiModelProperty(value = "单位体积重")
+    private String bulkDensity;
+
+    @ApiModelProperty(value = "抗压强度")
+    private BigDecimal compressiveStrength;
+
+}

+ 44 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/RawMaterialsInfo.java

@@ -0,0 +1,44 @@
+package org.springblade.manager.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+/**
+ * @Param   原材料信息表
+ * @Author wangwl
+ * @Date 2023/8/21 16:21
+ **/
+@Data
+@TableName("m_raw_materials_info")
+@EqualsAndHashCode(callSuper = true)
+public class RawMaterialsInfo extends BaseEntity {
+
+    @ApiModelProperty(value = "项目id")
+    private Long projectId;
+
+    @ApiModelProperty(value = "合同id")
+    private Long contractId;
+
+    @ApiModelProperty(value = "材料名称")
+    private String name;
+
+    @ApiModelProperty(value = "规格型号")
+    private String specification;
+
+    @ApiModelProperty(value = "生产厂商")
+    private String manufacturers;
+
+    @ApiModelProperty(value = "存放地点或料厂号")
+    private String storageSite;
+
+    @ApiModelProperty(value = "批准文号")
+    private String batchNumber;
+
+    @ApiModelProperty(value = "准备数量")
+    private Integer total;
+
+
+}

+ 3 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/WbsTreeContractLazyVO.java

@@ -70,4 +70,7 @@ public class WbsTreeContractLazyVO implements Serializable {
     @ApiModelProperty(value = "工程图纸id")
     private Long drawingsId;
 
+    @ApiModelProperty("是否又混泥土,0否1是")
+    private Integer isConcrete;
+
 }

+ 126 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/MixProportionInfoController.java

@@ -0,0 +1,126 @@
+package org.springblade.manager.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.*;
+import lombok.AllArgsConstructor;
+import org.apache.commons.lang.StringUtils;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.manager.dto.MoistureContentDTO;
+import org.springblade.manager.entity.MixProportionInfo;
+import org.springblade.manager.service.IMixProportionInfoService;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import javax.validation.Valid;
+import java.util.List;
+
+@RestController
+@AllArgsConstructor
+@RequestMapping("/mixProportion")
+@Api(value = "试验数据-配合比", tags = "试验数据-配合比")
+public class MixProportionInfoController extends BladeController {
+
+    private final IMixProportionInfoService mixProportionInfoService;
+
+
+    /**
+     * 计算含水率
+     */
+    @PostMapping("/calculateWater")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "计算含水率", notes = "计算含水率")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "key", value = "当前输入框位置", required = true),
+            @ApiImplicitParam(name = "MixProportionId", value = "配合比id", required = true),
+            @ApiImplicitParam(name = "sand", value = "黄砂含水率", required = true),
+            @ApiImplicitParam(name = "macadamOne", value = "碎石1含水率", required = true),
+            @ApiImplicitParam(name = "macadamTwo", value = "碎石2含水率", required = true),
+            @ApiImplicitParam(name = "macadamThree", value = "碎石3含水率", required = true),
+    })
+    public R calculateWater(@Valid @RequestBody MoistureContentDTO dto) {
+        return mixProportionInfoService.calculateWater(dto);
+    }
+
+
+    /**
+     * 设计强度列表
+     */
+    @GetMapping("/designStrengthList")
+    @ApiOperationSupport(order = 7)
+    @ApiOperation(value = "设计强度列表", notes = "模糊搜索")
+    public R<List<MixProportionInfo>> designStrengthList(@RequestParam String searchValue,Long contractId) {
+        List<MixProportionInfo> list = mixProportionInfoService.designStrengthList(searchValue,contractId);
+        return R.data(list);
+    }
+
+    /**
+     * 删除 配合比
+     */
+    @GetMapping("/remove")
+    @ApiOperationSupport(order = 7)
+    @ApiOperation(value = "逻辑删除", notes = "传入ids")
+    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+        return R.status(mixProportionInfoService.deleteLogic(Func.toLongList(ids)));
+    }
+
+    /**
+     * 修改 配合比
+     */
+    @PostMapping("/update")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "修改-配合比", notes = "传入mixProportionInfo")
+    public R update(@Valid @RequestBody MixProportionInfo info) {
+        return R.status(mixProportionInfoService.updateById(info));
+    }
+
+    /**
+     * 新增 配合比
+     */
+    @PostMapping("/save")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "新增-配合比", notes = "传入mixProportionInfo")
+    public R save(@Valid @RequestBody MixProportionInfo info) {
+        return R.status(mixProportionInfoService.save(info));
+    }
+
+
+    /**
+     * 自定义分页 原材
+     */
+    @GetMapping("/page")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "分页-配合比", notes = "搜索传入报告编号")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "searchValue", value = "搜索值"),
+            @ApiImplicitParam(name = "projectId", value = "项目id"),
+            @ApiImplicitParam(name = "contractId", value = "合同id", required = true),
+    })
+    public R<IPage<MixProportionInfo>> page(String searchValue, Query query,Long contractId) {
+        IPage<MixProportionInfo> page = new Page<>(query.getCurrent(),query.getSize());
+        IPage<MixProportionInfo> iPage = mixProportionInfoService.page(page, new LambdaQueryWrapper<MixProportionInfo>()
+                .eq(MixProportionInfo::getContractId,contractId)
+                .like(StringUtils.isNotBlank(searchValue),MixProportionInfo::getReportNumber, searchValue));
+        return R.data(iPage);
+    }
+
+    /**
+     * 导入配合比
+     */
+    @PostMapping("importMixProportionInfo")
+    @ApiOperationSupport(order = 8)
+    @ApiOperation(value = "导入-配合比", notes = "传入excel")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "file", value = "文件源", required = true),
+            @ApiImplicitParam(name = "projectId", value = "项目id", required = true),
+            @ApiImplicitParam(name = "contractId", value = "合同id", required = true),
+    })
+    public R importMixProportionInfo(@RequestParam("file") MultipartFile file,Long projectId,Long contractId) {
+         return mixProportionInfoService.importMixProportionInfo(file,projectId,contractId);
+
+    }
+}

+ 117 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/RawMaterialsInfoController.java

@@ -0,0 +1,117 @@
+package org.springblade.manager.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import io.swagger.annotations.*;
+import lombok.AllArgsConstructor;
+import org.apache.commons.lang.StringUtils;
+import org.springblade.core.boot.ctrl.BladeController;
+import org.springblade.core.excel.util.ExcelUtil;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.DateUtil;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.manager.entity.RawMaterialsInfo;
+import org.springblade.manager.excel.RawMaterialsInfoExcel;
+import org.springblade.manager.service.IRawMaterialsInfoService;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.validation.Valid;
+import java.time.LocalDate;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+
+@RestController
+@AllArgsConstructor
+@RequestMapping("/rawMaterials")
+@Api(value = "试验数据-原材", tags = "试验数据-原材")
+public class RawMaterialsInfoController extends BladeController {
+
+    private final IRawMaterialsInfoService rawMaterialsInfoService;
+
+
+    /**
+     * 删除 原材
+     */
+    @GetMapping("/remove")
+    @ApiOperationSupport(order = 7)
+    @ApiOperation(value = "逻辑删除", notes = "传入ids")
+    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+        return R.status(rawMaterialsInfoService.deleteLogic(Func.toLongList(ids)));
+    }
+
+
+    /**
+     * 修改 原材
+     */
+    @PostMapping("/update")
+    @ApiOperationSupport(order = 5)
+    @ApiOperation(value = "修改-原材", notes = "传入rawMaterialsInfo")
+    public R update(@Valid @RequestBody RawMaterialsInfo info) {
+        return R.status(rawMaterialsInfoService.updateById(info));
+    }
+
+
+    /**
+     * 新增 原材
+     */
+    @PostMapping("/save")
+    @ApiOperationSupport(order = 4)
+    @ApiOperation(value = "新增-原材", notes = "传入rawMaterialsInfo")
+    public R save(@Valid @RequestBody RawMaterialsInfo info) {
+        return R.status(rawMaterialsInfoService.save(info));
+    }
+
+    /**
+     * 自定义分页 原材
+     */
+    @GetMapping("/page")
+    @ApiOperationSupport(order = 3)
+    @ApiOperation(value = "分页-原材", notes = "搜索传入批准文号")
+    public R<IPage<RawMaterialsInfo>> page(String searchValue, Query query,Long contractId) {
+        IPage<RawMaterialsInfo> page = new Page<>(query.getCurrent(),query.getSize());
+        IPage<RawMaterialsInfo> iPage = rawMaterialsInfoService.page(page, new LambdaQueryWrapper<RawMaterialsInfo>()
+                .eq(RawMaterialsInfo::getContractId,contractId)
+                .like(StringUtils.isNotBlank(searchValue),RawMaterialsInfo::getBatchNumber, searchValue));
+        return R.data(iPage);
+    }
+
+
+    /**
+     * 导入原材信息
+     */
+    @PostMapping("/importRawMaterialsInfo")
+    @ApiOperationSupport(order = 8)
+    @ApiOperation(value = "导入-原材信息", notes = "传入excel")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "file", value = "文件源", required = true),
+            @ApiImplicitParam(name = "projectId", value = "项目id", required = true),
+            @ApiImplicitParam(name = "contractId", value = "合同id", required = true),
+    })
+    public R importRawMaterialsInfo(@RequestParam("file") MultipartFile file,Long projectId,Long contractId) {
+        List<RawMaterialsInfoExcel> list = ExcelUtil.read(file, RawMaterialsInfoExcel.class);
+        if(list!=null && list.size()>=1){
+            List<RawMaterialsInfo> vos = list.stream().map(f -> {
+                RawMaterialsInfo tag = new RawMaterialsInfo();
+                BeanUtil.copy(f,tag);
+                tag.setProjectId(projectId);
+                tag.setContractId(contractId);
+                return tag;
+            }).collect(Collectors.toList());
+            rawMaterialsInfoService.saveBatch(vos);
+            return R.success("导入成功");
+        }else {
+            return R.fail("没有一条数据");
+        }
+    }
+}

+ 67 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/excel/MixProportionInfoExcel.java

@@ -0,0 +1,67 @@
+package org.springblade.manager.excel;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ *
+ */
+@Data
+@ColumnWidth(16)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class MixProportionInfoExcel implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ExcelProperty(value = "配合比报告编号")
+    private String reportNumber;
+
+    @ExcelProperty(value = "设计强度")
+    private String designStrength;
+
+    @ExcelProperty(value = "水胶比")
+    private String waterBinderRatio;
+
+    @ExcelProperty(value = "水泥")
+    private Double cement ;
+
+    @ExcelProperty(value = "砂")
+    private Double sand;
+
+    @ExcelProperty(value = "碎石1")
+    private Double macadamOne ;
+
+    @ExcelProperty(value = "碎石2")
+    private Double macadamTwo;
+
+    @ExcelProperty(value = "碎石3")
+    private Double macadamThree;
+
+    @ExcelProperty(value = "水")
+    private Double water;
+
+    @ExcelProperty(value = "掺加剂")
+    private Double admixture;
+
+    @ExcelProperty(value = "粉煤灰")
+    private Double coalAsh;
+
+    @ExcelProperty(value = "矿渣粉")
+    private Double slagPowder;
+
+    @ExcelProperty(value = "坍落度")
+    private Double slumps;
+
+    @ExcelProperty(value = "单位体积重")
+    private String bulkDensity;
+
+    @ExcelProperty(value = "28天抗压强度")
+    private Double compressiveStrength;
+
+
+}

+ 40 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/excel/RawMaterialsInfoExcel.java

@@ -0,0 +1,40 @@
+package org.springblade.manager.excel;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ *
+ */
+@Data
+@ColumnWidth(16)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class RawMaterialsInfoExcel implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ExcelProperty(value = "材料名称")
+    private String name;
+
+    @ExcelProperty(value = "规格型号")
+    private String specification;
+
+    @ExcelProperty(value = "生产厂商")
+    private String manufacturers;
+
+    @ExcelProperty(value = "存放地点或料厂号")
+    private String storageSite;
+
+    @ExcelProperty(value = "试验批准文号")
+    private String batchNumber;
+
+    @ExcelProperty(value = "准备数量")
+    private Integer total;
+
+
+}

+ 44 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/MixProportionInfoMapper.java

@@ -0,0 +1,44 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.apache.ibatis.annotations.MapKey;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.business.entity.ArchiveFile;
+import org.springblade.manager.entity.ArchiveTreeContract;
+import org.springblade.manager.entity.MixProportionInfo;
+import org.springblade.manager.vo.ArchiveTreeContractVO;
+import org.springblade.manager.vo.ArchiveTreeContractVO2;
+import org.springblade.manager.vo.ArchiveTreeContractVO3;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author 00
+ * @since 2023-02-18
+ */
+public interface MixProportionInfoMapper extends BaseMapper<MixProportionInfo> {
+
+    List<MixProportionInfo> designStrengthList(@Param("searchValue") String searchValue,@Param("contractId") Long contractId);
+
+    Integer compareInfo(@Param("number") Set<String> number,@Param("strength") Set<String> strength,@Param("contractId") Long contractId);
+}

+ 26 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/MixProportionInfoMapper.xml

@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.manager.mapper.MixProportionInfoMapper">
+
+
+    <select id="designStrengthList" resultType="org.springblade.manager.entity.MixProportionInfo">
+        select id,design_strength
+        from m_mix_proportion_info
+        WHERE is_deleted = 0 and contract_id = #{contractId}
+        <if test="searchValue!=null and searchValue !=''">
+            and design_strength like concat(concat('%', #{searchValue}),'%')
+        </if>
+    </select>
+    <select id="compareInfo" resultType="java.lang.Integer">
+        select count(1)
+        from m_mix_proportion_info
+        WHERE is_deleted = 0 and report_number in
+        <foreach collection="number" item="n" open="(" separator="," close=")">
+            #{n}
+        </foreach>
+        or
+        <foreach collection="strength" item="s" open="(" separator="," close=")">
+            #{s}
+        </foreach>
+    </select>
+</mapper>

+ 30 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/RawMaterialsInfoMapper.java

@@ -0,0 +1,30 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.manager.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springblade.manager.entity.MixProportionInfo;
+import org.springblade.manager.entity.RawMaterialsInfo;
+
+/**
+ * @author 00
+ * @since 2023-02-18
+ */
+public interface RawMaterialsInfoMapper extends BaseMapper<RawMaterialsInfo> {
+
+}

+ 6 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/RawMaterialsInfoMapper.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.manager.mapper.RawMaterialsInfoMapper">
+
+
+</mapper>

+ 22 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IMixProportionInfoService.java

@@ -0,0 +1,22 @@
+package org.springblade.manager.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.core.tool.api.R;
+import org.springblade.manager.dto.MoistureContentDTO;
+import org.springblade.manager.entity.MixProportionInfo;
+import org.springblade.manager.entity.RawMaterialsInfo;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+import java.util.Set;
+
+public interface IMixProportionInfoService extends BaseService<MixProportionInfo> {
+
+    List<MixProportionInfo> designStrengthList(String searchValue,Long contractId);
+
+    Integer compareInfo(Set<String> number, Set<String> strength, Long contractId);
+
+    R importMixProportionInfo(MultipartFile file, Long projectId, Long contractId);
+
+    R calculateWater(MoistureContentDTO dto);
+}

+ 16 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IRawMaterialsInfoService.java

@@ -0,0 +1,16 @@
+package org.springblade.manager.service;
+
+import org.springblade.core.mp.base.BaseService;
+import org.springblade.manager.dto.ArchiveTreeContractAutoRuleMapDTO;
+import org.springblade.manager.dto.ArchiveTreeDTO;
+import org.springblade.manager.dto.ArchiveTreeSortDTO;
+import org.springblade.manager.entity.ArchiveTree;
+import org.springblade.manager.entity.RawMaterialsInfo;
+import org.springblade.manager.vo.ArchiveTreeVO2;
+
+import java.util.List;
+import java.util.Map;
+
+public interface IRawMaterialsInfoService extends BaseService<RawMaterialsInfo> {
+
+}

+ 165 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/MixProportionInfoServiceImpl.java

@@ -0,0 +1,165 @@
+package org.springblade.manager.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.StringPool;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import javassist.runtime.DotClass;
+import lombok.AllArgsConstructor;
+import org.apache.commons.lang.StringUtils;
+import org.springblade.common.utils.ForestNodeMergerEx;
+import org.springblade.common.utils.SnowFlakeUtil;
+import org.springblade.core.excel.util.ExcelUtil;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.constant.BladeConstant;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.manager.dto.ArchiveTreeContractAutoRuleMapDTO;
+import org.springblade.manager.dto.ArchiveTreeDTO;
+import org.springblade.manager.dto.ArchiveTreeSortDTO;
+import org.springblade.manager.dto.MoistureContentDTO;
+import org.springblade.manager.entity.ArchiveAutoRuleWbs;
+import org.springblade.manager.entity.ArchiveTree;
+import org.springblade.manager.entity.MixProportionInfo;
+import org.springblade.manager.entity.ProjectInfo;
+import org.springblade.manager.excel.MixProportionInfoExcel;
+import org.springblade.manager.mapper.ArchiveAutoRuleWbsMapper;
+import org.springblade.manager.mapper.ArchiveTreeMapper;
+import org.springblade.manager.mapper.MixProportionInfoMapper;
+import org.springblade.manager.service.*;
+import org.springblade.manager.utils.DiffListUtil;
+import org.springblade.manager.utils.ForestNodeMerger;
+import org.springblade.manager.vo.ArchiveTreeAutoRuleVO;
+import org.springblade.manager.vo.ArchiveTreeVO2;
+import org.springblade.manager.vo.WbsTreeVO2;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.math.BigDecimal;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+@AllArgsConstructor
+public class MixProportionInfoServiceImpl extends BaseServiceImpl<MixProportionInfoMapper, MixProportionInfo> implements IMixProportionInfoService {
+
+
+    @Override
+    public List<MixProportionInfo> designStrengthList(String searchValue,Long contractId) {
+        return baseMapper.designStrengthList(searchValue,contractId);
+    }
+
+    @Override
+    public Integer compareInfo(Set<String> number, Set<String> strength, Long contractId) {
+        return baseMapper.compareInfo(number,strength,contractId);
+    }
+
+    @Override
+    public R importMixProportionInfo(MultipartFile file, Long projectId, Long contractId) {
+        List<MixProportionInfoExcel> list = ExcelUtil.read(file, MixProportionInfoExcel.class);
+        if(list!=null && list.size()>=1){
+            Set<String> number = new HashSet<>();
+            Set<String> strength = new HashSet<>();
+            //校验数据
+            for (MixProportionInfoExcel excel : list) {
+                if (org.apache.commons.lang.StringUtils.isNotBlank(excel.getReportNumber())){
+                    number.add(excel.getReportNumber());
+                }else {
+                    throw new ServiceException("文件中缺少配合比报告编号,请修改后重新导入");
+                }
+
+                if (StringUtils.isNotBlank(excel.getDesignStrength())){
+                    strength.add(excel.getDesignStrength());
+                }else {
+                    throw new ServiceException("文件中缺少设计强度,请修改后重新导入");
+                }
+            }
+            if (number.size() != list.size()){
+                throw new ServiceException("文件中配合比报告编号重复,请修改后重新导入");
+            }
+            if (strength.size() != list.size()){
+                throw new ServiceException("文件中设计强度重复,请修改后重新导入");
+            }
+            //判断是否存在相同的配合比编号,和设计强度
+            Integer infos = this.compareInfo(number,strength,contractId);
+            if (infos != 0){
+                throw new ServiceException("文件数据与现有数据重复,请修改后重新导入");
+            }
+
+            List<MixProportionInfo> vos = list.stream().map(f -> {
+                MixProportionInfo tag = new MixProportionInfo();
+                BeanUtil.copy(f,tag);
+                tag.setProjectId(projectId);
+                tag.setContractId(contractId);
+                return tag;
+            }).collect(Collectors.toList());
+            this.saveBatch(vos);
+            return R.success("导入成功");
+        }else {
+            return R.fail("没有一条数据");
+        }
+    }
+
+    /**
+     * 计算含水率
+     * @param dto
+     * @return
+     */
+    @Override
+    public R calculateWater(MoistureContentDTO dto) {
+        //获取位置前缀后缀
+        String prefix= dto.getKey().replaceAll("__[\\d_]+", "");
+        String suffix = dto.getKey().replaceAll("key_\\d+__", "");
+        String[] split = suffix.split("_");
+        String s1 = split[0];
+        Integer s2 = Integer.parseInt(split[1]);
+        //结果集
+        Map<String,BigDecimal> map = new HashMap<>();
+        //获取配合比信息
+        MixProportionInfo info = this.getById(dto.getMixProportionId());
+        if (info == null){
+            throw new ServiceException("获取配合比信息失败");
+        }
+        //含水量计算
+        //黄砂
+        BigDecimal sand = dto.getSand().divide(new BigDecimal(100)).multiply(info.getSand());
+        //碎石1
+        BigDecimal macadamOne = dto.getMacadamOne().divide(new BigDecimal(100)).multiply(info.getMacadamOne());
+        //碎石2
+        BigDecimal macadamTwo = dto.getMacadamTwo().divide(new BigDecimal(100)).multiply(info.getMacadamTwo());
+        //碎石3
+        BigDecimal macadamThree = dto.getMacadamThree().divide(new BigDecimal(100)).multiply(info.getMacadamThree());
+
+        //施工配合比计算
+        //水泥
+        BigDecimal cement = info.getCement();
+        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);
+        //掺加剂
+        BigDecimal admixture = info.getAdmixture();
+        map.put(prefix + "__" +s1 + "_" +(s2+6),admixture);
+        //粉煤灰
+        BigDecimal coalAsh = info.getCoalAsh();
+        map.put(prefix + "__" +s1 + "_" +(s2+7),coalAsh);
+        //矿渣粉
+        BigDecimal slagPowder = info.getSlagPowder();
+        map.put(prefix + "__" +s1 + "_" +(s2+8),slagPowder);
+        return R.data(map);
+    }
+}

+ 18 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/RawMaterialsInfoServiceImpl.java

@@ -0,0 +1,18 @@
+package org.springblade.manager.service.impl;
+
+import lombok.AllArgsConstructor;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.manager.entity.MixProportionInfo;
+import org.springblade.manager.entity.RawMaterialsInfo;
+import org.springblade.manager.mapper.MixProportionInfoMapper;
+import org.springblade.manager.mapper.RawMaterialsInfoMapper;
+import org.springblade.manager.service.IMixProportionInfoService;
+import org.springblade.manager.service.IRawMaterialsInfoService;
+import org.springframework.stereotype.Service;
+
+@Service
+@AllArgsConstructor
+public class RawMaterialsInfoServiceImpl extends BaseServiceImpl<RawMaterialsInfoMapper, RawMaterialsInfo> implements IRawMaterialsInfoService {
+
+
+}

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeContractServiceImpl.java

@@ -667,7 +667,7 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                         }
                     }
                     //获取当前层懒加载节点
-                    List<WbsTreeContractLazyVO> lazyNodes = jdbcTemplate.query("select p_key_id,(SELECT id FROM u_contract_tree_drawings where process_id = p_key_id) AS drawingsId,id,parent_id,node_type,type,wbs_type,major_data_type,partition_code,old_id,contract_id_relation,is_concealed_works_node,CASE (SELECT count(1) FROM u_tree_contract_first AS tcf WHERE tcf.is_deleted = 0 AND tcf.wbs_node_id = a.p_key_id) WHEN 0 THEN 'false' ELSE 'true' END AS isFirst,IFNULL(if(length(trim(full_name))>0,full_name,node_name),node_name) AS title,(SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM m_wbs_tree_contract b WHERE b.parent_id = a.id AND b.type = 1 and b.status = 1 AND b.contract_id = " + contractId + " AND b.is_deleted = 0 ) AS hasChildren from m_wbs_tree_contract a where a.node_type != 111 and a.type = 1 and a.status = 1 and a.is_deleted = 0 and parent_id = " + (StringUtils.isNotEmpty(id) ? id : 0) + " and contract_id = " + contractId + " ORDER BY a.sort,title,a.create_time", new BeanPropertyRowMapper<>(WbsTreeContractLazyVO.class));
+                    List<WbsTreeContractLazyVO> lazyNodes = jdbcTemplate.query("select p_key_id,(SELECT id FROM u_contract_tree_drawings where process_id = p_key_id) AS drawingsId,id,parent_id,node_type,type,wbs_type,is_concrete,major_data_type,partition_code,old_id,contract_id_relation,is_concealed_works_node,CASE (SELECT count(1) FROM u_tree_contract_first AS tcf WHERE tcf.is_deleted = 0 AND tcf.wbs_node_id = a.p_key_id) WHEN 0 THEN 'false' ELSE 'true' END AS isFirst,IFNULL(if(length(trim(full_name))>0,full_name,node_name),node_name) AS title,(SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM m_wbs_tree_contract b WHERE b.parent_id = a.id AND b.type = 1 and b.status = 1 AND b.contract_id = " + contractId + " AND b.is_deleted = 0 ) AS hasChildren from m_wbs_tree_contract a where a.node_type != 111 and a.type = 1 and a.status = 1 and a.is_deleted = 0 and parent_id = " + (StringUtils.isNotEmpty(id) ? id : 0) + " and contract_id = " + contractId + " ORDER BY a.sort,title,a.create_time", new BeanPropertyRowMapper<>(WbsTreeContractLazyVO.class));
                     if (lazyNodes.size() > 0 && nodesAll.size() > 0) {
                         //所有节点
                         List<WbsTreeContractLazyVO> distinctNodesAll = nodesAll.stream()