| | |
| | | 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; |
| | |
| | | @RequestMapping(value = "/basQualityTesting/add/auth") |
| | | @ManagerAuth |
| | | public R add(BasQualityTesting basQualityTesting) { |
| | | BasQualityTesting boxType = basQualityTestingService.selectOne(new EntityWrapper<BasQualityTesting>().eq("box_type", basQualityTesting.getBoxType())); |
| | | if (!Cools.isEmpty(boxType)){ |
| | | return R.error("标识号重复,请检查!!!"); |
| | | } |
| | | basQualityTestingService.insert(basQualityTesting); |
| | | return R.ok(); |
| | | } |
| | |
| | | if (Cools.isEmpty(basQualityTesting) || null==basQualityTesting.getId()){ |
| | | return R.error(); |
| | | } |
| | | BasQualityTesting boxType = basQualityTestingService.selectOne(new EntityWrapper<BasQualityTesting>().eq("box_type", basQualityTesting.getBoxType())); |
| | | BasQualityTesting basQualityTesting1 = basQualityTestingService.selectById(basQualityTesting.getId()); |
| | | if (!Cools.isEmpty(boxType) && !basQualityTesting1.equals(boxType)){ |
| | | return R.error("标识号重复,请检查!!!"); |
| | | } |
| | | basQualityTestingService.updateById(basQualityTesting); |
| | | return R.ok(); |
| | | } |