Просмотр исходного кода

Merge branch 'master_huangjunjie' of http://121.40.253.172:3000/pengyue/jsh_erp into master_liaozeyong

# Conflicts:
#	src/main/java/com/jsh/erp/datasource/entities/Material.java
廖泽勇 1 месяц назад
Родитель
Сommit
b47d45c5fe
27 измененных файлов с 864 добавлено и 249 удалено
  1. 11 3
      docs/new_sql.sql
  2. 1 1
      jshERP-web/.env.development
  3. 5 1
      jshERP-web/src/components/tools/ImportFileModal.vue
  4. 1 1
      jshERP-web/src/views/material/mixins/MaterialModalMixins.js
  5. 63 63
      jshERP-web/src/views/material/modules/MaterialModal.vue
  6. 65 6
      jshERP-web/src/views/stock/TaskList.vue
  7. 6 6
      jshERP-web/src/views/stock/components/FilterForm.vue
  8. 121 0
      jshERP-web/src/views/stock/components/editForm.vue
  9. 166 0
      jshERP-web/src/views/stock/components/stockModal.vue
  10. 82 0
      jshERP-web/src/views/stock/utils/table.js
  11. 12 0
      src/main/java/com/jsh/erp/constants/ExceptionConstants.java
  12. 15 11
      src/main/java/com/jsh/erp/controller/DepotItemController.java
  13. 38 1
      src/main/java/com/jsh/erp/controller/MaterialController.java
  14. 13 0
      src/main/java/com/jsh/erp/datasource/entities/DepotHead.java
  15. 0 1
      src/main/java/com/jsh/erp/datasource/entities/Material.java
  16. 1 1
      src/main/java/com/jsh/erp/datasource/mappers/DepotItemMapperEx.java
  17. 13 0
      src/main/java/com/jsh/erp/datasource/pda/dto/PDADepotHeadDTO.java
  18. 17 0
      src/main/java/com/jsh/erp/datasource/pda/dto/PDADepotMaterialDto.java
  19. 10 0
      src/main/java/com/jsh/erp/datasource/vo/DepotItemVo4Stock.java
  20. 1 0
      src/main/java/com/jsh/erp/service/DepotHeadService.java
  21. 7 1
      src/main/java/com/jsh/erp/service/DepotItemService.java
  22. 2 3
      src/main/java/com/jsh/erp/service/impl/DepotHeadServiceImpl.java
  23. 11 5
      src/main/java/com/jsh/erp/service/impl/DepotItemServiceImpl.java
  24. 191 137
      src/main/java/com/jsh/erp/service/impl/MaterialServiceImpl.java
  25. 2 2
      src/main/resources/application-test.yml
  26. 2 2
      src/main/resources/mapper_xml/DepotHeadMapper.xml
  27. 8 4
      src/main/resources/mapper_xml/DepotItemMapperEx.xml

+ 11 - 3
docs/new_sql.sql

@@ -31,9 +31,11 @@ ADD COLUMN inventory DECIMAL(24,6) DEFAULT NULL COMMENT '库存',
 ADD COLUMN depot_id BIGINT DEFAULT NULL COMMENT '仓库id',
 ADD COLUMN position VARCHAR(255) DEFAULT '' COMMENT '仓位货架';
 
--- 单据主表  新增凭证图片
+-- 单据主表  新增凭证图片、商品数量、商品总类数量
 ALTER TABLE jsh_depot_head
-ADD COLUMN voucher_picture VARCHAR(255) DEFAULT '' COMMENT '凭证图片';
+ADD COLUMN voucher_picture VARCHAR(255) DEFAULT '' COMMENT '凭证图片',
+ADD COLUMN goods_quantity INT DEFAULT NULL COMMENT '商品数量',
+ADD COLUMN goods_type_count INT DEFAULT NULL COMMENT '商品总类数量';
 
 -- 单据子表  新增实际出入库数量、出入库差异、出入库差异原因、出入库操作用户、出入库时间
 ALTER TABLE jsh_depot_item
@@ -62,6 +64,12 @@ CREATE TABLE `task_stocktaking` (
     PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='盘点任务表';
 
+ALTER TABLE jsh_depot_head
+    ADD COLUMN link_tesco varchar(50) DEFAULT '' COMMENT '集采订单编号',
+    ADD COLUMN receiver_name VARCHAR(255) DEFAULT '' COMMENT '收货人',
+    ADD COLUMN receiver_phone VARCHAR(20) DEFAULT '' COMMENT '收货人电话',
+    ADD COLUMN receiver_address VARCHAR(255) DEFAULT '' COMMENT '收货地址';
+
 CREATE TABLE `task_stocktaking_item` (
     `id` bigint NOT NULL COMMENT '主键ID',
     `task_stocktaking_id` bigint DEFAULT NULL COMMENT '任务ID',
@@ -74,4 +82,4 @@ CREATE TABLE `task_stocktaking_item` (
     `delete_flag` varchar(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT '0' COMMENT '删除标记,0未删除,1删除',
     `oper_time` datetime DEFAULT NULL COMMENT '操作时间',
     PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='盘点任务关联商品表';
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='盘点任务关联商品表';

+ 1 - 1
jshERP-web/.env.development

@@ -5,7 +5,7 @@ ENV = 'development'
 NODE_ENV = 'development'
 
 # ERP管理系统/开发环境
-VUE_APP_BASE_API = '/stage-api'
+VUE_APP_BASE_API = ''
 
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 5 - 1
jshERP-web/src/components/tools/ImportFileModal.vue

@@ -20,7 +20,7 @@
         <a-row class="form-row" :gutter="24">
           <a-col :md="24" :sm="24">
             <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="第一步:">
-              <a target="_blank" :href="templateUrl"
+              <a ref="myLink" @click="importTemplate" :href="templateUrl"
                 ><b>{{ templateName }}</b></a
               >
               <p>提示:模板中的第一行请勿删除</p>
@@ -89,6 +89,10 @@ export default {
       this.templateName = templateName
       this.visible = true
     },
+    importTemplate() {
+      let link = this.$refs.myLink
+      link.setAttribute('download', '供应商模板' + '.xls')
+    },
     close() {
       this.$emit('close')
       this.visible = false

+ 1 - 1
jshERP-web/src/views/material/mixins/MaterialModalMixins.js

@@ -44,7 +44,7 @@ export const MaterialModalMixins = {
           let arr = res.data
           that.depotList = arr.map((item) => {
             return {
-              value: item.id + '',
+              value: item.id,
               text: item.depotName,
               title: item.depotName,
             }

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

@@ -1419,9 +1419,9 @@ export default {
           formUnit = obj.basicUnit
         }
       }else{
-        formUnit = this.form.getFieldValue('unit')
+        formUnit = this.form.getFieldValue('unit')||''
       }
-      target.setValues([{ rowKey: row.id, values: { barCode: '', commodityUnit: formUnit } }])
+      target.setValues([{ rowKey: row.id, values: { barCode: '', commodityUnit: formUnit, supplierId: undefined, depotId: undefined } }])
     },
     onDeleted(value) {
       this.meDeleteIdList = value
@@ -1429,15 +1429,15 @@ export default {
     //单元值改变一个字符就触发一次
     onValueChange(event) {
       console.log('onValueChange--------table-change', event)
-      const { type, row, column, value, target } = event
-      switch (column.key) {
-        case 'purchaseDecimal':
-        case 'commodityDecimal':
-        case 'wholesaleDecimal':
-        case 'lowDecimal':
-          this.changeDecimalByValue(row)
-          break
-      }
+      // const { type, row, column, value, target } = event
+      // switch (column.key) {
+      //   case 'purchaseDecimal':
+      //   case 'commodityDecimal':
+      //   case 'wholesaleDecimal':
+      //   case 'lowDecimal':
+      //     this.changeDecimalByValue(row)
+      //     break
+      // }
     },
     //修改商品明细中的价格触发计算
     changeDecimalByValue(row) {
@@ -1691,58 +1691,58 @@ export default {
         for (let i = 0; i < mArr.length; i++) {
           let mInfo = mArr[i]
           mInfo.commodityUnit = basicUnit
-          if (i === 0) {
-            // mInfo.commodityUnit = basicUnit
-            basicPurchaseDecimal = mInfo.purchaseDecimal
-            basicCommodityDecimal = mInfo.commodityDecimal
-            basicWholesaleDecimal = mInfo.wholesaleDecimal
-            basicLowDecimal = mInfo.lowDecimal
-          } else {
-            //副单位进行换算
-            // mInfo.commodityUnit = otherUnit
-            if (basicPurchaseDecimal) {
-              mInfo.purchaseDecimal = (basicPurchaseDecimal * ratio).toFixed(2)
-            }
-            if (basicCommodityDecimal) {
-              mInfo.commodityDecimal = (basicCommodityDecimal * ratio).toFixed(2)
-            }
-            if (basicWholesaleDecimal) {
-              mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratio).toFixed(2)
-            }
-            if (basicLowDecimal) {
-              mInfo.lowDecimal = (basicLowDecimal * ratio).toFixed(2)
-            }
-            if (otherUnitTwo && i === 2) {
-              // mInfo.commodityUnit = otherUnitTwo
-              if (basicPurchaseDecimal) {
-                mInfo.purchaseDecimal = (basicPurchaseDecimal * ratioTwo).toFixed(2)
-              }
-              if (basicCommodityDecimal) {
-                mInfo.commodityDecimal = (basicCommodityDecimal * ratioTwo).toFixed(2)
-              }
-              if (basicWholesaleDecimal) {
-                mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratioTwo).toFixed(2)
-              }
-              if (basicLowDecimal) {
-                mInfo.lowDecimal = (basicLowDecimal * ratioTwo).toFixed(2)
-              }
-            }
-            if (otherUnitThree && i === 3) {
-              // mInfo.commodityUnit = otherUnitThree
-              if (basicPurchaseDecimal) {
-                mInfo.purchaseDecimal = (basicPurchaseDecimal * ratioThree).toFixed(2)
-              }
-              if (basicCommodityDecimal) {
-                mInfo.commodityDecimal = (basicCommodityDecimal * ratioThree).toFixed(2)
-              }
-              if (basicWholesaleDecimal) {
-                mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratioThree).toFixed(2)
-              }
-              if (basicLowDecimal) {
-                mInfo.lowDecimal = (basicLowDecimal * ratioThree).toFixed(2)
-              }
-            }
-          }
+          // if (i === 0) {
+          //   // mInfo.commodityUnit = basicUnit
+          //   basicPurchaseDecimal = mInfo.purchaseDecimal
+          //   basicCommodityDecimal = mInfo.commodityDecimal
+          //   basicWholesaleDecimal = mInfo.wholesaleDecimal
+          //   basicLowDecimal = mInfo.lowDecimal
+          // } else {
+          //   //副单位进行换算
+          //   // mInfo.commodityUnit = otherUnit
+          //   if (basicPurchaseDecimal) {
+          //     mInfo.purchaseDecimal = (basicPurchaseDecimal * ratio).toFixed(2)
+          //   }
+          //   if (basicCommodityDecimal) {
+          //     mInfo.commodityDecimal = (basicCommodityDecimal * ratio).toFixed(2)
+          //   }
+          //   if (basicWholesaleDecimal) {
+          //     mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratio).toFixed(2)
+          //   }
+          //   if (basicLowDecimal) {
+          //     mInfo.lowDecimal = (basicLowDecimal * ratio).toFixed(2)
+          //   }
+          //   if (otherUnitTwo && i === 2) {
+          //     // mInfo.commodityUnit = otherUnitTwo
+          //     if (basicPurchaseDecimal) {
+          //       mInfo.purchaseDecimal = (basicPurchaseDecimal * ratioTwo).toFixed(2)
+          //     }
+          //     if (basicCommodityDecimal) {
+          //       mInfo.commodityDecimal = (basicCommodityDecimal * ratioTwo).toFixed(2)
+          //     }
+          //     if (basicWholesaleDecimal) {
+          //       mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratioTwo).toFixed(2)
+          //     }
+          //     if (basicLowDecimal) {
+          //       mInfo.lowDecimal = (basicLowDecimal * ratioTwo).toFixed(2)
+          //     }
+          //   }
+          //   if (otherUnitThree && i === 3) {
+          //     // mInfo.commodityUnit = otherUnitThree
+          //     if (basicPurchaseDecimal) {
+          //       mInfo.purchaseDecimal = (basicPurchaseDecimal * ratioThree).toFixed(2)
+          //     }
+          //     if (basicCommodityDecimal) {
+          //       mInfo.commodityDecimal = (basicCommodityDecimal * ratioThree).toFixed(2)
+          //     }
+          //     if (basicWholesaleDecimal) {
+          //       mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratioThree).toFixed(2)
+          //     }
+          //     if (basicLowDecimal) {
+          //       mInfo.lowDecimal = (basicLowDecimal * ratioThree).toFixed(2)
+          //     }
+          //   }
+          // }
         }
         this.meTable.dataSource = mArr
       })

+ 65 - 6
jshERP-web/src/views/stock/TaskList.vue

@@ -3,9 +3,9 @@
     <a-col :md="24">
       <a-card :bordered="false">
         <!-- 查询区域 -->
-        <filter-form></filter-form>
+        <!-- <filter-form></filter-form> -->
         <div>
-          <a-button type="primary" icon="plus">新增盘点任务</a-button>
+          <a-button type="primary" icon="plus" @click="addTask">新增盘点任务</a-button>
           <a-button>取消盘点</a-button>
           <a-button>批量删除</a-button>
           <a-button>导出任务</a-button>
@@ -15,9 +15,9 @@
           size="middle"
           bordered
           rowKey="id"
-          :columns="taskColumns"
+          :columns="columns"
           :dataSource="dataSource"
-          :components="handleDrag(taskColumns)"
+          :components="handleDrag(columns)"
           :pagination="ipagination"
           :scroll="scroll"
           :loading="loading"
@@ -40,21 +40,80 @@
         </a-table>
       </a-card>
     </a-col>
+    <stock-modal
+      :stockVisible.sync="stockVisible"
+      :form="form"
+      :validatorRules="validatorRules"
+      ref="stockF"
+    ></stock-modal>
   </a-row>
 </template>
 
 <script>
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import FilterForm from './components/FilterForm.vue'
+import table from './utils/table'
+import StockModal from './components/stockModal.vue'
+import { getAction } from '@/api/manage'
 
 export default {
-  components: { FilterForm },
+  components: { FilterForm, StockModal },
   mixins: [JeecgListMixin],
   data() {
     return {
-      taskColumns: [],
+      description: '盘点任务列表',
+      // 表头
+      scroll: { x: 1500 },
+      // 权限按钮集合
+      btnEnableList: [1, 1, 1],
+      queryParam: {
+        taskStatus: '',
+        number: '',
+        depotId: '',
+        createBy: '',
+      },
+      // stockTable: {
+      //   loading: false,
+      //   dataSource: [],
+      //   columns: table.taskColumns,
+      // },
+      defColumns: table.taskColumns,
+      dataSource: [],
+      form: {
+        number: '',
+        taskType: '',
+        taskName: '',
+        depotId: '',
+        creator: '',
+        createBy: '',
+        createTime: '',
+        positionRange: '',
+        materialExtendIdList: [],
+      },
+      validatorRules: {
+        taskType: { rules: [{ required: true, message: '请选择盘点类型' }] },
+        depotId: { rules: [{ required: true, message: '请选择盘点仓库' }] },
+        taskName: { rules: [{ required: true, message: '请输入盘点任务名称' }] },
+      },
+      rules: {
+        number: { rules: [{ required: true, message: '请输入盘点编号' }] },
+      },
+      organId: { rules: [{ required: true, message: '请选择盘点类型' }] },
+      organId: { rules: [{ required: true, message: '请选择盘点仓库' }] },
+      organId: { rules: [{ required: true, message: '请选择盘点负责人' }] },
+      url: {
+        list: '/stocktaking/list',
+        add: '/stocktaking/add',
+      },
+      stockVisible: false,
     }
   },
+
+  methods: {
+    addTask() {
+      this.stockVisible = true
+    },
+  },
 }
 </script>
 

+ 6 - 6
jshERP-web/src/views/stock/components/FilterForm.vue

@@ -5,7 +5,7 @@
       <a-row :gutter="24">
         <a-col :md="6" :sm="24">
           <a-form-item label="盘点状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
-            <a-select placeholder="请选择供应商" showSearch optionFilterProp="children" v-model="queryParam.organId">
+            <a-select placeholder="请选择供应商" showSearch optionFilterProp="children" v-model="queryParam.taskStatus">
               <a-select-option v-for="(item, index) in statusList" :key="index" :value="item.id">
                 {{ item.supplier }}
               </a-select-option>
@@ -16,13 +16,13 @@
           <a-form-item label="盘点单号" :labelCol="labelCol" :wrapperCol="wrapperCol">
             <a-input
               placeholder="请输入条码、名称、助记码、规格、型号等信息"
-              v-model="queryParam.materialParam"
+              v-model="queryParam.number"
             ></a-input>
           </a-form-item>
         </a-col>
         <a-col :md="6" :sm="24">
           <a-form-item label="盘点仓库" :labelCol="labelCol" :wrapperCol="wrapperCol">
-            <a-select placeholder="请选择盘点仓库" showSearch optionFilterProp="children" v-model="queryParam.organId">
+            <a-select placeholder="请选择盘点仓库" showSearch optionFilterProp="children" v-model="queryParam.depotId">
               <a-select-option v-for="(item, index) in statusList" :key="index" :value="item.id">
                 {{ item.supplier }}
               </a-select-option>
@@ -31,14 +31,14 @@
         </a-col>
         <a-col :md="6" :sm="24">
           <a-form-item label="创建人" :labelCol="labelCol" :wrapperCol="wrapperCol">
-            <a-select placeholder="请选择创建人" showSearch optionFilterProp="children" v-model="queryParam.organId">
+            <a-select placeholder="请选择创建人" showSearch optionFilterProp="children" v-model="queryParam.createBy">
               <a-select-option v-for="(item, index) in statusList" :key="index" :value="item.id">
                 {{ item.supplier }}
               </a-select-option>
             </a-select>
           </a-form-item>
         </a-col>
-        <a-col :md="6" :sm="24">
+        <!-- <a-col :md="6" :sm="24">
           <a-form-item label="商品类别" :labelCol="labelCol" :wrapperCol="wrapperCol">
             <a-select placeholder="请选择商品类别" showSearch optionFilterProp="children" v-model="queryParam.organId">
               <a-select-option v-for="(item, index) in statusList" :key="index" :value="item.id">
@@ -56,7 +56,7 @@
           <a-col :md="6" :sm="24">
             <a-button type="primary" @click="searchQuery">查询</a-button>
             <a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
-          </a-col>
+          </a-col> -->
         </span>
       </a-row>
     </a-form>

+ 121 - 0
jshERP-web/src/views/stock/components/editForm.vue

@@ -0,0 +1,121 @@
+<template>
+  <a-form :model="form">
+    <a-row class="form-row" :gutter="24">
+      <a-col :lg="6" :md="12" :sm="24" class="form-col">
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="盘点单号">
+          <a-input placeholder="请输入" v-model="form.number" />
+        </a-form-item>
+      </a-col>
+      <a-col :lg="6" :md="12" :sm="24" class="form-col">
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="盘点类型">
+          <a-select placeholder="请选择" v-model="form.taskType" :options="taskTypeList"> </a-select>
+        </a-form-item>
+      </a-col>
+      <a-col :lg="6" :md="12" :sm="24" class="form-col">
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="盘点任务名称">
+          <a-input placeholder="请输入" v-model="form.taskName" />
+        </a-form-item>
+      </a-col>
+      <a-col :lg="6" :md="12" :sm="24" class="form-col">
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="盘点仓库">
+          <a-select placeholder="请选择" v-model="form.depotId" :options="depotList"> </a-select>
+        </a-form-item>
+      </a-col>
+      <a-col :lg="6" :md="12" :sm="24" class="form-col">
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="盘点负责人">
+          <a-select placeholder="请选择" v-model="form.creator" :options="spinnerList"> </a-select>
+        </a-form-item>
+      </a-col>
+      <a-col :lg="6" :md="12" :sm="24" class="form-col">
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="创建人">
+          <a-input placeholder="请输入" disabled v-model="form.createBy" />
+        </a-form-item>
+      </a-col>
+      <a-col :lg="6" :md="12" :sm="24" class="form-col">
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="创建时间">
+          <a-input placeholder="请输入" disabled v-model="form.createTime" />
+        </a-form-item>
+      </a-col>
+      <a-col :lg="6" :md="12" :sm="24" class="form-col">
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="盘点库位范围">
+          <a-input placeholder="请输入" v-model="form.positionRange" />
+        </a-form-item>
+      </a-col>
+      <a-col :lg="6" :md="12" :sm="24" class="form-col">
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="商品数量">
+          <a-input placeholder="请输入" v-model="form.materialCount" />
+        </a-form-item>
+      </a-col>
+      <a-col :lg="6" :md="12" :sm="24" class="form-col">
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="盘点状态">
+          <!-- <a-input placeholder="请输入" v-model="form.taskStatus" /> -->
+          <a-select placeholder="请选择" v-model="form.taskStatus" :options="taskStatusList"> </a-select>
+        </a-form-item>
+      </a-col>
+      <!-- <a-col :lg="6" :md="12" :sm="24" class="form-col">
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="盘点人">
+          <a-input placeholder="请输入" v-decorator.trim="['number']" />
+        </a-form-item>
+      </a-col>
+      <a-col :lg="6" :md="12" :sm="24" class="form-col">
+        <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="完成时间">
+          <a-input placeholder="请输入" v-decorator.trim="['number']" />
+        </a-form-item>
+      </a-col> -->
+    </a-row>
+  </a-form>
+</template>
+
+<script>
+export default {
+  name: 'EditForm',
+  props: {
+    form: {
+      type: Object,
+      default: null,
+    },
+    validatorRules: {
+      type: Object,
+      default: () => {
+        return {}
+      },
+    },
+    spinnerList: {
+      type: Array,
+      default: () => {
+        return []
+      },
+    },
+    depotList: {
+      type: Array,
+      default: () => {
+        return []
+      },
+    },
+  },
+  data() {
+    return {
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 8 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      taskTypeList: [
+        { value: 1, label: '全盘' },
+        { value: 2, label: '抽盘' },
+      ],
+      taskStatusList: [
+        { value: 0, label: '未开始' },
+        { value: 1, label: '进行中' },
+        { value: 2, label: '已完成' },
+        { value: 3, label: '已取消' },
+      ],
+    }
+  },
+}
+</script>
+
+<style></style>

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

@@ -0,0 +1,166 @@
+<template>
+  <div>
+    <a-modal
+      :visible="stockVisible"
+      :title="title"
+      @ok="handleOk"
+      @cancel="handleCancel"
+      width="90%"
+      wrapClassName="full-modal"
+    >
+      <a-spin :spinning="confirmLoading">
+        <edit-form
+          :spinnerList="spinnerList"
+          :depotList="deoptData"
+          :form="form"
+          :validatorRules="validatorRules"
+        ></edit-form>
+        <div v-if="form.taskType === 2">
+          <a-button style="margin-bottom: 6px" type="primary" @click="onChangeGoods">选择商品</a-button>
+          <a-table
+            ref="table"
+            size="middle"
+            bordered
+            rowKey="id"
+            :columns="columns"
+            :dataSource="dataSource"
+            :components="handleDrag(columns)"
+            :pagination="ipagination"
+            :loading="loading"
+            @change="handleTableChange"
+          >
+            <!-- <span slot="action" slot-scope="text, record">
+          <a>查看</a>
+          <a>编辑</a>
+          <a-divider v-if="btnEnableList.indexOf(1) > -1" type="vertical" />
+          <a-popconfirm title="确定删除吗?">
+            <a>删除</a>
+          </a-popconfirm>
+        </span>
+        <template slot="customName" slot-scope="text, record">
+          {{ record.name }}
+          <a-tag v-if="record.enableSerialNumber == 1" color="orange">序</a-tag>
+          <a-tag v-if="record.enableBatchNumber == 1" color="orange">批</a-tag>
+        </template> -->
+          </a-table>
+        </div>
+      </a-spin>
+    </a-modal>
+    <j-select-material-modal @ok="getGoods" ref="selectModal" :multi="true"></j-select-material-modal>
+  </div>
+</template>
+
+<script>
+import editForm from './editForm.vue'
+import table from '../utils/table'
+import JSelectMaterialModal from '../../../components/jeecgbiz/modal/JSelectMaterialModal.vue'
+import { getAction, postAction } from '@/api/manage'
+
+export default {
+  components: { editForm, JSelectMaterialModal },
+  props: {
+    form: {
+      type: Object,
+      default: null,
+    },
+    validatorRules: {
+      type: Object,
+      default: () => {
+        return {}
+      },
+    },
+    stockVisible: {
+      type: Boolean,
+      default: false,
+    },
+    title: {
+      type: String,
+      default: '新增',
+    },
+  },
+  data() {
+    return {
+      //   validatorRules: {
+      //     organId: { rules: [{ required: true, message: '请选择盘点类型' }] },
+      //     organId: { rules: [{ required: true, message: '请选择盘点仓库' }] },
+      //     organId: { rules: [{ required: true, message: '请选择盘点负责人' }] },
+      //   },
+      width: '1600px',
+      visible: false,
+      confirmLoading: false,
+      prefixNo: '',
+      //   form: {},
+
+      loading: false,
+      dataSource: [],
+      columns: table.goodsColums,
+      url: {
+        spinnerList: '/stocktaking/creatorSpinnerList',
+        depotList: '/depot/findDepotByCurrentUser',
+        add: '/stocktaking/add',
+      },
+      spinnerList: [],
+      deoptData: [],
+    }
+  },
+  watch: {
+    stockVisible(val) {
+      if (val) {
+        this.getSpinnerList()
+        this.getDepotList()
+      }
+    },
+    form: {
+      handler(val) {
+        if (val.taskType === 1) {
+          val.materialExtendIdList = []
+        }
+      },
+      deep: true,
+    },
+  },
+  methods: {
+    handleCancel() {
+      this.$emit('update:stockVisible', false)
+    },
+    handleOk() {
+      postAction(this.url.add, this.form).then((res) => {
+        console.log('222222222222222222222', res)
+
+        // this.$emit('ok')
+      })
+    },
+    onChangeGoods() {
+      this.$refs.selectModal.showModal()
+    },
+    getSpinnerList() {
+      getAction(this.url.spinnerList).then((res) => {
+        this.spinnerList = res.data || []
+      })
+    },
+
+    getDepotList() {
+      getAction(this.url.depotList).then((res) => {
+        this.deoptData = res.data.map((item) => {
+          return {
+            label: item.depotName,
+            value: item.id,
+          }
+        })
+      })
+    },
+    getGoods(rows, ids) {
+      this.form.materialExtendIdList = ids.split(',').filter((item) => item)
+      this.dataSource = rows
+    },
+
+    handleDrag() {},
+    ipagination() {},
+    selectedRowKeys() {},
+    onSelectChange() {},
+    handleTableChange() {},
+  },
+}
+</script>
+
+<style></style>

+ 82 - 0
jshERP-web/src/views/stock/utils/table.js

@@ -0,0 +1,82 @@
+const table = {
+  taskColumns: [
+    {
+      title: '操作',
+      dataIndex: 'action',
+      scopedSlots: { customRender: 'action' },
+    },
+    {
+      title: '盘点任务编号',
+      dataIndex: 'num',
+    },
+
+    {
+      title: '盘点任务名称',
+      dataIndex: 'name',
+    },
+    {
+      title: '盘点类型',
+      dataIndex: 'type',
+    },
+    {
+      title: '盘点仓库',
+      dataIndex: 'num',
+    },
+    {
+      title: '商品数量',
+      dataIndex: 'time',
+    },
+    {
+      title: '盘点库位范围',
+      dataIndex: 'status',
+    },
+    {
+      title: '创建人',
+      dataIndex: 'person',
+    },
+    {
+      title: '创建时间',
+      dataIndex: 'status',
+    },
+    {
+      title: '盘点负责人',
+      dataIndex: 'person',
+    },
+    {
+      title: '盘点状态',
+      dataIndex: 'remark',
+    },
+    {
+      title: '完成时间',
+      dataIndex: 'remark',
+    },
+  ],
+  goodsColums: [
+    {
+      title: '操作',
+      dataIndex: 'action',
+      align: 'center',
+      width: 60,
+      scopedSlots: { customRender: 'action' },
+    },
+    // { dataIndex: 'mBarCode', title: '条码', scopedSlots: { customRender: 'customBarCode' } },
+    { dataIndex: 'batchNumber', title: '批次号' },
+    { dataIndex: 'name', title: '名称', scopedSlots: { customRender: 'customName' } },
+    { dataIndex: 'categoryName', title: '类别' },
+    { dataIndex: 'standard', title: '规格' },
+    { dataIndex: 'model', title: '型号' },
+    { dataIndex: 'color', title: '颜色' },
+    { dataIndex: 'brand', title: '品牌' },
+    { dataIndex: 'supplierName', title: '供应商' },
+    { dataIndex: 'unit', title: '单位' },
+    { dataIndex: 'sku', title: '多属性' },
+    { dataIndex: 'stock', title: '库存' },
+    { dataIndex: 'productionDate', title: '生产日期' },
+    { dataIndex: 'expiryNum', title: '保质期' },
+    { dataIndex: 'barCode', title: '商品条码' },
+    { dataIndex: 'depotId', title: '仓库名称' },
+    { dataIndex: 'position', title: '仓库货架' },
+  ],
+}
+
+export default table

+ 12 - 0
src/main/java/com/jsh/erp/constants/ExceptionConstants.java

@@ -357,6 +357,18 @@ public class ExceptionConstants {
     public static final int MATERIAL_Category_Name_EMPTY_CODE = 8000029;
     public static final String MATERIAL_Category_Name_EMPTY_MSG = "第%s行类别为空";
 
+    //类型不存在错误
+    public static final int MATERIAL_TYPE_NOT_DECIMAL_CODE = 8000030;
+    public static final String MATERIAL_TYPE_NOT_DECIMAL_MSG = "第%s行类别不存在";
+
+    //供应商不存在错误
+    public static final int MATERIAL_SUPPLIER_NOT_DECIMAL_CODE = 8000031;
+    public static final String MATERIAL_SUPPLIER_NOT_DECIMAL_MSG = "第%s行供应商不存在";
+
+    //仓库不存在错误
+    public static final int MATERIAL_DEPOT_NOT_DECIMAL_CODE = 8000031;
+    public static final String MATERIAL_DEPOT_NOT_DECIMAL_MSG = "第%s行仓库不存在";
+
     /**
      *  单据信息
      * type = 85

+ 15 - 11
src/main/java/com/jsh/erp/controller/DepotItemController.java

@@ -999,7 +999,7 @@ public class DepotItemController {
         Map<String, Object> data = new HashMap<>();
         String message = "";
         try {
-            String barCodes = "";
+            String batchNumbers = "";
             //文件合法性校验
             Sheet src = null;
             try {
@@ -1019,22 +1019,23 @@ public class DepotItemController {
             } else {
                 List<Map<String, String>> detailList = new ArrayList<>();
                 for (int i = 2; i < src.getRows(); i++) {
-                    String depotName = "", barCode = "", num = "", unitPrice = "", taxRate = "", remark = "";
+                    String depotName = "", batchNumber = "", num = "", unitPrice = "", taxRate = "", remark = "";
                     if("QGD".equals(prefixNo)) {
-                        barCode = ExcelUtils.getContent(src, i, 0);
+                        batchNumber = ExcelUtils.getContent(src, i, 0);
                         num = ExcelUtils.getContent(src, i, 2);
                         remark = ExcelUtils.getContent(src, i, 3);
                     }
                     if("CGDD".equals(prefixNo) || "XSDD".equals(prefixNo)) {
-                        barCode = ExcelUtils.getContent(src, i, 0);
+                        batchNumber = ExcelUtils.getContent(src, i, 0);
                         num = ExcelUtils.getContent(src, i, 2);
                         unitPrice = ExcelUtils.getContent(src, i, 3);
                         taxRate = ExcelUtils.getContent(src, i, 4);
                         remark = ExcelUtils.getContent(src, i, 5);
                     }
                     if("CGRK".equals(prefixNo) || "XSCK".equals(prefixNo)) {
+                        //采购入库
                         depotName = ExcelUtils.getContent(src, i, 0);
-                        barCode = ExcelUtils.getContent(src, i, 1);
+                        batchNumber = ExcelUtils.getContent(src, i, 1);
                         num = ExcelUtils.getContent(src, i, 3);
                         unitPrice = ExcelUtils.getContent(src, i, 4);
                         taxRate = ExcelUtils.getContent(src, i, 5);
@@ -1042,25 +1043,25 @@ public class DepotItemController {
                     }
                     if("QTRK".equals(prefixNo) || "QTCK".equals(prefixNo)) {
                         depotName = ExcelUtils.getContent(src, i, 0);
-                        barCode = ExcelUtils.getContent(src, i, 1);
+                        batchNumber = ExcelUtils.getContent(src, i, 1);
                         num = ExcelUtils.getContent(src, i, 3);
                         unitPrice = ExcelUtils.getContent(src, i, 4);
                         remark = ExcelUtils.getContent(src, i, 5);
                     }
                     Map<String, String> materialMap = new HashMap<>();
                     materialMap.put("depotName", depotName);
-                    materialMap.put("barCode", barCode);
+                    materialMap.put("batchNumber", batchNumber);
                     materialMap.put("num", num);
                     materialMap.put("unitPrice", unitPrice);
                     materialMap.put("taxRate", taxRate);
                     materialMap.put("remark", remark);
                     detailList.add(materialMap);
-                    barCodes += "'" + barCode + "',";
+                    batchNumbers += "'" + batchNumber + "',";
                 }
-                if (StringUtil.isNotEmpty(barCodes)) {
-                    barCodes = barCodes.substring(0, barCodes.length() - 1);
+                if (StringUtil.isNotEmpty(batchNumbers)) {
+                    batchNumbers = batchNumbers.substring(0, batchNumbers.length() - 1);
                 }
-                JSONObject map = depotItemService.parseMapByExcelData(barCodes, detailList, prefixNo);
+                JSONObject map = depotItemService.parseMapByExcelData(batchNumbers, detailList, prefixNo);
                 if (map != null) {
                     res.code = 200;
                 } else {
@@ -1081,4 +1082,7 @@ public class DepotItemController {
         }
         return res;
     }
+
+
+
 }

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

@@ -494,7 +494,7 @@ public class MaterialController extends BaseController {
                             HttpServletRequest request, HttpServletResponse response) throws Exception{
         BaseResponseInfo res = new BaseResponseInfo();
         try {
-            res = materialService.importExcel(file, request);
+            res = materialService.importExcelTwo(file, request);
         } catch (Exception e) {
             logger.error(e.getMessage(), e);
         }
@@ -928,5 +928,42 @@ public class MaterialController extends BaseController {
         return res;
     }
 
+    /**
+     * 商品信息全选获取批次号
+     */
+    @GetMapping(value = "/findBatchNumbersBySelect")
+    @ApiOperation(value = "商品选择全选获取商品批次号")
+    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,
+                                           @RequestParam(value = "mfrs", required = false) String mfrs,
+                                           @RequestParam(value = "enableSerialNumber", required = false) String enableSerialNumber,
+                                           @RequestParam(value = "enableBatchNumber", required = false) String enableBatchNumber,
+                                           HttpServletRequest request){
+        BaseResponseInfo res = new BaseResponseInfo();
+        try {
+            List<MaterialVo4Unit> dataList = materialService.findBySelectWithBarCode(categoryId, q, StringUtil.toNull(standardOrModel),
+                    StringUtil.toNull(color), StringUtil.toNull(brand), StringUtil.toNull(mfrs), enableSerialNumber, enableBatchNumber,
+                    null, null,depotId);
+            StringBuffer str = new StringBuffer();
+            //存放数据json数组
+            if (null != dataList) {
+                for (MaterialVo4Unit material : dataList) {
+                    str.append("," + material.getBatchNumber());
+                }
+            }
+            res.code = 200;
+            res.data = str.deleteCharAt(0);
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            res.code = 500;
+        }
+        return res;
+    }
+
 
 }

+ 13 - 0
src/main/java/com/jsh/erp/datasource/entities/DepotHead.java

@@ -127,6 +127,19 @@ public class DepotHead {
     @ApiModelProperty("供应商名称")
     private String supplierName;
 
+    @ApiModelProperty("集采订单编号")
+    private String linkTesco;
+
+    @ApiModelProperty("收货人信息")
+    private String receiverName;
+
+    @ApiModelProperty("收货人电话")
+    private String receiverPhone;
+
+    @ApiModelProperty("收货人地址")
+    private String receiverAddress;
+
+
     public Long getId() {
         return id;
     }

+ 0 - 1
src/main/java/com/jsh/erp/datasource/entities/Material.java

@@ -7,7 +7,6 @@ import lombok.Data;
 import lombok.experimental.Accessors;
 
 import java.math.BigDecimal;
-import java.util.Date;
 import java.util.List;
 
 /**

+ 1 - 1
src/main/java/com/jsh/erp/datasource/mappers/DepotItemMapperEx.java

@@ -249,7 +249,7 @@ public interface DepotItemMapperEx {
             @Param("batchNumber") String batchNumber);
 
     List<MaterialVo4Unit> getBillItemByParam(
-            @Param("barCodes") String barCodes);
+            @Param("batchNumbers") String batchNumbers);
 
     BigDecimal getCurrentStockByParam(
             @Param("depotId") Long depotId,

+ 13 - 0
src/main/java/com/jsh/erp/datasource/pda/dto/PDADepotHeadDTO.java

@@ -1,8 +1,12 @@
 package com.jsh.erp.datasource.pda.dto;
 
+import com.jsh.erp.datasource.pda.vo.PDADepotItemVO;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.math.BigDecimal;
+import java.util.List;
+
 @Data
 public class PDADepotHeadDTO {
 
@@ -20,4 +24,13 @@ public class PDADepotHeadDTO {
 
     @ApiModelProperty("单据类型")
     private String subType;
+
+    @ApiModelProperty("操作类型")
+    private String type;
+
+    @ApiModelProperty("订单商品数据")
+    private List<PDADepotMaterialDto> material;
+
+
+
 }

+ 17 - 0
src/main/java/com/jsh/erp/datasource/pda/dto/PDADepotMaterialDto.java

@@ -0,0 +1,17 @@
+package com.jsh.erp.datasource.pda.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class PDADepotMaterialDto {
+
+    @ApiModelProperty("批次号")
+    private String batchNumber;
+
+    @ApiModelProperty("订单数量")
+    private BigDecimal operNumber;
+
+}

+ 10 - 0
src/main/java/com/jsh/erp/datasource/vo/DepotItemVo4Stock.java

@@ -1,12 +1,22 @@
 package com.jsh.erp.datasource.vo;
 
 
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
 import java.math.BigDecimal;
 
+/**
+ * 单据子表库存数量
+ */
+@Data
 public class DepotItemVo4Stock {
 
+    @ApiModelProperty("入库数量")
     private BigDecimal inTotal;
+    @ApiModelProperty("出库数量")
     private BigDecimal outTotal;
+
     private BigDecimal transfInTotal;
     private BigDecimal transfOutTotal;
     private BigDecimal assemInTotal;

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

@@ -189,4 +189,5 @@ public interface DepotHeadService extends IService<DepotHead> {
      * @return
      */
     DepotHead getDepotLastByMaterialId(long mid);
+
 }

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

@@ -168,7 +168,13 @@ public interface DepotItemService extends IService<DepotItem> {
 
     Long getCountByMaterialAndDepot(Long mId, Long depotId);
 
-    JSONObject parseMapByExcelData(String barCodes, List<Map<String, String>> detailList, String prefixNo) throws Exception;
+    /**
+     * 解析excel表格数据
+     * @param batchNumbers 批次号
+     * @param detailList    数据明细
+     * @param prefixNo  单据类型
+     */
+    JSONObject parseMapByExcelData(String batchNumbers, List<Map<String, String>> detailList, String prefixNo) throws Exception;
 
     BigDecimal getLastUnitPriceByParam(Long organId, Long meId, String prefixNo);
 

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

@@ -1131,9 +1131,8 @@ public class DepotHeadServiceImpl extends ServiceImpl<DepotHeadMapper, DepotHead
             }
         }
         //生成订单二维码
-        String qrCodeUrl = qrCodeGenerator.generateQRCodeImage(depotHead.getNumber());
-        depotHead.setQrcodeUrl(qrCodeUrl);
-        //
+        //String qrCodeUrl = qrCodeGenerator.generateQRCodeImage(depotHead.getNumber());
+        depotHead.setQrcodeUrl(null);
         JSONArray rowArr = JSONArray.parseArray(rows);
         //商品数量
         int operNumber = 0;

+ 11 - 5
src/main/java/com/jsh/erp/service/impl/DepotItemServiceImpl.java

@@ -1129,6 +1129,7 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
         BigDecimal initStock = materialService.getInitStockByMidAndDepotList(depotList, mId);
         //盘点复盘后数量的变动
         BigDecimal stockCheckSum = depotItemMapperEx.getStockCheckSumByDepotList(depotList, mId, forceFlag, beginTime, endTime);
+        //表单的数量
         DepotItemVo4Stock stockObj = depotItemMapperEx.getStockByParamWithDepotList(depotList, mId, forceFlag, inOutManageFlag, beginTime, endTime);
         BigDecimal stockSum = BigDecimal.ZERO;
         //获取商品子表单的库存总数
@@ -1446,16 +1447,21 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
         return depotItemMapperEx.getCountByMaterialAndDepot(mId, depotId);
     }
 
+
     @Override
-    public JSONObject parseMapByExcelData(String barCodes, List<Map<String, String>> detailList, String prefixNo) throws Exception {
+    public JSONObject parseMapByExcelData(String batchNumbers, List<Map<String, String>> detailList, String prefixNo) throws Exception {
         JSONObject map = new JSONObject();
         JSONArray arr = new JSONArray();
-        List<MaterialVo4Unit> list = depotItemMapperEx.getBillItemByParam(barCodes);
+        //根据批次号获取商品数据
+        List<MaterialVo4Unit> list = depotItemMapperEx.getBillItemByParam(batchNumbers);
+        //商品数据集合
         Map<String, MaterialVo4Unit> materialMap = new HashMap<>();
+        //仓库集合
         Map<String, Long> depotMap = new HashMap<>();
         for (MaterialVo4Unit material: list) {
-            materialMap.put(material.getmBarCode(), material);
+            materialMap.put(material.getBatchNumber(), material);
         }
+        //获取当前用户所有仓库
         JSONArray depotArr = depotService.findDepotByCurrentUser();
         for (Object depotObj: depotArr) {
             if(depotObj!=null) {
@@ -1465,7 +1471,7 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
         }
         for (Map<String, String> detailMap: detailList) {
             JSONObject item = new JSONObject();
-            String barCode = detailMap.get("barCode");
+            String barCode = detailMap.get("batchNumber");
             if(StringUtil.isNotEmpty(barCode)) {
                 MaterialVo4Unit m = materialMap.get(barCode);
                 if(m!=null) {
@@ -1480,7 +1486,7 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
                                     String.format(ExceptionConstants.DEPOT_ITEM_DEPOTNAME_IS_NOT_EXIST_MSG, depotName));
                         }
                     }
-                    item.put("barCode", barCode);
+                    item.put("batchNumber", barCode);
                     item.put("name", m.getName());
                     item.put("standard", m.getStandard());
                     if(StringUtil.isNotEmpty(m.getModel())) {

+ 191 - 137
src/main/java/com/jsh/erp/service/impl/MaterialServiceImpl.java

@@ -13,6 +13,7 @@ import com.jsh.erp.datasource.vo.MaterialVoSearch;
 import com.jsh.erp.datasource.vo.MaterialWarnListVo;
 import com.jsh.erp.exception.BusinessRunTimeException;
 import com.jsh.erp.exception.JshException;
+import com.jsh.erp.query.LambdaQueryWrapperX;
 import com.jsh.erp.service.*;
 import com.jsh.erp.utils.*;
 import jxl.Sheet;
@@ -76,6 +77,10 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
     private SystemConfigService systemConfigService;
     @Resource
     private DepotHeadService depotHeadService;
+    @Resource
+    private SupplierService supplierService;
+    @Resource
+    private DepotMapperEx depotMapperEx;
 
     @Value(value="${file.uploadType}")
     private Long fileUploadType;
@@ -229,6 +234,7 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     public int updateMaterial(JSONObject obj, HttpServletRequest request) throws Exception{
         Material material = JSONObject.parseObject(obj.toJSONString(), Material.class);
+
         try{
             //修改商品属性
             materialMapper.updateByPrimaryKeySelective(material);
@@ -1649,7 +1655,7 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
         materialExtendExample.createCriteria().andDeleteFlagEqualTo("0");
         List<MaterialExtend> extendList = materialExtendMapper.selectByExample(materialExtendExample);
         //无动销提醒
-        materials.stream().filter( v -> v.getMovingPinReminderCycle() != null)
+        materials.stream().filter( v -> v.getMovingPinReminderCycle() != null && !"".equals(v.getMovingPinReminderCycle()))
                         .forEach(v -> {
                             //获取商品最后一条动销订单数据
                             DepotHead depotHead = depotHeadService.getDepotLastByMaterialId(v.getId());
@@ -1672,7 +1678,7 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
         vo.setNoMovingPinReminder(noMovingPinReminders);
         //过期提醒
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-        extendList.stream().filter(v -> v.getInventory().doubleValue() > 0 && v.getProductionDate() != null && v.getExpiryNum() != null)
+        extendList.stream().filter(v -> v.getInventory() != null && v.getInventory().doubleValue() > 0 && v.getProductionDate() != null && v.getExpiryNum() != null)
                 .forEach(v ->{
                     if (DateUtils.differentDaysByMillisecond(v.getProductionDate(),new Date()) >  (v.getExpiryNum() -30)){
                         String name = materialMapper.selectByPrimaryKey(v.getMaterialId()).getName();
@@ -1751,6 +1757,26 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                 String categoryName = ExcelUtils.getContent(src, i, 5); //类别
                 String weight = ExcelUtils.getContent(src, i, 6); //基础重量(kg)
                 String unit = ExcelUtils.getContent(src, i, 7); //基本单位
+                String manyUnit = ExcelUtils.getContent(src, i, 8); //副单位
+                String ratio = ExcelUtils.getContent(src, i, 9); //比例
+                String sku = ExcelUtils.getContent(src, i, 10); //多属性
+                String purchaseDecimal = ExcelUtils.getContent(src, i, 11); //采购价
+                String commodityDecimal = ExcelUtils.getContent(src, i, 12); //零售价
+                String wholesaleDecimal = ExcelUtils.getContent(src, i, 13); //销售价
+                String lowDecimal = ExcelUtils.getContent(src, i, 14); //最低售价
+                String enabled = ExcelUtils.getContent(src, i, 15); //状态
+                String enableSerialNumber = ExcelUtils.getContent(src, i, 16); //序列号
+                String productionDate = ExcelUtils.getContent(src, i, 17); //生产日期
+                String expiryNum = ExcelUtils.getContent(src, i, 18); //保质期天数
+                String supplier = ExcelUtils.getContent(src, i, 19); //供应商
+                String barCode = ExcelUtils.getContent(src, i, 20); //商品条码
+                String depotName = ExcelUtils.getContent(src, i, 21); //仓库名称
+                String position = ExcelUtils.getContent(src, i, 22); //仓位货架
+                String inventory = ExcelUtils.getContent(src,i,23);//库存
+                String otherField1 = ExcelUtils.getContent(src, i, 24); //自定义1
+                String otherField2 = ExcelUtils.getContent(src, i, 25); //自定义2
+                String otherField3 = ExcelUtils.getContent(src, i, 26); //自定义3
+                String remark = ExcelUtils.getContent(src, i, 27); //备注
                 //名称为空
                 if(StringUtil.isEmpty(name)) {
                     throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_NAME_EMPTY_CODE,
@@ -1781,24 +1807,48 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                     throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_Category_Name_EMPTY_CODE,
                             String.format(ExceptionConstants.MATERIAL_Category_Name_EMPTY_MSG, i+1));
                 }
+                //通过类型名查询类型编号
+                Long categoryId = materialCategoryService.getCategoryIdByName(categoryName);
+                if(null == categoryId){
+                    //类别不存在
+                    throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_TYPE_NOT_DECIMAL_CODE,
+                            String.format(ExceptionConstants.MATERIAL_TYPE_NOT_DECIMAL_MSG, i+1));
+                }
+                Long supplierId = null;
+                if (supplier != null && !supplier.isEmpty()){
+                    //根据供应商查询供应商id
+                    Supplier s  = supplierService.getOne(new LambdaQueryWrapperX<Supplier>().eq(Supplier::getSupplier,supplier));
+                    supplierId = s.getId();
+                    if (supplierId == null){
+                        //供应商不存在
+                        throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_SUPPLIER_NOT_DECIMAL_CODE,
+                                String.format(ExceptionConstants.MATERIAL_SUPPLIER_NOT_DECIMAL_MSG, i+1));
+                    }
+                }
+                Long depotId = null;
+                if (depotName != null && !depotName.isEmpty()){
+                    //根据仓库名查询仓库id
+                    depotId = depotMapperEx.selectByConditionDepot(depotName,null,null).get(0).getId();
+                    if (depotId == null){
+                        //仓库不存在
+                        throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_DEPOT_NOT_DECIMAL_CODE,
+                                String.format(ExceptionConstants.MATERIAL_DEPOT_NOT_DECIMAL_MSG, i+1));
+                    }
+                }
                 MaterialWithInitStock m = new MaterialWithInitStock();
-                //设置商品名字、规格、型号、颜色、品牌
+                //设置商品名字、规格、型号、颜色、品牌、类型id
                 m.setName(name);
                 m.setStandard(standard);
                 m.setModel(model);
                 m.setColor(color);
                 m.setBrand(brand);
+                m.setCategoryId(categoryId);
                 //通过名称生成助记码
                 m.setMnemonic(PinYinUtil.getFirstLettersLo(name));
-                //通过类型名查询类型编号
-                Long categoryId = materialCategoryService.getCategoryIdByName(categoryName);
                 //获取类型编码
                 Long serial_no = categoryId == null ? null : materialCategoryService.getMaterialCategory(m.getCategoryId()).getSerialNo();
                 //设置系统sku
                 m.setSystemSku(serial_no + DateUtils.dateTimeNow());
-                if(null!=categoryId){
-                    m.setCategoryId(categoryId);
-                }
                 if(StringUtil.isNotEmpty(weight)) {
                     //校验基础重量是否是数字(含小数)
                     if(!StringUtil.isPositiveBigDecimal(weight)) {
@@ -1807,19 +1857,6 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                     }
                     m.setWeight(new BigDecimal(weight));
                 }
-                String manyUnit = ExcelUtils.getContent(src, i, 8); //副单位
-                String ratio = ExcelUtils.getContent(src, i, 9); //比例
-                String sku = ExcelUtils.getContent(src, i, 10); //多属性
-                String purchaseDecimal = ExcelUtils.getContent(src, i, 11); //采购价
-                String commodityDecimal = ExcelUtils.getContent(src, i, 12); //零售价
-                String wholesaleDecimal = ExcelUtils.getContent(src, i, 13); //销售价
-                String lowDecimal = ExcelUtils.getContent(src, i, 14); //最低售价
-                String enabled = ExcelUtils.getContent(src, i, 15); //状态
-                String enableSerialNumber = ExcelUtils.getContent(src, i, 16); //序列号
-                String enableBatchNumber = ExcelUtils.getContent(src, i, 17); //批号
-                String systemSku = ExcelUtils.getContent(src, i, 18); //系统sku
-                String productionDate = ExcelUtils.getContent(src, i, 19); //生产日期
-                String expiryNum = ExcelUtils.getContent(src, i, 20); //保质期天数
                 if(StringUtil.isNotEmpty(expiryNum)) {
                     //校验保质期是否是正整数
                     if(!StringUtil.isPositiveLong(expiryNum)) {
@@ -1828,17 +1865,6 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                     }
                     //m.setExpiryNum(Integer.parseInt(expiryNum));
                 }
-                String supplier = ExcelUtils.getContent(src, i, 21); //供应商
-                String barCode = ExcelUtils.getContent(src, i, 22); //商品条码
-                String batchNumber = ExcelUtils.getContent(src, i, 23); //批次号
-                String depotName = ExcelUtils.getContent(src, i, 24); //仓库名称
-                String position = ExcelUtils.getContent(src, i, 25); //仓位货架
-                String otherField1 = ExcelUtils.getContent(src, i, 26); //自定义1
-                String otherField2 = ExcelUtils.getContent(src, i, 27); //自定义2
-                String otherField3 = ExcelUtils.getContent(src, i, 28); //自定义3
-                String remark = ExcelUtils.getContent(src, i, 29); //备注
-                // m.setPosition(StringUtil.isNotEmpty(position)?position:null);
-                //m.setMfrs(StringUtil.isNotEmpty(mfrs)?mfrs:null);
                 m.setOtherField1(StringUtil.isNotEmpty(otherField1)?otherField1:null);
                 m.setOtherField2(StringUtil.isNotEmpty(otherField2)?otherField2:null);
                 m.setOtherField3(StringUtil.isNotEmpty(otherField3)?otherField3:null);
@@ -1848,30 +1874,24 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                     throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_ENABLED_ERROR_CODE,
                             String.format(ExceptionConstants.MATERIAL_ENABLED_ERROR_MSG, i+1));
                 }
-                //基本条码为空
-                if(StringUtil.isEmpty(barCode)) {
-                    throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_BARCODE_EMPTY_CODE,
-                            String.format(ExceptionConstants.MATERIAL_BARCODE_EMPTY_MSG, i+1));
-                }
-                //校验基本条码长度为4到40位
-                if(!StringUtil.checkBarCodeLength(barCode)) {
-                    throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_BARCODE_LENGTH_ERROR_CODE,
-                            String.format(ExceptionConstants.MATERIAL_BARCODE_LENGTH_ERROR_MSG, barCode));
-                }
                 //批量校验excel中有无重复商品,是指名称、规格、型号、颜色、单位、多属性
-                batchCheckExistMaterialListByParam(mList, name, standard, model, color, unit, sku);
-                //批量校验excel中有无重复条码(1-文档自身校验,2-和数据库里面的商品校验)
-                //batchCheckExistBarCodeByParam(mList, barCode, manyBarCode);
+                //batchCheckExistMaterialListByParam(mList, name, standard, model, color, unit, sku);
                 //设置商品拓展属性
                 JSONObject materialExObj = new JSONObject();
                 JSONObject basicObj = new JSONObject();
-                basicObj.put("barCode", barCode);
                 basicObj.put("commodityUnit", unit);
                 basicObj.put("sku", sku);
                 basicObj.put("purchaseDecimal", purchaseDecimal);
                 basicObj.put("commodityDecimal", commodityDecimal);
                 basicObj.put("wholesaleDecimal", wholesaleDecimal);
                 basicObj.put("lowDecimal", lowDecimal);
+                basicObj.put("productionDate",productionDate);
+                basicObj.put("expiryNum",expiryNum);
+                basicObj.put("supplierId",supplierId);
+                basicObj.put("barCode", barCode);
+                basicObj.put("inventory",inventory);
+                basicObj.put("depotId",depotId);
+                basicObj.put("position",position);
                 materialExObj.put("basic", basicObj);
                 if(StringUtil.isNotEmpty(manyUnit) && StringUtil.isNotEmpty(ratio)){ //多单位
                     //校验比例是否是数字(含小数)
@@ -1884,12 +1904,7 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                         m.setUnitId(unitId);
                         m.setUnit("");
                     }
-//                    else {
-//                        throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_UNIT_MATE_CODE,
-//                                String.format(ExceptionConstants.MATERIAL_UNIT_MATE_MSG, manyBarCode));
-//                    }
                     JSONObject otherObj = new JSONObject();
-                    //otherObj.put("barCode", manyBarCode);
                     otherObj.put("commodityUnit", manyUnit);
                     otherObj.put("purchaseDecimal", parsePrice(purchaseDecimal,ratio));
                     otherObj.put("commodityDecimal", parsePrice(commodityDecimal,ratio));
@@ -1901,24 +1916,30 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
                     m.setUnitId(null);
                 }
                 m.setMaterialExObj(materialExObj);
+                //设置商品是否启用
                 m.setEnabled("1".equals(enabled));
+                //设置商品是否开启序列号
                 if(StringUtil.isNotEmpty(enableSerialNumber) && "1".equals(enableSerialNumber)) {
                     m.setEnableSerialNumber("1");
                 } else {
                     m.setEnableSerialNumber("0");
                 }
-                if(StringUtil.isNotEmpty(enableBatchNumber) && "1".equals(enableBatchNumber)) {
-                    m.setEnableBatchNumber("1");
-                } else {
-                    m.setEnableBatchNumber("0");
-                }
-                if("1".equals(enableSerialNumber) && "1".equals(enableBatchNumber)) {
-                    throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_ENABLE_MUST_ONE_CODE,
-                            String.format(ExceptionConstants.MATERIAL_ENABLE_MUST_ONE_MSG, barCode));
-                }
+                //批号去掉
+//                if(StringUtil.isNotEmpty(enableBatchNumber) && "1".equals(enableBatchNumber)) {
+//                    m.setEnableBatchNumber("1");
+//                } else {
+//                    m.setEnableBatchNumber("0");
+//                }
+//                if("1".equals(enableSerialNumber) && "1".equals(enableBatchNumber)) {
+//                    throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_ENABLE_MUST_ONE_CODE,
+//                            String.format(ExceptionConstants.MATERIAL_ENABLE_MUST_ONE_MSG, barCode));
+//                }
+                //设置库存
                 m.setStockMap(getStockMapCache(src, depotCount, depotMap, i));
                 mList.add(m);
             }
+            //处理表单信息,转为对象集合
+            List<Material> materialList = parseMapByExcelData(mList);
             List<Long> deleteInitialStockMaterialIdList = new ArrayList<>();
             List<Long> deleteCurrentStockMaterialIdList = new ArrayList<>();
             List<MaterialInitialStock> insertInitialStockMaterialList = new ArrayList<>();
@@ -1926,86 +1947,25 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
             //防止初始库存和当前库存出现重复
             Map<String, String> materialDepotInitialMap = new HashMap<>();
             Map<String, String> materialDepotCurrentMap = new HashMap<>();
-            for(MaterialWithInitStock m: mList) {
-                Long mId = 0L;
-                //判断该商品是否存在,如果不存在就新增,如果存在就更新
-                String basicBarCode = getBasicBarCode(m);
-                //根据条件返回产品列表
-                List<Material> materials = getMaterialListByParam(m.getName(),m.getStandard(),m.getModel(),m.getColor(),m.getUnit(),m.getUnitId(), basicBarCode);
-                if(materials.size() == 0) { //产品列表为0,新增商品
-                    materialMapperEx.insertSelectiveEx(m);
-                    mId = m.getId();
-                } else { //产品列表不为0,商品存在,修改商品属性
-                    mId = materials.get(0).getId();
-                    String materialJson = JSON.toJSONString(m);
-                    Material material = JSONObject.parseObject(materialJson, Material.class);
-                    material.setId(mId);
-                    materialMapper.updateByPrimaryKeySelective(material);
-                    //更新多单位
-                    if(material.getUnitId() == null) {
-                        materialMapperEx.setUnitIdToNull(material.getId());
-                    }
-                    //如果之前有保质期,则更新保质期
-//                    if(materials.get(0).getExpiryNum()!=null && material.getExpiryNum() == null) {
-//                        materialMapperEx.setExpiryNumToNull(material.getId());
-//                    }
-                }
-                //给商品新增或更新条码与价格相关信息
-                JSONObject materialExObj = m.getMaterialExObj();
-                insertOrUpdateMaterialExtend(materialExObj, "basic", "1", mId, user);
-                insertOrUpdateMaterialExtend(materialExObj, "other", "0", mId, user);
-                //给商品更新库存
-                Map<Long, BigDecimal> stockMap = m.getStockMap();
-                for(Depot depot: depotList){
-                    Long depotId = depot.getId();
-                    String materialDepotKey = mId + "_" + depotId;
-                    //获取初始库存
-                    BigDecimal initStock = getInitStock(mId, depotId);
-                    //excel里面的当前库存
-                    BigDecimal stock = stockMap.get(depot.getId());
-                    //新增或更新初始库存
-                    if(stock!=null && stock.compareTo(BigDecimal.ZERO)!=0) {
-                        String basicStr = materialExObj.getString("basic");
-                        MaterialExtend materialExtend = JSONObject.parseObject(basicStr, MaterialExtend.class);
-                        if(StringUtil.isNotEmpty(materialExtend.getSku())) {
-                            throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_SKU_BEGIN_STOCK_FAILED_CODE,
-                                    String.format(ExceptionConstants.MATERIAL_SKU_BEGIN_STOCK_FAILED_MSG, materialExtend.getBarCode()));
-                        }
-                        buildChangeInitialStock(deleteInitialStockMaterialIdList, insertInitialStockMaterialList, materialDepotInitialMap, mId, depotId, materialDepotKey, stock);
-                    } else {
-                        if(initStock.compareTo(BigDecimal.ZERO)!=0) {
-                            buildChangeInitialStock(deleteInitialStockMaterialIdList, insertInitialStockMaterialList, materialDepotInitialMap, mId, depotId, materialDepotKey, stock);
-                        }
-                    }
-                    //新增或更新当前库存
-                    Long billCount = depotItemService.getCountByMaterialAndDepot(mId, depotId);
-                    if(billCount == 0) {
-                        if(stock!=null && stock.compareTo(BigDecimal.ZERO)!=0) {
-                            buildChangeCurrentStock(deleteCurrentStockMaterialIdList, insertCurrentStockMaterialList, materialDepotCurrentMap, mId, depotId, materialDepotKey, stock);
-                        } else {
-                            if(initStock.compareTo(BigDecimal.ZERO)!=0) {
-                                buildChangeCurrentStock(deleteCurrentStockMaterialIdList, insertCurrentStockMaterialList, materialDepotCurrentMap, mId, depotId, materialDepotKey, stock);
-                            }
-                        }
-                    } else {
-                        BigDecimal currentNumber = getCurrentStockByMaterialIdAndDepotId(mId, depotId);
-                        //当前库存的更新:减去初始库存,再加上导入的新初始库存
-                        if(currentNumber!=null && initStock!=null && stock!=null) {
-                            currentNumber = currentNumber.subtract(initStock).add(stock);
-                        }
-                        buildChangeCurrentStock(deleteCurrentStockMaterialIdList, insertCurrentStockMaterialList, materialDepotCurrentMap, mId, depotId, materialDepotKey, currentNumber);
-                    }
+            for (Material material : materialList) {
+                //添加商品
+                materialMapperEx.insertSelectiveEx(material);
+                //
+                Long mId = material.getId();
+                for (MaterialExtend materialExtend : material.getList()) {
+                    materialExtend.setMaterialId(mId);
+                    materialExtendService.insertMaterialExtend(materialExtend);
                 }
             }
             //批量更新库存,先删除后新增
-            if(insertInitialStockMaterialList.size()>0) {
-                batchDeleteInitialStockByMaterialList(deleteInitialStockMaterialIdList);
-                materialInitialStockMapperEx.batchInsert(insertInitialStockMaterialList);
-            }
-            if(insertCurrentStockMaterialList.size()>0) {
-                batchDeleteCurrentStockByMaterialList(deleteCurrentStockMaterialIdList);
-                materialCurrentStockMapperEx.batchInsert(insertCurrentStockMaterialList);
-            }
+//            if(insertInitialStockMaterialList.size()>0) {
+//                batchDeleteInitialStockByMaterialList(deleteInitialStockMaterialIdList);
+//                materialInitialStockMapperEx.batchInsert(insertInitialStockMaterialList);
+//            }
+//            if(insertCurrentStockMaterialList.size()>0) {
+//                batchDeleteCurrentStockByMaterialList(deleteCurrentStockMaterialIdList);
+//                materialCurrentStockMapperEx.batchInsert(insertCurrentStockMaterialList);
+//            }
             //添加日志
             logService.insertLog("商品",
                     new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_IMPORT).append(mList.size()).append(BusinessConstants.LOG_DATA_UNIT).toString(),
@@ -2025,4 +1985,98 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
         return info;
     }
 
+    /**
+     * 解析excel表格数据为商品对象
+     */
+    public List<Material> parseMapByExcelData(List<MaterialWithInitStock> mList){
+        List<Material> materials = new ArrayList<>();
+        Map<String,Material> materialMap = new HashMap<>();
+        for (MaterialWithInitStock m : mList) {
+            String materialSku = "";
+            JSONObject materialExObj = m.getMaterialExObj();
+            JSONObject basicObj = materialExObj.getJSONObject("basic");
+            if(materialExObj!=null && materialExObj.get("basic")!=null) {
+                if(basicObj!=null && materialExObj.get("sku")!=null) {
+                    materialSku = basicObj.getString("sku");
+                }
+            }
+            //名称,型号,品牌,规格,颜色,单位一样视为同一商品
+            String str = m.getName()
+                    +"-" + m.getModel()
+                    + "-" + m.getStandard()
+                    + "-" + m.getBrand()
+                    + "-" + m.getColor()
+                    + "-" + m.getUnit()
+                    + "-" + materialSku;
+            if (materialMap.get(str) == null) {
+                //商品主表不存在,创建商品主表
+                Material material = new Material();
+                //名称
+                material.setName(m.getName());
+                //型号
+                material.setModel(m.getModel());
+                //规格
+                material.setStandard(m.getStandard());
+                //品牌
+                material.setBrand(m.getBrand());
+                //助记码
+                material.setMnemonic(m.getMnemonic());
+                //颜色
+                material.setColor(m.getColor());
+                //单位-单个
+                material.setUnit(m.getUnit());
+                //计量单位Id
+                material.setUnitId(m.getUnitId());
+                //启用 0-禁用  1-启用
+                material.setEnabled(m.getEnabled());
+                //自定义1
+                material.setOtherField1(m.getOtherField1());
+                //自定义2
+                material.setOtherField2(m.getOtherField2());
+                //自定义3
+                material.setOtherField3(m.getOtherField3());
+                //是否开启序列号
+                material.setEnableSerialNumber(m.getEnableSerialNumber());
+                //系统sku
+                material.setSystemSku(m.getSystemSku());
+                List<MaterialExtend> list = new ArrayList<>();
+                material.setList(list);
+                materialMap.put(str,material);
+            }
+            //添加子表信息
+            MaterialExtend materialExtend = new MaterialExtend();
+            //商品单位
+            materialExtend.setCommodityUnit(m.getUnit());
+            //商品属性
+            materialExtend.setSku(materialSku);
+            //采购价格
+            materialExtend.setPurchaseDecimal(basicObj.getBigDecimal("purchaseDecimal"));
+            //零售价格
+            materialExtend.setCommodityDecimal(basicObj.getBigDecimal("commodityDecimal"));
+            //销售价格
+            materialExtend.setWholesaleDecimal(basicObj.getBigDecimal("wholesaleDecimal"));
+            //最低售价
+            materialExtend.setLowDecimal(basicObj.getBigDecimal("lowDecimal"));
+            //生产日期
+            materialExtend.setProductionDate(basicObj.getDate("productionDate"));
+            //保质期天数
+            materialExtend.setExpiryNum(basicObj.getInteger("expiryNum"));
+            //供应商id
+            materialExtend.setSupplierId(basicObj.getLong("supplierId"));
+            //商品条码
+            materialExtend.setBarCode(basicObj.getString("barCode"));
+            //设置批次号
+            String batchNumber = DateUtils.dateTimeNow("yyyyMMdd") + RandomHelper.getRandomStr(6);
+            materialExtend.setBatchNumber(batchNumber);
+            //仓库id
+            materialExtend.setDepotId(basicObj.getLong("depotId"));
+            //仓位货架
+            materialExtend.setPosition(basicObj.getString("position"));
+            materialExtend.setInventory(basicObj.getBigDecimal("inventory"));
+            materialMap.get(str).getList().add(materialExtend);
+        }
+        materialMap.values().forEach(v -> materials.add(v));
+        return materials;
+    }
+
 }

+ 2 - 2
src/main/resources/application-test.yml

@@ -12,10 +12,10 @@ file:
 spring:
   #数据库连接
   datasource:
-    url: jdbc:mysql://rm-bp1m458hex0a0p5553o.mysql.rds.aliyuncs.com:3306/jsh_erp?useUnicode=true&characterEncoding=utf8&useCursorFetch=true&defaultFetchSize=500&allowMultiQueries=true&rewriteBatchedStatements=true&useSSL=false
+    url: jdbc:mysql://120.26.144.244:3306/jsh_erp?useUnicode=true&characterEncoding=utf8&useCursorFetch=true&defaultFetchSize=500&allowMultiQueries=true&rewriteBatchedStatements=true&useSSL=false
     driverClassName: com.mysql.cj.jdbc.Driver
     username: root
-    password: jiesuimysql2022
+    password: Hro@2021Hro
   # Redis
   redis:
     host: 127.0.0.1

+ 2 - 2
src/main/resources/mapper_xml/DepotHeadMapper.xml

@@ -373,10 +373,10 @@
         #{qrcodeUrl,jdbcType=VARCHAR},
       </if>
       <if test="goodsQuantity != null">
-        #{goodsQuantity,jdbcType=INT},
+        #{goodsQuantity,jdbcType=INTEGER},
       </if>
       <if test="goodsTypeCount != null">
-        #{goodsTypeCount,jdbcType=INT},
+        #{goodsTypeCount,jdbcType=INTEGER},
       </if>
     </trim>
   </insert>

+ 8 - 4
src/main/resources/mapper_xml/DepotItemMapperEx.xml

@@ -1102,13 +1102,17 @@
     </select>
 
     <select id="getBillItemByParam" resultType="com.jsh.erp.datasource.entities.MaterialVo4Unit">
-        select m.id, m.name, m.standard, m.model, me.id meId,me.commodity_unit commodityUnit,
-        me.purchase_decimal purchaseDecimal, me.wholesale_decimal wholesaleDecimal, me.bar_code mBarCode, me.sku
+        select m.*,u.name unit_name, me.id meId, me.commodity_unit, me.purchase_decimal, me.commodity_decimal,
+        me.wholesale_decimal, me.low_decimal, me.sku,
+        me.production_date, me.expiry_num, me.supplier_id, me.bar_code, me.batch_number, me.depot_id, me.position,d.`name` depotName,s.supplier supplierName
         from jsh_material m
         left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1'
+        left join jsh_unit u on m.unit_id=u.id and ifnull(u.delete_Flag,'0') !='1'
+        left JOIN jsh_depot d on me.depot_id = d.id and ifnull(d.delete_Flag,'0') !='1'
+        left JOIN jsh_supplier s on me.supplier_id = s.id and ifnull(s.delete_Flag,'0') !='1'
         where 1=1
-        <if test="barCodes != null">
-            and me.bar_code in (${barCodes})
+        <if test="batchNumbers != null">
+            and me.batch_number in (${batchNumbers})
         </if>
         and ifnull(m.delete_flag,'0') !='1'
         order by m.id desc