| | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.LocAroundBind; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.param.InitDeviceLocParams; |
| | | import com.zy.asrs.enums.LocStsType; |
| | | import com.zy.asrs.service.LocAroundBindService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.service.impl.LocMastServiceImpl; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | @Autowired |
| | | private LocAroundBindService locAroundBindService; |
| | | @Autowired |
| | | private LocMastServiceImpl locMastService; |
| | | |
| | | @RequestMapping(value = "/locAroundBind/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | @RequestMapping(value = "/locAroundBind/add/auth") |
| | | @ManagerAuth |
| | | public R add(LocAroundBind locAroundBind) { |
| | | if (Objects.isNull(locAroundBind)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | LocAroundBind aroundBind = locAroundBindService.selectOne(new EntityWrapper<LocAroundBind>().eq("b_loc_no", locAroundBind.getBLocNo())); |
| | | if (!Objects.isNull(aroundBind)) { |
| | | return R.error("工位已绑定,不能重复绑定!"); |
| | | } |
| | | |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locAroundBind.getBLocNo())); |
| | | locMast.setLocSts(LocStsType.LOC_STS_TYPE_X.type); |
| | | locMast.setDeleted(1); |
| | | locMast.setFrozen(1); |
| | | |
| | | if (!locMastService.updateById(locMast)) { |
| | | return R.error("原库禁用失败!!"); |
| | | } |
| | | locAroundBindService.insert(locAroundBind); |
| | | return R.ok(); |
| | | } |