| | |
| | | import com.vincent.rsf.server.manager.service.WarehouseAreasService; |
| | | import com.vincent.rsf.server.manager.service.impl.WarehouseAreasServiceImpl; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | | import com.vincent.rsf.server.manager.utils.buildPageRowsUtils; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @Api("库存调整单") |
| | |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<LocRevise, BaseParam> pageParam = new PageParam<>(baseParam, LocRevise.class); |
| | | return R.ok().add(locReviseService.page(pageParam, pageParam.buildWrapper(true))); |
| | | PageParam<LocRevise, BaseParam> page = locReviseService.page(pageParam, pageParam.buildWrapper(true)); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(page)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locRevise:list')") |
| | | @PostMapping("/locRevise/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(locReviseService.list()); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(locReviseService.list())); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locRevise:list')") |
| | | @PostMapping({"/locRevise/many/{ids}", "/locRevises/many/{ids}"}) |
| | | public R many(@PathVariable Long[] ids) { |
| | | return R.ok().add(locReviseService.listByIds(Arrays.asList(ids))); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(locReviseService.listByIds(Arrays.asList(ids)))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locRevise:list')") |
| | | @GetMapping("/locRevise/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(locReviseService.getById(id)); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(locReviseService.getById(id))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locRevise:save')") |
| | |
| | | locRevise.setUpdateBy(getLoginUserId()); |
| | | locRevise.setUpdateTime(new Date()); |
| | | |
| | | return R.ok("Save Success").add(locReviseService.saveRevise(locRevise)); |
| | | return R.ok("Save Success").add(buildPageRowsUtils.rowsMap(locReviseService.saveRevise(locRevise))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locRevise:update')") |
| | |
| | | if (!locReviseService.updateById(locRevise)) { |
| | | return R.error("Update Fail"); |
| | | } |
| | | return R.ok("Update Success").add(locRevise); |
| | | return R.ok("Update Success").add(buildPageRowsUtils.rowsMap(locRevise)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locRevise:remove')") |
| | |
| | | if (!locReviseService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("Delete Fail"); |
| | | } |
| | | return R.ok("Delete Success").add(ids); |
| | | return R.ok("Delete Success").add(buildPageRowsUtils.rowsMap(ids)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locRevise:list')") |
| | |
| | | locReviseService.page(new Page<>(1, 30), wrapper).getRecords().forEach( |
| | | item -> vos.add(new KeyValVo(item.getId(), item.getId())) |
| | | ); |
| | | return R.ok().add(vos); |
| | | return R.ok().add(buildPageRowsUtils.rowsMap(vos)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locRevise:list')") |
| | | @PostMapping("/locRevise/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(locReviseService.list(), LocRevise.class), response); |
| | | ExcelUtil.build(ExcelUtil.create(buildPageRowsUtils.rowsMap(locReviseService.list()), LocRevise.class), response); |
| | | } |
| | | |
| | | } |