2
0

8 Commits 643477d6ea ... a3d06191c0

Autor SHA1 Nachricht Datum
  yangzhi a3d06191c0 Merge remote-tracking branch 'origin/dev_ml_522' vor 3 Wochen
  yangzhi 4e07b31521 Merge remote-tracking branch 'origin/dev_hjj_522' vor 3 Wochen
  maliang 52f2b24b61 fix:修改 vor 3 Wochen
  huang eae5c33322 循环引入问题解决 vor 3 Wochen
  maliang cb6dbf5247 fix:价格修改 vor 3 Wochen
  maliang dbb0bcc767 fix:校验 vor 3 Wochen
  huang 5c0b96f3d1 pda录入货物校验,pc端商品导出调整,审核bug修改 vor 3 Wochen
  maliang 5ef9e23f48 fix:bug vor 3 Wochen
28 geänderte Dateien mit 436 neuen und 521 gelöschten Zeilen
  1. 5 0
      docs/new_sql.sql
  2. 60 231
      jshERP-web/src/views/bill/dialog/BillDetail.vue
  3. 2 2
      jshERP-web/src/views/bill/modules/OtherInModal.vue
  4. 4 4
      jshERP-web/src/views/bill/modules/OtherOutModal.vue
  5. 15 6
      jshERP-web/src/views/bill/modules/PurchaseInModal.vue
  6. 13 4
      jshERP-web/src/views/bill/modules/PurchaseOrderModal.vue
  7. 11 2
      jshERP-web/src/views/bill/modules/SaleOrderModal.vue
  8. 14 5
      jshERP-web/src/views/bill/modules/SaleOutModal.vue
  9. 1 1
      jshERP-web/src/views/material/MaterialList.vue
  10. 6 2
      jshERP-web/src/views/material/modules/MaterialModal.vue
  11. 1 1
      jshERP-web/src/views/task/modules/FlowModal.vue
  12. 3 8
      src/main/java/com/jsh/erp/controller/pda/PdaController.java
  13. 9 8
      src/main/java/com/jsh/erp/datasource/mappers/DepotItemMapper.java
  14. 0 7
      src/main/java/com/jsh/erp/datasource/mappers/MaterialMapperEx.java
  15. 6 0
      src/main/java/com/jsh/erp/exception/GlobalExceptionHandler.java
  16. 21 0
      src/main/java/com/jsh/erp/exception/ServiceException.java
  17. 4 8
      src/main/java/com/jsh/erp/service/DepotItemService.java
  18. 53 55
      src/main/java/com/jsh/erp/service/impl/AuditServiceImpl.java
  19. 4 2
      src/main/java/com/jsh/erp/service/impl/DepotHeadServiceImpl.java
  20. 7 23
      src/main/java/com/jsh/erp/service/impl/DepotItemServiceImpl.java
  21. 10 8
      src/main/java/com/jsh/erp/service/impl/MaterialBatchServiceImpl.java
  22. 9 0
      src/main/java/com/jsh/erp/service/impl/MaterialInputServiceImpl.java
  23. 141 125
      src/main/java/com/jsh/erp/service/impl/MaterialServiceImpl.java
  24. 3 2
      src/main/java/com/jsh/erp/service/impl/TaskStocktakingServiceImpl.java
  25. 26 2
      src/main/resources/mapper_xml/DepotItemMapper.xml
  26. 1 1
      src/main/resources/mapper_xml/MaterialExtendMapperEx.xml
  27. 1 1
      src/main/resources/mapper_xml/MaterialInitialStockMapperEx.xml
  28. 6 13
      src/main/resources/mapper_xml/MaterialMapperEx.xml

+ 5 - 0
docs/new_sql.sql

@@ -382,6 +382,11 @@ ALTER TABLE jsh_depot_head
   ADD COLUMN reject VARCHAR(1000) DEFAULT NULL COMMENT '驳回原因',
   ADD COLUMN reject_time datetime DEFAULT NULL COMMENT '驳回时间';
 
+-- 2025-06-13
+-- 商品价格拓展表 新增条码属性
+ALTER TABLE jsh_material_extend
+  ADD COLUMN bar_code VARCHAR(255) DEFAULT NULL COMMENT '商品条码';
+
 
 
 

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

@@ -477,21 +477,17 @@
               :columns="columns"
               :dataSource="dataSource"
             >
-              <template slot="customBarCode" slot-scope="text, record">
-                <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">{{ record.barCode }}</div>
-                <a-popover placement="right" trigger="click">
-                  <template slot="content"
-                    ><img :src="getImgUrl(record.imgName, record.imgLarge)" width="500px"
-                  /></template>
-                  <div class="item-info" v-if="record.imgName">
-                    <img
-                      v-if="record.imgName"
-                      :src="getImgUrl(record.imgName, record.imgSmall)"
-                      class="item-img"
-                      title="查看大图"
-                    />
-                  </div>
-                </a-popover>
+              <template slot="unitPrice" slot-scope="text, record">
+                {{ record.unitPrice }}
+                <a-tooltip title="单价和默认采购价不一致">
+                  <a-icon type="info-circle" style="color: #f5222d" v-show="record.unitPrice!=record.defaultPurchaseDecimal" />
+                </a-tooltip>
+              </template>
+              <template slot="wholesaleDecimal" slot-scope="text, record">
+                {{ record.wholesaleDecimal }}
+                <a-tooltip title="销售价和默认销售价不一致">
+                  <a-icon type="info-circle" style="color: #f5222d" v-show="record.wholesaleDecimal!=record.defaultWholesaleDecimal" />
+                </a-tooltip>
               </template>
             </a-table>
           </div>
@@ -609,21 +605,17 @@
               :dataSource="dataSource"
               :scroll="{ x: 1500, y: 300 }"
             >
-              <template slot="customBarCode" slot-scope="text, record">
-                <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">{{ record.barCode }}</div>
-                <a-popover placement="right" trigger="click">
-                  <template slot="content"
-                    ><img :src="getImgUrl(record.imgName, record.imgLarge)" width="500px"
-                  /></template>
-                  <div class="item-info" v-if="record.imgName">
-                    <img
-                      v-if="record.imgName"
-                      :src="getImgUrl(record.imgName, record.imgSmall)"
-                      class="item-img"
-                      title="查看大图"
-                    />
-                  </div>
-                </a-popover>
+              <template slot="unitPrice" slot-scope="text, record">
+                {{ record.unitPrice }}
+                <a-tooltip title="单价和默认采购价不一致">
+                  <a-icon type="info-circle" style="color: #f5222d" v-show="record.unitPrice!=record.defaultPurchaseDecimal" />
+                </a-tooltip>
+              </template>
+              <template slot="wholesaleDecimal" slot-scope="text, record">
+                {{ record.wholesaleDecimal }}
+                <a-tooltip title="销售价和默认销售价不一致">
+                  <a-icon type="info-circle" style="color: #f5222d" v-show="record.wholesaleDecimal!=record.defaultWholesaleDecimal" />
+                </a-tooltip>
               </template>
             </a-table>
           </div>
@@ -915,21 +907,11 @@
               :dataSource="dataSource"
               :scroll="{ x: '100%'}"
             >
-              <template slot="customBarCode" slot-scope="text, record">
-                <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">{{ record.barCode }}</div>
-                <a-popover placement="right" trigger="click">
-                  <template slot="content"
-                    ><img :src="getImgUrl(record.imgName, record.imgLarge)" width="500px"
-                  /></template>
-                  <div class="item-info" v-if="record.imgName">
-                    <img
-                      v-if="record.imgName"
-                      :src="getImgUrl(record.imgName, record.imgSmall)"
-                      class="item-img"
-                      title="查看大图"
-                    />
-                  </div>
-                </a-popover>
+              <template slot="unitPrice" slot-scope="text, record">
+                {{ record.unitPrice }}
+                <a-tooltip title="单价和默认销售价不一致">
+                  <a-icon type="info-circle" style="color: #f5222d" v-show="record.unitPrice!=record.defaultWholesaleDecimal" />
+                </a-tooltip>
               </template>
             </a-table>
           </div>
@@ -1051,21 +1033,11 @@
               :dataSource="dataSource"
               :scroll="{ x: '100%' }"
             >
-              <template slot="customBarCode" slot-scope="text, record">
-                <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">{{ record.barCode }}</div>
-                <a-popover placement="right" trigger="click">
-                  <template slot="content"
-                    ><img :src="getImgUrl(record.imgName, record.imgLarge)" width="500px"
-                  /></template>
-                  <div class="item-info" v-if="record.imgName">
-                    <img
-                      v-if="record.imgName"
-                      :src="getImgUrl(record.imgName, record.imgSmall)"
-                      class="item-img"
-                      title="查看大图"
-                    />
-                  </div>
-                </a-popover>
+              <template slot="unitPrice" slot-scope="text, record">
+                {{ record.unitPrice }}
+                <a-tooltip title="单价和默认销售价不一致">
+                  <a-icon type="info-circle" style="color: #f5222d" v-show="record.unitPrice!=record.defaultWholesaleDecimal" />
+                </a-tooltip>
               </template>
             </a-table>
           </div>
@@ -1369,21 +1341,17 @@
               :dataSource="dataSource"
               :scroll="{ x: '100%' }"
             >
-              <template slot="customBarCode" slot-scope="text, record">
-                <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">{{ record.barCode }}</div>
-                <a-popover placement="right" trigger="click">
-                  <template slot="content"
-                    ><img :src="getImgUrl(record.imgName, record.imgLarge)" width="500px"
-                  /></template>
-                  <div class="item-info" v-if="record.imgName">
-                    <img
-                      v-if="record.imgName"
-                      :src="getImgUrl(record.imgName, record.imgSmall)"
-                      class="item-img"
-                      title="查看大图"
-                    />
-                  </div>
-                </a-popover>
+              <template slot="unitPrice" slot-scope="text, record">
+                {{ record.unitPrice }}
+                <a-tooltip title="单价和默认采购价不一致">
+                  <a-icon type="info-circle" style="color: #f5222d" v-show="record.unitPrice!=record.defaultPurchaseDecimal" />
+                </a-tooltip>
+              </template>
+              <template slot="wholesaleDecimal" slot-scope="text, record">
+                {{ record.wholesaleDecimal }}
+                <a-tooltip title="销售价和默认销售价不一致">
+                  <a-icon type="info-circle" style="color: #f5222d" v-show="record.wholesaleDecimal!=record.defaultWholesaleDecimal" />
+                </a-tooltip>
               </template>
             </a-table>
           </div>
@@ -1489,21 +1457,11 @@
               :dataSource="dataSource"
               :scroll="{ x: '100%' }"
             >
-              <template slot="customBarCode" slot-scope="text, record">
-                <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">{{ record.barCode }}</div>
-                <a-popover placement="right" trigger="click">
-                  <template slot="content"
-                    ><img :src="getImgUrl(record.imgName, record.imgLarge)" width="500px"
-                  /></template>
-                  <div class="item-info" v-if="record.imgName">
-                    <img
-                      v-if="record.imgName"
-                      :src="getImgUrl(record.imgName, record.imgSmall)"
-                      class="item-img"
-                      title="查看大图"
-                    />
-                  </div>
-                </a-popover>
+              <template slot="unitPrice" slot-scope="text, record">
+                {{ record.unitPrice }}
+                <a-tooltip title="单价和默认销售价不一致">
+                  <a-icon type="info-circle" style="color: #f5222d" v-show="record.unitPrice!=record.defaultWholesaleDecimal" />
+                </a-tooltip>
               </template>
             </a-table>
           </div>
@@ -2081,85 +2039,66 @@ export default {
         { title: '备注', dataIndex: 'remark' },
       ],
       purchaseOrderColumns: [
-        { title: '批次号', dataIndex: 'batchNumber', width: 90 },
         { title: '名称', dataIndex: 'name', width: 115 },
-        // { title: '规格', dataIndex: 'standard', width: 90 },
         { title: '生产日期', dataIndex: 'productionDate', width: 100 },
         { title: '保质期', dataIndex: 'expiryNum', width: 60 },
         { title: 'SKU', dataIndex: 'sku', width: 90 },
         { title: '仓库名称', dataIndex: 'depotName', width: 90 },
         { title: '仓库货架', dataIndex: 'position', width: 90 },
         { title: '包装规格', dataIndex: 'unitName', width: 90 },
-
         { title: '型号', dataIndex: 'model', width: 60 },
         { title: '颜色', dataIndex: 'color', width: 60 },
         { title: '品牌', dataIndex: 'brand', width: 90 },
-        { title: '制造商', dataIndex: 'mfrs', width: 90 },
         { title: '扩展信息', dataIndex: 'materialOther', width: 90 },
         { title: '库存', dataIndex: 'stock', width: 90 },
         { title: '单位', dataIndex: 'unit', width: 90 },
-        { title: '序列号', dataIndex: 'snList', width: 300 },
-        { title: '有效期', dataIndex: 'expirationDate', width: 90 },
         { title: '入库数量', dataIndex: 'operNumber', width: 90 },
-        { title: '已入库', dataIndex: 'finishNumber', width: 90 },
-        { title: '单价', dataIndex: 'unitPrice', width: 90 },
+        { title: '单价', dataIndex: 'unitPrice', width: 90, scopedSlots: { customRender: 'unitPrice' } },
+        { title: '销售价', dataIndex: 'wholesaleDecimal', width: 90, scopedSlots: { customRender: 'wholesaleDecimal' } },
         { title: '金额', dataIndex: 'allPrice', width: 90 },
         { title: '税率(%)', dataIndex: 'taxRate', width: 90 },
         { title: '税额', dataIndex: 'taxMoney', width: 90 },
         { title: '价税合计', dataIndex: 'taxLastMoney', width: 90 },
         { title: '入库人', dataIndex: 'warehousingUserName', width: 90 },
         { title: '入库时间', dataIndex: 'warehousingTime', width: 90 },
-        { title: '重量', dataIndex: 'weight', width: 90 },
         { title: '备注', dataIndex: 'remark', width: 90 },
       ],
       purchaseInColumns: [
-        { title: '批次号', dataIndex: 'batchNumber', width: 90 },
         { title: '名称', dataIndex: 'name', width: 115 },
-        // { title: '规格', dataIndex: 'standard', width: 90 },
-
         { title: '生产日期', dataIndex: 'productionDate', width: 100 },
         { title: '保质期', dataIndex: 'expiryNum', width: 60 },
         { title: 'SKU', dataIndex: 'sku', width: 90 },
         { title: '仓库名称', dataIndex: 'depotName', width: 90 },
         { title: '仓库货架', dataIndex: 'position', width: 90 },
         { title: '包装规格', dataIndex: 'unitName', width: 90 },
-
         { title: '型号', dataIndex: 'model', width: 60 },
         { title: '颜色', dataIndex: 'color', width: 60 },
         { title: '品牌', dataIndex: 'brand', width: 90 },
-        { title: '制造商', dataIndex: 'mfrs', width: 90 },
         { title: '扩展信息', dataIndex: 'materialOther', width: 90 },
         { title: '库存', dataIndex: 'stock', width: 90 },
         { title: '单位', dataIndex: 'unit', width: 90 },
-        { title: '序列号', dataIndex: 'snList', width: 300 },
-        { title: '有效期', dataIndex: 'expirationDate', width: 90 },
         { title: '入库数量', dataIndex: 'operNumber', width: 90 },
-        { title: '已入库', dataIndex: 'finishNumber', width: 90 },
-        { title: '单价', dataIndex: 'unitPrice', width: 90 },
+        { title: '单价', dataIndex: 'unitPrice', width: 90, scopedSlots: { customRender: 'unitPrice' } },
+        { title: '销售价', dataIndex: 'wholesaleDecimal', width: 90, scopedSlots: { customRender: 'wholesaleDecimal' } },
         { title: '金额', dataIndex: 'allPrice', width: 90 },
         { title: '税率(%)', dataIndex: 'taxRate', width: 90 },
         { title: '税额', dataIndex: 'taxMoney', width: 90 },
         { title: '价税合计', dataIndex: 'taxLastMoney', width: 90 },
         { title: '入库人', dataIndex: 'warehousingUserName', width: 90 },
         { title: '入库时间', dataIndex: 'warehousingTime', width: 90 },
-        { title: '重量', dataIndex: 'weight', width: 90 },
         { title: '备注', dataIndex: 'remark', width: 90 },
       ],
       purchaseBackColumns: [
         { title: '仓库名称', dataIndex: 'depotName' },
-        { title: '条码', dataIndex: 'barCode' },
+        { title: 'SKU', dataIndex: 'sku' },
         { title: '名称', dataIndex: 'name' },
         { title: '规格', dataIndex: 'standard' },
         { title: '型号', dataIndex: 'model' },
         { title: '颜色', dataIndex: 'color' },
         { title: '品牌', dataIndex: 'brand' },
-        { title: '制造商', dataIndex: 'mfrs' },
         { title: '扩展信息', dataIndex: 'materialOther' },
         { title: '库存', dataIndex: 'stock' },
         { title: '单位', dataIndex: 'unit' },
-        { title: '序列号', dataIndex: 'snList', width: 300 },
-        { title: '批号', dataIndex: 'batchNumber' },
-        { title: '有效期', dataIndex: 'expirationDate' },
         { title: '数量', dataIndex: 'operNumber' },
         { title: '已出库', dataIndex: 'finishNumber' },
         { title: '单价', dataIndex: 'unitPrice' },
@@ -2172,27 +2111,18 @@ export default {
         { title: '备注', dataIndex: 'remark' },
       ],
       saleOrderColumns: [
-        { title: '批次号', dataIndex: 'batchNumber', width: 90 },
         { title: '名称', dataIndex: 'name', width: 115 },
-        // { title: '规格', dataIndex: 'standard', width: 90 },
-
         { title: 'SKU', dataIndex: 'sku', width: 90 },
         { title: '仓库名称', dataIndex: 'depotName', width: 90 },
         { title: '仓库货架', dataIndex: 'position', width: 90 },
         { title: '包装规格', dataIndex: 'unitName', width: 90 },
-
-        // { title: '规格', dataIndex: 'standard', width: 60 },
         { title: '型号', dataIndex: 'model', width: 60 },
         { title: '颜色', dataIndex: 'color', width: 60 },
         { title: '品牌', dataIndex: 'brand', width: 90 },
-        { title: '制造商', dataIndex: 'mfrs', width: 90 },
         { title: '扩展信息', dataIndex: 'materialOther', width: 90 },
         { title: '库存', dataIndex: 'stock', width: 90 },
-        { title: '单位', dataIndex: 'unit', width: 90 },
-        { title: '序列号', dataIndex: 'snList', width: 300 },
-        { title: '有效期', dataIndex: 'expirationDate', width: 90 },
+        { title: '单价', dataIndex: 'unitPrice', width: 90, scopedSlots: { customRender: 'unitPrice' } },
         { title: '出库数量', dataIndex: 'operNumber', width: 90 },
-        { title: '已出库', dataIndex: 'finishNumber', width: 90 },
         { title: '单价', dataIndex: 'unitPrice', width: 90 },
         { title: '金额', dataIndex: 'allPrice', width: 90 },
         { title: '税率(%)', dataIndex: 'taxRate', width: 90 },
@@ -2200,40 +2130,28 @@ export default {
         { title: '价税合计', dataIndex: 'taxLastMoney', width: 90 },
         { title: '出库人', dataIndex: 'warehousingUserName', width: 90 },
         { title: '出库时间', dataIndex: 'warehousingTime', width: 90 },
-
-        { title: '重量', dataIndex: 'weight', width: 90 },
         { title: '备注', dataIndex: 'remark', width: 90 },
       ],
       saleOutColumns: [
-        { title: '批次号', dataIndex: 'batchNumber', width: 90 },
         { title: '名称', dataIndex: 'name', width: 115 },
-        // { title: '规格', dataIndex: 'standard', width: 90 },
-
         { title: 'SKU', dataIndex: 'sku', width: 90 },
         { title: '仓库名称', dataIndex: 'depotName', width: 90 },
         { title: '仓库货架', dataIndex: 'position', width: 90 },
         { title: '包装规格', dataIndex: 'unitName', width: 90 },
-
-        // { title: '规格', dataIndex: 'standard', width: 60 },
         { title: '型号', dataIndex: 'model', width: 60 },
         { title: '颜色', dataIndex: 'color', width: 60 },
         { title: '品牌', dataIndex: 'brand', width: 90 },
-        { title: '制造商', dataIndex: 'mfrs', width: 90 },
         { title: '扩展信息', dataIndex: 'materialOther', width: 90 },
         { title: '库存', dataIndex: 'stock', width: 90 },
         { title: '单位', dataIndex: 'unit', width: 90 },
-        { title: '序列号', dataIndex: 'snList', width: 300 },
-        { title: '有效期', dataIndex: 'expirationDate', width: 90 },
         { title: '出库数量', dataIndex: 'operNumber', width: 90 },
-        { title: '已出库', dataIndex: 'finishNumber', width: 90 },
-        { title: '单价', dataIndex: 'unitPrice', width: 90 },
+        { title: '单价', dataIndex: 'unitPrice', width: 90, scopedSlots: { customRender: 'unitPrice' } },
         { title: '金额', dataIndex: 'allPrice', width: 90 },
         { title: '税率(%)', dataIndex: 'taxRate', width: 90 },
         { title: '税额', dataIndex: 'taxMoney', width: 90 },
         { title: '价税合计', dataIndex: 'taxLastMoney', width: 90 },
         { title: '出库人', dataIndex: 'warehousingUserName', width: 90 },
         { title: '出库时间', dataIndex: 'warehousingTime', width: 90 },
-        { title: '重量', dataIndex: 'weight', width: 90 },
         { title: '备注', dataIndex: 'remark', width: 90 },
       ],
       saleBackColumns: [
@@ -2244,13 +2162,9 @@ export default {
         { title: '型号', dataIndex: 'model' },
         { title: '颜色', dataIndex: 'color' },
         { title: '品牌', dataIndex: 'brand' },
-        { title: '制造商', dataIndex: 'mfrs' },
         { title: '扩展信息', dataIndex: 'materialOther' },
         { title: '库存', dataIndex: 'stock' },
         { title: '单位', dataIndex: 'unit' },
-        { title: '序列号', dataIndex: 'snList', width: 300 },
-        { title: '批号', dataIndex: 'batchNumber' },
-        { title: '有效期', dataIndex: 'expirationDate' },
         { title: '数量', dataIndex: 'operNumber' },
         { title: '已入库', dataIndex: 'finishNumber' },
         { title: '单价', dataIndex: 'unitPrice' },
@@ -2258,82 +2172,61 @@ export default {
         { title: '税率(%)', dataIndex: 'taxRate' },
         { title: '税额', dataIndex: 'taxMoney' },
         { title: '价税合计', dataIndex: 'taxLastMoney' },
-        { title: '重量', dataIndex: 'weight' },
         { title: '仓位货架', dataIndex: 'position' },
         { title: '备注', dataIndex: 'remark' },
       ],
       otherInColumns: [
-        { title: '批次号', dataIndex: 'batchNumber', width: 90 },
         { title: '名称', dataIndex: 'name', width: 115 },
-        // { title: '规格', dataIndex: 'standard', width: 90 },
-
         { title: '生产日期', dataIndex: 'productionDate', width: 100 },
         { title: '保质期', dataIndex: 'expiryNum', width: 60 },
         { title: 'SKU', dataIndex: 'sku', width: 90 },
         { title: '仓库名称', dataIndex: 'depotName', width: 90 },
         { title: '仓库货架', dataIndex: 'position', width: 90 },
         { title: '包装规格', dataIndex: 'unitName', width: 90 },
-
         { title: '型号', dataIndex: 'model', width: 60 },
         { title: '颜色', dataIndex: 'color', width: 60 },
         { title: '品牌', dataIndex: 'brand', width: 90 },
-        { title: '制造商', dataIndex: 'mfrs', width: 90 },
         { title: '扩展信息', dataIndex: 'materialOther', width: 90 },
         { title: '库存', dataIndex: 'stock', width: 90 },
         { title: '单位', dataIndex: 'unit', width: 90 },
-        { title: '序列号', dataIndex: 'snList', width: 300 },
-        { title: '有效期', dataIndex: 'expirationDate', width: 90 },
         { title: '入库数量', dataIndex: 'operNumber', width: 90 },
-        { title: '单价', dataIndex: 'unitPrice', width: 90 },
+        { title: '单价', dataIndex: 'unitPrice', width: 90, scopedSlots: { customRender: 'unitPrice' } },
+        { title: '销售价', dataIndex: 'wholesaleDecimal', width: 90, scopedSlots: { customRender: 'wholesaleDecimal' } },
         { title: '金额', dataIndex: 'allPrice', width: 90 },
         { title: '入库人', dataIndex: 'warehousingUserName', width: 90 },
         { title: '入库时间', dataIndex: 'warehousingTime', width: 90 },
-        { title: '重量', dataIndex: 'weight', width: 90 },
+        { title: '备注', dataIndex: 'remark', width: 90 },
       ],
       otherOutColumns: [
-        { title: '批次号', dataIndex: 'batchNumber', width: 90 },
         { title: '名称', dataIndex: 'name', width: 115 },
-        // { title: '规格', dataIndex: 'standard', width: 90 },
         { title: 'SKU', dataIndex: 'sku', width: 90 },
         { title: '仓库名称', dataIndex: 'depotName', width: 90 },
         { title: '仓库货架', dataIndex: 'position', width: 90 },
         { title: '包装规格', dataIndex: 'unitName', width: 90 },
-
-        // { title: '规格', dataIndex: 'standard', width: 60 },
         { title: '型号', dataIndex: 'model', width: 60 },
         { title: '颜色', dataIndex: 'color', width: 60 },
         { title: '品牌', dataIndex: 'brand', width: 90 },
-        { title: '制造商', dataIndex: 'mfrs', width: 90 },
         { title: '扩展信息', dataIndex: 'materialOther', width: 90 },
         { title: '库存', dataIndex: 'stock', width: 90 },
         { title: '单位', dataIndex: 'unit', width: 90 },
-        { title: '序列号', dataIndex: 'snList', width: 300 },
-        { title: '有效期', dataIndex: 'expirationDate', width: 90 },
         { title: '出库数量', dataIndex: 'operNumber', width: 90 },
-        { title: '单价', dataIndex: 'unitPrice', width: 90 },
+        { title: '单价', dataIndex: 'unitPrice', width: 90, scopedSlots: { customRender: 'unitPrice' } },
         { title: '金额', dataIndex: 'allPrice', width: 90 },
         { title: '出库人', dataIndex: 'warehousingUserName', width: 90 },
         { title: '出库时间', dataIndex: 'warehousingTime', width: 90 },
-        { title: '重量', dataIndex: 'weight', width: 90 },
         { title: '备注', dataIndex: 'remark', width: 90 },
       ],
       allocationOutColumns: [
-        { title: '批次号', dataIndex: 'batchNumber', width: 90 },
         { title: '名称', dataIndex: 'name', width: 115 },
-        // { title: '规格', dataIndex: 'standard', width: 90 },
-
         { title: '生产日期', dataIndex: 'productionDate', width: 100 },
         { title: '保质期', dataIndex: 'expiryNum', width: 60 },
         { title: 'SKU', dataIndex: 'sku', width: 90 },
         { title: '仓库名称', dataIndex: 'depotName', width: 90 },
         { title: '仓库货架', dataIndex: 'position', width: 90 },
         { title: '包装规格', dataIndex: 'unitName', width: 90 },
-
-        // { title: '规格', dataIndex: 'standard', width: 60 },
         { title: '型号', dataIndex: 'model', width: 60 },
         { title: '颜色', dataIndex: 'color', width: 60 },
         { title: '品牌', dataIndex: 'brand', width: 90 },
-        { title: '制造商', dataIndex: 'mfrs', width: 90 },
         { title: '扩展信息', dataIndex: 'materialOther', width: 90 },
         { title: '库存', dataIndex: 'stock', width: 90 },
         { title: '调入仓库', dataIndex: 'anotherDepotName' },
@@ -2341,12 +2234,9 @@ export default {
         { title: '数量', dataIndex: 'operNumber', width: 90 },
         { title: '单价', dataIndex: 'unitPrice', width: 90 },
         { title: '金额', dataIndex: 'allPrice', width: 90 },
-
         { title: '实际出库数量', dataIndex: 'actualQuantityInStorage', width: 115 },
         { title: '出库人', dataIndex: 'warehousingUserName', width: 90 },
         { title: '出库时间', dataIndex: 'warehousingTime', width: 90 },
-
-        { title: '重量', dataIndex: 'weight', width: 90 },
         { title: '备注', dataIndex: 'remark', width: 90 },
       ],
       assembleColumns: [
@@ -2517,69 +2407,8 @@ export default {
           },
         },
       ]
-      if (record.status === '3') {
-        //部分采购|部分销售的时候显示全部列
-        for (let i = 0; i < this.defColumns.length; i++) {
-          currentCol.push(this.defColumns[i])
-        }
-      } else if (record.purchaseStatus === '3') {
-        //将已出库的标题转为已采购,针对销售订单转采购订单的场景
-        for (let i = 0; i < this.defColumns.length; i++) {
-          let info = {}
-          info.title = this.defColumns[i].title
-          info.dataIndex = this.defColumns[i].dataIndex
-          if (this.defColumns[i].width) {
-            info.width = this.defColumns[i].width
-          }
-          if (this.defColumns[i].dataIndex === 'finishNumber') {
-            info.title = '已采购'
-          }
-          if (this.defColumns[i].dataIndex === 'barCode') {
-            info.scopedSlots = { customRender: 'customBarCode' }
-          }
-          currentCol.push(info)
-        }
-      } else {
-        for (let i = 0; i < this.defColumns.length; i++) {
-          //移除列
-          let needRemoveKeywords = [
-            'finishNumber',
-            'snList',
-            'batchNumber',
-            'expirationDate',
-            'sku',
-            'weight',
-            'position',
-            'brand',
-            'mfrs',
-          ]
-          if (needRemoveKeywords.indexOf(this.defColumns[i].dataIndex) === -1) {
-            let info = {}
-            info.title = this.defColumns[i].title
-            info.dataIndex = this.defColumns[i].dataIndex
-            if (this.defColumns[i].width) {
-              info.width = this.defColumns[i].width
-            }
-            if (this.defColumns[i].dataIndex === 'barCode') {
-              info.scopedSlots = { customRender: 'customBarCode' }
-            }
-            currentCol.push(info)
-          }
-          //添加有数据的列
-          if (needAddkeywords.indexOf(this.defColumns[i].dataIndex) > -1) {
-            let info = {}
-            info.title = this.defColumns[i].title
-            info.dataIndex = this.defColumns[i].dataIndex
-            if (this.defColumns[i].width) {
-              info.width = this.defColumns[i].width
-            }
-            currentCol.push(info)
-          }
-        }
-      }
-      this.defColumns = currentCol
+      this.defColumns = [...currentCol,...this.defColumns]
       this.initColumnsSetting()
-      // this.columns = currentCol
     },
     initPlatform() {
       getPlatformConfigByKey({ platformKey: 'bill_print_flag' }).then((res) => {

+ 2 - 2
jshERP-web/src/views/bill/modules/OtherInModal.vue

@@ -328,13 +328,13 @@ export default {
             type: FormTypes.inputNumber,
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
-          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.slot,validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' }], },
+          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.slot,validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(?:0|[1-9]\d*)(?:\.\d{1,4})?$/, message: '金额格式不正确!' }], },
           {
             title: '销售价',
             key: 'wholesaleDecimal',
             width: '120px',
             type: FormTypes.slot,
-            validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' }],
+            validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(?:0|[1-9]\d*)(?:\.\d{1,4})?$/, message: '金额格式不正确!' }],
           },
           { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber,disabled: true, statistics: true },
           {

+ 4 - 4
jshERP-web/src/views/bill/modules/OtherOutModal.vue

@@ -152,13 +152,13 @@
             >
             </a-select>
           </template>
-          <template #wholesaleDecimal="{ handleChange, value, index,allValues }">
+          <!-- <template #wholesaleDecimal="{ handleChange, value, index,allValues }">
             <a-input :value="value" @change="($event) => onChangePrice($event,handleChange)">
               <a-tooltip slot="suffix" title="修改后和默认价格不一致">
                 <a-icon type="info-circle" style="color: #f5222d" v-show="getDefaultWholesaleDecimal(index,'defaultWholesaleDecimal',value,allValues)" />
               </a-tooltip>
             </a-input>
-          </template>
+          </template> -->
           <template #unitPrice="{ handleChange, value, index,allValues }">
             <a-input :value="value" @change="($event) => onChangePrice($event,handleChange)">
               <a-tooltip slot="suffix" title="修改后和默认价格不一致">
@@ -312,7 +312,7 @@ export default {
             width: '120px',
             type: FormTypes.normal,
           },
-          { title: '销售价', key: 'wholesaleDecimal', width: '120px', type: FormTypes.slot,validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' }] },
+          // { title: '销售价', key: 'wholesaleDecimal', width: '120px', type: FormTypes.slot,validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(?:0|[1-9]\d*)(?:\.\d{1,4})?$/, message: '金额格式不正确!' }] },
           {
             title: '出库数量',
             key: 'operNumber',
@@ -320,7 +320,7 @@ export default {
             type: FormTypes.inputNumber,
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
-          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.slot,validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' }], },
+          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.slot,validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(?:0|[1-9]\d*)(?:\.\d{1,4})?$/, message: '金额格式不正确!' }], },
           { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber, disabled: true, statistics: true },
           {
             title: '出库人',

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

@@ -212,7 +212,7 @@
               <a-input
                 style="width: 100%"
                 placeholder="请输入优惠率"
-                v-decorator.trim="['discount']"
+                v-decorator.trim="['discount',validatorRules.discount]"
                 suffix="%"
                 @change="onChangeDiscount"
               />
@@ -229,7 +229,7 @@
             >
               <a-input
                 placeholder="请输入付款优惠"
-                v-decorator.trim="['discountMoney']"
+                v-decorator.trim="['discountMoney',validatorRules.discountMoney]"
                 @change="onChangeDiscountMoney"
               />
             </a-form-item>
@@ -255,7 +255,7 @@
               data-title="其它费用"
               data-intro="比如快递费、油费、过路费"
             >
-              <a-input placeholder="请输入其它费用" v-decorator.trim="['otherMoney']" @change="onChangeOtherMoney" />
+              <a-input placeholder="请输入其它费用" v-decorator.trim="['otherMoney',validatorRules.otherMoney]" @change="onChangeOtherMoney" />
             </a-form-item>
           </a-col>
         </a-row>
@@ -494,13 +494,13 @@ export default {
             type: FormTypes.inputNumber,
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
-          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.slot,validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' }], },
+          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.slot,validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(?:0|[1-9]\d*)(?:\.\d{1,4})?$/, message: '金额格式不正确!' }], },
           {
             title: '销售价',
             key: 'wholesaleDecimal',
             width: '120px',
             type: FormTypes.slot,
-            validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' }],
+            validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(?:0|[1-9]\d*)(?:\.\d{1,4})?$/, message: '金额格式不正确!' }],
           },
           { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber, disabled: true, statistics: true },
           {
@@ -547,12 +547,21 @@ export default {
         changeAmount: {
           rules: [
             { required: true, message: '请输入金额,如果为空请填0!' },
-            { pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' },
+            { pattern: /^(?:0|[1-9]\d*)(?:\.\d{1,4})?$/, message: '金额格式不正确!' },
           ],
         },
         depotId: {
           rules: [{ required: true, message: '请选择仓库名!' }],
         },
+        discount: {
+          rules: [{ pattern: /^(?:0|[1-9]\d*)(?:\.\d{1,4})?$/, message: '格式不正确!' }],
+        },
+        discountMoney: {
+          rules: [{ pattern: /^(?:0|[1-9]\d*)(?:\.\d{1,4})?$/, message: '格式不正确!' }],
+        },
+        otherMoney: {
+          rules: [{ pattern: /^(?:0|[1-9]\d*)(?:\.\d{1,4})?$/, message: '格式不正确!' }],
+        },
       },
       url: {
         add: '/depotHead/addDepotHeadAndDetail',

+ 13 - 4
jshERP-web/src/views/bill/modules/PurchaseOrderModal.vue

@@ -236,7 +236,7 @@
               <a-input
                 style="width: 100%"
                 placeholder="请输入优惠率"
-                v-decorator.trim="['discount']"
+                v-decorator.trim="['discount', validatorRules.discount]"
                 suffix="%"
                 @change="onChangeDiscount"
               />
@@ -253,7 +253,7 @@
             >
               <a-input
                 placeholder="请输入付款优惠"
-                v-decorator.trim="['discountMoney']"
+                v-decorator.trim="['discountMoney', validatorRules.discountMoney]"
                 @change="onChangeDiscountMoney"
               />
             </a-form-item>
@@ -485,13 +485,13 @@ export default {
             type: FormTypes.inputNumber,
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
-          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.slot,validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' }], },
+          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.slot,validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(?:0|[1-9]\d*)(?:\.\d{1,4})?$/, message: '金额格式不正确!' }], },
           {
             title: '销售价',
             key: 'wholesaleDecimal',
             width: '120px',
             type: FormTypes.slot,
-            validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' }],
+            validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(?:0|[1-9]\d*)(?:\.\d{1,4})?$/, message: '金额格式不正确!' }],
           },
           { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber, disabled: true, statistics: true, },
           {
@@ -525,6 +525,15 @@ export default {
         accountId: {
           rules: [{ required: true, message: '请选择结算账户!' }],
         },
+        price: {
+          rules: [{ pattern: /^(?:0|[1-9]\d*)(?:\.\d{1,4})?$/, message: '格式不正确!' }],
+        },
+        discount: {
+          rules: [{ pattern: /^(?:0|[1-9]\d*)(?:\.\d{1,4})?$/, message: '格式不正确!' }],
+        },
+        discountMoney: {
+          rules: [{ pattern: /^(?:0|[1-9]\d*)(?:\.\d{1,4})?$/, message: '格式不正确!' }],
+        },
       },
       url: {
         add: '/depotHead/addDepotHeadAndDetail',

+ 11 - 2
jshERP-web/src/views/bill/modules/SaleOrderModal.vue

@@ -209,7 +209,7 @@
               <a-input
                 style="width: 100%"
                 placeholder="请输入优惠率"
-                v-decorator.trim="['discount']"
+                v-decorator.trim="['discount',validatorRules.discount]"
                 suffix="%"
                 @change="onChangeDiscount"
               />
@@ -226,7 +226,7 @@
             >
               <a-input
                 placeholder="请输入付款优惠"
-                v-decorator.trim="['discountMoney']"
+                v-decorator.trim="['discountMoney',validatorRules.discountMoney]"
                 @change="onChangeDiscountMoney"
               />
             </a-form-item>
@@ -471,6 +471,15 @@ export default {
         accountId: {
           rules: [{ required: true, message: '请选择结算账户!' }],
         },
+        discount: {
+          rules: [{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '格式不正确!' }],
+        },
+        discountMoney: {
+          rules: [{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '格式不正确!' }],
+        },
+        changeAmount: {
+          rules: [{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '格式不正确!' }],
+        },
       },
       url: {
         add: '/depotHead/addDepotHeadAndDetail',

+ 14 - 5
jshERP-web/src/views/bill/modules/SaleOutModal.vue

@@ -229,7 +229,7 @@
               <a-input
                 style="width: 100%"
                 placeholder="请输入优惠率"
-                v-decorator.trim="['discount']"
+                v-decorator.trim="['discount',validatorRules.discount]"
                 suffix="%"
                 @change="onChangeDiscount"
               />
@@ -246,7 +246,7 @@
             >
               <a-input
                 placeholder="请输入付款优惠"
-                v-decorator.trim="['discountMoney']"
+                v-decorator.trim="['discountMoney',validatorRules.discountMoney]"
                 @change="onChangeDiscountMoney"
               />
             </a-form-item>
@@ -272,7 +272,7 @@
               data-title="其它费用"
               data-intro="比如快递费、油费、过路费"
             >
-              <a-input placeholder="请输入其它费用" v-decorator.trim="['otherMoney']" @change="onChangeOtherMoney" />
+              <a-input placeholder="请输入其它费用" v-decorator.trim="['otherMoney',validatorRules.otherMoney]" @change="onChangeOtherMoney" />
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="8" :md="12" :sm="24">
@@ -528,7 +528,7 @@ export default {
             type: FormTypes.inputNumber,
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
-          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.slot,validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' }], },
+          { title: '单价', key: 'unitPrice', width: '120px', type: FormTypes.slot,validateRules: [{ required: true, message: '${title}不能为空' },{ pattern: /^(?:0|[1-9]\d*)(?:\.\d{1,4})?$/, message: '金额格式不正确!' }], },
           { title: '金额', key: 'allPrice', width: '120px', type: FormTypes.inputNumber,disabled: true, statistics: true },
           {
             title: '税额',
@@ -567,10 +567,19 @@ export default {
         accountId: {
           rules: [{ required: true, message: '请选择结算账户!' }],
         },
+        discount: {
+          rules: [{ pattern: /^(?:0|[1-9]\d*)(?:\.\d{1,4})?$/, message: '格式不正确!' }],
+        },
+        discountMoney: {
+          rules: [{ pattern: /^(?:0|[1-9]\d*)(?:\.\d{1,4})?$/, message: '格式不正确!' }],
+        },
+        otherMoney: {
+          rules: [{ pattern: /^(?:0|[1-9]\d*)(?:\.\d{1,4})?$/, message: '格式不正确!' }],
+        },
         changeAmount: {
           rules: [
             { required: true, message: '请输入金额,如果为空请填0!' },
-            { pattern: /^(([0-9][0-9]*)|([0]\.\d{0,4}|[0-9][0-9]*\.\d{0,4}))$/, message: '金额格式不正确!' },
+            { pattern: /^(?:0|[1-9]\d*)(?:\.\d{1,4})?$/, message: '金额格式不正确!' },
           ],
         },
         depotId: {

+ 1 - 1
jshERP-web/src/views/material/MaterialList.vue

@@ -2,7 +2,7 @@
 <template>
   <a-row :gutter="24">
     <a-col :md="24">
-      <a-card :bordered="false">
+      <a-card :style="cardStyle" :bordered="false">
         <!-- 查询区域 -->
         <div class="table-page-search-wrapper">
           <!-- 搜索区域 -->

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

@@ -398,6 +398,10 @@ export default {
             dataIndex: 'batchNumber',
           },
           {
+            title: 'SKU',
+            dataIndex: 'sku',
+          },
+          {
             title: '单位',
             dataIndex: 'commodityUnit',
           },
@@ -585,10 +589,10 @@ export default {
           rules: [{ required: true, message: '请选择类别!' }],
         },
         defaultWholesaleDecimal: {
-          rules: [{ required: true, message: '请输入默认销售价!' }],
+          rules: [{ required: true, message: '请输入默认销售价!' },{ pattern: /^(?:0|[1-9]\d*)(?:\.\d{1,4})?$/, message: '金额格式不正确!' }],
         },
         defaultPurchaseDecimal: {
-          rules: [{ required: true, message: '请输入默认采购价!' }],
+          rules: [{ required: true, message: '请输入默认采购价!' },{ pattern: /^(?:0|[1-9]\d*)(?:\.\d{1,4})?$/, message: '金额格式不正确!' }],
         },
       },
       url: {

+ 1 - 1
jshERP-web/src/views/task/modules/FlowModal.vue

@@ -52,7 +52,7 @@
                 message: '请选择',
                 trigger: 'change',
               }:{}">
-                <a-select v-model="item.auditor" @change="changeAuditor($event,index)" allowClear placeholder="请选择" :disabled="item.auditorType==2||item.auditorType==3||isReadOnly" style="width: 100%;">
+                <a-select v-model="item.auditor" @change="changeAuditor($event,index)" allowClear placeholder="请选择" :disabled="item.auditorType!=1||isReadOnly" style="width: 100%;">
                   <a-select-option v-for="(item, index) in _userList" :disabled="item.disabled" :key="index" :value="item.id">
                     {{ item.userName }}
                   </a-select-option>

+ 3 - 8
src/main/java/com/jsh/erp/controller/pda/PdaController.java

@@ -16,7 +16,6 @@ import com.jsh.erp.datasource.vo.TaskStocktakingVO;
 import com.jsh.erp.datasource.vo.TreeNode;
 import com.jsh.erp.exception.BusinessRunTimeException;
 import com.jsh.erp.query.LambdaQueryWrapperX;
-import com.jsh.erp.query.QueryWrapperX;
 import com.jsh.erp.service.*;
 import com.jsh.erp.utils.StringUtil;
 import com.jsh.erp.utils.TreeNodeUtils;
@@ -131,7 +130,7 @@ public class PdaController extends BaseController {
         return AjaxResult.success(depotItemService.pdaDetail(id,depotId));
     }
 
-    @ApiOperation("商品库存详情")
+    @ApiOperation("采购、拣货 - 出入库明细")
     @GetMapping("/materialDepotDetail/{type}/{materialId}/{depotId}")
     public TableDataInfo materialDepotDetail(@PathVariable("type") String type, @PathVariable("materialId") Long materialId,@PathVariable("depotId") Long depotId) {
         startPage();
@@ -140,7 +139,7 @@ public class PdaController extends BaseController {
         } else {
             type = "出库";
         }
-        List<PDADepotItemVO> list = depotItemService.materialDepotDetail(type, materialId);
+        List<PDADepotItemVO> list = depotItemService.materialDepotDetail(type, materialId, depotId);
         return getDataTable(list);
     }
 
@@ -206,10 +205,6 @@ public class PdaController extends BaseController {
         if (materialBatch == null) {
             return AjaxResult.error("商品信息不存在");
         }
-//        TaskStocktakingItem item = taskStocktakingItemService.getById(taskStocktakingItem.getId());
-//        if (item != null && item.getStatus() > 1){
-//            return AjaxResult.error("该商品已盘点!");
-//        }
         UpdateWrapper<TaskStocktakingItem> updateWrapper = new UpdateWrapper<>();
         updateWrapper.eq("id", taskStocktakingItem.getId())
                 .set("creator", currentUser.getId())
@@ -356,7 +351,7 @@ public class PdaController extends BaseController {
     public AjaxResult goodsSave(@RequestBody MaterialInput materialInput) {
         boolean b = materialInputService.add(materialInput);
         if (!b){
-            return AjaxResult.success("保存失败");
+            return AjaxResult.error("保存失败");
         }
         return AjaxResult.success("保存成功");
     }

+ 9 - 8
src/main/java/com/jsh/erp/datasource/mappers/DepotItemMapper.java

@@ -1,6 +1,5 @@
 package com.jsh.erp.datasource.mappers;
 
-import com.jsh.erp.datasource.entities.DepotHead;
 import com.jsh.erp.datasource.entities.DepotItem;
 import com.jsh.erp.datasource.entities.DepotItemExample;
 import java.util.List;
@@ -14,28 +13,30 @@ public interface DepotItemMapper  extends BaseMapperX<DepotItem>{
     /**
      * 根据单据ID获取单据详情
      * @param id 订单ID
-     * @return
+     * @return 主表ID对应的子表详情列表
      */
     List<PDADepotItemVO> pdaList(@Param("id") Long id);
 
     /**
      * 根据商品订单ID获取单据详情
      * @param id 商品订单ID
-     * @return
+     * @return PDA主表
      */
     PDADepotItemVO pdaDetail(@Param("id") Long id);
 
     /**
-     * pda根据商品订单ID查询商品详情
+     * pda根据商品ID查询商品出入库订单详情
      * @param materialId 商品ID
-     * @return
+     * @return 商品出入库订单列表
      */
-    List<PDADepotItemVO> materialDepotDetail(@Param("type")String type, @Param("materialId") Long materialId);
+    List<PDADepotItemVO> materialDepotDetail(@Param("type")String type,
+                                             @Param("materialId") Long materialId,
+                                             @Param("depotId") Long depotId);
 
     /**
      * 根据单据子表id查询商品打印信息
-     * @param id
-     * @return
+     * @param id 单据子表ID
+     * @return  PDA打印信息
      */
     PDAPrintVo pdaPrintMaterial(@Param("id")Long id) ;
 

+ 0 - 7
src/main/java/com/jsh/erp/datasource/mappers/MaterialMapperEx.java

@@ -203,12 +203,5 @@ public interface MaterialMapperEx {
 
     List<MaterialCurrentStock4SystemSku> getMaterialCurrentPriceByIdList(@Param("idList") List<Long> idList);
 
-    /**
-     * 根据单据子表id查询打印信息
-     * @param depotItemId 单据子表id
-     * @return
-     */
-    PDAPrintVo pdaPrintMaterial(@Param("depotItemId") Long depotItemId);
-
 
 }

+ 6 - 0
src/main/java/com/jsh/erp/exception/GlobalExceptionHandler.java

@@ -1,6 +1,7 @@
 package com.jsh.erp.exception;
 
 import com.alibaba.fastjson.JSONObject;
+import com.jsh.erp.base.AjaxResult;
 import com.jsh.erp.constants.ExceptionConstants;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.bind.annotation.ExceptionHandler;
@@ -43,4 +44,9 @@ public class GlobalExceptionHandler {
     }
 
 
+    @ExceptionHandler(ServiceException.class)
+    public AjaxResult serviceException(ServiceException e){
+        return AjaxResult.error(e.getMsg());
+    }
+
 }

+ 21 - 0
src/main/java/com/jsh/erp/exception/ServiceException.java

@@ -0,0 +1,21 @@
+package com.jsh.erp.exception;
+
+
+/**
+ * 业务异常
+ */
+public class ServiceException extends RuntimeException {
+
+    private static final long serialVersionUID = 1L;
+
+    private String msg;
+
+    public ServiceException(String msg) {
+        super(msg);
+        this.msg = msg;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+}

+ 4 - 8
src/main/java/com/jsh/erp/service/DepotItemService.java

@@ -23,28 +23,26 @@ public interface DepotItemService extends IService<DepotItem> {
 
     /**
      * pda根据订单信息查询商品列表
-     * @return
      */
     List<PDADepotItemVO> pdaList(Long id) throws Exception;
 
     /**
      * pda根据商品订单ID查询商品详情
      * @param id 商品订单ID
-     * @return
      */
     PDADepotItemVO pdaDetail(Long id, Long depotId) throws Exception;
 
     /**
-     * 商品库存详情列表
+     * 出入库明细列表
+     * @param type 查询类型
      * @param materialId 商品ID
-     * @return
+     * @param depotId 仓库ID
      */
-    List<PDADepotItemVO> materialDepotDetail(String type, Long materialId);
+    List<PDADepotItemVO> materialDepotDetail(String type, Long materialId, Long depotId);
 
     /**
      * pda 获取商品打印条码信息
      * @param depotItemId 单据子表id
-     * @return
      */
     PDAPrintVo pdaPrintMaterial(Long depotItemId);
 
@@ -57,8 +55,6 @@ public interface DepotItemService extends IService<DepotItem> {
 
     List<DepotItem> select(String name, Integer type, String remark, int offset, int rows)throws Exception;
 
-    Long countDepotItem(String name, Integer type, String remark) throws Exception;
-
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     int insertDepotItem(JSONObject obj, HttpServletRequest request)throws Exception;
 

+ 53 - 55
src/main/java/com/jsh/erp/service/impl/AuditServiceImpl.java

@@ -8,9 +8,7 @@ import com.jsh.erp.datasource.dto.AuditQueryDTO;
 import com.jsh.erp.datasource.dto.MaterialDTO;
 import com.jsh.erp.datasource.dto.MaterialExtendDTO;
 import com.jsh.erp.datasource.entities.*;
-import com.jsh.erp.datasource.mappers.AuditMapper;
-import com.jsh.erp.datasource.mappers.AuditNodeConfigMapper;
-import com.jsh.erp.datasource.mappers.AuditNodeMapper;
+import com.jsh.erp.datasource.mappers.*;
 import com.jsh.erp.datasource.pda.dto.PDADepotHeadDTO;
 import com.jsh.erp.datasource.pda.vo.PDADepotHeadVO;
 import com.jsh.erp.datasource.vo.AuditNodeVo;
@@ -40,23 +38,24 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
 
     private final AuditNodeMapper auditNodeMapper;
 
-    private final AuditProcessService auditProcessService;
+    private final AuditProcessMapper auditProcessMapper;
 
     private final UserService userService;
 
     @Resource
+    private MaterialService materialService;
+    @Resource
     private MaterialBatchService materialBatchService;
     @Resource
-    private TaskStocktakingService taskStocktakingService;
+    private DepotHeadService depotHeadService;
     @Resource
     private MaterialInputService materialInputService;
     @Resource
-    private MaterialService materialService;
-    @Resource
-    private DepotHeadService depotHeadService;
+    private TaskStocktakingService taskStocktakingService;
 
     /**
      * 根据审核业务单号和类型生成审核实例及节点实例
+     *
      * @param businessNumber 业务单号
      */
     @Override
@@ -65,24 +64,24 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
         try {
             //针对重新提交申请,获取失败审核
             Audit a = getOne(new LambdaQueryWrapperX<Audit>()
-                    .eq(Audit::getBusinessNumber,businessNumber)
-                    .eq(Audit::getAuditStatus,2)
-                    .eq(Audit::getDeleteFlag,false));
-            if (a != null){
+                    .eq(Audit::getBusinessNumber, businessNumber)
+                    .eq(Audit::getAuditStatus, 2)
+                    .eq(Audit::getDeleteFlag, false));
+            if (a != null) {
                 //删除审核
-                update(new UpdateWrapper<Audit>().set("delete_flag",true).eq("id",a.getId()));
+                update(new UpdateWrapper<Audit>().set("delete_flag", true).eq("id", a.getId()));
             }
             //获取业务id
-            Long bid = null;
-            if (type.equals("盘点任务")){
-                bid = taskStocktakingService.getOne(new LambdaQueryWrapperX<TaskStocktaking>().eq(TaskStocktaking::getNumber,businessNumber)).getId();
-            }else if (type.equals("pda维护商品")){
-                bid = materialInputService.getOne(new LambdaQueryWrapperX<MaterialInput>().eq(MaterialInput::getNumber,businessNumber)).getId();
-            }else {
+            Long bid;
+            if (type.equals("盘点任务")) {
+                bid = taskStocktakingService.getOne(new LambdaQueryWrapperX<TaskStocktaking>().eq(TaskStocktaking::getNumber, businessNumber)).getId();
+            } else if (type.equals("pda维护商品")) {
+                bid = materialInputService.getOne(new LambdaQueryWrapperX<MaterialInput>().eq(MaterialInput::getNumber, businessNumber)).getId();
+            } else {
                 bid = depotHeadService.getDepotHead(businessNumber).getId();
             }
             //获取审核流程
-            AuditProcess auditProcess = auditProcessService.getOne(new LambdaQueryWrapperX<AuditProcess>()
+            AuditProcess auditProcess = auditProcessMapper.selectOne(new LambdaQueryWrapperX<AuditProcess>()
                     .eq(AuditProcess::getType, type)
                     .eq(AuditProcess::getDeleteFlag, false));
             //判断是否有审核流程
@@ -102,11 +101,11 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
                 AuditNodeConfig auditNodeConfig = auditNodeConfigMapper.selectOne(new LambdaQueryWrapperX<AuditNodeConfig>()
                         .eq(AuditNodeConfig::getProcessId, auditProcess.getId())
                         .eq(AuditNodeConfig::getNodeOrder, 1));
-                AuditNode auditNode = buildAuditNode(audit.getId(), auditNodeConfig, user);
+                AuditNode auditNode = buildAuditNode(audit.getId(), auditNodeConfig, user.getId());
                 auditNodeMapper.insert(auditNode);
             } else {
                 //无审核流程,直接通过
-                approved(bid,type);
+                approved(bid, type);
             }
         } catch (Exception e) {
             log.error("创建审核流程失败", e);
@@ -124,9 +123,7 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
         auditQueryDTO.setUid(user.getId());
         PageUtils.startPage();
         List<AuditVo> list = auditMapper.pendingApprovalList(auditQueryDTO);
-        list.forEach(v -> {
-            v.setAuditorName(user.getUsername());
-        });
+        list.forEach(v -> v.setAuditorName(user.getUsername()) );
         return list;
     }
 
@@ -136,8 +133,7 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
     @Override
     public Long pendingApprovalCount() {
         User user = userService.getCurrentUser();
-        Long count =auditNodeMapper.selectCount(AuditNode::getAuditorUser,user.getId(),AuditNode::getAuditResult,0);
-        return count;
+        return auditNodeMapper.selectCount(AuditNode::getAuditorUser, user.getId(), AuditNode::getAuditResult, 0);
     }
 
     /**
@@ -149,9 +145,7 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
         auditQueryDTO.setUid(user.getId());
         PageUtils.startPage();
         List<AuditVo> list = auditMapper.processedApprovalList(auditQueryDTO);
-        list.forEach(v -> {
-            v.setAuditorName(user.getUsername());
-        });
+        list.forEach(v -> v.setAuditorName(user.getUsername()));
         return list;
     }
 
@@ -164,9 +158,7 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
         auditQueryDTO.setUid(user.getId());
         PageUtils.startPage();
         List<AuditVo> list = auditMapper.myApprovalList(auditQueryDTO);
-        list.forEach(v -> {
-            v.setInitiatorName(user.getUsername());
-        });
+        list.forEach(v -> v.setInitiatorName(user.getUsername()));
         return list;
     }
 
@@ -180,7 +172,8 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
 
     /**
      * 设置审核状态
-     * @param auditDTO
+     *
+     * @param auditDTO 审核参数
      */
     @Override
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
@@ -202,14 +195,16 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
             AuditNodeConfig auditNodeConfig = auditNodeConfigMapper.getAuditNodeConfigByAuditIdAndOrder(auditDTO.getId(), auditNode.getNodeOrder());
             if (auditNodeConfig != null && auditNodeConfig.getAuditorType() != null) {
                 //有,根据节点配置生成下一节点
-                AuditNode newAuditNode = buildAuditNode(auditDTO.getId(), auditNodeConfig, user);
+                //发起审核用户ID
+                Long uid = getById(auditDTO.getId()).getSubmitUser();
+                AuditNode newAuditNode = buildAuditNode(auditDTO.getId(), auditNodeConfig, uid);
                 auditNodeMapper.insert(newAuditNode);
             } else {
                 //无下一节点,审核阶段结束,修改对应审核内容状态
                 //修改审核状态
                 this.update(new UpdateWrapper<Audit>().set("audit_status", 1).eq("id", auditDTO.getId()));
                 Audit audit = auditMapper.selectById(auditDTO.getId());
-                approved(audit.getBusinessId(),audit.getType());
+                approved(audit.getBusinessId(), audit.getType());
             }
         } else {
             //审批未通过
@@ -218,11 +213,11 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
             //修改单据状态
             Audit audit = auditMapper.selectById(auditDTO.getId());
             Long businessId = audit.getBusinessId();
-            if (audit.getType().equals("盘点任务")){
-                taskStocktakingService.update(new UpdateWrapper<TaskStocktaking>().set("task_status",8).eq("id",businessId));
-            }else if (audit.getType().equals("pda维护商品")){
-                materialInputService.update(new UpdateWrapper<MaterialInput>().set("status",8).eq("id",businessId));
-            }else {
+            if (audit.getType().equals("盘点任务")) {
+                taskStocktakingService.update(new UpdateWrapper<TaskStocktaking>().set("task_status", 8).eq("id", businessId));
+            } else if (audit.getType().equals("pda维护商品")) {
+                materialInputService.update(new UpdateWrapper<MaterialInput>().set("status", 8).eq("id", businessId));
+            } else {
                 depotHeadService.update(new UpdateWrapper<DepotHead>().set("status", 8).eq("id", businessId));
             }
         }
@@ -231,21 +226,22 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
 
     /**
      * pda复核任务列表
-     * @param pdaDepotHeadDTO
+     *
+     * @param pdaDepotHeadDTO  筛选条件
      */
     @Override
     public List<PDADepotHeadVO> pdaList(PDADepotHeadDTO pdaDepotHeadDTO) {
-        List<PDADepotHeadVO> list = auditMapper.pdaList(pdaDepotHeadDTO);
-        return list;
+        return auditMapper.pdaList(pdaDepotHeadDTO);
     }
 
     /**
      * 根据节点配置构建审核节点实例
+     *
      * @param aid             审核id
      * @param auditNodeConfig 审核节点配置
-     * @param user            当前用户
+     * @param uid            发起用户id
      */
-    private AuditNode buildAuditNode(Long aid, AuditNodeConfig auditNodeConfig, User user) {
+    private AuditNode buildAuditNode(Long aid, AuditNodeConfig auditNodeConfig, Long uid) {
         AuditNode auditNode = new AuditNode();
         auditNode.setAuditId(aid);
         auditNode.setNodeId(auditNodeConfig.getId());
@@ -253,7 +249,7 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
         if (auditNodeConfig.getAuditor() == null) {
             if (auditNodeConfig.getAuditorType().equals(2)) {
                 //上级部门最高领导审核
-                Long id = userService.getAuditUserIds(user.getId(), true);
+                Long id = userService.getAuditUserIds(uid, true);
                 if (id == null) {
                     throw new BusinessRunTimeException(ExceptionConstants.AUDIT_APPROVAL_HIGHER_DEPARTMENTS_LEADER_IS_NOT_EXIST_CODE,
                             ExceptionConstants.AUDIT_APPROVAL_HIGHER_DEPARTMENTS_LEADER_IS_NOT_EXIST_MSG);
@@ -261,7 +257,7 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
                 auditNode.setAuditorUser(id);
             } else if (auditNodeConfig.getAuditorType().equals(3)) {
                 //本部门最高领导审核
-                Long id = userService.getAuditUserIds(user.getId(), false);
+                Long id = userService.getAuditUserIds(uid, false);
                 if (id == null) {
                     throw new BusinessRunTimeException(ExceptionConstants.AUDIT_APPROVAL_DEPARTMENT_LEADER_IS_NOT_EXIST_CODE,
                             ExceptionConstants.AUDIT_APPROVAL_DEPARTMENT_LEADER_IS_NOT_EXIST_MSG);
@@ -277,16 +273,17 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
 
     /**
      * 审批通过,处理对应业务
+     *
      * @param businessId 业务id
-     * @param type 业务类型
+     * @param type       业务类型
      */
     private void approved(Long businessId, String type) {
-        if (type.equals("盘点任务")){
-            taskStocktakingService.update(new UpdateWrapper<TaskStocktaking>().set("task_status",1).eq("id",businessId));
-        }else if (type.equals("pda维护商品")){
-            materialInputService.update(new UpdateWrapper<MaterialInput>().set("status",1).eq("id",businessId));
+        if (type.equals("盘点任务")) {
+            taskStocktakingService.update(new UpdateWrapper<TaskStocktaking>().set("task_status", 1).eq("id", businessId));
+        } else if (type.equals("pda维护商品")) {
+            materialInputService.update(new UpdateWrapper<MaterialInput>().set("status", 1).eq("id", businessId));
             materialInputApproved(businessId);
-        }else {
+        } else {
             //单据处理
             depotHeadService.update(new UpdateWrapper<DepotHead>().set("status", 1).eq("id", businessId));
             materialBatchService.generateMaterialBatchByDepotHeadId(businessId);
@@ -295,6 +292,7 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
 
     /**
      * 单据审核通过 处理商品录入信息
+     *
      * @param id 单据主表id
      */
     private void materialInputApproved(Long id) {
@@ -334,7 +332,7 @@ public class AuditServiceImpl extends ServiceImpl<AuditMapper, Audit> implements
         List<MaterialInitialStock> initialStockList = new ArrayList<>();
         initialStockList.add(materialInitialStock);
         materialDTO.setStock(initialStockList);
-        materialService.insertMaterial(materialDTO,null);
+        materialService.insertMaterial(materialDTO, null);
     }
 
 }

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

@@ -50,6 +50,9 @@ public class DepotHeadServiceImpl extends ServiceImpl<DepotHeadMapper, DepotHead
     @Resource
     private DepotHeadMapperEx depotHeadMapperEx;
     @Resource
+    DepotItemMapperEx depotItemMapperEx;
+
+    @Resource
     private UserService userService;
     @Resource
     private RoleService roleService;
@@ -77,8 +80,7 @@ public class DepotHeadServiceImpl extends ServiceImpl<DepotHeadMapper, DepotHead
     private AccountItemService accountItemService;
     @Resource
     private SequenceService sequenceService;
-    @Resource
-    DepotItemMapperEx depotItemMapperEx;
+
     @Resource
     private LogService logService;
     @Resource

+ 7 - 23
src/main/java/com/jsh/erp/service/impl/DepotItemServiceImpl.java

@@ -51,8 +51,6 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
     @Resource
     private MaterialExtendService materialExtendService;
     @Resource
-    private SerialNumberMapperEx serialNumberMapperEx;
-    @Resource
     private DepotHeadService depotHeadService;
     @Resource
     private DepotHeadMapper depotHeadMapper;
@@ -71,8 +69,6 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
     @Resource
     private MaterialCurrentStockMapperEx materialCurrentStockMapperEx;
     @Resource
-    private MaterialMapperEx materialMapperEx;
-    @Resource
     private SyncTescoSystemService syncTescoSystemService;
     @Resource
     private MaterialBatchService materialBatchService;
@@ -118,13 +114,14 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
     }
 
     /**
-     * 商品库存详情列表
+     * 出入库明细列表
+     * @param type 查询类型
      * @param materialId 商品ID
-     * @return
+     * @param depotId 仓库ID
      */
     @Override
-    public List<PDADepotItemVO> materialDepotDetail(String type , Long materialId) {
-        return depotItemMapper.materialDepotDetail(type, materialId);
+    public List<PDADepotItemVO> materialDepotDetail(String type , Long materialId, Long depotId) {
+        return depotItemMapper.materialDepotDetail(type, materialId,depotId);
     }
 
     /**
@@ -134,7 +131,7 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
      */
     @Override
     public PDAPrintVo pdaPrintMaterial(Long depotItemId) {
-        return materialMapperEx.pdaPrintMaterial(depotItemId);
+        return depotItemMapper.pdaPrintMaterial(depotItemId);
     }
 
     /**
@@ -175,7 +172,7 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
         return list;
     }
 
-    @Override
+
     public Long countDepotItem(String name, Integer type, String remark) throws Exception{
         Long result =null;
         try{
@@ -1127,9 +1124,7 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
                 BusinessConstants.SUB_TYPE_DISASSEMBLE.equals(subType)) {
             if(depotItems.size() > 1) {
                 DepotItem firstItem = depotItems.get(0);
-//                JSONObject firstRowObj = JSONObject.parseObject(rowArr.getString(0));
                 DepotItem secondItem = depotItems.get(1);
-//                JSONObject secondRowObj = JSONObject.parseObject(rowArr.getString(1));
                 String firstMaterialType = firstItem.getMaterialType();
                 String secondMaterialType = secondItem.getMaterialType();
                 if(!"组合件".equals(firstMaterialType) || !"普通子件".equals(secondMaterialType)) {
@@ -1766,15 +1761,4 @@ public class DepotItemServiceImpl extends ServiceImpl<DepotItemMapper, DepotItem
         return materialOther;
     }
 
-    //删除前回复库存
-    private void ReplyInventoryByHeadId(Long id) throws Exception {
-        DepotHead depotHead = depotHeadService.getDepotHead(id);
-        List<DepotItem> list = getListByHeaderId(id);
-        for (DepotItem depotItem : list) {
-            if (depotHead.getType().equals("入库")){
-
-            }
-        }
-    }
-
 }

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

@@ -6,6 +6,7 @@ import com.jsh.erp.constants.BusinessConstants;
 import com.jsh.erp.constants.ExceptionConstants;
 import com.jsh.erp.datasource.entities.*;
 import com.jsh.erp.datasource.mappers.MaterialBatchMapper;
+import com.jsh.erp.datasource.mappers.MaterialExtendMapper;
 import com.jsh.erp.datasource.mappers.MaterialInitialStockMapper;
 import com.jsh.erp.datasource.vo.TaskStocktakingItemVO;
 import com.jsh.erp.exception.BusinessRunTimeException;
@@ -33,17 +34,19 @@ public class MaterialBatchServiceImpl extends ServiceImpl<MaterialBatchMapper,Ma
     @Resource
     private MaterialBatchMapper materialBatchMapper;
     @Resource
-    private UserService userService;
+    private MaterialExtendMapper materialExtendMapper;
     @Resource
-    private DepotItemService depotItemService;
+    private MaterialInitialStockMapper materialInitialStockMapper;
+
     @Resource
-    private MaterialExtendService materialExtendService;
+    private UserService userService;
     @Resource
-    private InventoryLogService inventoryLogService;
+    private DepotHeadService depotHeadService;
     @Resource
-    private MaterialInitialStockMapper materialInitialStockMapper;
+    private DepotItemService depotItemService;
     @Resource
-    private DepotHeadService depotHeadService;
+    private InventoryLogService inventoryLogService;
+
 
     /**
      * 根据单据子表生成商品批次数据
@@ -51,7 +54,7 @@ public class MaterialBatchServiceImpl extends ServiceImpl<MaterialBatchMapper,Ma
     @Override
     public void generateMaterialBatchByDepotItemId(DepotItem depotItem, Long supplierId) {
         //获取条码信息
-        MaterialExtend materialExtend = materialExtendService.getMaterialExtend(depotItem.getMaterialExtendId());
+        MaterialExtend materialExtend = materialExtendMapper.selectByPrimaryKey(depotItem.getMaterialExtendId());
         //创建批次信息
         MaterialBatch materialBatch = new MaterialBatch();
         //设置单据id
@@ -233,7 +236,6 @@ public class MaterialBatchServiceImpl extends ServiceImpl<MaterialBatchMapper,Ma
         if (barCodes != null && !barCodes.isEmpty()){
             barCodeList = Arrays.asList(barCodes.split(","));
         }
-        //List<Long> ids = materialExtendService.selectIdsByBarCode(barCodeList);
         List<MaterialBatch> list = materialBatchMapper.selectList(new LambdaQueryWrapperX<MaterialBatch>().eq(MaterialBatch::getDepotId,depotId).inIfPresent(MaterialBatch::getSku,barCodeList).gt(MaterialBatch::getInventory,BigDecimal.ZERO));
         return list;
     }

+ 9 - 0
src/main/java/com/jsh/erp/service/impl/MaterialInputServiceImpl.java

@@ -2,9 +2,12 @@ package com.jsh.erp.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jsh.erp.datasource.dto.MaterialInputDto;
+import com.jsh.erp.datasource.entities.AuditProcess;
 import com.jsh.erp.datasource.entities.MaterialInput;
 import com.jsh.erp.datasource.entities.User;
+import com.jsh.erp.datasource.mappers.AuditProcessMapper;
 import com.jsh.erp.datasource.mappers.MaterialInputMapper;
+import com.jsh.erp.exception.ServiceException;
 import com.jsh.erp.query.LambdaQueryWrapperX;
 import com.jsh.erp.service.AuditService;
 import com.jsh.erp.service.MaterialInputService;
@@ -23,6 +26,8 @@ public class MaterialInputServiceImpl extends ServiceImpl<MaterialInputMapper,Ma
 
     @Resource
     private MaterialInputMapper materialInputMapper;
+    @Resource
+    private AuditProcessMapper auditProcessMapper;
 
     @Resource
     private SequenceService sequenceService;
@@ -42,6 +47,10 @@ public class MaterialInputServiceImpl extends ServiceImpl<MaterialInputMapper,Ma
     @Override
     @Transactional(value = "transactionManager", rollbackFor = Exception.class)
     public boolean add(MaterialInput materialInput) {
+        AuditProcess auditProcess = auditProcessMapper.selectOne(new LambdaQueryWrapperX<AuditProcess>().eq(AuditProcess::getType,"pda维护商品").eq(AuditProcess::getDeleteFlag,false));
+        if (auditProcess == null){
+            throw new ServiceException("pda录入商品当前没有审核流程,录入失败!");
+        }
         try{
             //生成单据编号
             materialInput.setNumber("HWLR" + sequenceService.buildOnlyNumber());

+ 141 - 125
src/main/java/com/jsh/erp/service/impl/MaterialServiceImpl.java

@@ -634,22 +634,29 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
             //遇到多个副条码的情况,只加第一个
             otherMaterialMap.putIfAbsent(me.getMaterialId(), me);
         }
-        String nameStr = "名称*,规格,型号,颜色,品牌,类别,基础重量(kg),基本单位*,副单位,比例,多属性," +
-                "状态*,序列号,系统sku,商品条码,默认采购价,默认销售价,自定义1,自定义2,自定义3,备注";
-        List<String> nameList = StringUtil.strToStringList(nameStr);
+        //仓库1名
+        String depotName1 = "仓库1";
+        //仓库2名
+        String depotName2 = "仓库2";
         //仓库列表
         List<Depot> depotList = depotService.getAllList();
-//        if (nameList != null) {
-//            for(Depot depot: depotList) {
-//                nameList.add(depot.getName());
-//            }
-//        }
+        depotName1 = depotList.get(0).getName();
+        if (depotList.size() > 1){
+            depotName2 = depotList.get(1).getName();
+        }
+//        String nameStr = "名称*,规格,型号,颜色,品牌,类别,基础重量(kg),基本单位*,副单位,比例,多属性," +
+//                "状态*,序列号,系统sku,商品条码,默认采购价,默认销售价,自定义1,自定义2,自定义3,备注";
+        String nameStr = "SPU编码(可留空),SKU编码(可留空),商品名称(SPU级)*,品牌,类目*,商品效期," + depotName1 + "*," + depotName2 + ",规格*,默认采购价*,默认销售价*," +
+                "基础单位*,是否启用*,UPC1*,UPC2,UPC3,UPC4,UPC5,单位1,单位1换算关系,单位2,单位2换算关系,单位3,单位3换算关系,单位4,单位4换算关系,单位5,单位5换算关系";
+        List<String> nameList = StringUtil.strToStringList(nameStr);
         //期初库存缓存
         List<MaterialInitialStock> misList = materialInitialStockMapperEx.getListExceptZero();
-        Map<String, BigDecimal> misMap = new HashMap<>();
+        Map<String, String> misMap = new HashMap<>();
         if (misList != null) {
             for (MaterialInitialStock mis : misList) {
-                misMap.put(mis.getMaterialId() + "_" + mis.getDepotId(), mis.getNumber());
+                String str = mis.getNumber().toString();
+                str += mis.getPosition() == null ? "" : "," + mis.getPosition();
+                misMap.put(mis.getMaterialId() + "_" + mis.getDepotId(), str);
             }
         }
         String[] names = StringUtil.listToStringArray(nameList);
@@ -658,34 +665,42 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
         if (null != dataList) {
             for (MaterialVo4Unit m : dataList) {
                 String[] objs = new String[names.length];
-                objs[0] = m.getName();
-                objs[1] = m.getStandard();
-                objs[2] = m.getModel();
-                objs[3] = m.getColor();
-                objs[4] = m.getBrand();
-                objs[5] = m.getCategoryName();
-                objs[6] = m.getWeight() == null ? "" : m.getWeight().setScale(3, BigDecimal.ROUND_HALF_UP).toString();
-                objs[7] = m.getCommodityUnit();
-                objs[8] = otherMaterialMap.get(m.getId()) == null ? "" : otherMaterialMap.get(m.getId()).getCommodityUnit();
-                objs[9] = m.getRatio() == null ? "" : m.getRatio().toString();
-                objs[10] = m.getSku();
-                objs[11] = m.getEnabled() ? "1" : "0";
-                objs[12] = m.getEnableSerialNumber();
-                objs[13] = m.getSystemSpu();
-                objs[14] = m.getBarCode();
-                objs[15] = m.getDefaultPurchaseDecimal() == null ? "" : m.getDefaultPurchaseDecimal().toString();
-                objs[16] = m.getDefaultWholesaleDecimal() == null ? "" : m.getDefaultWholesaleDecimal().toString();
-                objs[17] = m.getOtherField1();
-                objs[18] = m.getOtherField2();
-                objs[19] = m.getOtherField3();
-                objs[20] = m.getRemark();
-                //仓库期初库存
-                int i = 21;
-//                for(Depot depot: depotList) {
-//                    BigDecimal number = misMap.get(m.getId() + "_" + depot.getId());
-//                    objs[i] = number == null ? "0" : number.setScale(2, BigDecimal.ROUND_HALF_UP).toString();
-//                    i++;
-//                }
+                objs[0] = m.getSystemSpu();
+                objs[1] = m.getSku();
+                objs[2] = m.getName();
+                objs[3] = m.getBrand();
+                objs[4] = m.getCategoryName();
+                objs[5] = m.getExpiryNum().toString();
+                //仓库
+                objs[6] = misMap.get(m.getId() + "_" + depotList.get(0).getId());
+                objs[7] = depotList.get(1) == null ? "" : misMap.get(m.getId() + "_" + depotList.get(1).getId());
+                objs[8] = m.getStandard();
+                objs[9] = m.getDefaultPurchaseDecimal().toString();
+                objs[10] = m.getDefaultWholesaleDecimal().toString();
+                objs[11] = m.getCommodityUnit();
+                objs[12] = m.getEnabled() ? "是" : "否";
+                //upc
+                List<MaterialUpc> upcList = materialUpcService.list(new LambdaQueryWrapperX<MaterialUpc>()
+                        .eq(MaterialUpc::getMaterialExtendId,m.getMeId())
+                        .eq(MaterialUpc::getDeleteFlag,false));
+                for (int i = 0; i <= 5; i++) {
+                    if (i == upcList.size()){
+                        break;
+                    }
+                    objs[13 + i] = upcList.get(i).getUpc();
+                }
+                //单位
+                List<MaterialUnit> unitList = materialUnitService.list(new LambdaQueryWrapperX<MaterialUnit>()
+                        .eq(MaterialUnit::getMaterialExtendId,m.getMeId())
+                        .eq(MaterialUnit::getDeleteFlag,false));
+                for (int i = 1; i < 5; i++) {
+                    if (i == unitList.size()){
+                        break;
+                    }
+                    int index = i * 2;
+                    objs[17 - 1 + index ] = unitList.get(i).getName();
+                    objs[17 + index ] = unitList.get(i).getRatio().toString();
+                }
                 objects.add(objs);
             }
         }
@@ -1263,18 +1278,19 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
             materialExtend.setCreateSerial(user.getLoginName());
             materialExtend.setUpdateSerial(user.getLoginName());
             Long meId = 0L;
-            if(StringUtil.isNotEmpty(materialExtend.getSku())){
-                //含sku的商品,特殊逻辑
-                meId = materialExtendService.selectIdByMaterialIdAndBarCode(mId, materialExtend.getBarCode());
-                List<MaterialExtend> meList = materialExtendService.getListByMaterialIdAndDefaultFlagAndBarCode(mId, "1", materialExtend.getBarCode());
-                if(meList.size() == 0) {
-                    materialExtend.setDefaultFlag("1");
-                } else {
-                    materialExtend.setDefaultFlag("0");
-                }
-            } else {
-                meId = materialExtendService.selectIdByMaterialIdAndDefaultFlag(mId, defaultFlag);
-            }
+//            if(StringUtil.isNotEmpty(materialExtend.getSku())){
+//                //含sku的商品,特殊逻辑
+//                meId = materialExtendService.selectIdByMaterialIdAndBarCode(mId, materialExtend.getBarCode());
+//                List<MaterialExtend> meList = materialExtendService.getListByMaterialIdAndDefaultFlagAndBarCode(mId, "1", materialExtend.getBarCode());
+//                if(meList.size() == 0) {
+//                    materialExtend.setDefaultFlag("1");
+//                } else {
+//                    materialExtend.setDefaultFlag("0");
+//                }
+//            } else {
+//                meId = materialExtendService.selectIdByMaterialIdAndDefaultFlag(mId, defaultFlag);
+//            }
+            meId = materialExtendService.selectIdByMaterialIdAndDefaultFlag(mId, defaultFlag);
             if(meId==0L){
                 materialExtendMapper.insertSelective(materialExtend);
             } else {
@@ -2263,79 +2279,79 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
     /**
      * 解析excel表格数据为商品对象
      */
-    private 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();
-            if (materialMap.get(str) == null) {
-                //商品主表不存在,创建商品主表
-                Material material = m;
-//                //名称
-//                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.setCategoryId(m.getCategoryId());
-//                //单位-单个
-//                material.setUnit(m.getUnit());
-//                //计量单位Id
-//                material.setUnitId(m.getUnitId());
-//                //备注
-//                material.setRemark(m.getRemark());
-//                //基础重量
-//                material.setWeight(m.getWeight());
-//                //启用 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);
-                material.setDepotMap(m.getDepotMap());
-                materialMap.put(str,material);
-            }
-            //添加子表信息
-            MaterialExtend materialExtend = new MaterialExtend();
-            //商品单位
-            materialExtend.setCommodityUnit(basicObj.getString("commodityUnit"));
-            //商品属性
-            materialExtend.setSku(materialSku);
-            //商品条码
-            materialExtend.setBarCode(basicObj.getString("barCode"));
-
-            materialMap.get(str).getList().add(materialExtend);
-        }
-        materialMap.values().forEach(v -> materials.add(v));
-        return materials;
-    }
+//    private 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();
+//            if (materialMap.get(str) == null) {
+//                //商品主表不存在,创建商品主表
+//                Material material = m;
+////                //名称
+////                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.setCategoryId(m.getCategoryId());
+////                //单位-单个
+////                material.setUnit(m.getUnit());
+////                //计量单位Id
+////                material.setUnitId(m.getUnitId());
+////                //备注
+////                material.setRemark(m.getRemark());
+////                //基础重量
+////                material.setWeight(m.getWeight());
+////                //启用 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);
+//                material.setDepotMap(m.getDepotMap());
+//                materialMap.put(str,material);
+//            }
+//            //添加子表信息
+//            MaterialExtend materialExtend = new MaterialExtend();
+//            //商品单位
+//            materialExtend.setCommodityUnit(basicObj.getString("commodityUnit"));
+//            //商品属性
+//            materialExtend.setSku(materialSku);
+//            //商品条码
+//            materialExtend.setBarCode(basicObj.getString("barCode"));
+//
+//            materialMap.get(str).getList().add(materialExtend);
+//        }
+//        materialMap.values().forEach(v -> materials.add(v));
+//        return materials;
+//    }
 }

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

@@ -54,10 +54,11 @@ public class TaskStocktakingServiceImpl extends ServiceImpl<TaskStocktakingMappe
 
     private final MaterialBatchMapper materialBatchMapper;
 
-    private final AuditService auditService;
-
     private final MaterialUpcMapper materialUpcMapper;
 
+    @Resource
+    private AuditService auditService;
+
     @Override
     public List<TaskStocktakingVO> listBy(TaskStocktakingQueryDTO taskStocktakingQueryDTO) {
         return taskStocktakingMapper.listBy(taskStocktakingQueryDTO);

+ 26 - 2
src/main/resources/mapper_xml/DepotItemMapper.xml

@@ -33,8 +33,8 @@
     <result column="reason_of_difference" jdbcType="VARCHAR" property="reasonOfDifference" />
     <result column="warehousing_user" jdbcType="VARCHAR" property="warehousingUser" />
     <result column="warehousing_time" jdbcType="DATE" property="warehousingTime" />
-
   </resultMap>
+
   <sql id="Example_Where_Clause">
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -64,6 +64,7 @@
       </foreach>
     </where>
   </sql>
+
   <sql id="Update_By_Example_Where_Clause">
     <where>
       <foreach collection="example.oredCriteria" item="criteria" separator="or">
@@ -93,12 +94,14 @@
       </foreach>
     </where>
   </sql>
+
   <sql id="Base_Column_List">
     id, header_id, material_id, material_extend_id, material_unit, sku, oper_number, 
     basic_number, unit_price, purchase_unit_price, tax_unit_price, all_price, remark, 
     depot_id, another_depot_id, tax_rate, tax_money, tax_last_money, material_type, sn_list, 
     batch_number, expiration_date, link_id, tenant_id, delete_flag,production_date,expiry_num,position,wholesale_decimal
   </sql>
+
   <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="BaseResultMap">
     select
     <if test="distinct">
@@ -113,22 +116,26 @@
       order by ${orderByClause}
     </if>
   </select>
+
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     select 
     <include refid="Base_Column_List" />
     from jsh_depot_item
     where id = #{id,jdbcType=BIGINT}
   </select>
+
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
     delete from jsh_depot_item
     where id = #{id,jdbcType=BIGINT}
   </delete>
+
   <delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample">
     delete from jsh_depot_item
     <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
   </delete>
+
   <insert id="insert" parameterType="com.jsh.erp.datasource.entities.DepotItem">
     insert into jsh_depot_item (id, header_id, material_id, 
       material_extend_id, material_unit, sku, 
@@ -367,12 +374,14 @@
       </if>
     </trim>
   </insert>
-    <select id="countByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultType="java.lang.Long">
+
+  <select id="countByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultType="java.lang.Long">
     select count(*) from jsh_depot_item
     <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
   </select>
+
   <update id="updateByExampleSelective" parameterType="map">
     update jsh_depot_item
     <set>
@@ -456,6 +465,7 @@
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
+
   <update id="updateByExample" parameterType="map">
     update jsh_depot_item
     set id = #{record.id,jdbcType=BIGINT},
@@ -487,6 +497,7 @@
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
+
   <update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.DepotItem">
     update jsh_depot_item
     <set>
@@ -565,6 +576,7 @@
     </set>
     where id = #{id,jdbcType=BIGINT}
   </update>
+
   <update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.DepotItem">
     update jsh_depot_item
     set header_id = #{headerId,jdbcType=BIGINT},
@@ -671,8 +683,20 @@
       AND dh.delete_flag = '0'
       AND dh.status in ('1','2','3')
       AND dh.type = #{type}
+      AND dh.depot_id = #{depotId}
       AND di.material_id = #{materialId}
   </select>
 
+  <select id="pdaPrintMaterial" parameterType="java.lang.Long" resultType="com.jsh.erp.datasource.pda.vo.PDAPrintVo">
+    SELECT s.supplier customerName,dh.number,m.system_spu barCode,mb.batch_number
+    FROM
+    jsh_depot_item di
+    LEFT JOIN jsh_depot_head dh ON di.header_id = dh.id
+    LEFT JOIN jsh_material m ON di.material_id = m.id
+    LEFT JOIN jsh_supplier s ON dh.organ_id = s.id
+    LEFT JOIN material_batch mb ON (SELECT id FROM jsh_depot_item WHERE link_id = di.id LIMIT 1) = mb.depot_item_id
+    WHERE di.id = #{depotItemId}
+  </select>
+
 
 </mapper>

+ 1 - 1
src/main/resources/mapper_xml/MaterialExtendMapperEx.xml

@@ -7,7 +7,7 @@
 
     <select id="getDetailList" parameterType="com.jsh.erp.datasource.entities.MaterialExtendExample" resultType="com.jsh.erp.datasource.vo.MaterialExtendVo">
         select
-          id,commodity_unit,sku,default_flag,bar_code,standard,color,weight,model,enabled
+          id,commodity_unit,sku,default_flag,standard,color,weight,model,enabled
         from jsh_material_extend
         where material_id = #{materialId}
         and ifnull(delete_flag,'0') !='1'

+ 1 - 1
src/main/resources/mapper_xml/MaterialInitialStockMapperEx.xml

@@ -23,7 +23,7 @@
   </select>
 
   <select id="getListExceptZero" resultType="com.jsh.erp.datasource.entities.MaterialInitialStock">
-      select * from jsh_material_initial_stock where number!=0
+      select * from jsh_material_initial_stock where number != 0 OR IFNULL(position,"") != ""
       and ifnull(delete_flag,'0') !='1'
   </select>
 

+ 6 - 13
src/main/resources/mapper_xml/MaterialMapperEx.xml

@@ -467,8 +467,12 @@
     </select>
 
     <select id="exportExcel" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultType="com.jsh.erp.datasource.entities.MaterialVo4Unit">
-        select m.*,u.name unitName, u.ratio, mc.name categoryName,me.bar_code,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
+        select m.*,
+        u.name unitName, u.ratio,
+        mc.name categoryName,
+        me.id AS meId,me.bar_code,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
         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'
@@ -949,15 +953,4 @@
         ORDER BY m.id DESC
     </select>
 
-    <select id="pdaPrintMaterial" parameterType="java.lang.Long" resultType="com.jsh.erp.datasource.pda.vo.PDAPrintVo">
-        SELECT s.supplier customerName,dh.number,m.system_spu barCode,mb.batch_number
-        FROM
-        jsh_depot_item di
-        LEFT JOIN jsh_depot_head dh ON di.header_id = dh.id
-        LEFT JOIN jsh_material m ON di.material_id = m.id
-        LEFT JOIN jsh_supplier s ON dh.organ_id = s.id
-        LEFT JOIN material_batch mb ON (SELECT id FROM jsh_depot_item WHERE link_id = di.id LIMIT 1) = mb.depot_item_id
-        WHERE di.id = #{depotItemId}
-    </select>
-
 </mapper>