| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.LocAroundBind; |
| | | import com.zy.asrs.entity.LocCache; |
| | | 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(); |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 台机绑定作业库位 |
| | | * 机台绑定作业库位 |
| | | * |
| | | * @param locAroundBind |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ManagerAuth |
| | |
| | | return R.error("参数不能为空"); |
| | | } |
| | | if (Cools.isEmpty(params.getDevNo())) { |
| | | return R.error("台机号不能为空"); |
| | | return R.error("机台号不能为空"); |
| | | } |
| | | if (Cools.isEmpty(params.getStartRow())) { |
| | | return R.error("起始排不能为空"); |