我的收藏列表查询添加ILawsCommonService

This commit is contained in:
caozhen
2023-09-11 13:36:30 +08:00
parent 5885610347
commit 1bfada2afa
@@ -2,6 +2,7 @@ package com.jero.modules.personal.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import com.jero.modules.laws.common.service.ILawsCommonService;
import com.jero.modules.laws.enterprise.entity.EnterpriseStandard; import com.jero.modules.laws.enterprise.entity.EnterpriseStandard;
import com.jero.modules.laws.enterprise.service.EnterpriseStandardService; import com.jero.modules.laws.enterprise.service.EnterpriseStandardService;
import com.jero.modules.personal.entity.LawsStandardCollection; import com.jero.modules.personal.entity.LawsStandardCollection;
@@ -15,6 +16,7 @@ import org.springframework.transaction.annotation.Transactional;
import com.jero.common.exception.JeroBootException; import com.jero.common.exception.JeroBootException;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.system.query.QueryGenerator; import com.jero.common.system.query.QueryGenerator;
@@ -40,6 +42,9 @@ public class LawsStandardCollectionServiceImpl extends ServiceImpl<LawsStandardC
@Autowired @Autowired
private EnterpriseStandardService enterpriseStandardService; //企业标准 private EnterpriseStandardService enterpriseStandardService; //企业标准
@Autowired
private ILawsCommonService lawsCommonService;
/** /**
* 列表查询 * 列表查询
@@ -53,21 +58,26 @@ public class LawsStandardCollectionServiceImpl extends ServiceImpl<LawsStandardC
QueryWrapper<LawsStandardCollection> queryWrapper = QueryGenerator.initQueryWrapper(lawsStandardCollection, req.getParameterMap()); QueryWrapper<LawsStandardCollection> queryWrapper = QueryGenerator.initQueryWrapper(lawsStandardCollection, req.getParameterMap());
Page<LawsStandardCollection> page = new Page<>(pageNo, pageSize); Page<LawsStandardCollection> page = new Page<>(pageNo, pageSize);
Page<LawsStandardCollection> collectionPage = page(page, queryWrapper); Page<LawsStandardCollection> collectionPage = page(page, queryWrapper);
// this.standardAssignment(collectionPage.getRecords()); this.standardAssignment(collectionPage.getRecords());
return page(page, queryWrapper); return page(page, queryWrapper);
} }
public void standardAssignment(List<LawsStandardCollection> list){ public void standardAssignment(List<LawsStandardCollection> list){
for (LawsStandardCollection collection : list) { for (LawsStandardCollection collection : list) {
String standardId = collection.getStandardId(); String standardId = collection.getStandardId();
String source = collection.getSource(); String source = collection.getSource();
if ("1".equals(source)){ if ("1".equals(source)){
//查询国内标准数据,赋值给collection //查询国内标准数据,赋值给collection
Map<String, Object> byIdAndModule = lawsCommonService.getByIdAndModule(standardId, source);
collection.setNewModelImplementationDate((Date) byIdAndModule.get("new_model_implementation_date"));
collection.setOnTheProductionDate((Date) byIdAndModule.get("on_the_production_date"));
collection.setReleaseDate((Date) byIdAndModule.get("release_date"));
} }
if ("2".equals(source)){ if ("2".equals(source)){
//查询海外标准数据,赋值给collection //查询海外标准数据,赋值给collection
Map<String, Object> byIdAndModule = lawsCommonService.getByIdAndModule(standardId, source);
collection.setNewModelImplementationDate((Date) byIdAndModule.get("new_model_implementation_date"));
collection.setOnTheProductionDate((Date) byIdAndModule.get("on_the_production_date"));
collection.setReleaseDate((Date) byIdAndModule.get("release_date"));
} }
if ("3".equals(source)){ if ("3".equals(source)){
//查询企业标准数据,赋值给collection //查询企业标准数据,赋值给collection