廖井涛
2025-09-22 3b19f5ce2baf4e1957dff3a101e1fbb00e728dc3
Merge branch 'master' of http://10.153.19.25:10105/r/ERP_override
9个文件已修改
168 ■■■■ 已修改文件
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/bom/OrderBOM.vue 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/bom/ProductBomAdd.vue 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/sd/BomDataController.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/entity/pp/FlowCard.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/sd/BomDataMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/sd/BomDataService.java 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/sd/BomDataMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue
@@ -127,7 +127,9 @@
      total.pageTotal = res.data.total.pageTotal
      orderInfo.workOrderDate = res.data.selectDate
      pageTotal.value = res.data.total
      total.value = res.data.total
      produceList.value = produceList.value.concat(deepClone(res.data.data))
      console.log(produceList.value)
      produceList.value.forEach(item => {
        switch (item.layoutStatus) {
          case "0":
@@ -189,6 +191,7 @@
      total.pageTotal = res.data.total.pageTotal
      orderInfo.workOrderDate = res.data.selectDate
      pageTotal.value = res.data.total
      total.value = res.data.total
      res.data.data.forEach(item => {
        switch (item.layoutStatus) {
          case "0":
@@ -244,6 +247,7 @@
      total.dataTotal = res.data.total.total*1
      total.pageTotal=parseInt(res.data.total)
      pageNum.value=1
      total.value = res.data.total
      produceList.value = deepClone(res.data.data)
      produceList.value.forEach(item => {
        switch (item.layoutStatus) {
@@ -336,7 +340,7 @@
    },
    {field: 'order.project', title: t('order.project'), showOverflow: "ellipsis"},
    {field: 'quantity', title: t('order.quantity'),},
    {field: 'orderDetail.computeGrossArea', title: t('order.area'),},
    {field: 'computeGrossArea', title: t('order.area'),},
    {field: 'founder', title: t('processCard.founder'),},
    {field: 'orderDetail.processingNote', title: t('order.processingNote'),},
@@ -369,9 +373,10 @@
        if (columnIndex === 0) {
          return t('basicData.total')
        }
        const List = ["quantity",'orderDetail.computeGrossArea']
        const List = ["quantity",'computeGrossArea']
        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/northglass-erp/src/views/sd/bom/OrderBOM.vue
@@ -45,7 +45,9 @@
  dataTotal : 0,
  pageSize : 50
})
let orderBomData =ref({
  productName:[]
})
const xGrid = ref()
const gridOptions = reactive({
@@ -474,7 +476,24 @@
const getTableRow =  (row,type) => {
  switch (type) {
    case 'edit': {
      dialogTableVisible.value = true
      if (row.orderId!="" && row.orderId!=null){
        request.post(`/BomData/getOrderBomData/${row.orderId}`,).then((res) => {
          if (res.code == 200 ) {
            orderBomData.value.productName =res.data.data
            console.log(orderBomData.value.productName)
            request.post(`/BomData/getBomDataProduct`,orderBomData.value).then((res) => {
              if (res.code == 200 ) {
                console.log(res.data.data)
              }
            })
          }
        })
        dialogTableVisible.value = true
      }
      break
    }
north-glass-erp/northglass-erp/src/views/sd/bom/ProductBomAdd.vue
@@ -251,39 +251,36 @@
  return parts
})
//每个产品对应的集合
const gridDataMapByProduct = reactive(
    productList.value.reduce((acc, name) => {
      acc[name] = []
      return acc
    }, {})
)
// 当前选中 tab 的下标
const activeProductIndex = ref(null)
const gridDataMapByProduct = reactive({})
const handleTabClick = (name) => {
  activeProduct.value = name
  if (!gridDataMapByProduct[name]) {
    gridDataMapByProduct[name] = []          // 首次点击该产品时初始化集合
const handleTabClick = (name, index) => {
  activeProductIndex.value = index
  if (!gridDataMapByProduct[index]) {
    gridDataMapByProduct[index] = [] // 初始化
  }
  xGridByProduct.value?.loadData(gridDataMapByProduct[name])
  xGridByProduct.value?.loadData(gridDataMapByProduct[index])
}
const getTableRow = (row, type) => {
  if (type !== 'add') return
  const key = activeProduct.value
  if (!key) {
  const key = activeProductIndex.value
  if (key=="" && key==null) {
    ElMessage.warning('请先选择一个产品标签')
    return
  }
  const plainRow = JSON.parse(JSON.stringify(row))
  const oldData = gridDataMapByProduct[key] || []
  gridDataMapByProduct[key] = [...oldData.map(item => JSON.parse(JSON.stringify(item))), plainRow]
  const oldData = (gridDataMapByProduct[key] || []).map((item) =>
      JSON.parse(JSON.stringify(item))
  )
  gridDataMapByProduct[key] = [...oldData, plainRow]
  xGridByProduct.value.loadData(gridDataMapByProduct[key])
}
const getTableRowDils = (row,type) =>{
  switch (type) {
    case 'delete' :{
      const key = activeProduct.value
      const key = activeProductIndex.value
      gridDataMapByProduct[key] = (gridDataMapByProduct[key] || []).filter(
          item => item.id !== row.id
      )
@@ -296,7 +293,7 @@
const saveProductBOM = () => {
  productList.value.forEach((name, index) => {
    const rows = gridDataMapByProduct[name] || []
    const rows = gridDataMapByProduct[index] || []
    const seq = index + 1
   //给每条数据加上对应层号、产品编号
@@ -305,6 +302,7 @@
      row.produceId = props.produceId
    })
  })
  console.log(gridDataMapByProduct)
  request.post(`/BomData/saveProductBOM`,gridDataMapByProduct).then((res) => {
    if(res.code==200){
      ElMessage.success(t('basicData.msg.saveSuccess'))
@@ -319,9 +317,9 @@
        <div class="product-tabs">
          <p
              v-for="(name, i) in productList"
              :key="name + i"
              :key="i"
              class="text item tab"
              :class="{ active: activeProduct === name }"
              :class="{ active: activeProductIndex === i }"
              @click="handleTabClick(name, i)"
          >
            {{ name }}
north-glass-erp/src/main/java/com/example/erp/controller/sd/BomDataController.java
@@ -33,5 +33,16 @@
    public Result saveProductBOM(@RequestBody Map<String, Object> object){
        return  Result.seccess(bomDataService.saveProductBOMSv(object));
    }
    @ApiOperation("查询订单BOM对应订单数据")
    @PostMapping("/getOrderBomData/{orderId}")
    public Result getOrderBomData(@PathVariable String orderId){
        return Result.seccess(bomDataService.getOrderBomDataSv(orderId));
    }
    @ApiOperation("更新基础数据")
    @PostMapping("getBomDataProduct")
    public Result getBomDataProduct(@RequestBody Map<String, Object> object){
        return  Result.seccess(bomDataService.getBomDataProductSv(object));
    }
}
north-glass-erp/src/main/java/com/example/erp/entity/pp/FlowCard.java
@@ -74,6 +74,9 @@
    private LocalDate updateTime;
    //查询用
    //流程卡面积
    @TableField(select = false,exist = false)
    private Double computeGrossArea;
    //标签打印数量
    @TableField(select = false,exist = false)
    private Integer printQuantity;
north-glass-erp/src/main/java/com/example/erp/mapper/sd/BomDataMapper.java
@@ -5,6 +5,7 @@
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
@Mapper
public interface BomDataMapper extends BaseMapper<BasicData> {
@@ -17,4 +18,8 @@
    Boolean updateMaterialBomDataMp(Integer id, String name, Object consume, Object price, Integer type);
    Boolean saveProductBOMMp(Object produceId, Object tabId, Object layer);
    List<Map<String, String>> getOrderBomDataMp(String orderId);
    List<Map<String, String>> getBOMDetails(Integer productId);
}
north-glass-erp/src/main/java/com/example/erp/service/sd/BomDataService.java
@@ -1,11 +1,11 @@
package com.example.erp.service.sd;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.erp.entity.sd.BasicData;
import com.example.erp.entity.sd.BasicOtherMoney;
import com.example.erp.entity.sd.BomBase;
import com.example.erp.entity.sd.Customer;
import com.example.erp.entity.pp.FlowCard;
import com.example.erp.entity.sd.*;
import com.example.erp.mapper.sd.BomDataMapper;
import com.example.erp.mapper.sd.BasicOtherMoneyMapper;
import com.example.erp.mapper.sd.CustomerMapper;
@@ -72,4 +72,26 @@
        return true;
    }
    public Map<String, Object> getOrderBomDataSv(String orderId) {
        Map<String, Object> map = new HashMap<>();
        map.put("data", bomDataMapper.getOrderBomDataMp(orderId));
        return map;
    }
    public Map<String, Object> getBomDataProductSv(Map<String, Object> object) {
        Map<String, Object> map = new HashMap<>();
        List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();//最终结果
        List<OrderDetail> orderDetailsList = JSONArray.parseArray(JSONObject.toJSONString(object.get("productName")), OrderDetail.class);
        if (!orderDetailsList.isEmpty()) {
            for (OrderDetail od : orderDetailsList) {
                Map<String, Object> itemmap = new HashMap<>();
                itemmap.put("data", bomDataMapper.getBOMDetails(od.getProductId()));
                list.add(itemmap);
            }
        }
        map.put("data", list);
        return map;
    }
}
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -12,6 +12,7 @@
        <result column="layout_status" property="layoutStatus"/>
        <result column="merge" property="merge"/>
        <result column="rack" property="rack"/>
        <result column="compute_gross_area" property="computeGrossArea"/>
        <!--接收其他外键实体类数据-->
        <association property="order" javaType="com.example.erp.entity.sd.Order">
            <result column="project" property="project"/>
@@ -31,7 +32,6 @@
            <result column="compute_gross_area" property="computeGrossArea"/>
            <result column="processing_note" property="processingNote"/>
            <result column="quantity" property="quantity"/>
            <result column="compute_gross_area" property="computeGrossArea"/>
            <result column="perimeter" property="perimeter"/>
            <result column="order_number" property="orderNumber"/>
            <result column="width" property="width"/>
@@ -117,10 +117,29 @@
    <select id="getPageTotal">
        SELECT SUM(quantity) as quantity,
               SUM(compute_gross_area) as computeGrossArea,
               CEILING(count(fcd.process_Id)/100) as 'pageTotal',
               count(distinct fcd.process_Id) as 'total'
        from (
        select
        CEILING(count(a.process_Id)/#{pageSize}) as 'pageTotal',
        count(distinct a.process_Id) as 'total'
        from flow_card as a left join sd.`order` as b on a.order_Id=b.order_id
        a.order_Id,
        a.process_Id,
        c.product_id,
        c.product_name,
        b.project,
        sum(a.quantity) as quantity,
        sum(a.quantity) * c.area as compute_gross_area,
        a.founder,
        c.processing_note,
        b.customer_name,
        layout_status as layout_status,
        a.merge,
        a.rack,
        b.batch
        from (select id,order_id,process_id,order_number, quantity,founder,max(layout_status) as layout_status,create_time,max(merge) as merge,rack from flow_card
        group by process_Id,order_number) as a
        left join sd.`order` as b on a.order_Id=b.order_id
        left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number
        where date(a.create_time)>=#{selectTime1} and date(a.create_time) &lt;= #{selectTime2}
        and b.create_order>0
@@ -152,9 +171,15 @@
        <if test="flowCard.merge != null">
            and a.merge regexp #{flowCard.merge}
        </if>
        <if test="flowCard.rack != null and flowCard.rack != ''">
            and a.rack regexp #{flowCard.rack}
        </if>
        <if test="flowCard.order.customerName != null and flowCard.order.customerName!= ''">
            and b.customer_name regexp #{flowCard.order.customerName}
        </if>
        group by a.process_Id
        ORDER BY a.id desc
        limit #{offset},#{pageSize};
        ) as fcd
    </select>
    <!--分架查询-->
north-glass-erp/src/main/resources/mapper/sd/BomDataMapper.xml
@@ -26,4 +26,12 @@
                (product_id,base_id,product_layer)
        values (#{produceId},#{tabId},#{layer})
    </insert>
    <select id="getOrderBomDataMp">
        SELECT DISTINCT product_id,product_name from sd.order_detail where order_id=#{orderId}
    </select>
    <select id="getBOMDetails">
    </select>
</mapper>