chenlu
2024-07-10 27346176f10ddcc2df668cdc76bf354132fb3dbc
在制品报表、班组产量报表修改
5个文件已修改
241 ■■■■ 已修改文件
north-glass-erp/northglass-erp/src/views/pp/report/WorkInProgress.vue 93 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/pp/ReportController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/Report.xml 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/report/WorkInProgress.vue
@@ -33,8 +33,12 @@
    value: 2,
    label: t('processCard.processId'),
  },
  // {
  //   value: 3,
  //   label: t('order.project'),
  // },
  {
    value: 3,
    value: 4,
    label: t('processCard.technologyNumber'),
  },
]
@@ -104,8 +108,12 @@
const titleSelectJson = ref({
  processType: [],
})
let optionVal=stateValue.value
if (optionVal == '') {
  optionVal = null
}
//第一次加载数据
request.post(`/report/workInProgress/${startTime}/${endTime}/${inputVal}/${inputProject}/${selectProcesses}`, filterData.value).then((res) => {
request.post(`/report/workInProgress/${startTime}/${endTime}/${inputVal}/${inputProject}/${selectProcesses}/${optionVal}`, filterData.value).then((res) => {
  if (res.code == 200) {
    // total.dataTotal = res.data.total.total*1
@@ -129,8 +137,11 @@
  if (inputVal == '') {
    inputVal = null
  }
  request.post(`/report/selectReportingWork/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${inputVal}`, filterData.value).then((res) => {
  let optionVal=stateValue.value
  if (optionVal == '') {
    optionVal = null
  }
  request.post(`/report/selectReportingWork/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${inputVal}/${optionVal}`, filterData.value).then((res) => {
    if (res.code == 200) {
@@ -156,7 +167,11 @@
  if (inputProject == '') {
    inputProject = null
  }
  request.post(`/report/workInProgress/${startTime}/${endTime}/${inputVal}/${inputProject}/${selectProcesses}`, filterData.value).then((res) => {
  let optionVal=stateValue.value
  if (optionVal == '') {
    optionVal = null
  }
  request.post(`/report/workInProgress/${startTime}/${endTime}/${inputVal}/${inputProject}/${selectProcesses}/${optionVal}`, filterData.value).then((res) => {
    if (res.code == 200) {
      // total.dataTotal = res.data.total.total*1
@@ -167,6 +182,7 @@
    } else {
      ElMessage.warning(res.msg)
    }
    //handleUpdateData(produceList)
  })
}
@@ -245,7 +261,8 @@
    {
      field: 'thisProcess', width: 120, title: t('report.workingProcedure'), filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged
      filterMethod: filterChanged,
      visible: true
    },
    {
      field: 'order_id',
@@ -254,7 +271,8 @@
      showOverflow: "ellipsis",
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged
      filterMethod: filterChanged,
      visible: true
    },
    {
      field: 'process_id',
@@ -263,34 +281,38 @@
      showOverflow: "ellipsis",
      filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged
      filterMethod: filterChanged,
      visible: true
    },
    {
      field: 'customer_name', width: 130, title: t('customer.customerName'), filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged
      filterMethod: filterChanged,
      visible: true
    },
    {
      field: 'project', width: 120, title: t('order.project'), filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged
      filterMethod: filterChanged,
      visible: true
    },
    {
      field: 'batch', width: 100, title: t('order.batch'), filters: [{data: ''}],
      slots: {filter: 'num1_filter'},
      filterMethod: filterChanged
      filterMethod: filterChanged,
      visible: true
    },
    {field: 'order_number', width: 100, title: t('order.OrderNum')},
    {field: 'technology_number', width: 120, title: t('processCard.technologyNumber'), showOverflow: "ellipsis"},
    {field: 'shape', width: 100, title: t('order.shape')},
    {field: 'process', width: 120, title: t('craft.process')},
    {field: 'quantity', width: 120, title: t('order.quantity')},
    {field: 'child_width', width: 120, title: t('order.width')},
    {field: 'child_height', width: 120, title: t('order.height')},
    {field: 'stockNum', width: 120, title: t('productStock.inventoryQuantity')},
    {field: 'stockArea', width: 120, title: t('report.inventoryArea')},
    {field: 'product_name', width: 120, title:  t('order.product')},
    {field: 'bend_radius', width: 120, title: t('order.bendRadius')},
    {field: 'order_number', width: 100, title: t('order.OrderNum'),visible: true},
    {field: 'technology_number', width: 120, title: t('processCard.technologyNumber'), showOverflow: "ellipsis",visible: true},
    {field: 'shape', width: 100, title: t('order.shape'),visible: true},
    {field: 'process', width: 120, title: t('craft.process'),visible: true},
    {field: 'quantity', width: 120, title: t('order.quantity'),visible: true},
    {field: 'child_width', width: 120, title: t('order.width'),visible: true},
    {field: 'child_height', width: 120, title: t('order.height'),visible: true},
    {field: 'stockNum', width: 120, title: t('productStock.inventoryQuantity'),visible: true},
    {field: 'stockArea', width: 120, title: t('report.inventoryArea'),visible: true},
    {field: 'product_name', width: 120, title:  t('order.product'),visible: true},
    {field: 'bend_radius', width: 120, title: t('order.bendRadius'),visible: true},
  ],//表头按钮
  toolbarConfig: {
@@ -321,7 +343,7 @@
        return ''
      })
    ]
  }
  },
})
@@ -376,6 +398,28 @@
  })
}
const handleUpdateData = (data) =>{
  // const usedColumns = new Set();
  // data.forEach(row => {
  //   Object.keys(row).forEach(key => {
  //     usedColumns.add(key);
  //   });
  // });
  // // 更新 columns 数组的 visible 属性来控制列的显示
  // gridOptions.columns.forEach(column => {
  //
  //   column.visible = usedColumns.has(column.field);
  // });
  //const columns = gridOptions.columns;
  // const ageColumn = columns.find(col => col.property === 'age');
  // if (ageColumn) {
  //   ageColumn.visible = !ageColumn.visible;
  //   VXETable.updateColumns(tableRef.value, columns);
  // }
}
</script>
<template>
@@ -399,7 +443,7 @@
        &nbsp;&nbsp;
        <el-input v-model="form.project" clearable :placeholder="$t('order.project')" style="width: 130px"></el-input>
        &nbsp;
        <el-select v-model="stateOptions[0]" class="m-2" :placeholder="$t('processCard.pleaseSelect')" clearable allow-create filterable style="width: 140px">
        <el-select v-model="stateValue" class="m-2" :placeholder="$t('processCard.pleaseSelect')" clearable allow-create filterable style="width: 140px">
          <el-option
              v-for="item in stateOptions"
              :key="item.value"
@@ -425,6 +469,7 @@
        class="mytable-scrollbar"
        max-height="100%"
        v-bind="gridOptions"
        :optimize="true"
    >
      <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
north-glass-erp/src/main/java/com/example/erp/controller/pp/ReportController.java
@@ -57,15 +57,16 @@
    @ApiOperation("在制品报表")
    @SaCheckPermission("WorkInProgress.search")
    @PostMapping("/workInProgress/{selectTime1}/{selectTime2}/{orderId}/{inputProject}/{selectProcesses}")
    @PostMapping("/workInProgress/{selectTime1}/{selectTime2}/{orderId}/{inputProject}/{selectProcesses}/{optionVal}")
    public Result workInProgress(
            @PathVariable Date selectTime1,
            @PathVariable Date selectTime2,
            @PathVariable String orderId,
            @PathVariable String inputProject,
            @PathVariable String selectProcesses,
            @PathVariable String optionVal,
            @RequestBody Report report) {
        return Result.seccess(reportService.workInProgressSv(selectTime1, selectTime2, orderId, inputProject, selectProcesses, report));
        return Result.seccess(reportService.workInProgressSv(selectTime1, selectTime2, orderId, inputProject, selectProcesses,optionVal, report));
    }
north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportMapper.java
@@ -69,6 +69,10 @@
    Map<String, Integer> teamOutputPageTotal(Integer offset, Integer pageSize, Date selectTime1, Date selectTime2, String selectProcesses, TeamOutputDTO teamOutputDTO);
    List<Map<String, String>> workInProgressOrderMp(Date selectTime1, Date selectTime2, String orderId, String inputProject, String selectProcesses, Report report);
    List<Map<String, String>> workInProgressProcessMp(Date selectTime1, Date selectTime2, String orderId, String inputProject, String selectProcesses, Report report);
//    Map<String, Integer> getWorkInProgressTotal(
//                                                @Param("selectTime1") Date selectTime1, @Param("selectTime2") Date selectTime2,
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportService.java
@@ -124,7 +124,7 @@
        return map;
    }
    public Map<String, Object> workInProgressSv(Date selectTime1, Date selectTime2, String orderId, String inputProject, String selectProcesses, Report report) {
    public Map<String, Object> workInProgressSv(Date selectTime1, Date selectTime2, String orderId, String inputProject, String selectProcesses, String optionVal, Report report) {
        if ("null".equals(orderId)) {
            orderId = "";
@@ -132,8 +132,24 @@
        if ("null".equals(inputProject)) {
            inputProject = "";
        }
        if ("null".equals(optionVal)) {
            optionVal = ("");
        }
        Map<String, Object> map = new HashMap<>();
        map.put("data", reportMapper.workInProgressMp(selectTime1, selectTime2, orderId, inputProject, selectProcesses, report));
        if (optionVal.equals("1")){
            /* 根据销售单号汇总*/
            map.put("data", reportMapper.workInProgressOrderMp(selectTime1, selectTime2, orderId, inputProject, selectProcesses, report));
        }else if(optionVal.equals("2")){
            /* 根流程卡号汇总*/
            map.put("data", reportMapper.workInProgressProcessMp(selectTime1, selectTime2, orderId, inputProject, selectProcesses, report));
        } else if (optionVal.equals("3")) {
        } else {
            map.put("data", reportMapper.workInProgressMp(selectTime1, selectTime2, orderId, inputProject, selectProcesses, report));
        }
        map.put("process", productionSchedulingMapper.selectProcess());
        return map;
    }
north-glass-erp/src/main/resources/mapper/pp/Report.xml
@@ -1290,4 +1290,123 @@
        limit #{offset},#{pageSize};
    </select>
    <select id="workInProgressOrderMp">
        select #{selectProcesses} as thisProcess,
               o.customer_name,
               o.project,
               o.order_id,
               o.batch,
               if(od.shape=1,'普形',if(od.shape=2,'异形','')) as shape,
               sum(od.quantity) as quantity,
               sum(odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count -
                   odpd.broken_num )as stockNum,
               sum(ROUND(ogd.child_width * ogd.child_height *
                         (odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count -
                          odpd.broken_num) / 1000000, 2)) as stockArea,
               od.product_name
        from sd.order_detail AS od
                 LEFT JOIN sd.order_glass_detail AS ogd
                           ON od.order_id = ogd.order_id
                               AND od.order_number = ogd.order_number
                 LEFT JOIN flow_card AS fc
                           ON fc.order_id = ogd.order_id
                               and fc.production_id = ogd.production_id
                               AND fc.order_number = ogd.order_number
                               AND fc.technology_number = ogd.technology_number
                 left join sd.order_process_detail as odpd
                           ON odpd.order_id = fc.order_id
                               AND odpd.order_number = fc.order_number
                               AND odpd.technology_number = fc.technology_number
                               and odpd.process_id = fc.process_id
                 left join sd.order_process_detail as odpds
                           ON odpds.id = odpd.id - 1
                 left join
             (SELECT sum(rw.rework_num) as 'patchNumSum',
                     rw.process_id,
                     rw.order_sort,
                     rw.technology_number,
                     rwk.this_process
              from rework as rw
                       LEFT JOIN
                   reporting_work as rwk
                   on rw.reporting_work_id = rwk.reporting_work_id
              where rwk.this_process = #{selectProcesses}
                and rw.review_status = 1
              GROUP BY rw.process_id, rw.order_sort, rw.technology_number) as c
             on c.process_id = fc.process_id
                 and c.order_sort = fc.order_number
                 and c.technology_number = fc.technology_number
                 left join sd.`order` as o
                           on o.order_id = od.order_id
        where LENGTH(fc.process_id) = 14
          and odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count -
              odpd.broken_num != 0
          and odpd.process = #{selectProcesses} and o.create_time between #{selectTime1} and #{selectTime2}
          and position(#{orderId} in od.order_id) and position(#{inputProject} in o.project)
        group by o.order_id
        order by o.order_id
    </select>
    <select id="workInProgressProcessMp">
        select #{selectProcesses} as thisProcess,
               o.customer_name,
               o.project,
               o.order_id,
               fc.process_id,
               o.batch,
               if(od.shape=1,'普形',if(od.shape=2,'异形','')) as shape,
               sum(od.quantity) as quantity,
               sum(odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count -
                   odpd.broken_num )as stockNum,
               sum(ROUND(ogd.child_width * ogd.child_height *
                         (odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count -
                          odpd.broken_num) / 1000000, 2)) as stockArea,
               od.product_name
        from sd.order_detail AS od
                 LEFT JOIN sd.order_glass_detail AS ogd
                           ON od.order_id = ogd.order_id
                               AND od.order_number = ogd.order_number
                 LEFT JOIN flow_card AS fc
                           ON fc.order_id = ogd.order_id
                               and fc.production_id = ogd.production_id
                               AND fc.order_number = ogd.order_number
                               AND fc.technology_number = ogd.technology_number
                 left join sd.order_process_detail as odpd
                           ON odpd.order_id = fc.order_id
                               AND odpd.order_number = fc.order_number
                               AND odpd.technology_number = fc.technology_number
                               and odpd.process_id = fc.process_id
                 left join sd.order_process_detail as odpds
                           ON odpds.id = odpd.id - 1
                 left join
             (SELECT sum(rw.rework_num) as 'patchNumSum',
                     rw.process_id,
                     rw.order_sort,
                     rw.technology_number,
                     rwk.this_process
              from rework as rw
                       LEFT JOIN
                   reporting_work as rwk
                   on rw.reporting_work_id = rwk.reporting_work_id
              where rwk.this_process = #{selectProcesses}
                and rw.review_status = 1
              GROUP BY rw.process_id, rw.order_sort, rw.technology_number) as c
             on c.process_id = fc.process_id
                 and c.order_sort = fc.order_number
                 and c.technology_number = fc.technology_number
                 left join sd.`order` as o
                           on o.order_id = od.order_id
        where LENGTH(fc.process_id) = 14
          and odpds.reporting_work_num_count + ifnull(c.patchNumSum, 0) - odpd.reporting_work_num_count -
              odpd.broken_num != 0
          and odpd.process = #{selectProcesses} and o.create_time between #{selectTime1} and #{selectTime2}
          and position(#{orderId} in od.order_id) and position(#{inputProject} in o.project)
        group by o.order_id,fc.process_id
        order by o.order_id,fc.process_id
    </select>
</mapper>