收藏、取消收藏、分享三个接口拆分为国内、海外、企业不同接口
This commit is contained in:
+58
-8
@@ -49,10 +49,10 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
|
|||||||
/**
|
/**
|
||||||
* 收藏
|
* 收藏
|
||||||
*/
|
*/
|
||||||
@AutoLog(value = "标准收藏-收藏")
|
@AutoLog(value = "标准收藏-国内收藏")
|
||||||
@ApiOperation(value="标准收藏-收藏", notes="标准收藏-收藏")
|
@ApiOperation(value="标准收藏-国内收藏", notes="标准收藏-国内收藏")
|
||||||
@PostMapping(value = "/add")
|
@PostMapping(value = "/domestic/add")
|
||||||
public Result<T> add(@Validated @RequestBody LawsStandardCollection lawsStandardCollection) {
|
public Result<T> domesticAdd(@Validated @RequestBody LawsStandardCollection lawsStandardCollection) {
|
||||||
lawsStandardCollectionService.add(lawsStandardCollection);
|
lawsStandardCollectionService.add(lawsStandardCollection);
|
||||||
return Result.OK("操作成功!");
|
return Result.OK("操作成功!");
|
||||||
}
|
}
|
||||||
@@ -60,10 +60,10 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
|
|||||||
/**
|
/**
|
||||||
* 取消收藏
|
* 取消收藏
|
||||||
*/
|
*/
|
||||||
@AutoLog(value = "标准收藏-取消收藏")
|
@AutoLog(value = "标准收藏-国内取消收藏")
|
||||||
@ApiOperation(value="标准收藏-取消收藏", notes="标准收藏-取消收藏")
|
@ApiOperation(value="标准收藏-国内取消收藏", notes="标准收藏-国内取消收藏")
|
||||||
@PostMapping(value = "/delete")
|
@PostMapping(value = "/domestic/delete")
|
||||||
public Result<T> delete(@RequestBody Map<String, String> map) {
|
public Result<T> domesticDelete(@RequestBody Map<String, String> map) {
|
||||||
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
||||||
return Result.error("请选择数据!");
|
return Result.error("请选择数据!");
|
||||||
}
|
}
|
||||||
@@ -71,4 +71,54 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
|
|||||||
return Result.OK("删除成功!");
|
return Result.OK("删除成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收藏
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "标准收藏-海外收藏")
|
||||||
|
@ApiOperation(value="标准收藏-海外收藏", notes="标准收藏-海外收藏")
|
||||||
|
@PostMapping(value = "/overseas/add")
|
||||||
|
public Result<T> overseasAdd(@Validated @RequestBody LawsStandardCollection lawsStandardCollection) {
|
||||||
|
lawsStandardCollectionService.add(lawsStandardCollection);
|
||||||
|
return Result.OK("操作成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消收藏
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "标准收藏-海外取消收藏")
|
||||||
|
@ApiOperation(value="标准收藏-海外取消收藏", notes="标准收藏-海外取消收藏")
|
||||||
|
@PostMapping(value = "/overseas/delete")
|
||||||
|
public Result<T> overseasDelete(@RequestBody Map<String, String> map) {
|
||||||
|
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
||||||
|
return Result.error("请选择数据!");
|
||||||
|
}
|
||||||
|
lawsStandardCollectionService.deleteById(map.get("id"));
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收藏
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "标准收藏-企标收藏")
|
||||||
|
@ApiOperation(value="标准收藏-企标收藏", notes="标准收藏-企标收藏")
|
||||||
|
@PostMapping(value = "/enterprise/add")
|
||||||
|
public Result<T> enterpriseAdd(@Validated @RequestBody LawsStandardCollection lawsStandardCollection) {
|
||||||
|
lawsStandardCollectionService.add(lawsStandardCollection);
|
||||||
|
return Result.OK("操作成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消收藏
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "标准收藏-企标取消收藏")
|
||||||
|
@ApiOperation(value="标准收藏-企标取消收藏", notes="标准收藏-企标取消收藏")
|
||||||
|
@PostMapping(value = "/enterprise/delete")
|
||||||
|
public Result<T> enterpriseDelete(@RequestBody Map<String, String> map) {
|
||||||
|
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
||||||
|
return Result.error("请选择数据!");
|
||||||
|
}
|
||||||
|
lawsStandardCollectionService.deleteById(map.get("id"));
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+72
-4
@@ -72,10 +72,10 @@ public class LawsStandardSharingController extends JeroController<LawsStandardSh
|
|||||||
/**
|
/**
|
||||||
* 添加
|
* 添加
|
||||||
*/
|
*/
|
||||||
@AutoLog(value = "标准分享-分享")
|
@AutoLog(value = "标准分享-国内分享")
|
||||||
@ApiOperation(value="标准分享-分享", notes="标准分享-分享")
|
@ApiOperation(value="标准分享-国内分享", notes="标准分享-国内分享")
|
||||||
@PostMapping(value = "/add")
|
@PostMapping(value = "/domestic/add")
|
||||||
public Result<T> add(@Validated @RequestBody LawsStandardSharing lawsStandardSharing) {
|
public Result<T> domesticAdd(@Validated @RequestBody LawsStandardSharing lawsStandardSharing) {
|
||||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
String recipientId = lawsStandardSharing.getRecipientId();
|
String recipientId = lawsStandardSharing.getRecipientId();
|
||||||
String recipientName = lawsStandardSharing.getRecipientName();
|
String recipientName = lawsStandardSharing.getRecipientName();
|
||||||
@@ -103,6 +103,74 @@ public class LawsStandardSharingController extends JeroController<LawsStandardSh
|
|||||||
return Result.OK("操作成功!");
|
return Result.OK("操作成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "标准分享-海外分享")
|
||||||
|
@ApiOperation(value="标准分享-分享", notes="标准分享-分享")
|
||||||
|
@PostMapping(value = "/overseas/add")
|
||||||
|
public Result<T> overseasAdd(@Validated @RequestBody LawsStandardSharing lawsStandardSharing) {
|
||||||
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
String recipientId = lawsStandardSharing.getRecipientId();
|
||||||
|
String recipientName = lawsStandardSharing.getRecipientName();
|
||||||
|
Date date = new Date();
|
||||||
|
List<LawsStandardSharing> sharings = new ArrayList<>();
|
||||||
|
List<String> recipientIdList = Arrays.asList(recipientId.split(","));
|
||||||
|
List<String> recipientNameList = Arrays.asList(recipientName.split(","));
|
||||||
|
for (int i = 0; i < recipientIdList.size(); i++) {
|
||||||
|
LawsStandardSharing sharing = new LawsStandardSharing();
|
||||||
|
sharing.setSource(lawsStandardSharing.getSource());
|
||||||
|
sharing.setStandardId(lawsStandardSharing.getStandardId());
|
||||||
|
sharing.setStandardName(lawsStandardSharing.getStandardName());
|
||||||
|
sharing.setStandardNum(lawsStandardSharing.getStandardNum());
|
||||||
|
sharing.setSharerId(sysUser.getId());
|
||||||
|
sharing.setSharerName(lawsStandardSharing.getSharerName());
|
||||||
|
sharing.setRecipientId(recipientIdList.get(i));
|
||||||
|
sharing.setRecipientName(recipientNameList.get(i));
|
||||||
|
sharing.setSharingTime(date);
|
||||||
|
sharing.setShareDescription(lawsStandardSharing.getShareDescription());
|
||||||
|
sharing.setReadingStatus("1");
|
||||||
|
sharing.setDelFlag("0");
|
||||||
|
sharings.add(sharing);
|
||||||
|
}
|
||||||
|
lawsStandardSharingService.saveBatch(sharings);
|
||||||
|
return Result.OK("操作成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "标准分享-企标分享")
|
||||||
|
@ApiOperation(value="标准分享-企标分享", notes="标准分享-企标分享")
|
||||||
|
@PostMapping(value = "/enterprise/add")
|
||||||
|
public Result<T> enterpriseAdd(@Validated @RequestBody LawsStandardSharing lawsStandardSharing) {
|
||||||
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
String recipientId = lawsStandardSharing.getRecipientId();
|
||||||
|
String recipientName = lawsStandardSharing.getRecipientName();
|
||||||
|
Date date = new Date();
|
||||||
|
List<LawsStandardSharing> sharings = new ArrayList<>();
|
||||||
|
List<String> recipientIdList = Arrays.asList(recipientId.split(","));
|
||||||
|
List<String> recipientNameList = Arrays.asList(recipientName.split(","));
|
||||||
|
for (int i = 0; i < recipientIdList.size(); i++) {
|
||||||
|
LawsStandardSharing sharing = new LawsStandardSharing();
|
||||||
|
sharing.setSource(lawsStandardSharing.getSource());
|
||||||
|
sharing.setStandardId(lawsStandardSharing.getStandardId());
|
||||||
|
sharing.setStandardName(lawsStandardSharing.getStandardName());
|
||||||
|
sharing.setStandardNum(lawsStandardSharing.getStandardNum());
|
||||||
|
sharing.setSharerId(sysUser.getId());
|
||||||
|
sharing.setSharerName(lawsStandardSharing.getSharerName());
|
||||||
|
sharing.setRecipientId(recipientIdList.get(i));
|
||||||
|
sharing.setRecipientName(recipientNameList.get(i));
|
||||||
|
sharing.setSharingTime(date);
|
||||||
|
sharing.setShareDescription(lawsStandardSharing.getShareDescription());
|
||||||
|
sharing.setReadingStatus("1");
|
||||||
|
sharing.setDelFlag("0");
|
||||||
|
sharings.add(sharing);
|
||||||
|
}
|
||||||
|
lawsStandardSharingService.saveBatch(sharings);
|
||||||
|
return Result.OK("操作成功!");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除
|
* 批量删除
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user