feat: 零部件字段逻辑改为关联表
This commit is contained in:
+47
-66
@@ -30,7 +30,6 @@ import com.jero.modules.laws.documenttool.entity.LawsDocumentSplit;
|
||||
import com.jero.modules.laws.documenttool.mapper.DocumentSplitMapper;
|
||||
import com.jero.modules.laws.enterprise.entity.EnterpriseStandardAuthDept;
|
||||
import com.jero.modules.laws.enterprise.entity.EnterpriseStandardInspectContent;
|
||||
import com.jero.modules.laws.enterprise.mapper.EnterpriseStandardAuthUserMapper;
|
||||
import com.jero.modules.laws.enterprise.service.EnterpriseStandardAuthDeptService;
|
||||
import com.jero.modules.laws.enterprise.service.EnterpriseStandardAuthUserService;
|
||||
import com.jero.modules.laws.enterprise.service.EnterpriseStandardInspectContentService;
|
||||
@@ -41,20 +40,16 @@ import com.jero.modules.laws.standard.entity.*;
|
||||
import com.jero.modules.laws.standard.service.*;
|
||||
import com.jero.modules.oss.entity.OSSFile;
|
||||
import com.jero.modules.oss.service.IOSSFileService;
|
||||
import com.jero.modules.personal.entity.LawsBrowsingHistory;
|
||||
import com.jero.modules.personal.entity.LawsStandardCollection;
|
||||
import com.jero.modules.personal.service.ILawsBrowsingHistoryService;
|
||||
import com.jero.modules.personal.service.ILawsStandardCollectionService;
|
||||
import com.jero.modules.split.common.FileUnZip;
|
||||
import com.jero.modules.split.entity.SarFileSplitInfoEO;
|
||||
import com.jero.modules.split.service.ISarFileSplitInfoService;
|
||||
import com.jero.modules.sys.service.ILawsGradeService;
|
||||
import com.jero.modules.system.entity.SysDepart;
|
||||
import com.jero.modules.system.entity.SysDictItem;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysDepartService;
|
||||
import com.jero.modules.system.service.ISysDictItemService;
|
||||
import com.jero.modules.system.service.ISysUserDepartService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.system.util.SysWaterMarkUtil;
|
||||
import com.jero.modules.system.util.UserUtils;
|
||||
@@ -75,7 +70,6 @@ import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -105,52 +99,45 @@ import java.util.zip.ZipOutputStream;
|
||||
@Component
|
||||
public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
|
||||
@Value(value = "${jero.path.upload}")
|
||||
private String uploadPath;
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private LawsCommonMapper lawsCommonMapper;
|
||||
@Autowired
|
||||
@Resource
|
||||
private ILawsAreaService lawsAreaService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private ISysUserService sysUserService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private ISysDepartService sysDepartService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private IOSSFileService ossFileService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private ILawsStandardCollectionService lawsStandardCollectionService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private ISysDictItemService sysDictItemService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private ILawsNodeRelationService lawsNodeRelationService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private ILawsReplacedStandardService lawsReplacedStandardService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private ILawsStandardFileService lawsStandardFileService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private ILawsTreeNodeService lawsTreeNodeService;
|
||||
@Autowired
|
||||
private ILawsBrowsingHistoryService lawsBrowsingHistoryService;
|
||||
|
||||
@Resource
|
||||
private EnterpriseStandardInspectContentService esInspectContentService;
|
||||
@Resource
|
||||
private EnterpriseStandardUtil esUtil;
|
||||
@Resource
|
||||
private ImportUtil importUtil;
|
||||
// 自我注入
|
||||
@Autowired
|
||||
@Resource
|
||||
private ILawsCommonService commonService;
|
||||
@Resource
|
||||
private EnterpriseStandardAuthUserService esAuthUserService;
|
||||
@Resource
|
||||
private SysWaterMarkUtil sysWaterMarkUtil;
|
||||
@Autowired
|
||||
@Resource
|
||||
private ISarFileSplitInfoService sarFileSplitInfoService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private ILawsDomesticStandardService lawsDomesticStandardService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private ILawsEnterpriseStandardService lawsEnterpriseStandardService;
|
||||
@Resource
|
||||
private EnterpriseStandardAuthDeptService enterpriseAuthDeptService;
|
||||
@@ -158,12 +145,14 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
private ILawsHomeSearchService lawsHomeSearchService;
|
||||
@Resource
|
||||
private DocumentSplitMapper documentSplitMapper;
|
||||
|
||||
@Resource
|
||||
private PartNameService partNameService;
|
||||
|
||||
private ILawsPartNameService partNameService;
|
||||
@Resource
|
||||
private ISysDepartService departService;
|
||||
@Resource
|
||||
private ISysUserService sysUserRoleService;
|
||||
@Resource
|
||||
private ILawsPartNameStandardService partNameStandardService;
|
||||
|
||||
public static boolean ENCRYPT_ENABLE;
|
||||
public static String DECRYPT_URL;
|
||||
@@ -174,40 +163,22 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
public void setEnable(boolean enable) {
|
||||
ENCRYPT_ENABLE = enable;
|
||||
}
|
||||
|
||||
@Value("${download.decrypt.url}")
|
||||
public void setDecryptUrl(String decryptUrl) {
|
||||
DECRYPT_URL = decryptUrl;
|
||||
}
|
||||
|
||||
@Value("${download.decrypt.app_code}")
|
||||
public void setDecryptAppCode(String decryptAppCode) {
|
||||
DECRYPT_APP_CODE = decryptAppCode;
|
||||
}
|
||||
|
||||
@Value("${download.decrypt.secret_key}")
|
||||
public void setDecryptSecretKey(String decryptSecretKey) {
|
||||
DECRYPT_SECRET_KEY = decryptSecretKey;
|
||||
}
|
||||
|
||||
@Resource
|
||||
private ISysUserService sysUserRoleService;
|
||||
|
||||
@Resource
|
||||
private ISysUserDepartService sysUserDepartService;
|
||||
|
||||
@Resource
|
||||
private ILawsGradeService gradeService;
|
||||
|
||||
@Resource
|
||||
private EnterpriseStandardAuthUserMapper authUserMapper;
|
||||
|
||||
@Value("#{'${adminRoleCode}'.split(',')}")
|
||||
private List<String> adminRoleCodeList;
|
||||
|
||||
@Value("#{'${enterpriseDetailRoleCode}'.split(',')}")
|
||||
private List<String> enterpriseDetailRoleCodeList;
|
||||
|
||||
@Value("#{'${download.enable}'}")
|
||||
private boolean enable;
|
||||
|
||||
@@ -254,8 +225,8 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
fieldListSelect.add(createTimeTag);
|
||||
|
||||
// 获取分页参数
|
||||
Integer pageNo = Integer.valueOf(parameterMap.get("pageNo").toString());
|
||||
Integer pageSize = Integer.valueOf(parameterMap.get("pageSize").toString());
|
||||
int pageNo = Integer.parseInt(parameterMap.get("pageNo").toString());
|
||||
int pageSize = Integer.parseInt(parameterMap.get("pageSize").toString());
|
||||
IPage<Map<String, Object>> page = new Page<>(pageNo, pageSize);
|
||||
// 封装查询返回字段
|
||||
String selectField = getSelectField(fieldListSelect);
|
||||
@@ -266,7 +237,7 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
try {
|
||||
infoPage = lawsCommonMapper.getCommonPage(page, tableName, selectField, selectCondition);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("分页查询异常", e);
|
||||
throw new JeroBootException("非法参数异常");
|
||||
}
|
||||
// 对返回的数据做处理
|
||||
@@ -521,8 +492,10 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
}
|
||||
} else if (FieldCommon.PART_NAME.equals(key) && StringUtils.isNotBlank(value)) {
|
||||
// 如果是零部件
|
||||
List<String> partNameIdList = partNameStandardService.getByStandardId(id);
|
||||
// 根据标准id找到对应的零部件记录
|
||||
LambdaQueryWrapper<PartName> partNameLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
partNameLambdaQueryWrapper.in(PartName::getCode, Arrays.asList(value.split(",")));
|
||||
partNameLambdaQueryWrapper.in(PartName::getCode, partNameIdList);
|
||||
List<PartName> partNameList = partNameService.list(partNameLambdaQueryWrapper);
|
||||
resultMap.put(key, value);
|
||||
resultMap.put(key + FieldCommon._DICT_TEXT, partNameList.stream().map(PartName::getName).collect(Collectors.joining(",")));
|
||||
@@ -703,7 +676,6 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
}
|
||||
// 将更新数据库的标准体系字段设置为空
|
||||
parameterMap.put(FieldCommon.STANDARD_SYSTEM, "");
|
||||
|
||||
// 处理新增和编辑时的代替标准、引用标准
|
||||
processReplaced(parameterMap, standardNumber, module);
|
||||
|
||||
@@ -714,14 +686,13 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
// 筛选出表单显示的
|
||||
fieldList = fieldList.stream().filter(lawsTag -> YesOrNoEnum.YES.getInteger()
|
||||
.equals(lawsTag.getIsShowFormCreate())).collect(Collectors.toList());
|
||||
// 新增字段
|
||||
StringBuilder fieldsBuilder = new StringBuilder();
|
||||
// 新增数据值
|
||||
StringBuilder valuesBuilder = new StringBuilder();
|
||||
// 对默认的字段赋值
|
||||
//对默认的字段赋值
|
||||
String existId = parameterMap.get(FieldCommon.ID) == null ? "" : parameterMap.get(FieldCommon.ID).toString();
|
||||
//先新增后面在编辑
|
||||
String id = executeInsertByModel(module, existId);
|
||||
// 处理零部件
|
||||
processPartName(parameterMap, id);
|
||||
parameterMap.put(FieldCommon.PART_NAME, "");
|
||||
// 更新语句
|
||||
UpdateWrapper updateWrapper = new UpdateWrapper();
|
||||
updateWrapper.eq("id", id);
|
||||
@@ -736,7 +707,6 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
String now = dateFormat.format(date);
|
||||
recordBuffer.append(loginUser.calcNameWorkNo() + " " + now + " 修改" +
|
||||
standardNumber + "《" + standardName + "》,");
|
||||
String oldStr = recordBuffer.toString();
|
||||
|
||||
// 拼接要添加的数据
|
||||
for (Map.Entry<String, Object> entryMap : parameterMap.entrySet()) {
|
||||
@@ -754,8 +724,6 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
jointInsertFieldAndValue(fieldList, key, value, id, standardNumber, updateWrapper);
|
||||
}
|
||||
}
|
||||
// 操作数据库进行新增数据
|
||||
//lawsCommonMapper.commonAdd(tableName, fieldsBuilder.toString(), valuesBuilder.toString());
|
||||
//根据类型更新数据
|
||||
executeUpdateWrapperByModel(module, updateWrapper);
|
||||
|
||||
@@ -783,6 +751,23 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
return ResultCommon.OK;
|
||||
}
|
||||
|
||||
private void processPartName(Map<String, Object> parameterMap, String standardId) {
|
||||
// 零部件
|
||||
String partName = (String) parameterMap.get(FieldCommon.PART_NAME);
|
||||
if (StrUtil.isBlank(partName)) {
|
||||
return;
|
||||
}
|
||||
List<String> partNameIdList = Arrays.asList(partName.split(","));
|
||||
List<LawsPartNameStandard> partNameStandardList = new ArrayList<>();
|
||||
partNameIdList.forEach(partNameId -> {
|
||||
LawsPartNameStandard partNameStandard = new LawsPartNameStandard();
|
||||
partNameStandard.setStandardId(standardId);
|
||||
partNameStandard.setPartNameId(partNameId);
|
||||
partNameStandardList.add(partNameStandard);
|
||||
});
|
||||
partNameStandardService.saveBatch(partNameStandardList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存新增编辑企标时的稽查内容
|
||||
*
|
||||
@@ -1013,8 +998,6 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
if (StringUtils.isNotBlank(replacedStandard)) {
|
||||
// 再添加新的关联
|
||||
lawsReplacedStandardService.addRelationWithReplaceFlag(replacedStandard, standardNumber, 1, replaceFlag);
|
||||
/*parameterMap.put(FieldCommon.REPLACED_STANDARD, "");
|
||||
parameterMap.put(FieldCommon.REPLACED_BY_STANDARD, "");*/
|
||||
}
|
||||
// 引用标准
|
||||
String referenceStandard = (String) parameterMap.get(FieldCommon.REFERENCE_STANDARD);
|
||||
@@ -1023,8 +1006,6 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
if (StringUtils.isNotBlank(referenceStandard)) {
|
||||
// 再添加新的关联
|
||||
lawsReplacedStandardService.addRelationWithReplaceFlag(referenceStandard, standardNumber, 2, replaceFlag);
|
||||
/*parameterMap.put(FieldCommon.REFERENCE_STANDARD, "");
|
||||
parameterMap.put(FieldCommon.REFERENCED_STANDARD, "");*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ public class ImportUtil {
|
||||
private ILawsDomesticStandardService lawsDomeStandardService;
|
||||
|
||||
@Resource
|
||||
private PartNameService partNameService;
|
||||
private ILawsPartNameService IPartNameService;
|
||||
|
||||
|
||||
public List<String> validExcelData(Sheet sheet, List<LawsTag> headerList, Map<String, File> fileMap, List<Map<String, Object>> insertDataList) {
|
||||
@@ -642,7 +642,7 @@ public class ImportUtil {
|
||||
List<String> valueList = Arrays.asList(cellValue.split(","));
|
||||
LambdaQueryWrapper<PartName> partNameLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
partNameLambdaQueryWrapper.in(PartName::getName, valueList);
|
||||
List<PartName> partNameList = partNameService.list(partNameLambdaQueryWrapper);
|
||||
List<PartName> partNameList = IPartNameService.list(partNameLambdaQueryWrapper);
|
||||
Map<String, String> partMap = partNameList.stream().collect(Collectors.toMap(PartName::getName, PartName::getCode));
|
||||
|
||||
StringBuilder result = new StringBuilder();
|
||||
@@ -751,7 +751,7 @@ public class ImportUtil {
|
||||
String[] valueList = cellValue.split(",");
|
||||
LambdaQueryWrapper<PartName> partNameWrapper = new LambdaQueryWrapper<>();
|
||||
partNameWrapper.in(PartName::getName, Arrays.asList(valueList));
|
||||
List<PartName> list = partNameService.list(partNameWrapper);
|
||||
List<PartName> list = IPartNameService.list(partNameWrapper);
|
||||
Map<String, String> partNameMap = list.stream().collect(Collectors.toMap(PartName::getName, PartName::getCode));
|
||||
for (String value : valueList) {
|
||||
if (partNameMap.get(value) == null) {
|
||||
|
||||
+7
-7
@@ -38,7 +38,7 @@ import com.jero.modules.laws.labeldatabase.service.ILawsLabelDatabaseService;
|
||||
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
|
||||
import com.jero.modules.laws.standard.entity.PartName;
|
||||
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
|
||||
import com.jero.modules.laws.standard.service.PartNameService;
|
||||
import com.jero.modules.laws.standard.service.ILawsPartNameService;
|
||||
import com.jero.modules.split.entity.SarFileSplitInfoEO;
|
||||
import com.jero.modules.split.entity.SarFileSplitItemsValEO;
|
||||
import com.jero.modules.split.entity.SarFileSplitMenuEO;
|
||||
@@ -123,7 +123,7 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
private final EnterpriseStandardAuthDeptService enterpriseStandardAuthDeptService;
|
||||
private final ISysUserDepartService sysUserDepartService;
|
||||
private final ILawsGradeService lawsGradeService;
|
||||
private final PartNameService partNameService;
|
||||
private final ILawsPartNameService IPartNameService;
|
||||
private final ILawsLabelDatabaseService lawsLabelDatabaseService;
|
||||
private final ISysBaseAPI sysBaseAPI;
|
||||
private final ISarFileSplitItemsValEOService sarFileSplitItemsValEOService;
|
||||
@@ -186,7 +186,7 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
EnterpriseStandardAuthDeptService enterpriseStandardAuthDeptService,
|
||||
ISysUserDepartService sysUserDepartService,
|
||||
ILawsGradeService lawsGradeService,
|
||||
PartNameService partNameService,
|
||||
ILawsPartNameService IPartNameService,
|
||||
ILawsLabelDatabaseService lawsLabelDatabaseService,
|
||||
ISysBaseAPI sysBaseAPI,
|
||||
ISarFileSplitItemsValEOService sarFileSplitItemsValEOService,
|
||||
@@ -207,7 +207,7 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
this.enterpriseStandardAuthDeptService = enterpriseStandardAuthDeptService;
|
||||
this.sysUserDepartService = sysUserDepartService;
|
||||
this.lawsGradeService = lawsGradeService;
|
||||
this.partNameService = partNameService;
|
||||
this.IPartNameService = IPartNameService;
|
||||
this.lawsLabelDatabaseService = lawsLabelDatabaseService;
|
||||
this.sysBaseAPI = sysBaseAPI;
|
||||
this.sarFileSplitItemsValEOService = sarFileSplitItemsValEOService;
|
||||
@@ -399,19 +399,19 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
// 零部件翻译
|
||||
if (map.containsKey("applicable_components")){
|
||||
String applicableComponents = (String) map.get("applicable_components");
|
||||
List<PartName> partNames = partNameService.queryEcho(applicableComponents);
|
||||
List<PartName> partNames = IPartNameService.queryEcho(applicableComponents);
|
||||
map.put("applicable_components_dictText", partNames.stream().map(PartName::getName).collect(Collectors.joining(",")));
|
||||
}
|
||||
// 涉及系统/部件(关键词)
|
||||
if (map.containsKey("keywords")){
|
||||
String applicableComponents = (String) map.get("keywords");
|
||||
List<PartName> partNames = partNameService.queryEcho(applicableComponents);
|
||||
List<PartName> partNames = IPartNameService.queryEcho(applicableComponents);
|
||||
map.put("keywords_dictText", partNames.stream().map(PartName::getName).collect(Collectors.joining(",")));
|
||||
}
|
||||
// 关键控制器
|
||||
if (map.containsKey("key_controller")){
|
||||
String applicableComponents = (String) map.get("key_controller");
|
||||
List<PartName> partNames = partNameService.queryEcho(applicableComponents);
|
||||
List<PartName> partNames = IPartNameService.queryEcho(applicableComponents);
|
||||
map.put("key_controller_dictText", partNames.stream().map(PartName::getName).collect(Collectors.joining(",")));
|
||||
}
|
||||
// 属性标识翻译
|
||||
|
||||
+5
-8
@@ -1,13 +1,10 @@
|
||||
package com.jero.modules.laws.standard.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.modules.laws.enterprise.entity.vo.LawsTreeNodeModel;
|
||||
import com.jero.modules.laws.standard.entity.LawsTreeNode;
|
||||
import com.jero.modules.laws.standard.entity.PartName;
|
||||
import com.jero.modules.laws.standard.entity.TreePage;
|
||||
import com.jero.modules.laws.standard.service.PartNameService;
|
||||
import com.jero.modules.laws.standard.service.ILawsPartNameService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
@@ -29,7 +26,7 @@ import java.util.Map;
|
||||
public class LawsPartNameController {
|
||||
|
||||
@Resource
|
||||
private PartNameService partNameService;
|
||||
private ILawsPartNameService IPartNameService;
|
||||
|
||||
@AutoLog(value = "企业标准-零部件树")
|
||||
@ApiOperation(value = "企业标准-零部件树", notes = "企业标准-零部件树")
|
||||
@@ -44,7 +41,7 @@ public class LawsPartNameController {
|
||||
if (pageSize == null) {
|
||||
pageSize = 5;
|
||||
}
|
||||
TreePage<PartName> list = partNameService.queryTreeList(nodeName, pageNo, pageSize);
|
||||
TreePage<PartName> list = IPartNameService.queryTreeList(nodeName, pageNo, pageSize);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
@@ -52,7 +49,7 @@ public class LawsPartNameController {
|
||||
@ApiOperation(value = "企业标准-零部件树选中回显", notes = "企业标准-零部件树选中回显")
|
||||
@PostMapping("/echo")
|
||||
public Result<List<PartName>> queryEcho(@RequestBody Map<String, String> selectNodeCodes) {
|
||||
List<PartName> list = partNameService.queryEcho(selectNodeCodes.get("selectNodeCodes"));
|
||||
List<PartName> list = IPartNameService.queryEcho(selectNodeCodes.get("selectNodeCodes"));
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
@@ -60,7 +57,7 @@ public class LawsPartNameController {
|
||||
@ApiOperation(value = "企业标准-零部件树历史数据处理", notes = "企业标准-零部件树历史数据处理")
|
||||
@PostMapping("/hisDataFix")
|
||||
public Result<List<PartName>> hisDataFix() {
|
||||
partNameService.fixFirstNodeCode();
|
||||
IPartNameService.fixFirstNodeCode();
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package com.jero.modules.laws.standard.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName laws_part_name_standard
|
||||
*/
|
||||
@TableName(value ="laws_part_name_standard")
|
||||
@Data
|
||||
public class LawsPartNameStandard implements Serializable {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 标准ID
|
||||
*/
|
||||
@ApiModelProperty(value = "标准ID")
|
||||
private String standardId;
|
||||
|
||||
/**
|
||||
* 零部件ID
|
||||
*/
|
||||
@ApiModelProperty(value = "零部件ID")
|
||||
private String partNameId;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -96,15 +96,6 @@ public class PartName implements Serializable {
|
||||
*/
|
||||
@ApiModelProperty(value = "父级分类内部码(根节点0)")
|
||||
private String parentCode;
|
||||
/**备用字段1*/
|
||||
@ApiModelProperty(value = "备用字段1")
|
||||
private String remark1;
|
||||
/**备用字段2*/
|
||||
@ApiModelProperty(value = "备用字段2")
|
||||
private String remark2;
|
||||
/**备用字段3*/
|
||||
@ApiModelProperty(value = "备用字段3")
|
||||
private String remark3;
|
||||
|
||||
/**
|
||||
* 子零部件
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.jero.modules.laws.standard.mapper;
|
||||
|
||||
import com.jero.modules.laws.standard.entity.LawsPartNameStandard;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【laws_part_name_standard】的数据库操作Mapper
|
||||
* @createDate 2024-07-01 14:05:46
|
||||
* @Entity com.jero.modules.laws.standard.entity.LawsPartNameStandard
|
||||
*/
|
||||
public interface LawsPartNameStandardMapper extends BaseMapper<LawsPartNameStandard> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.laws.standard.mapper.LawsPartNameStandardMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.jero.modules.laws.standard.entity.LawsPartNameStandard">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="standardId" column="standard_id" jdbcType="VARCHAR"/>
|
||||
<result property="partNameId" column="part_name_id" jdbcType="VARCHAR"/>
|
||||
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="orgCode" column="org_code" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,standard_id,part_name_id,
|
||||
create_by,create_time,update_by,
|
||||
update_time,org_code
|
||||
</sql>
|
||||
</mapper>
|
||||
+1
-1
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
* @description 针对表【laws_part_name】的数据库操作Service
|
||||
* @createDate 2024-01-19 10:37:39
|
||||
*/
|
||||
public interface PartNameService extends IService<PartName> {
|
||||
public interface ILawsPartNameService extends IService<PartName> {
|
||||
|
||||
/**
|
||||
* 查询零部件树
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.jero.modules.laws.standard.service;
|
||||
|
||||
import com.jero.modules.laws.standard.entity.LawsPartNameStandard;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【laws_part_name_standard】的数据库操作Service
|
||||
* @createDate 2024-07-01 14:05:46
|
||||
*/
|
||||
public interface ILawsPartNameStandardService extends IService<LawsPartNameStandard> {
|
||||
|
||||
/**
|
||||
* 根据标准Id获取所有绑定的零部件Id
|
||||
*
|
||||
* @param standardId
|
||||
* @return
|
||||
*/
|
||||
List<String> getByStandardId(String standardId);
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.jero.modules.laws.standard.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.modules.laws.standard.entity.LawsPartNameStandard;
|
||||
import com.jero.modules.laws.standard.service.ILawsPartNameStandardService;
|
||||
import com.jero.modules.laws.standard.mapper.LawsPartNameStandardMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【laws_part_name_standard】的数据库操作Service实现
|
||||
* @createDate 2024-07-01 14:05:46
|
||||
*/
|
||||
@Service
|
||||
public class LawsPartNameStandardServiceImpl extends ServiceImpl<LawsPartNameStandardMapper, LawsPartNameStandard>
|
||||
implements ILawsPartNameStandardService {
|
||||
|
||||
@Override
|
||||
public List<String> getByStandardId(String standardId) {
|
||||
LambdaQueryWrapper<LawsPartNameStandard> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(LawsPartNameStandard::getStandardId, standardId);
|
||||
return this.list(queryWrapper).stream().map(LawsPartNameStandard::getPartNameId).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+2
-5
@@ -2,15 +2,12 @@ package com.jero.modules.laws.standard.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.enums.YesOrNoEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.modules.laws.standard.entity.LawsTreeNode;
|
||||
import com.jero.modules.laws.standard.entity.PartName;
|
||||
import com.jero.modules.laws.standard.entity.TreePage;
|
||||
import com.jero.modules.laws.standard.service.PartNameService;
|
||||
import com.jero.modules.laws.standard.service.ILawsPartNameService;
|
||||
import com.jero.modules.laws.standard.mapper.PartNameMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -29,7 +26,7 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
public class PartNameServiceImpl extends ServiceImpl<PartNameMapper, PartName>
|
||||
implements PartNameService {
|
||||
implements ILawsPartNameService {
|
||||
|
||||
@Resource
|
||||
private PartNameMapper partNameMapper;
|
||||
|
||||
+4
-4
@@ -27,7 +27,7 @@ import com.jero.modules.laws.documenttool.service.IDocumentSplitService;
|
||||
import com.jero.modules.laws.labeldatabase.entity.LawsLabelDatabase;
|
||||
import com.jero.modules.laws.labeldatabase.service.ILawsLabelDatabaseService;
|
||||
import com.jero.modules.laws.standard.entity.PartName;
|
||||
import com.jero.modules.laws.standard.service.PartNameService;
|
||||
import com.jero.modules.laws.standard.service.ILawsPartNameService;
|
||||
import com.jero.modules.oss.entity.OSSFile;
|
||||
import com.jero.modules.oss.service.IOSSFileService;
|
||||
import com.jero.modules.split.common.ConvertHtml2Excel;
|
||||
@@ -143,7 +143,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
@Autowired
|
||||
private IDocumentSplitService documentSplitService;
|
||||
@Autowired
|
||||
private PartNameService partNameService;
|
||||
private ILawsPartNameService IPartNameService;
|
||||
@Autowired
|
||||
private ILawsLabelDatabaseService lawsLabelDatabaseService;
|
||||
@Autowired
|
||||
@@ -2605,7 +2605,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
// 特殊字段
|
||||
if (StringUtils.isNotBlank(value) && SPECIAL_FIELD.contains(dbfieldName)){
|
||||
if (partNameList.isEmpty()){
|
||||
List<PartName> partNames = partNameService.list(new LambdaQueryWrapper<PartName>().ne(PartName::getCode, "Part"));
|
||||
List<PartName> partNames = IPartNameService.list(new LambdaQueryWrapper<PartName>().ne(PartName::getCode, "Part"));
|
||||
partNameList = partNameGetLevelPath(partNames);
|
||||
}
|
||||
String[] treePathList = value.split(",");
|
||||
@@ -3479,7 +3479,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
// 特殊翻译
|
||||
if (entry.getKey().equals("applicable_components")){
|
||||
String applicableComponents = (String) entry.getValue();
|
||||
List<PartName> partNames = partNameService.queryEcho(applicableComponents);
|
||||
List<PartName> partNames = IPartNameService.queryEcho(applicableComponents);
|
||||
entry.setValue(partNames.stream().map(PartName::getName).collect(Collectors.joining(",")));
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user