提交 cc96cb9e authored 作者: chaoyanjun's avatar chaoyanjun

--no commit message

上级 4fb43d48
...@@ -4,8 +4,12 @@ ...@@ -4,8 +4,12 @@
*/ */
package com.zrqx.resource.bg.service.copyright; package com.zrqx.resource.bg.service.copyright;
import com.zrqx.core.form.newbook.ExportForm;
import com.zrqx.core.model.resource.copyright.Copyright; import com.zrqx.core.model.resource.copyright.Copyright;
import com.zrqx.core.service.BaseService; import com.zrqx.core.service.BaseService;
import com.zrqx.core.vo.resource.copyright.ExportCopyrightVo;
import java.util.List;
/** /**
* @author niguanghui * @author niguanghui
...@@ -17,4 +21,6 @@ public interface CopyrightService extends BaseService<Copyright, Integer> { ...@@ -17,4 +21,6 @@ public interface CopyrightService extends BaseService<Copyright, Integer> {
boolean isExist(String identifier, String oid); boolean isExist(String identifier, String oid);
Copyright getCopyRight(String objId); Copyright getCopyRight(String objId);
List<ExportCopyrightVo> export(ExportForm form);
} }
...@@ -4,7 +4,10 @@ ...@@ -4,7 +4,10 @@
*/ */
package com.zrqx.resource.bg.service.copyright; package com.zrqx.resource.bg.service.copyright;
import com.zrqx.core.enums.resource.ContractEnum;
import com.zrqx.core.form.newbook.ExportForm;
import com.zrqx.core.model.resource.copyright.CopyrightResource; import com.zrqx.core.model.resource.copyright.CopyrightResource;
import com.zrqx.core.vo.resource.copyright.ExportCopyrightVo;
import com.zrqx.resource.bg.mapper.copyright.CopyrightResourceMapper; import com.zrqx.resource.bg.mapper.copyright.CopyrightResourceMapper;
import com.zrqx.resource.bg.mapper.publicLibrary.ResourceRelationMapper; import com.zrqx.resource.bg.mapper.publicLibrary.ResourceRelationMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -16,6 +19,7 @@ import com.zrqx.core.service.BaseServiceImpl; ...@@ -16,6 +19,7 @@ import com.zrqx.core.service.BaseServiceImpl;
import com.zrqx.resource.bg.mapper.copyright.CopyrightMapper; import com.zrqx.resource.bg.mapper.copyright.CopyrightMapper;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @author niguanghui * @author niguanghui
...@@ -48,4 +52,27 @@ public class CopyrightServiceImpl extends BaseServiceImpl<Copyright, Integer> im ...@@ -48,4 +52,27 @@ public class CopyrightServiceImpl extends BaseServiceImpl<Copyright, Integer> im
Copyright copyright = mapper.selectByPrimaryKey(copyrightResource.getCopyrightId()); Copyright copyright = mapper.selectByPrimaryKey(copyrightResource.getCopyrightId());
return copyright; return copyright;
} }
@Override
public List<ExportCopyrightVo> export(ExportForm form) {
List<ExportCopyrightVo> all;
//导出全部
switch (form.getOpsType()) {
case "0":
all = mapper.findAll();
break;
case "1":
all = mapper.findByIds(form.getIds());
break;
default:
return null;
}
return all.stream()
.map(arg ->{
arg.setContractClass(ContractEnum.getNameByCode(Integer.valueOf(arg.getContractClass())));
return arg;
})
.collect(Collectors.toList());
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论