refactor(全局): 整理框架

This commit is contained in:
yjz
2024-06-05 10:34:31 +08:00
parent 7c6a6d7ac2
commit bc55dddd4f
6 changed files with 22 additions and 95 deletions
@@ -40,9 +40,6 @@ import com.jero.modules.laws.home.common.LawsHomeSearchCommon;
import com.jero.modules.laws.home.service.ILawsHomeSearchService;
import com.jero.modules.laws.standard.entity.*;
import com.jero.modules.laws.standard.service.*;
import com.jero.modules.laws.standardization.common.LawsStandardizationCommon;
import com.jero.modules.laws.standardization.entity.LawsStandardization;
import com.jero.modules.laws.standardization.service.ILawsStandardizationService;
import com.jero.modules.oss.entity.OSSFile;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.personal.entity.LawsBrowsingHistory;
@@ -138,8 +135,6 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
private ILawsTreeNodeService lawsTreeNodeService;
@Autowired
private ILawsBrowsingHistoryService lawsBrowsingHistoryService;
@Resource
private ILawsStandardizationService lawsStandardizationService;
@Resource
private EnterpriseStandardInspectContentService esInspectContentService;
@@ -526,11 +521,11 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
}
} else if (FieldCommon.BIDDING_COMMITTEE.equals(key) && StringUtils.isNotBlank(value)) {
// 如果是分标委
LawsStandardization lawsStandardization = lawsStandardizationService.getById(value);
resultMap.put(key, value);
if (!Objects.isNull(lawsStandardization)) {
resultMap.put(key + FieldCommon._DICT_TEXT, lawsStandardization.getName());
}
// LawsStandardization lawsStandardization = lawsStandardizationService.getById(value);
// resultMap.put(key, value);
// if (!Objects.isNull(lawsStandardization)) {
// resultMap.put(key + FieldCommon._DICT_TEXT, lawsStandardization.getName());
// }
} else if (FieldCommon.PART_NAME.equals(key) && StringUtils.isNotBlank(value)) {
// 如果是零部件
LambdaQueryWrapper<PartName> partNameLambdaQueryWrapper = new LambdaQueryWrapper<>();
@@ -2285,22 +2280,22 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
// 分标委
String biddingCommittee = (String) parameterMap.get(FieldCommon.BIDDING_COMMITTEE);
if (StrUtil.isNotBlank(biddingCommittee)) {
LambdaQueryWrapper<LawsStandardization> standardizationWrapper = new LambdaQueryWrapper<>();
standardizationWrapper.eq(LawsStandardization::getPid, "0");
LawsStandardization rootNode = lawsStandardizationService.getOne(standardizationWrapper);
standardizationWrapper.clear();
standardizationWrapper.eq(LawsStandardization::getPid, rootNode.getId());
List<LawsStandardization> nodeList = lawsStandardizationService.list(standardizationWrapper);
String sql = nodeList.stream()
.map(item -> "'" + item.getId() + "'")
.collect(Collectors.joining(","));
// 拼接SQL
selectCondition.append(" AND bidding_committee IN (");
if (StrUtil.isBlank(sql)) {
sql = "''";
}
selectCondition.append(sql).append(")");
parameterMap.remove(FieldCommon.BIDDING_COMMITTEE);
// LambdaQueryWrapper<LawsStandardization> standardizationWrapper = new LambdaQueryWrapper<>();
// standardizationWrapper.eq(LawsStandardization::getPid, "0");
// LawsStandardization rootNode = lawsStandardizationService.getOne(standardizationWrapper);
// standardizationWrapper.clear();
// standardizationWrapper.eq(LawsStandardization::getPid, rootNode.getId());
// List<LawsStandardization> nodeList = lawsStandardizationService.list(standardizationWrapper);
// String sql = nodeList.stream()
// .map(item -> "'" + item.getId() + "'")
// .collect(Collectors.joining(","));
// // 拼接SQL
// selectCondition.append(" AND bidding_committee IN (");
// if (StrUtil.isBlank(sql)) {
// sql = "''";
// }
// selectCondition.append(sql).append(")");
// parameterMap.remove(FieldCommon.BIDDING_COMMITTEE);
}
if (idSearch) {
@@ -2716,19 +2711,7 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
**/
@Override
public List<LawsDictModel> getBiddingCommittee() {
LambdaQueryWrapper<LawsStandardization> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(LawsStandardization::getStandardizationType, LawsStandardizationCommon.FBW);
List<LawsStandardization> standardizationList = lawsStandardizationService.list(queryWrapper);
if (CollectionUtils.isEmpty(standardizationList)) {
return new ArrayList<>();
}
List<LawsDictModel> lawsDictModelList = new ArrayList<>();
standardizationList.forEach(standardization -> {
LawsDictModel lawsDictModel = new LawsDictModel();
lawsDictModel.setValue(standardization.getId());
lawsDictModel.setText(standardization.getName());
lawsDictModelList.add(lawsDictModel);
});
return lawsDictModelList;
}
@@ -12,8 +12,6 @@ import com.jero.common.util.oConvertUtils;
import com.jero.modules.laws.common.constant.FieldCommon;
import com.jero.modules.laws.standard.entity.*;
import com.jero.modules.laws.standard.service.*;
import com.jero.modules.laws.standardization.entity.LawsStandardization;
import com.jero.modules.laws.standardization.service.ILawsStandardizationService;
import com.jero.modules.oss.entity.OSSFile;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.system.entity.SysDepart;
@@ -82,9 +80,6 @@ public class ImportUtil {
@Resource
private PartNameService partNameService;
@Resource
private ILawsStandardizationService standardizationService;
public List<String> validExcelData(Sheet sheet, List<LawsTag> headerList, Map<String, File> fileMap, List<Map<String, Object>> insertDataList) {
List<String> errMsgList = new ArrayList<>();
@@ -539,31 +534,10 @@ public class ImportUtil {
}
private String convertBiddingCommitteeValid(String cellValue) {
List<String> valueList = Arrays.asList(cellValue.split(","));
LambdaQueryWrapper<LawsStandardization> wrapper = new LambdaQueryWrapper<>();
wrapper.in(LawsStandardization::getName, valueList);
List<LawsStandardization> list = standardizationService.list(wrapper);
Map<String, String> systemMap = list.stream().collect(Collectors.toMap(LawsStandardization::getName, LawsStandardization::getId));
StringBuilder result = new StringBuilder();
for (String value : valueList) {
result.append(systemMap.get(value)).append(",");
}
// 去除掉最后的逗号
return result.substring(0, result.length() - 1);
return cellValue;
}
private boolean biddingCommitteeValid(String cellValue) {
String[] valueList = cellValue.split(",");
LambdaQueryWrapper<LawsStandardization> wrapper = new LambdaQueryWrapper<>();
wrapper.in(LawsStandardization::getName, Arrays.asList(valueList));
List<LawsStandardization> list = standardizationService.list(wrapper);
Map<String, String> map = list.stream().collect(Collectors.toMap(LawsStandardization::getName, LawsStandardization::getId));
for (String value : valueList) {
if (map.get(value) == null) {
return false;
}
}
return true;
}
@@ -11,7 +11,6 @@ import com.jero.common.util.MessageUtils;
import com.jero.modules.compare.service.ISarFileCompareInfoService;
import com.jero.modules.laws.common.constant.FieldCommon;
import com.jero.modules.laws.common.service.ILawsCommonService;
import com.jero.modules.laws.customcompare.service.ILawsCustomCompareInfoService;
import com.jero.modules.laws.standard.entity.LawsUpdateRecord;
import com.jero.modules.laws.standard.service.ILawsNodeRelationService;
import com.jero.modules.laws.standard.service.ILawsUpdateRecordService;
@@ -61,9 +60,6 @@ public class LawsDomesticController {
@Resource
private ISarFileCompareInfoService compareInfoService;
@Resource
private ILawsCustomCompareInfoService customCompareService;
private static final String MODULE_VALUE = TableNameEnum.DOMESTIC_REGULATIONS.getValue();
@AutoLog(value = "国内法规标准-分页列表查询")
@@ -165,7 +161,6 @@ public class LawsDomesticController {
// 删除标准时同步删除比对和拆分的相关数据
splitInfoService.deleteByStandardId((String) parameterMap.get("ids"));
compareInfoService.deleteByStandardId((String) parameterMap.get("ids"));
customCompareService.deleteByStandardId((String) parameterMap.get("ids"));
return Result.OK(lawsCommonService.deleteByIdsAndModule((String) parameterMap.get("ids"), MODULE_VALUE));
}
@@ -12,7 +12,6 @@ import com.jero.common.util.MessageUtils;
import com.jero.modules.compare.service.ISarFileCompareInfoService;
import com.jero.modules.laws.common.constant.FieldCommon;
import com.jero.modules.laws.common.service.ILawsCommonService;
import com.jero.modules.laws.customcompare.service.ILawsCustomCompareInfoService;
import com.jero.modules.laws.enterprise.entity.EnterpriseStandardRmrEvaluateDetail;
import com.jero.modules.laws.enterprise.service.EnterpriseStandardAuthDeptService;
import com.jero.modules.laws.enterprise.service.EnterpriseStandardAuthUserService;
@@ -78,9 +77,6 @@ public class LawsEnterpriseController {
@Resource
private ISarFileCompareInfoService compareInfoService;
@Resource
private ILawsCustomCompareInfoService customCompareService;
private static final String MODULE_VALUE = TableNameEnum.ENTERPRISE_STANDARDS.getValue();
@AutoLog(value = "企业法规标准-分页列表查询")
@@ -192,7 +188,6 @@ public class LawsEnterpriseController {
// 删除标准时同步删除比对和拆分的相关数据
splitInfoService.deleteByStandardId((String) parameterMap.get("ids"));
compareInfoService.deleteByStandardId((String) parameterMap.get("ids"));
customCompareService.deleteByStandardId((String) parameterMap.get("ids"));
return Result.OK(lawsCommonService.deleteByIdsAndModule((String) parameterMap.get("ids"), MODULE_VALUE));
}
@@ -212,7 +207,6 @@ public class LawsEnterpriseController {
// 删除标准时同步删除比对和拆分的相关数据
splitInfoService.deleteByStandardId((String) parameterMap.get("ids"));
compareInfoService.deleteByStandardId((String) parameterMap.get("ids"));
customCompareService.deleteByStandardId((String) parameterMap.get("ids"));
return Result.OK(lawsCommonService.deleteByIdsAndModule((String) parameterMap.get("ids"), MODULE_VALUE));
}
@@ -11,7 +11,6 @@ import com.jero.common.exception.JeroBootException;
import com.jero.common.util.MessageUtils;
import com.jero.modules.laws.common.constant.FieldCommon;
import com.jero.modules.laws.common.service.ILawsCommonService;
import com.jero.modules.laws.customcompare.service.ILawsCustomCompareInfoService;
import com.jero.modules.laws.enterprise.service.EnterpriseStandardAuthUserService;
import com.jero.modules.laws.standard.entity.LawsUpdateRecord;
import com.jero.modules.laws.standard.service.ILawsNodeRelationService;
@@ -56,8 +55,6 @@ public class LawsOverseasController {
@Autowired
private ILawsStandardSharingService lawsStandardSharingService;
@Resource
private ILawsCustomCompareInfoService customCompareService;
@Resource
private EnterpriseStandardAuthUserService authUserService;
private static final String MODULE_VALUE = TableNameEnum.FOREIGN_REGULATIONS.getValue();
@@ -161,7 +158,6 @@ public class LawsOverseasController {
//删除标准时同步删除这个标准的收藏数据
lawsStandardCollectionService.deleteByStandardId((String) parameterMap.get("ids"));
lawsStandardSharingService.deleteByStandardId((String) parameterMap.get("ids"));
customCompareService.deleteByStandardId((String) parameterMap.get("ids"));
return Result.OK(lawsCommonService.deleteByIdsAndModule((String) parameterMap.get("ids"), MODULE_VALUE));
}
@@ -13,8 +13,6 @@ import com.jero.modules.activiti.enums.FinishFlagEnum;
import com.jero.modules.activiti.enums.ProcessStatusEnum;
import com.jero.modules.compare.entity.SarFileCompareInfo;
import com.jero.modules.compare.service.ISarFileCompareInfoService;
import com.jero.modules.laws.customcompare.entity.LawsCustomCompareInfo;
import com.jero.modules.laws.customcompare.service.ILawsCustomCompareInfoService;
import com.jero.modules.laws.enterprise.entity.EnterpriseStandardPlan;
import com.jero.modules.laws.enterprise.service.EnterpriseStandardPlanService;
import com.jero.modules.laws.tasktransfer.common.LawsTaskTransferCommon;
@@ -55,7 +53,6 @@ public class LawsTaskTransferServiceImpl implements ILawsTaskTransferService {
private final EnterpriseStandardPlanService enterpriseStandardPlanService;
private final ISarFileSplitInfoService sarFileSplitInfoService;
private final ISarFileCompareInfoService sarFileCompareInfoService;
private final ILawsCustomCompareInfoService lawsCustomCompareInfoService;
private final ISysUserService sysUserService;
@Resource
@@ -65,13 +62,11 @@ public class LawsTaskTransferServiceImpl implements ILawsTaskTransferService {
EnterpriseStandardPlanService enterpriseStandardPlanService,
ISarFileSplitInfoService sarFileSplitInfoService,
ISarFileCompareInfoService sarFileCompareInfoService,
ILawsCustomCompareInfoService lawsCustomCompareInfoService,
ISysUserService sysUserService) {
this.lawsTaskTransferMapper = lawsTaskTransferMapper;
this.enterpriseStandardPlanService = enterpriseStandardPlanService;
this.sarFileSplitInfoService = sarFileSplitInfoService;
this.sarFileCompareInfoService = sarFileCompareInfoService;
this.lawsCustomCompareInfoService = lawsCustomCompareInfoService;
this.sysUserService = sysUserService;
}
@@ -201,16 +196,6 @@ public class LawsTaskTransferServiceImpl implements ILawsTaskTransferService {
}
private void customCompareInfo(List<LawsBaseDB> lawsBaseDBList) {
List<LawsBaseDB> customCompareInfo = lawsBaseDBList.stream()
.filter(v -> LawsTaskTransferCommon.BASE_DB_TYPE_4.equals(v.getType()))
.collect(Collectors.toList());
for (LawsBaseDB lawsBaseDB : customCompareInfo) {
SysUser sysUser = sysUserService.getById(lawsBaseDB.getTransferUser());
lawsCustomCompareInfoService.update(
new LambdaUpdateWrapper<LawsCustomCompareInfo>()
.eq(LawsCustomCompareInfo::getId, lawsBaseDB.getId())
.set(LawsCustomCompareInfo::getCreateBy, sysUser.getUsername()));
}
}
private void compareInfo(List<LawsBaseDB> lawsBaseDBList) {