| | |
| | | package com.qianwen.smartman.modules.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import java.lang.invoke.SerializedLambda; |
| | | import java.util.List; |
| | | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import com.qianwen.smartman.common.constant.FmsConstant; |
| | | 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.mp.base.BaseServiceImpl; |
| | | import com.qianwen.core.tool.utils.Func; |
| | | import com.qianwen.smartman.common.constant.FmsConstant; |
| | | import com.qianwen.smartman.common.utils.MessageUtils; |
| | | import com.qianwen.smartman.modules.fms.dto.FmsInputDto; |
| | | import com.qianwen.smartman.modules.fms.dto.SwitchDTO; |
| | | import com.qianwen.smartman.modules.fms.entity.FmsInstructionRecord; |
| | |
| | | import com.qianwen.smartman.modules.system.entity.Param; |
| | | import com.qianwen.smartman.modules.system.mapper.ParamMapper; |
| | | import com.qianwen.smartman.modules.system.service.IParamService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | @Service |
| | | /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/system/service/impl/ParamServiceImpl.class */ |
| | |
| | | private final IFmsInstructionRecordService instructionRecordService; |
| | | private final FmsForestClient fmsForestClient; |
| | | |
| | | private static /* synthetic */ Object $deserializeLambda$(SerializedLambda lambda) { |
| | | String implMethodName = lambda.getImplMethodName(); |
| | | boolean z = true; |
| | | switch (implMethodName.hashCode()) { |
| | | case -1045666808: |
| | | if (implMethodName.equals("getParamKey")) { |
| | | z = true; |
| | | break; |
| | | } |
| | | break; |
| | | case 1071464927: |
| | | if (implMethodName.equals("getCreateTime")) { |
| | | z = false; |
| | | break; |
| | | } |
| | | break; |
| | | case 1944152578: |
| | | if (implMethodName.equals("getParamName")) { |
| | | 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/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/system/entity/Param") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getParamName(); |
| | | }; |
| | | } |
| | | 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/Param") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getParamName(); |
| | | }; |
| | | } |
| | | 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/Param") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getParamName(); |
| | | }; |
| | | } |
| | | 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/Param") && lambda.getImplMethodSignature().equals("()Ljava/lang/String;")) { |
| | | return (v0) -> { |
| | | return v0.getParamKey(); |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | throw new IllegalArgumentException("Invalid lambda deserialization"); |
| | | } |
| | | |
| | | public ParamServiceImpl(final IFmsInstructionRecordService instructionRecordService, final FmsForestClient fmsForestClient) { |
| | | this.instructionRecordService = instructionRecordService; |
| | |
| | | |
| | | @Override // org.springblade.modules.system.service.IParamService |
| | | public String getValue(String paramKey) { |
| | | Param param = getOne(Wrappers.<Param>query().lambda().eq(Param::getParamKey, paramKey)); |
| | | /* |
| | | Param param = (Param) getOne((Wrapper) Wrappers.query().lambda().eq((v0) -> { |
| | | return v0.getParamKey(); |
| | | }, paramKey)); |
| | | }, paramKey));*/ |
| | | return param.getParamValue(); |
| | | } |
| | | |
| | | @Override // org.springblade.modules.system.service.IParamService |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public void startSwitching() { |
| | | Param fmsParam = getOne(Wrappers.<Param>lambdaQuery().eq(Param::getParamName, FmsConstant.PARAM_NAME)); |
| | | /* |
| | | Param fmsParam = (Param) getOne((Wrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getParamName(); |
| | | }, FmsConstant.PARAM_NAME)); |
| | | }, FmsConstant.PARAM_NAME));*/ |
| | | if (fmsParam != null) { |
| | | fmsParam.setParamValue(FmsConstant.MANUAL); |
| | | updateById(fmsParam); |
| | |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public void switchState(SwitchDTO switchDTO) { |
| | | String paramValue = switchDTO.getParamValue(); |
| | | List<FmsInstructionRecord> list = this.instructionRecordService.list(Wrappers.<FmsInstructionRecord>lambdaQuery().orderByDesc(FmsInstructionRecord::getCreateTime)); |
| | | /* |
| | | List<FmsInstructionRecord> list = this.instructionRecordService.list((Wrapper) Wrappers.lambdaQuery().orderByDesc((v0) -> { |
| | | return v0.getCreateTime(); |
| | | })); |
| | | }));*/ |
| | | if (Func.isNotEmpty(list)) { |
| | | FmsInstructionRecord fmsInstructionRecord = list.get(0); |
| | | Integer state = fmsInstructionRecord.getState(); |
| | |
| | | throw new ServiceException(MessageUtils.message("cps.fms.order.last.instruction.status.fail.can.not.automatic", new Object[0])); |
| | | } |
| | | } |
| | | Param fmsParam = getOne(Wrappers.<Param>lambdaQuery().eq(Param::getParamName,FmsConstant.PARAM_NAME)); |
| | | /* |
| | | Param fmsParam = (Param) getOne((Wrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getParamName(); |
| | | }, FmsConstant.PARAM_NAME)); |
| | | }, ));*/ |
| | | log.info("==============调用dmp接口,调度系统自动切换开始执行===================="); |
| | | FmsInputDto fms = new FmsInputDto(); |
| | | if (FmsConstant.MANUAL.equals(paramValue)) { |
| | |
| | | |
| | | @Override // org.springblade.modules.system.service.IParamService |
| | | public SwitchDTO orderStartStatus() { |
| | | Param fmsParam = getOne(Wrappers.<Param>lambdaQuery().eq(Param::getParamName, FmsConstant.PARAM_NAME)); |
| | | /* |
| | | Param fmsParam = (Param) getOne((Wrapper) Wrappers.lambdaQuery().eq((v0) -> { |
| | | return v0.getParamName(); |
| | | }, FmsConstant.PARAM_NAME)); |
| | | }, FmsConstant.PARAM_NAME));*/ |
| | | if (fmsParam != null) { |
| | | SwitchDTO switchDTO = new SwitchDTO(); |
| | | switchDTO.setParamValue(fmsParam.getParamValue()); |