| | |
| | | <artifactId>syslog4j</artifactId> |
| | | <version>0.9.60</version> |
| | | </dependency> |
| | | <!-- WebService --> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-web-services</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.cxf</groupId> |
| | | <artifactId>cxf-spring-boot-starter-jaxws</artifactId> |
| | | <version>${cxf.version}</version> |
| | | </dependency> |
| | | <!-- cxf webservice --> |
| | | <dependency> |
| | | <groupId>org.apache.cxf</groupId> |
| | | <artifactId>cxf-rt-frontend-jaxws</artifactId> |
| | | <version>${cxf.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.cxf</groupId> |
| | | <artifactId>cxf-rt-transports-http</artifactId> |
| | | <version>${cxf.version}</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | </project> |
| | |
| | | filterChainDefinitionMap.put("/sys/checkAuth", "anon"); //æææ¥å£æé¤ |
| | | filterChainDefinitionMap.put("/sys/api/appAuth", "anon"); //ç½é¸è®¤è¯æ¥å£æé¤ |
| | | filterChainDefinitionMap.put("/sys/api/fileUpload", "anon"); //ç½é¸ä¸ä¼ æä»¶æ¥å£æé¤ |
| | | filterChainDefinitionMap.put("/services/**", "anon"); //webserviceæ¥å£æé¤ |
| | | |
| | | |
| | | filterChainDefinitionMap.put("/", "anon"); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.bo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2025/2/20 14:01 |
| | | */ |
| | | @Data |
| | | public class WebResult { |
| | | |
| | | private String flag; |
| | | |
| | | private String msg; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.config; |
| | | |
| | | import org.apache.cxf.Bus; |
| | | import org.apache.cxf.bus.spring.SpringBus; |
| | | import org.apache.cxf.jaxws.EndpointImpl; |
| | | import org.jeecg.modules.mdc.webservice.EquipmentWebService; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import javax.xml.ws.Endpoint; |
| | | |
| | | /** |
| | | * @Author hweiyu |
| | | * @Description |
| | | * @Date 2021/4/21 17:55 |
| | | */ |
| | | @Configuration |
| | | public class WebServiceConfig { |
| | | |
| | | /** |
| | | * Bus交ç±spring管ç |
| | | * @return |
| | | */ |
| | | @Bean(name = Bus.DEFAULT_BUS_ID) |
| | | public SpringBus springBus() { |
| | | return new SpringBus(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æå¡å°åï¼ |
| | | * http://localhost:9999/services |
| | | * http://localhost:9999/services/EquipmentWebService?wsdl |
| | | * @param equipmentWebService |
| | | * @return |
| | | */ |
| | | @Bean |
| | | public Endpoint endpoint(EquipmentWebService equipmentWebService) { |
| | | EndpointImpl endpoint = new EndpointImpl(springBus(), equipmentWebService); |
| | | endpoint.publish("/EquipmentWebService"); |
| | | return endpoint; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecg.common.system.base.entity.JeecgEntity; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("mdc_equipment_day_schedule") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "mdc_equipment_day_schedule对象", description = "è®¾å¤æ¥æäº§è®¡å表") |
| | | public class MdcEquipmentDaySchedule extends JeecgEntity implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 3006667467937651207L; |
| | | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | private String medId; |
| | | /** |
| | | * åå
|
| | | */ |
| | | private String dept; |
| | | /** |
| | | * 车é´ï¼ååï¼ |
| | | */ |
| | | private String workshop; |
| | | /** |
| | | * çæ¬å·ï¼å·¥èºè§ç¨çæ¬¡ï¼ |
| | | */ |
| | | private String revisionNo; |
| | | /** |
| | | * é¶ä»¶åç§° |
| | | */ |
| | | private String mdsItemId; |
| | | /** |
| | | * é¶ä»¶å· |
| | | */ |
| | | private String mdsItemCode; |
| | | /** |
| | | * 订åå· |
| | | */ |
| | | private String taskCode; |
| | | /** |
| | | * æµå¡å· |
| | | */ |
| | | private String ewoNo; |
| | | /** |
| | | * æ¹æ¬¡å· |
| | | */ |
| | | private String batchNo; |
| | | /** |
| | | * æ¹æ¬¡æ°éï¼è®¡åæ°ï¼ |
| | | */ |
| | | private String batchNum; |
| | | /** |
| | | * åæ ¼æ° |
| | | */ |
| | | private Integer qualifiedQty; |
| | | /** |
| | | * æ¥åºæ° |
| | | */ |
| | | private Integer scrapQty; |
| | | /** |
| | | * å·¥åºå· |
| | | */ |
| | | private String opreationSeqNo; |
| | | /** |
| | | * æ´¾å·¥æ¥æ |
| | | */ |
| | | private String dispatchDate; |
| | | /** |
| | | * 设å¤ç¼å· |
| | | */ |
| | | private String equipmentId; |
| | | /** |
| | | * 1 æ£å¸¸ 2 åæ¶ 3 å é¤ |
| | | */ |
| | | private String taskType; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecg.common.system.base.entity.JeecgEntity; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("mdc_equipment_day_summary") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "mdc_equipment_day_summary对象", description = "è®¾å¤æ¥äº§éæ±æ»è¡¨") |
| | | public class MdcEquipmentDaySummary extends JeecgEntity implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 4440281782659062056L; |
| | | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | private String medId; |
| | | /** |
| | | * åå
|
| | | */ |
| | | private String dept; |
| | | /** |
| | | * 车é´ï¼ååï¼ |
| | | */ |
| | | private String workshop; |
| | | /** |
| | | * 设å¤ç¼å· |
| | | */ |
| | | private String equipmentCode; |
| | | /** |
| | | * å½åå¨å¶åéï¼è®¢åè®¡åæ°é-å
¥åºæ°é-æ¥åºæ°éï¼ |
| | | */ |
| | | private Integer demandQty; |
| | | /** |
| | | * 仿¥å®å·¥å
¥åºéï¼å
¥åºæ°éï¼ |
| | | */ |
| | | private Integer qualifiedQty; |
| | | /** |
| | | * 仿¥æäº§éï¼è®¢åæ°éï¼ |
| | | */ |
| | | private Integer planQty; |
| | | /** |
| | | * 仿¥æ¥åºæ°é |
| | | */ |
| | | private Integer scrapQty; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "èåæéç¼ç ") |
| | | private String perms; |
| | | |
| | | /** |
| | | * 设å¤è½¦é´ç®¡çid |
| | | */ |
| | | @ApiModelProperty(value = "设å¤è½¦é´ç®¡çid") |
| | | private String productionId; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.job; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.util.DateUtils; |
| | | import org.jeecg.modules.mdc.service.IEquipmentService; |
| | | import org.jeecg.modules.mdc.util.CxfClientUtil; |
| | | import org.jeecg.modules.mdc.util.ThrowableUtil; |
| | | import org.jeecg.modules.mdc.vo.WsEquipmentStatus; |
| | | import org.jeecg.modules.quartz.entity.QuartzJob; |
| | | import org.jeecg.modules.quartz.entity.SysQuartzLog; |
| | | import org.jeecg.modules.quartz.service.IQuartzJobService; |
| | | import org.jeecg.modules.quartz.service.ISysQuartzLogService; |
| | | import org.quartz.*; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/6/11 11:27 |
| | | */ |
| | | @PersistJobDataAfterExecution |
| | | @DisallowConcurrentExecution |
| | | @Slf4j |
| | | public class WebServiceStatusJob implements Job { |
| | | |
| | | /** |
| | | * url |
| | | */ |
| | | @Value("${webservice.url}") |
| | | private String url; |
| | | |
| | | /** |
| | | * namespace |
| | | */ |
| | | @Value("${webservice.namespace}") |
| | | private String namespace; |
| | | |
| | | /** |
| | | * method |
| | | */ |
| | | @Value("${webservice.statusMethod}") |
| | | private String method; |
| | | |
| | | |
| | | @Resource |
| | | private IQuartzJobService quartzJobService; |
| | | |
| | | @Resource |
| | | private ISysQuartzLogService sysQuartzLogService; |
| | | |
| | | @Resource |
| | | private IEquipmentService equipmentService; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext context) throws JobExecutionException { |
| | | SysQuartzLog quartzLog = new SysQuartzLog(); |
| | | quartzLog.setCreateTime(new Date()); |
| | | List<QuartzJob> byJobClassName = this.quartzJobService.findByJobClassName(this.getClass().getName()); |
| | | if (byJobClassName != null && !byJobClassName.isEmpty()) { |
| | | quartzLog.setJobId(byJobClassName.get(0).getId()); |
| | | } |
| | | log.info("WebService䏿¥è®¾å¤ç¶æä»»å¡ WebServiceStatusJob start! æ¶é´:" + DateUtils.now()); |
| | | long startTime = System.currentTimeMillis(); |
| | | try { |
| | | List<WsEquipmentStatus> equipmentStatusList = equipmentService.selectEquipmentStatus(); |
| | | if (equipmentStatusList != null && !equipmentStatusList.isEmpty()) { |
| | | for (WsEquipmentStatus wsEquipmentStatus : equipmentStatusList) { |
| | | String s = JSONObject.toJSONString(wsEquipmentStatus); |
| | | log.info("䏿¥ç¶ææ°æ® ===== " + s); |
| | | String result = CxfClientUtil.invokeService(url, s, namespace, method); |
| | | log.info("䏿¥ç¶æç»æ ===== " + result); |
| | | } |
| | | } |
| | | quartzLog.setIsSuccess(0); |
| | | } catch (Exception e) { |
| | | quartzLog.setIsSuccess(-1); |
| | | quartzLog.setExceptionDetail(ThrowableUtil.getStackTrace(e)); |
| | | } |
| | | long endTime = System.currentTimeMillis(); |
| | | quartzLog.setExecutionTime(Integer.parseInt(String.valueOf(endTime - startTime))); |
| | | sysQuartzLogService.save(quartzLog); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.job; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.util.DateUtils; |
| | | import org.jeecg.modules.mdc.service.IEquipmentService; |
| | | import org.jeecg.modules.mdc.util.CxfClientUtil; |
| | | import org.jeecg.modules.mdc.util.ThrowableUtil; |
| | | import org.jeecg.modules.mdc.vo.WsEquipmentUtilizationRate; |
| | | import org.jeecg.modules.quartz.entity.QuartzJob; |
| | | import org.jeecg.modules.quartz.entity.SysQuartzLog; |
| | | import org.jeecg.modules.quartz.service.IQuartzJobService; |
| | | import org.jeecg.modules.quartz.service.ISysQuartzLogService; |
| | | import org.quartz.*; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/6/11 16:17 |
| | | */ |
| | | @PersistJobDataAfterExecution |
| | | @DisallowConcurrentExecution |
| | | @Slf4j |
| | | public class WebServiceUtilizationRateJob implements Job { |
| | | |
| | | /** |
| | | * å°å |
| | | */ |
| | | |
| | | @Value("${webservice.url}") |
| | | private String url; |
| | | |
| | | /** |
| | | * namespace |
| | | */ |
| | | @Value("${webservice.namespace}") |
| | | private String namespace; |
| | | |
| | | /** |
| | | * æ¹æ³ |
| | | */ |
| | | @Value("${webservice.rateMethod}") |
| | | private String method; |
| | | @Resource |
| | | private IQuartzJobService quartzJobService; |
| | | |
| | | @Resource |
| | | private ISysQuartzLogService sysQuartzLogService; |
| | | |
| | | @Resource |
| | | private IEquipmentService equipmentService; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext context) throws JobExecutionException { |
| | | SysQuartzLog quartzLog = new SysQuartzLog(); |
| | | quartzLog.setCreateTime(new Date()); |
| | | List<QuartzJob> byJobClassName = this.quartzJobService.findByJobClassName(this.getClass().getName()); |
| | | if (byJobClassName != null && !byJobClassName.isEmpty()) { |
| | | quartzLog.setJobId(byJobClassName.get(0).getId()); |
| | | } |
| | | log.info("WebService䏿¥è®¾å¤å©ç¨çä»»å¡ WebServiceUtilizationRateJob start! æ¶é´:{}", DateUtils.now()); |
| | | long startTime = System.currentTimeMillis(); |
| | | try { |
| | | List<WsEquipmentUtilizationRate> equipmentRateList = equipmentService.selectEquipmentRate(); |
| | | if (equipmentRateList != null && !equipmentRateList.isEmpty()) { |
| | | for (WsEquipmentUtilizationRate wsEquipmentUtilizationRate : equipmentRateList) { |
| | | String s = JSONObject.toJSONString(wsEquipmentUtilizationRate); |
| | | log.info("䏿¥å©ç¨çæ°æ® ===== {}", s); |
| | | String result = CxfClientUtil.invokeService(url, s, namespace, method); |
| | | log.info("䏿¥å©ç¨çç»æ ===== {}", result); |
| | | } |
| | | } |
| | | quartzLog.setIsSuccess(0); |
| | | } catch (Exception e) { |
| | | quartzLog.setIsSuccess(-1); |
| | | quartzLog.setExceptionDetail(ThrowableUtil.getStackTrace(e)); |
| | | } |
| | | long endTime = System.currentTimeMillis(); |
| | | quartzLog.setExecutionTime(Integer.parseInt(String.valueOf(endTime - startTime))); |
| | | sysQuartzLogService.save(quartzLog); |
| | | } |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.jeecg.modules.mdc.entity.Equipment; |
| | | import org.jeecg.modules.mdc.vo.WsEquipmentStatus; |
| | | import org.jeecg.modules.mdc.vo.WsEquipmentUtilizationRate; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: éé设å¤è¡¨ |
| | |
| | | |
| | | @Insert(" CREATE TABLE ${tableName} AS SELECT * FROM ${lastTableName} WHERE CollectTime < '${date}' ") |
| | | void insertNoTableData(@Param("tableName") String tableName, @Param("lastTableName") String lastTableName, @Param("date") String date); |
| | | |
| | | List<WsEquipmentStatus> selectEquipmentStatus(); |
| | | |
| | | List<WsEquipmentUtilizationRate> selectEquipmentRate(@Param("date") String date); |
| | | |
| | | String selectOee(@Param("equipmentId") String equipmentId, @Param("date") String date); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentDaySchedule; |
| | | |
| | | public interface MdcEquipmentDayScheduleMapper extends BaseMapper<MdcEquipmentDaySchedule> { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentDaySummary; |
| | | |
| | | public interface MdcEquipmentDaySummaryMapper extends BaseMapper<MdcEquipmentDaySummary> { |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | MdcEquipmentDetailedDto findById(@Param("id") String id); |
| | | |
| | | /** |
| | | * æ ¹æ®äº§çº¿idè·å设å¤ç¶æå表 |
| | | * @param workshopId |
| | | * @return |
| | | */ |
| | | List<MdcEquipmentMonitor> getEquipmentMonitorList(@Param("workshopId") String workshopId); |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.mdc.mapper.EquipmentMapper"> |
| | | |
| | | <!--æ¥è¯¢è®¾å¤ç¶æ--> |
| | | <select id="selectEquipmentStatus" resultType="org.jeecg.modules.mdc.vo.WsEquipmentStatus"> |
| | | SELECT |
| | | t1.EquipmentID equipmentCode, |
| | | t1.equipmentName equipmentName, |
| | | t1.oporation equipmentStatus, |
| | | t1.collectTime creationDate, |
| | | t2.FactoryName finr |
| | | FROM |
| | | Equipment t1 |
| | | LEFT JOIN FactoryInfo t2 ON t1.FactoryID = t2.FactoryID |
| | | </select> |
| | | |
| | | <!--æ¥è¯¢è®¾å¤å©ç¨ç--> |
| | | <select id="selectEquipmentRate" resultType="org.jeecg.modules.mdc.vo.WsEquipmentUtilizationRate"> |
| | | SELECT |
| | | t1.EquipmentID equipmentCode, |
| | | t1.equipmentName equipmentName, |
| | | t2.FactoryName finr, |
| | | t3.process_long equipmentRunTime, |
| | | t3.create_time statisDate |
| | | FROM |
| | | Equipment t1 |
| | | LEFT JOIN FactoryInfo t2 ON t1.FactoryID = t2.FactoryID |
| | | LEFT JOIN mdc_equipment_statistical_info t3 ON t1.EquipmentID = t3.equipment_id |
| | | WHERE t3.the_date = #{date} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectOee" resultType="java.lang.String"> |
| | | SELECT |
| | | oee |
| | | FROM |
| | | mdc_oee_info |
| | | WHERE equipment_id = #{equipmentId} AND the_date = #{date} |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.mdc.mapper.MdcEquipmentDayScheduleMapper"> |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.mdc.mapper.MdcEquipmentDaySummaryMapper"> |
| | | |
| | | </mapper> |
| | |
| | | t1.id = #{ id } |
| | | </select> |
| | | |
| | | <!--æ ¹æ®äº§çº¿idè·å设å¤ç¶æå表--> |
| | | <select id="getEquipmentMonitorList" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentMonitor"> |
| | | SELECT e.equipment_id, |
| | | et.CollectTime, |
| | | e.equipment_name, |
| | | et.Oporation, |
| | | e.id, |
| | | e.equipment_status, |
| | | e.equipment_type AS equipmentType, |
| | | etp.equipment_type_pictures |
| | | FROM mdc_equipment e |
| | | LEFT JOIN Equipment et ON e.equipment_id = et.EquipmentID |
| | | LEFT JOIN mdc_equipment_type etp ON e.equipment_type = etp.equipment_type_name |
| | | JOIN mdc_workshop_equipment we ON e.equipment_id = we.equipment_id |
| | | WHERE we.workshop_id = #{workshopId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.mdc.entity.Equipment; |
| | | import org.jeecg.modules.mdc.vo.WsEquipmentStatus; |
| | | import org.jeecg.modules.mdc.vo.WsEquipmentUtilizationRate; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: éé设å¤è¡¨ |
| | |
| | | |
| | | /** |
| | | * æ ¹æ®æ°æ®è¡¨åç§°æ¥è¯¢æ°æ®è¡¨æ¯å¦åå¨ |
| | | * |
| | | * @param saveTableName |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * æ¥è¯¢éå¤ä»½æ°æ®é |
| | | * |
| | | * @param saveTableName |
| | | * @param day |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * æ°æ®è¿ç§» |
| | | * |
| | | * @param backupTableName |
| | | * @param tableName |
| | | * @param day |
| | |
| | | |
| | | /** |
| | | * å é¤åæ°æ®è¡¨æ°æ® |
| | | * |
| | | * @param tableName |
| | | * @param day |
| | | */ |
| | |
| | | |
| | | /** |
| | | * å建å¤ä»½è¡¨ |
| | | * |
| | | * @param backupTableName |
| | | * @param tableName |
| | | * @param day |
| | | */ |
| | | void insertNoTableData(String backupTableName, String tableName, String day); |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤ç¶æ |
| | | * |
| | | * @return |
| | | */ |
| | | List<WsEquipmentStatus> selectEquipmentStatus(); |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤å©ç¨ç |
| | | * @return |
| | | */ |
| | | List<WsEquipmentUtilizationRate> selectEquipmentRate(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentDaySchedule; |
| | | |
| | | public interface IMdcEquipmentDayScheduleService extends IService<MdcEquipmentDaySchedule> { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentDaySummary; |
| | | |
| | | public interface IMdcEquipmentDaySummaryService extends IService<MdcEquipmentDaySummary> { |
| | | } |
| | |
| | | |
| | | List<String> listEquipmentIdShift(MdcEfficiencyReportShiftQueryVo vo); |
| | | |
| | | /** |
| | | * æ ¹æ®äº§çº¿idè·å设å¤ç¶æå表 |
| | | * |
| | | * @param workshopId |
| | | * @return |
| | | */ |
| | | List<MdcEquipmentMonitor> getEquipmentMonitorList(String workshopId); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 计ç®OEE |
| | | * |
| | | * @param mdcOeeComputeVo |
| | | */ |
| | | void computeOee(MdcOeeComputeVo mdcOeeComputeVo); |
| | |
| | | import org.jeecg.modules.mdc.entity.Equipment; |
| | | import org.jeecg.modules.mdc.mapper.EquipmentMapper; |
| | | import org.jeecg.modules.mdc.service.IEquipmentService; |
| | | import org.jeecg.modules.mdc.vo.WsEquipmentStatus; |
| | | import org.jeecg.modules.mdc.vo.WsEquipmentUtilizationRate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: éé设å¤è¡¨ |
| | |
| | | public void insertNoTableData(String backupTableName, String tableName, String day) { |
| | | this.baseMapper.insertNoTableData(backupTableName, tableName, day); |
| | | } |
| | | |
| | | @Override |
| | | public List<WsEquipmentStatus> selectEquipmentStatus() { |
| | | return this.baseMapper.selectEquipmentStatus(); |
| | | } |
| | | |
| | | @Override |
| | | public List<WsEquipmentUtilizationRate> selectEquipmentRate() { |
| | | String date = LocalDate.now().plusDays(-1).toString(); |
| | | List<WsEquipmentUtilizationRate> list = this.baseMapper.selectEquipmentRate(date.replaceAll("-", "")); |
| | | if (list != null && !list.isEmpty()) { |
| | | for (WsEquipmentUtilizationRate wsEquipmentUtilizationRate : list) { |
| | | String equipmentRunTime = wsEquipmentUtilizationRate.getEquipmentRunTime(); |
| | | wsEquipmentUtilizationRate.setStatisType("D"); |
| | | wsEquipmentUtilizationRate.setEquipmentRunTime(new BigDecimal(equipmentRunTime).divide(new BigDecimal("60"), 0, RoundingMode.HALF_UP).toString()); |
| | | wsEquipmentUtilizationRate.setEquipmentRate(new BigDecimal(equipmentRunTime).divide(new BigDecimal("86400"), 2, RoundingMode.HALF_UP).toString()); |
| | | wsEquipmentUtilizationRate.setEquipmentCalendar(date); |
| | | String oee = this.baseMapper.selectOee(wsEquipmentUtilizationRate.getEquipmentCode(), date); |
| | | wsEquipmentUtilizationRate.setEquipmentOee(oee == null ? "0" : oee); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentDaySchedule; |
| | | import org.jeecg.modules.mdc.mapper.MdcEquipmentDayScheduleMapper; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentDayScheduleService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @Author: Lius |
| | | * @CreateTime: 2025-02-26 |
| | | * @Description: s |
| | | */ |
| | | @Service |
| | | public class MdcEquipmentDayScheduleServiceImpl extends ServiceImpl<MdcEquipmentDayScheduleMapper, MdcEquipmentDaySchedule> implements IMdcEquipmentDayScheduleService { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentDaySummary; |
| | | import org.jeecg.modules.mdc.mapper.MdcEquipmentDaySummaryMapper; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentDaySummaryService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @Author: Lius |
| | | * @CreateTime: 2025-02-26 |
| | | * @Description: è®¾å¤æ¥æ±æ»impl |
| | | */ |
| | | @Service |
| | | public class MdcEquipmentDaySummaryServiceImpl extends ServiceImpl<MdcEquipmentDaySummaryMapper, MdcEquipmentDaySummary> implements IMdcEquipmentDaySummaryService { |
| | | } |
| | |
| | | package org.jeecg.modules.mdc.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | return list.stream().map(MdcEquipment::getEquipmentId).collect(Collectors.toList()); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®äº§çº¿idè·å设å¤ç¶æå表 |
| | | * |
| | | * @param workshopId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<MdcEquipmentMonitor> getEquipmentMonitorList(String workshopId) { |
| | | return this.baseMapper.getEquipmentMonitorList(workshopId); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * å页å表 |
| | | * |
| | | * @param userId |
| | | * @param page |
| | | * @param mdcOeeInfoVo |
| | |
| | | |
| | | /** |
| | | * å¯¼åº |
| | | * |
| | | * @param userId |
| | | * @param mdcOeeInfoVo |
| | | * @return |
| | |
| | | ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); |
| | | List<MdcOeeInfo> mdcOeeInfos = this.baseMapper.selectList(queryWrapper); |
| | | // å¯¼åºæä»¶åç§° |
| | | mv.addObject(NormalExcelConstants.FILE_NAME, "OEEæ°æ®å表"); |
| | | mv.addObject(NormalExcelConstants.FILE_NAME, "OEEæ°æ®å表"); |
| | | mv.addObject(NormalExcelConstants.CLASS, MdcOeeInfo.class); |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("OEEæ°æ®åè¡¨æ°æ®", "导åºäºº:" + user.getRealname(), "OEEæ°æ®")); |
| | |
| | | |
| | | /** |
| | | * 计ç®OEE |
| | | * |
| | | * @param mdcOeeComputeVo |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 计ç®oee |
| | | * |
| | | * @param dateTime åæ° |
| | | */ |
| | | @Override |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.util; |
| | | |
| | | import org.apache.cxf.endpoint.Client; |
| | | import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory; |
| | | |
| | | import javax.xml.namespace.QName; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/6/11 10:16 |
| | | */ |
| | | public class CxfClientUtil { |
| | | |
| | | /** |
| | | * 卿è°ç¨ |
| | | */ |
| | | public static String invokeService(String url, String data, String namespace, String method) throws Exception { |
| | | |
| | | JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance(); |
| | | Client client = dcf.createClient(url); |
| | | QName opName = new QName(namespace, method); |
| | | Object[] objects = new Object[0]; |
| | | try { |
| | | objects = client.invoke(opName, data); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return objects[0].toString(); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * MESä¸ä¼ æ¥è®¡åæ¥æ¶å¯¹è±¡ |
| | | * |
| | | * @author Lius |
| | | * @date 2025/2/26 14:17 |
| | | */ |
| | | @Data |
| | | public class EquipmentDaySchedule { |
| | | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | private String medId; |
| | | /** |
| | | * åå
|
| | | */ |
| | | private String dept; |
| | | /** |
| | | * 车é´ï¼ååï¼ |
| | | */ |
| | | private String workshop; |
| | | /** |
| | | * çæ¬å·ï¼å·¥èºè§ç¨çæ¬¡ï¼ |
| | | */ |
| | | private String revisionNo; |
| | | /** |
| | | * é¶ä»¶åç§° |
| | | */ |
| | | private String mdsItemId; |
| | | /** |
| | | * é¶ä»¶å· |
| | | */ |
| | | private String mdsItemCode; |
| | | /** |
| | | * 订åå· |
| | | */ |
| | | private String taskCode; |
| | | /** |
| | | * æµå¡å· |
| | | */ |
| | | private String ewoNo; |
| | | /** |
| | | * æ¹æ¬¡å· |
| | | */ |
| | | private String batchNo; |
| | | /** |
| | | * æ¹æ¬¡æ°éï¼è®¡åæ°ï¼ |
| | | */ |
| | | private String batchNum; |
| | | /** |
| | | * åæ ¼æ° |
| | | */ |
| | | private Integer qualifiedQty; |
| | | /** |
| | | * æ¥åºæ° |
| | | */ |
| | | private Integer scrapQty; |
| | | /** |
| | | * å·¥åºå· |
| | | */ |
| | | private String opreationSeqNo; |
| | | /** |
| | | * æ´¾å·¥æ¥æ |
| | | */ |
| | | private String dispatchDate; |
| | | /** |
| | | * 设å¤ç¼å· |
| | | */ |
| | | private String equipmentId; |
| | | /** |
| | | * 1 æ£å¸¸ 2 åæ¶ 3 å é¤ |
| | | */ |
| | | private String taskType; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * MESä¸ä¼ æ¥æ±æ»æ¥æ¶å¯¹è±¡ |
| | | * |
| | | * @author Lius |
| | | * @date 2025/2/26 14:17 |
| | | */ |
| | | @Data |
| | | public class EquipmentDaySummary { |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | private String medId; |
| | | /** |
| | | * åå
|
| | | */ |
| | | private String dept; |
| | | /** |
| | | * 车é´ï¼ååï¼ |
| | | */ |
| | | private String workshop; |
| | | /** |
| | | * 设å¤ç¼å· |
| | | */ |
| | | private String equipmentCode; |
| | | /** |
| | | * å½åå¨å¶åéï¼è®¢åè®¡åæ°é-å
¥åºæ°é-æ¥åºæ°éï¼ |
| | | */ |
| | | private Integer demandQty; |
| | | /** |
| | | * 仿¥å®å·¥å
¥åºéï¼å
¥åºæ°éï¼ |
| | | */ |
| | | private Integer qualifiedQty; |
| | | /** |
| | | * 仿¥æäº§éï¼è®¢åæ°éï¼ |
| | | */ |
| | | private Integer planQty; |
| | | /** |
| | | * 仿¥æ¥åºæ°é |
| | | */ |
| | | private Integer scrapQty; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.vo; |
| | | |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/6/11 10:44 |
| | | */ |
| | | @Data |
| | | public class WsEquipmentStatus { |
| | | |
| | | private String equipmentCode; |
| | | |
| | | private String equipmentName; |
| | | |
| | | private String equipmentStatus; |
| | | |
| | | private Date creationDate; |
| | | |
| | | private String finr; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/6/11 16:31 |
| | | */ |
| | | @Data |
| | | public class WsEquipmentUtilizationRate { |
| | | |
| | | /** |
| | | * 设å¤ç¼å· |
| | | */ |
| | | private String equipmentCode; |
| | | /** |
| | | * 设å¤åç§° |
| | | */ |
| | | private String equipmentName; |
| | | /** |
| | | * åå |
| | | */ |
| | | private String finr; |
| | | /** |
| | | * 设å¤å©ç¨ç |
| | | */ |
| | | private String equipmentRate; |
| | | /** |
| | | * 设å¤è¿è¡æ¶é´(åé) |
| | | */ |
| | | private String equipmentRunTime; |
| | | /** |
| | | * è®¾å¤æ¥å |
| | | */ |
| | | private String equipmentCalendar; |
| | | /** |
| | | * OEE |
| | | */ |
| | | private String equipmentOee; |
| | | /** |
| | | * ç»è®¡ç±»å |
| | | */ |
| | | private String statisType; |
| | | /** |
| | | * ç»è®¡æ¥æ |
| | | */ |
| | | private Date statisDate; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/6/11 11:12 |
| | | */ |
| | | @Data |
| | | public class WsResult { |
| | | |
| | | private String flag; |
| | | |
| | | private String msg; |
| | | |
| | | public WsResult(String flag, String msg) { |
| | | this.flag = flag; |
| | | this.msg = msg; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.webservice; |
| | | |
| | | import javax.jws.WebMethod; |
| | | import javax.jws.WebParam; |
| | | import javax.jws.WebService; |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2025/2/20 13:48 |
| | | */ |
| | | @WebService(name = "EquipmentWebService", targetNamespace = "http://mdc.webservice.equipment.com") |
| | | public interface EquipmentWebService { |
| | | |
| | | @WebMethod |
| | | String equipmentDaySchedule(@WebParam(name = "msg") String msg); |
| | | |
| | | @WebMethod |
| | | String equipmentDaySummary(@WebParam(name = "msg") String msg); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.webservice.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentDaySchedule; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentDaySummary; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentDayScheduleService; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentDaySummaryService; |
| | | import org.jeecg.modules.mdc.vo.EquipmentDaySchedule; |
| | | import org.jeecg.modules.mdc.vo.EquipmentDaySummary; |
| | | import org.jeecg.modules.mdc.vo.WsResult; |
| | | import org.jeecg.modules.mdc.webservice.EquipmentWebService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.jws.WebService; |
| | | |
| | | |
| | | /** |
| | | * @author Lius |
| | | * @date 2024/6/11 11:07 |
| | | */ |
| | | @Service |
| | | @WebService(name = "EquipmentWebService", |
| | | targetNamespace = "http://mdc.webservice.equipment.com", |
| | | endpointInterface = "org.jeecg.modules.mdc.webservice.EquipmentWebService" |
| | | ) |
| | | @Slf4j |
| | | public class EquipmentWebServiceImpl implements EquipmentWebService { |
| | | |
| | | @Resource |
| | | private IMdcEquipmentDaySummaryService mdcEquipmentDaySummaryService; |
| | | |
| | | @Resource |
| | | private IMdcEquipmentDayScheduleService mdcEquipmentDayScheduleService; |
| | | |
| | | @Override |
| | | public String equipmentDaySchedule(String msg) { |
| | | log.info("MES䏿¥æ¥è®¡ååå§æ°æ® === {}", msg); |
| | | EquipmentDaySchedule equipmentDaySchedule = JSONObject.parseObject(msg, EquipmentDaySchedule.class); |
| | | MdcEquipmentDaySchedule mdcEquipmentDaySchedule = new MdcEquipmentDaySchedule(); |
| | | BeanUtils.copyProperties(equipmentDaySchedule, mdcEquipmentDaySchedule); |
| | | mdcEquipmentDayScheduleService.save(mdcEquipmentDaySchedule); |
| | | |
| | | log.info("MES䏿¥æ¥è®¡åæ°æ®æåï¼"); |
| | | WsResult wsResult = new WsResult("1", "æå"); |
| | | return JSONObject.toJSONString(wsResult); |
| | | } |
| | | |
| | | @Override |
| | | public String equipmentDaySummary(String msg) { |
| | | log.info("MES䏿¥æ¥æ±æ»åå§æ°æ® === {}", msg); |
| | | EquipmentDaySummary equipmentDaySummary = JSONObject.parseObject(msg, EquipmentDaySummary.class); |
| | | MdcEquipmentDaySummary mdcEquipmentDaySummary = new MdcEquipmentDaySummary(); |
| | | BeanUtils.copyProperties(equipmentDaySummary, mdcEquipmentDaySummary); |
| | | mdcEquipmentDaySummaryService.save(mdcEquipmentDaySummary); |
| | | |
| | | log.info("MES䏿¥æ¥æ±æ»æ°æ®æåï¼"); |
| | | WsResult wsResult = new WsResult("1", "æå"); |
| | | return JSONObject.toJSONString(wsResult); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.screen.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.screen.dto.EquipmentStatusOverview; |
| | | import org.jeecg.modules.screen.service.MdcLargeScreenService; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @Author: Lius |
| | | * @CreateTime: 2025-02-28 |
| | | * @Description: |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "大å±çæ¿") |
| | | @RestController |
| | | @RequestMapping("/mdc/largeScreen") |
| | | public class MdcLargeScreenController { |
| | | |
| | | @Resource |
| | | private MdcLargeScreenService mdcLargeScreenService; |
| | | |
| | | @ApiOperation(value = "大å±çæ¿-è®¾å¤æ
åµ", notes = "大å±çæ¿-è®¾å¤æ
åµ") |
| | | @GetMapping("/equipmentStatusOverview") |
| | | public Result<EquipmentStatusOverview> equipmentStatusOverview(String workshopId) { |
| | | EquipmentStatusOverview equipmentStatusOverview = mdcLargeScreenService.equipmentStatusOverview(workshopId); |
| | | return Result.OK(equipmentStatusOverview); |
| | | } |
| | | |
| | | // @ApiOperation(value = "大å±çæ¿-æå©ç¨çè¶å¿", notes = "大å±çæ¿-æå©ç¨çè¶å¿") |
| | | // @GetMapping("/monthUtilizationTendency") |
| | | // public Result<EquipmentStatusOverview> monthUtilizationTendency(String workshopId) { |
| | | // |
| | | // return Result.OK(equipmentStatusOverview); |
| | | // } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.screen.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author: Lius |
| | | * @CreateTime: 2025-02-28 |
| | | * @Description: |
| | | */ |
| | | @Data |
| | | public class EquipmentStatusOverview { |
| | | /** |
| | | * è®¾å¤æ»æ° |
| | | */ |
| | | private Integer equipmentCount = 0; |
| | | /** |
| | | * 大修ãé¡¹ä¿®æ° |
| | | */ |
| | | private Integer repairCount = 0; |
| | | /** |
| | | * æ£å¸¸è¿è¡æ° |
| | | */ |
| | | private Integer runCount = 0; |
| | | /** |
| | | * å¾
æºæ° |
| | | */ |
| | | private Integer waitCount = 0; |
| | | /** |
| | | * æ¥è¦æ° |
| | | */ |
| | | private Integer errorCount = 0; |
| | | /** |
| | | * å
³æºæ° |
| | | */ |
| | | private Integer closeCount = 0; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.screen.service; |
| | | |
| | | import org.jeecg.modules.screen.dto.EquipmentStatusOverview; |
| | | |
| | | /** |
| | | * @Author: Lius |
| | | * @CreateTime: 2025-02-28 |
| | | * @Description: |
| | | */ |
| | | public interface MdcLargeScreenService { |
| | | |
| | | /** |
| | | * è®¾å¤æ
åµ |
| | | * |
| | | * @param workshopId |
| | | * @return |
| | | */ |
| | | EquipmentStatusOverview equipmentStatusOverview(String workshopId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.screen.service.impl; |
| | | |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.vo.DictModel; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentMonitor; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentService; |
| | | import org.jeecg.modules.screen.dto.EquipmentStatusOverview; |
| | | import org.jeecg.modules.screen.service.MdcLargeScreenService; |
| | | import org.jeecg.modules.system.service.ISysDictService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: Lius |
| | | * @CreateTime: 2025-02-28 |
| | | * @Description: |
| | | */ |
| | | @Service |
| | | public class MdcLargeScreenServiceImpl implements MdcLargeScreenService { |
| | | |
| | | @Resource |
| | | private IMdcEquipmentService mdcEquipmentService; |
| | | |
| | | @Resource |
| | | private ISysDictService sysDictService; |
| | | |
| | | /** |
| | | * 设å¤ç¶ææ
åµ |
| | | * |
| | | * @param workshopId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public EquipmentStatusOverview equipmentStatusOverview(String workshopId) { |
| | | EquipmentStatusOverview equipmentStatusOverview = new EquipmentStatusOverview(); |
| | | List<MdcEquipmentMonitor> equipmentMonitorList = mdcEquipmentService.getEquipmentMonitorList(workshopId); |
| | | if (equipmentMonitorList != null && !equipmentMonitorList.isEmpty()) { |
| | | equipmentStatusOverview.setEquipmentCount(equipmentMonitorList.size()); |
| | | for (MdcEquipmentMonitor mdcEquipmentMonitor : equipmentMonitorList) { |
| | | if (mdcEquipmentMonitor.getEquipmentStatus() == 0) { |
| | | if (mdcEquipmentMonitor.getOporation() != null) { |
| | | switch (mdcEquipmentMonitor.getOporation()) { |
| | | case 1: |
| | | case 2: |
| | | equipmentStatusOverview.setWaitCount(equipmentStatusOverview.getWaitCount() + 1); |
| | | break; |
| | | case 3: |
| | | equipmentStatusOverview.setRunCount(equipmentStatusOverview.getRunCount()); |
| | | break; |
| | | case 22: |
| | | equipmentStatusOverview.setErrorCount(equipmentStatusOverview.getErrorCount() + 1); |
| | | break; |
| | | default: |
| | | equipmentStatusOverview.setCloseCount(equipmentStatusOverview.getCloseCount() + 1); |
| | | break; |
| | | } |
| | | } else { |
| | | equipmentStatusOverview.setCloseCount(equipmentStatusOverview.getCloseCount() + 1); |
| | | mdcEquipmentMonitor.setOporation(0); |
| | | } |
| | | } else { |
| | | List<DictModel> dictList = sysDictService.queryEnableDictItemsByCode(CommonConstant.DICT_EQUIPMENT_STATUS); |
| | | for (DictModel dictModel : dictList) { |
| | | if (Integer.valueOf(dictModel.getValue()).equals(mdcEquipmentMonitor.getEquipmentStatus())) { |
| | | equipmentStatusOverview.setRepairCount(equipmentStatusOverview.getRepairCount() + 1); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return equipmentStatusOverview; |
| | | } |
| | | } |
| | |
| | | <!-- Log4j2çé·æ¼æ´ --> |
| | | <log4j2.version>2.17.0</log4j2.version> |
| | | <logback.version>1.2.9</logback.version> |
| | | <!-- webservice --> |
| | | <cxf.version>3.2.4</cxf.version> |
| | | </properties> |
| | | |
| | | <modules> |