| | |
| | | package com.qianwen.smartman.modules.tpm.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.qianwen.core.mp.base.BaseServiceImpl; |
| | | import com.qianwen.core.mp.support.Condition; |
| | | import com.qianwen.core.mp.support.Query; |
| | |
| | | import com.qianwen.smartman.modules.tpm.service.IRepairRecordService; |
| | | import com.qianwen.smartman.modules.tpm.vo.DeviceMaterialRecordVO; |
| | | import com.qianwen.smartman.modules.tpm.vo.RepairRecordMaterialVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/tpm/service/impl/DeviceMaterialRecordServiceImpl.class */ |
| | |
| | | @Lazy |
| | | private IMaintainRecordService maintainRecordService; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -1107875961: |
| | | if (implMethodName.equals("getDeviceId")) { |
| | | z = false; |
| | | break; |
| | | } |
| | | break; |
| | | case 98245393: |
| | | if (implMethodName.equals("getId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 771206363: |
| | | if (implMethodName.equals("getTenantId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 1070984535: |
| | | if (implMethodName.equals("getCreateDept")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 1278665410: |
| | | if (implMethodName.equals("getRecordId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | } |
| | | switch (z) { |
| | | case false: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/tpm/entity/DeviceMaterialRecord") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getDeviceId(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getCreateDept(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/tpm/entity/DeviceMaterialRecord") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getRecordId(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/tpm/entity/DeviceMaterialRecord") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getRecordId(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/tpm/entity/DeviceMaterialRecord") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getRecordId(); |
| | | }; |
| | | } |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/modules/tpm/entity/DeviceMaterialRecord") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getRecordId(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getId(); |
| | | }; |
| | | } |
| | | break; |
| | | case true: |
| | | if (lambda.getImplMethodKind() == 5 && lambda.getFunctionalInterfaceClass().equals("com/baomidou/mybatisplus/core/toolkit/support/SFunction") && lambda.getFunctionalInterfaceMethodName().equals("apply") && lambda.getFunctionalInterfaceMethodSignature().equals("(Ljava/lang/Object;)Ljava/lang/Object;") && lambda.getImplClass().equals("org/springblade/core/tenant/mp/TenantEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getTenantId(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.tpm.service.IDeviceMaterialRecordService |
| | | public Boolean createDeviceMaterialRecord(List<RepairRecordMaterialAddVO> list) { |
| | | List<DeviceMaterialRecord> collect = (List) list.stream().map(o -> { |
| | | List<DeviceMaterialRecord> collect = list.stream().map(o -> { |
| | | return new DeviceMaterialRecord() { // from class: org.springblade.modules.tpm.service.impl.DeviceMaterialRecordServiceImpl.1 |
| | | { |
| | | setRecordId(o.getRecordId()); |
| | |
| | | /* JADX WARN: Multi-variable type inference failed */ |
| | | @Override // org.springblade.modules.tpm.service.IDeviceMaterialRecordService |
| | | public List<RepairRecordMaterialVO> getRecordByRecordId(Long id) { |
| | | List<DeviceMaterialRecord> list = list(Wrappers.<DeviceMaterialRecord>lambdaQuery().eq(DeviceMaterialRecord::getRecordId, id)); |
| | | /* |
| | | List<DeviceMaterialRecord> list = list((Wrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getRecordId(); |
| | | }, id)); |
| | | }, id));*/ |
| | | List<RepairRecordMaterialVO> addDTOList = new ArrayList<>(list.size()); |
| | | if (Func.isNotEmpty(list)) { |
| | | addDTOList = (List) list.stream().map(o -> { |
| | | addDTOList = list.stream().map(o -> { |
| | | RepairRecordMaterialVO vo = new RepairRecordMaterialVO(); |
| | | BeanUtil.copyProperties(o, vo); |
| | | return vo; |
| | |
| | | boolean remove = true; |
| | | boolean save = true; |
| | | if (Func.isNotEmpty(list)) { |
| | | |
| | | List<DeviceMaterialRecord> records = list(Wrappers.<DeviceMaterialRecord>lambdaQuery() |
| | | .eq(DeviceMaterialRecord::getRecordId, list.get(0).getRecordId())); |
| | | remove = remove(Wrappers.<DeviceMaterialRecord>query().lambda().eq(DeviceMaterialRecord::getRecordId, list.get(0).getRecordId())); |
| | | |
| | | /* |
| | | list((Wrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getRecordId(); |
| | | }, list.get(0).getRecordId())); |
| | | remove = remove((Wrapper) Wrappers.query().lambda().eq((v0) -> { |
| | | return v0.getRecordId(); |
| | | }, list.get(0).getRecordId())); |
| | | }, list.get(0).getRecordId()));*/ |
| | | save = createDeviceMaterialRecord(list).booleanValue(); |
| | | } |
| | | return Boolean.valueOf(remove && save); |
| | |
| | | |
| | | @Override // org.springblade.modules.tpm.service.IDeviceMaterialRecordService |
| | | public void deleteDeviceMaterialRecordByRecordId(List<Long> ids) { |
| | | remove((Wrapper) Wrappers.lambdaQuery().in((v0) -> { |
| | | return v0.getRecordId(); |
| | | }, ids)); |
| | | remove(Wrappers.<DeviceMaterialRecord>lambdaQuery().in(DeviceMaterialRecord::getRecordId, ids)); |
| | | |
| | | } |
| | | |
| | | @Override // org.springblade.modules.tpm.service.IDeviceMaterialRecordService |
| | | public IPage<DeviceMaterialRecordVO> pageCheckMaterialRecord(Query query, Long id) { |
| | | IPage<DeviceMaterialRecord> page = page(Condition.getPage(query), Wrappers.<DeviceMaterialRecord>lambdaQuery() |
| | | .eq(DeviceMaterialRecord::getDeviceId, id) |
| | | .eq(Func.isNotEmpty(AuthUtil.getTenantId()), DeviceMaterialRecord::getTenantId, AuthUtil.getTenantId()) |
| | | .orderByDesc(DeviceMaterialRecord::getCreateDept) |
| | | .orderByDesc(DeviceMaterialRecord::getId)); |
| | | /* |
| | | IPage<DeviceMaterialRecord> page = page(Condition.getPage(query), (Wrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getDeviceId(); |
| | | }, id)).eq(Func.isNotEmpty(AuthUtil.getTenantId()), (v0) -> { |
| | |
| | | return v0.getCreateDept(); |
| | | })).orderByDesc((v0) -> { |
| | | return v0.getId(); |
| | | })); |
| | | Page page2 = new Page(page.getCurrent(), page.getSize(), page.getTotal()); |
| | | }));*/ |
| | | Page<DeviceMaterialRecordVO> page2 = new Page<>(page.getCurrent(), page.getSize(), page.getTotal()); |
| | | if (Func.isNotEmpty(page.getRecords())) { |
| | | page2.setRecords(convertData(page.getRecords())); |
| | | } |
| | |
| | | } |
| | | |
| | | private List<DeviceMaterialRecordVO> convertData(List<DeviceMaterialRecord> list) { |
| | | return (List) list.stream().map(o -> { |
| | | return list.stream().map(o -> { |
| | | DeviceMaterialRecordVO vo = new DeviceMaterialRecordVO(); |
| | | BeanUtil.copyProperties(o, vo); |
| | | if (o.getBizType().intValue() == 1) { |
| | | RepairRecord repairRecord = (RepairRecord) this.repairRecordService.getById(o.getRecordId()); |
| | | RepairRecord repairRecord =this.repairRecordService.getById(o.getRecordId()); |
| | | vo.setRecordCode(Func.isEmpty(repairRecord) ? "" : repairRecord.getRecordCode()); |
| | | } else { |
| | | MaintainRecord maintainRecord = (MaintainRecord) this.maintainRecordService.getById(o.getRecordId()); |
| | | MaintainRecord maintainRecord = this.maintainRecordService.getById(o.getRecordId()); |
| | | vo.setRecordCode(Func.isEmpty(maintainRecord) ? "" : maintainRecord.getRecordCode()); |
| | | } |
| | | return vo; |