|
|
|
@ -14,7 +14,9 @@ import com.sun.mail.util.QEncoderStream; |
|
|
|
|
import org.jeecg.common.api.vo.Result; |
|
|
|
|
import org.jeecg.common.system.query.QueryGenerator; |
|
|
|
|
import org.jeecg.common.util.oConvertUtils; |
|
|
|
|
import org.jeecg.modules.demo.fabric.entity.ZyFabric; |
|
|
|
|
import org.jeecg.modules.demo.fabric.entity.ZyFabricType; |
|
|
|
|
import org.jeecg.modules.demo.fabric.service.IZyFabricService; |
|
|
|
|
import org.jeecg.modules.demo.fabric.service.IZyFabricTypeService; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
@ -51,6 +53,8 @@ import org.jeecg.common.aspect.annotation.AutoLog; |
|
|
|
|
public class ZyFabricTypeController extends JeecgController<ZyFabricType, IZyFabricTypeService> { |
|
|
|
|
@Autowired |
|
|
|
|
private IZyFabricTypeService zyFabricTypeService; |
|
|
|
|
@Autowired |
|
|
|
|
private IZyFabricService zyFabricService; //面料表
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 分页列表查询 |
|
|
|
@ -133,6 +137,12 @@ public class ZyFabricTypeController extends JeecgController<ZyFabricType, IZyFab |
|
|
|
|
@ApiOperation(value="zy_fabric_type-通过id删除", notes="zy_fabric_type-通过id删除") |
|
|
|
|
@DeleteMapping(value = "/delete") |
|
|
|
|
public Result<?> delete(@RequestParam(name="id",required=true) String id) { |
|
|
|
|
List<ZyFabric> zyFabricsList = zyFabricService.list(); |
|
|
|
|
for (ZyFabric zyFabric : zyFabricsList){ |
|
|
|
|
if (zyFabric.getTypeId().equals(id)){ |
|
|
|
|
return Result.error("此面料类型已被使用,禁止删除!"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
zyFabricTypeService.removeById(id); |
|
|
|
|
return Result.OK("删除成功!"); |
|
|
|
|
} |
|
|
|
|