| | |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.entity.LocAreaMat; |
| | | import com.vincent.rsf.server.manager.service.LocAreaMatService; |
| | | import com.vincent.rsf.server.manager.utils.buildPageRowsUtils; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | 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(tags = "逻辑分区") |
| | |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<LocAreaMat, BaseParam> pageParam = new PageParam<>(baseParam, LocAreaMat.class); |
| | | return R.ok().add(locAreaMatService.page(pageParam, pageParam.buildWrapper(true))); |
| | | PageParam<LocAreaMat, BaseParam> page = locAreaMatService.page(pageParam, pageParam.buildWrapper(true)); |
| | | buildPageRowsUtils.userNameMap(page.getRecords()); |
| | | return R.ok().add(page); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:locAreaMat:list')") |
| | |
| | | @OperationLog("Create loc areas mats") |
| | | @PostMapping("/locAreaMat/save") |
| | | public R save(@RequestBody LocAreaMat locAreaMat) { |
| | | if (Objects.isNull(locAreaMat.getWarehouseId())) { |
| | | return R.error("仓库不能为空!!"); |
| | | } |
| | | if (Objects.isNull(locAreaMat.getAreaId())) { |
| | | return R.error("库区不能为空!!"); |
| | | } |
| | | locAreaMat.setCreateBy(getLoginUserId()); |
| | | locAreaMat.setCreateTime(new Date()); |
| | | locAreaMat.setUpdateBy(getLoginUserId()); |
| | | locAreaMat.setUpdateTime(new Date()); |
| | | if (!locAreaMatService.save(locAreaMat)) { |
| | | return R.error("Save Fail"); |
| | | } |