guoyujie
2025-08-19 75804cb9b6946557451799261434818389540248
提交 装箱调架后端程序
8个文件已修改
200 ■■■■■ 已修改文件
north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheetLuoyangDetails.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/mm/productStock/ProductStockList.vue 80 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/bom/OrderBOM.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/mm/FinishedGoodsInventoryController.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/entity/mm/FinishedGoodsInventory.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/mm/FinishedGoodsInventoryMapper.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/mm/FinishedGoodsInventoryService.java 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/mm/FinishedGoodsInventory.xml 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheetLuoyangDetails.vue
@@ -515,7 +515,7 @@
  }*/
  .foot{
    position: absolute;
    bottom: 1cm;
    bottom: 0.3cm;
  //transform: translateY(8cm);
  }
  /*#table-sum {
north-glass-erp/northglass-erp/src/views/mm/productStock/ProductStockList.vue
@@ -13,6 +13,7 @@
const { t } = useI18n()
let router=useRouter()
let produceList = ref([])
let dialogTableVisible = ref(false)
const getTableRow = (row,type) =>{
  switch (type) {
    case 'edit' :{
@@ -122,7 +123,6 @@
    filterData.value[column.property] = value
  }
  request.post(`/finishedGoodsInventory/getSelect/1/${total.pageSize}`,filterData.value).then((res) => {
    if(res.code==200){
      total.dataTotal = res.data.total.total*1
      total.pageTotal= res.data.total.pageTotal
@@ -139,7 +139,6 @@
const selectOrderList = ()=>{
  request.post(`/finishedGoodsInventory/getSelect/${pageNum.value}/${total.pageSize}`,filterData.value).then((res) => {
    if(res.code==200){
      if (res.data.total!=null){
        total.dataTotal = res.data.total.total*1
@@ -233,6 +232,7 @@
      { 'code' :'issue','name':t('productStock.orderTransfer'),status: 'primary'},
      { 'code' :'out','name':t('productStock.finishedProductPickup'),status: 'primary'},
      /*{ 'code' :'rework','name':t('productStock.finishedProductRework'),status: 'primary'},*/
      /*{ 'code' :'changeRack','name':'装箱调架',status: 'primary'},*/
    ],
    /*import: false,
@@ -261,7 +261,7 @@
})
let currentRecord = ref(null)
const  xGrid = ref();
const gridEvents = {
  toolbarButtonClick({ code }) {
@@ -270,23 +270,44 @@
      switch (code){
        case 'issue':{
          /*VXETable.modal.confirm('点击了库存调拨');*/
          router.push({path: '/main/productStock/OrderAllocation'});
          return;
          router.push({path: '/main/productStock/OrderAllocation'})
          break
        }
        case 'out':{
          router.push({path: '/main/productStock/FinishedGoodsIssue'});
          return;
          break;
          router.push({path: '/main/productStock/FinishedGoodsIssue'})
          break
        }
        case 'rework':{
          router.push({path: '/main/productStock/FinishedProductRework'});
          return;
          break;
          router.push({path: '/main/productStock/FinishedProductRework'})
          break
        }
        case 'changeRack':{
          currentRecord.value = null
          if(xGrid.value.getCurrentRecord()===null){
            ElMessage.warning(t('productStock.unselectedData'))
            return
          }
          currentRecord.value = JSON.parse(JSON.stringify(xGrid.value.getCurrentRecord()))
          console.log(currentRecord.value)
          dialogTableVisible.value = true
          break
        }
      }
    }
  }
}
const changeRack = () => {
  // if(){
  //
  // }
  request.post(`/finishedGoodsInventory/changeRack`,currentRecord.value).then((res) => {
    console.log(res)
    if(res.code==200 && res.data ===true){
      ElMessage.success('装箱调架成功')
    }else{
      ElMessage.warning(res.msg)
    }
  })
}
@@ -345,6 +366,40 @@
      </template>
    </vxe-grid>
    <el-dialog v-model="dialogTableVisible"  style="width: 400px;height:250px;margin-top: 25vh">
      <el-row>
        <el-col :span="8">
          <el-text>箱号:</el-text>
        </el-col>
        <el-col :span="16">
          <el-input v-model="currentRecord.boxNo"/>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
          <el-text>数量:</el-text>
        </el-col>
        <el-col :span="16">
          <el-input v-model="currentRecord.quantityAvailable" type="number"/>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
          <el-text>备注:</el-text>
        </el-col>
        <el-col :span="16">
          <el-input v-model="currentRecord.remark"/>
        </el-col>
      </el-row>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="changeRack">
            调架
          </el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
@@ -360,4 +415,7 @@
  -ms-user-select: none;
  user-select: none;
}
.el-row {
  margin-bottom: 10px;
}
</style>
north-glass-erp/northglass-erp/src/views/sd/bom/OrderBOM.vue
@@ -119,8 +119,6 @@
  columns:[
    {title: t('basicData.operate'), width: 110, slots: { default: 'button_slot' },fixed:"left",},
    {type: 'seq', title: t('basicData.Number'), width: 80 ,fixed:"left",},
    {field: 'orderId',width:120,  title: t('order.orderId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'customerId',width:120,  title: t('customer.customerNumber'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'customerName',width:120,  title: t('customer.customerName'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
@@ -129,6 +127,7 @@
    {field: 'quantity',width:120,  title: t('order.quantity'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
   // {field: 'goodsQuantity',width:120,  title: t('searchOrder.inventoryNum'), sortable: true},
    {field: 'area',width:120,  title: t('order.computeGrossArea'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'bomPrice',width:120,  title: 'BOM成本',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'money',width:120,  title: t('order.money'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'createTime',width:120,filters:[{ data: '' }],slots: { filter: 'num1_filter' },   title: t('basicData.reportData'), sortable: true},
    {field: 'packType',width:120,  title: t('order.packType'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
@@ -171,10 +170,10 @@
        if (columnIndex === 0) {
          return t('basicData.total')
        }
        const List = ["quantity",'goodsQuantity','area','perimeter','money']
        const List = ["quantity",'goodsQuantity','area','perimeter','money','bomPrice']
        if (List.includes(column.field)) {
          //return footSum(data, column.field)
          return total.value[column.field]
          return footSum(data, column.field)
          //return total.value[column.field]
        }
        return ''
      })
@@ -374,6 +373,9 @@
      /*total.dataTotal = res.data.total.dataTotal*1
      total.pageTotal= res.data.total.pageTotal*/
      orderInfo.selectDate = res.data.selectDate
      res.data.data.forEach((item)=>{
        item.bomPrice=(item.money/1.3).toFixed(2)
      })
      orderList.value = deepClone(res.data.data)
      xGrid.value.loadData(orderList.value)
    }else{
north-glass-erp/src/main/java/com/example/erp/controller/mm/FinishedGoodsInventoryController.java
@@ -209,4 +209,12 @@
    public Result getSelectPrints( @RequestBody Map<String, Object> object){
        return Result.seccess(finishedGoodsInventoryService.getSelectPrintSvs(object));
    }
    @ApiOperation("成品装箱调架")
    @SaCheckPermission("createProductStock.add")
    @PostMapping("/changeRack")
    public Result changeRack( @RequestBody FinishedGoodsInventory  finishedGoodsInventory){
        return Result.seccess(finishedGoodsInventoryService.changeRack(finishedGoodsInventory));
    }
}
north-glass-erp/src/main/java/com/example/erp/entity/mm/FinishedGoodsInventory.java
@@ -1,6 +1,7 @@
package com.example.erp.entity.mm;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.example.erp.entity.sd.*;
import lombok.Data;
@@ -27,8 +28,11 @@
    private LocalDate endTime;
    private String processId;
    private String boxNo;
    @TableField(select = false,exist = false)
    private Order order;
    @TableField(select = false,exist = false)
    private OrderDetail orderDetail;
    @TableField(select = false,exist = false)
    private Double weight;
}
north-glass-erp/src/main/java/com/example/erp/mapper/mm/FinishedGoodsInventoryMapper.java
@@ -1,5 +1,7 @@
package com.example.erp.mapper.mm;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.erp.dto.otherSystem.GlassDetailList;
import com.example.erp.entity.mm.FinishedGoodsInventory;
import com.example.erp.entity.mm.FinishedOperateLog;
import com.example.erp.entity.pp.FlowCard;
@@ -12,7 +14,7 @@
import java.util.Map;
@Mapper
public interface FinishedGoodsInventoryMapper extends CrudRepository<FinishedGoodsInventory,Long> {
public interface FinishedGoodsInventoryMapper  extends BaseMapper<FinishedGoodsInventory>  {
north-glass-erp/src/main/java/com/example/erp/service/mm/FinishedGoodsInventoryService.java
@@ -3,7 +3,9 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.example.erp.dto.mm.FinishedOperateLogDTO;
import com.example.erp.entity.mm.FinishedGoodsInventory;
import com.example.erp.entity.mm.FinishedOperateLog;
@@ -1051,4 +1053,83 @@
        }
        return "true";
    }
    public Map<String,Object> changeRack(FinishedGoodsInventory finishedGoodsInventory) {
        Long id = finishedGoodsInventory.getId();
        Map<String,Object> map = new HashMap<>();
        FinishedGoodsInventory oldFinishedGoodsInventory = finishedGoodsInventoryMapper.selectById(finishedGoodsInventory.getId());
        //查询此此序号箱号的库存是否存在
        FinishedGoodsInventory existFinishedGoodsInventory = finishedGoodsInventoryMapper
                .selectOne(new LambdaQueryWrapper<FinishedGoodsInventory>()
                        .eq(FinishedGoodsInventory::getOrderId, finishedGoodsInventory.getOrderId())
                        .eq(FinishedGoodsInventory::getOrderNumber, finishedGoodsInventory.getOrderNumber())
                        .eq(FinishedGoodsInventory::getBoxNo, finishedGoodsInventory.getBoxNo())
                        .last("limit 1")
                );
        //当成品箱号不存在,则新增
        if(existFinishedGoodsInventory==null){
            //当转移数量大于实际库存箱号时,则不能转移
            if(oldFinishedGoodsInventory.getQuantityAvailable()<finishedGoodsInventory.getQuantityAvailable()){
                map.put("code",0);
                return map;
            }
            //原库存 数量面积减少
            oldFinishedGoodsInventory.setInventory(oldFinishedGoodsInventory.getInventory()-finishedGoodsInventory.getQuantityAvailable());
            oldFinishedGoodsInventory.setQuantityAvailable(oldFinishedGoodsInventory.getQuantityAvailable()-finishedGoodsInventory.getQuantityAvailable());
            oldFinishedGoodsInventory.setArea(oldFinishedGoodsInventory.getInventory()*oldFinishedGoodsInventory.getActualSignalArea());
            //新库存数据增加
            finishedGoodsInventory.setId(null);
            finishedGoodsInventory.setInventory(finishedGoodsInventory.getQuantityAvailable());
            finishedGoodsInventory.setArea(finishedGoodsInventory.getQuantityAvailable()*finishedGoodsInventory.getActualSignalArea());
            finishedGoodsInventoryMapper.
                    update(oldFinishedGoodsInventory,
                            new LambdaUpdateWrapper<FinishedGoodsInventory>()
                                    .eq(FinishedGoodsInventory::getId,id)
                    ) ;
            finishedGoodsInventoryMapper.insert(finishedGoodsInventory);
            map.put("code",1);
            return map;//库存转移成功,新增箱号
        }else{
            //当id不变时,修改备注
            if(Objects.equals(id, existFinishedGoodsInventory.getId())){
                finishedGoodsInventoryMapper.
                        update(null,new LambdaUpdateWrapper<FinishedGoodsInventory>()
                                .eq(FinishedGoodsInventory::getId,id)
                                .set(FinishedGoodsInventory::getRemark,finishedGoodsInventory.getRemark()));
                map.put("code",2);
                return map;//库存备注修改成功
            }else{
                //原库存 数量面积减少
                oldFinishedGoodsInventory.setInventory(oldFinishedGoodsInventory.getInventory()-finishedGoodsInventory.getQuantityAvailable());
                oldFinishedGoodsInventory.setQuantityAvailable(oldFinishedGoodsInventory.getQuantityAvailable()-finishedGoodsInventory.getQuantityAvailable());
                oldFinishedGoodsInventory.setArea(oldFinishedGoodsInventory.getInventory()*oldFinishedGoodsInventory.getActualSignalArea());
                existFinishedGoodsInventory.setInventory(existFinishedGoodsInventory.getInventory()+finishedGoodsInventory.getQuantityAvailable());
                existFinishedGoodsInventory.setQuantityAvailable(existFinishedGoodsInventory.getQuantityAvailable()+finishedGoodsInventory.getQuantityAvailable());
                existFinishedGoodsInventory.setArea(existFinishedGoodsInventory.getInventory()*existFinishedGoodsInventory.getActualSignalArea());
                finishedGoodsInventoryMapper.
                        update(oldFinishedGoodsInventory,
                                new LambdaUpdateWrapper<FinishedGoodsInventory>()
                                        .eq(FinishedGoodsInventory::getId,id)
                        ) ;
                finishedGoodsInventoryMapper.
                        update(existFinishedGoodsInventory,
                                new LambdaUpdateWrapper<FinishedGoodsInventory>()
                                        .eq(FinishedGoodsInventory::getId,existFinishedGoodsInventory.getId())
                        ) ;
                map.put("code",3);
                List<String> list = new ArrayList<>();
                list.add(oldFinishedGoodsInventory.getBoxNo());
                list.add(existFinishedGoodsInventory.getBoxNo());
                map.put("msg",list);
                return map;//库存转移成功,修改箱号
            }
        }
    }
}
north-glass-erp/src/main/resources/mapper/mm/FinishedGoodsInventory.xml
@@ -7,6 +7,10 @@
    <!--映射成品库存-->
    <resultMap id="selectFinishedGoodsInventory" type="com.example.erp.entity.mm.FinishedGoodsInventory">
        <id column="fid" property="id"/>
        <result column="id" property="id"/>
        <result column="order_id" property="orderId"/>
        <result column="order_number" property="orderNumber"/>
        <result column="process_id" property="processId"/>
        <result column="inventory" property="inventory"/>
        <result column="area" property="area"/>
        <result column="actual_signal_area" property="actualSignalArea"/>
@@ -773,7 +777,10 @@
    <select id="defaultfinishedGoods" resultMap="selectFinishedGoodsInventory">
        select od.order_number,
        select
        fgi.id,
        fgi.process_id,
        od.order_number,
        o.order_id,
        o.project,
        o.order_type,