Commit ad9240d13b3b12abe59c3524cd61662581317c4a

Authored by 李泰瑜
1 parent 5aaf96c1

盘点选择站台生成任务,优化很多细节

ant-design-vue-jeecg/src/api/api.js
... ... @@ -139,6 +139,8 @@ export const createShipmentTask = (params) => postAction('/shipment/shipmentComb
139 139 export const selectSortingPort = (params) => postAction('/shipment/shipmentCombination/selectSortingPort', params);
140 140 //选择入库分拣口
141 141 export const selectSupplePort = (params) => postAction('/receipt/receiptContainerHeader/selectSupplePort', params);
  142 +//选择盘点分拣口
  143 +export const inventoryPort = (params) => postAction('/cycleCountDetail/cycleCountDetail/inventoryPort', params);
142 144 //创建空托盘入库任务
143 145 export const createEmptyIn = (params) => postAction('/task/taskHeader/createEmptyIn', params);
144 146 //创建空托盘出库任务
... ...
ant-design-vue-jeecg/src/views/system/inventory/InventoryDetailSelectList.vue
... ... @@ -28,7 +28,7 @@
28 28 :dataSource="dataSource"
29 29 :pagination="ipagination"
30 30 :loading="loading"
31   - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  31 +
32 32 @change="handleTableChange">
33 33  
34 34 <span slot="companyCode" slot-scope="companyCode">
... ... @@ -157,14 +157,8 @@ export default {
157 157 ],
158 158 url: {
159 159 list: "/inventory/inventoryHeader/listInventoryDetailByMainId",
160   - delete: "/inventory/inventoryHeader/deleteInventoryDetail",
161   - deleteBatch: "/inventory/inventoryHeader/deleteBatchInventoryDetail",
162   - exportXlsUrl: "/inventory/inventoryHeader/exportInventoryDetail",
163   - importUrl: "/inventory/inventoryHeader/importInventoryDetail",
164 160 },
165   - dictOptions: {
166   - containerStatus: [],
167   - }
  161 +
168 162 }
169 163 },
170 164 created() {
... ... @@ -175,18 +169,8 @@ export default {
175 169 Utils.$on('methodA',(data)=> {
176 170 _this.methodA(data);
177 171 })
178   - // var _this = this;
179   - // setInterval(function () {
180   - // if(_this.isLoad) {
181   - // _this.loadDataList();
182   - // }
183   - // },1000)
184   - },
185   - computed: {
186   - importExcelUrl() {
187   - return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`;
188   - }
189 172 },
  173 +
190 174 methods: {
191 175  
192 176 methodA(data) {
... ...
ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountDetailList.vue
... ... @@ -27,7 +27,6 @@
27 27 bordered
28 28 rowKey="id"
29 29 class="j-table-force-nowrap"
30   - :scroll="{x:true}"
31 30 :loading="loading"
32 31 :columns="columns"
33 32 :dataSource="dataSource"
... ... @@ -75,7 +74,7 @@
75 74 </template>
76 75  
77 76 <template slot="action" slot-scope="text, record">
78   - <a v-if="record.enableStatus === 1" @click="generateCount(record.id)">生成盘点任务</a>
  77 + <a v-if="record.enableStatus === 1" @click="selectPort(record)">生成盘点任务</a>
79 78 <a-divider v-if="record.enableStatus === 1" type="vertical"/>
80 79 <a @click="loadDatas(record.cycleCountHeadId)"><a-icon type="sync"/>刷新</a>
81 80 </template>
... ... @@ -85,6 +84,8 @@
85 84 <!-- table区域 end -->
86 85  
87 86 <!-- 表单区域 -->
  87 +
  88 + <cycle-count-select-modal ref="modalForm2"></cycle-count-select-modal>
88 89 <cycle-count-detail-modal ref="modalForm" @ok="modalFormOk"/>
89 90  
90 91 </a-card>
... ... @@ -95,6 +96,7 @@
95 96 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
96 97 import { getAction } from '@api/manage'
97 98 import CycleCountDetailModal from './modules/CycleCountDetailModal'
  99 + import CycleCountSelectModal from './modules/CycleCountSelectModal'
98 100 import CycleCountDetailChildSubTable from './subTables/CycleCountDetailChildSubTable'
99 101 import '@/assets/less/TableExpand.less'
100 102 import {createCycleCoutTaskByDetailId, stockTakeTask} from "../../../api/api";
... ... @@ -107,6 +109,7 @@
107 109 components: {
108 110 CycleCountDetailModal,
109 111 CycleCountDetailChildSubTable,
  112 + CycleCountSelectModal,
110 113 },
111 114 props: {
112 115 record: {
... ... @@ -247,12 +250,6 @@
247 250 Utils.$on('methodB',(data)=> {
248 251 _this.methodB(data);
249 252 })
250   - // var _this = this;
251   - // setInterval(function () {
252   - // if(_this.isLoad) {
253   - // _this.loadDataList();
254   - // }
255   - // },1000)
256 253 },
257 254 computed: {
258 255 importExcelUrl() {
... ... @@ -283,8 +280,12 @@
283 280 }).finally(() => {
284 281 this.loading = false
285 282 })
286   - },
287 283  
  284 + },
  285 + selectPort(record) {
  286 + this.$refs.modalForm2.edit(record);
  287 + this.$refs.modalForm2.title = "选择出库口";
  288 + },
288 289 loadDatas(record) {
289 290 this.loading = true
290 291 this.dataSource = []
... ... @@ -299,34 +300,13 @@
299 300 })
300 301 },
301 302  
302   - // testaa(){
303   - // alert("刷新了")
304   - // var _this = this;
305   - // _this.loadDataList();
306   - // },
307 303 methodB(data) {
308 304 var _this = this;
309 305 _this.loadDatas(data);
310 306 },
311 307 initDictConfig() {
312 308 },
313   - generateCount(id){
314   - createCycleCoutTaskByDetailId(id).then((res) => {
315   - // alert("请求成功")
316   - if (res.success) {
317   - this.$message.success(res.message)
318   - this.$emit('ok')
319   - var _this = this;
320   - _this.loadDatas(res.result);
321   - } else {
322   - this.$message.warning(res.message);
323   - }
324   - }).finally(() => {
325   - this.confirmLoading = false;
326   - this.close()
327   - })
328 309  
329   - },
330 310 handleExpand(expanded, record) {
331 311 this.expandedRowKeys = []
332 312 if (expanded === true) {
... ...
ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountHeaderList.vue
... ... @@ -36,7 +36,6 @@
36 36 <a-table
37 37 ref="table"
38 38 size="middle"
39   - :scroll="{x:true}"
40 39 bordered
41 40 rowKey="id"
42 41 :columns="columns"
... ... @@ -230,7 +229,7 @@
230 229 title: '操作',
231 230 dataIndex: 'action',
232 231 align:"center",
233   - fixed:"right",
  232 + // fixed:"right",
234 233 width:147,
235 234 scopedSlots: { customRender: 'action' }
236 235 }
... ...
ant-design-vue-jeecg/src/views/system/stocktaking/modules/CycleCountSelectModal.vue 0 → 100644
  1 +<template>
  2 + <j-modal
  3 + :title="title"
  4 + :width="width"
  5 + :visible="visible"
  6 + :confirmLoading="confirmLoading"
  7 + switchFullscreen
  8 + @ok="handleOk"
  9 + @cancel="handleCancel"
  10 + cancelText="关闭">
  11 + <a-spin :spinning="confirmLoading">
  12 + <a-form-model ref="form" :model="model" :rules="validatorRules">
  13 + <a-row>
  14 + <a-col :span="24">
  15 + <a-form-model-item label="出库口" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toPort">
  16 + <a-select
  17 + show-search
  18 + placeholder="请选择出库口"
  19 + option-filter-prop="children"
  20 + v-model="model.toPort">
  21 + <a-select-option v-for="item in portList" :key="item.name" :value="item.code">{{
  22 + item.name
  23 + }}
  24 + </a-select-option>
  25 + </a-select>
  26 + </a-form-model-item>
  27 + </a-col>
  28 + </a-row>
  29 + </a-form-model>
  30 + </a-spin>
  31 + </j-modal>
  32 +</template>
  33 +
  34 +<script>
  35 +
  36 +import {createCycleCoutTaskByDetailId} from '@/api/api'
  37 +import {inventoryPort} from '@/api/api'
  38 +import Utils from "../../../../components/jeecgbiz/JButtonBizComponent/util";
  39 +
  40 +export default {
  41 + name: "CycleCountSelectModal",
  42 + portList: [],
  43 + components: {},
  44 + props: {
  45 + mainId: {
  46 + type: String,
  47 + required: false,
  48 + default: ''
  49 + }
  50 + },
  51 + data() {
  52 + return {
  53 + title: "操作",
  54 + width: 500,
  55 + visible: false,
  56 + model: {},
  57 + portList: [],
  58 + labelCol: {
  59 + xs: {span: 24},
  60 + sm: {span: 5},
  61 + },
  62 + wrapperCol: {
  63 + xs: {span: 24},
  64 + sm: {span: 16},
  65 + },
  66 +
  67 + confirmLoading: false,
  68 + validatorRules: {},
  69 + modifyId:"",
  70 + url: {
  71 + createTask: "/shipment/shipmentContainerHeader/createShipmentTask",
  72 + }
  73 +
  74 + }
  75 + },
  76 + created() {
  77 + //备份model原始值
  78 + this.modelDefault = JSON.parse(JSON.stringify(this.model));
  79 + },
  80 + methods: {
  81 + add() {
  82 + this.edit(this.modelDefault);
  83 + },
  84 + edit(record) {
  85 + this.visible = true;
  86 + this.modifyId=record.id;
  87 + this.getPortList(record);
  88 + },
  89 + close() {
  90 + this.$emit('close');
  91 + this.visible = false;
  92 + this.$refs.form.clearValidate();
  93 + },
  94 + handleOk() {
  95 + const that = this;
  96 + // 触发表单验证
  97 + this.$refs.form.validate(valid => {
  98 +
  99 +
  100 + if (valid) {
  101 + that.confirmLoading = true;
  102 + createCycleCoutTaskByDetailId(this.modifyId).then((res) => {
  103 + // alert("请求成功")
  104 + if (res.success) {
  105 + this.$message.success(res.message)
  106 + this.$emit('ok')
  107 + var _this = this;
  108 + Utils.$emit('methodB',res.result);
  109 + // _this.loadDatas(res.result);
  110 + } else {
  111 + this.$message.warning(res.message);
  112 + }
  113 + }).finally(() => {
  114 + that.confirmLoading = false;
  115 + that.close();
  116 + });
  117 + } else {
  118 + return false
  119 + }
  120 + })
  121 + },
  122 + handleCancel() {
  123 + this.close()
  124 + },
  125 + getPortList(record) {
  126 + console.log("getPortList");
  127 + inventoryPort(record).then((res) => {
  128 + if (res.success) {
  129 + this.portList = res.result;
  130 + this.model = Object.assign({}, record);
  131 + this.visible = true;
  132 + }
  133 + });
  134 + }
  135 +
  136 + }
  137 +}
  138 +</script>
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/controller/CycleCountDetailController.java
... ... @@ -15,6 +15,12 @@ import javax.servlet.http.HttpServletRequest;
15 15  
16 16 import org.apache.shiro.authz.annotation.RequiresPermissions;
17 17 import org.jeecg.modules.system.entity.SysAnnouncementSend;
  18 +import org.jeecg.modules.wms.config.location.entity.Location;
  19 +import org.jeecg.modules.wms.config.location.service.impl.LocationServiceImpl;
  20 +import org.jeecg.modules.wms.config.port.entity.Port;
  21 +import org.jeecg.modules.wms.config.port.service.impl.PortServiceImpl;
  22 +import org.jeecg.modules.wms.config.zone.entity.Zone;
  23 +import org.jeecg.modules.wms.config.zone.service.impl.ZoneServiceImpl;
18 24 import org.jeecg.modules.wms.framework.controller.HuahengBaseController;
19 25 import javax.servlet.http.HttpServletResponse;
20 26  
... ... @@ -24,9 +30,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
24 30 import org.jeecg.modules.wms.framework.controller.HuahengBaseController;
25 31 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
26 32 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService;
  33 +import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader;
27 34 import org.jeecg.utils.ConvertUtils;
28 35 import org.jeecg.utils.HuahengJwtUtil;
29 36 import org.jeecg.utils.StringUtils;
  37 +import org.jeecg.utils.constant.QuantityConstant;
30 38 import org.jeecgframework.poi.excel.ExcelImportUtil;
31 39 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
32 40 import org.jeecgframework.poi.excel.entity.ExportParams;
... ... @@ -74,6 +82,13 @@ public class CycleCountDetailController extends HuahengBaseController {
74 82 private ICycleCountDetailChildService cycleCountDetailChildService;
75 83 @Autowired
76 84 private IInventoryDetailService inventoryDetailService;
  85 + @Resource
  86 + private LocationServiceImpl locationService;
  87 + @Resource
  88 + private ZoneServiceImpl zoneService;
  89 + @Resource
  90 + private PortServiceImpl portService;
  91 +
77 92 /**
78 93 * 分页列表查询
79 94 *
... ... @@ -199,6 +214,41 @@ public class CycleCountDetailController extends HuahengBaseController {
199 214  
200 215  
201 216 /**
  217 + * 选择分拣口
  218 + * @return
  219 + */
  220 + @ApiOperation(value = "盘点-选择分拣口", notes = "盘点-选择分拣口")
  221 + @PostMapping("/inventoryPort")
  222 + @ResponseBody
  223 + public Result inventoryPort(@RequestBody CycleCountDetail cycleCountDetail, HttpServletRequest req) {
  224 + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
  225 + String fromLocationCode = cycleCountDetail.getLocationCode();
  226 + if (StringUtils.isEmpty(fromLocationCode)) {
  227 + return Result.error("选择分拣口时, 起始库位号为空");
  228 + }
  229 + Location fromLocation = locationService.getLocationByCode(fromLocationCode, warehouseCode);
  230 + if (fromLocation == null) {
  231 + return Result.error("选择分拣口时, 根据库位号" + fromLocationCode + " 没有找到库位");
  232 + }
  233 + String zoneCode = fromLocation.getZoneCode();
  234 + if (StringUtils.isEmpty(zoneCode)) {
  235 + return Result.error("选择分拣口时, 库区编码为空");
  236 + }
  237 + Zone zone = zoneService.getZoneByCode(zoneCode, warehouseCode);
  238 + if (zone == null) {
  239 + return Result.error("选择分拣口时, 库区为空");
  240 + }
  241 + int type = QuantityConstant.PORT_TYPE_PICK;
  242 +
  243 + List<Port> portList = portService.getPortListByType(type, zoneCode, warehouseCode);
  244 + if (portList.size() == 0) {
  245 + return Result.error("选择分拣口时, 没有找到合适的分拣口");
  246 + }
  247 + return Result.OK(portList);
  248 + }
  249 +
  250 +
  251 + /**
202 252 * 添加盘点
203 253 *
204 254 */
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailServiceImpl.java
... ... @@ -119,6 +119,7 @@ public class CycleCountDetailServiceImpl extends ServiceImpl&lt;CycleCountDetailMap
119 119 }
120 120  
121 121 @Override
  122 + @Transactional
122 123 public Result stockDetailAdd(int taskId,int headerId,String code) {
123 124 LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery();
124 125 inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getInventoryHeaderId,taskId);
... ... @@ -134,10 +135,24 @@ public class CycleCountDetailServiceImpl extends ServiceImpl&lt;CycleCountDetailMap
134 135 return Result.error("当前容器已经在盘点队列还没有完成 盘点单号"+cycleCountDetails.get(0).getCycleCountHeadCode());
135 136 }
136 137  
  138 + String warehouseCode=inventoryDetails.get(0).getWarehouseCode();
  139 +
  140 +
  141 + Container containerByCode = containerServiceImpl.getContainerByCode(inventoryDetails.get(0).getContainerCode(),warehouseCode);
  142 + if (containerByCode.getStatus().equals(QuantityConstant.STATUS_CONTAINER_LOCK))
  143 + {
  144 + return Result.error("当前容器已锁定 请检查数据 库存里面不是锁定 实际上容器里面锁定了");
  145 + }
  146 +
  147 + Location locationByCode = locationService.getLocationByCode(inventoryDetails.get(0).getLocationCode(), warehouseCode);
  148 + if (locationByCode.getStatus().equals(QuantityConstant.STATUS_CONTAINER_LOCK))
  149 + {
  150 + return Result.error("当前库位已锁定 请检查数据 库存里面不是锁定 实际上库位里面锁定了");
  151 + }
  152 +
137 153 CycleCountDetail cycleCountDetail = new CycleCountDetail();
138 154 cycleCountDetail.setCycleCountHeadId(headerId);
139 155 cycleCountDetail.setContainerCode(inventoryDetails.get(0).getContainerCode());
140   -
141 156 cycleCountDetail.setCycleCountHeadCode(code);
142 157 cycleCountDetail.setCompanyCode(inventoryDetails.get(0).getCompanyCode());
143 158 cycleCountDetail.setWarehouseCode(inventoryDetails.get(0).getWarehouseCode());
... ... @@ -153,7 +168,6 @@ public class CycleCountDetailServiceImpl extends ServiceImpl&lt;CycleCountDetailMap
153 168 CycleCountDetailChild cycleCountDetailChild=new CycleCountDetailChild();
154 169 for(InventoryDetail inventoryDetail:inventoryDetails)
155 170 {
156   -// cycleCountDetailChild.setCyclecountheadcode();
157 171 cycleCountDetailChild.setCycleCountDetailid(cycleCountDetail.getId());
158 172 cycleCountDetailChild.setCyclecountheadcode(code);
159 173 cycleCountDetailChild.setChildStatus(QuantityConstant.CYCLECOUNT_STATUS_BUILD);
... ... @@ -208,7 +222,7 @@ public class CycleCountDetailServiceImpl extends ServiceImpl&lt;CycleCountDetailMap
208 222 if(StringUtils.isEmpty(location.getContainerCode())){
209 223 return Result.error(cycleCountDetail.getLocationCode() + "库位中没有容器,操作失败!");
210 224 }
211   -
  225 +
212 226 //生成任务同时锁定库位
213 227 locationService.updateStatus(location.getCode(), QuantityConstant.STATUS_LOCATION_LOCK,warehouseCode);
214 228  
... ...
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... ... @@ -1540,6 +1540,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
1540 1540 //1.先拿到盘点单主单据
1541 1541 CycleCountDetail cycleCountDetail = cycleCountDetailService.getById(taskHeader.getShipmentContainerHeaderId());
1542 1542  
  1543 + if (cycleCountDetail.getSystemQty().compareTo(BigDecimal.ZERO)==0)
  1544 + {
  1545 + return Result.error("盘点单据系统数量为0,不能完成 单据号+" +cycleCountDetail.getCycleCountHeadCode());
  1546 + }
  1547 +
1543 1548 //2.盘点单主单据查明细单据list
1544 1549 LambdaQueryWrapper<CycleCountDetailChild> childLambdaQueryWrapper = new LambdaQueryWrapper<CycleCountDetailChild>();
1545 1550 childLambdaQueryWrapper.eq(CycleCountDetailChild::getCycleCountDetailid,cycleCountDetail.getId());
... ...