收藏bug

This commit is contained in:
caozhen
2023-09-18 16:23:11 +08:00
parent e5ee9ebb97
commit 73e3b7994b
3 changed files with 33 additions and 14 deletions
@@ -8,6 +8,12 @@ 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.laws.enterprise.entity.EnterpriseStandard;
import com.jero.modules.laws.enterprise.service.EnterpriseStandardService;
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
import com.jero.modules.laws.standard.entity.LawsOverseasStandard;
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
import com.jero.modules.personal.entity.LawsStandardCollection;
import com.jero.modules.personal.service.ILawsStandardCollectionService;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -38,6 +44,12 @@ import org.apache.poi.ss.formula.functions.T;
public class LawsStandardCollectionController extends JeroController<LawsStandardCollection, ILawsStandardCollectionService> {
@Autowired
private ILawsStandardCollectionService lawsStandardCollectionService;
@Autowired
private ILawsDomesticStandardService lawsDomesticStandardService; //国内标准
@Autowired
private ILawsOverseasStandardService lawsOverseasStandardService; //海外标准
@Autowired
private EnterpriseStandardService enterpriseStandardService; //企业标准
/**
* 分页列表查询
@@ -62,6 +74,10 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
@ApiOperation(value="标准收藏-国内收藏", notes="标准收藏-国内收藏")
@PostMapping(value = "/domestic/add")
public Result<T> domesticAdd(@Validated @RequestBody LawsStandardCollection lawsStandardCollection) {
LawsDomesticStandard standard = lawsDomesticStandardService.queryById(lawsStandardCollection.getStandardId());
lawsStandardCollection.setStandardClass(standard.getStandardClass());
lawsStandardCollection.setStandardName(standard.getStandardName());
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
LambdaQueryWrapper<LawsStandardCollection> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(LawsStandardCollection::getStandardId, lawsStandardCollection.getStandardId());
@@ -97,6 +113,10 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
@ApiOperation(value="标准收藏-海外收藏", notes="标准收藏-海外收藏")
@PostMapping(value = "/overseas/add")
public Result<T> overseasAdd(@Validated @RequestBody LawsStandardCollection lawsStandardCollection) {
LawsOverseasStandard standard = lawsOverseasStandardService.queryById(lawsStandardCollection.getStandardId());
lawsStandardCollection.setStandardClass(standard.getStandardClass());
lawsStandardCollection.setStandardName(standard.getStandardName());
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
LambdaQueryWrapper<LawsStandardCollection> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(LawsStandardCollection::getStandardId, lawsStandardCollection.getStandardId());
@@ -132,6 +152,10 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
@ApiOperation(value="标准收藏-企标收藏", notes="标准收藏-企标收藏")
@PostMapping(value = "/enterprise/add")
public Result<T> enterpriseAdd(@Validated @RequestBody LawsStandardCollection lawsStandardCollection) {
EnterpriseStandard standard = enterpriseStandardService.getById(lawsStandardCollection.getStandardId());
lawsStandardCollection.setStandardClass(standard.getCategoryCode());
lawsStandardCollection.setStandardName(standard.getStandardName());
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
LambdaQueryWrapper<LawsStandardCollection> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(LawsStandardCollection::getStandardId, lawsStandardCollection.getStandardId());