2
0

8 Ревизии 3652023c1a ... 8e2826d7b4

Автор SHA1 Съобщение Дата
  huang 8e2826d7b4 pda提交订单价格bug修改 преди 1 седмица
  huang e4931bee9b 盘点任务新增编辑-全盘增加仓库筛选,选择商品显示批次信息bug修改 преди 1 седмица
  huang d8b82d90a4 盘点-查询修改参数类型错误 преди 1 седмица
  huang aff058f510 Merge branch 'dev_ml_423' of http://121.40.253.172:3000/pengyue/jsh_erp into dev_huangjunjie преди 1 седмица
  huang 9b06d7a45e 盘点任务新增-查询批次接口新增仓库条件,盘点核对刷新库存 преди 1 седмица
  maliang f338eef51e fix:商品信息供应商回显 преди 1 седмица
  maliang 8b1d410b29 Merge branch 'master' into dev_ml_423 преди 1 седмица
  maliang 4ac0236606 fix:采购管理、销售管理 преди 1 седмица

+ 6 - 6
jshERP-web/src/views/bill/dialog/BillDetail.vue

@@ -1669,7 +1669,7 @@ export default {
         { title: '实际入库数量', dataIndex: 'actualQuantityInStorage', width: 115 },
         { title: '入库差异', dataIndex: 'warehousingVariance', width: 90 },
         { title: '入库差异原因', dataIndex: 'reasonOfDifference', width: 115 },
-        { title: '入库人', dataIndex: 'warehousingUser', width: 90 },
+        { title: '入库人', dataIndex: 'warehousingUserName', width: 90 },
         { title: '入库时间', dataIndex: 'warehousingTime', width: 90 },
 
         { title: '重量', dataIndex: 'weight', width: 90 },
@@ -1775,7 +1775,7 @@ export default {
         { title: '实际出库数量', dataIndex: 'actualQuantityInStorage', width: 115 },
         { title: '出库差异', dataIndex: 'warehousingVariance', width: 90 },
         { title: '出库差异原因', dataIndex: 'reasonOfDifference', width: 115 },
-        { title: '出库人', dataIndex: 'warehousingUser', width: 90 },
+        { title: '出库人', dataIndex: 'warehousingUserName', width: 90 },
         { title: '出库时间', dataIndex: 'warehousingTime', width: 90 },
 
         { title: '重量', dataIndex: 'weight', width: 90 },
@@ -1815,7 +1815,7 @@ export default {
         { title: '实际出库数量', dataIndex: 'actualQuantityInStorage', width: 115 },
         { title: '出库差异', dataIndex: 'warehousingVariance', width: 90 },
         { title: '出库差异原因', dataIndex: 'reasonOfDifference', width: 115 },
-        { title: '出库人', dataIndex: 'warehousingUser', width: 90 },
+        { title: '出库人', dataIndex: 'warehousingUserName', width: 90 },
         { title: '出库时间', dataIndex: 'warehousingTime', width: 90 },
 
         { title: '重量', dataIndex: 'weight', width: 90 },
@@ -1877,7 +1877,7 @@ export default {
         { title: '实际入库数量', dataIndex: 'actualQuantityInStorage', width: 115 },
         { title: '入库差异', dataIndex: 'warehousingVariance', width: 90 },
         { title: '入库差异原因', dataIndex: 'reasonOfDifference', width: 115 },
-        { title: '入库人', dataIndex: 'warehousingUser', width: 90 },
+        { title: '入库人', dataIndex: 'warehousingUserName', width: 90 },
         { title: '入库时间', dataIndex: 'warehousingTime', width: 90 },
 
         { title: '重量', dataIndex: 'weight', width: 90 },
@@ -1912,7 +1912,7 @@ export default {
         { title: '实际出库数量', dataIndex: 'actualQuantityInStorage', width: 115 },
         { title: '出库差异', dataIndex: 'warehousingVariance', width: 90 },
         { title: '出库差异原因', dataIndex: 'reasonOfDifference', width: 115 },
-        { title: '出库人', dataIndex: 'warehousingUser', width: 90 },
+        { title: '出库人', dataIndex: 'warehousingUserName', width: 90 },
         { title: '出库时间', dataIndex: 'warehousingTime', width: 90 },
 
         { title: '重量', dataIndex: 'weight', width: 90 },
@@ -1947,7 +1947,7 @@ export default {
         { title: '实际出库数量', dataIndex: 'actualQuantityInStorage', width: 115 },
         { title: '出库差异', dataIndex: 'warehousingVariance', width: 90 },
         { title: '出库差异原因', dataIndex: 'reasonOfDifference', width: 115 },
-        { title: '出库人', dataIndex: 'warehousingUser', width: 90 },
+        { title: '出库人', dataIndex: 'warehousingUserName', width: 90 },
         { title: '出库时间', dataIndex: 'warehousingTime', width: 90 },
 
         { title: '重量', dataIndex: 'weight', width: 90 },

+ 94 - 120
jshERP-web/src/views/bill/mixins/BillModalMixin.js

@@ -474,34 +474,19 @@ export const BillModalMixin = {
       //   })
       // }
     },
-    //根据【仓库名】带出对应的【仓位货架】
+    //根据仓库名、商品条码带出对应的仓位货架、库存数量
     async setProPosition(barCode, depotId, event){
       const { row, column, value, target } = event
-      const res = await getMaterialBySelect({
-        q: barCode,
-        page: 1,
-        rows: 20
+      findStockByDepotAndBarCode({ depotId: depotId, barCode: barCode }).then(res => {
+        const {position,stock} = res.data
+        target.setValues([
+          {
+            rowKey: row.id,
+            values: { position,inventory: stock },
+          },
+        ])
+        target.$forceUpdate()
       })
-      let proDetail
-      if (res && res.rows) {
-        proDetail = res.rows[0]? res.rows[0] : {}
-      }
-      // 商品id
-      if(proDetail.mid){
-        const res2 = await getAction('/material/getPositionByDidAndMid', { mid: proDetail.mid, did: depotId })
-        console.log('getPositionByDidAndMid======',res2)
-        if (res2 && res2.code === 200) {
-          const msg = res2.msg
-          if(msg){
-            target.setValues([
-              {
-                rowKey: row.id,
-                values: { position: msg },
-              },
-            ])
-          }
-        }
-      }
     },
     //单元值改变一个字符就触发一次
     onValueChange(event) {
@@ -511,98 +496,95 @@ export const BillModalMixin = {
       switch (column.key) {
         case 'depotId':
           that.currentSelectDepotId = row.depotId
-          if (row.barCode) {
-            that.getStockByDepotBarCode(row, target)
-          }
           console.log('row========', row)
           // // 选择商品自动带出barCode、商品ID
-          if(row.depotId&&row.barCode){
+          if(row.depotId&&row.barCode&&type=='select'){
             // // 根据仓库id自动带出仓位货架(若有)参数:商品id、仓库id
             this.setProPosition(row.barCode, row.depotId, event)
           }
           break
-        case 'batchNumber':
-          param = {
-            batchNumber: value,
-            organId: this.form.getFieldValue('organId'),
-            mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性
-            prefixNo: this.prefixNo,
-          }
-          getMaterialByBatchNumber(param).then((res) => {
-            if (res && res.code === 200) {
-              let mList = res.data
+        // case 'batchNumber':
+        //   param = {
+        //     batchNumber: value,
+        //     organId: this.form.getFieldValue('organId'),
+        //     mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性
+        //     prefixNo: this.prefixNo,
+        //   }
+        //   getMaterialByBatchNumber(param).then((res) => {
+        //     if (res && res.code === 200) {
+        //       let mList = res.data
 
-              if (value.indexOf(',') > -1) {
-                //多个条码
-                this.$refs.materialDataTable.getValues((error, values) => {
-                  values.pop() //移除最后一行数据
-                  let mArr = values
-                  for (let i = 0; i < mList.length; i++) {
-                    let mInfo = mList[i]
-                    if (mInfo.unitId) {
-                      mInfo.unitList = JSON.stringify(mInfo.unitList)
-                    }
-                    this.changeColumnShow(mInfo)
-                    let mObj = this.parseInfoToObj(mInfo)
-                    mObj.depotId = mInfo.depotId
-                    mObj.stock = mInfo.stock
-                    mObj.inventory = mInfo.inventory
-                    mArr.push(mObj)
-                  }
-                  let allPriceTotal = 0
-                  let taxLastMoneyTotal = 0
-                  for (let j = 0; j < mArr.length; j++) {
-                    allPriceTotal += mArr[j].allPrice - 0
-                    taxLastMoneyTotal += mArr[j].taxLastMoney - 0
-                    //组合和拆分单据给商品类型进行重新赋值
-                    if (j === 0) {
-                      mArr[0].mType = '组合件'
-                    } else {
-                      mArr[j].mType = '普通子件'
-                    }
-                  }
+        //       if (value.indexOf(',') > -1) {
+        //         //多个条码
+        //         this.$refs.materialDataTable.getValues((error, values) => {
+        //           values.pop() //移除最后一行数据
+        //           let mArr = values
+        //           for (let i = 0; i < mList.length; i++) {
+        //             let mInfo = mList[i]
+        //             if (mInfo.unitId) {
+        //               mInfo.unitList = JSON.stringify(mInfo.unitList)
+        //             }
+        //             this.changeColumnShow(mInfo)
+        //             let mObj = this.parseInfoToObj(mInfo)
+        //             mObj.depotId = mInfo.depotId
+        //             mObj.stock = mInfo.stock
+        //             mObj.inventory = mInfo.inventory
+        //             mArr.push(mObj)
+        //           }
+        //           let allPriceTotal = 0
+        //           let taxLastMoneyTotal = 0
+        //           for (let j = 0; j < mArr.length; j++) {
+        //             allPriceTotal += mArr[j].allPrice - 0
+        //             taxLastMoneyTotal += mArr[j].taxLastMoney - 0
+        //             //组合和拆分单据给商品类型进行重新赋值
+        //             if (j === 0) {
+        //               mArr[0].mType = '组合件'
+        //             } else {
+        //               mArr[j].mType = '普通子件'
+        //             }
+        //           }
 
-                  this.materialTable.dataSource = mArr
-                  if (this.prefixNo === 'LSCK' || this.prefixNo === 'LSTH') {
-                    target.statisticsColumns.allPrice = allPriceTotal
-                  } else {
-                    target.statisticsColumns.taxLastMoney = taxLastMoneyTotal
-                  }
-                  that.autoChangePrice(target)
-                  //强制渲染
-                  target.$forceUpdate()
-                })
-              } else {
-                //单个条码
-                let depotIdSelected = row.depotId || ''
-                findStockByDepotAndBarCode({ depotId: depotIdSelected, barCode: row.batchNumber }).then((res) => {
-                  if (res && res.code === 200) {
-                    let mArr = []
-                    let mInfo = mList[0]
-                    if (mInfo.unitId) {
-                      mInfo.unitList = JSON.stringify(mInfo.unitList)
-                    }
-                    this.changeColumnShow(mInfo)
-                    let mInfoEx = this.parseInfoToObj(mInfo)
-                    mInfoEx.stock = res.data.stock
-                    mInfoEx.inventory = mInfo.inventory
-                    let mObj = {
-                      rowKey: row.id,
-                      values: mInfoEx,
-                    }
-                    mArr.push(mObj)
-                    target.setValues(mArr)
-                    target.recalcAllStatisticsColumns()
-                    that.autoChangePrice(target)
-                    target.autoSelectBySpecialKey('operNumber', row.orderNum)
-                    //强制渲染
-                    target.$forceUpdate()
-                  }
-                })
-              }
-            }
-          })
-          break
+        //           this.materialTable.dataSource = mArr
+        //           if (this.prefixNo === 'LSCK' || this.prefixNo === 'LSTH') {
+        //             target.statisticsColumns.allPrice = allPriceTotal
+        //           } else {
+        //             target.statisticsColumns.taxLastMoney = taxLastMoneyTotal
+        //           }
+        //           that.autoChangePrice(target)
+        //           //强制渲染
+        //           target.$forceUpdate()
+        //         })
+        //       } else {
+        //         //单个条码
+        //         let depotIdSelected = row.depotId || ''
+        //         // findStockByDepotAndBarCode({ depotId: depotIdSelected, barCode: row.batchNumber }).then((res) => {
+        //         //   if (res && res.code === 200) {
+        //         //     let mArr = []
+        //         //     let mInfo = mList[0]
+        //         //     if (mInfo.unitId) {
+        //         //       mInfo.unitList = JSON.stringify(mInfo.unitList)
+        //         //     }
+        //         //     this.changeColumnShow(mInfo)
+        //         //     let mInfoEx = this.parseInfoToObj(mInfo)
+        //         //     mInfoEx.stock = res.data.stock
+        //         //     mInfoEx.inventory = mInfo.inventory
+        //         //     let mObj = {
+        //         //       rowKey: row.id,
+        //         //       values: mInfoEx,
+        //         //     }
+        //         //     mArr.push(mObj)
+        //         //     target.setValues(mArr)
+        //         //     target.recalcAllStatisticsColumns()
+        //         //     that.autoChangePrice(target)
+        //         //     target.autoSelectBySpecialKey('operNumber', row.orderNum)
+        //         //     //强制渲染
+        //         //     target.$forceUpdate()
+        //         //   }
+        //         // })
+        //       }
+        //     }
+        //   })
+        //   break
         case 'barCode':
           param = {
             barCode: value,
@@ -629,8 +611,9 @@ export const BillModalMixin = {
                   mObj.depotId = mInfo.depotId
                   mObj.stock = mInfo.stock
                   mObj.inventory = mInfo.inventory
-                  mObj.allPrice = mInfo.allPrice||0
-                  mObj.taxLastMoney = mInfo.taxLastMoney||0
+                  const unitPrice = (mObj.unitPrice||0)- 0
+                  mObj.allPrice = (unitPrice * mObj.operNumber).toFixed(2)
+                  // mObj.taxLastMoney = mInfo.taxLastMoney||0
                   mArr.push(mObj)
                 }
                 let allPriceTotal = 0
@@ -908,15 +891,6 @@ export const BillModalMixin = {
       target.recalcAllStatisticsColumns()
       this.autoChangePrice(target)
     },
-    //根据仓库和条码查询库存
-    getStockByDepotBarCode(row, target) {
-      findStockByDepotAndBarCode({ depotId: row.depotId, barCode: row.batchNumber }).then((res) => {
-        if (res && res.code === 200) {
-          target.setValues([{ rowKey: row.id, values: { stock: res.data.stock } }])
-          target.recalcAllStatisticsColumns()
-        }
-      })
-    },
     //改变优惠、本次付款、欠款的值
     autoChangePrice(target) {
       let allTaxLastMoney = target.statisticsColumns.taxLastMoney - 0

+ 1 - 1
jshERP-web/src/views/bill/modules/PurchaseInModal.vue

@@ -623,7 +623,7 @@ export default {
         }
         this.model.debt = (
           this.model.discountLastMoney +
-          this.model.otherMoney -
+          (this.model.otherMoney||0)-
           this.model.deposit -
           this.model.changeAmount
         ).toFixed(2)

+ 8 - 0
jshERP-web/src/views/material/modules/MaterialModal.vue

@@ -342,6 +342,9 @@
                 bordered
                 @change="handleMeTableChange"
               >
+                <template slot="supplierId" slot-scope="text, record">
+                  {{ formatSupplierName(record.supplierId) }}
+                </template>
                 <template slot="depotId" slot-scope="text, record">
                   {{ formatDepotName(record.depotId) }}
                 </template>
@@ -593,6 +596,7 @@ export default {
           {
             title: '供应商',
             dataIndex: 'supplierId',
+            scopedSlots: { customRender: 'supplierId' } 
           },
           {
             title: '库存(最小单位)',
@@ -735,6 +739,10 @@ export default {
       const target = this.depotList.find(item => item.value == id)
       return target ? target.title : ''
     },
+    formatSupplierName(id){
+      const target = this.supList.find(item => item.id == id)
+      return target ? target.supplier : ''
+    },
     // 快捷键
     handleOkKey(e) {
       const key = window.event.keyCode ? window.event.keyCode : window.event.which

+ 2 - 0
jshERP-web/src/views/stock/components/stockModal.vue

@@ -199,6 +199,7 @@ export default {
           positionRange,
           creator,
           id,
+          number
         } = res.data
         form.setFieldsValue({
           depotId,
@@ -211,6 +212,7 @@ export default {
           positionRange,
           creator,
           id,
+          number
         })
 
         postAction(url2, { taskStocktakingId: id }).then((res) => {

+ 0 - 1
src/main/java/com/jsh/erp/controller/MaterialController.java

@@ -866,7 +866,6 @@ public class MaterialController extends BaseController {
     public BaseResponseInfo findBatchNumberSBySelect(@RequestParam(value = "categoryId", required = false) Long categoryId,
                                            @RequestParam(value = "q", required = false) String q,
                                            @RequestParam(value = "standardOrModel", required = false) String standardOrModel,
-                                           @RequestParam(value = "mpList", required = false) String mpList,
                                            @RequestParam(value = "depotId", required = false) Long depotId,
                                            @RequestParam(value = "color", required = false) String color,
                                            @RequestParam(value = "brand", required = false) String brand,

+ 3 - 2
src/main/java/com/jsh/erp/controller/materialBatch/MaterialBatchController.java

@@ -46,8 +46,9 @@ public class MaterialBatchController extends BaseController {
 
     @GetMapping(value = "/findBatchNumbersByBarCode")
     @ApiOperation(value = "根据条码查询批次号")
-    public AjaxResult findBatchNumbersByBarCode(@RequestParam(value = "barCodes",required = false) String barCodes){
-        List<MaterialBatch> dataList = materialBatchService.findBySelectWithBarCode(barCodes);
+    public AjaxResult findBatchNumbersByBarCode(@RequestParam(value = "barCodes",required = false) String barCodes,
+                                                @RequestParam(value = "depotId") Long depotId){
+        List<MaterialBatch> dataList = materialBatchService.findBySelectWithBarCode(barCodes,depotId);
         StringBuffer str = new StringBuffer();
         if (null != dataList) {
             for (MaterialBatch material : dataList) {

+ 1 - 1
src/main/java/com/jsh/erp/datasource/dto/TaskStocktakingItemQueryDTO.java

@@ -15,7 +15,7 @@ public class TaskStocktakingItemQueryDTO {
     private Long categoryId;
 
     @ApiModelProperty("商品名称")
-    private Integer materialName;
+    private String materialName;
 
     @ApiModelProperty("批次号")
     private String batchNumber;

+ 2 - 0
src/main/java/com/jsh/erp/datasource/mappers/MaterialExtendMapperEx.java

@@ -41,4 +41,6 @@ public interface MaterialExtendMapperEx {
      * 仓库删除校验
      */
     int getMaterialExtendCountByDepotIds(@Param("depotIds") String[] depotIds);
+
+    List<Long> getIdsByBarcode(@Param("barCodeList") List<String> barCodeList);
 }

+ 1 - 1
src/main/java/com/jsh/erp/service/MaterialBatchService.java

@@ -56,7 +56,7 @@ public interface MaterialBatchService extends IService<MaterialBatch> {
      * 根据商品条码获取商品批次信息
      * @param barCodes 商品条码字符集合
      */
-    List<MaterialBatch> findBySelectWithBarCode(String barCodes);
+    List<MaterialBatch> findBySelectWithBarCode(String barCodes,Long depotId);
 
     /**
      * 根据批次号数组查询商品批次信息

+ 6 - 0
src/main/java/com/jsh/erp/service/MaterialExtendService.java

@@ -60,4 +60,10 @@ public interface MaterialExtendService extends IService<MaterialExtend> {
     int getCountByManyBarCodeWithoutUs(String manyBarCode, String barCode);
 
     MaterialExtend getInfoByBatchNumber(String batchNumber)throws Exception;
+
+    /**
+     * 根据商品条码集合查询商品id
+     * @param barCodeList 商品条码
+     */
+    List<Long> selectIdsByBarCode(List<String> barCodeList);
 }

+ 4 - 4
src/main/java/com/jsh/erp/service/impl/DepotHeadServiceImpl.java

@@ -2064,10 +2064,10 @@ public class DepotHeadServiceImpl extends ServiceImpl<DepotHeadMapper, DepotHead
             depotItemService.updateCurrentUnitPrice(depotItem);
             //修改商品生产日期
             //materialExtendService.update(new UpdateWrapper<MaterialExtend>().set("production_date",materialMap.get(batchNumber).getProductionDate()).eq("id", materialExtend.getId()));
-            //修改订单总额
-            updateTotalPriceById(depotHead);
         }
-        //修改采购订单状态、操作人、操作时间
+        //修改订单总额
+        updateTotalPriceById(depotHead);
+        //修改采购订单状态、操作人、操作时间,数额
         this.update(new UpdateWrapper<DepotHead>().set("status", "2").set("oper_id",userInfo.getId()).set("submit_time",new Date()).eq("id", pdaDepotHeadDTO.getId()));
         return true;
     }
@@ -2087,7 +2087,7 @@ public class DepotHeadServiceImpl extends ServiceImpl<DepotHeadMapper, DepotHead
             if (depotHead.getTotalPrice().compareTo(BigDecimal.ZERO) < 0){
                 totalPrice = totalPrice.negate();
             }
-            update(new UpdateWrapper<DepotHead>().set("total_price",totalPrice).set("change_amount",totalPrice).set("discount_last_money",sum).eq("id",list.get(0).getId()));
+            this.update(new UpdateWrapper<DepotHead>().set("total_price",totalPrice).set("change_amount",totalPrice).set("discount_last_money",sum).eq("id",depotHead.getId()));
         }
     }
 

+ 8 - 3
src/main/java/com/jsh/erp/service/impl/MaterialBatchServiceImpl.java

@@ -42,6 +42,9 @@ public class MaterialBatchServiceImpl extends ServiceImpl<MaterialBatchMapper,Ma
     @Resource
     private InventoryLogService inventoryLogService;
 
+    @Resource
+    private MaterialService materialService;
+
 
     @Override
     public void generateMaterialBatchByDepotItemId(DepotItem depotItem, Long supplierId) throws Exception {
@@ -121,6 +124,7 @@ public class MaterialBatchServiceImpl extends ServiceImpl<MaterialBatchMapper,Ma
                 log.setType(type);
                 inventoryLogService.save(log);
                 update(new UpdateWrapper<MaterialBatch>().set("inventory",materialBatch.getInventory()).eq("id",materialBatch.getId()));
+                depotItemService.updateCurrentStockFun(materialBatch.getMaterialId(),materialBatch.getDepotId());
         }
     }
 
@@ -155,16 +159,17 @@ public class MaterialBatchServiceImpl extends ServiceImpl<MaterialBatchMapper,Ma
     }
 
     /**
-     * 根据商品条码获取商品批次信息
+     * 根据商品条码和仓库id获取商品批次信息
      * @param barCodes 商品条码字符集合
      */
     @Override
-    public List<MaterialBatch> findBySelectWithBarCode(String barCodes) {
+    public List<MaterialBatch> findBySelectWithBarCode(String barCodes,Long depotId) {
         List<String> barCodeList = null;
         if (barCodes != null && !barCodes.isEmpty()){
             barCodeList = Arrays.asList(barCodes.split(","));
         }
-        List<MaterialBatch> list = materialBatchMapper.selectList(new LambdaQueryWrapperX<MaterialBatch>().inIfPresent(MaterialBatch::getBarCode,barCodeList).gt(MaterialBatch::getInventory,BigDecimal.ZERO));
+        List<Long> ids = materialExtendService.selectIdsByBarCode(barCodeList);
+        List<MaterialBatch> list = materialBatchMapper.selectList(new LambdaQueryWrapperX<MaterialBatch>().eq(MaterialBatch::getDepotId,depotId).inIfPresent(MaterialBatch::getMaterialId,ids).gt(MaterialBatch::getInventory,BigDecimal.ZERO));
         return list;
     }
 

+ 10 - 0
src/main/java/com/jsh/erp/service/impl/MaterialExtendServiceImpl.java

@@ -536,6 +536,16 @@ public class MaterialExtendServiceImpl extends ServiceImpl<MaterialExtendMapper,
     }
 
     /**
+     * 根据商品条码集合查询商品id
+     *
+     * @param barCodeList 商品条码
+     */
+    @Override
+    public List<Long> selectIdsByBarCode(List<String> barCodeList) {
+        return materialExtendMapperEx.getIdsByBarcode(barCodeList);
+    }
+
+    /**
      * 设置当前库存
      * @param depotId 仓库id
      * @param mId 商品id

+ 2 - 2
src/main/java/com/jsh/erp/service/impl/TaskStocktakingServiceImpl.java

@@ -70,7 +70,7 @@ public class TaskStocktakingServiceImpl extends ServiceImpl<TaskStocktakingMappe
             List<MaterialBatch> materialBatchList;
             //全盘,抽盘,处理任务明细
             if (taskStocktakingDTO.getTaskType() == 1) {
-                materialBatchList = materialBatchMapper.selectList(new LambdaQueryWrapper<MaterialBatch>().ne(MaterialBatch::getInventory, BigDecimal.ZERO).isNotNull(MaterialBatch::getInventory));
+                materialBatchList = materialBatchMapper.selectList(new LambdaQueryWrapper<MaterialBatch>().ne(MaterialBatch::getInventory, BigDecimal.ZERO).isNotNull(MaterialBatch::getInventory).eq(MaterialBatch::getDepotId,taskStocktakingDTO.getDepotId()));
                 collect = materialBatchList
                         .stream()
                         .map(MaterialBatch::getPosition)
@@ -161,7 +161,7 @@ public class TaskStocktakingServiceImpl extends ServiceImpl<TaskStocktakingMappe
             List<MaterialBatch> materialExtendList;
             //全盘,抽盘,处理任务明细
             if (taskStocktakingDTO.getTaskType() == 1) {
-                materialExtendList = materialBatchMapper.selectList(new LambdaQueryWrapper<MaterialBatch>().ne(MaterialBatch::getInventory, BigDecimal.ZERO).isNotNull(MaterialBatch::getInventory));
+                materialExtendList = materialBatchMapper.selectList(new LambdaQueryWrapper<MaterialBatch>().ne(MaterialBatch::getInventory, BigDecimal.ZERO).isNotNull(MaterialBatch::getInventory).eq(MaterialBatch::getDepotId,taskStocktakingDTO.getDepotId()));
                 collect = materialExtendList
                         .stream()
                         .map(MaterialBatch::getPosition)

+ 14 - 0
src/main/resources/mapper_xml/MaterialExtendMapperEx.xml

@@ -92,4 +92,18 @@
         )
         AND IFNULL(delete_Flag,'0') != '1'
     </select>
+
+    <select id="getIdsByBarcode" resultType="java.lang.Long">
+        SELECT DISTINCT material_id FROM jsh_material_extend
+        <where>
+            <if test="barCodeList != null and barCodeList.size()>0">
+                and bar_code in
+                <foreach collection="barCodeList" item="item" index="index" separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            AND IFNULL(delete_Flag,'0') != '1'
+        </where>
+    </select>
+
 </mapper>