Commit 9c0bc5b25eb82a7d9bd6239a1cd85d5808e3a0fb
1 parent
ac1db0c7
✨ feat(mes): 添加盘点任务相关的请求和响应 VO
Showing
15 changed files
with
818 additions
and
14 deletions
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/stocktaking/task/MesWmStockTakingTaskController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.stocktaking.task; | |
| 2 | + | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 4 | +import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | |
| 6 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | |
| 7 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 8 | +import cn.iocoder.yudao.framework.common.util.collection.MapUtils; | |
| 9 | +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | |
| 10 | +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | |
| 11 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.stocktaking.task.vo.*; | |
| 12 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.stocktaking.task.vo.line.MesWmStockTakingTaskLineBatchUpdateReqVO; | |
| 13 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.stocktaking.task.vo.line.MesWmStockTakingTaskLineRespVO; | |
| 14 | +import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdItemDO; | |
| 15 | +import cn.iocoder.yudao.module.mes.dal.dataobject.md.unitmeasure.MesMdUnitMeasureDO; | |
| 16 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.stocktaking.plan.MesWmStockTakingPlanDO; | |
| 17 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.stocktaking.task.MesWmStockTakingTaskDO; | |
| 18 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.stocktaking.task.MesWmStockTakingTaskLineDO; | |
| 19 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.warehouse.MesWmWarehouseAreaDO; | |
| 20 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.warehouse.MesWmWarehouseDO; | |
| 21 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.warehouse.MesWmWarehouseLocationDO; | |
| 22 | +import cn.iocoder.yudao.module.mes.service.md.item.MesMdItemService; | |
| 23 | +import cn.iocoder.yudao.module.mes.service.md.unitmeasure.MesMdUnitMeasureService; | |
| 24 | +import cn.iocoder.yudao.module.mes.service.wm.stocktaking.plan.MesWmStockTakingPlanService; | |
| 25 | +import cn.iocoder.yudao.module.mes.service.wm.stocktaking.task.MesWmStockTakingTaskService; | |
| 26 | +import cn.iocoder.yudao.module.mes.service.wm.warehouse.MesWmWarehouseAreaService; | |
| 27 | +import cn.iocoder.yudao.module.mes.service.wm.warehouse.MesWmWarehouseLocationService; | |
| 28 | +import cn.iocoder.yudao.module.mes.service.wm.warehouse.MesWmWarehouseService; | |
| 29 | +import cn.iocoder.yudao.module.system.api.user.AdminUserApi; | |
| 30 | +import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; | |
| 31 | +import io.swagger.v3.oas.annotations.Operation; | |
| 32 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 33 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 34 | +import jakarta.annotation.Resource; | |
| 35 | +import jakarta.servlet.http.HttpServletResponse; | |
| 36 | +import jakarta.validation.Valid; | |
| 37 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 38 | +import org.springframework.validation.annotation.Validated; | |
| 39 | +import org.springframework.web.bind.annotation.*; | |
| 40 | + | |
| 41 | +import java.io.IOException; | |
| 42 | +import java.math.BigDecimal; | |
| 43 | +import java.util.Collections; | |
| 44 | +import java.util.List; | |
| 45 | +import java.util.Map; | |
| 46 | + | |
| 47 | +import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT; | |
| 48 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | |
| 49 | +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; | |
| 50 | + | |
| 51 | +@Tag(name = "管理后台 - MES 盘点任务") | |
| 52 | +@RestController | |
| 53 | +@RequestMapping("/mes/wm/stocktaking-task") | |
| 54 | +@Validated | |
| 55 | +public class MesWmStockTakingTaskController { | |
| 56 | + | |
| 57 | + @Resource | |
| 58 | + private MesWmStockTakingTaskService stockTakingTaskService; | |
| 59 | + @Resource | |
| 60 | + private MesWmStockTakingPlanService stockTakingPlanService; | |
| 61 | + @Resource | |
| 62 | + private MesMdItemService itemService; | |
| 63 | + @Resource | |
| 64 | + private MesMdUnitMeasureService unitMeasureService; | |
| 65 | + @Resource | |
| 66 | + private MesWmWarehouseService warehouseService; | |
| 67 | + @Resource | |
| 68 | + private MesWmWarehouseLocationService locationService; | |
| 69 | + @Resource | |
| 70 | + private MesWmWarehouseAreaService areaService; | |
| 71 | + | |
| 72 | + @Resource | |
| 73 | + private AdminUserApi adminUserApi; | |
| 74 | + | |
| 75 | + @PostMapping("/create") | |
| 76 | + @Operation(summary = "创建盘点任务") | |
| 77 | + @PreAuthorize("@ss.hasPermission('mes:wm-stock-taking-task:create')") | |
| 78 | + public CommonResult<Long> createStockTakingTask(@Valid @RequestBody MesWmStockTakingTaskSaveReqVO createReqVO) { | |
| 79 | + return success(stockTakingTaskService.createStockTakingTask(createReqVO)); | |
| 80 | + } | |
| 81 | + | |
| 82 | + @PutMapping("/update") | |
| 83 | + @Operation(summary = "修改盘点任务") | |
| 84 | + @PreAuthorize("@ss.hasPermission('mes:wm-stock-taking-task:update')") | |
| 85 | + public CommonResult<Boolean> updateStockTakingTask(@Valid @RequestBody MesWmStockTakingTaskSaveReqVO updateReqVO) { | |
| 86 | + stockTakingTaskService.updateStockTakingTask(updateReqVO); | |
| 87 | + return success(true); | |
| 88 | + } | |
| 89 | + | |
| 90 | + @DeleteMapping("/delete") | |
| 91 | + @Operation(summary = "删除盘点任务") | |
| 92 | + @Parameter(name = "id", description = "编号", required = true) | |
| 93 | + @PreAuthorize("@ss.hasPermission('mes:wm-stock-taking-task:delete')") | |
| 94 | + public CommonResult<Boolean> deleteStockTakingTask(@RequestParam("id") Long id) { | |
| 95 | + stockTakingTaskService.deleteStockTakingTask(id); | |
| 96 | + return success(true); | |
| 97 | + } | |
| 98 | + | |
| 99 | + @PutMapping("/submit") | |
| 100 | + @Operation(summary = "提交盘点任务") | |
| 101 | + @PreAuthorize("@ss.hasPermission('mes:wm-stock-taking-task:update')") | |
| 102 | + public CommonResult<Boolean> submitStockTakingTask(@Valid @RequestBody MesWmStockTakingTaskSubmitReqVO reqVO) { | |
| 103 | + stockTakingTaskService.submitStockTakingTask(reqVO.getId()); | |
| 104 | + return success(true); | |
| 105 | + } | |
| 106 | + | |
| 107 | + @GetMapping("/get") | |
| 108 | + @Operation(summary = "获得盘点任务") | |
| 109 | + @Parameter(name = "id", description = "编号", required = true) | |
| 110 | + @PreAuthorize("@ss.hasPermission('mes:wm-stock-taking-task:query')") | |
| 111 | + public CommonResult<MesWmStockTakingTaskRespVO> getStockTakingTask(@RequestParam("id") Long id) { | |
| 112 | + MesWmStockTakingTaskDO task = stockTakingTaskService.getStockTakingTask(id); | |
| 113 | + if (task == null) { | |
| 114 | + return success(null); | |
| 115 | + } | |
| 116 | + return success(buildTaskRespVOList(Collections.singletonList(task)).get(0)); | |
| 117 | + } | |
| 118 | + | |
| 119 | + @GetMapping("/page") | |
| 120 | + @Operation(summary = "获得盘点任务分页") | |
| 121 | + @PreAuthorize("@ss.hasPermission('mes:wm-stock-taking-task:query')") | |
| 122 | + public CommonResult<PageResult<MesWmStockTakingTaskRespVO>> getStockTakingTaskPage(@Valid MesWmStockTakingTaskPageReqVO pageReqVO) { | |
| 123 | + PageResult<MesWmStockTakingTaskDO> pageResult = stockTakingTaskService.getStockTakingTaskPage(pageReqVO); | |
| 124 | + return success(new PageResult<>(buildTaskRespVOList(pageResult.getList()), pageResult.getTotal())); | |
| 125 | + } | |
| 126 | + | |
| 127 | + @GetMapping("/export-excel") | |
| 128 | + @Operation(summary = "导出盘点任务 Excel") | |
| 129 | + @PreAuthorize("@ss.hasPermission('mes:wm-stock-taking-task:export')") | |
| 130 | + @ApiAccessLog(operateType = EXPORT) | |
| 131 | + public void exportStockTakingTaskExcel(@Valid MesWmStockTakingTaskPageReqVO pageReqVO, | |
| 132 | + HttpServletResponse response) throws IOException { | |
| 133 | + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); | |
| 134 | + PageResult<MesWmStockTakingTaskDO> pageResult = stockTakingTaskService.getStockTakingTaskPage(pageReqVO); | |
| 135 | + ExcelUtils.write(response, "盘点任务.xls", "数据", MesWmStockTakingTaskRespVO.class, | |
| 136 | + buildTaskRespVOList(pageResult.getList())); | |
| 137 | + } | |
| 138 | + | |
| 139 | + @PutMapping("/start") | |
| 140 | + @Operation(summary = "开始盘点任务") | |
| 141 | + @PreAuthorize("@ss.hasPermission('mes:wm-stock-taking-task:update')") | |
| 142 | + public CommonResult<Boolean> startStockTakingTask(@Valid @RequestBody MesWmStockTakingTaskStartReqVO reqVO) { | |
| 143 | + stockTakingTaskService.startStockTakingTask(reqVO.getId()); | |
| 144 | + return success(true); | |
| 145 | + } | |
| 146 | + | |
| 147 | + @PutMapping("/finish") | |
| 148 | + @Operation(summary = "完成盘点任务") | |
| 149 | + @PreAuthorize("@ss.hasPermission('mes:wm-stock-taking-task:finish')") | |
| 150 | + public CommonResult<Boolean> finishStockTakingTask(@Valid @RequestBody MesWmStockTakingTaskFinishReqVO reqVO) { | |
| 151 | + stockTakingTaskService.finishStockTakingTask(reqVO.getId()); | |
| 152 | + return success(true); | |
| 153 | + } | |
| 154 | + | |
| 155 | + @PutMapping("/cancel") | |
| 156 | + @Operation(summary = "取消盘点任务") | |
| 157 | + @PreAuthorize("@ss.hasPermission('mes:wm-stock-taking-task:update')") | |
| 158 | + public CommonResult<Boolean> cancelStockTakingTask(@Valid @RequestBody MesWmStockTakingTaskCancelReqVO reqVO) { | |
| 159 | + stockTakingTaskService.cancelStockTakingTask(reqVO.getId()); | |
| 160 | + return success(true); | |
| 161 | + } | |
| 162 | + | |
| 163 | + @PutMapping("/line-batch-update") | |
| 164 | + @Operation(summary = "批量更新盘点任务行") | |
| 165 | + @PreAuthorize("@ss.hasPermission('mes:wm-stock-taking-task:update')") | |
| 166 | + public CommonResult<Boolean> updateStockTakingTaskLines(@Valid @RequestBody MesWmStockTakingTaskLineBatchUpdateReqVO reqVO) { | |
| 167 | + stockTakingTaskService.updateStockTakingTaskLines(reqVO); | |
| 168 | + return success(true); | |
| 169 | + } | |
| 170 | + | |
| 171 | + @GetMapping("/line-list") | |
| 172 | + @Operation(summary = "获得盘点任务行列表") | |
| 173 | + @Parameter(name = "taskId", description = "任务编号", required = true) | |
| 174 | + @PreAuthorize("@ss.hasPermission('mes:wm-stock-taking-task:query')") | |
| 175 | + public CommonResult<List<MesWmStockTakingTaskLineRespVO>> getStockTakingTaskLineList(@RequestParam("taskId") Long taskId) { | |
| 176 | + return success(buildTaskLineRespVOList(stockTakingTaskService.getStockTakingTaskLineList(taskId))); | |
| 177 | + } | |
| 178 | + | |
| 179 | + private List<MesWmStockTakingTaskRespVO> buildTaskRespVOList(List<MesWmStockTakingTaskDO> list) { | |
| 180 | + if (CollUtil.isEmpty(list)) { | |
| 181 | + return Collections.emptyList(); | |
| 182 | + } | |
| 183 | + Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(convertSet(list, MesWmStockTakingTaskDO::getUserId)); | |
| 184 | + Map<Long, MesWmStockTakingPlanDO> planMap = stockTakingPlanService.getStockTakingPlanMap(convertSet(list, MesWmStockTakingTaskDO::getPlanId)); | |
| 185 | + return BeanUtils.toBean(list, MesWmStockTakingTaskRespVO.class, vo -> { | |
| 186 | + MapUtils.findAndThen(userMap, vo.getUserId(), user -> vo.setUserNickname(user.getNickname())); | |
| 187 | + MapUtils.findAndThen(planMap, vo.getPlanId(), plan -> { | |
| 188 | + vo.setPlanCode(plan.getCode()); | |
| 189 | + vo.setPlanName(plan.getName()); | |
| 190 | + }); | |
| 191 | + }); | |
| 192 | + } | |
| 193 | + | |
| 194 | + private List<MesWmStockTakingTaskLineRespVO> buildTaskLineRespVOList(List<MesWmStockTakingTaskLineDO> list) { | |
| 195 | + if (CollUtil.isEmpty(list)) { | |
| 196 | + return Collections.emptyList(); | |
| 197 | + } | |
| 198 | + Map<Long, MesMdItemDO> itemMap = itemService.getItemMap(convertSet(list, MesWmStockTakingTaskLineDO::getItemId)); | |
| 199 | + Map<Long, MesMdUnitMeasureDO> unitMeasureMap = unitMeasureService.getUnitMeasureMap( | |
| 200 | + convertSet(itemMap.values(), MesMdItemDO::getUnitMeasureId)); | |
| 201 | + Map<Long, MesWmWarehouseDO> warehouseMap = warehouseService.getWarehouseMap(convertSet(list, MesWmStockTakingTaskLineDO::getWarehouseId)); | |
| 202 | + Map<Long, MesWmWarehouseLocationDO> locationMap = locationService.getWarehouseLocationMap(convertSet(list, MesWmStockTakingTaskLineDO::getLocationId)); | |
| 203 | + Map<Long, MesWmWarehouseAreaDO> areaMap = areaService.getWarehouseAreaMap(convertSet(list, MesWmStockTakingTaskLineDO::getAreaId)); | |
| 204 | + return BeanUtils.toBean(list, MesWmStockTakingTaskLineRespVO.class, vo -> { | |
| 205 | + MapUtils.findAndThen(itemMap, vo.getItemId(), item -> { | |
| 206 | + vo.setItemCode(item.getCode()); | |
| 207 | + vo.setItemName(item.getName()); | |
| 208 | + vo.setSpecification(item.getSpecification()); | |
| 209 | + MapUtils.findAndThen(unitMeasureMap, item.getUnitMeasureId(), unit -> vo.setUnitMeasureName(unit.getName())); | |
| 210 | + }); | |
| 211 | + MapUtils.findAndThen(warehouseMap, vo.getWarehouseId(), warehouse -> vo.setWarehouseName(warehouse.getName())); | |
| 212 | + MapUtils.findAndThen(locationMap, vo.getLocationId(), location -> vo.setLocationName(location.getName())); | |
| 213 | + MapUtils.findAndThen(areaMap, vo.getAreaId(), area -> vo.setAreaName(area.getName())); | |
| 214 | + vo.setDifferenceQuantity(defaultQuantity(vo.getTakingQuantity()).subtract(defaultQuantity(vo.getQuantity()))); | |
| 215 | + }); | |
| 216 | + } | |
| 217 | + | |
| 218 | + private BigDecimal defaultQuantity(BigDecimal quantity) { | |
| 219 | + return quantity == null ? BigDecimal.ZERO : quantity; | |
| 220 | + } | |
| 221 | + | |
| 222 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/stocktaking/task/MesWmStockTakingTaskResultController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.stocktaking.task; | |
| 2 | + | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 4 | +import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | |
| 6 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | |
| 7 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 8 | +import cn.iocoder.yudao.framework.common.util.collection.MapUtils; | |
| 9 | +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | |
| 10 | +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | |
| 11 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.stocktaking.task.vo.result.MesWmStockTakingTaskResultPageReqVO; | |
| 12 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.stocktaking.task.vo.result.MesWmStockTakingTaskResultRespVO; | |
| 13 | +import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdItemDO; | |
| 14 | +import cn.iocoder.yudao.module.mes.dal.dataobject.md.unitmeasure.MesMdUnitMeasureDO; | |
| 15 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.stocktaking.task.MesWmStockTakingTaskResultDO; | |
| 16 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.warehouse.MesWmWarehouseAreaDO; | |
| 17 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.warehouse.MesWmWarehouseDO; | |
| 18 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.warehouse.MesWmWarehouseLocationDO; | |
| 19 | +import cn.iocoder.yudao.module.mes.service.md.item.MesMdItemService; | |
| 20 | +import cn.iocoder.yudao.module.mes.service.md.unitmeasure.MesMdUnitMeasureService; | |
| 21 | +import cn.iocoder.yudao.module.mes.service.wm.stocktaking.task.MesWmStockTakingTaskResultService; | |
| 22 | +import cn.iocoder.yudao.module.mes.service.wm.warehouse.MesWmWarehouseAreaService; | |
| 23 | +import cn.iocoder.yudao.module.mes.service.wm.warehouse.MesWmWarehouseLocationService; | |
| 24 | +import cn.iocoder.yudao.module.mes.service.wm.warehouse.MesWmWarehouseService; | |
| 25 | +import io.swagger.v3.oas.annotations.Operation; | |
| 26 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 27 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 28 | +import jakarta.annotation.Resource; | |
| 29 | +import jakarta.servlet.http.HttpServletResponse; | |
| 30 | +import jakarta.validation.Valid; | |
| 31 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 32 | +import org.springframework.validation.annotation.Validated; | |
| 33 | +import org.springframework.web.bind.annotation.GetMapping; | |
| 34 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 35 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 36 | +import org.springframework.web.bind.annotation.RestController; | |
| 37 | + | |
| 38 | +import java.io.IOException; | |
| 39 | +import java.util.Collections; | |
| 40 | +import java.util.List; | |
| 41 | +import java.util.Map; | |
| 42 | + | |
| 43 | +import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT; | |
| 44 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | |
| 45 | +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; | |
| 46 | + | |
| 47 | +@Tag(name = "管理后台 - MES 盘点结果") | |
| 48 | +@RestController | |
| 49 | +@RequestMapping("/mes/wm/stocktaking-task-result") | |
| 50 | +@Validated | |
| 51 | +public class MesWmStockTakingTaskResultController { | |
| 52 | + | |
| 53 | + @Resource | |
| 54 | + private MesWmStockTakingTaskResultService stockTakingTaskResultService; | |
| 55 | + @Resource | |
| 56 | + private MesMdItemService itemService; | |
| 57 | + @Resource | |
| 58 | + private MesMdUnitMeasureService unitMeasureService; | |
| 59 | + @Resource | |
| 60 | + private MesWmWarehouseService warehouseService; | |
| 61 | + @Resource | |
| 62 | + private MesWmWarehouseLocationService locationService; | |
| 63 | + @Resource | |
| 64 | + private MesWmWarehouseAreaService areaService; | |
| 65 | + | |
| 66 | + @GetMapping("/get") | |
| 67 | + @Operation(summary = "获得盘点结果") | |
| 68 | + @Parameter(name = "id", description = "编号", required = true) | |
| 69 | + @PreAuthorize("@ss.hasPermission('mes:wm-stock-taking-task:query')") | |
| 70 | + public CommonResult<MesWmStockTakingTaskResultRespVO> getStockTakingTaskResult(@RequestParam("id") Long id) { | |
| 71 | + MesWmStockTakingTaskResultDO result = stockTakingTaskResultService.getStockTakingTaskResult(id); | |
| 72 | + if (result == null) { | |
| 73 | + return success(null); | |
| 74 | + } | |
| 75 | + return success(buildRespVOList(Collections.singletonList(result)).get(0)); | |
| 76 | + } | |
| 77 | + | |
| 78 | + @GetMapping("/page") | |
| 79 | + @Operation(summary = "获得盘点结果分页") | |
| 80 | + @PreAuthorize("@ss.hasPermission('mes:wm-stock-taking-task:query')") | |
| 81 | + public CommonResult<PageResult<MesWmStockTakingTaskResultRespVO>> getStockTakingTaskResultPage(@Valid MesWmStockTakingTaskResultPageReqVO pageReqVO) { | |
| 82 | + PageResult<MesWmStockTakingTaskResultDO> pageResult = stockTakingTaskResultService.getStockTakingTaskResultPage(pageReqVO); | |
| 83 | + return success(new PageResult<>(buildRespVOList(pageResult.getList()), pageResult.getTotal())); | |
| 84 | + } | |
| 85 | + | |
| 86 | + @GetMapping("/list") | |
| 87 | + @Operation(summary = "获得盘点结果列表") | |
| 88 | + @Parameter(name = "taskId", description = "任务编号", required = true) | |
| 89 | + @PreAuthorize("@ss.hasPermission('mes:wm-stock-taking-task:query')") | |
| 90 | + public CommonResult<List<MesWmStockTakingTaskResultRespVO>> getStockTakingTaskResultList(@RequestParam("taskId") Long taskId) { | |
| 91 | + return success(buildRespVOList(stockTakingTaskResultService.getStockTakingTaskResultList(taskId))); | |
| 92 | + } | |
| 93 | + | |
| 94 | + @GetMapping("/export-excel") | |
| 95 | + @Operation(summary = "导出盘点结果 Excel") | |
| 96 | + @PreAuthorize("@ss.hasPermission('mes:wm-stock-taking-task:export')") | |
| 97 | + @ApiAccessLog(operateType = EXPORT) | |
| 98 | + public void exportStockTakingTaskResultExcel(@Valid MesWmStockTakingTaskResultPageReqVO pageReqVO, | |
| 99 | + HttpServletResponse response) throws IOException { | |
| 100 | + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); | |
| 101 | + PageResult<MesWmStockTakingTaskResultDO> pageResult = stockTakingTaskResultService.getStockTakingTaskResultPage(pageReqVO); | |
| 102 | + ExcelUtils.write(response, "盘点结果.xls", "数据", MesWmStockTakingTaskResultRespVO.class, | |
| 103 | + buildRespVOList(pageResult.getList())); | |
| 104 | + } | |
| 105 | + | |
| 106 | + private List<MesWmStockTakingTaskResultRespVO> buildRespVOList(List<MesWmStockTakingTaskResultDO> list) { | |
| 107 | + if (CollUtil.isEmpty(list)) { | |
| 108 | + return Collections.emptyList(); | |
| 109 | + } | |
| 110 | + Map<Long, MesMdItemDO> itemMap = itemService.getItemMap(convertSet(list, MesWmStockTakingTaskResultDO::getItemId)); | |
| 111 | + Map<Long, MesMdUnitMeasureDO> unitMeasureMap = unitMeasureService.getUnitMeasureMap( | |
| 112 | + convertSet(itemMap.values(), MesMdItemDO::getUnitMeasureId)); | |
| 113 | + Map<Long, MesWmWarehouseDO> warehouseMap = warehouseService.getWarehouseMap(convertSet(list, MesWmStockTakingTaskResultDO::getWarehouseId)); | |
| 114 | + Map<Long, MesWmWarehouseLocationDO> locationMap = locationService.getWarehouseLocationMap(convertSet(list, MesWmStockTakingTaskResultDO::getLocationId)); | |
| 115 | + Map<Long, MesWmWarehouseAreaDO> areaMap = areaService.getWarehouseAreaMap(convertSet(list, MesWmStockTakingTaskResultDO::getAreaId)); | |
| 116 | + return BeanUtils.toBean(list, MesWmStockTakingTaskResultRespVO.class, vo -> { | |
| 117 | + MapUtils.findAndThen(itemMap, vo.getItemId(), item -> { | |
| 118 | + vo.setItemCode(item.getCode()); | |
| 119 | + vo.setItemName(item.getName()); | |
| 120 | + vo.setSpecification(item.getSpecification()); | |
| 121 | + MapUtils.findAndThen(unitMeasureMap, item.getUnitMeasureId(), unit -> vo.setUnitMeasureName(unit.getName())); | |
| 122 | + }); | |
| 123 | + MapUtils.findAndThen(warehouseMap, vo.getWarehouseId(), warehouse -> vo.setWarehouseName(warehouse.getName())); | |
| 124 | + MapUtils.findAndThen(locationMap, vo.getLocationId(), location -> vo.setLocationName(location.getName())); | |
| 125 | + MapUtils.findAndThen(areaMap, vo.getAreaId(), area -> vo.setAreaName(area.getName())); | |
| 126 | + }); | |
| 127 | + } | |
| 128 | + | |
| 129 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/stocktaking/task/vo/MesWmStockTakingTaskCancelReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.stocktaking.task.vo; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import jakarta.validation.constraints.NotNull; | |
| 5 | +import lombok.Data; | |
| 6 | + | |
| 7 | +@Schema(description = "管理后台 - MES 盘点任务取消 Request VO") | |
| 8 | +@Data | |
| 9 | +public class MesWmStockTakingTaskCancelReqVO { | |
| 10 | + | |
| 11 | + @Schema(description = "任务编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 12 | + @NotNull(message = "任务编号不能为空") | |
| 13 | + private Long id; | |
| 14 | + | |
| 15 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/stocktaking/task/vo/MesWmStockTakingTaskFinishReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.stocktaking.task.vo; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import jakarta.validation.constraints.NotNull; | |
| 5 | +import lombok.Data; | |
| 6 | + | |
| 7 | +@Schema(description = "管理后台 - MES 盘点任务完成 Request VO") | |
| 8 | +@Data | |
| 9 | +public class MesWmStockTakingTaskFinishReqVO { | |
| 10 | + | |
| 11 | + @Schema(description = "任务编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 12 | + @NotNull(message = "任务编号不能为空") | |
| 13 | + private Long id; | |
| 14 | + | |
| 15 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/stocktaking/task/vo/MesWmStockTakingTaskPageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.stocktaking.task.vo; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | |
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 5 | +import lombok.Data; | |
| 6 | +import lombok.EqualsAndHashCode; | |
| 7 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 8 | + | |
| 9 | +import java.time.LocalDateTime; | |
| 10 | + | |
| 11 | +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 12 | + | |
| 13 | +@Schema(description = "管理后台 - MES 盘点任务分页 Request VO") | |
| 14 | +@Data | |
| 15 | +@EqualsAndHashCode(callSuper = true) | |
| 16 | +public class MesWmStockTakingTaskPageReqVO extends PageParam { | |
| 17 | + | |
| 18 | + @Schema(description = "任务编码", example = "ST202603080001") | |
| 19 | + private String code; | |
| 20 | + | |
| 21 | + @Schema(description = "任务名称", example = "原料仓月度盘点任务") | |
| 22 | + private String name; | |
| 23 | + | |
| 24 | + @Schema(description = "盘点类型", example = "1") | |
| 25 | + private Integer type; | |
| 26 | + | |
| 27 | + @Schema(description = "状态", example = "0") | |
| 28 | + private Integer status; | |
| 29 | + | |
| 30 | + @Schema(description = "盘点人 ID", example = "1") | |
| 31 | + private Long userId; | |
| 32 | + | |
| 33 | + @Schema(description = "来源方案 ID", example = "1") | |
| 34 | + private Long planId; | |
| 35 | + | |
| 36 | + @Schema(description = "盘点日期范围") | |
| 37 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 38 | + private LocalDateTime[] takingDate; | |
| 39 | + | |
| 40 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/stocktaking/task/vo/MesWmStockTakingTaskRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.stocktaking.task.vo; | |
| 2 | + | |
| 3 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; | |
| 4 | +import cn.idev.excel.annotation.ExcelProperty; | |
| 5 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 6 | +import lombok.Data; | |
| 7 | + | |
| 8 | +import java.time.LocalDateTime; | |
| 9 | + | |
| 10 | +@Schema(description = "管理后台 - MES 盘点任务 Response VO") | |
| 11 | +@Data | |
| 12 | +@ExcelIgnoreUnannotated | |
| 13 | +public class MesWmStockTakingTaskRespVO { | |
| 14 | + | |
| 15 | + @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 16 | + @ExcelProperty("编号") | |
| 17 | + private Long id; | |
| 18 | + | |
| 19 | + @Schema(description = "任务编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "ST202603080001") | |
| 20 | + @ExcelProperty("任务编码") | |
| 21 | + private String code; | |
| 22 | + | |
| 23 | + @Schema(description = "任务名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "原料仓月度盘点任务") | |
| 24 | + @ExcelProperty("任务名称") | |
| 25 | + private String name; | |
| 26 | + | |
| 27 | + @Schema(description = "盘点日期") | |
| 28 | + @ExcelProperty("盘点日期") | |
| 29 | + private LocalDateTime takingDate; | |
| 30 | + | |
| 31 | + @Schema(description = "盘点类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 32 | + @ExcelProperty("盘点类型") | |
| 33 | + private Integer type; | |
| 34 | + | |
| 35 | + @Schema(description = "盘点人 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 36 | + private Long userId; | |
| 37 | + | |
| 38 | + @Schema(description = "盘点人昵称", example = "管理员") | |
| 39 | + @ExcelProperty("盘点人") | |
| 40 | + private String userNickname; | |
| 41 | + | |
| 42 | + @Schema(description = "来源方案 ID", example = "1") | |
| 43 | + private Long planId; | |
| 44 | + | |
| 45 | + @Schema(description = "来源方案编码", example = "STP202603080001") | |
| 46 | + @ExcelProperty("方案编码") | |
| 47 | + private String planCode; | |
| 48 | + | |
| 49 | + @Schema(description = "来源方案名称", example = "原料仓月度盘点方案") | |
| 50 | + @ExcelProperty("方案名称") | |
| 51 | + private String planName; | |
| 52 | + | |
| 53 | + @Schema(description = "是否盲盘", requiredMode = Schema.RequiredMode.REQUIRED, example = "false") | |
| 54 | + @ExcelProperty("是否盲盘") | |
| 55 | + private Boolean blindFlag; | |
| 56 | + | |
| 57 | + @Schema(description = "是否冻结库存", requiredMode = Schema.RequiredMode.REQUIRED, example = "false") | |
| 58 | + @ExcelProperty("是否冻结库存") | |
| 59 | + private Boolean frozenFlag; | |
| 60 | + | |
| 61 | + @Schema(description = "快照时间") | |
| 62 | + @ExcelProperty("快照时间") | |
| 63 | + private LocalDateTime snapshotTime; | |
| 64 | + | |
| 65 | + @Schema(description = "开始时间") | |
| 66 | + @ExcelProperty("开始时间") | |
| 67 | + private LocalDateTime startTime; | |
| 68 | + | |
| 69 | + @Schema(description = "结束时间") | |
| 70 | + @ExcelProperty("结束时间") | |
| 71 | + private LocalDateTime endTime; | |
| 72 | + | |
| 73 | + @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0") | |
| 74 | + @ExcelProperty("状态") | |
| 75 | + private Integer status; | |
| 76 | + | |
| 77 | + @Schema(description = "是否已调账", requiredMode = Schema.RequiredMode.REQUIRED, example = "false") | |
| 78 | + @ExcelProperty("是否已调账") | |
| 79 | + private Boolean adjustedFlag; | |
| 80 | + | |
| 81 | + @Schema(description = "备注", example = "备注") | |
| 82 | + @ExcelProperty("备注") | |
| 83 | + private String remark; | |
| 84 | + | |
| 85 | + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 86 | + @ExcelProperty("创建时间") | |
| 87 | + private LocalDateTime createTime; | |
| 88 | + | |
| 89 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/stocktaking/task/vo/MesWmStockTakingTaskSaveReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.stocktaking.task.vo; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import jakarta.validation.constraints.NotEmpty; | |
| 5 | +import jakarta.validation.constraints.NotNull; | |
| 6 | +import lombok.Data; | |
| 7 | + | |
| 8 | +import java.time.LocalDateTime; | |
| 9 | + | |
| 10 | +@Schema(description = "管理后台 - MES 盘点任务新增/修改 Request VO") | |
| 11 | +@Data | |
| 12 | +public class MesWmStockTakingTaskSaveReqVO { | |
| 13 | + | |
| 14 | + @Schema(description = "编号", example = "1024") | |
| 15 | + private Long id; | |
| 16 | + | |
| 17 | + @Schema(description = "任务编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "ST202603080001") | |
| 18 | + @NotEmpty(message = "任务编码不能为空") | |
| 19 | + private String code; | |
| 20 | + | |
| 21 | + @Schema(description = "任务名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "原料仓月度盘点任务") | |
| 22 | + @NotEmpty(message = "任务名称不能为空") | |
| 23 | + private String name; | |
| 24 | + | |
| 25 | + @Schema(description = "盘点日期") | |
| 26 | + private LocalDateTime takingDate; | |
| 27 | + | |
| 28 | + @Schema(description = "盘点类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 29 | + @NotNull(message = "盘点类型不能为空") | |
| 30 | + private Integer type; | |
| 31 | + | |
| 32 | + @Schema(description = "盘点人 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 33 | + @NotNull(message = "盘点人不能为空") | |
| 34 | + private Long userId; | |
| 35 | + | |
| 36 | + @Schema(description = "来源方案 ID", example = "1") | |
| 37 | + private Long planId; | |
| 38 | + | |
| 39 | + @Schema(description = "是否盲盘", example = "false") | |
| 40 | + @NotNull(message = "是否盲盘不能为空") | |
| 41 | + private Boolean blindFlag; | |
| 42 | + | |
| 43 | + @Schema(description = "是否冻结库存", example = "false") | |
| 44 | + @NotNull(message = "是否冻结库存不能为空") | |
| 45 | + private Boolean frozenFlag; | |
| 46 | + | |
| 47 | + @Schema(description = "备注", example = "备注") | |
| 48 | + private String remark; | |
| 49 | + | |
| 50 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/stocktaking/task/vo/MesWmStockTakingTaskStartReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.stocktaking.task.vo; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import jakarta.validation.constraints.NotNull; | |
| 5 | +import lombok.Data; | |
| 6 | + | |
| 7 | +@Schema(description = "管理后台 - MES 盘点任务开始 Request VO") | |
| 8 | +@Data | |
| 9 | +public class MesWmStockTakingTaskStartReqVO { | |
| 10 | + | |
| 11 | + @Schema(description = "任务编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 12 | + @NotNull(message = "任务编号不能为空") | |
| 13 | + private Long id; | |
| 14 | + | |
| 15 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/stocktaking/task/vo/line/MesWmStockTakingTaskLineBatchUpdateReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.stocktaking.task.vo.line; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import jakarta.validation.Valid; | |
| 5 | +import jakarta.validation.constraints.NotEmpty; | |
| 6 | +import jakarta.validation.constraints.NotNull; | |
| 7 | +import lombok.Data; | |
| 8 | + | |
| 9 | +import java.math.BigDecimal; | |
| 10 | +import java.util.List; | |
| 11 | + | |
| 12 | +@Schema(description = "管理后台 - MES 盘点任务行批量更新 Request VO") | |
| 13 | +@Data | |
| 14 | +public class MesWmStockTakingTaskLineBatchUpdateReqVO { | |
| 15 | + | |
| 16 | + @Schema(description = "任务编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 17 | + @NotNull(message = "任务编号不能为空") | |
| 18 | + private Long taskId; | |
| 19 | + | |
| 20 | + @Schema(description = "任务行列表") | |
| 21 | + @NotEmpty(message = "任务行不能为空") | |
| 22 | + @Valid | |
| 23 | + private List<Item> items; | |
| 24 | + | |
| 25 | + @Data | |
| 26 | + public static class Item { | |
| 27 | + | |
| 28 | + @Schema(description = "任务行编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 29 | + @NotNull(message = "任务行编号不能为空") | |
| 30 | + private Long id; | |
| 31 | + | |
| 32 | + @Schema(description = "实盘数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "98.000000") | |
| 33 | + @NotNull(message = "实盘数量不能为空") | |
| 34 | + private BigDecimal takingQuantity; | |
| 35 | + | |
| 36 | + @Schema(description = "备注", example = "备注") | |
| 37 | + private String remark; | |
| 38 | + | |
| 39 | + } | |
| 40 | + | |
| 41 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/stocktaking/task/vo/line/MesWmStockTakingTaskLineRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.stocktaking.task.vo.line; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import lombok.Data; | |
| 5 | + | |
| 6 | +import java.math.BigDecimal; | |
| 7 | + | |
| 8 | +@Schema(description = "管理后台 - MES 盘点任务行 Response VO") | |
| 9 | +@Data | |
| 10 | +public class MesWmStockTakingTaskLineRespVO { | |
| 11 | + | |
| 12 | + @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 13 | + private Long id; | |
| 14 | + | |
| 15 | + @Schema(description = "任务 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 16 | + private Long taskId; | |
| 17 | + | |
| 18 | + @Schema(description = "库存台账 ID", example = "1") | |
| 19 | + private Long materialStockId; | |
| 20 | + | |
| 21 | + @Schema(description = "物料 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 22 | + private Long itemId; | |
| 23 | + | |
| 24 | + @Schema(description = "物料编码", example = "ITEM001") | |
| 25 | + private String itemCode; | |
| 26 | + | |
| 27 | + @Schema(description = "物料名称", example = "钢板") | |
| 28 | + private String itemName; | |
| 29 | + | |
| 30 | + @Schema(description = "规格型号", example = "10mm*100mm") | |
| 31 | + private String specification; | |
| 32 | + | |
| 33 | + @Schema(description = "计量单位名称", example = "千克") | |
| 34 | + private String unitMeasureName; | |
| 35 | + | |
| 36 | + @Schema(description = "批次 ID", example = "1") | |
| 37 | + private Long batchId; | |
| 38 | + | |
| 39 | + @Schema(description = "批次编码", example = "B202603080001") | |
| 40 | + private String batchCode; | |
| 41 | + | |
| 42 | + @Schema(description = "账面数量", example = "100.000000") | |
| 43 | + private BigDecimal quantity; | |
| 44 | + | |
| 45 | + @Schema(description = "实盘数量", example = "98.000000") | |
| 46 | + private BigDecimal takingQuantity; | |
| 47 | + | |
| 48 | + @Schema(description = "差异数量", example = "-2.000000") | |
| 49 | + private BigDecimal differenceQuantity; | |
| 50 | + | |
| 51 | + @Schema(description = "仓库 ID", example = "1") | |
| 52 | + private Long warehouseId; | |
| 53 | + | |
| 54 | + @Schema(description = "仓库名称", example = "原料仓") | |
| 55 | + private String warehouseName; | |
| 56 | + | |
| 57 | + @Schema(description = "库区 ID", example = "1") | |
| 58 | + private Long locationId; | |
| 59 | + | |
| 60 | + @Schema(description = "库区名称", example = "A 区") | |
| 61 | + private String locationName; | |
| 62 | + | |
| 63 | + @Schema(description = "库位 ID", example = "1") | |
| 64 | + private Long areaId; | |
| 65 | + | |
| 66 | + @Schema(description = "库位名称", example = "A-01") | |
| 67 | + private String areaName; | |
| 68 | + | |
| 69 | + @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0") | |
| 70 | + private Integer status; | |
| 71 | + | |
| 72 | + @Schema(description = "备注", example = "备注") | |
| 73 | + private String remark; | |
| 74 | + | |
| 75 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/stocktaking/task/vo/result/MesWmStockTakingTaskResultPageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.stocktaking.task.vo.result; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | |
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 5 | +import lombok.Data; | |
| 6 | +import lombok.EqualsAndHashCode; | |
| 7 | + | |
| 8 | +@Schema(description = "管理后台 - MES 盘点结果分页 Request VO") | |
| 9 | +@Data | |
| 10 | +@EqualsAndHashCode(callSuper = true) | |
| 11 | +public class MesWmStockTakingTaskResultPageReqVO extends PageParam { | |
| 12 | + | |
| 13 | + @Schema(description = "任务编号", example = "1") | |
| 14 | + private Long taskId; | |
| 15 | + | |
| 16 | + @Schema(description = "物料编号", example = "1") | |
| 17 | + private Long itemId; | |
| 18 | + | |
| 19 | + @Schema(description = "仓库编号", example = "1") | |
| 20 | + private Long warehouseId; | |
| 21 | + | |
| 22 | + @Schema(description = "库区编号", example = "1") | |
| 23 | + private Long locationId; | |
| 24 | + | |
| 25 | + @Schema(description = "库位编号", example = "1") | |
| 26 | + private Long areaId; | |
| 27 | + | |
| 28 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/stocktaking/task/vo/result/MesWmStockTakingTaskResultRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.stocktaking.task.vo.result; | |
| 2 | + | |
| 3 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; | |
| 4 | +import cn.idev.excel.annotation.ExcelProperty; | |
| 5 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 6 | +import lombok.Data; | |
| 7 | + | |
| 8 | +import java.math.BigDecimal; | |
| 9 | +import java.time.LocalDateTime; | |
| 10 | + | |
| 11 | +@Schema(description = "管理后台 - MES 盘点结果 Response VO") | |
| 12 | +@Data | |
| 13 | +@ExcelIgnoreUnannotated | |
| 14 | +public class MesWmStockTakingTaskResultRespVO { | |
| 15 | + | |
| 16 | + @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 17 | + @ExcelProperty("编号") | |
| 18 | + private Long id; | |
| 19 | + | |
| 20 | + @Schema(description = "任务 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 21 | + private Long taskId; | |
| 22 | + | |
| 23 | + @Schema(description = "任务行 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 24 | + private Long lineId; | |
| 25 | + | |
| 26 | + @Schema(description = "库存台账 ID", example = "1") | |
| 27 | + private Long materialStockId; | |
| 28 | + | |
| 29 | + @Schema(description = "物料 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 30 | + private Long itemId; | |
| 31 | + | |
| 32 | + @Schema(description = "物料编码", example = "ITEM001") | |
| 33 | + @ExcelProperty("物料编码") | |
| 34 | + private String itemCode; | |
| 35 | + | |
| 36 | + @Schema(description = "物料名称", example = "钢板") | |
| 37 | + @ExcelProperty("物料名称") | |
| 38 | + private String itemName; | |
| 39 | + | |
| 40 | + @Schema(description = "规格型号", example = "10mm*100mm") | |
| 41 | + @ExcelProperty("规格型号") | |
| 42 | + private String specification; | |
| 43 | + | |
| 44 | + @Schema(description = "计量单位名称", example = "千克") | |
| 45 | + @ExcelProperty("计量单位") | |
| 46 | + private String unitMeasureName; | |
| 47 | + | |
| 48 | + @Schema(description = "批次 ID", example = "1") | |
| 49 | + private Long batchId; | |
| 50 | + | |
| 51 | + @Schema(description = "批次编码", example = "B202603080001") | |
| 52 | + @ExcelProperty("批次编码") | |
| 53 | + private String batchCode; | |
| 54 | + | |
| 55 | + @Schema(description = "仓库 ID", example = "1") | |
| 56 | + private Long warehouseId; | |
| 57 | + | |
| 58 | + @Schema(description = "仓库名称", example = "原料仓") | |
| 59 | + @ExcelProperty("仓库") | |
| 60 | + private String warehouseName; | |
| 61 | + | |
| 62 | + @Schema(description = "库区 ID", example = "1") | |
| 63 | + private Long locationId; | |
| 64 | + | |
| 65 | + @Schema(description = "库区名称", example = "A 区") | |
| 66 | + @ExcelProperty("库区") | |
| 67 | + private String locationName; | |
| 68 | + | |
| 69 | + @Schema(description = "库位 ID", example = "1") | |
| 70 | + private Long areaId; | |
| 71 | + | |
| 72 | + @Schema(description = "库位名称", example = "A-01") | |
| 73 | + @ExcelProperty("库位") | |
| 74 | + private String areaName; | |
| 75 | + | |
| 76 | + @Schema(description = "账面数量", example = "100.000000") | |
| 77 | + @ExcelProperty("账面数量") | |
| 78 | + private BigDecimal quantity; | |
| 79 | + | |
| 80 | + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 81 | + @ExcelProperty("创建时间") | |
| 82 | + private LocalDateTime createTime; | |
| 83 | + | |
| 84 | + @Schema(description = "备注", example = "备注") | |
| 85 | + @ExcelProperty("备注") | |
| 86 | + private String remark; | |
| 87 | + | |
| 88 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/wm/stocktaking/task/MesWmStockTakingTaskLineMapper.java
| ... | ... | @@ -2,15 +2,16 @@ package cn.iocoder.yudao.module.mes.dal.mysql.wm.stocktaking.task; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 4 | 4 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 5 | -import cn.iocoder.yudao.module.mes.dal.dataobject.wm.stocktaking.MesWmStockTakingTaskLineDO; | |
| 5 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.stocktaking.task.MesWmStockTakingTaskLineDO; | |
| 6 | 6 | import org.apache.ibatis.annotations.Mapper; |
| 7 | 7 | |
| 8 | -import java.util.Collection; | |
| 9 | 8 | import java.util.List; |
| 10 | 9 | import java.util.Set; |
| 11 | 10 | |
| 12 | 11 | /** |
| 13 | 12 | * MES 盘点任务行 Mapper |
| 13 | + * | |
| 14 | + * @author 芋道源码 | |
| 14 | 15 | */ |
| 15 | 16 | @Mapper |
| 16 | 17 | public interface MesWmStockTakingTaskLineMapper extends BaseMapperX<MesWmStockTakingTaskLineDO> { |
| ... | ... | @@ -21,14 +22,6 @@ public interface MesWmStockTakingTaskLineMapper extends BaseMapperX<MesWmStockTa |
| 21 | 22 | .orderByAsc(MesWmStockTakingTaskLineDO::getId)); |
| 22 | 23 | } |
| 23 | 24 | |
| 24 | - default List<MesWmStockTakingTaskLineDO> selectListByTaskIds(Collection<Long> taskIds) { | |
| 25 | - return selectList(MesWmStockTakingTaskLineDO::getTaskId, taskIds); | |
| 26 | - } | |
| 27 | - | |
| 28 | - default List<MesWmStockTakingTaskLineDO> selectListByIds(Collection<Long> ids) { | |
| 29 | - return selectByIds(ids); | |
| 30 | - } | |
| 31 | - | |
| 32 | 25 | default List<MesWmStockTakingTaskLineDO> selectListByTaskIdAndIds(Long taskId, Set<Long> ids) { |
| 33 | 26 | return selectList(new LambdaQueryWrapperX<MesWmStockTakingTaskLineDO>() |
| 34 | 27 | .eq(MesWmStockTakingTaskLineDO::getTaskId, taskId) | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/wm/stocktaking/task/MesWmStockTakingTaskMapper.java
| ... | ... | @@ -3,12 +3,14 @@ package cn.iocoder.yudao.module.mes.dal.mysql.wm.stocktaking.task; |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | 4 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 5 | 5 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 6 | -import cn.iocoder.yudao.module.mes.controller.admin.wm.stocktaking.vo.task.MesWmStockTakingTaskPageReqVO; | |
| 7 | -import cn.iocoder.yudao.module.mes.dal.dataobject.wm.stocktaking.MesWmStockTakingTaskDO; | |
| 6 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.stocktaking.task.vo.MesWmStockTakingTaskPageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.stocktaking.task.MesWmStockTakingTaskDO; | |
| 8 | 8 | import org.apache.ibatis.annotations.Mapper; |
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * MES 盘点任务 Mapper |
| 12 | + * | |
| 13 | + * @author 芋道源码 | |
| 12 | 14 | */ |
| 13 | 15 | @Mapper |
| 14 | 16 | public interface MesWmStockTakingTaskMapper extends BaseMapperX<MesWmStockTakingTaskDO> { | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/wm/stocktaking/task/MesWmStockTakingTaskResultMapper.java
| ... | ... | @@ -3,14 +3,16 @@ package cn.iocoder.yudao.module.mes.dal.mysql.wm.stocktaking.task; |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | 4 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 5 | 5 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 6 | -import cn.iocoder.yudao.module.mes.controller.admin.wm.stocktaking.vo.result.MesWmStockTakingTaskResultPageReqVO; | |
| 7 | -import cn.iocoder.yudao.module.mes.dal.dataobject.wm.stocktaking.MesWmStockTakingTaskResultDO; | |
| 6 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.stocktaking.task.vo.result.MesWmStockTakingTaskResultPageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.stocktaking.task.MesWmStockTakingTaskResultDO; | |
| 8 | 8 | import org.apache.ibatis.annotations.Mapper; |
| 9 | 9 | |
| 10 | 10 | import java.util.List; |
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * MES 盘点结果 Mapper |
| 14 | + * | |
| 15 | + * @author 芋道源码 | |
| 14 | 16 | */ |
| 15 | 17 | @Mapper |
| 16 | 18 | public interface MesWmStockTakingTaskResultMapper extends BaseMapperX<MesWmStockTakingTaskResultDO> { | ... | ... |