Commit 992ab8b481e468848ee1020c86a81757ee432c68

Authored by 肖超群
1 parent 00b04817

更新仓库权限

jeecg-boot-master/ant-design-vue-jeecg/src/views/system/config/WarehouseList.vue
... ... @@ -38,19 +38,19 @@
38 38  
39 39 <!-- 操作按钮区域 -->
40 40 <div class="table-operator">
41   - <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  41 + <a-button v-has="'warehouse:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button>
42 42 <a-button type="primary" icon="download" @click="handleExportXls('仓库')">导出</a-button>
43 43 <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
44 44 <a-button type="primary" icon="import">导入</a-button>
45 45 </a-upload>
46 46 <!-- 高级查询区域 -->
47 47 <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
48   - <a-dropdown v-if="selectedRowKeys.length > 0">
49   - <a-menu slot="overlay">
50   - <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
51   - </a-menu>
52   - <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
53   - </a-dropdown>
  48 +<!-- <a-dropdown v-if="selectedRowKeys.length > 0">-->
  49 +<!-- <a-menu slot="overlay">-->
  50 +<!-- <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>-->
  51 +<!-- </a-menu>-->
  52 +<!-- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>-->
  53 +<!-- </a-dropdown>-->
54 54 </div>
55 55  
56 56 <!-- table区域-begin -->
... ...
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/shipment/ShipmentDetailList.vue
... ... @@ -62,7 +62,7 @@
62 62 </template>
63 63  
64 64 <span slot="action" slot-scope="text, record">
65   - <a @click="handleEdit(record)">编辑</a>
  65 + <a @click="edit(record)">编辑</a>
66 66 <a-divider type="vertical" />
67 67 <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
68 68 <a>删除</a>
... ... @@ -73,6 +73,7 @@
73 73 </div>
74 74  
75 75 <shipmentDetail-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId"></shipmentDetail-modal>
  76 + <shipment-detail-edit-modal ref="modalEditForm" @ok="modalFormOk" :mainId="mainId"></shipment-detail-edit-modal>
76 77 </a-card>
77 78 </template>
78 79  
... ... @@ -80,11 +81,12 @@
80 81  
81 82 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
82 83 import ShipmentDetailModal from './modules/ShipmentDetailModal'
  84 + import ShipmentDetailEditModal from './modules/ShipmentDetailEditModal'
83 85  
84 86 export default {
85 87 name: "ShipmentDetailList",
86 88 mixins:[JeecgListMixin],
87   - components: { ShipmentDetailModal },
  89 + components: { ShipmentDetailEditModal, ShipmentDetailModal },
88 90 props:{
89 91 mainId:{
90 92 type:String,
... ... @@ -215,8 +217,12 @@
215 217 this.dataSource=[]
216 218 this.selectedRowKeys=[]
217 219 this.ipagination.current = 1
218   - }
219   -
  220 + },
  221 + edit (record) {
  222 + this.$refs.modalEditForm.edit(record);
  223 + this.$refs.modalEditForm.title = "编辑";
  224 + this.$refs.modalEditForm.disableSubmit = false;
  225 + },
220 226 }
221 227 }
222 228 </script>
... ...
jeecg-boot-master/ant-design-vue-jeecg/src/views/system/shipment/modules/ShipmentDetailEditModal.vue
... ... @@ -11,21 +11,37 @@
11 11 <a-spin :spinning="confirmLoading">
12 12 <a-form-model ref="form" :model="model" :rules="validatorRules">
13 13 <a-row>
14   - <a-form-model-item label="物料" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialCode">
15   - <j-search-select-tag
16   - v-model="model.materialCode"
17   - :dictOptions="materialList"
18   - :trigger-change="true"
19   - placeholder="请选择物料编码"
20   - @change="searchMaterial">
21   - </j-search-select-tag>
22   - </a-form-model-item>
  14 + <a-col :span="24">
  15 + <a-form-model-item label="物料编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialCode">
  16 + <a-input v-model="model.materialCode"placeholder="请输入物料编码" style="width: 100%" />
  17 + </a-form-model-item>
  18 + </a-col>
  19 + <a-col :span="24">
  20 + <a-form-model-item label="物料名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialName">
  21 + <a-input v-model="model.materialName"placeholder="请输入物料名称" style="width: 100%" />
  22 + </a-form-model-item>
  23 + </a-col>
  24 + <a-col :span="24">
  25 + <a-form-model-item label="物料规格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialSpec">
  26 + <a-input v-model="model.materialSpec"placeholder="请输入单据数量" style="width: 100%" />
  27 + </a-form-model-item>
  28 + </a-col>
  29 + <a-col :span="24">
  30 + <a-form-model-item label="物料单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialUnit">
  31 + <a-input v-model="model.materialUnit"placeholder="请输入物料单位" style="width: 100%" />
  32 + </a-form-model-item>
  33 + </a-col>
23 34 <a-col :span="24">
24 35 <a-form-model-item label="单据数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qty">
25 36 <a-input-number v-model="model.qty"placeholder="请输入单据数量" style="width: 100%" />
26 37 </a-form-model-item>
27 38 </a-col>
28 39 <a-col :span="24">
  40 + <a-form-model-item label="已收数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="taskQty">
  41 + <a-input-number v-model="model.taskQty"placeholder="请输入已收数量" style="width: 100%" />
  42 + </a-form-model-item>
  43 + </a-col>
  44 + <a-col :span="24">
29 45 <a-form-model-item label="库存状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inventoryStatus">
30 46 <j-dict-select-tag type="list" v-model="model.inventoryStatus" dictCode="inventory_status" placeholder="请选择库存状态" />
31 47 </a-form-model-item>
... ... @@ -35,6 +51,11 @@
35 51 <a-input v-model="model.batch"placeholder="请输入批次" ></a-input>
36 52 </a-form-model-item>
37 53 </a-col>
  54 + <a-col :span="24">
  55 + <a-form-model-item label="单据状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
  56 + <j-dict-select-tag type="list" v-model="model.status" dictCode="shipment_status" placeholder="请选择单据状态" />
  57 + </a-form-model-item>
  58 + </a-col>
38 59 </a-row>
39 60 </a-form-model>
40 61 </a-spin>
... ... @@ -48,7 +69,7 @@
48 69 import {searchMaterialByCode} from '@/api/api'
49 70  
50 71 export default {
51   - name: "ShipmentDetailModal",
  72 + name: "ShipmentDetailEditModal",
52 73 components: {
53 74 },
54 75 props:{
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/warehouse/controller/WarehouseController.java
... ... @@ -115,6 +115,10 @@ public class WarehouseController extends JeecgController&lt;Warehouse, IWarehouseSe
115 115 @DeleteMapping(value = "/delete")
116 116 @RequiresPermissions("warehouse:delete")
117 117 public Result<String> delete(@RequestParam(name="id",required=true) String id) {
  118 + List<Warehouse> warehouseList = warehouseService.getAllWarehouseList();
  119 + if(warehouseList.size() == 1) {
  120 + return Result.error("不能删除唯一的仓库");
  121 + }
118 122 warehouseService.removeById(id);
119 123 return Result.OK("删除成功!");
120 124 }
... ... @@ -130,6 +134,10 @@ public class WarehouseController extends JeecgController&lt;Warehouse, IWarehouseSe
130 134 @DeleteMapping(value = "/deleteBatch")
131 135 @RequiresPermissions("warehouse:delete")
132 136 public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
  137 + List<Warehouse> warehouseList = warehouseService.getAllWarehouseList();
  138 + if(warehouseList.size() == 1) {
  139 + return Result.error("不能删除唯一的仓库");
  140 + }
133 141 this.warehouseService.removeByIds(Arrays.asList(ids.split(",")));
134 142 return Result.OK("批量删除成功!");
135 143 }
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/warehouse/service/IWarehouseService.java
... ... @@ -3,6 +3,8 @@ package org.jeecg.modules.wms.config.warehouse.service;
3 3 import com.baomidou.mybatisplus.extension.service.IService;
4 4 import org.jeecg.modules.wms.config.warehouse.entity.Warehouse;
5 5  
  6 +import java.util.List;
  7 +
6 8 /**
7 9 * @Description: 仓库
8 10 * @Author: jeecg-boot
... ... @@ -11,4 +13,5 @@ import org.jeecg.modules.wms.config.warehouse.entity.Warehouse;
11 13 */
12 14 public interface IWarehouseService extends IService<Warehouse> {
13 15  
  16 + public List<Warehouse> getAllWarehouseList();
14 17 }
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/config/warehouse/service/impl/WarehouseServiceImpl.java
... ... @@ -7,6 +7,8 @@ import org.springframework.stereotype.Service;
7 7  
8 8 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
9 9  
  10 +import java.util.List;
  11 +
10 12 /**
11 13 * @Description: 仓库
12 14 * @Author: jeecg-boot
... ... @@ -16,4 +18,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
16 18 @Service
17 19 public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper, Warehouse> implements IWarehouseService {
18 20  
  21 + @Override
  22 + public List<Warehouse> getAllWarehouseList() {
  23 + return list();
  24 + }
19 25 }
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/controller/shipmentCombinationController.java
... ... @@ -132,4 +132,18 @@ public class shipmentCombinationController {
132 132 }
133 133 return Result.OK(portList);
134 134 }
  135 +
  136 +
  137 + /**
  138 + * 匹配库存
  139 + * @return
  140 + */
  141 + @AutoLog(value = "出库组盘-选取库存")
  142 + @ApiOperation(value="出库组盘-选取库存", notes="出库组盘-选取库存")
  143 + @PostMapping("/getInventoryFromShipmentDetail")
  144 + @ResponseBody
  145 + public Result getInventoryFromShipmentDetail(@RequestParam(name="id",required=true) Integer id, HttpServletRequest req) {
  146 +
  147 + return shipmentCombinationService.getInventoryFromShipmentDetail(id);
  148 + }
135 149 }
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/IShipmentCombinationService.java
... ... @@ -24,4 +24,6 @@ public interface IShipmentCombinationService {
24 24 public Result combination(CombinationModel combinationModel);
25 25  
26 26 public Result createShipmentTask(ShipmentContainerHeader shipmentContainerHeader, String warehouseCode);
  27 +
  28 + public Result getInventoryFromShipmentDetail(Integer shipmentDetailId);
27 29 }
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java
... ... @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
6 6 import org.jeecg.common.api.vo.Result;
7 7 import org.jeecg.modules.wms.config.container.entity.Container;
8 8 import org.jeecg.modules.wms.config.container.service.IContainerService;
  9 +import org.jeecg.modules.wms.config.container.service.impl.ContainerServiceImpl;
9 10 import org.jeecg.modules.wms.config.location.entity.Location;
10 11 import org.jeecg.modules.wms.config.location.service.ILocationService;
11 12 import org.jeecg.modules.wms.config.material.entity.Material;
... ... @@ -545,4 +546,23 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi
545 546  
546 547 return Result.OK("生成出库任务成功");
547 548 }
  549 +
  550 + @Override
  551 + public Result getInventoryFromShipmentDetail(Integer shipmentDetailId) {
  552 + ShipmentDetail shipmentDetail = shipmentDetailService.getById(shipmentDetailId);
  553 + if(shipmentDetail == null){
  554 + return Result.error("找不到出库单详情");
  555 + }
  556 + String warehouseCode = shipmentDetail.getWarehouseCode();
  557 + List<InventoryDetail> inventoryDetailList = getInventorys(shipmentDetail);
  558 + if(inventoryDetailList.size() == 0) {
  559 + return Result.error("该物料没有库存或没有符合出库规则的库存");
  560 + }
  561 + List<InventoryDetail> removeInventoryList = new ArrayList<>();
  562 + for(InventoryDetail inventoryDetail : inventoryDetailList) {
  563 + String containerCode = inventoryDetail.getContainerCode();
  564 + Container container =
  565 + }
  566 + return null;
  567 + }
548 568 }
... ...
jeecg-boot-master/jeecg-boot/jeecg-boot-module-system/src/main/resources/application-dev.yml
... ... @@ -131,9 +131,9 @@ spring:
131 131 connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
132 132 datasource:
133 133 master:
134   - url: jdbc:mysql://localhost:3306/wms4?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
  134 + url: jdbc:mysql://172.16.29.45:3306/wms4?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
135 135 username: root
136   - password: HHsoft123.
  136 + password: hhsoftware
137 137 driver-class-name: com.mysql.cj.jdbc.Driver
138 138 # 多数据源配置
139 139 #multi-datasource1:
... ...