Browse Source

修改新增文件

oyq28 1 năm trước cách đây
mục cha
commit
a59c0164d9

+ 15 - 5
imcs-admin-boot/imcs-authority-server/src/main/resources/application-dev.yml

@@ -1,6 +1,6 @@
 zuihou:
   nginx:
-    ip: 106.15.38.8     # 正式环境需要将该ip设置成nginx对应的 公网ip
+    ip: 127.0.0.1     # 正式环境需要将该ip设置成nginx对应的 公网ip
     port: 10000
   redis:
     ip: 127.0.0.1
@@ -11,18 +11,28 @@ zuihou:
     enabled: true
     ip: 127.0.0.1
     port: 5672
-    username: guest
-    password: guest
+    username: admin
+    password: adminoyq
   mysql:
     ip: 127.0.0.1
     port: 3306
     driverClassName: com.mysql.cj.jdbc.Driver
-    database: zuihou_defaults_yj
+    database: imcs_defaults_yj_test
     username: root
-    password: 123456
+    password: adminoyq
     url: jdbc:mysql://${zuihou.mysql.ip}:${zuihou.mysql.port}/${zuihou.mysql.database}?serverTimezone=CTT&characterEncoding=utf8&useUnicode=true&useSSL=false&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
   database:
     isNotWrite: false
+  smb:
+    userName: measuring
+    password: Imcs@123456
+    fileIp: 192.168.11.245
+    filePath: smb://192.168.11.245/measuring/
+  file:
+    #remoteInputDataPath: smb://SOFLEX-PCS:SOFLEX-PCS@192.168.0.2/SOFLEX_PCS_iGen_CASC1_INPUT/ERP_DATA/
+    remoteInputDataPath: smb://192.168.11.245/measuring/
+  machineCuttingTools:
+    synUrl: https://www.baidu.com
   swagger:
     # 正式环境用nginx代理,为了保持和cloud版本一致的URL,特意调整
     docket:

+ 10 - 16
imcs-admin-boot/imcs-authority-server/src/main/resources/application-test.yml

@@ -9,31 +9,28 @@ zuihou:
     database: 0
   rabbitmq:
     enabled: true
-    #ip: 106.15.38.8
     ip: 127.0.0.1
     port: 5672
-    #username: admin
-    username: guest
-    #password: adminoyq
-    password: guest
+    username: admin    
+    password: adminoyq
   mysql:
-    #ip: 106.15.38.8
     ip: 127.0.0.1
     port: 3306
     driverClassName: com.mysql.cj.jdbc.Driver
     database: zuihou_defaults_yj
     username: root
-    password: 123456
+    password: adminoyq
     url: jdbc:mysql://${zuihou.mysql.ip}:${zuihou.mysql.port}/${zuihou.mysql.database}?serverTimezone=CTT&characterEncoding=utf8&useUnicode=true&useSSL=false&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
   database:
     isNotWrite: false
   smb:
-    userName: measuring
-    password: Imcs@123456
-    fileIp: 192.168.170.23
-    filePath: smb://192.168.170.23/measuring/
+    userName: administrator
+    password: Aa1
+    fileIp: 192.168.11.240
+    filePath: smb://192.168.11.240/report/
   file:
-    remoteInputDataPath: smb://SOFLEX-PCS:SOFLEX-PCS@192.168.0.2/SOFLEX_PCS_iGen_CASC1_INPUT/ERP_DATA/
+    #remoteInputDataPath: smb://SOFLEX-PCS:SOFLEX-PCS@192.168.0.2/SOFLEX_PCS_iGen_CASC1_INPUT/ERP_DATA/
+    remoteInputDataPath: smb://192.168.11.240/report/
   machineCuttingTools:
     synUrl: https://www.baidu.com
   swagger:
@@ -56,7 +53,4 @@ zuihou:
       msgs:
         base-path: /api/msgs
       file:
-        base-path: /api/file
-mybatis-plus:
-  configuration:
-    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+        base-path: /api/file

+ 11 - 8
imcs-admin-boot/imcs-authority-server/src/main/resources/application.yml

@@ -1,32 +1,33 @@
 zuihou:
   nginx:
     ip: 127.0.0.1     # 正式环境需要将该ip设置成nginx对应的 公网ip
-    port: 8760
+    port: 10000
   redis:
     ip: 127.0.0.1
-    port: 16379
-    #password: SbtyMveYNfLzTks7H0apCmyStPzWJqjy
+    port: 6379
     password: 123456
     database: 0
   rabbitmq:
     enabled: true
     ip: 127.0.0.1
     port: 5672
-    username: guest
-    password: guest
+    username: admin
+    password: adminoyq
   mysql:
 #    ip: 106.15.38.8
 #    username: root
 #    password: adminoyq
     ip: 127.0.0.1
     username: root
-    password: 123456
+    password: adminoyq
     port: 3306
     driverClassName: com.mysql.cj.jdbc.Driver
     database: zuihou_defaults_yj
+    #database: imcs_defaults_yj_test
     url: jdbc:mysql://${zuihou.mysql.ip}:${zuihou.mysql.port}/${zuihou.mysql.database}?serverTimezone=CTT&characterEncoding=utf8&useUnicode=true&useSSL=false&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
   database:
-    tenantDatabasePrefix: zuihou_base_yj
+    tenantDatabasePrefix: zuihou_base_yj2
+    #tenantDatabasePrefix: imcs_base_yj_test
     multiTenantType: SCHEMA
     isNotWrite: false
     isBlockAttack: false  # 是否启用 攻击 SQL 阻断解析器
@@ -69,6 +70,8 @@ zuihou:
       endpoint: http://oss-cn-shenzhen.aliyuncs.com
       access-key-id: test
       access-key-secret: test
+  print:
+    printCodePath: "\\\\192.168.11.247\\ZDesigner ZT210-200dpi ZPL"
   swagger:
     license: Powered By zuihou
     licenseUrl: https://github.com/zuihou
@@ -284,7 +287,7 @@ mybatis-plus:
     #配置JdbcTypeForNull, oracle数据库必须配置
     jdbc-type-for-null: 'null'
     call-setters-on-nulls: true
-#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+    #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
 
 j2cache:
   #  config-location: /j2cache.properties

+ 8 - 5
imcs-admin-boot/imcs-authority-server/src/main/resources/bootstrap.yml

@@ -6,19 +6,22 @@ spring:
   profiles:
     active: test
 logging:
+  level:
+    com.github.zuihou: ERROR
   file:
-    path: /data/projects/logs
+    path: D:\data\projects\logs
     name: ${logging.file.path}/${spring.application.name}/root.log
 
+
 machine:
 #  ip: 192.168.170.32
 ##  port: 21
 ##  username: ftpUser1
 ##  password: 1
 ##  path: /cncFile
-  ip: 192.168.170.25
+  ip: 192.168.11.245
   port: 21
-  username: PROG
-  password: abc.1234
-  path:
+  username: measuring
+  password: Imcs@123456
+  path: /
 

+ 4 - 3
imcs-admin-boot/imcs-authority-server/src/main/resources/logback-spring.xml

@@ -43,13 +43,13 @@
     </springProfile>
 
     <springProfile name="test,dev">
-        <logger name="com.github.zuihou.authority.controller" additivity="true" level="${log.level.controller}">
+        <logger name="com.github.zuihou.authority.controller" additivity="true" level="${log.level.com.github.zuihou}">
             <appender-ref ref="CONTROLLER_APPENDER"/>
         </logger>
-        <logger name="com.github.zuihou.authority.service" additivity="true" level="${log.level.service}">
+        <logger name="com.github.zuihou.authority.service" additivity="true" level="${log.level.com.github.zuihou}">
             <appender-ref ref="SERVICE_APPENDER"/>
         </logger>
-        <logger name="com.github.zuihou.msgs.controller" additivity="true" level="${log.level.controller}">
+        <logger name="com.github.zuihou.msgs.controller" additivity="true" level="${log.level.com.github.zuihou}">
             <appender-ref ref="CONTROLLER_APPENDER"/>
         </logger>
         <logger name="com.github.zuihou.msgs.service" additivity="true" level="${log.level.service}">
@@ -68,4 +68,5 @@
             <appender-ref ref="SERVICE_APPENDER"/>
         </logger>
     </springProfile>
+
 </configuration>

+ 6 - 6
imcs-admin-boot/imcs-authority-server/src/test/java/com/github/zuihou/node/redisTest.java

@@ -53,15 +53,15 @@ public class redisTest {
         Storge storge3 = storgeService.getById(1497080619560075264L);
         msgUtil.redis_set(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_JXS + "1611192951189217285",storge3);
         */
-
-        Storge storge3 = storgeService.getById(1497081499214675968L);
-        msgUtil.redis_set(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_STORE + "1626793025120964610",storge3);
-
+        //1497080228478976000, 1496721304449974272, 1497081209006587904,1497080062724276224(沈2),1497080161923760128
+        Storge storge3 = storgeService.getById(1497080228478976000L);
+        msgUtil.redis_set(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_STORE + "1693583881808359426",storge3);
+        //1497080777182019584 (125)  1497080904667889664 (126)
         Storge storge2 = storgeService.getById(1497080777182019584L);
-        msgUtil.redis_set(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_HCW + "1626793025120964610",storge2);
+        msgUtil.redis_set(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_HCW + "1693583881808359426",storge2);
 
         Storge storge4 = storgeService.getById(1497080619560075264L);
-        msgUtil.redis_set(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_JXS + "1626793025120964610", storge4);
+        msgUtil.redis_set(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_JXS + "1693583881808359426", storge4);
 
     }
 

+ 203 - 0
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/operationManagementCenter/ToolQueryController.java

@@ -0,0 +1,203 @@
+package com.github.zuihou.business.controller.operationManagementCenter;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.support.spring.GenericFastJsonRedisSerializer;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.zuihou.authority.service.common.ParameterService;
+import com.github.zuihou.base.R;
+import com.github.zuihou.base.request.PageParams;
+import com.github.zuihou.business.DemoLine.YunjianConstant;
+import com.github.zuihou.business.edgeLibrary.entity.StockInfo;
+import com.github.zuihou.business.edgeLibrary.entity.Storge;
+import com.github.zuihou.business.edgeLibrary.service.StockInfoService;
+import com.github.zuihou.business.edgeLibrary.service.StorgeService;
+import com.github.zuihou.business.externalApi.service.AgvHikOrderInfoService;
+import com.github.zuihou.business.operationManagementCenter.dto.PlanPageDTO;
+import com.github.zuihou.business.operationManagementCenter.entity.Order;
+import com.github.zuihou.business.operationManagementCenter.entity.OrderTask;
+import com.github.zuihou.business.operationManagementCenter.entity.Plan;
+import com.github.zuihou.business.operationManagementCenter.entity.TaskNode;
+import com.github.zuihou.business.operationManagementCenter.service.OrderTaskService;
+import com.github.zuihou.business.operationManagementCenter.service.TaskNodeService;
+import com.github.zuihou.business.operationManagementCenter.service.TaskService;
+import com.github.zuihou.business.operationManagementCenter.service.WorkpieceService;
+import com.github.zuihou.business.productionResourceCenter.dao.ProductionresourceBizMapper;
+import com.github.zuihou.business.productionResourceCenter.entity.Productionresource;
+import com.github.zuihou.business.productionResourceCenter.service.ProductionresourcePositionService;
+import com.github.zuihou.business.productionResourceCenter.service.ZZoneService;
+import com.github.zuihou.business.util.DynamicRabbitMq;
+import com.github.zuihou.business.util.MsgUtil;
+import com.github.zuihou.common.constant.ParameterKey;
+import com.github.zuihou.common.util.DateUtil;
+import com.github.zuihou.log.annotation.SysLog;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang.time.DateUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.ListOperations;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.client.RestTemplate;
+
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+
+/**
+ * <p>
+ * 前端控制器
+ * 工具查询表
+ * </p>
+ *
+ * @author imcs
+ * @date 2023-12-29
+ */
+@Slf4j
+@Validated
+@RestController
+@RequestMapping("/toolQuery")
+@Api(value = "toolQuery", tags = "工具查询表盘")
+@SysLog(enabled = true)
+public class ToolQueryController {
+
+    @Autowired
+    private StockInfoService stockInfoService;
+    @Autowired
+    private StorgeService storgeService;
+    @Autowired
+    private MsgUtil msgUtil;
+    @Autowired
+    private TaskNodeService taskNodeService;
+    @Autowired
+    private ProductionresourceBizMapper productionresourceBizMapper;
+    @Autowired
+    private ZZoneService zoneService;
+    @Autowired
+    private ProductionresourcePositionService productionresourcePositionService;
+    @Autowired
+    private WorkpieceService workpieceService;
+    @Autowired
+    private TaskService taskService;
+    @Autowired
+    private DynamicRabbitMq dynamicRabbitMq;
+    @Autowired
+    private AgvHikOrderInfoService agvHikOrderInfoService;
+    @Resource
+    private RedisTemplate<String,String> redisTemplate;
+    @Autowired
+    private OrderTaskService orderTaskService;
+    @Autowired
+    private PlanController planController;
+
+    @ApiOperation(value = "查询业务节点状态", notes = "查询业务节点状态")
+    @PostMapping("/getBizStatusList")
+    public R getBizStatusList(@RequestBody Map<String, String> data) {
+        int timeSpan = data.containsKey("timeSpan")? Integer.parseInt(data.get("timeSpan")) : 2;
+        List<TaskNode> statusList = taskNodeService.list(new LambdaQueryWrapper<TaskNode>().eq(TaskNode::getNodeType, "0").in(TaskNode::getExeStatus, new String[]{"2","4","5"}).le(TaskNode::getStartTime, DateUtils.addDays(new Date(),(-1)*timeSpan)));
+        Map map = new HashMap();
+        map.put("data", statusList);
+        return R.success(map);
+    }
+
+    @ApiOperation(value = "查询AGV锁定状态", notes = "查询AGV锁定状态")
+    @PostMapping("/getAgvLockList")
+    public R getAgvLockList(@RequestBody Map<String, String> data) {
+       return agvHikOrderInfoService.queryAgvCheck();
+    }
+
+    @ApiOperation(value = "查询节点回调数据", notes = "查询节点回调数据")
+    @PostMapping("/getCacheCallbackList")
+    public R getCacheCallbackList(@RequestBody Map<String, String> data) {
+        Map map = new HashMap();
+        String hostSystemUrl = (null == msgUtil.redis_get(ParameterKey.PARAMETERS)? "": ((Map<String,String>)msgUtil.redis_get(ParameterKey.PARAMETERS)).get(ParameterKey.HOSTSYSTEMURL).toString());
+        if(StringUtils.isEmpty(hostSystemUrl)) return R.fail("Redis缓存数据不存在");
+        String instructionUrl = "/api/GetCallbackList";
+        JSONObject jsonParam = new JSONObject();
+        jsonParam.put("state",  "1");
+        String callbackTaskList = msgUtil.httpForPost(hostSystemUrl+instructionUrl, jsonParam.toJSONString());
+        if(null==callbackTaskList) return R.fail("CCS数据调用失败");
+        JSONArray jsonArray = JSON.parseArray(callbackTaskList);
+        List<Map> mapList = JSONObject.parseArray(jsonArray.toJSONString(), Map.class);
+        map.put("data", mapList);
+        return R.success(map);
+    }
+
+    @ApiOperation(value = "查询点库位锁定状态", notes = "查询点库位锁定状态")
+    @PostMapping("/getStorgeLockList")
+    public R getStorgeLockList(@RequestBody Map<String, String> data) {
+        List<Storge> storgeList = storgeService.list(new LambdaQueryWrapper<Storge>().eq(Storge::getLockStatus, "0").eq(Storge::getStatus,"1"));
+        Map map = new HashMap();
+        map.put("data", storgeList);
+        return R.success(map);
+    }
+
+    @ApiOperation(value = "查询点库位锁定状态", notes = "查询点库位锁定状态")
+    @PostMapping("/getOfflineList")
+    public R getOfflineList(@RequestBody Map<String, String> data) {
+        List<Productionresource> productionresourcesList = productionresourceBizMapper.selectList(new LambdaQueryWrapper<Productionresource>().eq(Productionresource::getStatus, "0").or().eq(Productionresource::getOnlineStatus, "0").isNotNull(Productionresource::getIp));
+        Map map = new HashMap();
+        map.put("data", productionresourcesList);
+        return R.success(map);
+    }
+
+    @ApiOperation(value = "查询缓存关键字", notes = "查询缓存关键字")
+    @PostMapping("/getCacheKeyList")
+    public R getCacheKeyList(@RequestBody Map<String, String> data) {
+        Map map = new HashMap();
+        map.put(YunjianConstant.YUNJIAN_SHEDULE_FLAG, (null != msgUtil.redis_get(YunjianConstant.YUNJIAN_SHEDULE_FLAG)? 1:0));
+        map.put("PRIORITY_LOCK", (null != msgUtil.redis_get("PRIORITY_LOCK"))? 1:0);
+
+        return R.success(map);
+    }
+
+
+    @ApiOperation(value = "查询自定义订单", notes = "查询自定义订单")
+    @PostMapping("/getOrderTaskList")
+    public R getOrderTaskList(@RequestBody Map<String, String> data) {
+        PageParams<PlanPageDTO> planPage = new PageParams<PlanPageDTO>();
+        IPage<Plan> page = planPage.buildPage();
+        PlanPageDTO planPageDTO = PlanPageDTO.builder().build();
+        planPageDTO.setPlanStatus("2").setSingleTaskFlag("1");
+        planPage.setModel(planPageDTO);
+        planController.query(planPage, page, 10L);
+        R result = planController.page(planPage);
+        return R.success(result);
+    }
+
+
+    /**
+     * 处理超时节点
+     *
+     */
+    @Scheduled(cron="0 0/10 * * * ?")
+    public void cronTaskNode(){
+        Date date = DateUtils.addMinutes(new Date(), -20);
+        Map map = new HashMap();
+        R result = this.getCacheCallbackList(map);
+        Map datas = (Map)result.getData();
+        List<Map> mapList = (List<Map>)datas.get("data");
+        List<Map> resultList = mapList.stream().filter(item->{
+            String dateStr = item.get("createTime").toString().replace("T", " ");
+            Date createTime = DateUtil.stringToDate7(dateStr);
+            return item.get("address").toString().equals("DB200.50") &&  DateUtil.dateDiff(createTime, date);
+        }).collect(Collectors.toList());
+        if(resultList.size() > 0){
+            Map dataMap = resultList.get(0);
+            String content = dataMap.get("operateName").toString()+"节点("+  dataMap.get("taskNodeId").toString() +")任务执行超时";
+            msgUtil.createWarnLog(content, "TimeoutException");
+        }
+    }
+}

+ 5 - 0
imcs-admin-boot/imcs-common/pom.xml

@@ -78,6 +78,11 @@
             <artifactId>ganymed-ssh2</artifactId>
             <version>262</version>
         </dependency>
+        <dependency>
+            <groupId>com.dameng</groupId>
+            <artifactId>Dm8JdbcDriver18</artifactId>
+            <version>8.1.1.49</version>
+        </dependency>
     </dependencies>
 
 </project>

+ 7 - 0
imcs-admin-boot/imcs-jobs/imcs-jobs-server/src/main/resources/application-dev.yml

@@ -6,6 +6,13 @@ zuihou:
     password: LomdtE@ShiTong2021
 
 xxl.job:
+  mail:
+    host: smtp.163.com
+    port: 25
+    ssl: false
+    username: ovono802302@163.com
+    password: asdfzxcv
+    sendNick: 《任务调度平台ZUIHOU-JOB》
   executor:
     ip: ${EXECUTOR_IP:127.0.0.1}
     port: ${EXECUTOR_PORT:8771}

+ 2 - 0
imcs-admin-boot/imcs-jobs/imcs-jobs-server/src/main/resources/bootstrap.yml

@@ -1,6 +1,8 @@
 spring:
   application:
     name: @project.artifactId@
+  profiles:
+    active: prod
 
 logging:
   file: