删除标准分享

This commit is contained in:
caozhen
2023-09-14 14:12:18 +08:00
parent 11a35b85e8
commit 9c09e2c1bb
5 changed files with 37 additions and 1 deletions
@@ -12,6 +12,7 @@ import com.jero.modules.laws.standard.entity.LawsUpdateRecord;
import com.jero.modules.laws.standard.service.ILawsNodeRelationService;
import com.jero.modules.laws.standard.service.ILawsUpdateRecordService;
import com.jero.modules.personal.service.ILawsStandardCollectionService;
import com.jero.modules.personal.service.ILawsStandardSharingService;
import com.jero.modules.tag.entity.LawsTag;
import com.jero.modules.tag.enums.TableNameEnum;
import io.swagger.annotations.Api;
@@ -41,6 +42,8 @@ public class LawsDomesticController {
private ILawsStandardCollectionService lawsStandardCollectionService;
@Autowired
private ILawsUpdateRecordService lawsUpdateRecordService;
@Autowired
private ILawsStandardSharingService lawsStandardSharingService;
private static final String MODULE_VALUE = TableNameEnum.DOMESTIC_REGULATIONS.getValue();
@@ -103,6 +106,7 @@ public class LawsDomesticController {
public Result<String> deleteByIdsAndModule(@RequestBody Map<String,Object> parameterMap) {
//删除标准时同步删除这个标准的收藏数据
lawsStandardCollectionService.deleteByStandardId((String) parameterMap.get("ids"));
lawsStandardSharingService.deleteByStandardId((String) parameterMap.get("ids"));
return Result.OK(lawsCommonService.deleteByIdsAndModule((String) parameterMap.get("ids"), MODULE_VALUE));
}
@@ -12,6 +12,7 @@ import com.jero.modules.laws.standard.entity.LawsUpdateRecord;
import com.jero.modules.laws.standard.service.ILawsNodeRelationService;
import com.jero.modules.laws.standard.service.ILawsUpdateRecordService;
import com.jero.modules.personal.service.ILawsStandardCollectionService;
import com.jero.modules.personal.service.ILawsStandardSharingService;
import com.jero.modules.tag.entity.LawsTag;
import com.jero.modules.tag.enums.TableNameEnum;
import io.swagger.annotations.Api;
@@ -41,6 +42,8 @@ public class LawsEnterpriseController {
private ILawsStandardCollectionService lawsStandardCollectionService;
@Autowired
private ILawsUpdateRecordService lawsUpdateRecordService;
@Autowired
private ILawsStandardSharingService lawsStandardSharingService;
private static final String MODULE_VALUE = TableNameEnum.ENTERPRISE_STANDARDS.getValue();
@@ -102,6 +105,7 @@ public class LawsEnterpriseController {
public Result<String> deleteByIdsAndModule(@RequestBody Map<String,Object> parameterMap) {
//删除标准时同步删除这个标准的收藏数据
lawsStandardCollectionService.deleteByStandardId((String) parameterMap.get("ids"));
lawsStandardSharingService.deleteByStandardId((String) parameterMap.get("ids"));
return Result.OK(lawsCommonService.deleteByIdsAndModule((String) parameterMap.get("ids"), MODULE_VALUE));
}
@@ -12,6 +12,7 @@ import com.jero.modules.laws.standard.entity.LawsUpdateRecord;
import com.jero.modules.laws.standard.service.ILawsNodeRelationService;
import com.jero.modules.laws.standard.service.ILawsUpdateRecordService;
import com.jero.modules.personal.service.ILawsStandardCollectionService;
import com.jero.modules.personal.service.ILawsStandardSharingService;
import com.jero.modules.tag.entity.LawsTag;
import com.jero.modules.tag.enums.TableNameEnum;
import io.swagger.annotations.Api;
@@ -41,6 +42,8 @@ public class LawsOverseasController {
private ILawsStandardCollectionService lawsStandardCollectionService;
@Autowired
private ILawsUpdateRecordService lawsUpdateRecordService;
@Autowired
private ILawsStandardSharingService lawsStandardSharingService;
private static final String MODULE_VALUE = TableNameEnum.FOREIGN_REGULATIONS.getValue();
@@ -102,6 +105,7 @@ public class LawsOverseasController {
public Result<String> deleteByIdsAndModule(@RequestBody Map<String,Object> parameterMap) {
//删除标准时同步删除这个标准的收藏数据
lawsStandardCollectionService.deleteByStandardId((String) parameterMap.get("ids"));
lawsStandardSharingService.deleteByStandardId((String) parameterMap.get("ids"));
return Result.OK(lawsCommonService.deleteByIdsAndModule((String) parameterMap.get("ids"), MODULE_VALUE));
}
@@ -29,4 +29,10 @@ public interface ILawsStandardSharingService extends IService<LawsStandardSharin
*/
void deleteByIds(List<String> ids);
/**
* 删除标准分享
*/
void deleteByStandardId(String id);
void deleteByStandardIds(List<String> ids);
}
@@ -1,7 +1,9 @@
package com.jero.modules.personal.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.jero.modules.personal.entity.LawsStandardCollection;
import com.jero.modules.personal.entity.LawsStandardSharing;
import com.jero.modules.personal.mapper.LawsStandardSharingMapper;
import com.jero.modules.personal.service.ILawsStandardSharingService;
@@ -46,7 +48,6 @@ public class LawsStandardSharingServiceImpl extends ServiceImpl<LawsStandardShar
String standardNum = record.getStandardNum();
String standardName = record.getStandardName();
record.setTitle(standardNum + standardName);
}
}
@@ -72,4 +73,21 @@ public class LawsStandardSharingServiceImpl extends ServiceImpl<LawsStandardShar
update(wrapper);
}
@Override
public void deleteByStandardId(String id) {
LambdaQueryWrapper<LawsStandardSharing> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(LawsStandardSharing::getStandardId, id);
remove(wrapper);
}
@Override
public void deleteByStandardIds(List<String> ids) {
if (ids.isEmpty()){
return;
}
LambdaQueryWrapper<LawsStandardSharing> wrapper = new LambdaQueryWrapper<>();
wrapper.in(LawsStandardSharing::getStandardId, ids);
remove(wrapper);
}
}