提交 4866e340 authored 作者: zhouzhigang's avatar zhouzhigang

--no commit message

上级 27c179b0
......@@ -3,6 +3,7 @@ package com.zrqx.bg.resource.controller.goods.phyresource;
import com.zrqx.bg.resource.service.goods.phyresource.PhyResourceService;
import com.zrqx.core.constant.resource.ResourceRequestPath;
import com.zrqx.core.enums.resource.goods.GoodsTypeEnum;
import com.zrqx.core.exception.BusinessValidateException;
import com.zrqx.core.form.GoodsForm;
import com.zrqx.core.form.resource.bg.goods.*;
import com.zrqx.core.form.resource.bg.goods.eleresource.EleFileForm;
......@@ -232,4 +233,10 @@ public class PhyResourceController {
return CallBack.success(phyResourceService.getPuublisherPage());
}
@ApiOperation(value = "验证ISBN是否存在")
@GetMapping(value = ResourceRequestPath.CHECK + ResourceRequestPath.ISBN)
public CallBack<Boolean> checkIsbn(String isbn) {
return phyResourceService.checkIsbn(isbn) ? CallBack.success(true) : CallBack.fail();
}
}
......@@ -252,5 +252,14 @@ public interface PhyResourceService extends BaseService<PhyResource, String> {
* @data 2019年8月26日 下午5:33:55
*/
List<String> getPuublisherPage();
/**
* 校验ISBN是否存在
* @param isbn
* @return
* @auther zzg
* @data 2019年9月2日 下午5:08:30
*/
boolean checkIsbn(String isbn);
}
......@@ -577,6 +577,22 @@ public class PhyResourceServiceImpl extends BaseModelServiceImpl<PhyResource, St
List<String> list = phyResourceMapper.getPublisherPage();
return list;
}
@Override
public boolean checkIsbn(String isbn) {
PhyResource phy = new PhyResource();
phy.setIsbn(isbn);
PhyResource entity = null;
try{
entity = super.selectOne(phy);
}catch(Exception e){
log.error(e.getMessage());
}
if(entity == null){
throw new BusinessValidateException("ISBN:" + isbn + "不存在");
}
return true;
}
......
......@@ -179,5 +179,10 @@ public class ResourceRequestPath extends BaseRequestPath {
/**出版社*/
public static final String PUBLISHER = "/publisher";
/**ISBN*/
public static final String ISBN = "/sibn";
/**校验*/
public static final String CHECK = "/check";
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论