Merge remote-tracking branch 'origin/master'

This commit is contained in:
liao
2023-09-14 17:00:21 +08:00
@@ -6,6 +6,8 @@ import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jero.common.api.vo.Result;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.MessageUtils;
import com.jero.modules.laws.common.constant.ResultCommon;
import com.jero.modules.personal.entity.LawsStandardCollection;
import com.jero.modules.personal.service.ILawsStandardCollectionService;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -63,11 +65,11 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
wrapper.eq(LawsStandardCollection::getCollectorId, sysUser.getId());
int count = lawsStandardCollectionService.count();
if (count > 0){
return Result.OK("不能重复收藏!");
return Result.OK(MessageUtils.getLanguage().equals("EN") ? "Cannot duplicate favorites" : "不能重复收藏!");
}
lawsStandardCollection.setSource("1");
lawsStandardCollectionService.add(lawsStandardCollection);
return Result.OK("操作成功!");
return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
}
/**
@@ -78,10 +80,10 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
@PostMapping(value = "/domestic/delete")
public Result<T> domesticDelete(@RequestBody Map<String, String> map) {
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
return Result.error("请选择数据!");
return Result.error(MessageUtils.getLanguage().equals("EN") ? "Please select data!" : "请选择数据!");
}
lawsStandardCollectionService.deleteById(map.get("id"));
return Result.OK("删除成功!");
return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
}
/**
@@ -97,11 +99,11 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
wrapper.eq(LawsStandardCollection::getCollectorId, sysUser.getId());
int count = lawsStandardCollectionService.count();
if (count > 0){
return Result.OK("不能重复收藏!");
return Result.OK(MessageUtils.getLanguage().equals("EN") ? "Cannot duplicate favorites" : "不能重复收藏!");
}
lawsStandardCollection.setSource("2");
lawsStandardCollectionService.add(lawsStandardCollection);
return Result.OK("操作成功!");
return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
}
/**
@@ -112,10 +114,10 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
@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("请选择数据!");
return Result.OK(MessageUtils.getLanguage().equals("EN") ? "Cannot duplicate favorites" : "不能重复收藏!");
}
lawsStandardCollectionService.deleteById(map.get("id"));
return Result.OK("删除成功!");
return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
}
/**
@@ -131,11 +133,11 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
wrapper.eq(LawsStandardCollection::getCollectorId, sysUser.getId());
int count = lawsStandardCollectionService.count();
if (count > 0){
return Result.OK("不能重复收藏!");
return Result.OK(MessageUtils.getLanguage().equals("EN") ? "Cannot duplicate favorites" : "不能重复收藏!");
}
lawsStandardCollection.setSource("3");
lawsStandardCollectionService.add(lawsStandardCollection);
return Result.OK("操作成功!");
return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
}
/**
@@ -146,10 +148,10 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
@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("请选择数据!");
return Result.error(MessageUtils.getLanguage().equals("EN") ? "Please select data!" : "请选择数据!");
}
lawsStandardCollectionService.deleteById(map.get("id"));
return Result.OK("删除成功!");
return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
}
/**
@@ -160,10 +162,10 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
@PostMapping(value = "/delete")
public Result<T> delete(@RequestBody Map<String, String> map) {
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
return Result.error("请选择数据!");
return Result.error(MessageUtils.getLanguage().equals("EN") ? "Please select data!" : "请选择数据!");
}
lawsStandardCollectionService.removeById(map.get("id"));
return Result.OK("删除成功!");
return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
}
}