guoyuji
2025-02-14 120df3e19856f9d3e27aec50d399cff72b331079
Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
12个文件已修改
244 ■■■■ 已修改文件
north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet4.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintCustomLabelSemi1.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintCustomLabelSemi2.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/mm/MaterialInventoryController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/entity/pp/OptimizeUse.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/mm/MaterialInventoryMapper.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/mm/MaterialInventoryService.java 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/components/sd/order/PrintSheet4.vue
@@ -36,6 +36,7 @@
})
const getData = () => {
  request.get(`/order/printOrderProductDetail/${props.orderId}/${selectedValues.value}`).then(res => {
    console.log( res.data)
    data.value= res.data
    productIdData.value=data.value.orderProductDetail
    data.value.orderProductDetail.forEach(item => {
@@ -188,6 +189,11 @@
                <td>{{items.orderNumber}}</td>
                <td>{{items.buildingNumber}}</td>
                <td colspan="3" style="font-size: 20px;font-weight: bold;" v-if="items.otherColumns?.S02">{{items.otherColumns?.S02}}</td>
                <td colspan="3" style="font-size: 20px;font-weight: bold;" v-else-if="items.differentSize=1">
                  <template v-for="(orderGlassDetail, index1) in items.orderGlassDetails" >
                  ({{orderGlassDetail.childWidth}}x{{orderGlassDetail.childHeight}})
                  </template>
                </td>
                <td colspan="3" style="font-size: 20px;font-weight: bold;" v-else>{{items.width}}x{{items.height}}</td>
                <td style="font-size: 20px;font-weight: bold;">{{items.quantity}}</td>
                <td style="font-size: 20px;font-weight: bold;">{{items.grossArea.toFixed(2)}}</td>
@@ -322,7 +328,7 @@
  height: 30px;
}
.contactNumber{
  width: 150px;
  width: 125px;
  height:20px;
  border: none;
  box-shadow: none;
north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue
@@ -606,18 +606,6 @@
        } else {
          // item.baiscQuantity = item.baiscQuantity * 1 + leftData[leftfilterIndex].quantity * 1
          // item.computeGrossArea=(item.width*item.height*item.baiscQuantity/1000000).toFixed(2)
          //item.computeGrossArea=(item.width*item.height*item.baiscQuantity/1000000).toFixed(2)
          // for (let i = 0; i <checkedList.length ; i++) {
          //
          //   if (checkedList[i].orderNumber === item.orderNumber){
          //     console.log(item.baiscQuantity  +"---"+ checkedList[i].quantity )
          //     item.baiscQuantity = item.baiscQuantity * 1 + checkedList[i].quantity * 1
          //   }
          // }
          delete item._X_ROW_KEY
          $grid.insert(item)
@@ -654,7 +642,29 @@
      // 更新 item.processId
      item.processId = newProcessId;
    });
    // 获取剩余数据,用于对落架顺序重新赋值
    let remainingData = $gridLeft.getTableData().fullData;
    // 按 processId 分组
    let groupedData = remainingData.reduce((acc, curr) => {
      if (!acc[curr.processId]) {
        acc[curr.processId] = [];
      }
      acc[curr.processId].push(curr);
      return acc;
    }, {});
    // 按 processId 排序(倒序)
    let sortedProcessIds = Object.keys(groupedData).sort((a, b) => b - a);
    // 更新每个分组的 landingSequence
    sortedProcessIds.forEach((processId, index) => {
      let group = groupedData[processId];
      // 对每个 processId 分组内的数据,不改变顺序,直接赋相同的 landingSequence
      group.forEach((item) => {
        item.landingSequence = sortedProcessIds.length - index; // 按倒序设置 landingSequence
      });
    });
    //清除两边复选框
    $gridLeft.clearCheckboxRow()
    $grid.clearCheckboxRow()
@@ -662,10 +672,13 @@
  } catch (e) {
    ElMessage.warning(e.message)
  }
  //每次点击情况输入框
  if (checkedNum.value){
    checkedNum.value =''
  }
}
//向左边表格添加数据
const addLeft = () => {
  try {
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintCustomLabelSemi1.vue
@@ -153,7 +153,8 @@
        <span>{{ item.processingNote }}</span>
      </div>
    </div>
    <div style="width: 20px" v-if="id%2===0"></div>
    <div style="width: 19px" v-if="id%2===0"></div>
      <div class="element-to-break-after" style="width: 1px" v-if="id%2===1"></div>
    </template>
  </div>
@@ -231,7 +232,9 @@
  font-size: 8pt;
}
.element-to-break-after {
  page-break-after: always;
}
north-glass-erp/northglass-erp/src/views/pp/processCard/PrintCustomLabelSemi2.vue
@@ -183,7 +183,8 @@
        <span>{{item.processing_note}}</span>
      </div>
    </div>
      <div style="width: 20px" v-if="id%2===0"></div>
      <div style="width: 19px" v-if="id%2===0"></div>
      <div class="element-to-break-after" style="width: 1px" v-if="id%2===1"></div>
    </template>
  </div>
@@ -280,7 +281,9 @@
}
.element-to-break-after {
  page-break-after: always;
}
north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue
@@ -1004,7 +1004,9 @@
  request.post(`/order/saveOrderTitle`,order).then((res) => {
    if(res.code==200){
      ElMessage.success(t('basicData.msg.saveSuccess'))
      router.push({path:'/main/order/selectOrder'})
      router.push({path:'/main/order/createOrder',query:{
          orderId:titleUploadData.value.orderId,
          random:Math.random()}})
    }else {
      ElMessage.error(res.msg)
    }
@@ -1668,7 +1670,7 @@
      </vxe-grid>
    </div>
    <el-dialog v-model="dialogTableVisible" :title="$t('order.processingNote')" style="width: 60%;height:75% ">
    <el-dialog v-model="dialogTableVisible" :draggable="true" :title="$t('order.processingNote')" style="width: 60%;height:75% ">
      <el-input
          v-model="titleUploadData.processingNote"
          type="textarea"
north-glass-erp/src/main/java/com/example/erp/controller/mm/MaterialInventoryController.java
@@ -182,6 +182,13 @@
    }
    @ApiOperation("mes切割报工")
    @PostMapping  ("/mesMaterialOutbound")
    public Result mesMaterialOutbound(@RequestBody Map<String,Object> reportingWork)  {
        return  Result.seccess(materialInventoryService.mesMaterialOutbound(reportingWork));
    }
}
north-glass-erp/src/main/java/com/example/erp/entity/pp/OptimizeUse.java
@@ -12,7 +12,7 @@
public class OptimizeUse {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private Integer projectNo;
    private String projectNo;
    private String rawStockCode;
    private String stockCode;
    private Integer type;
north-glass-erp/src/main/java/com/example/erp/mapper/mm/MaterialInventoryMapper.java
@@ -116,6 +116,9 @@
    Boolean updateMaterialInventoryAvailableInventoryOut(@Param("inventoryId") Long inventoryId,
                                                @Param("quantity") Integer quantity);
    Boolean updateMaterialInventoryAvailableInventoryOutMes(@Param("inventoryId") Long inventoryId,
                                                         @Param("quantity") Integer quantity);
    Boolean updateMaterialInventoryAvailableInventoryInt(@Param("inventoryId") Long inventoryId,
                                                @Param("quantity") Integer quantity);
@@ -231,4 +234,22 @@
    List<MaterialLog> exportMaterialLogReport(List<LocalDate> dates, String type);
    List<MaterialOutbound> getSelectMaterialOutboundProjectNo(@Param("projectNo") String projectNo);
    OptimizeUse getSelectOptimizeUses(@Param("projectNo") String projectNo,@Param("width") Double width,@Param("height") Double height);
    List<MaterialOutboundDetail> getSelectMaterialOutboundOptimizeUses(@Param("materialOutboundId") String materialOutboundId,@Param("useId") Integer useId);
    Boolean updateMaterialOutboundOptimizeUses(@Param("useId") Integer useId,@Param("quantity") Integer quantity);
    Boolean insertMaterialOutboundDetailOptimizeUses(@Param("materialOutboundId") String materialOutboundId,@Param("number") Integer number,
                                               @Param("inventoryId") Long inventoryId,@Param("materialCode") Long materialCode,@Param("inventoryArea") String inventory_area,
                                               @Param("useId") Integer useId,@Param("outboundQuantity") Integer outboundQuantity,
                                               @Param("singlePieceArea") Double singlePieceArea,@Param("dateOfManufacture") LocalDate dateOfManufacture);
    Boolean insertMaterialOutboundOptimizeUses(@Param("materialOutboundId") String materialOutboundId,@Param("projectNo") String projectNo,
                                                     @Param("name") String name);
    Boolean updateOptimizeUsesMes(@Param("useId") Integer useId,@Param("quantity") Integer quantity);
}
north-glass-erp/src/main/java/com/example/erp/service/mm/MaterialInventoryService.java
@@ -1,18 +1,22 @@
package com.example.erp.service.mm;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.example.erp.common.Constants;
import com.example.erp.dto.mm.FinishedOperateLogDTO;
import com.example.erp.entity.mm.*;
import com.example.erp.entity.pp.FlowCard;
import com.example.erp.entity.pp.OptimizeUse;
import com.example.erp.entity.pp.*;
import com.example.erp.entity.sd.Delivery;
import com.example.erp.entity.sd.DeliveryDetail;
import com.example.erp.entity.sd.OrderDetail;
import com.example.erp.entity.sd.OrderProcessDetail;
import com.example.erp.entity.userInfo.Log;
import com.example.erp.entity.userInfo.SysError;
import com.example.erp.exception.ServiceException;
import com.example.erp.mapper.mm.BasicWarehouseTypeMapper;
import com.example.erp.mapper.mm.MaterialInventoryMapper;
import com.example.erp.mapper.mm.MaterialLogMapper;
@@ -23,6 +27,8 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.time.LocalDateTime;
import java.util.List;
import java.util.ArrayList;
@@ -939,6 +945,63 @@
    @Transactional(rollbackFor = Exception.class)
    public boolean mesMaterialOutbound(Map<String, Object> reportingWorkMap) {
        boolean saveState=true;
        Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint();
        try {
            //接收解析主附表信息
            JSONObject reportingWorkJson = new JSONObject(reportingWorkMap);
            String projectNo=reportingWorkJson.get("projectNo").toString();
            Double width= Double.valueOf(reportingWorkJson.get("width").toString());
            Double height= Double.valueOf(reportingWorkJson.get("height").toString());
            Integer quantity= Integer.valueOf(reportingWorkJson.get("quantity").toString());
            List<MaterialOutbound> materialOutboundList=materialInventoryMapper.getSelectMaterialOutboundProjectNo(projectNo);
            OptimizeUse optimizeUses=materialInventoryMapper.getSelectOptimizeUses(projectNo,width,height);
            MaterialInventory materialInventory=materialInventoryMapper.getMaterialInventoryById(Long.valueOf(optimizeUses.getRawStockCode()));
            if(materialOutboundList.size()==1){
                List<MaterialOutboundDetail> materialOutboundDetailList=materialInventoryMapper.getSelectMaterialOutboundOptimizeUses(materialOutboundList.get(0).getMaterialOutboundId(),optimizeUses.getId());
                List<MaterialOutboundDetail> materialOutboundDetailList1=materialInventoryMapper.getSelectMaterialOutboundOptimizeUses(materialOutboundList.get(0).getMaterialOutboundId(),null);
                if(materialOutboundDetailList.size()==1){
                    materialInventoryMapper.updateMaterialOutboundOptimizeUses(optimizeUses.getId(),quantity);
                }else{
                    materialInventoryMapper.insertMaterialOutboundDetailOptimizeUses(materialOutboundList.get(0).getMaterialOutboundId(),
                            materialOutboundDetailList1.size()+1,Long.valueOf(optimizeUses.getRawStockCode()),materialInventory.getMaterialCode(),materialInventory.getInventoryArea(),
                            optimizeUses.getId(),quantity,materialInventory.getSinglePieceArea(),materialInventory.getDateOfManufacture());
                }
            }else if(materialOutboundList.isEmpty()){
                String oddNumber = orderNumberSetting("出库");
                materialInventoryMapper.insertMaterialOutboundOptimizeUses(oddNumber,projectNo,reportingWorkJson.get("userName").toString());
                materialInventoryMapper.insertMaterialOutboundDetailOptimizeUses(oddNumber, 1,Long.valueOf(optimizeUses.getRawStockCode()),materialInventory.getMaterialCode(),materialInventory.getInventoryArea(),
                        optimizeUses.getId(),quantity,materialInventory.getSinglePieceArea(),materialInventory.getDateOfManufacture());
            }else{
                return false;
            }
            materialInventoryMapper.updateMaterialInventoryAvailableInventoryOutMes(Long.valueOf(optimizeUses.getRawStockCode()),quantity);
            materialInventoryMapper.updateOptimizeUsesMes(optimizeUses.getId(),quantity);
            //保存日志
            Log log = new Log();
            log.setContent(reportingWorkMap.toString());
            log.setFunction("mesMaterialOutbound报工新增");
            log.setOperatorId((String) reportingWorkJson.get("userId"));
            log.setOperator((String) reportingWorkJson.get("userName"));
            logService.saveLog(log);
        } catch (Exception e) {
            TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint);
            //将异常传入数据库
            SysError sysError = new SysError();
            sysError.setError(e+Arrays.toString(e.getStackTrace()));
            sysError.setFunc("mesMaterialOutbound报工新增");
            sysErrorService.insert(sysError);
            saveState = false;
        }
        return saveState;
    }
north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java
@@ -614,6 +614,19 @@
            orderProductDetailMap.put("productId",map.get("productId"));
            orderProductDetailMap.put("productName",map.get("productName"));
            List<OrderDetail> orderDetails = orderDetailMapper.getOrderProductByProductId(map.get("productId"),orderId);
            orderDetails.forEach(orderDetail->{
                List<OrderGlassDetail> orderGlassDetails =
                        orderGlassDetailMapper.selectList(
                                new QueryWrapper<OrderGlassDetail>().
                                        eq("order_id",orderId).
                                        eq("order_number",orderDetail.getOrderNumber())
                        );
                Integer differentSize = orderGlassDetailMapper.getDifferentSizeNumber(orderId,orderDetail.getOrderNumber());
                orderDetail.setDifferentSize(differentSize);
                orderDetail.setOrderGlassDetails(orderGlassDetails);
            });
            orderProductDetailMap.put("productDetail",orderDetails);
            orderProductDetail.add(orderProductDetailMap);
        });
@@ -632,13 +645,24 @@
        }else{
            orderProductDistinct = orderDetailMapper.getOrderProductDistinctById(orderId);
        }
        List<Map<String,Object>> orderProductDetail = new ArrayList<>();
        orderProductDistinct.forEach(map->{
            Map<String,Object> orderProductDetailMap = new HashMap<>();
            orderProductDetailMap.put("productId",map.get("productId"));
            orderProductDetailMap.put("productName",map.get("productName"));
            List<OrderDetail> orderDetails = orderDetailMapper.getOrderProductByProductId(map.get("productId"),orderId);
            orderDetails.forEach(orderDetail->{
                List<OrderGlassDetail> orderGlassDetails =
                        orderGlassDetailMapper.selectList(
                                new QueryWrapper<OrderGlassDetail>().
                                        eq("order_id",orderId).
                                        eq("order_number",orderDetail.getOrderNumber())
                        );
                Integer differentSize = orderGlassDetailMapper.getDifferentSizeNumber(orderId,orderDetail.getOrderNumber());
                orderDetail.setDifferentSize(differentSize);
                orderDetail.setOrderGlassDetails(orderGlassDetails);
            });
            orderProductDetailMap.put("productDetail",orderDetails);
north-glass-erp/src/main/resources/mapper/mm/MaterialInventory.xml
@@ -727,6 +727,13 @@
        where id=#{inventoryId}
    </update>
    <update id="updateMaterialInventoryAvailableInventoryOutMes">
        update mm.material_inventory
        set available_quantity=available_quantity-#{quantity},inventory_quantity=inventory_quantity-#{quantity},
            plan_quantity=plan_quantity-#{quantity},total_area=inventory_quantity*single_piece_area
        where id=#{inventoryId}
    </update>
    <update id="updateMaterialOutboundToExamine">
        update mm.material_outbound set reviewed_state=#{reviewedState},reviewed=#{reviewed},reviewed_time=now()
@@ -1061,5 +1068,48 @@
        </where>
    </select>
    <select id="getSelectMaterialOutboundProjectNo">
        select * from mm.material_outbound mo where order_id=#{projectNo}
    </select>
    <select id="getSelectOptimizeUses">
        select * from pp.optimize_use  where project_no=#{projectNo} and width=#{width} and height=#{height} and state=1
    </select>
    <select id="getSelectMaterialOutboundOptimizeUses">
        select * from mm.material_outbound_detail mo
        <where>
            mo.material_outbound_id=#{materialOutboundId}
            <if test="useId != null">
               and mo.use_id=#{useId}
            </if>
        </where>
    </select>
    <select id="updateMaterialOutboundOptimizeUses">
        update mm.material_outbound_detail set outbound_quantity=outbound_quantity+#{quantity} where use_id=#{useId};
    </select>
    <select id="updateOptimizeUsesMes">
        update pp.optimize_use set not_use_count=not_use_count-#{quantity} where id=#{useId};
    </select>
    <insert id="insertMaterialOutboundDetailOptimizeUses"  useGeneratedKeys="true" >
        insert into mm.material_outbound_detail (material_outbound_id,material_outbound_number,material_code,use_id,inventory_id,inventory_organization,
                                                 outbound_quantity,single_piece_area,inventory_area,date_of_manufacture)
        values (
                   #{materialOutboundId} ,#{number},#{materialCode},#{useId},#{inventoryId},'原片库',#{outboundQuantity},
                   #{singlePieceArea},#{inventoryArea},#{dateOfManufacture}
               )
    </insert>
    <insert id="insertMaterialOutboundOptimizeUses"  useGeneratedKeys="true" >
        insert into mm.material_outbound(material_outbound_id,order_id,outbound_type,
                                         warehouse_manager,material_requisition_date,reviewed_state,reviewed,create_time,reviewed_time)
        values (
                   #{materialOutboundId} ,#{projectNo},'标准出库',#{name},now(),1,#{name},now(),now()
               )
    </insert>
</mapper>
north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml
@@ -738,7 +738,7 @@
               fc.quantity,
               round(ogd.total_area, 2)                                       as total_area,
               od.perimeter,
               if(od.bend_radius!=null,od.bend_radius,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04'))) as bend_radius,
               if(od.bend_radius!=null || od.bend_radius!='',od.bend_radius,if(od.shape=2,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')),'')) as bend_radius,
               concat(IFNULL(od.processing_note, ''), IFNULL(od.remarks, '')) as remarks,
               od.other_columns,
               round(ogd.child_width)                                         as width,
@@ -1396,7 +1396,7 @@
               fc.quantity,
               round(ogd.total_area, 2)                                       as total_area,
               od.perimeter,
               if(od.bend_radius!=null,od.bend_radius,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04'))) as bend_radius,
               if(od.bend_radius!=null || od.bend_radius!='',od.bend_radius,if(od.shape=2,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')),'')) as bend_radius,
               concat(IFNULL(od.processing_note, ''), IFNULL(od.remarks, '')) as remarks,
               od.other_columns,
               round(ogd.child_width)                                         as width,
@@ -1503,7 +1503,7 @@
               sum(pl.patch_num)                                                 as quantity,
               round(ogd.total_area, 2)                                       as total_area,
               od.perimeter,
               if(od.bend_radius!=null,od.bend_radius,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04'))) as bend_radius,
               if(od.bend_radius!=null || od.bend_radius!='',od.bend_radius,if(od.shape=2,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')),'')) as bend_radius,
               concat(IFNULL(od.processing_note, ''), IFNULL(od.remarks, '')) as remarks,
               od.other_columns,
               round(ogd.child_width)                                         as width,