Commit da1c23a474f0312a1e9bd44ce459c750dba30c42

Authored by 肖超群
1 parent f5af1eec

1 增加快速入库

2. 分配库位时,如果参数相同,那么取缓存数据
ant-design-vue-jeecg/src/api/api.js
... ... @@ -234,13 +234,11 @@ export const auditShipment = (params) => getAction("/audit/audit/auditShipment",
234 234  
235 235 //查询是否开启审核流程
236 236 export const getDocumentAduitFlow = (params) => getAction("/config/parameterConfiguration/getDocumentAduitFlow", params);
237   -
238   -
239   -
240   -
241   -//批量快速出整托
  237 +//快速入库
  238 +export const quickReceipt = (params) => postAction("/task/taskHeader/quickReceipt", params);
  239 +//快速出库,批量快速出整托
242 240 export const shipmentInventoryHeader = (params) => postAction('/inventory/inventoryHeader/shipmentInventoryHeader', params);
243   -//批量快速出库存详情
  241 +//快速出库,批量快速出库存详情
244 242 export const shipmentInventoryDetail = (params) => postAction('/inventory/inventoryHeader/shipmentInventoryDetail', params);
245 243 // 中转HTTP请求
246 244 export const transitRESTful = {
... ...
ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue
... ... @@ -85,7 +85,7 @@
85 85 <div class="table-operator">
86 86 <a-button @click="createEmptyIn()" v-has="'taskHeader:emptyIn'" type="primary">空托入库</a-button>
87 87 <a-button @click="createManyEmptyIn()" v-has="'taskHeader:manyEmptyIn'" type="primary">空托组入库</a-button>
88   - <a-button @click="openDemo()" type="primary">弹出demo</a-button>
  88 + <a-button @click="quickReceipt()" type="primary">快速入库</a-button>
89 89 </div>
90 90  
91 91 <!-- table区域-begin -->
... ... @@ -438,7 +438,7 @@ export default {
438 438 this.$refs.manyEmptyInModal.edit();
439 439 this.$refs.manyEmptyInModal.title = "创建空托盘组入库";
440 440 },
441   - openDemo(){
  441 + quickReceipt(){
442 442 this.$refs.materialTaskModal.edit();
443 443 },
444 444 solutionZoneCode(value) {
... ...
ant-design-vue-jeecg/src/views/system/task/modules/MaterialTaskModal.vue
1 1 <template>
2 2 <a-modal
3 3 :title="title"
4   - :width="1200"
  4 + :width="800"
5 5 :visible="visible"
6 6 :maskClosable="false"
7 7 :confirmLoading="confirmLoading"
... ... @@ -19,8 +19,8 @@
19 19 </a-col>
20 20  
21 21 <a-col :lg="8">
22   - <a-form-model-item label="库位号">
23   - <a-input placeholder="请输入库位号" v-model="model.toLocationCode"/>
  22 + <a-form-model-item label="qu">
  23 + <a-input placeholder="请输入库位号" v-model="model.toPort"/>
24 24 </a-form-model-item>
25 25 </a-col>
26 26 </a-row>
... ... @@ -53,6 +53,7 @@
53 53 import JEditableTable from '@/components/jeecg/JEditableTable'
54 54 import {FormTypes, VALIDATE_NO_PASSED, getRefPromise, validateFormModelAndTables} from '@/utils/JEditableTableUtil'
55 55 import {httpAction, getAction} from '@/api/manage'
  56 +import {execute, quickReceipt} from '@/api/api'
56 57 import JDate from '@/components/jeecg/JDate'
57 58  
58 59 export default {
... ... @@ -82,7 +83,7 @@ export default {
82 83 columns: [
83 84 {
84 85 title: '物料编码',
85   - key: 'materiaCode',
  86 + key: 'materialCode',
86 87 width: '24%',
87 88 type: FormTypes.input,
88 89 defaultValue: '',
... ... @@ -108,7 +109,6 @@ export default {
108 109 created() {
109 110 },
110 111 methods: {
111   -
112 112 // 获取所有的editableTable实例
113 113 getAllTable() {
114 114 return Promise.all([
... ... @@ -121,7 +121,6 @@ export default {
121 121 this.getAllTable().then(editableTables => {
122 122 editableTables[0].add()
123 123 })
124   -
125 124 this.edit({})
126 125 },
127 126 edit(record) {
... ... @@ -169,8 +168,10 @@ export default {
169 168 let formData = this.classifyIntoFormData(allValues)
170 169 console.log("输出数据:")
171 170 console.log(formData)
  171 + alert(JSON.stringify(formData))
  172 + this.receipt(formData);
172 173 // 发起请求
173   - return this.requestAddOrEdit(formData)
  174 + // return this.requestAddOrEdit(formData)
174 175 }).catch(e => {
175 176 if (e.error === VALIDATE_NO_PASSED) {
176 177 // 如果有未通过表单验证的子表,就自动跳转到它所在的tab
... ... @@ -185,7 +186,7 @@ export default {
185 186 let orderMain = Object.assign(this.model, allValues.formValue)
186 187 return {
187 188 ...orderMain, // 展开
188   - jeecgOrderCustomerList: allValues.tablesValue[0].values,
  189 + receiptEntityList: allValues.tablesValue[0].values,
189 190 }
190 191 },
191 192 /** 发起新增或修改的请求 */
... ... @@ -208,8 +209,19 @@ export default {
208 209 }).finally(() => {
209 210 this.confirmLoading = false
210 211 })
211   - }
212   -
  212 + },
  213 + receipt(record) {
  214 + this.loading = true;
  215 + this.model = Object.assign({}, record);
  216 + quickReceipt(this.model).then((res) => {
  217 + this.loading = false;
  218 + if (res.success) {
  219 + this.$message.success(res.message);
  220 + } else {
  221 + this.$message.error(res.message);
  222 + }
  223 + });
  224 + },
213 225 }
214 226 }
215 227 </script>
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java
... ... @@ -12,6 +12,7 @@ import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService;
12 12 import org.jeecg.utils.StringUtils;
13 13 import org.jeecg.utils.interceptor.AccessLimit;
14 14 import org.jeecg.utils.support.ApiLogger;
  15 +import org.springframework.cache.annotation.Cacheable;
15 16 import org.springframework.web.bind.annotation.*;
16 17  
17 18 import io.swagger.annotations.Api;
... ... @@ -38,7 +39,8 @@ public class WcsController extends HuahengBaseController {
38 39 @ResponseBody
39 40 @ApiOperation("仓位分配")
40 41 @ApiLogger(apiName = "仓位分配", from = "WCS")
41   - @AccessLimit(seconds = 5, maxCount = 10)
  42 + @Cacheable(cacheNames = "warecellAllocation#10", key = "#warecellDomain.taskNo + '_' + #warecellDomain.height + '_' + #warecellDomain.roadWays",
  43 + unless = "#result == null ")
42 44 public Result warecellAllocation(@RequestBody WarecellDomain warecellDomain, HttpServletRequest req) {
43 45 String warehouseCode = warecellDomain.getWarehouseCode();
44 46 String taskNo = warecellDomain.getTaskNo();
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java
... ... @@ -144,16 +144,12 @@ public class WcsServiceImpl implements WcsService {
144 144 return Result.error("分配库位时,整出类型的任务不需要分配库位");
145 145 }
146 146 String containerCode = taskHeader.getContainerCode();
147   - String toLocationCode = taskHeader.getToLocationCode();
148   - if (StringUtils.isNotEmpty(toLocationCode)) {
149   - WcsTask wcsTask2 = new WcsTask();
150   - wcsTask2.setToLocationCode(toLocationCode);
151   - wcsTask2.setPreTaskNo(String.valueOf(preTaskNo));
152   - return Result.OK(wcsTask2);
  147 + if (StringUtils.isEmpty(containerCode)) {
  148 + return Result.error("分配库位时,任务托盘为空");
153 149 }
154 150 Container container = containerService.getContainerByCode(containerCode, warehouseCode);
155 151 if (container == null) {
156   - return Result.error("分配库位时,任务托盘为空");
  152 + return Result.error("分配库位时,没有找到容器" + containerCode);
157 153 }
158 154 String containerTypeCode = container.getContainerTypeCode();
159 155 if (StringUtils.isEmpty(containerTypeCode)) {
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/controller/TaskHeaderController.java
... ... @@ -27,6 +27,7 @@ import org.jeecg.modules.wms.config.zone.entity.Zone;
27 27 import org.jeecg.modules.wms.config.zone.service.IZoneService;
28 28 import org.jeecg.modules.wms.framework.controller.HuahengBaseController;
29 29 import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService;
  30 +import org.jeecg.modules.wms.task.taskHeader.entity.QucikReceiptEntity;
30 31 import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail;
31 32 import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
32 33 import org.jeecg.modules.wms.task.taskHeader.service.ITaskDetailService;
... ... @@ -706,4 +707,24 @@ public class TaskHeaderController extends HuahengBaseController {
706 707 return result;
707 708 }
708 709  
  710 + /**
  711 + * 快速入库
  712 + * @return
  713 + */
  714 + @AutoLog(value = "快速入库")
  715 + @PostMapping("quickReceipt")
  716 + @ApiOperation("快速入库")
  717 + @ResponseBody
  718 + public Result quickReceipt(@RequestBody QucikReceiptEntity qucikReceiptEntity, HttpServletRequest req) {
  719 + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
  720 + qucikReceiptEntity.setWarehouseCode(warehouseCode);
  721 + Result result = handleMultiProcess("quickReceipt", new MultiProcessListener() {
  722 + @Override
  723 + public Result<?> doProcess() {
  724 + Result result = taskHeaderService.quickReceipt(qucikReceiptEntity);
  725 + return result;
  726 + }
  727 + });
  728 + return result;
  729 + }
709 730 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/entity/QucikReceiptEntity.java 0 → 100644
  1 +package org.jeecg.modules.wms.task.taskHeader.entity;
  2 +
  3 +import java.util.List;
  4 +
  5 +import lombok.Data;
  6 +
  7 +@Data
  8 +public class QucikReceiptEntity {
  9 +
  10 + private String containerCode;
  11 + private String toPort;
  12 + private String warehouseCode;
  13 + private List<ReceiptEntity> receiptEntityList;
  14 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/entity/ReceiptEntity.java 0 → 100644
  1 +package org.jeecg.modules.wms.task.taskHeader.entity;
  2 +
  3 +import java.math.BigDecimal;
  4 +
  5 +import lombok.Data;
  6 +
  7 +/**
  8 + * @author 游杰
  9 + */
  10 +@Data
  11 +public class ReceiptEntity {
  12 +
  13 + private String materialCode;
  14 + private BigDecimal qty;
  15 +}
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/ITaskHeaderService.java
... ... @@ -5,6 +5,7 @@ import java.util.Collection;
5 5  
6 6 import org.jeecg.common.api.vo.Result;
7 7 import org.jeecg.modules.wms.config.location.entity.Location;
  8 +import org.jeecg.modules.wms.task.taskHeader.entity.QucikReceiptEntity;
8 9 import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
9 10  
10 11 import com.baomidou.mybatisplus.extension.service.IService;
... ... @@ -363,4 +364,10 @@ public interface ITaskHeaderService extends IService&lt;TaskHeader&gt; {
363 364 */
364 365 Result completeTaskUnLockContainerAndLocation(String containerFillStatus, int taskType, String containerCode, String fromLocationCode, String toLocationCode,
365 366 String warehouseCode);
  367 +
  368 + /**
  369 + * add
  370 + * @return
  371 + */
  372 + Result quickReceipt(QucikReceiptEntity qucikReceiptEntity);
366 373 }
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... ... @@ -38,6 +38,7 @@ import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptDetail;
38 38 import org.jeecg.modules.wms.receipt.receiptHeader.entity.ReceiptHeader;
39 39 import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptDetailService;
40 40 import org.jeecg.modules.wms.receipt.receiptHeader.service.IReceiptHeaderService;
  41 +import org.jeecg.modules.wms.receipt.receiving.domain.Receive;
41 42 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerDetail;
42 43 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader;
43 44 import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerDetailService;
... ... @@ -51,9 +52,7 @@ import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetai
51 52 import org.jeecg.modules.wms.stocktaking.cycleCountDetail.service.impl.CycleCountDetailChildServiceImpl;
52 53 import org.jeecg.modules.wms.stocktaking.cycleCountDetail.service.impl.CycleCountDetailServiceImpl;
53 54 import org.jeecg.modules.wms.stocktaking.cycleCountHeader.service.impl.CycleCountHeaderServiceImpl;
54   -import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail;
55   -import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
56   -import org.jeecg.modules.wms.task.taskHeader.entity.TaskLockEntity;
  55 +import org.jeecg.modules.wms.task.taskHeader.entity.*;
57 56 import org.jeecg.modules.wms.task.taskHeader.mapper.TaskDetailMapper;
58 57 import org.jeecg.modules.wms.task.taskHeader.mapper.TaskHeaderMapper;
59 58 import org.jeecg.modules.wms.task.taskHeader.service.ITaskDetailService;
... ... @@ -1787,6 +1786,29 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
1787 1786 return Result.OK("任务类型" + taskType + "完成任务成功");
1788 1787 }
1789 1788  
  1789 + @Override
  1790 + @Transactional(rollbackFor = Exception.class)
  1791 + public Result quickReceipt(QucikReceiptEntity qucikReceiptEntity) {
  1792 + String containerCode = qucikReceiptEntity.getContainerCode();
  1793 + List<ReceiptEntity> receiptEntityList = qucikReceiptEntity.getReceiptEntityList();
  1794 + String toPort = qucikReceiptEntity.getToPort();
  1795 + String warehouseCode = qucikReceiptEntity.getWarehouseCode();
  1796 + List<Receive> receiveList = new ArrayList<>();
  1797 + if (StringUtils.isEmpty(containerCode)) {
  1798 + return Result.error("快速入库,容器编码为空");
  1799 + }
  1800 + if (StringUtils.isEmpty(toPort)) {
  1801 + return Result.error("快速入库,入库口为空");
  1802 + }
  1803 + Container container = containerService.getContainerByCode(containerCode, warehouseCode);
  1804 + if (container == null) {
  1805 + return Result.error("快速入库,没有找到容器" + containerCode);
  1806 + }
  1807 +
  1808 + return Result.OK("快速入库成功");
  1809 +
  1810 + }
  1811 +
1790 1812 /**
1791 1813 * 完成空托盘入库任务
1792 1814 * @param taskHeader 任务
... ...