| | |
| | | import java.util.List; |
| | | import com.qianwen.core.tool.utils.StringPool; |
| | | |
| | | /* loaded from: blade-core-tool-9.3.0.0-SNAPSHOT.jar:org/springblade/core/tool/node/BaseNode.class */ |
| | | public class BaseNode<T> implements INode<T> { |
| | | private static final long serialVersionUID = 1; |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | protected Long parentId; |
| | | @JsonInclude(JsonInclude.Include.NON_EMPTY) |
| | | protected List<T> children = new ArrayList(); |
| | | protected List<T> children = new ArrayList<>(); |
| | | @JsonInclude(JsonInclude.Include.NON_EMPTY) |
| | | private Boolean hasChildren; |
| | | |
| | |
| | | |
| | | import com.qianwen.core.tool.utils.StringPool; |
| | | |
| | | /* loaded from: blade-core-tool-9.3.0.0-SNAPSHOT.jar:org/springblade/core/tool/node/ForestNode.class */ |
| | | public class ForestNode extends BaseNode<ForestNode> { |
| | | private static final long serialVersionUID = 1; |
| | | private Object content; |
| | |
| | | this.content = content; |
| | | } |
| | | |
| | | @Override // org.springblade.core.tool.node.BaseNode |
| | | @Override |
| | | public String toString() { |
| | | return "ForestNode(content=" + getContent() + StringPool.RIGHT_BRACKET; |
| | | } |
| | | |
| | | @Override // org.springblade.core.tool.node.BaseNode |
| | | @Override |
| | | public boolean equals(final Object o) { |
| | | if (o == this) { |
| | | return true; |
| | |
| | | return false; |
| | | } |
| | | |
| | | @Override // org.springblade.core.tool.node.BaseNode |
| | | @Override |
| | | protected boolean canEqual(final Object other) { |
| | | return other instanceof ForestNode; |
| | | } |
| | | |
| | | @Override // org.springblade.core.tool.node.BaseNode |
| | | @Override |
| | | public int hashCode() { |
| | | Object $content = getContent(); |
| | | int result = (1 * 59) + ($content == null ? 43 : $content.hashCode()); |
| | |
| | | if (licenseMap.get(tenantId) != null) { |
| | | return licenseMap.get(tenantId); |
| | | } |
| | | Tenant tenant = (Tenant) tenantMapper.selectOne(Lambda.eq(Tenant::getTenantId, tenantId)); |
| | | Tenant tenant = tenantMapper.selectOne(Lambda.eq(Tenant::getTenantId, tenantId)); |
| | | if (Func.isNotEmpty(tenant.getBladeLicense())) { |
| | | licenseMap.put(Func.toStr(tenant.getTenantId()), tenant.getBladeLicense()); |
| | | } |
| | |
| | | package com.qianwen.smartman.modules.andon.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.support.SFunction; |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.google.common.collect.Lists; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.util.List; |
| | | import com.qianwen.smartman.common.cache.RegionCache; |
| | | import com.qianwen.smartman.common.utils.Lambda; |
| | | import com.qianwen.smartman.common.utils.MessageUtils; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.google.common.collect.Lists; |
| | | import com.qianwen.core.log.exception.ServiceException; |
| | | import com.qianwen.core.mp.service.impl.BladeServiceImpl; |
| | | import com.qianwen.core.mp.support.Condition; |
| | | import com.qianwen.core.mp.support.Query; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.common.utils.Lambda; |
| | | import com.qianwen.smartman.common.utils.MessageUtils; |
| | | import com.qianwen.smartman.modules.andon.convert.AndonReasonConvert; |
| | | import com.qianwen.smartman.modules.andon.entity.AndonReason; |
| | | import com.qianwen.smartman.modules.andon.mapper.AndonReasonMapper; |
| | |
| | | import com.qianwen.smartman.modules.cps.vo.IdsVO; |
| | | import com.qianwen.smartman.modules.system.service.ICodeGeneratorService; |
| | | import com.qianwen.smartman.modules.tpm.enums.MetaTypeEnum; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/andon/service/impl/AndonReasonServiceImpl.class */ |
| | | public class AndonReasonServiceImpl extends BladeServiceImpl<AndonReasonMapper, AndonReason> implements IAndonReasonService { |
| | | private final ICodeGeneratorService codeGeneratorService; |
| | | public AndonReasonServiceImpl(ICodeGeneratorService codeGeneratorService) { |
| | |
| | | return AndonReasonConvert.INSTANCE.convert(reason); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.andon.service.IAndonReasonService |
| | | @Override |
| | | public Boolean updateReason(AndonReasonUpdateVO vo) { |
| | | |
| | | int nums = this.baseMapper.recordsReason(Lists.newArrayList(new Long[]{vo.getId()})); |
| | |
| | | //Boolean.valueOf(((LambdaUpdateChainWrapper)((LambdaUpdateChainWrapper)((LambdaUpdateChainWrapper)Lambda.updateWrapper(this.baseMapper).set(AndonReason::getName, vo.getName())).set(AndonReason::getRemark, vo.getRemark())).eq(BaseEntity::getId, vo.getId())).update()); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.andon.service.IAndonReasonService |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Boolean removeReason(IdsVO vo) { |
| | | List<Long> ids = Func.toLongList(vo.getIds()); |
| | |
| | | } |
| | | |
| | | private void checkDuplicateCode(String code) { |
| | | List<AndonReason> list = list(Lambda.eq((v0) -> { |
| | | return v0.getCode(); |
| | | }, code)); |
| | | List<AndonReason> list = list(Lambda.eq(AndonReason::getCode, code)); |
| | | if (Func.isNotEmpty(list)) { |
| | | throw new ServiceException(MessageUtils.message("andon.type.reason.code.dub", new Object[0])); |
| | | } |
| | |
| | | package com.qianwen.smartman.modules.andon.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.google.common.collect.Lists; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | import com.qianwen.smartman.common.cache.RegionCache; |
| | | import com.qianwen.smartman.common.utils.Lambda; |
| | | import com.qianwen.smartman.common.utils.MessageUtils; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import com.google.common.collect.Lists; |
| | | import com.qianwen.core.log.exception.ServiceException; |
| | | import com.qianwen.core.mp.service.impl.BladeServiceImpl; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.common.utils.Lambda; |
| | | import com.qianwen.smartman.common.utils.MessageUtils; |
| | | import com.qianwen.smartman.modules.andon.convert.AndonTypeConvert; |
| | | import com.qianwen.smartman.modules.andon.entity.AndonRecord; |
| | | import com.qianwen.smartman.modules.andon.entity.AndonType; |
| | |
| | | import com.qianwen.smartman.modules.andon.vo.BindingDeviceTypeVO; |
| | | import com.qianwen.smartman.modules.system.service.ICodeGeneratorService; |
| | | import com.qianwen.smartman.modules.tpm.enums.MetaTypeEnum; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/andon/service/impl/AndonTypeServiceImpl.class */ |
| | | public class AndonTypeServiceImpl extends BladeServiceImpl<AndonTypeMapper, AndonType> implements IAndonTypeService { |
| | | private final ICodeGeneratorService codeGeneratorService; |
| | | private final IDeviceAndonTypeService deviceAndonTypeService; |
| | |
| | | this.recordService = recordService; |
| | | } |
| | | |
| | | @Override // org.springblade.modules.andon.service.IAndonTypeService |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public AndonTypeVO saveAndonType(AndonTypeSaveVO vo) { |
| | | andonTypeCodeGenerator(vo); |
| | |
| | | return AndonTypeConvert.INSTANCE.convert(type); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.andon.service.IAndonTypeService |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Boolean updateAndonType(AndonTypeUpdateVO vo) { |
| | | Long typeId = vo.getId(); |
| | |
| | | saveDeviceTypeBinding(typeId, deviceTypeIds); |
| | | return Boolean.valueOf(update); |
| | | |
| | | /* |
| | | Long typeId = vo.getId(); |
| | | notUpdate(typeId); |
| | | boolean update = ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) Lambda.updateWrapper(this.baseMapper).set((v0) -> { |
| | | return v0.getName(); |
| | | }, vo.getName())).set((v0) -> { |
| | | return v0.getRemark(); |
| | | }, vo.getRemark())).eq((v0) -> { |
| | | return v0.getId(); |
| | | }, typeId)).update(); |
| | | List<AndonRecord> list = this.recordService.list((Wrapper) Lambda.eq((v0) -> { |
| | | return v0.getTypeId(); |
| | | }, typeId).in((v0) -> { |
| | | return v0.getCurStatus(); |
| | | }, Lists.newArrayList(new Integer[]{AndonStatusEnum.ALREADY_RECEIVED.getStatus(), AndonStatusEnum.HAVA_INITIATED.getStatus()}))); |
| | | List<Long> deviceTypeIds = vo.getDeviceTypeIds(); |
| | | if (Func.isNotEmpty(list)) { |
| | | List<DeviceAndonType> typeList = this.deviceAndonTypeService.list(Lambda.eq((v0) -> { |
| | | return v0.getAndonTypeId(); |
| | | }, typeId)); |
| | | List<Long> collect = (List) typeList.stream().map((v0) -> { |
| | | return v0.getDeviceTypeId(); |
| | | }).collect(Collectors.toList()); |
| | | boolean sameList = sameList(collect, deviceTypeIds); |
| | | if (sameList) { |
| | | throw new ServiceException(MessageUtils.message("andon.type.device.type.update", new Object[0])); |
| | | } |
| | | } |
| | | boolean update2 = this.deviceAndonTypeService.remove(Lambda.eq((v0) -> { |
| | | return v0.getAndonTypeId(); |
| | | }, typeId)) && update; |
| | | saveDeviceTypeBinding(typeId, deviceTypeIds); |
| | | return Boolean.valueOf(update2); |
| | | */ |
| | | } |
| | | |
| | | @Override // org.springblade.modules.andon.service.IAndonTypeService |
| | | @Override |
| | | public Boolean removeAndonType(Long typeId) { |
| | | notRemove(typeId); |
| | | return Boolean.valueOf(removeById(typeId)); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.andon.service.IAndonTypeService |
| | | @Override |
| | | public List<AndonTypeVO> andonTypeList(String keyword) { |
| | | return this.baseMapper.andonTypeList(keyword); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.andon.service.IAndonTypeService |
| | | @Override |
| | | public AndonTypeDetailVO detail(Long typeId) { |
| | | return this.baseMapper.detail(typeId); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.andon.service.IAndonTypeService |
| | | @Override |
| | | public List<BindingDeviceTypeVO> allDeviceTypes(String typeId) { |
| | | return this.baseMapper.allDeviceTypes(typeId); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.andon.service.IAndonTypeService |
| | | @Override |
| | | public List<AndonTypeVO> workBanding(Long workstationId) { |
| | | return this.baseMapper.workBanding(workstationId); |
| | | } |
| | |
| | | if (l1.size() != l2.size()) { |
| | | return true; |
| | | } |
| | | String c1 = (String) l1.stream().sorted((v0, v1) -> { |
| | | String c1 = l1.stream().sorted((v0, v1) -> { |
| | | return v0.compareTo(v1); |
| | | }).map((v0) -> { |
| | | return String.valueOf(v0); |
| | | }).collect(Collectors.joining(",")); |
| | | String c2 = (String) l2.stream().sorted((v0, v1) -> { |
| | | String c2 = l2.stream().sorted((v0, v1) -> { |
| | | return v0.compareTo(v1); |
| | | }).map((v0) -> { |
| | | return String.valueOf(v0); |
| | |
| | | } |
| | | |
| | | private void notRemove(Long typeId) { |
| | | List<AndonRecord> list = this.recordService.list(Lambda.eq((v0) -> { |
| | | return v0.getTypeId(); |
| | | }, typeId)); |
| | | List<AndonRecord> list = this.recordService.list(Lambda.eq(AndonRecord::getTypeId, typeId)); |
| | | if (Func.isNotEmpty(list)) { |
| | | throw new ServiceException(MessageUtils.message("andon.type.has.record", new Object[0])); |
| | | } |
| | |
| | | Lists.newArrayList(AndonStatusEnum.ALREADY_RECEIVED.getStatus(), AndonStatusEnum.HAVA_INITIATED.getStatus()))); |
| | | if (Func.isNotEmpty(list)) |
| | | throw new ServiceException(MessageUtils.message("andon.type.not.update", new Object[0])); |
| | | /* |
| | | List<AndonRecord> list = this.recordService.list((Wrapper) Lambda.eq((v0) -> { |
| | | return v0.getTypeId(); |
| | | }, typeId).in((v0) -> { |
| | | return v0.getCurStatus(); |
| | | }, Lists.newArrayList(new Integer[]{AndonStatusEnum.ALREADY_RECEIVED.getStatus(), AndonStatusEnum.HAVA_INITIATED.getStatus()}))); |
| | | if (Func.isNotEmpty(list)) { |
| | | throw new ServiceException(MessageUtils.message("andon.type.not.update", new Object[0])); |
| | | } |
| | | */ |
| | | |
| | | } |
| | | |
| | | private void saveDeviceTypeBinding(Long andonTypeId, List<Long> deviceTypeIds) { |
| | |
| | | package com.qianwen.smartman.modules.coproduction.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.google.common.collect.Lists; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.time.LocalDate; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | |
| | | import java.util.Map; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | import com.qianwen.smartman.common.cache.RegionCache; |
| | | import com.qianwen.smartman.common.constant.CommonConstant; |
| | | import com.qianwen.smartman.common.constant.ExcelConstant; |
| | | import com.qianwen.smartman.common.utils.Lambda; |
| | | import com.qianwen.smartman.common.utils.MessageUtils; |
| | | import com.qianwen.smartman.common.utils.TimeUtils; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.google.common.collect.Lists; |
| | | import com.qianwen.core.excel.util.ExcelUtil; |
| | | import com.qianwen.core.log.exception.ServiceException; |
| | | import com.qianwen.core.mp.base.BaseServiceImpl; |
| | |
| | | import com.qianwen.core.oss.model.BladeFile; |
| | | import com.qianwen.core.tool.utils.DateUtil; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.common.constant.CommonConstant; |
| | | import com.qianwen.smartman.common.constant.ExcelConstant; |
| | | import com.qianwen.smartman.common.utils.Lambda; |
| | | import com.qianwen.smartman.common.utils.MessageUtils; |
| | | import com.qianwen.smartman.common.utils.TimeUtils; |
| | | import com.qianwen.smartman.modules.coproduction.convert.OrderReportRecordConvert; |
| | | import com.qianwen.smartman.modules.coproduction.convert.ReportConvert; |
| | | import com.qianwen.smartman.modules.coproduction.dto.JuxtapositionReportDTO; |
| | |
| | | import com.qianwen.smartman.modules.coproduction.vo.OrderReportRecordResVO; |
| | | import com.qianwen.smartman.modules.coproduction.vo.OrderReportRecordSearchVO; |
| | | import com.qianwen.smartman.modules.resource.builder.oss.OssBuilder; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/coproduction/service/impl/OrderReportRecordServiceImpl.class */ |
| | |
| | | return orderReportRecord; |
| | | } |
| | | |
| | | @Override // org.springblade.modules.coproduction.service.IOrderReportRecordService |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Boolean updateRecord(OrderProcessReportWorkDTO workDTO, OrderReportRecord orderReportRecord, OrderProcess orderProcess) { |
| | | int qualifyNum = workDTO.getQualifyNum().intValue() + ((orderReportRecord.getQualifyNum() == null) ? 0 : orderReportRecord.getQualifyNum().intValue()); |
| | | int scrappedNum = workDTO.getScrappedNum().intValue() + ((orderReportRecord.getScrappedNum() == null) ? 0 : orderReportRecord.getScrappedNum().intValue()); |
| | | Integer whetherParallel = orderProcess.getWhetherParallel(); |
| | | //Integer whetherParallel = orderProcess.getWhetherParallel(); |
| | | if (Func.isEmpty(orderReportRecord.getMainSequenceId()) && qualifyNum == 0 && scrappedNum == 0) |
| | | throw new ServiceException(MessageUtils.message("production.report.fail.is.not.parallel.qualifyNum.and.scrappedNum.is.not.zero", new Object[0])); |
| | | return Boolean.valueOf(update(Wrappers.<OrderReportRecord>lambdaUpdate() |
| | |
| | | .set(OrderReportRecord::getRemark, workDTO.getRemark()))); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.coproduction.service.IOrderReportRecordService |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public OrderReportRecord buildReportRecord(OrderProcessReportWorkDTO reportWorkDTO, OrderReportRecord orderReportRecord) { |
| | | orderReportRecord.setQualifyNum(Integer.valueOf(reportWorkDTO.getQualifyNum().intValue() + orderReportRecord.getQualifyNum().intValue())).setScrappedNum(Integer.valueOf(reportWorkDTO.getScrappedNum().intValue() + orderReportRecord.getScrappedNum().intValue())).setWorkshopUserId(Long.valueOf(Func.toLong(reportWorkDTO.getWorkshopUserId()))).setWorkshopUserName(reportWorkDTO.getWorkshopUserName()).setWorkshopUserCode(reportWorkDTO.getWorkshopUserCode()).setQualityUserId(Long.valueOf(Func.toLong(reportWorkDTO.getQualityUserId()))).setQualityUserName(reportWorkDTO.getQualityUserName()).setQualityUserCode(reportWorkDTO.getQualityUserCode()).setRemark(reportWorkDTO.getRemark()).setRecordStatus(CoProductionEnum.RecordStatus.YES.getCode()).setQualityTime(DateUtil.now()).setWorkshopTime(DateUtil.now()); |
| | | return orderReportRecord; |
| | | } |
| | | |
| | | @Override // org.springblade.modules.coproduction.service.IOrderReportRecordService |
| | | @Override |
| | | public OrderReportRecord getLatestRecord(Long planId, Long orderId, Long orderProcessId) { |
| | | List<OrderReportRecord> list = list(Wrappers.<OrderReportRecord>lambdaQuery() |
| | | .eq(Func.isNotEmpty(planId), OrderReportRecord::getPlanId, planId) |
| | |
| | | return orderProcessReportWorkDTO; |
| | | } |
| | | |
| | | @Override // org.springblade.modules.coproduction.service.IOrderReportRecordService |
| | | @Override |
| | | public IPage<OrderReportRecordResVO> pageQuery(OrderReportRecordSearchVO vo) { |
| | | Query query = vo.getQuery(); |
| | | Long productId = vo.getProductId(); |
| | |
| | | String startTime = Func.notNull(startDate) ? TimeUtils.getStartTime(startDate) : ""; |
| | | LocalDate endDate = vo.getEndDate(); |
| | | String endTime = Func.notNull(endDate) ? TimeUtils.getEndTime(endDate) : ""; |
| | | IPage<OrderReportRecordResVO> page = ((OrderReportRecordMapper) this.baseMapper).pageQuery(Condition.getPage(query), getWrapper(orderId, productId, reportEmployeeIds, workEmployeeIds, startTime, endTime)); |
| | | IPage<OrderReportRecordResVO> page = this.baseMapper.pageQuery(Condition.getPage(query), getWrapper(orderId, productId, reportEmployeeIds, workEmployeeIds, startTime, endTime)); |
| | | List<OrderReportRecordResVO> records = page.getRecords(); |
| | | if (Func.isEmpty(records)) { |
| | | return new Page(); |
| | | return new Page<>(); |
| | | } |
| | | List<Long> recordIds = (List) records.stream().map((v0) -> { |
| | | List<Long> recordIds = records.stream().map((v0) -> { |
| | | return v0.getId(); |
| | | }).collect(Collectors.toList()); |
| | | List<OrderReportRecord> recordList = list(Lambda.in((v0) -> { |
| | | return v0.getOpenSequenceId(); |
| | | }, recordIds)); |
| | | if (Func.isEmpty(recordList)) { |
| | | page.setRecords((List) records.stream().peek(r -> { |
| | | page.setRecords(records.stream().peek(r -> { |
| | | if (Func.notNull(r.getStartTime()) && Func.notNull(r.getEndTime())) { |
| | | r.setReportTime(Long.valueOf(DateUtil.between(r.getStartTime(), r.getEndTime()).getSeconds())); |
| | | } |
| | | }).collect(Collectors.toList())); |
| | | return page; |
| | | } |
| | | Map<Long, List<OrderReportRecord>> recordMap = (Map) recordList.stream().collect(Collectors.groupingBy((v0) -> { |
| | | Map<Long, List<OrderReportRecord>> recordMap = recordList.stream().collect(Collectors.groupingBy((v0) -> { |
| | | return v0.getOpenSequenceId(); |
| | | })); |
| | | List<OrderReportRecordResVO> vos = completeData(records, recordMap); |
| | |
| | | if (Func.isEmpty(records)) { |
| | | return exportRecord(Lists.newArrayList()); |
| | | } |
| | | List<Long> recordIds = (List) records.stream().map((v0) -> { |
| | | List<Long> recordIds = records.stream().map((v0) -> { |
| | | return v0.getId(); |
| | | }).collect(Collectors.toList()); |
| | | List<OrderReportRecord> recordList = list(Lambda.in((v0) -> { |
| | |
| | | return exportHasChildRecord(records, recordList); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.coproduction.service.IOrderReportRecordService |
| | | @Override |
| | | public List<OrderChildRecordVO> queryChildRecord(String mainRecordId) { |
| | | List<OrderReportRecord> records = list(Lambda.eq((v0) -> { |
| | | return v0.getOpenSequenceId(); |
| | | }, mainRecordId)); |
| | | List<Long> opIds = (List) records.stream().map((v0) -> { |
| | | List<OrderReportRecord> records = list(Lambda.eq(OrderReportRecord::getOpenSequenceId, mainRecordId)); |
| | | List<Long> opIds = records.stream().map((v0) -> { |
| | | return v0.getProcessId(); |
| | | }).collect(Collectors.toList()); |
| | | List<OrderProcess> orderProcessList = this.orderProcessService.listByIds(opIds); |
| | | Map<Long, OrderProcess> map = (Map) orderProcessList.stream().collect(Collectors.toMap((v0) -> { |
| | | Map<Long, OrderProcess> map = orderProcessList.stream().collect(Collectors.toMap((v0) -> { |
| | | return v0.getId(); |
| | | }, v -> { |
| | | return v; |
| | | })); |
| | | return (List) records.stream().map(c -> { |
| | | return records.stream().map(c -> { |
| | | return convertVO(c, map); |
| | | }).collect(Collectors.toList()); |
| | | } |
| | |
| | | } |
| | | |
| | | private BladeFile exportNoChildRecord(List<OrderReportRecordResVO> records) { |
| | | List<OrderReportRecordExport> result = (List) records.stream().map(OrderReportRecordServiceImpl::getExport).collect(Collectors.toList()); |
| | | List<OrderReportRecordExport> result = records.stream().map(OrderReportRecordServiceImpl::getExport).collect(Collectors.toList()); |
| | | return exportRecord(result); |
| | | } |
| | | |
| | | private BladeFile exportHasChildRecord(List<OrderReportRecordResVO> records, List<OrderReportRecord> recordList) { |
| | | Map<Long, List<OrderReportRecord>> recordMap = (Map) recordList.stream().collect(Collectors.groupingBy((v0) -> { |
| | | Map<Long, List<OrderReportRecord>> recordMap = recordList.stream().collect(Collectors.groupingBy((v0) -> { |
| | | return v0.getOpenSequenceId(); |
| | | })); |
| | | List<OrderReportRecordExport> result = Lists.newArrayList(); |
| | | List<OrderProcess> orderProcessList = this.orderProcessService.list(); |
| | | Map<Long, OrderProcess> orderProcessMap = (Map) orderProcessList.stream().collect(Collectors.toMap((v0) -> { |
| | | Map<Long, OrderProcess> orderProcessMap = orderProcessList.stream().collect(Collectors.toMap((v0) -> { |
| | | return v0.getId(); |
| | | }, v -> { |
| | | return v; |
| | | })); |
| | | records.forEach(rd -> { |
| | | OrderReportRecordExport convert = getExport(rd); |
| | | List<OrderReportRecord> childRecords = (List) recordMap.get(rd.getId()); |
| | | List<OrderReportRecord> childRecords = recordMap.get(rd.getId()); |
| | | if (Func.isNotEmpty(childRecords)) { |
| | | String workstationNames = (String) childRecords.stream().map((v0) -> { |
| | | return v0.getWorkstationName(); |
| | |
| | | QueryWrapper<T> wrapper = Wrappers.<T>query().eq(Func.notNull(productId), "bp.product_id", productId).eq(Func.notNull(orderId), "borr.order_id", orderId).in(Func.isNotEmpty(reportEmployeeIds), "borr.workshop_user_id", reportEmployeeIds).in(Func.isNotEmpty(workEmployeeIds), "borr.producer_user_id", workEmployeeIds); |
| | | if (Func.isNotBlank(startTime) && Func.isNotBlank(endTime)) { |
| | | wrapper.nested(nt -> { |
| | | QueryWrapper queryWrapper = (QueryWrapper) ((QueryWrapper) ((QueryWrapper) nt.between("borr.start_time", startTime, endTime)).or()).between("borr.workshop_time", startTime, endTime); |
| | | nt.between("borr.start_time", startTime, endTime).or().between("borr.workshop_time", startTime, endTime); |
| | | }); |
| | | } else if (Func.isNotBlank(startTime)) { |
| | | wrapper.nested(nt2 -> { |
| | | QueryWrapper queryWrapper = (QueryWrapper) ((QueryWrapper) ((QueryWrapper) nt2.gt("borr.start_time", startTime)).or()).gt("borr.start_time", startTime); |
| | | nt2.gt("borr.start_time", startTime).or().gt("borr.start_time", startTime); |
| | | }); |
| | | } else if (Func.isNotBlank(endTime)) { |
| | | wrapper.nested(nt3 -> { |
| | | QueryWrapper queryWrapper = (QueryWrapper) ((QueryWrapper) ((QueryWrapper) nt3.le("borr.workshop_time", endTime)).or()).le("borr.workshop_time", endTime); |
| | | nt3.le("borr.workshop_time", endTime).or().le("borr.workshop_time", endTime); |
| | | }); |
| | | } |
| | | if (Func.isNotBlank(wrapper.getSqlSegment())) { |
| | |
| | | } |
| | | |
| | | private List<OrderReportRecordResVO> completeData(List<OrderReportRecordResVO> records, Map<Long, List<OrderReportRecord>> recordMap) { |
| | | return (List) records.stream().peek(r -> { |
| | | return records.stream().peek(r -> { |
| | | if (Func.notNull(r.getStartTime()) && Func.notNull(r.getEndTime())) { |
| | | r.setReportTime(Long.valueOf(DateUtil.between(r.getStartTime(), r.getEndTime()).getSeconds())); |
| | | } |
| | | List<OrderReportRecord> childRecords = (List) recordMap.get(r.getId()); |
| | | List<OrderReportRecord> childRecords = recordMap.get(r.getId()); |
| | | if (Func.isNotEmpty(childRecords)) { |
| | | String workstationIds = (String) childRecords.stream().map(c -> { |
| | | Long workstationId = c.getWorkstationId(); |
| | |
| | | }).collect(Collectors.joining(",")); |
| | | Long workstationId = r.getWorkstationId(); |
| | | r.setWorkstationIds(workstationId == null ? workstationIds : String.join(",", String.valueOf(workstationId), workstationIds)); |
| | | String workstationNames = (String) childRecords.stream().map((v0) -> { |
| | | String workstationNames = childRecords.stream().map((v0) -> { |
| | | return v0.getWorkstationName(); |
| | | }).filter((v0) -> { |
| | | return Func.notNull(v0); |
| | |
| | | if (Func.isEmpty(reportWorkDTOList)) { |
| | | throw new ServiceException(MessageUtils.message("production.report.fail.data.empty", new Object[0])); |
| | | } |
| | | List<String> recordIds = (List) reportWorkDTOList.stream().map((v0) -> { |
| | | List<String> recordIds = reportWorkDTOList.stream().map((v0) -> { |
| | | return v0.getRecordId(); |
| | | }).collect(Collectors.toList()); |
| | | Map<Long, OrderReportRecord> recordMap = getRecordMap(recordIds); |
| | |
| | | throw new ServiceException(MessageUtils.message("production.report.fail.data.empty", new Object[0])); |
| | | } |
| | | this.orderProcessService.parallelProcessAround(ReportConvert.INSTANCE.convertParallel(reportWorkDTOList), Boolean.TRUE); |
| | | List<String> recordIds = (List) reportWorkDTOList.stream().map((v0) -> { |
| | | List<String> recordIds = reportWorkDTOList.stream().map((v0) -> { |
| | | return v0.getRecordId(); |
| | | }).distinct().collect(Collectors.toList()); |
| | | Map<Long, OrderReportRecord> recordMap = getRecordMap(recordIds); |
| | |
| | | package com.qianwen.smartman.modules.cps.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.util.List; |
| | | import com.qianwen.smartman.common.constant.ExtCacheConstant; |
| | | import com.qianwen.smartman.common.enums.GlobalWcsTypeEnum; |
| | | import com.qianwen.smartman.common.utils.Lambda; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.qianwen.core.cache.utils.CacheUtil; |
| | | import com.qianwen.core.log.exception.ServiceException; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.common.constant.ExtCacheConstant; |
| | | import com.qianwen.smartman.common.enums.GlobalWcsTypeEnum; |
| | | import com.qianwen.smartman.common.utils.Lambda; |
| | | import com.qianwen.smartman.modules.cps.convert.GlobalWcsConvert; |
| | | import com.qianwen.smartman.modules.cps.entity.GlobalWcs; |
| | | import com.qianwen.smartman.modules.cps.entity.GlobalWcsOfRps; |
| | |
| | | import com.qianwen.smartman.modules.cps.service.IGlobalWcsService; |
| | | import com.qianwen.smartman.modules.cps.vo.WcsAchievementsUpdateVO; |
| | | import com.qianwen.smartman.modules.cps.vo.WcsAndAchievementsVO; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | @Service |
| | | |
| | | public class GlobalWcsServiceImpl extends ServiceImpl<GlobalWcsMapper, GlobalWcs> implements IGlobalWcsService { |
| | | |
| | | |
| | | @Override // org.springblade.modules.cps.service.IGlobalWcsService |
| | | @Override |
| | | public List<GlobalWcs> getGlobalWcsList(GlobalWcsTypeEnum globalWcsTypeEnum) { |
| | | return list(Wrappers.<GlobalWcs>lambdaQuery().eq(GlobalWcs::getType, globalWcsTypeEnum.getType()).orderByAsc(GlobalWcs::getSeq)); |
| | | /* |
| | | return list((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getType(); |
| | | }, globalWcsTypeEnum.getType())).orderByAsc((v0) -> { |
| | | return v0.getSeq(); |
| | | }));*/ |
| | | |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IGlobalWcsService |
| | | @Override |
| | | public List<WcsAndAchievementsVO> getWcsAndAchievements() { |
| | | return ((GlobalWcsMapper) this.baseMapper).wcsAndAchievements(); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IGlobalWcsService |
| | | @Override |
| | | public GlobalWcs getByCode(String code, GlobalWcsTypeEnum globalWcsTypeEnum) { |
| | | return getOne(Lambda.eq(GlobalWcs::getCode, code).eq(GlobalWcs::getType, globalWcsTypeEnum.getType())); |
| | | /* |
| | | return (GlobalWcs) getOne((Wrapper) Lambda.eq((v0) -> { |
| | | return v0.getCode(); |
| | | }, code).eq((v0) -> { |
| | | return v0.getType(); |
| | | }, globalWcsTypeEnum.getType()));*/ |
| | | |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IGlobalWcsService |
| | | @Override |
| | | @Transactional |
| | | public void updateWcsAndAchievements(WcsAchievementsUpdateVO wcsAchievements) { |
| | | boolean update = lambdaUpdate() |
| | | lambdaUpdate() |
| | | .set(Func.isNotBlank(wcsAchievements.getName()), GlobalWcs::getName, wcsAchievements.getName()) |
| | | .set(Func.isNotBlank(wcsAchievements.getColor()), GlobalWcs::getColor, wcsAchievements.getColor()) |
| | | .eq(GlobalWcs::getCode, wcsAchievements.getCode()).update(); |
| | | /* |
| | | ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) ((LambdaUpdateChainWrapper) lambdaUpdate().set(Func.isNotBlank(wcsAchievements.getName()), (v0) -> { |
| | | return v0.getName(); |
| | | }, wcsAchievements.getName())).set(Func.isNotBlank(wcsAchievements.getColor()), (v0) -> { |
| | | return v0.getColor(); |
| | | }, wcsAchievements.getColor())).eq((v0) -> { |
| | | return v0.getCode(); |
| | | }, wcsAchievements.getCode())).update();*/ |
| | | |
| | | GlobalWcsOfRps globalWcsOfRps = new GlobalWcsOfRps(); |
| | | globalWcsOfRps.setCode(wcsAchievements.getCode()); |
| | | globalWcsOfRps.setRps(wcsAchievements.getRps()); |
| | |
| | | CacheUtil.clear(ExtCacheConstant.POSTING_WORKSTATION, Boolean.FALSE); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IGlobalWcsService |
| | | @Override |
| | | @Transactional |
| | | public boolean insertWcsAndAchievements(WcsAchievementsUpdateVO wcsAchievementsUpdateVO) { |
| | | if (count(Lambda.eq((v0) -> { |
| | | return v0.getCode(); |
| | | }, wcsAchievementsUpdateVO.getCode())) > 0) { |
| | | if (count(Lambda.eq(GlobalWcs::getCode, wcsAchievementsUpdateVO.getCode())) > 0) { |
| | | throw new ServiceException("编码已经存在"); |
| | | } |
| | | GlobalWcs globalWcs = GlobalWcsConvert.INSTANCE.convert(wcsAchievementsUpdateVO); |
| | |
| | | package com.qianwen.smartman.modules.cps.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.google.common.collect.Lists; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.util.Collection; |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import com.qianwen.smartman.common.cache.RegionCache; |
| | | import com.qianwen.smartman.common.utils.ExtraLambdaQueryWrapper; |
| | | import com.qianwen.smartman.common.utils.Lambda; |
| | | import com.qianwen.smartman.common.utils.MessageUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.google.common.collect.Lists; |
| | | import com.qianwen.core.log.exception.ServiceException; |
| | | import com.qianwen.core.mp.service.impl.BladeServiceImpl; |
| | | import com.qianwen.core.tool.node.ForestNodeMerger; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.common.utils.Lambda; |
| | | import com.qianwen.smartman.common.utils.MessageUtils; |
| | | import com.qianwen.smartman.modules.cps.convert.ProductionCraftProcessConvert; |
| | | import com.qianwen.smartman.modules.cps.convert.ProductionCraftProcessFileConvert; |
| | | import com.qianwen.smartman.modules.cps.convert.ProductionCraftProcessRelatedFixtureConvert; |
| | |
| | | import com.qianwen.smartman.modules.cps.vo.VersionProcessParallelVO; |
| | | import com.qianwen.smartman.modules.cps.vo.VersionProcessTreeVO; |
| | | import com.qianwen.smartman.modules.cps.vo.VersionProcessUpdateVO; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * 工艺版本的工序流程管理服务 |
| | | */ |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/cps/service/impl/ProductionCraftProcessServiceImpl.class */ |
| | | public class ProductionCraftProcessServiceImpl extends BladeServiceImpl<ProductionCraftProcessMapper, ProductionCraftProcess> implements IProductionCraftProcessService { |
| | | private final IProductionCraftProcessFileService processFileService; |
| | | private final IProductionCraftProcessRelatedToolService relatedToolService; |
| | |
| | | this.relatedFixtureService = relatedFixtureService; |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IProductionCraftProcessService |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public List<ProductionCraftProcessVO> saveVersionProcess(Long versionId, List<VersionProcessAddVO> processList) { |
| | | validFixVersion(versionId); |
| | |
| | | return ProductionCraftProcessConvert.INSTANCE.convert(craftProcessList); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IProductionCraftProcessService |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Boolean removeVersionProcess(List<Long> ids) { |
| | | boolean flag = removeBatchByIds(ids); |
| | | return Boolean.valueOf(flag && removeProcessAssociation(ids)); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IProductionCraftProcessService |
| | | @Override |
| | | public List<ProductionCraftProcess> listProcessByVersion(Long id) { |
| | | return list(Wrappers.lambdaQuery(ProductionCraftProcess.class) |
| | | .eq(ProductionCraftProcess::getVersionId, id) |
| | |
| | | |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IProductionCraftProcessService |
| | | @Override |
| | | public boolean useSameFixture(ProductionCraftProcess currentProcess, ProductionCraftProcess nextProcess) { |
| | | List<ProductionCraftProcessRelatedFixture> currentFixture = this.relatedFixtureService.list(Wrappers.lambdaQuery(ProductionCraftProcessRelatedFixture.class) |
| | | .eq(ProductionCraftProcessRelatedFixture::getVersionProcessId, currentProcess.getId())); |
| | |
| | | return currentIds.containsAll(nextIds); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IProductionCraftProcessService |
| | | @Override |
| | | public Boolean updateSort(ProductionCraftProcessUpdateSortVO productionCraftProcessUpdateSortVO) { |
| | | List<ProductionCraftProcess> list = productionCraftProcessUpdateSortVO.getProcessList().stream().map(i -> { |
| | | ProductionCraftProcess productionCraftProcess = new ProductionCraftProcess(); |
| | |
| | | }, id)); |
| | | List<ProductionCraftProcessRelatedFixtureVO> fixtureList = ProductionCraftProcessRelatedFixtureConvert.INSTANCE.convert(fixtures); |
| | | vo.setFixtures(fixtureList); |
| | | List<ProductionCraftProcessRelatedTool> tools = this.relatedToolService.list( Wrappers.lambdaQuery(ProductionCraftProcessRelatedTool.class).eq((v0) -> { |
| | | return v0.getVersionProcessId(); |
| | | }, id)); |
| | | List<ProductionCraftProcessRelatedTool> tools = this.relatedToolService.list( Wrappers.lambdaQuery(ProductionCraftProcessRelatedTool.class).eq(ProductionCraftProcessRelatedTool::getVersionProcessId, id)); |
| | | List<ProductionCraftProcessRelatedToolVO> toolList = ProductionCraftProcessRelatedToolConvert.INSTANCE.convert(tools); |
| | | vo.setTools(toolList); |
| | | return vo; |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IProductionCraftProcessService |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Boolean removeProcess(ProductionCraftProcessRemoveVO vo) { |
| | | int versionStatus = this.baseMapper.getVersionStatus(vo.getVersionId()); |
| | |
| | | import com.qianwen.smartman.modules.system.entity.User; |
| | | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/dnc/service/impl/DncArtFileServiceImpl.class */ |
| | | public class DncArtFileServiceImpl extends BaseServiceImpl<DncArtFileMapper, DncArtFile> implements IDncArtFileService { |
| | | @Autowired |
| | | private IDncArtBagLogService dncArtBagLogService; |
| | |
| | | @Autowired |
| | | private IFileService fileService; |
| | | |
| | | @Override // org.springblade.modules.dnc.service.IDncArtFileService |
| | | @Override |
| | | public List<DncArtFileAddVO> addArtFile(List<DncArtFileAddVO> dncArtFilesList) { |
| | | if (Func.isNotEmpty(dncArtFilesList)) { |
| | | dncArtFilesList.forEach(dncArtFileAddVO -> { |
| | |
| | | this.dncArtBagLogService.save(dncArtBagLogDTO); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.dnc.service.IDncArtFileService |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public BatchArchiveArtBagFilesVO batchArchiveArtBagFile(BatchArchiveArtBagFilesVO bagFilesVO) { |
| | | List<String> artBagIds = bagFilesVO.getArtBagIds(); |
| | |
| | | return bagFilesVO; |
| | | } |
| | | |
| | | @Override // org.springblade.modules.dnc.service.IDncArtFileService |
| | | @Override |
| | | public boolean duplicateValidationFile(DuplicateValidationFileVO validationFileVO) { |
| | | String artBagId = validationFileVO.getArtBagId(); |
| | | List<ArtFileAddVO> artFileAddVOList = validationFileVO.getArtFileAddVOList(); |
| | |
| | | return list.size() > 0; |
| | | } |
| | | |
| | | @Override // org.springblade.modules.dnc.service.IDncArtFileService |
| | | @Override |
| | | public List<DncArtFileVO> artFileList(String artBagId) { |
| | | List<DncArtFile> list = list(Wrappers.<DncArtFile>lambdaQuery() |
| | | .eq(DncArtFile::getArtBagId, artBagId) |
| | |
| | | return dncArtFileVOList; |
| | | } |
| | | |
| | | @Override // org.springblade.modules.dnc.service.IDncArtFileService |
| | | @Override |
| | | public ArtFileInformationDTO getFileInformation(Long id) { |
| | | ArtFileInformationDTO artFileInformationDTO = new ArtFileInformationDTO(); |
| | | DncArtFile dncArtFile = (DncArtFile) getById(id); |
| | |
| | | return artFileInformationDTO; |
| | | } |
| | | |
| | | @Override // org.springblade.modules.dnc.service.IDncArtFileService |
| | | @Override |
| | | public Map<Long, ArtFileInformationDTO> getArtFileInformationMap(List<Long> ids) { |
| | | Map<Long, ArtFileInformationDTO> map = new HashMap<>(16); |
| | | if (Func.isNotEmpty(ids)) { |
| | |
| | | return map; |
| | | } |
| | | |
| | | @Override // org.springblade.modules.dnc.service.IDncArtFileService |
| | | @Override |
| | | public boolean batchRemoveFile(List<String> ids) { |
| | | List<DncArtFile> list = list(Wrappers.<DncArtFile>lambdaQuery().in(DncArtFile::getId, ids)); |
| | | /* |
| | |
| | | }, fileName));*/ |
| | | } |
| | | |
| | | @Override // org.springblade.modules.dnc.service.IDncArtFileService |
| | | @Override |
| | | public FileSourcePathVO getArtFileSourcePath(String fileId) { |
| | | FileSourcePathVO fileSourcePathVO = new FileSourcePathVO(); |
| | | if (Func.isNotBlank(fileId)) { |
| | |
| | | return fileSourcePathVO; |
| | | } |
| | | |
| | | @Override // org.springblade.modules.dnc.service.IDncArtFileService |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Boolean syncFile(SyncArtCatalogVO syncArtCatalogVO) { |
| | | List<String> suffixes = this.fileService.getSuffix(); |
| | |
| | | import java.io.Serializable; |
| | | import javax.validation.constraints.Size; |
| | | |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/dnc/vo/DncArtFileAddVO.class */ |
| | | public class DncArtFileAddVO implements Serializable { |
| | | @ApiModelProperty(value = "主键id", dataType = "java.lang.String") |
| | | private Long id; |
| | |
| | | import com.qianwen.core.oss.rule.OssRule; |
| | | import com.qianwen.smartman.modules.resource.entity.Oss; |
| | | |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/resource/builder/oss/MinioOssBuilder.class */ |
| | | public class MinioOssBuilder { |
| | | public static OssTemplate template(Oss oss, OssRule ossRule) { |
| | | OssProperties ossProperties = new OssProperties(); |
| | |
| | | import com.qianwen.core.oss.rule.BladeOssRule; |
| | | import com.qianwen.core.oss.rule.OssRule; |
| | | import com.qianwen.core.redis.cache.BladeRedis; |
| | | import com.qianwen.core.tenant.mp.TenantEntity; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.core.tool.utils.SpringUtil; |
| | | import com.qianwen.core.tool.utils.StringUtil; |
| | |
| | | import com.qianwen.smartman.modules.resource.enums.BucketEnum; |
| | | import com.qianwen.smartman.modules.resource.service.IOssService; |
| | | |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/resource/builder/oss/OssBuilder.class */ |
| | | public class OssBuilder { |
| | | public static final String OSS_CODE = "oss:code:"; |
| | | public static final String OSS_PARAM_KEY = "code"; |
| | |
| | | private static BladeRedis bladeRedis; |
| | | private final OssProperties ossProperties; |
| | | private final IOssService ossService; |
| | | private final Map<String, OssTemplate> templatePool = new ConcurrentHashMap(); |
| | | private final Map<String, OssTemplate> templatePool = new ConcurrentHashMap<>(); |
| | | private final Map<String, Oss> ossPool = new ConcurrentHashMap<>(); |
| | | |
| | | public OssBuilder(OssProperties ossProperties, IOssService ossService) { |
| | |
| | | |
| | | private static BladeRedis getBladeRedis() { |
| | | if (bladeRedis == null) { |
| | | bladeRedis = (BladeRedis) SpringUtil.getBean(BladeRedis.class); |
| | | bladeRedis = SpringUtil.getBean(BladeRedis.class); |
| | | } |
| | | return bladeRedis; |
| | | } |
| | |
| | | Oss oss = getOss("000000", code); |
| | | Oss ossCached = this.ossPool.get("000000"); |
| | | OssTemplate template2 = this.templatePool.get("000000"); |
| | | if (!Func.hasEmpty(new Object[]{template2, ossCached}) && oss.getEndpoint().equals(ossCached.getEndpoint()) && oss.getAccessKey().equals(ossCached.getAccessKey())) { |
| | | if (!Func.hasEmpty(template2, ossCached) && oss.getEndpoint().equals(ossCached.getEndpoint()) && oss.getAccessKey().equals(ossCached.getAccessKey())) { |
| | | return template2; |
| | | } |
| | | synchronized (OssBuilder.class) { |
| | |
| | | @RestController |
| | | @ApiResource({"blade-resource/oss"}) |
| | | @NonDS |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/resource/controller/OssController.class */ |
| | | public class OssController extends BladeController { |
| | | private final IOssService ossService; |
| | | private final OssProperties ossProperties; |
| | |
| | | @PostResource({"/update"}) |
| | | @ApiOperation(value = "修改", notes = "传入oss") |
| | | @PreAuth |
| | | public R update(@Valid @RequestBody Oss oss) { |
| | | public R<Void> update(@Valid @RequestBody Oss oss) { |
| | | CacheUtil.clear("blade:resource", ExtCacheConstant.TENANT_MODE); |
| | | return R.status(this.ossService.updateById(oss)); |
| | | } |
| | |
| | | |
| | | @ApiModel(value = "Oss", description = "Oss对象") |
| | | @TableName("blade_oss") |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/resource/entity/Oss.class */ |
| | | public class Oss extends TenantEntity { |
| | | private static final long serialVersionUID = 1; |
| | | @ApiModelProperty("所属分类") |
| | |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /* loaded from: blade-starter-oss-9.3.0.0-SNAPSHOT.jar:org/springblade/core/oss/AliossTemplate.class */ |
| | | public class AliossTemplate implements OssTemplate { |
| | | private final OSSClient ossClient; |
| | | private final OssProperties ossProperties; |
| | |
| | | this.ossRule = ossRule; |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void makeBucket(String bucketName) { |
| | | if (!bucketExists(bucketName)) { |
| | | this.ossClient.createBucket(getBucketName(bucketName)); |
| | | } |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void removeBucket(String bucketName) { |
| | | this.ossClient.deleteBucket(getBucketName(bucketName)); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public boolean bucketExists(String bucketName) { |
| | | return this.ossClient.doesBucketExist(getBucketName(bucketName)); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void copyFile(String bucketName, String fileName, String destBucketName) { |
| | | this.ossClient.copyObject(getBucketName(bucketName), fileName, getBucketName(destBucketName), fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void copyFile(String bucketName, String fileName, String destBucketName, String destFileName) { |
| | | this.ossClient.copyObject(getBucketName(bucketName), fileName, getBucketName(destBucketName), destFileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public OssFile statFile(String fileName) { |
| | | return statFile(this.ossProperties.getBucketName(), fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public OssFile statFile(String bucketName, String fileName) { |
| | | ObjectMetadata stat = this.ossClient.getObjectMetadata(getBucketName(bucketName), fileName); |
| | | OssFile ossFile = new OssFile(); |
| | |
| | | return ossFile; |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public String filePath(String fileName) { |
| | | return getOssHost().concat("/").concat(fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public String filePath(String bucketName, String fileName) { |
| | | return getOssHost(bucketName).concat("/").concat(fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public String fileLink(String fileName) { |
| | | return getOssHost().concat("/").concat(fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public String fileLink(String bucketName, String fileName) { |
| | | return getOssHost(bucketName).concat("/").concat(fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public InputStream getObject(String bucketName, String fileName, Long offset, Long length) { |
| | | return get(bucketName, fileName, offset, length); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public InputStream getObject(String fileName, Long offset, Long length) { |
| | | return get(this.ossProperties.getBucketName(), fileName, offset, length); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public InputStream getObject(String bucketName, String fileName) { |
| | | return get(bucketName, fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public InputStream getObject(String fileName) { |
| | | return get(this.ossProperties.getBucketName(), fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public BladeFile putFile(MultipartFile file) { |
| | | return putFile(this.ossProperties.getBucketName(), file.getOriginalFilename(), file); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public BladeFile putFile(String fileName, MultipartFile file) { |
| | | return putFile(this.ossProperties.getBucketName(), fileName, file); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public BladeFile putFile(String bucketName, String fileName, MultipartFile file) { |
| | | try { |
| | | return putFile(bucketName, fileName, file.getInputStream()); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public BladeFile putFile(String fileName, InputStream stream) { |
| | | return putFile(this.ossProperties.getBucketName(), fileName, stream); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public BladeFile putFile(String bucketName, String fileName, InputStream stream) { |
| | | return put(bucketName, stream, fileName, false); |
| | | } |
| | |
| | | return ossObject.getObjectContent(); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void removeFile(String fileName) { |
| | | this.ossClient.deleteObject(getBucketName(), fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void removeFile(String bucketName, String fileName) { |
| | | this.ossClient.deleteObject(getBucketName(bucketName), fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void removeFiles(List<String> fileNames) { |
| | | fileNames.forEach(this::removeFile); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void removeFiles(String bucketName, List<String> fileNames) { |
| | | fileNames.forEach(fileName -> { |
| | | removeFile(getBucketName(bucketName), fileName); |
| | |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /* loaded from: blade-starter-oss-9.3.0.0-SNAPSHOT.jar:org/springblade/core/oss/HuaweiObsTemplate.class */ |
| | | public class HuaweiObsTemplate implements OssTemplate { |
| | | private final ObsClient obsClient; |
| | | private final OssProperties ossProperties; |
| | |
| | | this.ossRule = ossRule; |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void makeBucket(String bucketName) { |
| | | if (!bucketExists(bucketName)) { |
| | | this.obsClient.createBucket(getBucketName(bucketName)); |
| | | } |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void removeBucket(String bucketName) { |
| | | this.obsClient.deleteBucket(getBucketName(bucketName)); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public boolean bucketExists(String bucketName) { |
| | | return this.obsClient.headBucket(getBucketName(bucketName)); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void copyFile(String bucketName, String fileName, String destBucketName) { |
| | | this.obsClient.copyObject(getBucketName(bucketName), fileName, getBucketName(destBucketName), fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void copyFile(String bucketName, String fileName, String destBucketName, String destFileName) { |
| | | this.obsClient.copyObject(getBucketName(bucketName), fileName, getBucketName(destBucketName), destFileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public OssFile statFile(String fileName) { |
| | | return statFile(this.ossProperties.getBucketName(), fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public OssFile statFile(String bucketName, String fileName) { |
| | | ObjectMetadata stat = this.obsClient.getObjectMetadata(getBucketName(bucketName), fileName); |
| | | OssFile ossFile = new OssFile(); |
| | |
| | | return ossFile; |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public String filePath(String fileName) { |
| | | return getOssHost(getBucketName()).concat("/").concat(fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public String filePath(String bucketName, String fileName) { |
| | | return getOssHost(getBucketName(bucketName)).concat("/").concat(fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public String fileLink(String fileName) { |
| | | return getOssHost().concat("/").concat(fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public String fileLink(String bucketName, String fileName) { |
| | | return getOssHost(getBucketName(bucketName)).concat("/").concat(fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public InputStream getObject(String bucketName, String fileName, Long offset, Long length) { |
| | | return get(bucketName, fileName, offset, length); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public InputStream getObject(String fileName, Long offset, Long length) { |
| | | return get(this.ossProperties.getBucketName(), fileName, offset, length); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public InputStream getObject(String bucketName, String fileName) { |
| | | return get(bucketName, fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public InputStream getObject(String fileName) { |
| | | return getObject(this.ossProperties.getBucketName(), fileName); |
| | | } |
| | |
| | | return ossObject.getObjectContent(); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public BladeFile putFile(MultipartFile file) { |
| | | return putFile(this.ossProperties.getBucketName(), file.getOriginalFilename(), file); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public BladeFile putFile(String fileName, MultipartFile file) { |
| | | return putFile(this.ossProperties.getBucketName(), fileName, file); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public BladeFile putFile(String bucketName, String fileName, MultipartFile file) { |
| | | |
| | | try { |
| | |
| | | } |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public BladeFile putFile(String fileName, InputStream stream) { |
| | | return putFile(this.ossProperties.getBucketName(), fileName, stream); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public BladeFile putFile(String bucketName, String fileName, InputStream stream) { |
| | | return put(bucketName, stream, fileName, false); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void removeFile(String fileName) { |
| | | this.obsClient.deleteObject(getBucketName(), fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void removeFile(String bucketName, String fileName) { |
| | | this.obsClient.deleteObject(getBucketName(bucketName), fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void removeFiles(List<String> fileNames) { |
| | | fileNames.forEach(this::removeFile); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void removeFiles(String bucketName, List<String> fileNames) { |
| | | fileNames.forEach(fileName -> { |
| | | removeFile(getBucketName(bucketName), fileName); |
| | |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /* loaded from: blade-starter-oss-9.3.0.0-SNAPSHOT.jar:org/springblade/core/oss/MinioTemplate.class */ |
| | | public class MinioTemplate implements OssTemplate { |
| | | private final MinioClient client; |
| | | private final OssRule ossRule; |
| | |
| | | this.ossProperties = ossProperties; |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void makeBucket(String bucketName) { |
| | | try { |
| | | if (!this.client.bucketExists(BucketExistsArgs.builder().bucket(getBucketName(bucketName)).build())) { |
| | |
| | | } |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void removeBucket(String bucketName) { |
| | | try { |
| | | this.client.removeBucket(RemoveBucketArgs.builder().bucket(getBucketName(bucketName)).build()); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public boolean bucketExists(String bucketName) { |
| | | try { |
| | | return this.client.bucketExists(BucketExistsArgs.builder().bucket(getBucketName(bucketName)).build()); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void copyFile(String bucketName, String fileName, String destBucketName) { |
| | | copyFile(bucketName, fileName, destBucketName, fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void copyFile(String bucketName, String fileName, String destBucketName, String destFileName) { |
| | | try { |
| | | this.client.copyObject(CopyObjectArgs.builder().source(CopySource.builder().bucket(getBucketName(bucketName)).object(fileName).build()).bucket(getBucketName(destBucketName)).object(destFileName).build()); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public OssFile statFile(String fileName) { |
| | | return statFile(this.ossProperties.getBucketName(), fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public OssFile statFile(String bucketName, String fileName) { |
| | | try { |
| | | StatObjectResponse stat = this.client.statObject(StatObjectArgs.builder().bucket(getBucketName(bucketName)).object(fileName).build()); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public String filePath(String fileName) { |
| | | return getBucketName().concat("/").concat(fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public String filePath(String bucketName, String fileName) { |
| | | return getBucketName(bucketName).concat("/").concat(fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public String fileLink(String fileName) { |
| | | return this.ossProperties.getEndpoint().concat("/").concat(getBucketName()).concat("/").concat(fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public String fileLink(String bucketName, String fileName) { |
| | | return this.ossProperties.getEndpoint().concat("/").concat(getBucketName(bucketName)).concat("/").concat(fileName); |
| | | } |
| | |
| | | import com.qianwen.core.oss.model.OssFile; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /* loaded from: blade-starter-oss-9.3.0.0-SNAPSHOT.jar:org/springblade/core/oss/OssTemplate.class */ |
| | | public interface OssTemplate { |
| | | void makeBucket(String bucketName); |
| | | |
| | |
| | | this.ossRule = ossRule; |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void makeBucket(String bucketName) { |
| | | try { |
| | | if (!CollectionUtil.contains(this.bucketManager.buckets(), getBucketName(bucketName))) { |
| | |
| | | } |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void removeBucket(String bucketName) { |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public boolean bucketExists(String bucketName) { |
| | | try { |
| | | return CollectionUtil.contains(this.bucketManager.buckets(), getBucketName(bucketName)); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void copyFile(String bucketName, String fileName, String destBucketName) { |
| | | try { |
| | | this.bucketManager.copy(getBucketName(bucketName), fileName, getBucketName(destBucketName), fileName); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void copyFile(String bucketName, String fileName, String destBucketName, String destFileName) { |
| | | try { |
| | | this.bucketManager.copy(getBucketName(bucketName), fileName, getBucketName(destBucketName), destFileName); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public OssFile statFile(String fileName) { |
| | | return statFile(this.ossProperties.getBucketName(), fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public OssFile statFile(String bucketName, String fileName) { |
| | | try { |
| | | FileInfo stat = this.bucketManager.stat(getBucketName(bucketName), fileName); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public String filePath(String fileName) { |
| | | return getBucketName().concat("/").concat(fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public String filePath(String bucketName, String fileName) { |
| | | return getBucketName(bucketName).concat("/").concat(fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public String fileLink(String fileName) { |
| | | return this.ossProperties.getEndpoint().concat("/").concat(fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public String fileLink(String bucketName, String fileName) { |
| | | return this.ossProperties.getEndpoint().concat("/").concat(fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public InputStream getObject(String bucketName, String fileName, Long offset, Long length) { |
| | | return get(bucketName, fileName, offset, length); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public InputStream getObject(String fileName, Long offset, Long length) { |
| | | return get(this.ossProperties.getBucketName(), fileName, offset, length); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public InputStream getObject(String bucketName, String fileName) { |
| | | return get(bucketName, fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public InputStream getObject(String fileName) { |
| | | return get(this.ossProperties.getBucketName(), fileName); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public BladeFile putFile(MultipartFile file) { |
| | | return putFile(this.ossProperties.getBucketName(), file.getOriginalFilename(), file); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public BladeFile putFile(String fileName, MultipartFile file) { |
| | | return putFile(this.ossProperties.getBucketName(), fileName, file); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public BladeFile putFile(String bucketName, String fileName, MultipartFile file) { |
| | | |
| | | try { |
| | |
| | | } |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public BladeFile putFile(String fileName, InputStream stream) { |
| | | return putFile(this.ossProperties.getBucketName(), fileName, stream); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public BladeFile putFile(String bucketName, String fileName, InputStream stream) { |
| | | return put(bucketName, stream, fileName, false); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void removeFile(String fileName) { |
| | | try { |
| | | this.bucketManager.delete(getBucketName(), fileName); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void removeFile(String bucketName, String fileName) { |
| | | try { |
| | | this.bucketManager.delete(getBucketName(bucketName), fileName); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void removeFiles(List<String> fileNames) { |
| | | fileNames.forEach(this::removeFile); |
| | | } |
| | | |
| | | @Override // com.qianwen.core.oss.OssTemplate |
| | | @Override |
| | | public void removeFiles(String bucketName, List<String> fileNames) { |
| | | fileNames.forEach(fileName -> { |
| | | removeFile(getBucketName(bucketName), fileName); |
| | |
| | | @ConditionalOnClass({OSSClient.class}) |
| | | @AutoConfigureAfter({OssConfiguration.class}) |
| | | @ConditionalOnProperty(value = {"oss.name"}, havingValue = "huaweiobs") |
| | | /* loaded from: blade-starter-oss-9.3.0.0-SNAPSHOT.jar:org/springblade/core/oss/config/HuaweiObsConfiguration.class */ |
| | | public class HuaweiObsConfiguration { |
| | | private final OssProperties ossProperties; |
| | | |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.qianwen.core.mp.base.BaseEntity; |
| | | |
| | | /* loaded from: blade-starter-tenant-9.3.0.0-SNAPSHOT.jar:org/springblade/core/tenant/mp/TenantEntity.class */ |
| | | public class TenantEntity extends BaseEntity { |
| | | @ApiModelProperty("租户ID") |
| | | private String tenantId; |