lxzn-boot-base-core/src/main/java/org/jeecg/common/constant/CommonConstant.java
@@ -605,4 +605,9 @@ String CLOSE_TYPE_2 = "2"; /** * 设备状态字典编号 */ String DICT_EQUIPMENT_STATUS = "mdc_equipment_status"; } lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcEquipmentController.java
@@ -233,7 +233,7 @@ Result<MdcEquipment> result = new Result<>(); String selectedDeparts = mdcEquipment.getSelectedDeparts(); String selectedProduction = mdcEquipment.getSelectedProduction(); mdcEquipment.setEquipmentStatus(CommonConstant.STATUS_NORMAL); // mdcEquipment.setEquipmentStatus(CommonConstant.STATUS_NORMAL); try { mdcEquipmentService.saveMdcEquipment(mdcEquipment, selectedDeparts, selectedProduction); result.success("添加成功!"); lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/EquipmentWorklineMapper.java
@@ -25,7 +25,7 @@ @InterceptorIgnore(tenantLine = "1") @Select("select Sequencenumber,CollectTime from ${tableName} " + " where CollectTime > #{startTime} and CollectTime <= #{endTime} and Sequencenumber is not null" + " where CollectTime > #{startTime} and CollectTime <= #{endTime} and Sequencenumber is not null and Sequencenumber != ''" + " order by CollectTime desc ") List<Map<String, Object>> getEquipmentSequenceNumber(@Param("tableName") String tableName, @Param("startTime") Date startTime, @Param("endTime") Date endTime); lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml
@@ -142,6 +142,7 @@ <foreach collection="equipmentIdList" index="index" item="id" open="(" separator="," close=")"> #{id} </foreach> AND me.equipment_status = 0 </where> ORDER BY sd.depart_order </select> @@ -165,6 +166,7 @@ <foreach collection="equipmentIdList" index="index" item="id" open="(" separator="," close=")"> #{id} </foreach> AND me.equipment_status = 0 </where> ORDER BY mp.production_order </select> lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java
@@ -9,6 +9,7 @@ import org.jeecg.common.api.dto.message.MessageDTO; import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.system.api.ISysBaseAPI; import org.jeecg.common.system.vo.DictModel; import org.jeecg.common.util.oConvertUtils; import org.jeecg.modules.mdc.dto.MdcEquDepDto; import org.jeecg.modules.mdc.dto.MdcEquProDto; @@ -29,10 +30,7 @@ import org.jeecg.modules.system.entity.SysDepart; import org.jeecg.modules.system.mapper.MdcEquipmentDepartMapper; import org.jeecg.modules.system.mapper.MdcProductionEquipmentMapper; import org.jeecg.modules.system.service.IMdcProductionService; import org.jeecg.modules.system.service.IMdcUserProductionService; import org.jeecg.modules.system.service.ISysDepartService; import org.jeecg.modules.system.service.ISysUserDepartService; import org.jeecg.modules.system.service.*; import org.springframework.cache.annotation.CacheEvict; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -67,8 +65,6 @@ @Resource private IMdcProductionService mdcProductionService; @Resource private IControlSystemService controlSystemService; @Resource private IEquipmentWorkLineService equipmentWorkLineService; @Resource private IMdcDriveTypeParamConfigService mdcDriveTypeParamConfigService; @@ -77,9 +73,6 @@ @Resource private IEquipmentLogService equipmentLogService; @Resource private IEquipmentBaseInfoService equipmentBaseInfoService; @Resource private ISysBaseAPI sysBaseApi; @@ -93,6 +86,11 @@ @Resource private IMdcOverrunAlarmService mdcOverrunAlarmService; @Resource private IEquipmentXYZService equipmentXYZService; @Resource private ISysDictService sysDictService; @Override public Map<String, String> getDepNamesByEquipmentIds(List<String> equipmentIds) { @@ -326,25 +324,35 @@ List<MdcEquipmentMonitor> result = this.baseMapper.checkStatusFromEquipmentIds(equipmentIds); if (result != null && !result.isEmpty()) { for (MdcEquipmentMonitor mdcEquipmentMonitor : result) { if (mdcEquipmentMonitor.getOporation() != null) { switch (mdcEquipmentMonitor.getOporation()) { case 1: case 2: mdcEquipmentMonitor.setOporationDict("待机"); break; case 3: mdcEquipmentMonitor.setOporationDict("运行"); break; case 22: mdcEquipmentMonitor.setOporationDict("报警"); break; default: mdcEquipmentMonitor.setOporationDict("关机"); break; if (mdcEquipmentMonitor.getEquipmentStatus() == 0) { if (mdcEquipmentMonitor.getOporation() != null) { switch (mdcEquipmentMonitor.getOporation()) { case 1: case 2: mdcEquipmentMonitor.setOporationDict("待机"); break; case 3: mdcEquipmentMonitor.setOporationDict("运行"); break; case 22: mdcEquipmentMonitor.setOporationDict("报警"); break; default: mdcEquipmentMonitor.setOporationDict("关机"); break; } } else { mdcEquipmentMonitor.setOporationDict("关机"); mdcEquipmentMonitor.setOporation(0); } } else { mdcEquipmentMonitor.setOporationDict("关机"); mdcEquipmentMonitor.setOporation(0); List<DictModel> dictList = sysDictService.queryEnableDictItemsByCode(CommonConstant.DICT_EQUIPMENT_STATUS); for (DictModel dictModel : dictList) { if (Integer.valueOf(dictModel.getValue()).equals(mdcEquipmentMonitor.getEquipmentStatus())) { mdcEquipmentMonitor.setOporationDict(dictModel.getLabel()); mdcEquipmentMonitor.setOporation(88); } } } } } @@ -454,6 +462,26 @@ } } result.put("runData", runData); //坐标信息 // 查询坐标信息 EquipmentXYZ equipmentXYZ = equipmentXYZService.getByEquipmentId(mdcEquipmentDetailedDto.getEquipmentId()); if (equipmentXYZ != null) { Map<String, Object> map = new HashMap<>(); map.put("xmachine", equipmentXYZ.getXMachine()); map.put("ymachine", equipmentXYZ.getYMachine()); map.put("zmachine", equipmentXYZ.getZMachine()); map.put("amachine", equipmentXYZ.getAMachine()); map.put("bmachine", equipmentXYZ.getBMachine()); map.put("xabsolute", equipmentXYZ.getXAbsolute()); map.put("yabsolute", equipmentXYZ.getYAbsolute()); map.put("zabsolute", equipmentXYZ.getZAbsolute()); map.put("aabsolute", equipmentXYZ.getAAbsolute()); map.put("babsolute", equipmentXYZ.getBAbsolute()); result.put("xyzList", map); } } return result; } @@ -578,6 +606,9 @@ if (StringUtils.isNotEmpty(mdcEquipment.getEquipmentName())) { queryWrapper.like(MdcEquipment::getEquipmentName, mdcEquipment.getEquipmentName()); } if (mdcEquipment.getEquipmentStatus() != null) { queryWrapper.eq(MdcEquipment::getEquipmentStatus, mdcEquipment.getEquipmentStatus()); } if (!allEquipments.isEmpty()) { queryWrapper.in(MdcEquipment::getEquipmentId, allEquipments); } else if (!equipmentIdsByDepart.isEmpty() && equipmentIdsProduction.isEmpty()) { lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/MdcEquipmentVo.java
@@ -15,6 +15,7 @@ private String equipmentId; private String equipmentName; private String equipmentModel; private Integer equipmentStatus; private String equipmentType; private String deviceLevel; private String deviceCategory; lxzn-module-system/lxzn-system-start/src/main/resources/application-dev.yml
@@ -1,5 +1,7 @@ server: port: 9999 # connection-timeout: 80000 # disableUploadTimeout: false tomcat: max-swallow-size: -1 error: @@ -81,15 +83,15 @@ type: com.alibaba.druid.pool.DruidDataSource druid: driverClassName: dm.jdbc.driver.DmDriver url: jdbc:dm://192.168.124.118:5236/?LXZN_MDC_420&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8 url: jdbc:dm://LOCALHOST:5236/?LXZN_MDC_420&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8 username: LXZN_MDC_420 password: 123 #redis 配置 redis: database: 0 host: 192.168.124.118 host: 127.0.0.1 port: 6379 password: password: 123456 #mybatis plus 设置 mybatis-plus: mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml @@ -177,7 +179,7 @@ enabled: true #cas单点登录 cas: prefixUrl: http://cas.example.org:8443/cas prefixUrl: http://127.0.0.1:8443/cas #Mybatis输出sql日志 logging: level: @@ -217,26 +219,15 @@ type: default prefix: 'demo::' timeout: 1h #第三方APP对接 third-app: enabled: false type: #企业微信 WECHAT_ENTERPRISE: enabled: false #CORP_ID client-id: ?? #SECRET client-secret: ?? #自建应用id agent-id: ?? #自建应用秘钥(新版企微需要配置) # agent-app-secret: ?? #钉钉 DINGTALK: enabled: false # appKey client-id: ?? # appSecret client-secret: ?? agent-id: ?? fileService: host: 127.0.0.1 port: 8299 username: admin pwd: 123 addressToken: /outer/appAuth addressUploadFile: /outer/fileUpload localFilePath: D:/data/sql servicePath: D:/data/sql logIp: 127.0.0.1 logPort: 8888 newFilePath: D:/data/bak_sql/ #备份地址 lxzn-module-system/lxzn-system-start/src/main/resources/application-prod.yml
@@ -38,39 +38,22 @@ ## quartz定时任务,采用数据库方式 quartz: job-store-type: jdbc initialize-schema: embedded jdbc: initialize-schema: never #定时任务启动开关,true-开 false-关 auto-startup: true #延迟1秒启动定时任务 startup-delay: 1s #启动时更新己存在的Job overwrite-existing-jobs: true properties: org: quartz: scheduler: instanceName: MyScheduler instanceId: AUTO jobStore: selectWithLockSQL: SELECT* FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ? # class: org.springframework.scheduling.quartz.LocalDataSourceJobStore # driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate # tablePrefix: QRTZ_ # isClustered: true # misfireThreshold: 12000 # clusterCheckinInterval: 15000 threadPool: class: org.quartz.simpl.SimpleThreadPool threadCount: 10 threadPriority: 5 threadsInheritContextClassLoaderOfInitializingThread: true #json 时间戳统一转换 jackson: date-format: yyyy-MM-dd HH:mm:ss time-zone: GMT+8 jpa: open-in-view: false database-platform: org.hibernate.dialect.SQLServerDialect properties: hibernate: dialect: org.hibernate.dialect.Oracle8iDialect aop: proxy-target-class: true #配置freemarker @@ -95,53 +78,21 @@ matching-strategy: ant_path_matcher resource: static-locations: classpath:/static/,classpath:/public/ autoconfigure: exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # autoconfigure: # exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure datasource: type: com.alibaba.druid.pool.DruidDataSource druid: stat-view-servlet: enabled: true loginUsername: admin loginPassword: 123456 allow: web-stat-filter: enabled: true dynamic: druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置) # 连接池的配置信息 # 初始化大小,最小,最大 initial-size: 5 min-idle: 5 maxActive: 1000 # 配置获取连接等待超时的时间 maxWait: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 timeBetweenEvictionRunsMillis: 60000 # 配置一个连接在池中最小生存的时间,单位是毫秒 minEvictableIdleTimeMillis: 300000 validationQuery: SELECT 1 testWhileIdle: true testOnBorrow: false testOnReturn: false # 打开PSCache,并且指定每个连接上PSCache的大小 poolPreparedStatements: true maxPoolPreparedStatementPerConnectionSize: 20 # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙 filters: stat,wall,slf4j # 通过connectProperties属性来打开mergeSql功能;慢SQL记录 connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 datasource: master: url: jdbc:sqlserver://195.0.1.10:1433;databasename=SSGX_kns username: sa password: Sa123456789 driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver driverClassName: dm.jdbc.driver.DmDriver url: jdbc:dm://LOCALHOST:5236/?LXZN_MDC&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8 username: LXZN_MDC password: 123 #redis 配置 redis: database: 0 host: 127.0.0.1 port: 6379 password: password: 123456 #mybatis plus 设置 mybatis-plus: mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml @@ -242,8 +193,8 @@ production: false basic: enable: true username: jeecg password: jeecg1314 username: lxzn password: lxzn1688 #第三方登录 justauth: enabled: true @@ -291,4 +242,16 @@ client-id: ?? # appSecret client-secret: ?? agent-id: ?? agent-id: ?? fileService: host: 127.0.0.1 port: 8299 username: admin pwd: 123 addressToken: /outer/appAuth addressUploadFile: /outer/fileUpload localFilePath: D:/data/sql servicePath: D:/data/sql logIp: 127.0.0.1 logPort: 8888 newFilePath: D:/data/bak_sql/ #备份地址