去掉tdedgine,去掉一部分rocketmq,去掉dmplog模块
已添加2个文件
已修改27个文件
已删除26个文件
| | |
| | | <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
| | | |
| | | <flowable.version>6.4.2</flowable.version> |
| | | <!-- |
| | | <tdengine.version>3.0.2</tdengine.version> |
| | | |
| | | --> |
| | | <spring.boot.version>2.3.12.RELEASE</spring.boot.version> |
| | | <spring.platform.version>Cairo-SR8</spring.platform.version> |
| | | |
| | |
| | | <artifactId>rocketmq-client</artifactId> |
| | | <version>4.5.2</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.integration</groupId> |
| | | <artifactId>spring-integration-mqtt</artifactId> |
| | | </dependency> |
| | | <!-- å½é
å --> |
| | | <dependency> |
| | | <groupId>com.qianwen</groupId> |
| | |
| | | </dependency> |
| | | |
| | | <!-- tdengine é©±å¨ --> |
| | | <!-- |
| | | <dependency> |
| | | <groupId>com.taosdata.jdbc</groupId> |
| | | <artifactId>taos-jdbcdriver</artifactId> |
| | | <version>${tdengine.version}</version> |
| | | </dependency> |
| | | --> |
| | | <!-- iotdb --> |
| | | <dependency> |
| | | <groupId>org.apache.iotdb</groupId> |
| | |
| | | import com.qianwen.smartman.modules.mdc.dto.WorkstationDmpDTO; |
| | | import com.qianwen.smartman.modules.mdc.entity.WorkstationCollectData; |
| | | import com.qianwen.smartman.modules.mdc.mapper.SuperProcessParameterMapper; |
| | | import com.qianwen.smartman.modules.mdc.service.IProcessParameterService; |
| | | |
| | | public class WorkstationCache { |
| | | public static final String CRC = "crc:"; |
| | |
| | | private static final IGlobalWcsService WCS_SERVICE = (IGlobalWcsService) SpringUtil.getBean(IGlobalWcsService.class); |
| | | private static final IWorkstationWcsService WORKSTATION_WCS_SERVICE = (IWorkstationWcsService) SpringUtil.getBean(IWorkstationWcsService.class); |
| | | private static final SuperProcessParameterMapper superProcessParameterMapper = (SuperProcessParameterMapper) SpringUtil.getBean(SuperProcessParameterMapper.class); |
| | | |
| | | private static final IProcessParameterService processParameterService = SpringUtil.getBean(IProcessParameterService.class); |
| | | |
| | | public static List<WorkstationWcsDmpDTO> getWorkstationWcsList(String workstationId) { |
| | | String redisKey = CommonUtil.getReallyCacheName(ExtCacheConstant.CPS_CACHE, WORKSTATION_WCS, "", workstationId); |
| | | SetOperations<String, Object> setOps = BLADE_REDIS.getSetOps(); |
| | |
| | | String cacheName = CommonUtil.getReallyCacheName(ExtCacheConstant.CPS_CACHE, WORKSTATION_REAL_TIME, "", workstationId); |
| | | Map<String, Object> resultMapping = BLADE_REDIS.hGetAll(cacheName); |
| | | if (Func.isEmpty(resultMapping)) { |
| | | List<WorkstationCollectData> workstationCollectData = superProcessParameterMapper.queryLastParameter(workstationId); |
| | | // |
| | | //List<WorkstationCollectData> workstationCollectData = superProcessParameterMapper.queryLastParameter(workstationId); |
| | | Long wid = Long.parseLong(workstationId); |
| | | List<WorkstationCollectData> workstationCollectData = processParameterService.queryLastParameter(wid); |
| | | if (Func.isNotEmpty(workstationCollectData)) { |
| | | resultMapping = workstationCollectData.stream().collect(Collectors.toMap((v0) -> { |
| | | return v0.getN(); |
| | |
| | | return result; |
| | | })); |
| | | } |
| | | |
| | | } |
| | | return resultMapping; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.qianwen.smartman.common.config; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Random; |
| | | |
| | | import org.eclipse.paho.client.mqttv3.MqttConnectOptions; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.integration.annotation.ServiceActivator; |
| | | import org.springframework.integration.channel.DirectChannel; |
| | | import org.springframework.integration.core.MessageProducer; |
| | | import org.springframework.integration.mqtt.core.DefaultMqttPahoClientFactory; |
| | | import org.springframework.integration.mqtt.core.MqttPahoClientFactory; |
| | | import org.springframework.integration.mqtt.inbound.MqttPahoMessageDrivenChannelAdapter; |
| | | import org.springframework.integration.mqtt.outbound.MqttPahoMessageHandler; |
| | | import org.springframework.integration.mqtt.support.DefaultPahoMessageConverter; |
| | | import org.springframework.integration.mqtt.support.MqttHeaders; |
| | | import org.springframework.messaging.MessageChannel; |
| | | import org.springframework.messaging.MessageHandler; |
| | | |
| | | |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | |
| | | @Configuration |
| | | public class MdcMqttConfig { |
| | | private Logger logger = LoggerFactory.getLogger(this.getClass()); |
| | | @Value("${mqtt.host}") |
| | | private String mqttHost; |
| | | |
| | | @Value("${mqtt.username:}") |
| | | private String mqttUserName; |
| | | |
| | | @Value("${mqtt.password:}") |
| | | private String mqttPassword; |
| | | |
| | | public static final String DEFAULT_TOPIC = "mdc"; |
| | | /** |
| | | * åé¦å建çtopicï¼mdcä¸ï¼ï¼æ¬åºç¨æ¥æ¶å¹¶å¤ç |
| | | */ |
| | | public static final String FEEDBACK_TOPIC = "mdc/feedback"; |
| | | |
| | | public static final String WOCKSTATION_CREATE_TOPIC = "mdc/workstation-create"; |
| | | |
| | | @Bean |
| | | public MqttPahoClientFactory mqttClientFactory() { |
| | | DefaultMqttPahoClientFactory factory = new DefaultMqttPahoClientFactory(); |
| | | MqttConnectOptions options = new MqttConnectOptions(); |
| | | options.setServerURIs(new String[] { mqttHost});//"tcp://82.156.1.83:1884" |
| | | |
| | | if(ObjectUtil.isNotEmpty(mqttUserName)) { |
| | | options.setUserName(mqttUserName); |
| | | options.setPassword(mqttPassword.toCharArray()); |
| | | } |
| | | factory.setConnectionOptions(options); |
| | | return factory; |
| | | } |
| | | |
| | | @Bean |
| | | public MessageChannel mqttInputChannel() { |
| | | return new DirectChannel(); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @return |
| | | */ |
| | | /* |
| | | @Bean |
| | | public MessageProducer inbound() { |
| | | MqttPahoMessageDrivenChannelAdapter adapter = |
| | | new MqttPahoMessageDrivenChannelAdapter("spring-boot-mqtt-client-inbound", |
| | | mqttClientFactory(), COLLECT_DATA_TOPIC, FEEDBACK_TOPIC,WOCKSTATION_CREATE_TOPIC);//æåä¸ä¸ªåæ°å
许å¤ä¸ªtopicåæ° |
| | | adapter.setCompletionTimeout(5000); |
| | | adapter.setConverter(new DefaultPahoMessageConverter()); |
| | | adapter.setQos(1); |
| | | adapter.setOutputChannel(mqttInputChannel()); |
| | | return adapter; |
| | | } |
| | | */ |
| | | |
| | | /** |
| | | * å
¥ç«æ¶æ¯å¤ç |
| | | * @return |
| | | */ |
| | | @Bean |
| | | @ServiceActivator(inputChannel = "mqttInputChannel") |
| | | public MessageHandler handler() { |
| | | return message -> { |
| | | String topic = String.valueOf(message.getHeaders().get(MqttHeaders.RECEIVED_TOPIC)); |
| | | if(FEEDBACK_TOPIC.equals(topic) ) { |
| | | |
| | | } |
| | | }; |
| | | } |
| | | |
| | | @Bean |
| | | public MessageChannel mqttOutboundChannel() { |
| | | return new DirectChannel(); |
| | | } |
| | | |
| | | @Bean |
| | | @ServiceActivator(inputChannel = "mqttOutboundChannel") |
| | | public MessageHandler mqttOutbound() { |
| | | Random numList = new Random(); |
| | | |
| | | MqttPahoMessageHandler messageHandler = |
| | | new MqttPahoMessageHandler("spring-boot-mqtt-client-outbound-mdc"+numList.nextInt(50), mqttClientFactory()); |
| | | messageHandler.setAsync(true); |
| | | messageHandler.setDefaultTopic(DEFAULT_TOPIC); |
| | | return messageHandler; |
| | | } |
| | | } |
| | |
| | | import com.qianwen.core.swagger.EnableSwagger; |
| | | import com.qianwen.core.swagger.SwaggerProperties; |
| | | import com.qianwen.core.swagger.SwaggerUtil; |
| | | import com.qianwen.smartman.modules.dmpLog.constant.DmpLogSyncConstant; |
| | | //import com.qianwen.smartman.modules.dmpLog.constant.DmpLogSyncConstant; |
| | | |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.context.annotation.Bean; |
| | |
| | | public Docket syncDocket() { |
| | | return docket("sync", Collections.singletonList("com.qianwen.smartman.modules.sync")); |
| | | } |
| | | |
| | | /* |
| | | @Bean |
| | | public Docket dmpLogDocket() { |
| | | return docket(DmpLogSyncConstant.DMP_LOG_TOPIC, Collections.singletonList("com.qianwen.smartman.modules.dmpLog")); |
| | | } |
| | | */ |
| | | |
| | | @Bean |
| | | public Docket toolDocket() { |
| | |
| | | package com.qianwen.smartman.common.constant; |
| | | |
| | | public interface WorkstationConstant { |
| | | public static final String WORKSTATION_CREATE_TOPIC = "workstation-create-data"; |
| | | //public static final String WORKSTATION_CREATE_TOPIC = "workstation-create-data"; |
| | | public static final String WORKSTATION_CREATE_TOPIC = "mdc/workstation-create"; |
| | | public static final int COLLECT_SWITCH_ON = 1; |
| | | public static final int LINK_WAY_CREAT = 1; |
| | | public static final int LINK_WAY_QUOTE = 0; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.qianwen.smartman.common.mqtt; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.integration.mqtt.support.MqttHeaders; |
| | | import org.springframework.messaging.MessageChannel; |
| | | import org.springframework.messaging.support.MessageBuilder; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class MqttMessageSender { |
| | | @Autowired |
| | | private MessageChannel mqttOutboundChannel; |
| | | |
| | | public void sendMessage(String topic, String payload) { |
| | | mqttOutboundChannel.send(MessageBuilder.withPayload(payload) |
| | | .setHeader(MqttHeaders.TOPIC, topic) |
| | | .build()); |
| | | |
| | | } |
| | | } |
| | |
| | | String userId = this.dingSyncService.getDingUserId(code); |
| | | return this.outerAppScanService.loginByOuterUserId(userId); |
| | | } |
| | | |
| | | /* |
| | | @ApiLog("åå·¥ä¼ä¸å¾®ä¿¡æ«ç ç»å½åè°æ¥å£") |
| | | @GetMapping({"/qy-wechat/token"}) |
| | | @ApiOperation(value = "åå·¥ä¼ä¸å¾®ä¿¡æ«ç ç»å½åè°æ¥å£", notes = "ä¼ å
¥æ«ç ææcode") |
| | | public R<Kv> scanLogin(@RequestParam("clientId") String clientId, @RequestParam("code") String authCode) { |
| | | return this.outerAppScanService.qyScanLogin(clientId, authCode); |
| | | } |
| | | */ |
| | | } |
| | |
| | | import com.qianwen.smartman.modules.sync.entity.QyUser; |
| | | import com.qianwen.smartman.modules.sync.enums.SseEventEnum; |
| | | import com.qianwen.smartman.modules.sync.message.sse.SseEmitterServer; |
| | | import com.qianwen.smartman.modules.sync.service.impl.WechatSyncServiceImpl; |
| | | //import com.qianwen.smartman.modules.sync.service.impl.WechatSyncServiceImpl; |
| | | import com.qianwen.smartman.modules.sync.util.CodeUtil; |
| | | import com.qianwen.smartman.modules.system.entity.UserInfo; |
| | | import com.qianwen.smartman.modules.system.entity.UserOauth; |
| | |
| | | private final IUserOauthService userOauthService; |
| | | private final IEmployeeService employeeService; |
| | | private final IUserService userServices; |
| | | private final WechatSyncServiceImpl wechatSyncService; |
| | | //private final WechatSyncServiceImpl wechatSyncService; |
| | | private final SseEmitterServer sseEmitterServer; |
| | | |
| | | |
| | | public OuterAppScanService(IUserOauthService userOauthService, IEmployeeService employeeService, IUserService userServices, WechatSyncServiceImpl wechatSyncService, SseEmitterServer sseEmitterServer) { |
| | | //WechatSyncServiceImpl wechatSyncService, |
| | | public OuterAppScanService(IUserOauthService userOauthService, IEmployeeService employeeService, IUserService userServices, SseEmitterServer sseEmitterServer) { |
| | | this.userOauthService = userOauthService; |
| | | this.employeeService = employeeService; |
| | | this.userServices = userServices; |
| | | this.wechatSyncService = wechatSyncService; |
| | | //this.wechatSyncService = wechatSyncService; |
| | | this.sseEmitterServer = sseEmitterServer; |
| | | } |
| | | |
| | |
| | | return R.data(TokenUtil.createAuthInfo(userInfo)); |
| | | */ |
| | | } |
| | | |
| | | /* |
| | | public R<Kv> qyScanLogin(String clientId, String code) { |
| | | |
| | | if (CodeUtil.verifyLoginCodeExpire(clientId).booleanValue()) { |
| | |
| | | } |
| | | QyUser scanUser = this.wechatSyncService.getScanUser(code, clientId); |
| | | String appUserMsg = MessageUtils.message("sys.outer.user.not.exist", new Object[0]); |
| | | |
| | | if (Objects.isNull(scanUser)) { |
| | | this.sseEmitterServer.sendMsg(clientId, appUserMsg, SseEventEnum.ERROR_MSG_ID.getEventId()); |
| | | throw new ServiceException(appUserMsg); |
| | | } |
| | | }* |
| | | UserOauth userOauth = this.userOauthService.getOne(Wrappers.<UserOauth>lambdaQuery().eq(UserOauth::getUuid, scanUser.getUserid()).eq(UserOauth::getSource,QyWechatConstant.QY_SOURCE)); |
| | | |
| | | if (Func.isEmpty(userOauth)) { |
| | | this.sseEmitterServer.sendMsg(clientId, appUserMsg, SseEventEnum.ERROR_MSG_ID.getEventId()); |
| | | throw new ServiceException(appUserMsg); |
| | | } |
| | | Employee employee = this.wechatSyncService.createOrModifyEmployee(scanUser, userOauth); |
| | | //Employee employee = this.wechatSyncService.createOrModifyEmployee(scanUser, userOauth); |
| | | String userBingMsg = MessageUtils.message("sys.outer.user.not.bind.account", new Object[0]); |
| | | if (StrUtil.isEmpty(employee.getUserId())) { |
| | | this.sseEmitterServer.sendMsg(clientId, userBingMsg, SseEventEnum.ERROR_MSG_ID.getEventId()); |
| | |
| | | CodeUtil.failureCode(cacheKey); |
| | | return R.data(authInfo); |
| | | } |
| | | */ |
| | | } |
| | |
| | | package com.qianwen.smartman.modules.cps.message.producer; |
| | | |
| | | import org.apache.rocketmq.spring.core.RocketMQTemplate; |
| | | //import org.apache.rocketmq.spring.core.RocketMQTemplate; |
| | | import com.qianwen.smartman.common.constant.WorkstationConstant; |
| | | import com.qianwen.smartman.common.mqtt.MqttMessageSender; |
| | | import com.qianwen.smartman.modules.cps.dto.WorkstationCreateMessageDTO; |
| | | import org.springframework.messaging.support.MessageBuilder; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.messaging.support.MessageBuilder; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | public class InsertWorkstationProducer { |
| | | private final RocketMQTemplate rocketMQTemplate; |
| | | |
| | | //private final RocketMQTemplate rocketMQTemplate; |
| | | @Autowired |
| | | private MqttMessageSender mqttMsgSender; |
| | | /* |
| | | public InsertWorkstationProducer(final RocketMQTemplate rocketMQTemplate) { |
| | | this.rocketMQTemplate = rocketMQTemplate; |
| | | } |
| | | }*/ |
| | | |
| | | public void sendInsertWorkstationMessage(WorkstationCreateMessageDTO dto) { |
| | | this.rocketMQTemplate.syncSend(WorkstationConstant.WORKSTATION_CREATE_TOPIC, MessageBuilder.withPayload(dto).build()); |
| | | public void sendInsertWorkstationMessage(Long workstationId) { |
| | | //this.rocketMQTemplate.syncSend(WorkstationConstant.WORKSTATION_CREATE_TOPIC, MessageBuilder.withPayload(dto).build()); |
| | | |
| | | mqttMsgSender.sendMessage(WorkstationConstant.WORKSTATION_CREATE_TOPIC, String.valueOf(workstationId)); |
| | | } |
| | | } |
| | |
| | | |
| | | BladeFile exportWorkstation(String keyWord, Long groupId, HttpServletResponse response); |
| | | |
| | | /** |
| | | * è·åå·¥ä½å®æ¶ç¶ææ°æ®ï¼å®æ¶çæ¿ä½¿ç¨ |
| | | * @param dto |
| | | * @param query |
| | | * @return |
| | | */ |
| | | IPage<WorkstationRealTimeStatusVO> getRealTimeStatus(WorkstationRealTimeStatusDTO dto, Query query); |
| | | |
| | | List<RealTimeStatusVO> getRealTimeProperties(Long workstationId, Long machineId); |
| | |
| | | } |
| | | |
| | | private void validMobile(EmployeeSubmitVO employeeSubmitVO, Boolean isUpdate, Boolean isMobile) { |
| | | SFunction<Employee, String> column = isMobile.booleanValue() ? (v0) -> { |
| | | return v0.getTel(); |
| | | } : (v0) -> { |
| | | return v0.getEmail(); |
| | | }; |
| | | SFunction<Employee, String> column = isMobile ?Employee::getTel : Employee:: getEmail; |
| | | String conditionValue = isMobile.booleanValue() ? employeeSubmitVO.getTel() : employeeSubmitVO.getEmail(); |
| | | |
| | | LambdaQueryWrapper<Employee> wrapper = Wrappers.<Employee>lambdaQuery().eq(column, conditionValue).ne(isUpdate.booleanValue(), Employee::getId, employeeSubmitVO.getId()); |
| | |
| | | |
| | | import org.apache.commons.collections.MapUtils; |
| | | import org.jetbrains.annotations.NotNull; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | import com.qianwen.smartman.common.enums.DictEnum; |
| | | import com.qianwen.smartman.common.enums.StatusType; |
| | | import com.qianwen.smartman.common.enums.WcsDataTypeEnums; |
| | | import com.qianwen.smartman.common.mqtt.MqttMessageSender; |
| | | import com.qianwen.smartman.common.utils.Lambda; |
| | | import com.qianwen.smartman.common.utils.LocalDateTimeUtils; |
| | | import com.qianwen.smartman.common.utils.MessageUtils; |
| | |
| | | private final IWorkstationWorkbenchService workbenchService; |
| | | private final IDncWsRelationTdService wsRelationTdService; |
| | | private final IDncFixedSpaceService dncFixedSpaceService; |
| | | private final InsertWorkstationProducer workstationProducer; |
| | | @Autowired |
| | | private InsertWorkstationProducer workstationProducer; |
| | | |
| | | private final IWorkstationDynamicCollectService dynamicCollectService; |
| | | private final String NAME = "é»è®¤å·¥ä½å°"; |
| | | private final Integer SORT = 1; |
| | |
| | | private final String ALL_WORKSTATION_GROUP = CommonGroupConstant.ALL_NAME; |
| | | private final Integer FTP_CORRELATION_DIRECTORY = 1; |
| | | private final Integer FTP_SAME_DIRECTORY = 2; |
| | | @Autowired |
| | | private MqttMessageSender mqttMsgSender; |
| | | |
| | | |
| | | public WorkstationServiceImpl(final IMachineService machineService, final IWorkstationOfMachineService workstationOfMachineService, final IWorkstationWcsService workstationWcsService, final ICommonGroupOfItemService commonGroupOfItemService, final ICommonGroupService commonGroupService, final ICalendarService calendarService, final WorkstationMapper workstationMapper, final OssBuilder ossBuilder, final IDmpVariablesService dmpVariablesService, final ITransferDirectoryService transferDirectoryService, final ITransferDirectoryGroupService transferDirectoryGroupService, final IWorkstationWorkbenchService workbenchService, final IDncWsRelationTdService wsRelationTdService, final IDncFixedSpaceService dncFixedSpaceService, final InsertWorkstationProducer workstationProducer, final IWorkstationDynamicCollectService dynamicCollectService) { |
| | | public WorkstationServiceImpl(final IMachineService machineService, final IWorkstationOfMachineService workstationOfMachineService, final IWorkstationWcsService workstationWcsService, final ICommonGroupOfItemService commonGroupOfItemService, final ICommonGroupService commonGroupService, final ICalendarService calendarService, final WorkstationMapper workstationMapper, final OssBuilder ossBuilder, final IDmpVariablesService dmpVariablesService, final ITransferDirectoryService transferDirectoryService, final ITransferDirectoryGroupService transferDirectoryGroupService, final IWorkstationWorkbenchService workbenchService, final IDncWsRelationTdService wsRelationTdService, final IDncFixedSpaceService dncFixedSpaceService,final IWorkstationDynamicCollectService dynamicCollectService) { |
| | | this.machineService = machineService; |
| | | this.workstationOfMachineService = workstationOfMachineService; |
| | | this.workstationWcsService = workstationWcsService; |
| | |
| | | this.workbenchService = workbenchService; |
| | | this.wsRelationTdService = wsRelationTdService; |
| | | this.dncFixedSpaceService = dncFixedSpaceService; |
| | | this.workstationProducer = workstationProducer; |
| | | //this.workstationProducer = workstationProducer; |
| | | this.dynamicCollectService = dynamicCollectService; |
| | | } |
| | | |
| | |
| | | CacheUtil.clear(redisKey, Boolean.FALSE); |
| | | WorkstationVO workstationVO = WorkstationConvert.INSTANCE.convertSaveVO(workstationSubmitVO); |
| | | workstationVO.setId(workstation.getId()); |
| | | if (Func.isNull(workstationSubmitVO.getId())) { |
| | | WorkstationCreateMessageDTO dto = WorkstationCreateMessageDTO.builder().workstationId(workstation.getId().toString()).operationTime(DateUtil.now()).build(); |
| | | this.workstationProducer.sendInsertWorkstationMessage(dto); |
| | | |
| | | if (Func.isNull(workstationSubmitVO.getId())) {//æ°å¢å·¥ä½ï¼åéæ¶æ¯ï¼poståºç¨æåºå®ç¹ |
| | | //WorkstationCreateMessageDTO dto = WorkstationCreateMessageDTO.builder().workstationId(workstation.getId().toString()).operationTime(DateUtil.now()).build(); |
| | | //this.workstationProducer.sendInsertWorkstationMessage(dto); |
| | | workstationProducer.sendInsertWorkstationMessage(workstation.getId()); |
| | | |
| | | } |
| | | return workstationVO; |
| | | } |
| | |
| | | } |
| | | |
| | | public List<CommonGroup> getCommonGroupIds(List<String> idList, List<CommonGroup> list) { |
| | | /* |
| | | List<CommonGroup> commonGroupList = this.commonGroupService.list(Lambda.in((v0) -> { |
| | | return v0.getParentId(); |
| | | }, idList)); |
| | | }, idList));*/ |
| | | List<CommonGroup> commonGroupList = this.commonGroupService.list(Lambda.<CommonGroup>in(CommonGroup::getParentId, idList)); |
| | | if (Func.isEmpty(commonGroupList)) { |
| | | return list; |
| | | } |
| | |
| | | @Value("${oss.secret-key}") |
| | | @ApiModelProperty("secret-key") |
| | | private String secretKey; |
| | | @Value("${spring.datasource.dynamic.datasource.tdengine.url}") |
| | | @ApiModelProperty("tdengineé
ç½®") |
| | | private String tdengineUrl; |
| | | // @Value("${spring.datasource.dynamic.datasource.tdengine.url}") |
| | | //@ApiModelProperty("tdengineé
ç½®") |
| | | //private String tdengineUrl; |
| | | @Value("${spring.datasource.dynamic.datasource.master.url}") |
| | | @ApiModelProperty("æ°æ®åºé
ç½®") |
| | | private String mysqlUrl; |
| | |
| | | return this; |
| | | } |
| | | |
| | | public ConfigVO build() { |
| | | return new ConfigVO(this.ossUrl, this.accessKey, this.secretKey, this.tdengineUrl, this.mysqlUrl, this.driverClassName, this.database, this.type, this.url); |
| | | public ConfigVO build() {// this.tdengineUrl, |
| | | return new ConfigVO(this.ossUrl, this.accessKey, this.secretKey,this.mysqlUrl, this.driverClassName, this.database, this.type, this.url); |
| | | } |
| | | |
| | | public String toString() { |
| | |
| | | public void setSecretKey(final String secretKey) { |
| | | this.secretKey = secretKey; |
| | | } |
| | | |
| | | /* |
| | | public void setTdengineUrl(final String tdengineUrl) { |
| | | this.tdengineUrl = tdengineUrl; |
| | | } |
| | | |
| | | */ |
| | | public void setMysqlUrl(final String mysqlUrl) { |
| | | this.mysqlUrl = mysqlUrl; |
| | | } |
| | |
| | | } else if (!this$secretKey.equals(other$secretKey)) { |
| | | return false; |
| | | } |
| | | /* |
| | | Object this$tdengineUrl = getTdengineUrl(); |
| | | Object other$tdengineUrl = other.getTdengineUrl(); |
| | | if (this$tdengineUrl == null) { |
| | |
| | | } |
| | | } else if (!this$tdengineUrl.equals(other$tdengineUrl)) { |
| | | return false; |
| | | } |
| | | }*/ |
| | | Object this$mysqlUrl = getMysqlUrl(); |
| | | Object other$mysqlUrl = other.getMysqlUrl(); |
| | | if (this$mysqlUrl == null) { |
| | |
| | | int result2 = (result * 59) + ($accessKey == null ? 43 : $accessKey.hashCode()); |
| | | Object $secretKey = getSecretKey(); |
| | | int result3 = (result2 * 59) + ($secretKey == null ? 43 : $secretKey.hashCode()); |
| | | /* |
| | | Object $tdengineUrl = getTdengineUrl(); |
| | | int result4 = (result3 * 59) + ($tdengineUrl == null ? 43 : $tdengineUrl.hashCode()); |
| | | */ |
| | | Object $mysqlUrl = getMysqlUrl(); |
| | | int result5 = (result4 * 59) + ($mysqlUrl == null ? 43 : $mysqlUrl.hashCode()); |
| | | //int result5 = (result4 * 59) + ($mysqlUrl == null ? 43 : $mysqlUrl.hashCode()); |
| | | int result5 = ($mysqlUrl == null ? 43 : $mysqlUrl.hashCode()); |
| | | Object $driverClassName = getDriverClassName(); |
| | | int result6 = (result5 * 59) + ($driverClassName == null ? 43 : $driverClassName.hashCode()); |
| | | Object $database = getDatabase(); |
| | |
| | | return (result8 * 59) + ($url == null ? 43 : $url.hashCode()); |
| | | } |
| | | |
| | | public String toString() { |
| | | return "ConfigVO(ossUrl=" + getOssUrl() + ", accessKey=" + getAccessKey() + ", secretKey=" + getSecretKey() + ", tdengineUrl=" + getTdengineUrl() + ", mysqlUrl=" + getMysqlUrl() + ", driverClassName=" + getDriverClassName() + ", database=" + getDatabase() + ", type=" + getType() + ", url=" + getUrl() + ")"; |
| | | public String toString() {//+ ", tdengineUrl=" + getTdengineUrl() |
| | | return "ConfigVO(ossUrl=" + getOssUrl() + ", accessKey=" + getAccessKey() + ", secretKey=" + getSecretKey() + ", mysqlUrl=" + getMysqlUrl() + ", driverClassName=" + getDriverClassName() + ", database=" + getDatabase() + ", type=" + getType() + ", url=" + getUrl() + ")"; |
| | | } |
| | | |
| | | public static ConfigVOBuilder builder() { |
| | |
| | | |
| | | public ConfigVO() { |
| | | } |
| | | |
| | | public ConfigVO(final String ossUrl, final String accessKey, final String secretKey, final String tdengineUrl, final String mysqlUrl, final String driverClassName, final String database, final String type, final String url) { |
| | | // final String tdengineUrl, |
| | | public ConfigVO(final String ossUrl, final String accessKey, final String secretKey, final String mysqlUrl, final String driverClassName, final String database, final String type, final String url) { |
| | | this.ossUrl = ossUrl; |
| | | this.accessKey = accessKey; |
| | | this.secretKey = secretKey; |
| | | this.tdengineUrl = tdengineUrl; |
| | | //this.tdengineUrl = tdengineUrl; |
| | | this.mysqlUrl = mysqlUrl; |
| | | this.driverClassName = driverClassName; |
| | | this.database = database; |
| | |
| | | public String getSecretKey() { |
| | | return this.secretKey; |
| | | } |
| | | |
| | | /* |
| | | public String getTdengineUrl() { |
| | | return this.tdengineUrl; |
| | | } |
| | | }*/ |
| | | |
| | | public String getMysqlUrl() { |
| | | return this.mysqlUrl; |
| | |
| | | return R.data(WorkstationFeedbackWrapper.build().entityVO(feedback)); |
| | | } |
| | | |
| | | /** |
| | | * ç¶æåé¦çé¢å页æ¥è¯¢ |
| | | * @param query |
| | | * @param queryDTO |
| | | * @return |
| | | */ |
| | | @PostMapping({"/page"}) |
| | | @ApiOperationSupport |
| | | @ApiOperation("å·¥ä½åé¦å页å表æ¥è¯¢") |
| | | public R<IPage<WorkstationFeedBackDetailVO>> page(Query query, @RequestBody WorkstationFeedBackQueryDTO queryDTO) { |
| | | IPage<WorkstationFeedbackDetail> page = this.detailService.page(Condition.getPage(query), |
| | | |
| | | Lambda.eq(WorkstationFeedbackDetail::getStatus, Integer.valueOf(FeedbackDetailStatus.EFFECTED.getValue())) |
| | | Lambda.eq(WorkstationFeedbackDetail::getStatus, FeedbackDetailStatus.EFFECTED.getValue()) |
| | | .eq(WorkstationFeedbackDetail::getCancel, Boolean.FALSE) |
| | | .in(Func.isNotEmpty(queryDTO.getWorkstationGroupId()), WorkstationFeedbackDetail::getWorkstationId, this.workstationService |
| | | .getWorkstationByGroupIds(ListUtil.toList(new String[] { queryDTO.getWorkstationGroupId() })).stream().map(WorkstationVO::getId).collect(Collectors.toList())) |
| | |
| | | return R.data(page); |
| | | } |
| | | |
| | | /** |
| | | * åºè¯¥æ¯ç´æ¥å½å
¥ä¸ä¸ªç¶æï¼ä¸å½å
¥èµ·æ¢æ¶é´ï¼ï¼èµ·å§æ¶é´ä¸ºå½åæ¶é´ï¼å¦ææç°åç峿¶ç¶æï¼åç´æ¥æ´æ°å
¶ç»ææ¶é´ä¸ºå½åæ¶é´ |
| | | * @param immediateFeedBackDTO |
| | | * @return |
| | | */ |
| | | @PostMapping({"/start-feedback-by-immediate"}) |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "H5: ç¶æå³æ¶åé¦ç»è®°", notes = "å·¥ä½å³æ¶åé¦, è¿è¡ä¸çåé¦") |
| | |
| | | return R.status(this.wcsFeedbackService.startFeedbackByImmediate(immediateFeedBackDTO)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿å人工åé¦çç¶æï¼ç¶æè®°å½çé¢ï¼ |
| | | * @param noImmediateFeedBackDTO |
| | | * @return |
| | | */ |
| | | @PostMapping({"/start-feedback-by-no-immediate"}) |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "H5: æ¶é´æ®µåé¦", notes = "æ¶é´æ®µåé¦") |
| | |
| | | return R.status(this.wcsFeedbackService.startFeedbackByNoImmediate(noImmediateFeedBackDTO)); |
| | | } |
| | | |
| | | /** |
| | | * ç¶ææäº¤åæ£æ¥ |
| | | * @param noImmediateFeedBackDTO |
| | | * @return |
| | | */ |
| | | @PostMapping({"/overwrite-feedback-check"}) |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "æ¥è¯¢æ¯å¦æè¦ççåé¦", notes = "data true: ä¼è¦çåé¦,æç¤º false: ä¸ä¼è¦çåé¦,ä¸æç¤ºç´æ¥æäº¤") |
| | | public R<Boolean> overwriteFeedback(@Validated @RequestBody WorkstationNoImmediateFeedBackDTO noImmediateFeedBackDTO) { |
| | | return R.data(Boolean.valueOf(this.detailService.overwriteFeedbackCheck(noImmediateFeedBackDTO))); |
| | | return R.data(this.detailService.overwriteFeedbackCheck(noImmediateFeedBackDTO)); |
| | | } |
| | | |
| | | @ApiOperationSupport(order = RegionCache.VILLAGE_LEVEL) |
| | |
| | | private String n; |
| | | private String v; |
| | | private Long workstationId; |
| | | |
| | | private String device; |
| | | |
| | | public static class WorkstationCollectDataBuilder { |
| | | public String getDevice() { |
| | | return device; |
| | | } |
| | | |
| | | public void setDevice(String device) { |
| | | this.device = device; |
| | | } |
| | | |
| | | public static class WorkstationCollectDataBuilder { |
| | | private Long ts; |
| | | private String n; |
| | | private String v; |
| | |
| | | } |
| | | |
| | | public String toString() { |
| | | return "WorkstationCollectData.WorkstationCollectDataBuilder(ts=" + this.ts + ", n=" + this.n + ", v=" + this.v + ", workstationId=" + this.workstationId + ")"; |
| | | return "WorkstationCollectData.WorkstationCollectDataBuilder(tsd=" + this.ts + ", n=" + this.n + ", v=" + this.v + ", workstationId=" + this.workstationId + ")"; |
| | | } |
| | | } |
| | | |
| | |
| | | @DS("iotdb") |
| | | @InterceptorIgnore(tenantLine = FmsConstant.AUTOMATIC) |
| | | public interface SuperProcessParameterMapper { |
| | | @Deprecated |
| | | List<WorkstationCollectData> queryLastParameter(@Param("workstationId") String workstationId); |
| | | //è¿ä¸ªå¨ProcessParameterServiceä¸å®ç°äºï¼mpå¯¹æ¤æbug |
| | | //List<WorkstationCollectData> queryLastParameter(@Param("workstationId") String workstationId); |
| | | /** |
| | | * æ¥è¯¢å·¥ä½ææ°åæ° |
| | | * æ¥è¯¢å·¥ä½ææ°åæ°ï¼yyså¢å ï¼å¯è½éè¦ä½¿ç¨queryLastParameteräºï¼å¦ææ²¡é®é¢ï¼ |
| | | * @param workstationId |
| | | * @return |
| | | */ |
| | | LastProcessParam getLastParameters(@Param("workstationId") String workstationId); |
| | | //LastProcessParam getLastParameters(@Param("workstationId") String workstationId); |
| | | |
| | | List<ProcessParameterVO> queryProcessParameter(@Param("workstationId") String workstationId, @Param("collectItems") List<String> collectItems, @Param("startTime") Long startTime, @Param("endTime") Long endTime); |
| | | |
| | |
| | | * @param workstationId å·¥ä½id |
| | | * @return åæ°å¼å表ï¼n,vï¼ |
| | | */ |
| | | List<WorkstationCollectData> lastParameter(long workstationId); |
| | | //List<WorkstationCollectData> lastParameter(long workstationId); |
| | | |
| | | /** |
| | | * æ¥è¯¢å·¥ä½ææ°åæ°éåï¼iotdb使ç¨mybatisæ¥è¯¢æé®é¢ï¼èªå·±å®ç°ï¼ |
| | | * @param workstationId |
| | | * @return |
| | | */ |
| | | List<WorkstationCollectData> queryLastParameter(long workstationId); |
| | | } |
| | |
| | | @Cacheable(cacheNames = {ExtCacheConstant.WORK_FEEDBACK_DETAIL}, key = "'list:cancel:workstationId:'.concat(#workstationId).concat(':').concat(#queryDate.toString())") |
| | | List<WorkstationFeedbackDetail> cancelFeedback(final LocalDate queryDate, final Long workstationId); |
| | | |
| | | /** |
| | | * æ¹éæ¤éåé¦ |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | boolean cancelWorkstationFeedbacks(final List<String> ids); |
| | | |
| | | WorkstationFeedbackDetail latestFeedbackByWorkstationId(final Long workstationId); |
| | |
| | | import org.springframework.cache.annotation.Caching; |
| | | |
| | | public interface IWorkstationFeedbackService extends IService<WorkstationFeedback> { |
| | | /** |
| | | * ä¸å¤©ç¼å blade:feedback#86400 |
| | | */ |
| | | public static final String WORK_FEEDBACK_EXP = "blade:feedback#86400"; |
| | | |
| | | /** |
| | | * 3天ç¼å blade:feedback#259200 |
| | | */ |
| | | public static final String WORK_FEEDBACK_EXP3 = "blade:feedback#259200"; |
| | | |
| | | IPage<WorkstationFeedbackInfoVO> workstationPage(Query query, boolean excludeImmediate); |
| | |
| | | import cn.hutool.core.lang.Tuple; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.google.common.collect.Lists; |
| | | import com.google.common.collect.Maps; |
| | | import com.google.common.collect.Sets; |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.sql.Timestamp; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | |
| | | import com.qianwen.smartman.modules.mdc.vo.WorkstationShiftSearchVO; |
| | | import com.qianwen.smartman.modules.mdc.vo.excel.ProcessParamExcelVO; |
| | | import com.qianwen.smartman.modules.resource.builder.oss.OssBuilder; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.jdbc.core.JdbcTemplate; |
| | | import org.springframework.jdbc.core.RowMapper; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | @Service |
| | | public class ProcessParameterServiceImpl implements IProcessParameterService { |
| | | private static final Logger log = LoggerFactory.getLogger(ProcessParameterServiceImpl.class); |
| | | private final SuperCollectJsonMapper collectJsonMapper; |
| | | private final IWorkstationService workstationService; |
| | | private final OssBuilder ossBuilder; |
| | | private final SuperProcessParameterMapper parameterMapper; |
| | | private final ICalendarService calendarService; |
| | | |
| | | @Autowired |
| | | private SuperCollectJsonMapper collectJsonMapper; |
| | | @Autowired |
| | | private IWorkstationService workstationService; |
| | | @Autowired |
| | | private OssBuilder ossBuilder; |
| | | @Autowired |
| | | private SuperProcessParameterMapper parameterMapper; |
| | | @Autowired |
| | | private ICalendarService calendarService; |
| | | @Autowired |
| | | private JdbcTemplate jdbcTemplate; |
| | | /* |
| | | public ProcessParameterServiceImpl(final SuperCollectJsonMapper collectJsonMapper, final IWorkstationService workstationService, final OssBuilder ossBuilder, final SuperProcessParameterMapper parameterMapper, final ICalendarService calendarService) { |
| | | this.collectJsonMapper = collectJsonMapper; |
| | | this.workstationService = workstationService; |
| | | this.ossBuilder = ossBuilder; |
| | | this.parameterMapper = parameterMapper; |
| | | this.calendarService = calendarService; |
| | | } |
| | | }*/ |
| | | |
| | | @Override |
| | | public ProcessParameterResVO queryProcessParameterChart(ProcessParameterSearchVO vo) { |
| | |
| | | return vos; |
| | | } |
| | | |
| | | /* |
| | | @Override |
| | | public List<WorkstationCollectData> lastParameter(long workstationId) { |
| | | //yys |
| | |
| | | }); |
| | | |
| | | return result; |
| | | } |
| | | }*/ |
| | | |
| | | /** |
| | | * è·å工使æ°åæ°å¼ |
| | |
| | | |
| | | return vo; |
| | | } |
| | | |
| | | @DS("iotdb") |
| | | @Override |
| | | public List<WorkstationCollectData> queryLastParameter(long workstationId) { |
| | | String sql ="select max_time(n) as ts,last_value(n) as n,last_value(v) as v,last_value(workstation_id) as workstationId from root.f2.process_param_"+workstationId+"_* align by device"; |
| | | List<WorkstationCollectData> list = jdbcTemplate.query(sql, new RowMapper<WorkstationCollectData>() { |
| | | |
| | | @Override |
| | | public WorkstationCollectData mapRow(ResultSet rs, int rowNum) throws SQLException { |
| | | WorkstationCollectData data = WorkstationCollectData.builder().ts(rs.getLong("ts")).n(rs.getString("n")).v(rs.getString("v")).workstationId(workstationId).build(); |
| | | |
| | | return data; |
| | | } |
| | | |
| | | }); |
| | | return list; |
| | | } |
| | | } |
| | |
| | | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | import com.qianwen.smartman.modules.mdc.entity.WorkstationCollectData; |
| | | import com.qianwen.smartman.modules.mdc.mapper.SuperAggregateStateMapper; |
| | | import com.qianwen.smartman.modules.mdc.mapper.SuperAlarmMapper; |
| | | import com.qianwen.smartman.modules.mdc.mapper.SuperProcessParameterMapper; |
| | | import com.qianwen.smartman.modules.mdc.service.IProcessParameterService; |
| | | import com.qianwen.smartman.modules.mdc.service.IWorkstationAnalysisService; |
| | | import com.qianwen.smartman.modules.mdc.vo.AlarmAnalysisWorkstationVO; |
| | |
| | | public class WorkstationAnalysisServiceImpl implements IWorkstationAnalysisService { |
| | | private static final Logger log = LoggerFactory.getLogger(WorkstationAnalysisServiceImpl.class); |
| | | public static final String STATUS = "STATUS"; |
| | | private final SuperAggregateStateMapper superAggregateStateMapper; |
| | | private final SuperAlarmMapper superAlarmMapper; |
| | | private final IGlobalWcsService globalWcsService; |
| | | private final WorkstationMapper workstationMapper; |
| | | private final SuperProcessParameterMapper superProcessParameterMapper; |
| | | private final IWorkstationService workstationService; |
| | | |
| | | @Autowired |
| | | private SuperAggregateStateMapper superAggregateStateMapper; |
| | | @Autowired |
| | | private SuperAlarmMapper superAlarmMapper; |
| | | @Autowired |
| | | private IGlobalWcsService globalWcsService; |
| | | @Autowired |
| | | private WorkstationMapper workstationMapper; |
| | | //private final SuperProcessParameterMapper superProcessParameterMapper; |
| | | @Autowired |
| | | private IWorkstationService workstationService; |
| | | @Autowired |
| | | private IProcessParameterService processParameterService; |
| | | |
| | | /* |
| | | public WorkstationAnalysisServiceImpl(final SuperAggregateStateMapper superAggregateStateMapper, final SuperAlarmMapper superAlarmMapper, final IGlobalWcsService globalWcsService, final WorkstationMapper workstationMapper, final SuperProcessParameterMapper superProcessParameterMapper, final IWorkstationService workstationService,IProcessParameterService aProcessParameterService) { |
| | | this.superAggregateStateMapper = superAggregateStateMapper; |
| | | this.superAlarmMapper = superAlarmMapper; |
| | |
| | | this.superProcessParameterMapper = superProcessParameterMapper; |
| | | this.workstationService = workstationService; |
| | | this.processParameterService = aProcessParameterService; |
| | | } |
| | | }*/ |
| | | |
| | | @Override |
| | | public List<StatusAnalysisWorkstationVO> statusByWorkstation(String workstationId) { |
| | |
| | | //this error |
| | | //List<WorkstationCollectData> workstationCollectData = this.superProcessParameterMapper.queryLastParameter(wId);//è¯¥å·¥ä½ææ°çlast(ts),last(v) |
| | | |
| | | List<WorkstationCollectData> workstationCollectData = processParameterService.lastParameter(Long.parseLong(wId)); |
| | | List<WorkstationCollectData> workstationCollectData = processParameterService.queryLastParameter(Long.parseLong(wId)); |
| | | if (Func.isNotEmpty(workstationCollectData)) { |
| | | //resultMapping ,key:n ï¼valueï¼TelemetryDataResponseDTO{last(ts),last(v)} |
| | | Map<String, Object> resultMapping = workstationCollectData.stream().collect(Collectors.toMap((v0) -> { |
| | |
| | | @Override |
| | | public WorkstationFeedback getImmediateFeedback(Serializable workstationId) { |
| | | return getOne(Lambda.eq(WorkstationFeedback::getWorkstationId, workstationId) |
| | | .eq(WorkstationFeedback::getFeedbackType, Integer.valueOf(FeedbackType.IMMEDIATE.getValue())) |
| | | .eq(WorkstationFeedback::getFeedbackType, FeedbackType.IMMEDIATE.getValue()) |
| | | .isNull(WorkstationFeedback::getEndTime)); |
| | | /* |
| | | return (WorkstationFeedback) getOne((Wrapper) ((ExtraLambdaQueryWrapper) Lambda.eq((v0) -> { |
| | |
| | | } else { |
| | | addFeedback.setFeedUser(getEmployeeById().getId()); |
| | | } |
| | | addFeedback.setFeedbackType(Integer.valueOf(FeedbackType.IMMEDIATE.getValue())); |
| | | addFeedback.setFeedbackType(FeedbackType.IMMEDIATE.getValue()); |
| | | addFeedback.setStatus(FeedbackStatus.WAIT_SYNC.getValue()); |
| | | addFeedback.setRemark(dto.getDescription()); |
| | | addFeedback.setWcs(dto.getWcs()); |
| | |
| | | this.redisLockClient.lockFair(ExtCacheConstant.WORK_FEEDBACK.concat(":").concat(workstationId), 30L, 100L, () -> { |
| | | existTimeOverImmediateFeedbackException(dto); |
| | | WorkstationFeedback addFeedback = new WorkstationFeedback(); |
| | | addFeedback.setWorkstationId(Long.valueOf(Long.parseLong(workstationId))); |
| | | addFeedback.setWorkstationId(Long.parseLong(workstationId)); |
| | | addFeedback.setStartTime(dto.getStartTime()); |
| | | addFeedback.setEndTime(dto.getEndTime()); |
| | | addFeedback.setFeedbackTime(new Date()); |
| | | if (Func.isNotEmpty(dto.getFeedUser())) { |
| | | addFeedback.setFeedUser(Long.valueOf(Long.parseLong(dto.getFeedUser()))); |
| | | addFeedback.setEndFeedUser(Long.valueOf(Long.parseLong(dto.getFeedUser()))); |
| | | addFeedback.setFeedUser(Long.parseLong(dto.getFeedUser())); |
| | | addFeedback.setEndFeedUser(Long.parseLong(dto.getFeedUser())); |
| | | } else { |
| | | addFeedback.setFeedUser(getEmployeeById().getId()); |
| | | addFeedback.setEndFeedUser(getEmployeeById().getId()); |
| | | } |
| | | addFeedback.setFeedbackType(Integer.valueOf(FeedbackType.TIME_RANGE.getValue())); |
| | | addFeedback.setFeedbackType(FeedbackType.TIME_RANGE.getValue()); |
| | | addFeedback.setStatus(FeedbackStatus.WAIT_SYNC.getValue()); |
| | | addFeedback.setRemark(dto.getDescription()); |
| | | addFeedback.setWcs(dto.getWcs()); |
| | | return Boolean.valueOf(save(addFeedback)); |
| | | return save(addFeedback);//ä¿åå°mysql |
| | | }); |
| | | } |
| | | evictFeedback(dto.getStartTime(), dto.getEndTime(), dto.getWorkstationIds()); |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * æ¹éæ¸
é¤ åé¦ |
| | | * @param startTime |
| | | * @param endTime |
| | | * @param workstationIds |
| | | */ |
| | | private void evictFeedback(final Date startTime, final Date endTime, List<String> workstationIds) { |
| | | LocalDate start = startTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); |
| | | LocalDate end = endTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); |
| | |
| | | }); |
| | | } |
| | | |
| | | private void evictFeedback(final LocalDate start, final LocalDate end, final Serializable workstationId) { |
| | | long distance = ChronoUnit.DAYS.between(start, end); |
| | | /** |
| | | * å个æ¸
æ¥ç¼åä¸çåé¦ï¼ä»catcheName=WORK_FEEDBACK_EXP3ç¼åä¸å é¤ å®é
key为 group:feedback:list:blade:feedback#259200${workstationId}:yyyy-MM-dd HH:mm:ss |
| | | * @param start |
| | | * @param end |
| | | * @param workstationId |
| | | */ |
| | | private void evictFeedback(final LocalDate start, final LocalDate end, final String workstationId) { |
| | | long distance = ChronoUnit.DAYS.between(start, end);//ä¸å
±limitå 天ï¼å°±æ¯åå 个æ°ï¼ |
| | | Stream.iterate(start, d -> { |
| | | return d.plusDays(1L); |
| | | }).limit(distance + 1).forEach(date -> { |
| | | String key = String.valueOf(workstationId).concat(":").concat(Func.formatDate(date)); |
| | | String key = workstationId.concat(":").concat(Func.formatDate(date)); |
| | | CacheUtil.evict(IWorkstationFeedbackService.WORK_FEEDBACK_EXP3, GROUP_FEEDBACK_CACHE_KEY, key, false); |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * æ£æ¥æ¯å¦ææ£å¨è¿è¡ä¸çç¶æåé¦ |
| | | * @param dto |
| | | */ |
| | | private void existTimeOverImmediateFeedbackException(WorkstationNoImmediateFeedBackDTO dto) { |
| | | if (dto.getWorkstationIds().stream().map(this.selfService::getImmediateFeedback).filter(Objects::nonNull).anyMatch(feedback -> |
| | | (dto.getStartTime().getTime() >= feedback.getStartTime().getTime() || dto.getEndTime().getTime() >= feedback.getStartTime().getTime()))) |
| | |
| | | this.maintainProjectService = maintainProjectService; |
| | | } |
| | | |
| | | @XxlJob("maintain-overdueJobHandler") |
| | | @XxlJob("maintain-overdueJobHandler")//ç»´æ¤ä»»å¡éç¥ï¼ï¼ |
| | | public ReturnT<String> maintainOverdueJobHandler(String param) { |
| | | XxlJobLogger.log("宿¶åéå¼å§ï¼:{}", new Object[]{param}); |
| | | LocalDateTime now = LocalDateTime.now(); |
| | |
| | | import com.qianwen.smartman.modules.sync.entity.OuterAppConfig; |
| | | import com.qianwen.smartman.modules.sync.service.IDingSyncService; |
| | | import com.qianwen.smartman.modules.sync.service.IOuterAppConfigService; |
| | | import com.qianwen.smartman.modules.sync.service.IWechatSyncService; |
| | | //import com.qianwen.smartman.modules.sync.service.IWechatSyncService; |
| | | import com.qianwen.smartman.modules.sync.vo.OuterAppConfigVO; |
| | | import com.qianwen.smartman.modules.sync.vo.OuterAppStatusVO; |
| | | import com.qianwen.smartman.modules.sync.vo.SyncResultVO; |
| | |
| | | @RestController |
| | | public class OuterAppConfigController extends BladeController { |
| | | private IOuterAppConfigService outerAppConfigService; |
| | | private final IWechatSyncService wechatSyncService; |
| | | //private final IWechatSyncService wechatSyncService; |
| | | private final IDingSyncService dingSyncService; |
| | | |
| | | public OuterAppConfigController(final IOuterAppConfigService outerAppConfigService, final IWechatSyncService wechatSyncService, final IDingSyncService dingSyncService) { |
| | | //, final IWechatSyncService wechatSyncService, |
| | | public OuterAppConfigController(final IOuterAppConfigService outerAppConfigService, final IDingSyncService dingSyncService) { |
| | | this.outerAppConfigService = outerAppConfigService; |
| | | this.wechatSyncService = wechatSyncService; |
| | | // this.wechatSyncService = wechatSyncService; |
| | | this.dingSyncService = dingSyncService; |
| | | } |
| | | |
| | |
| | | public R<SyncResultVO> submit(@Valid @RequestBody OuterAppConfigVO outerAppConfigVO) { |
| | | this.outerAppConfigService.submit(outerAppConfigVO); |
| | | if (outerAppConfigVO.getAppType().equals(OuterAppConfigConstant.QY_WECHAT)) { |
| | | return R.data(this.wechatSyncService.syncOrganization()); |
| | | //yangys注éæäº |
| | | //return R.data(this.wechatSyncService.syncOrganization()); |
| | | } |
| | | return R.data(this.dingSyncService.syncImmediately()); |
| | | } |
| | |
| | | private final IMetaObjectTypeService metaObjectTypeService; |
| | | private final IMetaObjectTypeFieldService metaObjectTypeFieldService; |
| | | private final CodeHistoryMapper codeHistoryMapper; |
| | | private final ConfigVO configVO; |
| | | //private final ConfigVO configVO; |
| | | |
| | | |
| | | public BasCoderuleServiceImpl(final IBasCoderuleEntryService basCoderuleEntryService, final IMetaObjectTypeService metaObjectTypeService, final IMetaObjectTypeFieldService metaObjectTypeFieldService, final CodeHistoryMapper codeHistoryMapper, final ConfigVO configVO) { |
| | | //public BasCoderuleServiceImpl(final IBasCoderuleEntryService basCoderuleEntryService, final IMetaObjectTypeService metaObjectTypeService, final IMetaObjectTypeFieldService metaObjectTypeFieldService, final CodeHistoryMapper codeHistoryMapper, final ConfigVO configVO) { |
| | | public BasCoderuleServiceImpl(final IBasCoderuleEntryService basCoderuleEntryService, final IMetaObjectTypeService metaObjectTypeService, final IMetaObjectTypeFieldService metaObjectTypeFieldService, final CodeHistoryMapper codeHistoryMapper) { |
| | | this.basCoderuleEntryService = basCoderuleEntryService; |
| | | this.metaObjectTypeService = metaObjectTypeService; |
| | | this.metaObjectTypeFieldService = metaObjectTypeFieldService; |
| | | this.codeHistoryMapper = codeHistoryMapper; |
| | | this.configVO = configVO; |
| | | //this.configVO = configVO; |
| | | } |
| | | |
| | | @Override |
| | |
| | | # rocketmq |
| | | rocketmq-name-server: localhost:9876 |
| | | |
| | | # tdengine |
| | | tdengine: |
| | | driver: com.taosdata.jdbc.TSDBDriver |
| | | url: jdbc:TAOS://localhost:6030/iot_data?charset=UTF-8&locale=en_US.UTF-8&cfgdir=taos.cfg |
| | | username: root |
| | | password: taosdata |
| | | |
| | | iotdb: |
| | | driver: org.apache.iotdb.jdbc.IoTDBDriver |
| | |
| | | maxSize: 10 |
| | | username: root |
| | | password: root |
| | | |
| | | |
| | | mqtt: |
| | | host: tcp://82.156.1.83:1884 |
| | | #username=admin #MQTT-æå¡ç«¯ç¨æ·å |
| | | #password=public #MQTT-æå¡ç«¯å¯ç |
| | | cleansession: false #MQTT-æ¯å¦æ¸
çsession |
| | | #MQTT-å½å客æ·ç«¯çå¯ä¸æ è¯ |
| | | clientid: mqtt_publish |
| | | default_topic: TEST #å½å客æ·ç«¯çé»è®¤ä¸»é¢(大夿°æ¶å没ä»ä¹ç¨) |
| | | #åéè¶
æ¶æ¶é´ |
| | | mqtt.timeout: 1000 |
| | | #å¿è·³æ¶é´ |
| | | keepalive: 10 |
| | | connectionTimeout: 3000 #è¿æ¥è¶
æ¶æ¶é´ |
| | | xxl: |
| | | job: |
| | | admin: |
| | |
| | | username: ${datasource.username} |
| | | password: ${datasource.password} |
| | | driver-class-name: ${datasource.driver-class-name} |
| | | tdengine: |
| | | driver-class-name: ${tdengine.driver} |
| | | url: ${tdengine.url} |
| | | username: ${tdengine.username} |
| | | password: ${tdengine.password} |
| | | iotdb: |
| | | driver-class-name: ${iotdb.driver} |
| | | url: jdbc:iotdb://${iotdb.host}:${iotdb.port}/ |
| | |
| | | feedback_id as feedbackId |
| | | </sql> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <!-- ä¿®æ¹sqlå¼å§ --> |
| | | |
| | | <sql id="aggregateStateColumnSql"> |
| | |
| | | rps, |
| | | is_deleted as isDeleted, |
| | | workstation_id as workstationId, |
| | | is_plan as isPlan |
| | | is_plan as isPlan, |
| | | feedback_id as feedbackId |
| | | </sql> |
| | | |
| | | <!-- ç±äºè¡¨æ°æ®ä¸æ ·ï¼iot_data.super_aggregate_state_with_feedbackï¼ï¼æä»¬ä¹æ²¡æåé¦ï¼æä»¥ææ¶é½æ¥ä¸ä¸ªè¡¨ --> |
| | | <select id="getStatusData" resultType="com.qianwen.smartman.modules.mdc.entity.SuperAggregateState"> |
| | | select |
| | | <include refid="aggregateStateColumnSql"/> |
| | | from root.f2.aggregate_state_* |
| | | from root.f2.aggregate_state_with_feedback_* |
| | | where is_deleted = false |
| | | and wcs > 0 |
| | | and time <![CDATA[>=]]> #{startDate} and time <![CDATA[<=]]> #{endDate} |
| | |
| | | resultType="com.qianwen.smartman.modules.mdc.entity.SuperAggregateState"> |
| | | select |
| | | <include refid="aggregateStateColumnSql"/> |
| | | from root.f2.aggregate_state_* |
| | | from root.f2.aggregate_state_with_feedback_* |
| | | where factory_date <![CDATA[>=]]> #{startFactoryDate} and factory_date <![CDATA[<=]]> #{endFactoryDate} |
| | | and wcs > 0 and is_deleted = false |
| | | <if test="workstationIds != null and workstationIds.size() > 0"> |
| | |
| | | <mapper namespace="com.qianwen.smartman.modules.mdc.mapper.SuperProcessParameterMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.qianwen.smartman.modules.mdc.entity.WorkstationCollectData"> |
| | | <id column="ts" jdbcType="TIMESTAMP" property="ts"/> |
| | | <result column="n" jdbcType="NVARCHAR" property="n"/> |
| | | <result column="v" jdbcType="NVARCHAR" property="v"/> |
| | | |
| | | |
| | | <id column="ts" jdbcType="BIGINT" property="ts"/> |
| | | |
| | | <result column="n" jdbcType="VARCHAR" property="n"/> |
| | | <result column="v" jdbcType="VARCHAR" property="v"/> |
| | | <result column="workstation_id" jdbcType="BIGINT" property="workstationId"/> |
| | | </resultMap> |
| | | |
| | | <!-- |
| | | <select id="queryLastParameter" resultType="com.qianwen.smartman.modules.mdc.entity.WorkstationCollectData"> |
| | | select last(ts), n, last(v),workstation_id from super_collect_data |
| | | <where> |
| | |
| | | </where> |
| | | group by workstation_id,n |
| | | </select> |
| | | |
| | | --> |
| | | |
| | | |
| | | <select id="queryProcessParameter" resultType="com.qianwen.smartman.modules.mdc.dto.ProcessParameterVO"> |
| | |
| | | --> |
| | | |
| | | <!-- sqlä¿®æ¹å¼å§ --> |
| | | <!-- queryLastParameter è¿ä¸ªæ¯æ ¹æ®åå§sqlæ¹çï¼mpæé®é¢ï¼æ¹å¨serviceä¸å®ç°äº |
| | | <select id="queryLastParameter" resultMap="BaseResultMap"> |
| | | select max_time(n) as ts,last_value(n) as n,last_value(v) as v,last_value(workstation_id) as workstationId from root.f2.process_param_${workstationId}_* align by device |
| | | </select> |
| | | --> |
| | | <!-- |
| | | <select id="getLastParameters" resultType="com.qianwen.smartman.modules.mdc.entity.LastProcessParam"> |
| | | select workstation_id as workstationId,update_time as updateTime, param_json as paramJson from root.f2.last_process_param where workstation_id = #{workstationId} |
| | | </select> |
| | | |
| | | --> |
| | | |
| | | |
| | | <!-- æ ¹æ®oldFirstStatue æ¹é ç--> |