package com.qianwen.smartman.modules.perf.service.impl; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.qianwen.smartman.common.constant.CommonConstant; import com.qianwen.core.tool.utils.Func; import com.qianwen.smartman.modules.cps.dto.MachineExtDTO; import com.qianwen.smartman.modules.cps.service.IMachineService; import com.qianwen.smartman.modules.perf.forestClient.PerfForestClient; import com.qianwen.smartman.modules.perf.service.IEmployeeSendService; import com.qianwen.smartman.modules.sync.constant.QyWechatConstant; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; @Service /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/perf/service/impl/EmployeeSendServiceImpl.class */ public class EmployeeSendServiceImpl implements IEmployeeSendService { private static final Logger log = LoggerFactory.getLogger(EmployeeSendServiceImpl.class); private final IMachineService machineService; private final PerfForestClient forestClient; public EmployeeSendServiceImpl(final IMachineService machineService, final PerfForestClient forestClient) { this.machineService = machineService; this.forestClient = forestClient; } @Override // org.springblade.modules.perf.service.IEmployeeSendService @Async public void sendMessageRocket(List workstationIds) { List extList = this.machineService.getMachineByWorkStation(workstationIds); workstationIds.forEach(wId -> { extList.stream().filter(c -> { return wId.equals(c.getWorkstationId()); }).findFirst().ifPresent(ext -> { String dmpId = this.machineService.queryDateTypeState(wId); if (Func.isNotBlank(dmpId)) { try { String employeeOnOff = this.forestClient.perfEmployeeOnOff(ext.getExtendId(), dmpId); JSONObject jsonObject = JSON.parseObject(employeeOnOff); Boolean success = jsonObject.getBoolean(QyWechatConstant.CALLBACK_RESULT); if (Boolean.FALSE.equals(success)) { log.error(jsonObject.getString(CommonConstant.ALARM_MSG)); } } catch (Exception e) { log.error("调用dmp失败"); } } }); }); } }