| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.zy.asrs.framework.common.Cools; |
| | | import com.zy.asrs.framework.common.R; |
| | | import com.zy.asrs.wms.asrs.entity.Loc; |
| | | import com.zy.asrs.wms.asrs.entity.enums.LocStsType; |
| | | import com.zy.asrs.wms.asrs.entity.param.InitLocTypeBindParam; |
| | | import com.zy.asrs.wms.asrs.service.LocService; |
| | | import com.zy.asrs.wms.common.annotation.OperationLog; |
| | | import com.zy.asrs.wms.common.domain.BaseParam; |
| | | import com.zy.asrs.wms.common.domain.KeyValVo; |
| | |
| | | import com.zy.asrs.wms.utils.ExcelUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | |
| | | @Autowired |
| | | private LocTypeBindService locTypeBindService; |
| | | @Autowired |
| | | private LocService locService; |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:locTypeBind:list')") |
| | | @PostMapping("/locTypeBind/page") |
| | |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:locTypeBind:save')") |
| | | @OperationLog("初始化库位类型绑定") |
| | | @PostMapping("/locTypeBind/init") |
| | | @Transactional |
| | | public R init(@RequestBody InitLocTypeBindParam param) { |
| | | LambdaQueryWrapper<Loc> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.ge(Loc::getRow1, param.getStartRow()); |
| | | queryWrapper.le(Loc::getRow1, param.getTargetRow()); |
| | | queryWrapper.ge(Loc::getBay1, param.getStartBay()); |
| | | queryWrapper.le(Loc::getBay1, param.getTargetBay()); |
| | | queryWrapper.ge(Loc::getLev1, param.getStartLev()); |
| | | queryWrapper.le(Loc::getLev1, param.getTargetLev()); |
| | | |
| | | List<Loc> list = locService.list(queryWrapper); |
| | | if (list.isEmpty()) { |
| | | return R.error("未找到库位信息"); |
| | | } |
| | | |
| | | for (Loc loc : list) { |
| | | LocTypeBind locTypeBind = new LocTypeBind(); |
| | | locTypeBind.setLocId(loc.getId()); |
| | | locTypeBind.setTypeId(param.getTypeId()); |
| | | locTypeBindService.save(locTypeBind); |
| | | } |
| | | |
| | | return R.ok("初始化成功"); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:locTypeBind:save')") |
| | | @OperationLog("添加库位类型绑定") |
| | | @PostMapping("/locTypeBind/save") |
| | | public R save(@RequestBody LocTypeBind locTypeBind) { |