Commit 17ffb073335b2347627aad78d510ab0216d86f46
1 parent
228c6760
fix: 1. 编辑单据表头的货主编码,明细没有改变
2. 生成盘点任务前,如果库存做过移库,那么生成盘点任务的起始库位就不准确
Showing
7 changed files
with
31 additions
and
16 deletions
ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerHeaderList.vue
... | ... | @@ -132,7 +132,7 @@ |
132 | 132 | <!-- <a v-else-if="record.status == 0" @click="selectContainerStatus(record)" v-has="'receiptContainerHeader:createTask'"><a-button type="primary">生成任务</a-button><a-divider type="vertical"/></a>--> |
133 | 133 | <a v-if="record.status == 0 && record.taskType == 200" @click="selectPort(record)" v-has="'receiptContainerHeader:createTask'"><a-button type="primary">生成任务</a-button><a-divider type="vertical"/></a> |
134 | 134 | <a v-else-if="record.status == 0" @click="createTask(record)" v-has="'receiptContainerHeader:createTask'"><a-button type="primary">生成任务</a-button><a-divider type="vertical"/></a> |
135 | - <a-popconfirm v-if="record.status == 0" v-has="'receipatContainerHeader:delete'" title="确定取消配盘吗?" @confirm="() => handleDelete(record.id)"> | |
135 | + <a-popconfirm v-if="record.status == 0" v-has="'receiptContainerHeader:delete'" title="确定取消配盘吗?" @confirm="() => handleDelete(record.id)"> | |
136 | 136 | <a><a-button type="danger">取消配盘</a-button> <a-divider type="vertical"/></a> |
137 | 137 | </a-popconfirm> |
138 | 138 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/material/controller/MaterialController.java
... | ... | @@ -16,7 +16,6 @@ import org.jeecg.modules.wms.config.material.entity.Material; |
16 | 16 | import org.jeecg.modules.wms.config.material.entity.SearchDomain; |
17 | 17 | import org.jeecg.modules.wms.config.material.service.IMaterialService; |
18 | 18 | import org.jeecg.utils.HuahengJwtUtil; |
19 | -import org.jeecg.utils.StringUtils; | |
20 | 19 | import org.springframework.beans.factory.annotation.Autowired; |
21 | 20 | import org.springframework.web.bind.annotation.*; |
22 | 21 | import org.springframework.web.servlet.ModelAndView; |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/AutoDeleteTask.java
... | ... | @@ -73,7 +73,8 @@ public class AutoDeleteTask implements Job { |
73 | 73 | shipmentHeaderService.delMain(String.valueOf(shipmentHeader.getId()), QuantityConstant.WMS_COMPLETE_DELETE_RECEIPT); |
74 | 74 | } |
75 | 75 | LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); |
76 | - taskHeaderLambdaQueryWrapper.eq(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_COMPLETED); | |
76 | + taskHeaderLambdaQueryWrapper.eq(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_COMPLETED).ne(TaskHeader::getExceptionState, | |
77 | + QuantityConstant.EXCEPTION_TASK_ERROR); | |
77 | 78 | List<TaskHeader> taskHeaderList = taskHeaderService.list(taskHeaderLambdaQueryWrapper); |
78 | 79 | log.info(String.format(" AutoDeleteTask 执行任务! taskHeaderList :" + taskHeaderList + "时间" + DateUtils.getTimestamp())); |
79 | 80 | for (TaskHeader taskHeader : taskHeaderList) { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptHeader/controller/ReceiptHeaderController.java
... | ... | @@ -130,7 +130,15 @@ public class ReceiptHeaderController extends JeecgController<ReceiptHeader, IRec |
130 | 130 | @RequiresPermissions("receiptHeader:edit") |
131 | 131 | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
132 | 132 | public Result<String> edit(@RequestBody ReceiptHeader receiptHeader) { |
133 | + String companyCode = receiptHeader.getCompanyCode(); | |
133 | 134 | receiptHeaderService.updateById(receiptHeader); |
135 | + if (StringUtils.isNotEmpty(companyCode)) { | |
136 | + List<ReceiptDetail> receiptDetailList = receiptDetailService.selectByMainId(String.valueOf(receiptHeader.getId())); | |
137 | + for (ReceiptDetail receiptDetail : receiptDetailList) { | |
138 | + receiptDetail.setCompanyCode(companyCode); | |
139 | + receiptDetailService.updateById(receiptDetail); | |
140 | + } | |
141 | + } | |
134 | 142 | return Result.OK("编辑成功!"); |
135 | 143 | } |
136 | 144 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/controller/ShipmentHeaderController.java
... | ... | @@ -3,7 +3,6 @@ package org.jeecg.modules.wms.shipment.shipmentHeader.controller; |
3 | 3 | import java.io.IOException; |
4 | 4 | import java.math.BigDecimal; |
5 | 5 | import java.util.Arrays; |
6 | -import java.util.Collections; | |
7 | 6 | import java.util.List; |
8 | 7 | import java.util.Map; |
9 | 8 | import java.util.stream.Collectors; |
... | ... | @@ -16,7 +15,6 @@ import org.apache.shiro.SecurityUtils; |
16 | 15 | import org.apache.shiro.authz.annotation.RequiresPermissions; |
17 | 16 | import org.jeecg.common.api.vo.Result; |
18 | 17 | import org.jeecg.common.aspect.annotation.AutoLog; |
19 | -import org.jeecg.common.exception.JeecgBootException; | |
20 | 18 | import org.jeecg.common.system.base.controller.JeecgController; |
21 | 19 | import org.jeecg.common.system.query.QueryGenerator; |
22 | 20 | import org.jeecg.common.system.vo.LoginUser; |
... | ... | @@ -33,6 +31,7 @@ import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentDetailServ |
33 | 31 | import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentHeaderService; |
34 | 32 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; |
35 | 33 | import org.jeecg.utils.HuahengJwtUtil; |
34 | +import org.jeecg.utils.StringUtils; | |
36 | 35 | import org.jeecg.utils.constant.QuantityConstant; |
37 | 36 | import org.jeecg.utils.support.ApiLogger; |
38 | 37 | import org.jeecgframework.poi.excel.ExcelImportUtil; |
... | ... | @@ -46,15 +45,11 @@ import org.springframework.web.multipart.MultipartFile; |
46 | 45 | import org.springframework.web.multipart.MultipartHttpServletRequest; |
47 | 46 | import org.springframework.web.servlet.ModelAndView; |
48 | 47 | |
49 | -import com.alibaba.fastjson.JSON; | |
50 | 48 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
51 | -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |
52 | 49 | import com.baomidou.mybatisplus.core.metadata.IPage; |
53 | -import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
54 | 50 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
55 | 51 | |
56 | 52 | import cn.monitor4all.logRecord.annotation.OperationLog; |
57 | -import cn.monitor4all.logRecord.context.LogRecordContext; | |
58 | 53 | import io.swagger.annotations.Api; |
59 | 54 | import io.swagger.annotations.ApiOperation; |
60 | 55 | import lombok.extern.slf4j.Slf4j; |
... | ... | @@ -143,7 +138,15 @@ public class ShipmentHeaderController extends JeecgController<ShipmentHeader, IS |
143 | 138 | @RequiresPermissions("shipmentHeader:edit") |
144 | 139 | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
145 | 140 | public Result<String> edit(@RequestBody ShipmentHeader shipmentHeader) { |
141 | + String companyCode = shipmentHeader.getCompanyCode(); | |
146 | 142 | shipmentHeaderService.updateById(shipmentHeader); |
143 | + if (StringUtils.isNotEmpty(companyCode)) { | |
144 | + List<ShipmentDetail> shipmentDetailList = shipmentDetailService.selectByMainId(String.valueOf(shipmentHeader.getId())); | |
145 | + for (ShipmentDetail shipmentDetail : shipmentDetailList) { | |
146 | + shipmentDetail.setCompanyCode(companyCode); | |
147 | + shipmentDetailService.updateById(shipmentDetail); | |
148 | + } | |
149 | + } | |
147 | 150 | return Result.OK("编辑成功!"); |
148 | 151 | } |
149 | 152 | |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailServiceImpl.java
... | ... | @@ -8,7 +8,6 @@ import java.util.stream.Collectors; |
8 | 8 | |
9 | 9 | import javax.annotation.Resource; |
10 | 10 | |
11 | -import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | |
12 | 11 | import org.jeecg.common.api.vo.Result; |
13 | 12 | import org.jeecg.common.exception.JeecgBootException; |
14 | 13 | import org.jeecg.modules.wms.config.container.entity.Container; |
... | ... | @@ -43,6 +42,7 @@ import org.springframework.stereotype.Service; |
43 | 42 | import org.springframework.transaction.annotation.Transactional; |
44 | 43 | |
45 | 44 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
45 | +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | |
46 | 46 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
47 | 47 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
48 | 48 | |
... | ... | @@ -85,6 +85,8 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
85 | 85 | private IShipmentContainerHeaderService shipmentContainerHeaderService; |
86 | 86 | @Resource |
87 | 87 | private IInventoryHeaderService inventoryHeaderService; |
88 | + @Resource | |
89 | + private ContainerServiceImpl containerService; | |
88 | 90 | |
89 | 91 | @Override |
90 | 92 | @Transactional |
... | ... | @@ -206,7 +208,7 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
206 | 208 | cycleCountDetailChildServiceImpl.save(cycleCountDetailChild); |
207 | 209 | } |
208 | 210 | } |
209 | - LambdaQueryWrapper <CycleCountDetail> cycleCountDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
211 | + LambdaQueryWrapper<CycleCountDetail> cycleCountDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
210 | 212 | cycleCountDetailLambdaQueryWrapper.eq(CycleCountDetail::getCycleCountHeadCode, code); |
211 | 213 | List<CycleCountDetail> cycleCountDetailList = cycleCountDetailService.list(cycleCountDetailLambdaQueryWrapper); |
212 | 214 | if (CollectionUtils.isEmpty(cycleCountDetailList)) { |
... | ... | @@ -251,7 +253,11 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
251 | 253 | return Result.error("盘点明细没有子单"); |
252 | 254 | } |
253 | 255 | String containerCode = cycleCountDetail.getContainerCode(); |
254 | - String fromLocationCode = cycleCountDetail.getLocationCode(); | |
256 | + Container container = containerService.getContainerByCode(containerCode, warehouseCode); | |
257 | + if (container == null) { | |
258 | + return Result.error("容器:" + containerCode + "不存在"); | |
259 | + } | |
260 | + String fromLocationCode = container.getLocationCode(); | |
255 | 261 | String toLocationCode = QuantityConstant.EMPTY_STRING; |
256 | 262 | String value = parameterConfigurationService.getValueByCode(QuantityConstant.RULE_TASK_LOCATION); |
257 | 263 | int taskLocationRule = Integer.parseInt(value); |
... | ... | @@ -281,9 +287,9 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
281 | 287 | task.setZoneCode(zoneCode); |
282 | 288 | task.setInnernalTaskType(QuantityConstant.TASK_INTENERTYPE_CYCLECOUNT); |
283 | 289 | task.setTaskType(QuantityConstant.TASK_TYPE_CYCLECOUNT); |
284 | - task.setContainerCode(cycleCountDetail.getContainerCode()); | |
290 | + task.setContainerCode(containerCode); | |
285 | 291 | task.setStatus(QuantityConstant.TASK_STATUS_BUILD); |
286 | - task.setFromLocationCode(cycleCountDetail.getLocationCode()); | |
292 | + task.setFromLocationCode(fromLocationCode); | |
287 | 293 | task.setToPortCode(toPort); |
288 | 294 | task.setSequenceNumber(1); |
289 | 295 | task.setShipmentContainerHeaderId(cycleCoutDetailId); |
... | ... | @@ -297,7 +303,6 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
297 | 303 | throw new JeecgBootException("盘点任务主表生成失败!"); |
298 | 304 | } |
299 | 305 | |
300 | - | |
301 | 306 | for (CycleCountDetailChild item : childList) { |
302 | 307 | // 写入任务细表 |
303 | 308 | TaskDetail taskDetail = new TaskDetail(); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... | ... | @@ -792,7 +792,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
792 | 792 | // 9 更新单据 |
793 | 793 | ShipmentContainerHeader shipmentContainerHeader = shipmentContainerHeaderService.getById(taskHeader.getShipmentContainerHeaderId()); |
794 | 794 | if (shipmentContainerHeader != null) { |
795 | - shipmentContainerHeader.setStatus(QuantityConstant.SHIPMENT_CONTAINER_FINISHED); | |
796 | 795 | success = shipmentContainerHeaderService.updateStatusById(QuantityConstant.SHIPMENT_CONTAINER_FINISHED, shipmentContainerHeader.getId()); |
797 | 796 | if (!success) { |
798 | 797 | throw new JeecgBootException("处理空出失败,更新出库组盘头失败"); |
... | ... |