| | |
| | | import cn.iocoder.yudao.framework.common.util.collection.MapUtils; |
| | | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| | | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.sn.vo.MesWmSnDetailRespVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.sn.vo.MesWmSnGenerateReqVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.sn.vo.MesWmSnGroupRespVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.sn.vo.MesWmSnInStockPageReqVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.sn.vo.MesWmSnInStockReqVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.sn.vo.MesWmSnOutStockReqVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.sn.vo.MesWmSnPageReqVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.sn.vo.MesWmSnRespVO; |
| | | import cn.iocoder.yudao.module.mdm.api.item.MdmItemApi; |
| | |
| | | |
| | | @GetMapping("/group-page") |
| | | @Operation(summary = "获得 SN 码分组分页") |
| | | @PreAuthorize("@ss.hasPermission('mes:wm-sn:query')") |
| | | public CommonResult<PageResult<MesWmSnGroupRespVO>> getSnGroupPage(@Valid MesWmSnPageReqVO reqVO) { |
| | | PageResult<MesWmSnGroupRespVO> pageResult = snService.getSnGroupPage(reqVO); |
| | | if (CollUtil.isEmpty(pageResult.getList())) { |
| | |
| | | @GetMapping("/list-by-uuid") |
| | | @Operation(summary = "获得批次 SN 码明细列表") |
| | | @Parameter(name = "uuid", description = "批次 UUID", required = true) |
| | | @PreAuthorize("@ss.hasPermission('mes:wm-sn:query')") |
| | | public CommonResult<List<MesWmSnRespVO>> getSnListByUuid( |
| | | @RequestParam("uuid") @NotBlank(message = "批次 UUID 不能为空") String uuid) { |
| | | List<MesWmSnRespVO> list = BeanUtils.toBean(snService.getSnListByUuid(uuid), MesWmSnRespVO.class); |
| | |
| | | return success(true); |
| | | } |
| | | |
| | | @PostMapping("/in-stock") |
| | | @Operation(summary = "入库登记 SN", description = "按 SN 建立单件入库事务并入台,需物料已启用序列号管理") |
| | | @PreAuthorize("@ss.hasPermission('mes:wm-sn:update')") |
| | | public CommonResult<Boolean> registerSnInStock(@Valid @RequestBody MesWmSnInStockReqVO reqVO) { |
| | | snService.registerSnInStock(reqVO); |
| | | return success(true); |
| | | } |
| | | |
| | | @PostMapping("/out-stock") |
| | | @Operation(summary = "出库核销 SN", description = "按 SN 建立单件出库事务并核销") |
| | | @PreAuthorize("@ss.hasPermission('mes:wm-sn:update')") |
| | | public CommonResult<Boolean> outboundSn(@Valid @RequestBody MesWmSnOutStockReqVO reqVO) { |
| | | snService.outboundSn(reqVO); |
| | | return success(true); |
| | | } |
| | | |
| | | @GetMapping("/detail") |
| | | @Operation(summary = "获得 SN 单件明细", description = "返回状态、在库位置及最近一笔库存事务") |
| | | @Parameter(name = "code", description = "SN 码", required = true, example = "SN20260305000001") |
| | | public CommonResult<MesWmSnDetailRespVO> getSnDetail(@RequestParam("code") @NotBlank(message = "SN 码不能为空") String code) { |
| | | return success(snService.getSnDetail(code)); |
| | | } |
| | | |
| | | @GetMapping("/in-stock-page") |
| | | @Operation(summary = "SN 码状态分页", description = "按状态/物料/库位等维度分页查询 SN(支持盘点核对)") |
| | | public CommonResult<PageResult<MesWmSnRespVO>> getSnInStockPage(@Valid MesWmSnInStockPageReqVO reqVO) { |
| | | PageResult<MesWmSnRespVO> pageResult = BeanUtils.toBean(snService.getSnInStockPage(reqVO), MesWmSnRespVO.class); |
| | | buildSnItemVO(pageResult.getList()); |
| | | return success(pageResult); |
| | | } |
| | | |
| | | @GetMapping("/group-export-excel") |
| | | @Operation(summary = "导出 SN 码分组 Excel") |
| | | @PreAuthorize("@ss.hasPermission('mes:wm-sn:export')") |