| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import java.util.Set; |
| | |
| | | import com.qianwen.smartman.modules.cps.dto.MaintainItemExportDTO; |
| | | import com.qianwen.smartman.modules.cps.dto.MaintainItemUpdateVO; |
| | | import com.qianwen.smartman.modules.cps.entity.MaintainItem; |
| | | import com.qianwen.smartman.modules.cps.entity.MaintainProjectItem; |
| | | import com.qianwen.smartman.modules.cps.excel.MaintainItemExcel; |
| | | import com.qianwen.smartman.modules.cps.excel.MaintainItemImport; |
| | | import com.qianwen.smartman.modules.cps.mapper.MaintainItemMapper; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * 保养项的服务 |
| | | */ |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/cps/service/impl/MaintainItemServiceImpl.class */ |
| | | public class MaintainItemServiceImpl extends BladeServiceImpl<MaintainItemMapper, MaintainItem> implements IMaintainItemService { |
| | | private final IMaintainProjectItemService maintainProjectItemService; |
| | | private final IMaintainPlanService maintainPlanService; |
| | | private final IMaintainPlanItemService maintainPlanItemService; |
| | | private final OssBuilder ossBuilder; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -75622813: |
| | | if (implMethodName.equals("getCode")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -75308287: |
| | | if (implMethodName.equals("getName")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 98245393: |
| | | if (implMethodName.equals("getId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 517353092: |
| | | if (implMethodName.equals("getItemId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 771206363: |
| | | if (implMethodName.equals("getTenantId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 803533544: |
| | | if (implMethodName.equals("getStatus")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 1071464927: |
| | | if (implMethodName.equals("getCreateTime")) { |
| | | z = false; |
| | | 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/util/Date;")) { |
| | | return (v0) -> { |
| | | return v0.getCreateTime(); |
| | | }; |
| | | } |
| | | 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/cps/entity/MaintainProjectItem") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getItemId(); |
| | | }; |
| | | } |
| | | 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/cps/entity/MaintainItem") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getName(); |
| | | }; |
| | | } |
| | | 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/cps/entity/MaintainItem") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getName(); |
| | | }; |
| | | } |
| | | 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(); |
| | | }; |
| | | } |
| | | 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(); |
| | | }; |
| | | } |
| | | 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(); |
| | | }; |
| | | } |
| | | 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; |
| | | case RegionCache.VILLAGE_LEVEL /* 5 */: |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getStatus(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getStatus(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getStatus(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getStatus(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getStatus(); |
| | | }; |
| | | } |
| | | 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/cps/entity/MaintainItem") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | 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/cps/entity/MaintainItem") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | 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/cps/entity/MaintainItem") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | 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/cps/entity/MaintainItem") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | 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/cps/entity/MaintainItem") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | public MaintainItemServiceImpl(final IMaintainProjectItemService maintainProjectItemService, final IMaintainPlanService maintainPlanService, final IMaintainPlanItemService maintainPlanItemService, final OssBuilder ossBuilder) { |
| | | this.maintainProjectItemService = maintainProjectItemService; |
| | |
| | | |
| | | @Override // org.springblade.modules.cps.service.IMaintainItemService |
| | | public List<MaintainItemVO> queryMaintainItemList(String keyWord) { |
| | | List<MaintainItem> list = list((Wrapper) ((LambdaQueryWrapper) Wrappers.query().lambda().eq(Func.isNotEmpty(AuthUtil.getTenantId()), (v0) -> { |
| | | return v0.getTenantId(); |
| | | }, AuthUtil.getTenantId()).eq((v0) -> { |
| | | return v0.getStatus(); |
| | | }, CommonConstant.ENABLE)).and(Func.isNotEmpty(keyWord), i -> { |
| | | LambdaQueryWrapper lambdaQueryWrapper = (LambdaQueryWrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) i.likeRight((v0) -> { |
| | | return v0.getName(); |
| | | }, keyWord)).or()).likeRight((v0) -> { |
| | | return v0.getCode(); |
| | | }, keyWord); |
| | | }).orderByAsc((v0) -> { |
| | | return v0.getCode(); |
| | | })); |
| | | //MaintainItem::getName MaintainItem::getCode |
| | | List<MaintainItem> list = list(Wrappers.<MaintainItem>query().lambda().eq(Func.isNotEmpty(AuthUtil.getTenantId()), MaintainItem::getTenantId, AuthUtil.getTenantId()) |
| | | .eq(MaintainItem::getStatus, CommonConstant.ENABLE) |
| | | .and(Func.isNotEmpty(keyWord), i -> { |
| | | LambdaQueryWrapper<MaintainItem> lambdaQueryWrapper = i.likeRight(MaintainItem::getName, keyWord).or().likeRight(MaintainItem::getCode, keyWord); |
| | | }).orderByAsc(MaintainItem::getCode)); |
| | | return MaintainItemConvert.INSTANCE.convert(list); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IMaintainItemService |
| | | @Override // org.springblade.modules.cps.service.IMaintainItemService MaintainItem::getCreateTime |
| | | public IPage<MaintainItemVO> queryMaintainItemListPage(String keyWord, Query query, Integer status) { |
| | | IPage<MaintainItem> pages = page(Condition.getPage(query), (Wrapper) ((LambdaQueryWrapper) Wrappers.query().lambda().eq(Func.isNotEmpty(AuthUtil.getTenantId()), (v0) -> { |
| | | return v0.getTenantId(); |
| | | }, AuthUtil.getTenantId()).eq((v0) -> { |
| | | return v0.getStatus(); |
| | | }, status == null ? CommonConstant.ENABLE : status)).and(Func.isNotEmpty(keyWord), i -> { |
| | | LambdaQueryWrapper lambdaQueryWrapper = (LambdaQueryWrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) i.likeRight((v0) -> { |
| | | return v0.getName(); |
| | | }, keyWord)).or()).likeRight((v0) -> { |
| | | return v0.getCode(); |
| | | }, keyWord); |
| | | }).orderByDesc((v0) -> { |
| | | return v0.getCreateTime(); |
| | | }, new SFunction[]{(v0) -> { |
| | | return v0.getId(); |
| | | }})); |
| | | return (IPage) Optional.ofNullable(pages).map(p -> { |
| | | Page page = new Page(p.getCurrent(), p.getSize(), p.getTotal()); |
| | | IPage<MaintainItem> pages = page(Condition.getPage(query), Wrappers.<MaintainItem>query().lambda() |
| | | .eq(Func.isNotEmpty(AuthUtil.getTenantId()), MaintainItem::getTenantId, AuthUtil.getTenantId()) |
| | | .eq(MaintainItem::getStatus, status == null ? CommonConstant.ENABLE : status) |
| | | .and(Func.isNotEmpty(keyWord), i -> { |
| | | LambdaQueryWrapper<MaintainItem> lambdaQueryWrapper = i.likeRight(MaintainItem::getName, keyWord).or().likeRight(MaintainItem::getCode, keyWord); |
| | | }).orderByDesc(Arrays.asList(MaintainItem::getCreateTime,MaintainItem::getId))); |
| | | |
| | | return Optional.ofNullable(pages).map(p -> { |
| | | Page<MaintainItemVO> page = new Page<>(p.getCurrent(), p.getSize(), p.getTotal()); |
| | | page.setRecords(MaintainItemConvert.INSTANCE.convert(p.getRecords())); |
| | | return page; |
| | | }).orElse(new Page()); |
| | | }).orElse(new Page<>()); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IMaintainItemService |
| | |
| | | public Boolean deleteMaintainItem(List<String> ids, Integer type) { |
| | | if (StatusType.REMOVE.getType().equals(type)) { |
| | | removeByIds(Func.toLongList(ids)); |
| | | this.maintainProjectItemService.remove((Wrapper) Wrappers.query().lambda().in((v0) -> { |
| | | return v0.getItemId(); |
| | | }, ids)); |
| | | this.maintainProjectItemService.remove(Wrappers.<MaintainProjectItem>query().lambda().in(MaintainProjectItem::getItemId, ids)); |
| | | } |
| | | return Boolean.valueOf(changeStatus(Func.toLongList(ids), CommonConstant.DEACTIVATE)); |
| | | } |
| | |
| | | if (data.size() > 200) { |
| | | throw new ServiceException(MessageUtils.message("excel.import.size.failed", new Object[0])); |
| | | } |
| | | List<MaintainItem> maintainItemList = list((Wrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getStatus(); |
| | | }, CommonConstant.ENABLE)); |
| | | Set<String> codeSet = (Set) maintainItemList.stream().map((v0) -> { |
| | | List<MaintainItem> maintainItemList = list(Wrappers.<MaintainItem>lambdaQuery().eq(MaintainItem::getStatus, CommonConstant.ENABLE)); |
| | | Set<String> codeSet = maintainItemList.stream().map((v0) -> { |
| | | return v0.getCode(); |
| | | }).collect(Collectors.toSet()); |
| | | Boolean flag = Boolean.TRUE; |
| | |
| | | } |
| | | } |
| | | if (!flag.booleanValue()) { |
| | | MultipartFile multipartFile = ExcelUtil.exportFillTemplateToMultipartFile(ExcelConstant.DIRECTORY + "保养项导入失败模板" + ExcelConstant.SUFFIX, MessageUtils.message("excel.import.failed.report.name", new Object[0]) + ExcelConstant.SUFFIX, "保养项表", (List) data.stream().filter(x -> { |
| | | MultipartFile multipartFile = ExcelUtil.exportFillTemplateToMultipartFile(ExcelConstant.DIRECTORY + "保养项导入失败模板" + ExcelConstant.SUFFIX, MessageUtils.message("excel.import.failed.report.name", new Object[0]) + ExcelConstant.SUFFIX, "保养项表", data.stream().filter(x -> { |
| | | return Func.isNotEmpty(x.getFailReason()); |
| | | }).collect(Collectors.toList()), (Object) null, (AbstractMergeStrategy) null); |
| | | }).collect(Collectors.toList()), null, (AbstractMergeStrategy) null); |
| | | BladeFile bladeFile = this.ossBuilder.tempTemplate().putFile(multipartFile.getOriginalFilename(), multipartFile); |
| | | return bladeFile; |
| | | } |
| | |
| | | } |
| | | |
| | | private boolean checkCodeStopIsExist(String code) { |
| | | MaintainItem maintainItem = (MaintainItem) getOne((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getCode(); |
| | | }, code)).eq((v0) -> { |
| | | return v0.getStatus(); |
| | | }, CommonConstant.DEACTIVATE)); |
| | | MaintainItem maintainItem = getOne(Wrappers.<MaintainItem>lambdaQuery().eq(MaintainItem::getCode, code).eq(MaintainItem::getStatus, CommonConstant.DEACTIVATE)); |
| | | if (maintainItem != null) { |
| | | return Boolean.TRUE.booleanValue(); |
| | | } |
| | |
| | | } |
| | | |
| | | private boolean checkCodeIsExist(String code, Long id) { |
| | | List<MaintainItem> maintainItemList = this.baseMapper.selectList(((LambdaQueryWrapper) ((LambdaQueryWrapper) Wrappers.query().lambda().eq(Func.isNotEmpty(AuthUtil.getTenantId()), (v0) -> { |
| | | return v0.getTenantId(); |
| | | }, AuthUtil.getTenantId()).eq((v0) -> { |
| | | return v0.getStatus(); |
| | | }, CommonConstant.ENABLE)).eq((v0) -> { |
| | | return v0.getCode(); |
| | | }, code)).notIn(Func.isNotEmpty(id), (v0) -> { |
| | | return v0.getId(); |
| | | }, new Object[]{id})); |
| | | List<MaintainItem> maintainItemList = this.baseMapper.selectList(Wrappers.<MaintainItem>query().lambda() |
| | | .eq(Func.isNotEmpty(AuthUtil.getTenantId()), MaintainItem::getTenantId, AuthUtil.getTenantId()) |
| | | .eq(MaintainItem::getStatus, CommonConstant.ENABLE) |
| | | .eq(MaintainItem::getCode, code) |
| | | .notIn(Func.isNotEmpty(id), MaintainItem::getId, id)); |
| | | return maintainItemList != null && maintainItemList.size() > 0; |
| | | } |
| | | } |
| | |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.modules.cps.convert.MaintainProjectConvert; |
| | | import com.qianwen.smartman.modules.cps.entity.MaintainProject; |
| | | import com.qianwen.smartman.modules.cps.entity.MaintainProjectItem; |
| | | import com.qianwen.smartman.modules.cps.mapper.MaintainProjectMapper; |
| | | import com.qianwen.smartman.modules.cps.service.IMaintainProjectItemService; |
| | | import com.qianwen.smartman.modules.cps.service.IMaintainProjectService; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/cps/service/impl/MaintainProjectServiceImpl.class */ |
| | | public class MaintainProjectServiceImpl extends ServiceImpl<MaintainProjectMapper, MaintainProject> implements IMaintainProjectService { |
| | | @Autowired |
| | | private IMaintainProjectItemService maintainProjectItemService; |
| | |
| | | @Lazy |
| | | private IMaintainPlanService maintainPlanService; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -904436898: |
| | | if (implMethodName.equals("getProjectId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -75622813: |
| | | if (implMethodName.equals("getCode")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 98245393: |
| | | if (implMethodName.equals("getId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 112409713: |
| | | if (implMethodName.equals("getPlanStatus")) { |
| | | z = false; |
| | | break; |
| | | } |
| | | break; |
| | | case 731625057: |
| | | if (implMethodName.equals("getDeviceTypeId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 771206363: |
| | | if (implMethodName.equals("getTenantId")) { |
| | | 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/MaintainPlan") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getPlanStatus(); |
| | | }; |
| | | } |
| | | 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/cps/entity/MaintainProjectItem") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getProjectId(); |
| | | }; |
| | | } |
| | | 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/MaintainPlan") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getProjectId(); |
| | | }; |
| | | } |
| | | 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/cps/entity/MaintainProject") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getDeviceTypeId(); |
| | | }; |
| | | } |
| | | 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/cps/entity/MaintainProject") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getDeviceTypeId(); |
| | | }; |
| | | } |
| | | 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(); |
| | | }; |
| | | } |
| | | 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(); |
| | | }; |
| | | } |
| | | 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; |
| | | case RegionCache.VILLAGE_LEVEL /* 5 */: |
| | | 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/cps/entity/MaintainProject") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | 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/cps/entity/MaintainProject") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IMaintainProjectService |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | |
| | | |
| | | @Override // org.springblade.modules.cps.service.IMaintainProjectService |
| | | public List<MaintainProjectVO> queryMaintainProjectList(Long deviceTypeId) { |
| | | List<MaintainProject> list = list(((LambdaQueryWrapper) Wrappers.query().lambda().eq((v0) -> { |
| | | List<MaintainProject> list = list(Wrappers.<MaintainProject>query().lambda() |
| | | .eq(MaintainProject::getDeviceTypeId, deviceTypeId) |
| | | .eq(Func.isNotEmpty(AuthUtil.getTenantId()), MaintainProject::getTenantId, AuthUtil.getTenantId())); |
| | | /*List<MaintainProject> list = list(((LambdaQueryWrapper) Wrappers.query().lambda().eq((v0) -> { |
| | | return v0.getDeviceTypeId(); |
| | | }, deviceTypeId)).eq(Func.isNotEmpty(AuthUtil.getTenantId()), (v0) -> { |
| | | return v0.getTenantId(); |
| | | }, AuthUtil.getTenantId())); |
| | | }, AuthUtil.getTenantId()));*/ |
| | | return MaintainProjectConvert.INSTANCE.convert(list); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IMaintainProjectService |
| | | public IPage<MaintainProjectVO> queryMaintainProjectListPage(Long deviceTypeId, Query query) { |
| | | IPage<MaintainProject> pages = page(Condition.getPage(query), (Wrapper) Wrappers.query().lambda().eq(Func.isNotEmpty(AuthUtil.getTenantId()), (v0) -> { |
| | | return v0.getTenantId(); |
| | | }, AuthUtil.getTenantId()).and(Func.isNotEmpty(deviceTypeId), i -> { |
| | | LambdaQueryWrapper lambdaQueryWrapper = (LambdaQueryWrapper) i.like((v0) -> { |
| | | return v0.getDeviceTypeId(); |
| | | }, deviceTypeId); |
| | | }).orderByAsc((v0) -> { |
| | | return v0.getCode(); |
| | | })); |
| | | return (IPage) Optional.ofNullable(pages).map(p -> { |
| | | Page page = new Page(p.getCurrent(), p.getSize(), p.getTotal()); |
| | | |
| | | //MaintainProject d;d.getDeviceTypeName() |
| | | IPage<MaintainProject> pages = page(Condition.getPage(query), Wrappers.<MaintainProject>query().lambda() |
| | | .eq(Func.isNotEmpty(AuthUtil.getTenantId()), MaintainProject::getTenantId, AuthUtil.getTenantId()) |
| | | .and(Func.isNotEmpty(deviceTypeId), i -> i.like(MaintainProject::getDeviceTypeId, deviceTypeId)) |
| | | |
| | | .orderByAsc(MaintainProject::getCode)); |
| | | |
| | | return Optional.ofNullable(pages).map(p -> { |
| | | Page<MaintainProjectVO> page = new Page<>(p.getCurrent(), p.getSize(), p.getTotal()); |
| | | page.setRecords(MaintainProjectConvert.INSTANCE.convert(p.getRecords())); |
| | | return page; |
| | | }).orElse(new Page()); |
| | | }).orElse(new Page<>()); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IMaintainProjectService |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Boolean deleteMaintainProject(Long id) { |
| | | removeById(id); |
| | | this.maintainProjectItemService.remove((Wrapper) Wrappers.query().lambda().eq((v0) -> { |
| | | return v0.getProjectId(); |
| | | }, id)); |
| | | |
| | | this.maintainProjectItemService.remove(Wrappers.<MaintainProjectItem>query().lambda().eq(MaintainProjectItem::getProjectId, id)); |
| | | return true; |
| | | } |
| | | |
| | | private boolean checkCodeIsExist(String code, Long id) { |
| | | List<MaintainProject> maintainProjectList = this.baseMapper.selectList(((LambdaQueryWrapper) Wrappers.query().lambda().eq(Func.isNotEmpty(AuthUtil.getTenantId()), (v0) -> { |
| | | return v0.getTenantId(); |
| | | }, AuthUtil.getTenantId()).and(wrapper -> { |
| | | LambdaQueryWrapper lambdaQueryWrapper = (LambdaQueryWrapper) wrapper.eq((v0) -> { |
| | | return v0.getCode(); |
| | | }, code); |
| | | })).notIn(Func.isNotEmpty(id), (v0) -> { |
| | | return v0.getId(); |
| | | }, new Object[]{id})); |
| | | //MaintainProject::getTenantId |
| | | List<MaintainProject> maintainProjectList = this.baseMapper.selectList(Wrappers.<MaintainProject>query().lambda() |
| | | .eq(Func.isNotEmpty(AuthUtil.getTenantId()), MaintainProject::getTenantId, AuthUtil.getTenantId()) |
| | | .and(wrapper -> { |
| | | LambdaQueryWrapper<MaintainProject> lambdaQueryWrapper = wrapper.eq(MaintainProject::getCode, code); |
| | | }).notIn(Func.isNotEmpty(id), MaintainProject::getId, id)); |
| | | return maintainProjectList != null && maintainProjectList.size() > 0; |
| | | } |
| | | |
| | |
| | | List<Integer> statusList = new ArrayList<>(); |
| | | statusList.add(Integer.valueOf(MaintainPlanStatusEnum.T1.getType())); |
| | | statusList.add(Integer.valueOf(MaintainPlanStatusEnum.T2.getType())); |
| | | List<MaintainPlan> list = this.maintainPlanService.list(Wrappers.<MaintainPlan>query().lambda() |
| | | .in(MaintainPlan::getPlanStatus, statusList) |
| | | .eq(MaintainPlan::getProjectId, projectId)); |
| | | /* |
| | | List<MaintainPlan> list = this.maintainPlanService.list((Wrapper) ((LambdaQueryWrapper) Wrappers.query().lambda().in((v0) -> { |
| | | return v0.getPlanStatus(); |
| | | }, statusList)).eq((v0) -> { |
| | | return v0.getProjectId(); |
| | | }, projectId)); |
| | | List<Long> planIdList = (List) list.stream().map((v0) -> { |
| | | return v0.getId(); |
| | | }).collect(Collectors.toList()); |
| | | }, projectId));*/ |
| | | List<Long> planIdList = list.stream().map(MaintainPlan::getId).collect(Collectors.toList()); |
| | | if (!planIdList.isEmpty()) { |
| | | MaintainPlanIdListVO maintainPlanIdListDTO = new MaintainPlanIdListVO(); |
| | | maintainPlanIdListDTO.setIdList(planIdList); |
| | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/cps/service/impl/MaintainRecordItemServiceImpl.class */ |
| | | public class MaintainRecordItemServiceImpl extends ServiceImpl<MaintainRecordItemMapper, MaintainRecordItem> implements IMaintainRecordItemService { |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -75622813: |
| | | if (implMethodName.equals("getCode")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 771206363: |
| | | if (implMethodName.equals("getTenantId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 1278665410: |
| | | if (implMethodName.equals("getRecordId")) { |
| | | z = false; |
| | | 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/MaintainRecordItem") && 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/MaintainRecordItem") && 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/tenant/mp/TenantEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getTenantId(); |
| | | }; |
| | | } |
| | | 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; |
| | | 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/MaintainRecordItem") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | 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/MaintainRecordItem") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | |
| | | @Override // org.springblade.modules.cps.service.IMaintainRecordItemService |
| | | public List<MaintainRecordItemVO> getMaintainRecordItemListByRecordId(Long recordId, String tenantId) { |
| | | List<MaintainRecordItem> list = list(Wrappers.<MaintainRecordItem>query().lambda() |
| | | .eq(MaintainRecordItem::getRecordId, recordId) |
| | | .eq(Func.isNotBlank(tenantId), MaintainRecordItem::getTenantId, tenantId) |
| | | .orderByAsc(MaintainRecordItem::getCode)); |
| | | /* |
| | | List<MaintainRecordItem> list = list((Wrapper) ((LambdaQueryWrapper) Wrappers.query().lambda().eq((v0) -> { |
| | | return v0.getRecordId(); |
| | | }, recordId)).eq(Func.isNotBlank(tenantId), (v0) -> { |
| | | return v0.getTenantId(); |
| | | }, tenantId).orderByAsc((v0) -> { |
| | | return v0.getCode(); |
| | | })); |
| | | return MaintainRecordItemConvert.INSTANCE.convert((List) list); |
| | | }));*/ |
| | | return MaintainRecordItemConvert.INSTANCE.convert(list); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IMaintainRecordItemService |
| | | public IPage<MaintainRecordItemVO> queryMaintainRecordItemListPage(Long recordId, String tenantId, Query query) { |
| | | IPage<MaintainRecordItem> pages = page(Condition.getPage(query),Wrappers.<MaintainRecordItem>query().lambda() |
| | | .eq(Func.isNotEmpty(tenantId), MaintainRecordItem::getTenantId, tenantId) |
| | | .eq(Func.isNotEmpty(recordId), MaintainRecordItem::getRecordId, recordId).orderByAsc(MaintainRecordItem::getCode)); |
| | | /* |
| | | IPage<MaintainRecordItem> pages = page(Condition.getPage(query), (Wrapper) Wrappers.query().lambda().eq(Func.isNotEmpty(tenantId), (v0) -> { |
| | | return v0.getTenantId(); |
| | | }, tenantId).eq(Func.isNotEmpty(recordId), (v0) -> { |
| | | return v0.getRecordId(); |
| | | }, recordId).orderByAsc((v0) -> { |
| | | return v0.getCode(); |
| | | })); |
| | | IPage<MaintainRecordItemVO> result = MaintainRecordItemConvert.INSTANCE.convert((IPage) pages); |
| | | }));*/ |
| | | IPage<MaintainRecordItemVO> result = MaintainRecordItemConvert.INSTANCE.convert(pages); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.support.SFunction; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | |
| | | public class MalfunctionTypeServiceImpl extends BladeServiceImpl<MalfunctionTypeMapper, MalfunctionType> implements IMalfunctionTypeService { |
| | | private final OssBuilder ossBuilder; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -75622813: |
| | | if (implMethodName.equals("getCode")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -75308287: |
| | | if (implMethodName.equals("getName")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 98245393: |
| | | if (implMethodName.equals("getId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 761390710: |
| | | if (implMethodName.equals("getRemark")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 803533544: |
| | | if (implMethodName.equals("getStatus")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 1071464927: |
| | | if (implMethodName.equals("getCreateTime")) { |
| | | z = false; |
| | | 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/util/Date;")) { |
| | | return (v0) -> { |
| | | return v0.getCreateTime(); |
| | | }; |
| | | } |
| | | 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/cps/entity/MalfunctionType") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getName(); |
| | | }; |
| | | } |
| | | 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/cps/entity/MalfunctionType") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getName(); |
| | | }; |
| | | } |
| | | 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/cps/entity/MalfunctionType") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getRemark(); |
| | | }; |
| | | } |
| | | 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(); |
| | | }; |
| | | } |
| | | 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(); |
| | | }; |
| | | } |
| | | 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(); |
| | | }; |
| | | } |
| | | 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/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getStatus(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getStatus(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getStatus(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getStatus(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getStatus(); |
| | | }; |
| | | } |
| | | break; |
| | | case RegionCache.VILLAGE_LEVEL /* 5 */: |
| | | 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/cps/entity/MalfunctionType") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | 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/cps/entity/MalfunctionType") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | 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/cps/entity/MalfunctionType") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | 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/cps/entity/MalfunctionType") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | public MalfunctionTypeServiceImpl(final OssBuilder ossBuilder) { |
| | | this.ossBuilder = ossBuilder; |
| | | } |
| | |
| | | @Override // org.springblade.modules.cps.service.IMalfunctionTypeService |
| | | public Boolean deleteMalfunctionTypeByIdList(List<Long> malfunctionTypeIds, Integer type) { |
| | | if (StatusType.REMOVE.getType().equals(type)) { |
| | | return Boolean.valueOf(remove(Wrappers.<MalfunctionType>lambdaQuery().in(MalfunctionType::getId, malfunctionTypeIds))); |
| | | /* |
| | | return Boolean.valueOf(remove((Wrapper) Wrappers.lambdaQuery().in((v0) -> { |
| | | return v0.getId(); |
| | | }, malfunctionTypeIds))); |
| | | }, malfunctionTypeIds)));*/ |
| | | } |
| | | return Boolean.valueOf(changeStatus(malfunctionTypeIds, CommonConstant.DEACTIVATE)); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IMalfunctionTypeService |
| | | public IPage<MalfunctionTypeVO> listPage(Query query, String keyWord, Integer status) { |
| | | IPage<MalfunctionType> page = page(Condition.getPage(query), Wrappers.<MalfunctionType>query() |
| | | .lambda() |
| | | .eq(MalfunctionType::getStatus, (status == null) ? CommonConstant.ENABLE : status) |
| | | .likeRight(Func.isNotEmpty(keyWord), MalfunctionType::getName, keyWord) |
| | | .or() |
| | | .likeRight(Func.isNotEmpty(keyWord), MalfunctionType::getCode, keyWord) |
| | | .orderByDesc(Arrays.asList(MalfunctionType::getCreateTime, MalfunctionType::getId))); |
| | | |
| | | /* |
| | | IPage<MalfunctionType> page = page(Condition.getPage(query), (Wrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) Wrappers.query().lambda().eq((v0) -> { |
| | | return v0.getStatus(); |
| | | }, status == null ? CommonConstant.ENABLE : status)).likeRight(Func.isNotEmpty(keyWord), (v0) -> { |
| | |
| | | return v0.getCreateTime(); |
| | | }, new SFunction[]{(v0) -> { |
| | | return v0.getId(); |
| | | }})); |
| | | return (IPage) Optional.ofNullable(page).map(p -> { |
| | | Page page2 = new Page(p.getCurrent(), p.getSize(), p.getTotal()); |
| | | }}));*/ |
| | | return Optional.ofNullable(page).map(p -> { |
| | | Page<MalfunctionTypeVO> page2 = new Page<>(p.getCurrent(), p.getSize(), p.getTotal()); |
| | | page2.setRecords(MalfunctionTypeConvert.INSTANCE.convert(p.getRecords())); |
| | | return page2; |
| | | }).orElse(new Page()); |
| | | }).orElse(new Page<>()); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IMalfunctionTypeService |
| | |
| | | throw new ServiceException(MessageUtils.message("excel.import.size.failed", new Object[0])); |
| | | } |
| | | HashMap<String, Object> codeMap = new HashMap<>(16); |
| | | List<MalfunctionType> malfunctionTypeList = list((Wrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getStatus(); |
| | | }, CommonConstant.ENABLE)); |
| | | List<MalfunctionType> malfunctionTypeList = list(Wrappers.<MalfunctionType>lambdaQuery().eq(MalfunctionType::getStatus, CommonConstant.ENABLE)); |
| | | if (Func.isNotEmpty(malfunctionTypeList)) { |
| | | malfunctionTypeList.forEach(x -> { |
| | | codeMap.put(x.getCode(), null); |
| | |
| | | } |
| | | } |
| | | if (!flag) { |
| | | MultipartFile multipartFile = ExcelUtil.exportFillTemplateToMultipartFile(ExcelConstant.DIRECTORY + "malfunctionTypeFailTemplate" + ExcelConstant.SUFFIX, MessageUtils.message("excel.import.failed.report.name", new Object[0]) + ExcelConstant.SUFFIX, "故障类型表", (List) data.stream().filter(x2 -> { |
| | | MultipartFile multipartFile = ExcelUtil.exportFillTemplateToMultipartFile(ExcelConstant.DIRECTORY + "malfunctionTypeFailTemplate" + ExcelConstant.SUFFIX, MessageUtils.message("excel.import.failed.report.name", new Object[0]) + ExcelConstant.SUFFIX, "故障类型表", data.stream().filter(x2 -> { |
| | | return Func.isNotEmpty(x2.getFailReason()); |
| | | }).collect(Collectors.toList()), (Object) null, (AbstractMergeStrategy) null); |
| | | }).collect(Collectors.toList()), null, null); |
| | | return this.ossBuilder.tempTemplate().putFile(multipartFile.getOriginalFilename(), multipartFile); |
| | | } |
| | | data.forEach(x3 -> { |
| | |
| | | Long id = malfunctionTypeVO.getId(); |
| | | String name = malfunctionTypeVO.getName(); |
| | | String remark = malfunctionTypeVO.getRemark(); |
| | | return Boolean.valueOf(update(Wrappers.<MalfunctionType>lambdaUpdate() |
| | | .set(Func.isNotBlank(name), MalfunctionType::getName, name) |
| | | .set(MalfunctionType::getRemark, remark) |
| | | .eq(MalfunctionType::getId, id))); |
| | | /* |
| | | return Boolean.valueOf(update((Wrapper) ((LambdaUpdateWrapper) ((LambdaUpdateWrapper) Wrappers.lambdaUpdate().set(Func.isNotBlank(name), (v0) -> { |
| | | return v0.getName(); |
| | | }, name)).set((v0) -> { |
| | | return v0.getRemark(); |
| | | }, remark)).eq((v0) -> { |
| | | return v0.getId(); |
| | | }, id))); |
| | | }, id)));*/ |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IMalfunctionTypeService |
| | | public List<MalfunctionTypeRecordVO> getCodeAndRecord() { |
| | | List<MalfunctionType> list = list((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getStatus(); |
| | | }, CommonConstant.ENABLE)).orderByDesc((v0) -> { |
| | | return v0.getCode(); |
| | | })); |
| | | List<MalfunctionType> list = list(Wrappers.<MalfunctionType>lambdaQuery() |
| | | .eq(MalfunctionType::getStatus, CommonConstant.ENABLE) |
| | | .orderByDesc(MalfunctionType::getCode)); |
| | | |
| | | return MalfunctionTypeRecordConvert.INSTANCE.convert(list); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | private boolean checkUnableMalfunctionTypeVO(String code) { |
| | | MalfunctionType malfunctionType = getOne(Wrappers.<MalfunctionType>lambdaQuery().eq(MalfunctionType::getCode, code) |
| | | .eq(MalfunctionType::getStatus, CommonConstant.DEACTIVATE)); |
| | | /* |
| | | MalfunctionType malfunctionType = (MalfunctionType) getOne((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getCode(); |
| | | }, code)).eq((v0) -> { |
| | | return v0.getStatus(); |
| | | }, CommonConstant.DEACTIVATE)); |
| | | }, CommonConstant.DEACTIVATE));*/ |
| | | if (malfunctionType != null) { |
| | | return Boolean.TRUE.booleanValue(); |
| | | } |
| | |
| | | } |
| | | |
| | | private void checkMalfunctionTypeVO(MalfunctionTypeVO malfunctionTypeVO) { |
| | | Long count = Long.valueOf(count((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().ne(Func.isNotEmpty(malfunctionTypeVO.getId()), (v0) -> { |
| | | Long count = Long.valueOf(count(Wrappers.<MalfunctionType>lambdaQuery() |
| | | .ne(Func.isNotEmpty(malfunctionTypeVO.getId()), MalfunctionType::getId, malfunctionTypeVO.getId()) |
| | | .eq(MalfunctionType::getStatus, CommonConstant.ENABLE) |
| | | .eq(MalfunctionType::getCode, malfunctionTypeVO.getCode()))); |
| | | /* |
| | | Long count = Long.valueOf(count((Wrapper) ((LambdaQueryWrapper) Wrappers.<MalfunctionType>lambdaQuery().ne(Func.isNotEmpty(malfunctionTypeVO.getId()), (v0) -> { |
| | | return v0.getId(); |
| | | }, malfunctionTypeVO.getId()).eq((v0) -> { |
| | | return v0.getStatus(); |
| | | }, CommonConstant.ENABLE)).eq((v0) -> { |
| | | return v0.getCode(); |
| | | }, malfunctionTypeVO.getCode()))); |
| | | }, malfunctionTypeVO.getCode())));*/ |
| | | if (count.longValue() > 0) { |
| | | throw new ServiceException(MessageUtils.message("cps.malfunction.type.code.already.exists", new Object[0])); |
| | | } |
| | |
| | | private final OssBuilder ossBuilder; |
| | | private final ICodeGeneratorService codeGeneratorService; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -75622813: |
| | | if (implMethodName.equals("getCode")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -75308287: |
| | | if (implMethodName.equals("getName")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 771206363: |
| | | if (implMethodName.equals("getTenantId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 803533544: |
| | | if (implMethodName.equals("getStatus")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 837211371: |
| | | if (implMethodName.equals("getTypeId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 961079513: |
| | | if (implMethodName.equals("getIsDeleted")) { |
| | | z = false; |
| | | break; |
| | | } |
| | | break; |
| | | case 1084758859: |
| | | if (implMethodName.equals("getProperty")) { |
| | | 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getIsDeleted(); |
| | | }; |
| | | } |
| | | 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/cps/entity/Material") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getProperty(); |
| | | }; |
| | | } |
| | | 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/cps/entity/Material") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getName(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getStatus(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getStatus(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getStatus(); |
| | | }; |
| | | } |
| | | 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(); |
| | | }; |
| | | } |
| | | 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(); |
| | | }; |
| | | } |
| | | 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; |
| | | case RegionCache.VILLAGE_LEVEL /* 5 */: |
| | | 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/cps/entity/Material") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getTypeId(); |
| | | }; |
| | | } |
| | | 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/cps/entity/Material") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | 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/cps/entity/Material") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | 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/cps/entity/Material") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | public MaterialServiceImpl(final IMaterialTypeService materialTypeService, final OssBuilder ossBuilder, final ICodeGeneratorService codeGeneratorService) { |
| | | this.materialTypeService = materialTypeService; |
| | |
| | | @Override // org.springblade.modules.cps.service.IMaterialService |
| | | public List<MaterialVO> listByProperty(Integer property) { |
| | | List<MaterialType> materialTypeList = this.materialTypeService.list(); |
| | | Map<Long, MaterialType> typeIdToValue = (Map) materialTypeList.stream().collect(Collectors.toMap((v0) -> { |
| | | Map<Long, MaterialType> typeIdToValue = materialTypeList.stream().collect(Collectors.toMap((v0) -> { |
| | | return v0.getId(); |
| | | }, v -> { |
| | | return v; |
| | | })); |
| | | List<Material> materialList = list(Wrappers.<Material>lambdaQuery() |
| | | .eq(Material::getProperty, property) |
| | | .eq(Material::getStatus, CommonConstant.ENABLE)); |
| | | /* |
| | | List<Material> materialList = list((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getProperty(); |
| | | }, property)).eq((v0) -> { |
| | | return v0.getStatus(); |
| | | }, CommonConstant.ENABLE)); |
| | | }, CommonConstant.ENABLE));*/ |
| | | List<MaterialVO> materialVoList = MaterialConvert.INSTANCE.convertList(materialList); |
| | | materialVoList.forEach(materialVo -> { |
| | | MaterialType materialType = (MaterialType) typeIdToValue.get(materialVo.getTypeId()); |
| | |
| | | @Override // org.springblade.modules.cps.service.IMaterialService |
| | | public IPage<MaterialVO> getPageMaterial(MaterialQueryVO vo, Query query) { |
| | | Integer status = Func.isNull(vo.getStatus()) ? CommonConstant.ENABLE : vo.getStatus(); |
| | | |
| | | QueryWrapper<MaterialQueryVO> wrapper = Wrappers.<MaterialQueryVO>query().eq("bm.status", status) |
| | | .eq(!Func.isNull(vo.getProperty()), "property", vo.getProperty()) |
| | | .eq(!Func.isNull(vo.getTypeId()), "bm.type_id", vo.getTypeId()) |
| | | .and(Func.isNotBlank(vo.getKeyWord()), i -> i.likeRight("bm.name", vo.getKeyWord()).or().likeRight("bm.code", vo.getKeyWord())) |
| | | .orderByDesc("bm.create_time", new String[] { "bm.id" }); |
| | | |
| | | /* |
| | | Wrapper<MaterialQueryVO> wrapper = (QueryWrapper) ((QueryWrapper) Wrappers.query().eq("bm.status", status)).eq(!Func.isNull(vo.getProperty()), "property", vo.getProperty()).eq(!Func.isNull(vo.getTypeId()), "bm.type_id", vo.getTypeId()).and(Func.isNotBlank(vo.getKeyWord()), i -> { |
| | | QueryWrapper queryWrapper = (QueryWrapper) ((QueryWrapper) ((QueryWrapper) i.likeRight("bm.name", vo.getKeyWord())).or()).likeRight("bm.code", vo.getKeyWord()); |
| | | }).orderByDesc("bm.create_time", new String[]{"bm.id"}); |
| | | */ |
| | | return this.baseMapper.getPageMaterial(Condition.getPage(query), Func.isNotBlank(wrapper.getSqlSegment()) ? wrapper : null); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IMaterialService |
| | | public boolean checkMaterialIsExist(List<Long> idList) { |
| | | List<Material> materialList = list(Wrappers.<Material>query().lambda() |
| | | .eq(Func.isNotEmpty(AuthUtil.getTenantId()), Material::getTenantId, AuthUtil.getTenantId()) |
| | | .in(Material::getTypeId, idList) |
| | | .eq(Material::getIsDeleted, 0)); |
| | | /* |
| | | List<Material> materialList = list((Wrapper) ((LambdaQueryWrapper) Wrappers.query().lambda().eq(Func.isNotEmpty(AuthUtil.getTenantId()), (v0) -> { |
| | | return v0.getTenantId(); |
| | | }, AuthUtil.getTenantId()).in((v0) -> { |
| | | return v0.getTypeId(); |
| | | }, idList)).eq((v0) -> { |
| | | return v0.getIsDeleted(); |
| | | }, 0)); |
| | | }, 0));*/ |
| | | return Func.isNotEmpty(materialList); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | private void checkCodeIsExist(String code) { |
| | | Material material = getOne(Wrappers.<Material>query().lambda() |
| | | .eq(Material::getStatus, CommonConstant.ENABLE) |
| | | .eq(Func.isNotEmpty(AuthUtil.getTenantId()), Material::getTenantId, AuthUtil.getTenantId()) |
| | | .eq(Material::getCode, code)); |
| | | /* |
| | | Material material = (Material) getOne((Wrapper) ((LambdaQueryWrapper) Wrappers.query().lambda().eq((v0) -> { |
| | | return v0.getStatus(); |
| | | }, CommonConstant.ENABLE)).eq(Func.isNotEmpty(AuthUtil.getTenantId()), (v0) -> { |
| | | return v0.getTenantId(); |
| | | }, AuthUtil.getTenantId()).eq((v0) -> { |
| | | return v0.getCode(); |
| | | }, code)); |
| | | }, code));*/ |
| | | if (!Func.isNull(material)) { |
| | | throw new ServiceException(MessageUtils.message("cps.material.code.already.exists", new Object[0])); |
| | | } |
| | | Material material2 = (Material) getOne((Wrapper) ((LambdaQueryWrapper) Wrappers.query().lambda().eq((v0) -> { |
| | | return v0.getStatus(); |
| | | }, CommonConstant.DEACTIVATE)).eq(Func.isNotEmpty(AuthUtil.getTenantId()), (v0) -> { |
| | | return v0.getTenantId(); |
| | | }, AuthUtil.getTenantId()).eq((v0) -> { |
| | | return v0.getCode(); |
| | | }, code)); |
| | | Material material2 = getOne(Wrappers.<Material>query().lambda() |
| | | .eq(Material::getStatus, CommonConstant.DEACTIVATE) |
| | | .eq(Func.isNotEmpty(AuthUtil.getTenantId()), Material::getTenantId, AuthUtil.getTenantId()) |
| | | .eq(Material::getCode, code)); |
| | | |
| | | if (!Func.isNull(material2)) { |
| | | throw new ServiceException(MessageUtils.message("cps.material.code.unable.already.exists", new Object[0])); |
| | | } |
| | |
| | | @Override // org.springblade.modules.cps.service.IMaterialService |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public boolean deleteMaterial(List<String> ids, Integer type) { |
| | | List<Long> idList = (List) ids.stream().map(Long::valueOf).collect(Collectors.toList()); |
| | | List<Long> idList = ids.stream().map(Long::valueOf).collect(Collectors.toList()); |
| | | if (StatusType.REMOVE.getType().equals(type)) { |
| | | return removeByIds(idList); |
| | | } |
| | |
| | | if (Func.isEmpty(data)) { |
| | | throw new ServiceException(MessageUtils.message("excel.import.data.can.not.be.null", new Object[0])); |
| | | } |
| | | Map<String, MaterialType> materialTypeCodeEnable = (Map) this.materialTypeService.list().stream().filter(c -> { |
| | | Map<String, MaterialType> materialTypeCodeEnable = this.materialTypeService.list().stream().filter(c -> { |
| | | return CommonConstant.ENABLE.equals(c.getStatus()); |
| | | }).collect(Collectors.toMap((v0) -> { |
| | | return v0.getCode(); |
| | | }, v -> { |
| | | return v; |
| | | })); |
| | | Map<String, MaterialType> materialTypeCodeDisable = (Map) this.materialTypeService.list().stream().filter(c2 -> { |
| | | Map<String, MaterialType> materialTypeCodeDisable = this.materialTypeService.list().stream().filter(c2 -> { |
| | | return CommonConstant.DEACTIVATE.equals(c2.getStatus()); |
| | | }).collect(Collectors.toMap((v0) -> { |
| | | return v0.getCode(); |
| | |
| | | return v2; |
| | | })); |
| | | List<Material> materialList = list(); |
| | | Map<String, String> dictValueToKey = (Map) DictCache.getList(DictEnum.MATERIAL_PROPERTY.getName()).stream().collect(Collectors.toMap((v0) -> { |
| | | Map<String, String> dictValueToKey = DictCache.getList(DictEnum.MATERIAL_PROPERTY.getName()).stream().collect(Collectors.toMap((v0) -> { |
| | | return v0.getDictValue(); |
| | | }, (v0) -> { |
| | | return v0.getDictKey(); |
| | |
| | | flag = Boolean.FALSE.booleanValue(); |
| | | } |
| | | if (!flag) { |
| | | MultipartFile multipartFile = ExcelUtil.exportFillTemplateToMultipartFile(ExcelConstant.DIRECTORY + "materialFailTemplate" + ExcelConstant.SUFFIX, MessageUtils.message("excel.import.failed.report.name", new Object[0]) + ExcelConstant.SUFFIX, "物料信息表", (List) data.stream().filter(x -> { |
| | | MultipartFile multipartFile = ExcelUtil.exportFillTemplateToMultipartFile(ExcelConstant.DIRECTORY + "materialFailTemplate" + ExcelConstant.SUFFIX, MessageUtils.message("excel.import.failed.report.name", new Object[0]) + ExcelConstant.SUFFIX, "物料信息表", data.stream().filter(x -> { |
| | | return Func.isNotEmpty(x.getFailReason()); |
| | | }).collect(Collectors.toList()), (Object) null, (AbstractMergeStrategy) null); |
| | | return this.ossBuilder.tempTemplate().putFile(multipartFile.getOriginalFilename(), multipartFile); |
| | |
| | | @Override // org.springblade.modules.cps.service.IMaterialService |
| | | public List<MaterialVO> getMaterialListByIds(MaterialIdListVO materialIdListVO) { |
| | | List<Material> materialList = listByIds(materialIdListVO.getIds()); |
| | | List<Long> typeIdList = (List) materialList.stream().map((v0) -> { |
| | | List<Long> typeIdList = materialList.stream().map((v0) -> { |
| | | return v0.getTypeId(); |
| | | }).distinct().collect(Collectors.toList()); |
| | | LinkedHashMap<Long, MaterialType> typeMap = new LinkedHashMap<>(); |
| | |
| | | @Override // org.springblade.modules.cps.service.IMaterialService |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Boolean synchronizedMaterial(SynchronizedProductMaterialVO synchronizedProductMaterialVO) { |
| | | List<String> nameList = (List) synchronizedProductMaterialVO.getProductList().stream().map(i -> { |
| | | List<String> nameList = synchronizedProductMaterialVO.getProductList().stream().map(i -> { |
| | | return i.getName(); |
| | | }).collect(Collectors.toList()); |
| | | List<String> codeList = (List) synchronizedProductMaterialVO.getProductList().stream().map(i2 -> { |
| | | List<String> codeList = synchronizedProductMaterialVO.getProductList().stream().map(i2 -> { |
| | | return i2.getCode(); |
| | | }).collect(Collectors.toList()); |
| | | |
| | | List<Material> list = list(Wrappers.<Material>query().lambda() |
| | | .and(i -> i.in(Material::getName, nameList)) |
| | | .or(i -> i.in(Material::getCode, codeList))); |
| | | /* |
| | | List<Material> list = list((Wrapper) ((LambdaQueryWrapper) Wrappers.query().lambda().and(i3 -> { |
| | | LambdaQueryWrapper lambdaQueryWrapper = (LambdaQueryWrapper) i3.in((v0) -> { |
| | | return v0.getName(); |
| | |
| | | LambdaQueryWrapper lambdaQueryWrapper = (LambdaQueryWrapper) i4.in((v0) -> { |
| | | return v0.getCode(); |
| | | }, codeList); |
| | | })); |
| | | }));*/ |
| | | List<ProductVO> needAddList = new ArrayList<>(); |
| | | List<Long> deleteIdList = new ArrayList<>(); |
| | | list.forEach(m -> { |
| | |
| | | } |
| | | |
| | | private Boolean insertProductMaterial(SynchronizedProductMaterialVO synchronizedProductMaterialVO) { |
| | | List<Material> insertList = (List) synchronizedProductMaterialVO.getProductList().stream().map(i -> { |
| | | List<Material> insertList = synchronizedProductMaterialVO.getProductList().stream().map(i -> { |
| | | Material bean = new Material(); |
| | | bean.setName(i.getName()); |
| | | bean.setCode(i.getCode()); |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/cps/service/impl/MaterialStorageServiceImpl.class */ |
| | | public class MaterialStorageServiceImpl extends BladeServiceImpl<MaterialStorageMapper, MaterialStorage> implements IMaterialStorageService { |
| | | private final IWarehouseStationService warehouseStationService; |
| | | private final IMaterialService materialService; |
| | | private final OssBuilder ossBuilder; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -75622813: |
| | | if (implMethodName.equals("getCode")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 1929248666: |
| | | if (implMethodName.equals("getWarehouseCode")) { |
| | | z = false; |
| | | 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/cps/entity/WarehouseStation") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getWarehouseCode(); |
| | | }; |
| | | } |
| | | 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/cps/entity/Material") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | public MaterialStorageServiceImpl(final IWarehouseStationService warehouseStationService, final IMaterialService materialService, final OssBuilder ossBuilder) { |
| | | this.warehouseStationService = warehouseStationService; |
| | |
| | | List<Long> materialIds = vo.getMaterialIds(); |
| | | Long warehouseStationId = vo.getWarehouseStationId(); |
| | | if (Func.isNotEmpty(materialIds)) { |
| | | List<MaterialStorage> storages = (List) materialIds.stream().map(c -> { |
| | | List<MaterialStorage> storages = materialIds.stream().map(c -> { |
| | | return convert(c, warehouseStationId); |
| | | }).collect(Collectors.toList()); |
| | | saveBatch(storages); |
| | |
| | | Map<String, Material> materialMap = new HashMap<>(rawData.size()); |
| | | getMaterialStorage(rawData, warehouseStationMap, materialMap); |
| | | List<MaterialStorage> materialStorageList = list(); |
| | | Set<Long> materialIds = (Set) materialStorageList.stream().map((v0) -> { |
| | | Set<Long> materialIds = materialStorageList.stream().map((v0) -> { |
| | | return v0.getMaterialId(); |
| | | }).collect(Collectors.toSet()); |
| | | List<MaterialStorageImport> failExcel = Lists.newArrayList(); |
| | |
| | | } |
| | | |
| | | private void getMaterialStorage(List<MaterialStorageImport> rawData, Map<String, WarehouseStation> warehouseStationMap, Map<String, Material> materialMap) { |
| | | Wrapper lambdaQuery = Wrappers.lambdaQuery(); |
| | | //Wrapper lambdaQuery = Wrappers.lambdaQuery(); |
| | | LambdaQueryWrapper<WarehouseStation> warehouseQuery = Wrappers.lambdaQuery(); |
| | | |
| | | boolean flag1 = false; |
| | | boolean flag2 = false; |
| | | Wrapper lambdaQuery2 = Wrappers.lambdaQuery(); |
| | | // MaterialStorage t; |
| | | //t.getWarehouseStationId() |
| | | //Wrapper lambdaQuery2 = Wrappers.lambdaQuery(); |
| | | LambdaQueryWrapper<Material> materialQuery = Wrappers.lambdaQuery(); |
| | | for (MaterialStorageImport data : rawData) { |
| | | if (requiredLocation(data)) { |
| | | if (flag1) { |
| | | lambdaQuery.or(); |
| | | warehouseQuery.or(); |
| | | } |
| | | flag1 = true; |
| | | lambdaQuery.nested(i -> { |
| | | warehouseQuery.nested(i -> i.eq(WarehouseStation::getWarehouseCode, data.getLocationCode())); |
| | | /* |
| | | warehouseQuery.nested(i -> { |
| | | LambdaQueryWrapper lambdaQueryWrapper = (LambdaQueryWrapper) i.eq((v0) -> { |
| | | return v0.getWarehouseCode(); |
| | | }, data.getLocationCode()); |
| | | }); |
| | | });*/ |
| | | } |
| | | if (requiredMaterial(data)) { |
| | | if (flag2) { |
| | | lambdaQuery2.or(); |
| | | materialQuery.or(); |
| | | } |
| | | flag2 = true; |
| | | lambdaQuery2.nested(i2 -> { |
| | | LambdaQueryWrapper lambdaQueryWrapper = (LambdaQueryWrapper) i2.eq((v0) -> { |
| | | materialQuery.nested(i -> i.eq(Material::getCode, data.getMaterialCode())); |
| | | /* |
| | | materialQuery.nested(i2 -> { |
| | | LambdaQueryWrapper lambdaQueryWrapper = i2.eq((v0) -> { |
| | | return v0.getCode(); |
| | | }, data.getMaterialCode()); |
| | | }); |
| | | });*/ |
| | | } |
| | | } |
| | | String sqlSegment1 = lambdaQuery.getSqlSegment(); |
| | | String sqlSegment1 = warehouseQuery.getSqlSegment(); |
| | | if (Func.isNotBlank(sqlSegment1)) { |
| | | List<WarehouseStation> warehouseStations = this.warehouseStationService.list(lambdaQuery); |
| | | List<WarehouseStation> warehouseStations = this.warehouseStationService.list(warehouseQuery); |
| | | if (Func.isNotEmpty(warehouseStations)) { |
| | | Map<String, WarehouseStation> map1 = (Map) warehouseStations.stream().collect(Collectors.toMap((v0) -> { |
| | | return v0.getWarehouseCode(); |
| | |
| | | warehouseStationMap.putAll(map1); |
| | | } |
| | | } |
| | | String sqlSegment2 = lambdaQuery2.getSqlSegment(); |
| | | String sqlSegment2 = materialQuery.getSqlSegment(); |
| | | if (Func.isNotBlank(sqlSegment2)) { |
| | | List<Material> materials = this.materialService.list(lambdaQuery2); |
| | | List<Material> materials = this.materialService.list(materialQuery); |
| | | if (Func.isNotEmpty(materials)) { |
| | | Map<String, Material> map2 = (Map) materials.stream().collect(Collectors.toMap((v0) -> { |
| | | return v0.getCode(); |
| | | }, v2 -> { |
| | | return v2; |
| | | })); |
| | | Map<String, Material> map2 = materials.stream().collect(Collectors.toMap(Material::getCode, v -> v)); |
| | | materialMap.putAll(map2); |
| | | } |
| | | } |
| | |
| | | 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.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | import com.qianwen.smartman.common.constant.CommonConstant; |
| | | import com.qianwen.smartman.common.enums.StatusType; |
| | | import com.qianwen.smartman.common.utils.MessageUtils; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.qianwen.core.log.exception.ServiceException; |
| | | import com.qianwen.core.mp.base.BaseServiceImpl; |
| | | import com.qianwen.core.mp.support.Condition; |
| | | import com.qianwen.core.mp.support.Query; |
| | | import com.qianwen.core.secure.utils.AuthUtil; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.common.constant.CommonConstant; |
| | | import com.qianwen.smartman.common.enums.StatusType; |
| | | import com.qianwen.smartman.common.utils.MessageUtils; |
| | | import com.qianwen.smartman.modules.cps.convert.MaterialTypeConvert; |
| | | import com.qianwen.smartman.modules.cps.entity.MaterialType; |
| | | import com.qianwen.smartman.modules.cps.mapper.MaterialTypeMapper; |
| | |
| | | import com.qianwen.smartman.modules.cps.vo.MaterialTypeAddVO; |
| | | import com.qianwen.smartman.modules.cps.vo.MaterialTypeUpdateVO; |
| | | import com.qianwen.smartman.modules.cps.vo.MaterialTypeVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/cps/service/impl/MaterialTypeServiceImpl.class */ |
| | | public class MaterialTypeServiceImpl extends BaseServiceImpl<MaterialTypeMapper, MaterialType> implements IMaterialTypeService { |
| | | @Autowired |
| | | @Lazy |
| | | private IMaterialService materialService; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -75622813: |
| | | if (implMethodName.equals("getCode")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -75308287: |
| | | if (implMethodName.equals("getName")) { |
| | | z = false; |
| | | break; |
| | | } |
| | | break; |
| | | case 771206363: |
| | | if (implMethodName.equals("getTenantId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 803533544: |
| | | if (implMethodName.equals("getStatus")) { |
| | | 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/cps/entity/MaterialType") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getName(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getStatus(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getStatus(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getStatus(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getStatus(); |
| | | }; |
| | | } |
| | | 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; |
| | | 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/cps/entity/MaterialType") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | 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/cps/entity/MaterialType") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | 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/cps/entity/MaterialType") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | 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/cps/entity/MaterialType") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IMaterialTypeService |
| | | public List<MaterialType> enableList() { |
| | | return list((Wrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getStatus(); |
| | | }, CommonConstant.ENABLE)); |
| | | return list(Wrappers.<MaterialType>lambdaQuery().eq(MaterialType::getStatus, CommonConstant.ENABLE)); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IMaterialTypeService |
| | | public IPage<MaterialType> getPageMaterialType(Query query, String keyWord, Integer status) { |
| | | return page(Condition.getPage(query), Wrappers.<MaterialType>query().lambda() |
| | | .eq(MaterialType::getStatus, status) |
| | | .eq(Func.isNotEmpty(AuthUtil.getTenantId()), MaterialType::getTenantId, AuthUtil.getTenantId()) |
| | | .and(Func.isNotEmpty(keyWord), i -> i.likeRight(MaterialType::getCode, keyWord).or().likeRight(MaterialType::getName, keyWord)) |
| | | .orderByDesc(MaterialType::getCode)); |
| | | |
| | | /* |
| | | return page(Condition.getPage(query), (Wrapper) ((LambdaQueryWrapper) Wrappers.query().lambda().eq((v0) -> { |
| | | return v0.getStatus(); |
| | | }, status)).eq(Func.isNotEmpty(AuthUtil.getTenantId()), (v0) -> { |
| | |
| | | }, keyWord); |
| | | }).orderByDesc((v0) -> { |
| | | return v0.getCode(); |
| | | })); |
| | | }));*/ |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.IMaterialTypeService |
| | |
| | | } |
| | | |
| | | private void checkCodeIsExist(String code) { |
| | | MaterialType materialType = getOne(Wrappers.<MaterialType>query().lambda() |
| | | .eq(MaterialType::getStatus, CommonConstant.ENABLE) |
| | | .eq(MaterialType::getCode, code)); |
| | | /* |
| | | MaterialType materialType = (MaterialType) getOne((Wrapper) ((LambdaQueryWrapper) Wrappers.query().lambda().eq((v0) -> { |
| | | return v0.getStatus(); |
| | | }, CommonConstant.ENABLE)).eq((v0) -> { |
| | | return v0.getCode(); |
| | | }, code)); |
| | | }, code));*/ |
| | | if (!Func.isNull(materialType)) { |
| | | throw new ServiceException(MessageUtils.message("cps.material.type.code.already.exists", new Object[0])); |
| | | } |
| | | MaterialType materialType2 = (MaterialType) getOne((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getStatus(); |
| | | }, CommonConstant.DEACTIVATE)).eq((v0) -> { |
| | | return v0.getCode(); |
| | | }, code)); |
| | | if (!Func.isNull(materialType2)) { |
| | | materialType = getOne(Wrappers.<MaterialType>lambdaQuery() |
| | | .eq(MaterialType::getStatus, CommonConstant.DEACTIVATE) |
| | | .eq(MaterialType::getCode, code)); |
| | | if (!Func.isNull(materialType)) { |
| | | throw new ServiceException(MessageUtils.message("cps.material.type.code.unable.already.exists", new Object[0])); |
| | | } |
| | | } |
| | |
| | | @Override // org.springblade.modules.cps.service.IMaterialTypeService |
| | | public boolean deleteMaterialType(List<String> ids, Integer type) { |
| | | if (StatusType.REMOVE.getType().equals(type)) { |
| | | List<Long> idList = (List) ids.stream().map(Long::valueOf).collect(Collectors.toList()); |
| | | List<Long> idList = ids.stream().map(Long::valueOf).collect(Collectors.toList()); |
| | | if (this.materialService.checkMaterialIsExist(idList)) { |
| | | throw new ServiceException(MessageUtils.message("cps.material.type.having.used.can.not.delete", new Object[0])); |
| | | } |
| | |
| | | package com.qianwen.smartman.modules.cps.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import com.qianwen.smartman.common.constant.CommonConstant; |
| | | import com.qianwen.smartman.common.enums.StatusType; |
| | | import com.qianwen.smartman.common.utils.CommonUtil; |
| | | 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.qianwen.core.log.exception.ServiceException; |
| | | import com.qianwen.core.tool.node.ForestNodeMerger; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.common.constant.CommonConstant; |
| | | import com.qianwen.smartman.common.enums.StatusType; |
| | | import com.qianwen.smartman.common.utils.CommonUtil; |
| | | import com.qianwen.smartman.common.utils.Lambda; |
| | | import com.qianwen.smartman.common.utils.MessageUtils; |
| | | import com.qianwen.smartman.modules.cps.convert.OrganizationConvert; |
| | | import com.qianwen.smartman.modules.cps.dto.OrganizationDTO; |
| | | import com.qianwen.smartman.modules.cps.entity.CommonGroup; |
| | |
| | | import com.qianwen.smartman.modules.cps.service.IOrganizationService; |
| | | import com.qianwen.smartman.modules.cps.vo.OrganizationSelectVO; |
| | | import com.qianwen.smartman.modules.cps.vo.OrganizationVO; |
| | | 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/OrganizationServiceImpl.class */ |
| | | public class OrganizationServiceImpl implements IOrganizationService { |
| | | private final OrganizationMapper organizationMapper; |
| | | private final ICommonGroupService commonGroupService; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -1041904421: |
| | | if (implMethodName.equals("getParentId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 803533544: |
| | | if (implMethodName.equals("getStatus")) { |
| | | z = false; |
| | | 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/cps/entity/CommonGroup") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getStatus(); |
| | | }; |
| | | } |
| | | 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/cps/entity/CommonGroup") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getParentId(); |
| | | }; |
| | | } |
| | | 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/cps/entity/CommonGroup") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getParentId(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | |
| | | public OrganizationServiceImpl(final OrganizationMapper organizationMapper, final ICommonGroupService commonGroupService) { |
| | | this.organizationMapper = organizationMapper; |
| | |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Boolean deleteOrganization(String ids, Integer type) { |
| | | if (StatusType.REMOVE.getType().equals(type)) { |
| | | CommonGroup commonGroup = this.commonGroupService.getOne(Lambda.<CommonGroup>create() |
| | | .eq(CommonGroup::getStatus, 1) |
| | | .in(CommonGroup::getParentId, Func.toLongList(ids)) |
| | | .limit()); |
| | | /* |
| | | CommonGroup commonGroup = (CommonGroup) this.commonGroupService.getOne(((ExtraLambdaQueryWrapper) ((ExtraLambdaQueryWrapper) Lambda.create().eq((v0) -> { |
| | | return v0.getStatus(); |
| | | }, 1)).in((v0) -> { |
| | | return v0.getParentId(); |
| | | }, Func.toLongList(ids))).limit()); |
| | | }, Func.toLongList(ids))).limit());*/ |
| | | if (Func.isNotEmpty(commonGroup)) { |
| | | throw new ServiceException(MessageUtils.message("cps.organization.delete.sub.dept", new Object[0])); |
| | | } |
| | |
| | | } |
| | | return Boolean.valueOf(this.commonGroupService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | List<CommonGroup> groups = this.commonGroupService.list(Wrappers.<CommonGroup>query() |
| | | .lambda() |
| | | .in(CommonGroup::getParentId, Func.toLongList(ids))); |
| | | /* |
| | | List<CommonGroup> groups = this.commonGroupService.list((Wrapper) Wrappers.query().lambda().in((v0) -> { |
| | | return v0.getParentId(); |
| | | }, Func.toLongList(ids))); |
| | | }, Func.toLongList(ids)));*/ |
| | | if (Func.isEmpty(groups)) { |
| | | return this.commonGroupService.changeStatus(Func.toLongList(ids), CommonConstant.DEACTIVATE); |
| | | } |
| | |
| | | private final ISupplierService supplierService; |
| | | private final IWarehouseAreaService warehouseAreaService; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -1104365260: |
| | | if (implMethodName.equals("getProcessId")) { |
| | | z = false; |
| | | break; |
| | | } |
| | | break; |
| | | case 98245393: |
| | | if (implMethodName.equals("getId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 1949578200: |
| | | if (implMethodName.equals("getBizId")) { |
| | | 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/cps/entity/ProcessAssociation") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getProcessId(); |
| | | }; |
| | | } |
| | | 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/cps/entity/ProcessAssociation") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getProcessId(); |
| | | }; |
| | | } |
| | | 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/cps/entity/ProcessAssociation") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getProcessId(); |
| | | }; |
| | | } |
| | | 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(); |
| | | }; |
| | | } |
| | | 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(); |
| | | }; |
| | | } |
| | | 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/modules/cps/entity/ProcessAssociation") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getBizId(); |
| | | }; |
| | | } |
| | | 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/cps/entity/ProcessAssociation") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getBizId(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | public ProcessAssociationServiceImpl(final IWorkstationService workstationService, final ISupplierService supplierService, final IWarehouseAreaService warehouseAreaService) { |
| | | this.workstationService = workstationService; |
| | |
| | | @Override // org.springblade.modules.cps.service.IProcessAssociationService |
| | | public ProcessAssociationVO listAssociation(Long processId) { |
| | | ProcessAssociationVO processAssociationVO = new ProcessAssociationVO(); |
| | | List<ProcessAssociation> processAssociationList = list(Wrappers.<ProcessAssociation>query() |
| | | .lambda() |
| | | .eq(ProcessAssociation::getProcessId, processId)); |
| | | /* |
| | | List<ProcessAssociation> processAssociationList = list((Wrapper) Wrappers.query().lambda().eq((v0) -> { |
| | | return v0.getProcessId(); |
| | | }, processId)); |
| | | }, processId));*/ |
| | | if (Func.isNotEmpty(processAssociationList)) { |
| | | Map<Integer, List<ProcessAssociation>> map = (Map) processAssociationList.stream().filter(type -> { |
| | | Map<Integer, List<ProcessAssociation>> map = processAssociationList.stream().filter(type -> { |
| | | return type.getType() != null; |
| | | }).collect(Collectors.groupingBy((v0) -> { |
| | | return v0.getType(); |
| | | })); |
| | | map.forEach(type2, value -> { |
| | | map.forEach((type2, value) -> { |
| | | switch (type2.intValue()) { |
| | | case 1: |
| | | List<Long> list = (List) value.stream().map((v0) -> { |
| | | List<Long> list = value.stream().map((v0) -> { |
| | | return v0.getBizId(); |
| | | }).collect(Collectors.toList()); |
| | | List<Workstation> workstationList = this.workstationService.list((Wrapper) Wrappers.query().lambda().in((v0) -> { |
| | | return v0.getId(); |
| | | }, list)); |
| | | List<Workstation> workstationList = this.workstationService.list(Wrappers.<Workstation>query().lambda().in(Workstation::getId, list)); |
| | | List<ProcessWorkstationTypeVO> processWorkstationTypeVOList = new ArrayList<>(); |
| | | workstationList.forEach(record -> { |
| | | ProcessWorkstationTypeVO processWorkstationTypeVO = ProcessWorkstationTypeVO.builder().id(record.getId()).workstationCode(record.getCode()).workstationName(record.getName()).build(); |
| | |
| | | processAssociationVO.setWorkstationList(processWorkstationTypeVOList); |
| | | return; |
| | | case 2: |
| | | List<Long> list2 = (List) value.stream().map((v0) -> { |
| | | return v0.getBizId(); |
| | | }).collect(Collectors.toList()); |
| | | List<WarehouseArea> warehouseAreaList = this.warehouseAreaService.list((Wrapper) Wrappers.query().lambda().in((v0) -> { |
| | | return v0.getId(); |
| | | }, list2)); |
| | | List<Long> list2 = value.stream().map(ProcessAssociation::getBizId).collect(Collectors.toList()); |
| | | List<WarehouseArea> warehouseAreaList = this.warehouseAreaService.list(Wrappers.<WarehouseArea>query().lambda().in(WarehouseArea::getId, list2)); |
| | | List<ProcessWarehouseAreaTypeVO> areaTypeVOList = new ArrayList<>(); |
| | | warehouseAreaList.forEach(record2 -> { |
| | | ProcessWarehouseAreaTypeVO processWarehouseAreaTypeVO = ProcessWarehouseAreaTypeVO.builder().id(record2.getId()).warehouseAreaCode(record2.getCode()).warehouseAreaName(record2.getName()).build(); |
| | |
| | | processAssociationVO.setWarehouseAreaList(areaTypeVOList); |
| | | return; |
| | | case 3: |
| | | List<Long> list3 = (List) value.stream().map((v0) -> { |
| | | return v0.getBizId(); |
| | | }).collect(Collectors.toList()); |
| | | List<Supplier> supplierList = this.supplierService.list((Wrapper) Wrappers.query().lambda().in((v0) -> { |
| | | return v0.getId(); |
| | | }, list3)); |
| | | List<Long> list3 = value.stream().map(ProcessAssociation::getBizId).collect(Collectors.toList()); |
| | | List<Supplier> supplierList = this.supplierService.list(Wrappers.<Supplier>query().lambda().in(Supplier::getId, list3)); |
| | | List<ProcessSupplierTypeVO> processSupplierTypeVOList = new ArrayList<>(); |
| | | supplierList.forEach(record3 -> { |
| | | ProcessSupplierTypeVO processSupplierTypeVO = ProcessSupplierTypeVO.builder().id(record3.getId()).supplierCode(record3.getCode()).supplierName(record3.getName()).build(); |
| | |
| | | |
| | | @Override // org.springblade.modules.cps.service.IProcessAssociationService |
| | | public Boolean delete(Long bizId, Long processId) { |
| | | return Boolean.valueOf(remove(Wrappers.<ProcessAssociation>query().lambda() |
| | | .eq(Func.isNotEmpty(bizId), ProcessAssociation::getBizId, bizId) |
| | | .eq(Func.isNotEmpty(processId), ProcessAssociation::getProcessId, processId))); |
| | | |
| | | /* |
| | | return Boolean.valueOf(remove(Wrappers.query().lambda().eq(Func.isNotEmpty(bizId), (v0) -> { |
| | | return v0.getBizId(); |
| | | }, bizId).eq(Func.isNotEmpty(processId), (v0) -> { |
| | | return v0.getProcessId(); |
| | | }, processId))); |
| | | */ |
| | | } |
| | | |
| | | private void checkProcessAssociation(ProcessAssociationSaveVO processAssociationSaveVO) { |
| | | Long count = Long.valueOf(count(Wrappers.query().lambda().eq(Func.isNotEmpty(processAssociationSaveVO.getProcessId()), (v0) -> { |
| | | return v0.getProcessId(); |
| | | }, processAssociationSaveVO.getProcessId()).eq(Func.isNotEmpty(processAssociationSaveVO.getBizId()), (v0) -> { |
| | | return v0.getBizId(); |
| | | }, processAssociationSaveVO.getBizId()))); |
| | | Long count = Long.valueOf(count(Wrappers.<ProcessAssociation>query().lambda() |
| | | .eq(Func.isNotEmpty(processAssociationSaveVO.getProcessId()), ProcessAssociation::getProcessId, processAssociationSaveVO.getProcessId()) |
| | | .eq(Func.isNotEmpty(processAssociationSaveVO.getBizId()), ProcessAssociation::getBizId, processAssociationSaveVO.getBizId()))); |
| | | if (count.longValue() > 0) { |
| | | throw new ServiceException(MessageUtils.message("cps.process.association.type.already.exists", new Object[0])); |
| | | } |
| | |
| | | package com.qianwen.smartman.modules.cps.service.impl; |
| | | |
| | | import com.alibaba.excel.write.merge.AbstractMergeStrategy; |
| | | 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.core.toolkit.support.SFunction; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.util.HashMap; |
| | | 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.constant.CommonConstant; |
| | | import com.qianwen.smartman.common.constant.ExcelConstant; |
| | | import com.qianwen.smartman.common.enums.StatusType; |
| | | import com.qianwen.smartman.common.utils.MessageUtils; |
| | | import com.qianwen.smartman.common.utils.ValidatorUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.qianwen.core.excel.util.ExcelUtil; |
| | | import com.qianwen.core.log.exception.ServiceException; |
| | | import com.qianwen.core.mp.service.impl.BladeServiceImpl; |
| | |
| | | import com.qianwen.core.mp.support.Query; |
| | | import com.qianwen.core.oss.model.BladeFile; |
| | | 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.enums.StatusType; |
| | | import com.qianwen.smartman.common.utils.MessageUtils; |
| | | import com.qianwen.smartman.common.utils.ValidatorUtils; |
| | | import com.qianwen.smartman.modules.cps.convert.ProcessConvert; |
| | | import com.qianwen.smartman.modules.cps.entity.Process; |
| | | import com.qianwen.smartman.modules.cps.entity.ProcessAssociation; |
| | | import com.qianwen.smartman.modules.cps.enums.WorkTypeEnum; |
| | | import com.qianwen.smartman.modules.cps.excel.ProcessExcel; |
| | | import com.qianwen.smartman.modules.cps.excel.ProcessImport; |
| | |
| | | import com.qianwen.smartman.modules.system.service.ICodeGeneratorService; |
| | | import com.qianwen.smartman.modules.system.service.IDictService; |
| | | import com.qianwen.smartman.modules.tpm.enums.MetaTypeEnum; |
| | | 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/cps/service/impl/ProcessServiceImpl.class */ |
| | | public class ProcessServiceImpl extends BladeServiceImpl<ProcessMapper, Process> implements IProcessService { |
| | | private static final Logger log = LoggerFactory.getLogger(ProcessServiceImpl.class); |
| | | private final IProcessAssociationService processAssociationService; |
| | |
| | | private final IDictService dictService; |
| | | private final ICodeGeneratorService codeGeneratorService; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -1601031533: |
| | | if (implMethodName.equals("getDictKey")) { |
| | | z = false; |
| | | break; |
| | | } |
| | | break; |
| | | case -1104365260: |
| | | if (implMethodName.equals("getProcessId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -982980443: |
| | | if (implMethodName.equals("getDictValue")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -75622813: |
| | | if (implMethodName.equals("getCode")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 98245393: |
| | | if (implMethodName.equals("getId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 803533544: |
| | | if (implMethodName.equals("getStatus")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 1567138533: |
| | | if (implMethodName.equals("getIsImport")) { |
| | | 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/system/entity/Dict") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getDictKey(); |
| | | }; |
| | | } |
| | | 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/cps/entity/ProcessAssociation") && lambda.getImplMethodSignature().equals("()Ljava/lang/Long;")) { |
| | | return (v0) -> { |
| | | return v0.getProcessId(); |
| | | }; |
| | | } |
| | | 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(); |
| | | }; |
| | | } |
| | | 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(); |
| | | }; |
| | | } |
| | | 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(); |
| | | }; |
| | | } |
| | | 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/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getStatus(); |
| | | }; |
| | | } |
| | | 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/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getStatus(); |
| | | }; |
| | | } |
| | | 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/system/entity/Dict") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getDictValue(); |
| | | }; |
| | | } |
| | | break; |
| | | case RegionCache.VILLAGE_LEVEL /* 5 */: |
| | | 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/system/entity/Dict") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | 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/cps/entity/Process") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | 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/cps/entity/Process") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | 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/cps/entity/Process") && lambda.getImplMethodSignature().equals("()Ljava/lang/Integer;")) { |
| | | return (v0) -> { |
| | | return v0.getIsImport(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | public ProcessServiceImpl(final IProcessAssociationService processAssociationService, final OssBuilder ossBuilder, final ProcessMapper processMapper, final IDictService dictService, final ICodeGeneratorService codeGeneratorService) { |
| | | this.processAssociationService = processAssociationService; |
| | |
| | | if (StatusType.REMOVE.getType().equals(type)) { |
| | | int count = this.baseMapper.existCraftProcess(processIds); |
| | | ThrowFun.isTrue(count > 0).throwMessage(MessageUtils.message("cps.process.binding.craft", new Object[0])); |
| | | |
| | | this.processAssociationService.remove(Wrappers.<ProcessAssociation>query().lambda().in(Func.isNotEmpty(processIds), ProcessAssociation::getProcessId, processIds)); |
| | | /* |
| | | this.processAssociationService.remove(Wrappers.query().lambda().in(Func.isNotEmpty(processIds), (v0) -> { |
| | | return v0.getProcessId(); |
| | | }, processIds)); |
| | | remove(Wrappers.query().lambda().in(Func.isNotEmpty(processIds), (v0) -> { |
| | | return v0.getId(); |
| | | }, processIds)); |
| | | */ |
| | | remove(Wrappers.<Process>query().lambda().in(Func.isNotEmpty(processIds), Process::getId, processIds)); |
| | | return true; |
| | | } |
| | | return Boolean.valueOf(changeStatus(processIds, CommonConstant.DEACTIVATE)); |
| | |
| | | } |
| | | }); |
| | | } |
| | | Set<String> codeDisableSet = (Set) processList.stream().filter(c -> { |
| | | Set<String> codeDisableSet = processList.stream().filter(c -> { |
| | | return CommonConstant.DEACTIVATE.equals(c.getStatus()); |
| | | }).map((v0) -> { |
| | | return v0.getCode(); |
| | | }).collect(Collectors.toSet()); |
| | | |
| | | Map<String, String> dictMap = new HashMap<>(16); |
| | | List<Dict> dictList = this.dictService.list(Wrappers.<Dict>lambdaQuery().select(Dict::getDictKey, Dict::getDictValue).eq(Dict::getCode, "work_type")); |
| | | /* |
| | | List<Dict> dictList = this.dictService.list((Wrapper) Wrappers.lambdaQuery().select(new SFunction[]{(v0) -> { |
| | | return v0.getDictKey(); |
| | | }, (v0) -> { |
| | | return v0.getDictValue(); |
| | | }}).eq((v0) -> { |
| | | return v0.getCode(); |
| | | }, "work_type")); |
| | | }, "work_type"));*/ |
| | | if (Func.isNotEmpty(dictList)) { |
| | | dictMap = (Map) dictList.stream().collect(Collectors.toMap((v0) -> { |
| | | dictMap = dictList.stream().collect(Collectors.toMap((v0) -> { |
| | | return v0.getDictValue(); |
| | | }, (v0) -> { |
| | | return v0.getDictKey(); |
| | |
| | | } |
| | | } |
| | | if (!flag) { |
| | | MultipartFile multipartFile = ExcelUtil.exportFillTemplateToMultipartFile(ExcelConstant.DIRECTORY + "processFailTemplate" + ExcelConstant.SUFFIX, MessageUtils.message("excel.import.failed.report.name", new Object[0]) + ExcelConstant.SUFFIX, "工序信息表", (List) data.stream().filter(x2 -> { |
| | | MultipartFile multipartFile = ExcelUtil.exportFillTemplateToMultipartFile(ExcelConstant.DIRECTORY + "processFailTemplate" + ExcelConstant.SUFFIX, MessageUtils.message("excel.import.failed.report.name", new Object[0]) + ExcelConstant.SUFFIX, "工序信息表", data.stream().filter(x2 -> { |
| | | return Func.isNotEmpty(x2.getFailReason()); |
| | | }).collect(Collectors.toList()), (Object) null, (AbstractMergeStrategy) null); |
| | | }).collect(Collectors.toList()), null, null); |
| | | return this.ossBuilder.tempTemplate().putFile(multipartFile.getOriginalFilename(), multipartFile); |
| | | } |
| | | data.forEach(x3 -> { |
| | |
| | | } |
| | | |
| | | private void checkProcess(ProcessSaveVO processSaveVO) { |
| | | long count = count(Wrappers.<Process>lambdaQuery() |
| | | .ne(Func.isNotEmpty(processSaveVO.getId()), Process::getId, processSaveVO.getId()) |
| | | .eq(Process::getCode, processSaveVO.getCode()) |
| | | .eq(Process::getStatus, CommonConstant.ENABLE)); |
| | | |
| | | /* |
| | | long count = count((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().ne(Func.isNotEmpty(processSaveVO.getId()), (v0) -> { |
| | | return v0.getId(); |
| | | }, processSaveVO.getId()).eq((v0) -> { |
| | |
| | | }, processSaveVO.getCode())).eq((v0) -> { |
| | | return v0.getStatus(); |
| | | }, CommonConstant.ENABLE)); |
| | | */ |
| | | if (count > 0) { |
| | | throw new ServiceException(MessageUtils.message("cps.process.code.already.exists", new Object[0])); |
| | | } |
| | | long countDisable = count(Wrappers.<Process>lambdaQuery() |
| | | .ne(Func.isNotEmpty(processSaveVO.getId()), Process::getId, processSaveVO.getId()) |
| | | .eq(Process::getCode, processSaveVO.getCode()) |
| | | .eq(Process::getStatus, CommonConstant.ENABLE)); |
| | | /* |
| | | long countDisable = count((Wrapper) ((LambdaQueryWrapper) Wrappers.lambdaQuery().ne(Func.isNotEmpty(processSaveVO.getId()), (v0) -> { |
| | | return v0.getId(); |
| | | }, processSaveVO.getId()).eq((v0) -> { |
| | | return v0.getCode(); |
| | | }, processSaveVO.getCode())).eq((v0) -> { |
| | | return v0.getStatus(); |
| | | }, CommonConstant.ENABLE)); |
| | | }, CommonConstant.ENABLE));*/ |
| | | if (countDisable > 0) { |
| | | throw new ServiceException(MessageUtils.message("cps.process.code.disable.already.exists", new Object[0])); |
| | | } |
| | |
| | | } |
| | | |
| | | private void checkImport(List<Long> ids) { |
| | | Long count = Long.valueOf(count((Wrapper) Wrappers.query().lambda().in(Func.isNotEmpty(ids), (v0) -> { |
| | | return v0.getId(); |
| | | }, ids).eq((v0) -> { |
| | | return v0.getIsImport(); |
| | | }, 1))); |
| | | Long count = Long.valueOf(count(Wrappers.<Process>query().lambda().in(Func.isNotEmpty(ids), Process::getId, ids).eq(Process::getIsImport, 1))); |
| | | |
| | | if (count.longValue() > 0) { |
| | | throw new ServiceException(MessageUtils.message("cps.process.delete.failed", new Object[0])); |
| | | } |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/cps/service/impl/SupplierServiceImpl.class */ |
| | | public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> implements ISupplierService { |
| | | private static final Logger log = LoggerFactory.getLogger(SupplierServiceImpl.class); |
| | | private final ICodeGeneratorService codeGeneratorService; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -1249349403: |
| | | if (implMethodName.equals("getTel")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -110831682: |
| | | if (implMethodName.equals("getAddress")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -75622813: |
| | | if (implMethodName.equals("getCode")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case -75308287: |
| | | if (implMethodName.equals("getName")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 98245393: |
| | | if (implMethodName.equals("getId")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 1071464927: |
| | | if (implMethodName.equals("getCreateTime")) { |
| | | z = false; |
| | | 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/core/mp/base/BaseEntity") && lambda.getImplMethodSignature().equals("()Ljava/util/Date;")) { |
| | | return (v0) -> { |
| | | return v0.getCreateTime(); |
| | | }; |
| | | } |
| | | 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/cps/entity/Supplier") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getName(); |
| | | }; |
| | | } |
| | | 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/cps/entity/Supplier") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getAddress(); |
| | | }; |
| | | } |
| | | 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(); |
| | | }; |
| | | } |
| | | 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/modules/cps/entity/Supplier") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | 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/cps/entity/Supplier") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getCode(); |
| | | }; |
| | | } |
| | | break; |
| | | case RegionCache.VILLAGE_LEVEL /* 5 */: |
| | | 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/cps/entity/Supplier") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getTel(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | public SupplierServiceImpl(final ICodeGeneratorService codeGeneratorService) { |
| | | this.codeGeneratorService = codeGeneratorService; |
| | |
| | | |
| | | @Override // org.springblade.modules.cps.service.ISupplierService |
| | | public IPage<SupplierVO> listPage(Query query, String keyword) { |
| | | IPage<Supplier> supplierPage = page(Condition.getPage(query), Wrappers.<Supplier>query() |
| | | .lambda() |
| | | .and(Func.isNotEmpty(keyword), i -> i.likeRight(Supplier::getCode, keyword).or().likeRight(Supplier::getName, keyword).or().likeRight(Supplier::getAddress, keyword).or().likeRight(Supplier::getTel, keyword)) |
| | | .orderByDesc(Supplier::getCreateTime)); |
| | | /* |
| | | IPage<Supplier> supplierPage = page(Condition.getPage(query), (Wrapper) Wrappers.query().lambda().and(Func.isNotEmpty(keyword), i -> { |
| | | LambdaQueryWrapper lambdaQueryWrapper = (LambdaQueryWrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) ((LambdaQueryWrapper) i.likeRight((v0) -> { |
| | | return v0.getCode(); |
| | |
| | | }, keyword); |
| | | }).orderByDesc((v0) -> { |
| | | return v0.getCreateTime(); |
| | | })); |
| | | return (IPage) Optional.ofNullable(supplierPage).map(record -> { |
| | | Page page = new Page(record.getCurrent(), record.getSize(), record.getTotal()); |
| | | }));*/ |
| | | return Optional.ofNullable(supplierPage).map(record -> { |
| | | Page<SupplierVO> page = new Page<>(record.getCurrent(), record.getSize(), record.getTotal()); |
| | | page.setRecords(SupplierConvert.INSTANCE.convertListPage(record.getRecords())); |
| | | return page; |
| | | }).orElse(new Page()); |
| | | }).orElse(new Page<>()); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.cps.service.ISupplierService |
| | |
| | | |
| | | @Override // org.springblade.modules.cps.service.ISupplierService |
| | | public Boolean delete(List<Long> supplierIds) { |
| | | remove(Wrappers.query().lambda().in(Func.isNotEmpty(supplierIds), (v0) -> { |
| | | return v0.getId(); |
| | | }, supplierIds)); |
| | | remove(Wrappers.<Supplier>query() |
| | | .lambda() |
| | | .in(Func.isNotEmpty(supplierIds), Supplier::getId, supplierIds)); |
| | | |
| | | return true; |
| | | } |
| | | |
| | | private void checkSupplier(SupplierSaveVO supplierSaveVO) { |
| | | Long count = Long.valueOf(count(Wrappers.query().lambda().ne(Func.isNotEmpty(supplierSaveVO.getId()), (v0) -> { |
| | | Long count = count(Wrappers.<Supplier>query() |
| | | .lambda() |
| | | .ne(Func.isNotEmpty(supplierSaveVO.getId()), Supplier::getId, supplierSaveVO.getId()) |
| | | .eq(Func.isNotEmpty(supplierSaveVO.getCode()), Supplier::getCode, supplierSaveVO.getCode())); |
| | | /* |
| | | Long count1 = Long.valueOf(count(Wrappers.query().lambda().ne(Func.isNotEmpty(supplierSaveVO.getId()), (v0) -> { |
| | | return v0.getId(); |
| | | }, supplierSaveVO.getId()).eq(Func.isNotEmpty(supplierSaveVO.getCode()), (v0) -> { |
| | | return v0.getCode(); |
| | | }, supplierSaveVO.getCode()))); |
| | | }, supplierSaveVO.getCode())));*/ |
| | | if (count.longValue() > 0) { |
| | | throw new ServiceException(MessageUtils.message("cps.supplier.code.already.exits", new Object[0])); |
| | | } |