| | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.*; |
| | | import com.zy.asrs.entity.BasAgvMast; |
| | | import com.zy.asrs.entity.BasAgvMastLog; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.service.BasAgvMastLogService; |
| | | import com.zy.asrs.service.BasAgvMastService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.common.web.BaseController; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | public class BasAgvMastController extends BaseController { |
| | | |
| | | @Autowired |
| | | private BasAgvMastService basAgvMastService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private BasAgvMastLogService basAgvMastLogService; |
| | | |
| | | @RequestMapping(value = "/basAgvMast/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | basAgvMastService.deleteById(id); |
| | | BasAgvMast basAgvMast = basAgvMastService.selectById(id); |
| | | // AGV库位==》输送线站点 0 |
| | | // if (basAgvMast.getIoType() == 0){ |
| | | // LocMast sourceLoc = locMastService.selectById(basAgvMast.getSourceLocNo()); //源库位 |
| | | // sourceLoc.setLocSts("F"); |
| | | // locMastService.updateById(sourceLoc); |
| | | // } |
| | | // AGV库位==》AGV库位 1 |
| | | if (basAgvMast.getIoType() == 1){ |
| | | // LocMast sourceLoc = locMastService.selectById(basAgvMast.getSourceLocNo()); //源库位 |
| | | LocMast targetLoc = locMastService.selectById(basAgvMast.getLocNo()); //目标库位 |
| | | // sourceLoc.setLocSts("F"); |
| | | targetLoc.setLocSts("O"); |
| | | locMastService.updateById(targetLoc); |
| | | } |
| | | // 输送线站点==》AGV库位 2 |
| | | if (basAgvMast.getIoType() == 2){ |
| | | LocMast targetLoc = locMastService.selectById(basAgvMast.getLocNo()); //目标库位 |
| | | targetLoc.setLocSts("O"); |
| | | locMastService.updateById(targetLoc); |
| | | log.info("修改成功"); |
| | | } |
| | | BasAgvMastLog basAgvMastLog = new BasAgvMastLog(basAgvMast); |
| | | basAgvMastLogService.insert(basAgvMastLog); |
| | | basAgvMastService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | } |