| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.zy.acs.common.utils.GsonUtils; |
| | | import com.zy.acs.common.utils.Utils; |
| | | import com.zy.acs.framework.common.Cools; |
| | | import com.zy.acs.framework.common.R; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @RestController |
| | | @RequestMapping("/api") |
| | |
| | | return R.ok("Update Success").add(loc); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:loc:update')") |
| | | @OperationLog("Update Loc") |
| | | @PostMapping("/loc/update/many") |
| | | public R updateMany(@RequestBody List<Loc> locList) { |
| | | if (!Cools.isEmpty(locList)) { |
| | | for (Loc loc : locList) { |
| | | loc.setUpdateBy(getLoginUserId()); |
| | | loc.setUpdateTime(new Date()); |
| | | if (!locService.updateById(loc)) { |
| | | return R.error("Update Fail"); |
| | | } |
| | | } |
| | | } |
| | | return R.ok("Update Success").add(locList.stream().map(Loc::getId).collect(Collectors.toList())); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:loc:remove')") |
| | | @OperationLog("Delete Loc") |
| | | @PostMapping("/loc/remove/{ids}") |
| | |
| | | locNo, // 库位编号 |
| | | null, // 名称 |
| | | null, // 条码 |
| | | LocStsType.IDLE.val(), // 库位状态 |
| | | param.getLocSts(), // 库位状态 |
| | | offset, // 偏移量 |
| | | r, // 排 |
| | | b, // 列 |
| | | l, // 层 |
| | | null, // 托盘码 |
| | | null, // 库位类型 |
| | | param.getLocType(), // 库位类型 |
| | | null, // 状态[非空] |
| | | null, // 是否删除[非空] |
| | | null, // 租户 |
| | |
| | | null, // 修改时间 |
| | | null // 备注 |
| | | ); |
| | | loc.setCompDirect(param.getCompDirect()); |
| | | if (locService.count(new LambdaQueryWrapper<Loc>().eq(Loc::getLocNo, locNo)) > 0) { |
| | | throw new CoolException(locNo + " location has exist !"); |
| | | } |