2 Commits

  1. 3
      archives/src/main/java/com/storeroom/modules/dictionary/controller/ArchivesTypeController.java
  2. 2
      archives/src/main/java/com/storeroom/modules/dictionary/service/ArchivesTypeService.java
  3. 9
      archives/src/main/java/com/storeroom/modules/dictionary/service/impl/ArchivesTypeServiceImpl.java

3
archives/src/main/java/com/storeroom/modules/dictionary/controller/ArchivesTypeController.java

@ -65,7 +65,8 @@ public class ArchivesTypeController {
if (archivesTypeDTO.getIsType() == 1 || archivesTypeDTO.getIsType() == 4) { if (archivesTypeDTO.getIsType() == 1 || archivesTypeDTO.getIsType() == 4) {
throw new BaseException("文件夹或卷内不能被选中"); throw new BaseException("文件夹或卷内不能被选中");
} }
return ApiResponse.success(archivesTypeService.create(archivesTypeDTO));
archivesTypeService.create(archivesTypeDTO);
return ApiResponse.success(ResponseStatus.SUCCESS);
} }
@ApiOperation("修改门类") @ApiOperation("修改门类")

2
archives/src/main/java/com/storeroom/modules/dictionary/service/ArchivesTypeService.java

@ -17,7 +17,7 @@ public interface ArchivesTypeService {
* 创建门类 * 创建门类
* @param archivesTypeDTO * @param archivesTypeDTO
*/ */
ArchivesType create(ArchivesTypeDTO archivesTypeDTO);
void create(ArchivesTypeDTO archivesTypeDTO);
/** /**

9
archives/src/main/java/com/storeroom/modules/dictionary/service/impl/ArchivesTypeServiceImpl.java

@ -39,10 +39,11 @@ public class ArchivesTypeServiceImpl implements ArchivesTypeService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ArchivesType create(ArchivesTypeDTO archivesTypeDTO) {
public void create(ArchivesTypeDTO archivesTypeDTO) {
//#生成表名称 //#生成表名称
String tableName = "tb_"; String tableName = "tb_";
ArchivesType archivesType = archivesTypeMapper.toEntity(archivesTypeDTO); ArchivesType archivesType = archivesTypeMapper.toEntity(archivesTypeDTO);
List<ArchivesType> artChilder= archivesType.getChildren();
List<ArchivesType> archivesType1 = archivesTypeRepository.findByCnName(archivesType.getCnName()); List<ArchivesType> archivesType1 = archivesTypeRepository.findByCnName(archivesType.getCnName());
if (archivesType1.size() == 0) { if (archivesType1.size() == 0) {
@ -63,8 +64,7 @@ public class ArchivesTypeServiceImpl implements ArchivesTypeService {
} }
//如果模板类型为案卷 //如果模板类型为案卷
if (item.getIsType() == 3) { if (item.getIsType() == 3) {
ArchivesType ar = createTemplateRoot(archivesTypeDTO.getPid(),cnName, item);
createInChive(ar.getId(), cnName, item.getChildren());
createArchives(archivesTypeDTO.getPid(),cnName, artChilder);
} }
//如果是文件级 //如果是文件级
if (item.getIsType() == 5){ if (item.getIsType() == 5){
@ -84,7 +84,6 @@ public class ArchivesTypeServiceImpl implements ArchivesTypeService {
} }
}); });
} }
return archivesType;
} }
tableName += DateUtils.getNowDateTime(); tableName += DateUtils.getNowDateTime();
@ -96,8 +95,6 @@ public class ArchivesTypeServiceImpl implements ArchivesTypeService {
} else { } else {
throw new BaseException("门类名称不能重复"); throw new BaseException("门类名称不能重复");
} }
return archivesType;
} }
private ArchivesType createTemplateRoot(String pid,String cnName, ArchivesType item) { private ArchivesType createTemplateRoot(String pid,String cnName, ArchivesType item) {

Loading…
Cancel
Save