chenlu
2025-02-20 2900f841be31f9c5626a149649680a9b06977db8
流程卡进度显示最近报工时间
5个文件已修改
56 ■■■■ 已修改文件
north-glass-erp/northglass-erp/src/views/pp/report/ProcessCardProgress.vue 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderProcessDetail.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/Report.xml 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/report/ProcessCardProgress.vue
@@ -62,7 +62,7 @@
      res.data.title.forEach((item, index) => {
        let column = {
          slots: { default: 'quantitySum' },
          width: 90,
          width: 150,
          title: item.process,
          field: `dynamicColumn${index}` // 为动态列添加唯一的 field
        }
@@ -71,9 +71,11 @@
      res.data.data.forEach(item => {
        item.reportWorkQuantity = JSON.parse(item.reportWorkQuantity)
        item.reportWorkQuantityCount = JSON.parse(item.reportWorkQuantityCount)
        item.reportWorkTime = JSON.parse(item.reportWorkTime)
      })
      mergeCells.value = res.data.mergeCell
      xGrid.value.loadData(res.data.data)
      console.log(res.data.data)
    } else {
      ElMessage.warning(res.msg)
    }
@@ -92,14 +94,34 @@
const quantitySum = ( row,column )=>{
  const reportWorkQuantity = row.reportWorkQuantity[column.title] || 0
  const reportWorkQuantityCount = row.reportWorkQuantityCount[column.title] || 0
  if(reportWorkQuantity===reportWorkQuantityCount){
    return reportWorkQuantity
  const reportWorkTime = row.reportWorkTime[column.title] || 0
  if (reportWorkTime===0){
    if(reportWorkQuantity===reportWorkQuantityCount){
      return reportWorkQuantity
    }
    return (reportWorkQuantity
        +'('
        +reportWorkQuantityCount
        +')' )
  }
  else {
    if(reportWorkQuantity===reportWorkQuantityCount){
      return (reportWorkQuantity+'['
          +reportWorkTime
          +']')
    }
    return (reportWorkQuantity
        +'('
        +reportWorkQuantityCount
        +')'
        +'['
        +reportWorkTime
        +']'
    )
  }
  return (reportWorkQuantity
      +'('
      +reportWorkQuantityCount
      +')' )
  //return
}
north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderProcessDetail.java
@@ -1,9 +1,12 @@
package com.example.erp.entity.sd;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.time.LocalDate;
@Data
@TableName("sd.order_process_detail")
@@ -19,6 +22,8 @@
    private int reportingWorkNumCount;
    private int reportingWorkNum;
    private int brokenNum;
    @ExcelProperty("修改日期")
    private LocalDate updateTime;
//    private Order order;
//    private OrderDetail orderDetail;
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java
@@ -86,7 +86,12 @@
            getRowCount.forEach(row -> {
                Map<String, Integer> getRow = new HashMap<>();
                // { row: 0, col: 1, rowspan: 3, colspan: 0},
                getRow.put("row", row.get("RowNum"));
                Object rowNumObj = row.get("RowNum");
                if (rowNumObj instanceof Double) {
                    getRow.put("row", ((Double) rowNumObj).intValue());
                } else if (rowNumObj instanceof Integer) {
                    getRow.put("row", (Integer) rowNumObj);
                }
                getRow.put("col", col);
                getRow.put("rowspan", row.get("rowCount"));
                getRow.put("colspan", 0);
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java
@@ -331,6 +331,7 @@
                    .eq(OrderProcessDetail::getTechnologyNumber, reportingWorkDetail.getTechnologyNumber())
                    .setSql("reporting_work_num_count = reporting_work_num_count +" + orderProcessDetail.getReportingWorkNum())
                    .setSql("reporting_work_num =reporting_work_num +" + orderProcessDetail.getReportingWorkNum())
                    .setSql("update_time = now()")
                    .setSql("broken_num =broken_num +" + orderProcessDetail.getBrokenNum());
            orderProcessDetailMapper.update(null, updateWrapper);
            //判断完工数量和刺破数量是否为0,为0则不插入到数据库
north-glass-erp/src/main/resources/mapper/pp/Report.xml
@@ -166,6 +166,7 @@
               c.quantity,
               e.reportWorkQuantity,
               e.reportWorkQuantityCount,
               e.reportWorkTime,
               e.broken_num,
               ifnull(f.inventory, 0)                         as inventory,
               round(ifnull(f.inventory, 0) * a.area, 2)      as inventoryArea,
@@ -196,7 +197,11 @@
                                   concat('{',
                                          GROUP_CONCAT(concat("\"", process, "\":\"", reporting_work_num_count, "\"")),
                                          '}'
                                       )             as reportWorkQuantityCount
                                       )             as reportWorkQuantityCount,
                                   concat('{',
                                          GROUP_CONCAT(concat("\"", process, "\":\"", IFNULL(date(update_time),''), "\"")),
                                          '}'
                                       )             as reportWorkTime
                            FROM sd.order_process_detail as a
                            where a.order_id = #{orderId}
                            GROUP BY process_id, a.order_number, a.technology_number) as e