| | |
| | | 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("库存调整单") |
| | |
| | | |
| | | @Autowired |
| | | private LocReviseService locReviseService; |
| | | @Autowired |
| | | private WarehouseAreasService warehouseAreasService; |
| | | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locRevise:list')") |
| | | @PostMapping("/locRevise/page") |
| | | 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)); |
| | | buildPageRowsUtils.userNameMap(page.getRecords()); |
| | | return R.ok().add(page); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locRevise:list')") |
| | |
| | | locRevise.setUpdateBy(getLoginUserId()); |
| | | locRevise.setUpdateTime(new Date()); |
| | | |
| | | if (Objects.isNull(locRevise.getId())) { |
| | | String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_LOC_REVISE_CODE, null); |
| | | locRevise.setCode(ruleCode); |
| | | } |
| | | |
| | | WarehouseAreas areas = warehouseAreasService.getById(locRevise.getAreaId()); |
| | | if (!Objects.isNull(areas)) { |
| | | locRevise.setAreaId(areas.getId()) |
| | | .setAreaName(areas.getName()); |
| | | } |
| | | |
| | | if (!locReviseService.save(locRevise)) { |
| | | return R.error("Save Fail"); |
| | | } |
| | | return R.ok("Save Success").add(locRevise); |
| | | return R.ok("Save Success").add(locReviseService.saveRevise(locRevise)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locRevise:update')") |