chenlu
4 天以前 d613f1080234e13d12f2bad22650733b4477aa84
在制品报表添加厚度和相关功能
8个文件已修改
97 ■■■■ 已修改文件
north-glass-erp/northglass-erp/src/views/pp/report/ProcessToBeCompleted.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/report/WorkInProgress.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/dto/pp/CrossProcessBreakingDTO.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/dto/pp/DamageReportDTO.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/dto/pp/WorkInProgressDTO.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/sd/ProductDetailMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/sd/ProductDetailMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/report/ProcessToBeCompleted.vue
@@ -290,6 +290,7 @@
      filterMethod: filterChanged},
    {field: 'thickness',filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged,
      width: 90, title: t('order.totalThickness')},
    {field: 'quantity', width: 120, title: t('order.quantity'),filters: [{data: ''}],
north-glass-erp/northglass-erp/src/views/pp/report/WorkInProgress.vue
@@ -143,6 +143,7 @@
  }
  request.post(`/report/workInProgress/${pageNum.value}/${total.pageSize}/${inputVal}/${inputProject}/${selectProcesses}/${optionVal}/${terminationVals}`, filterData.value).then((res) => {
    if (res.code == 200) {
      total.value = res.data.total
      produceList = deepClone(res.data.data)
      produceList.forEach(item => {
@@ -180,10 +181,10 @@
  request.post(`/report/workInProgress/${pageNum.value}/${total.pageSize}/${inputVal}/${inputProject}/${selectProcesses}/${optionVal}/${terminationVals}`, filterData.value).then((res) => {
    if (res.code == 200) {
      total.dataTotal = res.data.total.total * 1
      total.pageTotal = res.data.total.pageTotal
      pageTotal.value = res.data.total
      total.value = res.data.total
      total.value = res.data.total;
      total.dataTotal = res.data.total.total * 1;
      total.pageTotal = res.data.total.pageTotal;
      pageTotal.value = res.data.total;
      res.data.data.forEach(item => {
        // 如果 shape 可能是字符串就用 ==,如果一定是数字就用 ===
        item.shape = (item.shape == 2) ? t('order.alien') : t('order.universalShape');
@@ -246,10 +247,10 @@
  request.post(`/report/workInProgress/${pageNum.value}/${total.pageSize}/${inputVal}/${inputProject}/${selectProcesses}/${optionVal}/${terminationVals}`, filterData.value).then((res) => {
    if (res.code == 200) {
      total.dataTotal = res.data.total.total * 1
      total.pageTotal = res.data.total.pageTotal
      pageTotal.value = res.data.total
      total.value = res.data.total
      total.value = res.data.total;
      total.dataTotal = res.data.total.total * 1;
      total.pageTotal = res.data.total.pageTotal;
      pageTotal.value = res.data.total;
      produceList = deepClone(res.data.data)
      produceList.forEach(item => {
        // 如果 shape 可能是字符串就用 ==,如果一定是数字就用 ===
@@ -359,6 +360,7 @@
      slots: {filter: 'num1_filter'},},
    {field: 'childHeight', width: 120, title: t('order.height'),visible: true,filters: [{data: ''}],
      slots: {filter: 'num1_filter'},},
    {field: 'thickness',width: 90, title: t('order.totalThickness'),visible: true},
    {field: 'stockNum', width: 120, title: t('productStock.inventoryQuantity'),visible: true,filters: [{data: ''}],
      slots: {filter: 'num1_filter'},},
    {field: 'stockArea', width: 120, title: t('report.inventoryArea'),visible: true,filters: [{data: ''}],
@@ -394,7 +396,7 @@
        const List = ["quantity",'stockNum','stockArea',]
        if (List.includes(column.field)) {
          //return footSum(data, column.field)
          return footSum(data, column.field)
          return total.value?.[column.field] ?? 0
        }
        return ''
      })
north-glass-erp/src/main/java/com/example/erp/dto/pp/CrossProcessBreakingDTO.java
@@ -27,6 +27,12 @@
    private String breakageType;
    @ExcelProperty("次破原因")
    private String breakageReason;
    @ExcelProperty("宽")
    private Double childWidth;
    @ExcelProperty("高")
    private Double childHeight;
    @ExcelProperty("厚度")
    private String thickness;
    @ExcelProperty("次破数量")
    private Integer breakageQuantity;
    @ExcelProperty("次破面积")
@@ -45,10 +51,5 @@
    private String creator;
    @ExcelProperty("报工编号")
    private String reportingWorkId;
    @ExcelProperty("厚度")
    private String thickness;
    @ExcelProperty("宽")
    private Double childWidth;
    @ExcelProperty("高")
    private Double childHeight;
}
north-glass-erp/src/main/java/com/example/erp/dto/pp/DamageReportDTO.java
@@ -48,12 +48,13 @@
    private Double childWidth;
    @ExcelProperty("高")
    private Double childHeight;
    @ExcelProperty("厚度")
    private String thickness;
    @ExcelProperty("报工工序")
    private String thisProcess;
    @ExcelProperty("创建人")
    private String creator;
    @ExcelProperty("报工编号")
    private String reportingWorkId;
    @ExcelProperty("厚度")
    private String thickness;
}
north-glass-erp/src/main/java/com/example/erp/dto/pp/WorkInProgressDTO.java
@@ -3,6 +3,8 @@
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class WorkInProgressDTO {
    @ExcelProperty("工序")
@@ -31,10 +33,12 @@
    private Double childWidth;
    @ExcelProperty("高")
    private Double childHeight;
    @ExcelProperty("厚度")
    private BigDecimal thickness;
    @ExcelProperty("库存数")
    private Integer stockNum;
    @ExcelProperty("库存面积")
    private Double stockArea;
    private BigDecimal stockArea;
    @ExcelProperty("成品名称")
    private String productName;
    @ExcelProperty("在制品名称")
@@ -45,4 +49,5 @@
    private String glassNumber;
    @ExcelProperty("上工序报工班组")
    private String teamsGroupsName;
}
north-glass-erp/src/main/java/com/example/erp/mapper/sd/ProductDetailMapper.java
@@ -13,4 +13,6 @@
    boolean insertList(List<ProductDetail> getProductDetails);
    String getGlassNameByGroup(Integer productId, Integer minTechnologyNumberByGroup, Integer maxTechnologyNumberByGroup);
    String getGlassName(Integer productId);
}
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java
@@ -34,6 +34,8 @@
import java.util.*;
import java.util.concurrent.*;
import java.util.function.Function;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static cn.hutool.core.convert.Convert.toDouble;
@@ -60,6 +62,33 @@
    @Resource
    private AsyncQueryExecutor asyncExecutor;
    //根据在制品名称获取厚度
    private List<BigDecimal> parseGlassThicknessList(String glassName) {
        List<BigDecimal> list = new ArrayList<>();
        if (glassName == null || glassName.isEmpty()) {
            return list;
        }
        // 匹配所有 "数字 + mm",支持小数,例如 3.2mm、5mm、8mm
        Pattern pattern = Pattern.compile("(\\d+(?:\\.\\d+)?)mm");
        Matcher matcher = pattern.matcher(glassName);
        while (matcher.find()) {
            String numStr = matcher.group(1); // 捕获 5、8、3.2
            try {
                list.add(new BigDecimal(numStr));
            } catch (Exception ignore) {
            }
        }
        return list;
    }
    //玻璃厚度求和
    private BigDecimal calcGlassThicknessSum(String glassName) {
        return parseGlassThicknessList(glassName).stream()
                .reduce(BigDecimal.ZERO, BigDecimal::add);
    }
    //上工序报工班组
    private void mergeTeamsGroupsName( List<WorkInProgressDTO> dataList1,List<WorkInProgressDTO> dataList2) {
@@ -88,9 +117,11 @@
              if(productDetail!=null){
                  dto1.setGlassName(productDetail.getDetail());
              }
              BigDecimal thicknessSum = calcGlassThicknessSum(productDetail.getDetail());
              dto1.setThickness(thicknessSum);
            //basicData.getNickname().equals("stepC")
          }else if(basicData.getNickname().equals("stepC")){
          }else if(basicData.getNickname().equals("stepC")){//夹层
              OrderGlassDetail orderGlassDetailGroup = orderGlassDetailMapper
                      .selectOne(new QueryWrapper<OrderGlassDetail>()
                              .eq("order_id", dto1.getOrderId())
@@ -104,9 +135,13 @@
                      orderGlassDetailMapper.getMaxTechnologyNumberByGroup(dto1.getOrderId(),dto1.getOrderNumber(), String.valueOf(orderGlassDetailGroup.getGroup()))
              );
              dto1.setGlassName(glassName);
          }else{
              dto1.setGlassName(dto1.getProductName());
              BigDecimal thicknessSum = calcGlassThicknessSum(glassName);
              dto1.setThickness(thicknessSum);
          }else{//中空
              String glassName = productDetailMapper.getGlassName(orderDetail.getProductId());
              dto1.setGlassName(glassName);
              BigDecimal thicknessSum = calcGlassThicknessSum(glassName);
              dto1.setThickness(thicknessSum);
          }
        }
north-glass-erp/src/main/resources/mapper/sd/ProductDetailMapper.xml
@@ -33,4 +33,10 @@
      and glass_sort >= #{minTechnologyNumberByGroup}
      and glass_sort &gt;= #{minTechnologyNumberByGroup}
    </select>
    <select id="getGlassName">
        SELECT GROUP_CONCAT(detail SEPARATOR '+')
        from sd.product_detail
        where prod_id = #{productId} and detail_type='glass'
    </select>
</mapper>