From 220141036107ef2103833fcd878de43307ca0905 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期四, 10 四月 2025 21:11:46 +0800
Subject: [PATCH] 补充logbacktest配置,application-test配置
---
/dev/null | 1
smart-man-boot/src/main/resources/dp/dpend-无计算规则.json | 1
smart-man-boot/src/main/java/com/qianwen/smartman/modules/smis/service/impl/WorkstationServiceImpl.java | 12 +++++-
smart-man-boot/src/main/resources/application-test.yml | 39 ++++++++++---------
smart-man-boot/src/main/resources/application.yml | 6 +-
smart-man-boot/src/main/resources/dp/dpend.json | 2
smart-man-boot/src/main/java/com/qianwen/smartman/modules/smis/service/WorkstationDatapointsService.java | 14 ++++++
smart-man-boot/src/main/resources/log/logback-test.xml | 2
smart-man-boot/src/main/java/com/qianwen/smartman/common/interceptor/LicenseCheckInterceptor.java | 2 +
9 files changed, 52 insertions(+), 27 deletions(-)
diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/common/interceptor/LicenseCheckInterceptor.java b/smart-man-boot/src/main/java/com/qianwen/smartman/common/interceptor/LicenseCheckInterceptor.java
index ef94901..1e693a0 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/common/interceptor/LicenseCheckInterceptor.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/common/interceptor/LicenseCheckInterceptor.java
@@ -18,6 +18,8 @@
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
+ //return true;
+
LicenseVerify licenseVerify = new LicenseVerify();
//鏍¢獙璇佷功鏄惁鏈夋晥
boolean verifyResult = licenseVerify.verify();
diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/smis/service/WorkstationDatapointsService.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/smis/service/WorkstationDatapointsService.java
index e17a678..dc68c8b 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/smis/service/WorkstationDatapointsService.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/smis/service/WorkstationDatapointsService.java
@@ -25,6 +25,8 @@
import com.qianwen.smartman.modules.smis.vo.WorkstationDatapointsSubmitVO;
import com.qianwen.smartman.modules.smis.vo.WorkstationDatapointsVO;
+import cn.hutool.core.util.ObjectUtil;
+
@Service
public class WorkstationDatapointsService extends BaseServiceImpl<WorkstationDatapointsMapper, WorkstationDatapoints> {
private Logger log = LoggerFactory.getLogger(this.getClass());
@@ -47,7 +49,9 @@
@Transactional
public void submit(WorkstationDatapointsSubmitVO dpVO) {
-
+ if(ObjectUtil.isEmpty(dpVO.getAppId())) {
+ throw new ServiceException("搴旂敤ID涓嶈兘涓虹┖");
+ }
Workstation usingWorkstation = appIdUsingWorkstation(dpVO.getAppId(),dpVO.getWorkstationId());
if(usingWorkstation != null) {
//appId琚娇鐢�
@@ -147,4 +151,12 @@
return dpVO;
}
+ /**
+ * 鍒犻櫎宸ヤ綅鐨勯噰闆嗘暟鎹偣浣嶉厤缃�
+ * @param workstationId
+ */
+ public void removeByWorkstation(List<Long> workstationIds) {
+ log.info("鍒犻櫎宸ヤ綅鏁版嵁鐐归厤缃紝workstationIds",workstationIds);
+ baseMapper.delete(Wrappers.<WorkstationDatapoints>lambdaQuery().in(WorkstationDatapoints::getWorkstationId, workstationIds));
+ }
}
diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/smis/service/impl/WorkstationServiceImpl.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/smis/service/impl/WorkstationServiceImpl.java
index 6ad77b4..2f2843d 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/smis/service/impl/WorkstationServiceImpl.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/smis/service/impl/WorkstationServiceImpl.java
@@ -152,6 +152,8 @@
private WorkstationDatapointsService wsDpService;
@Autowired
private LicenseWrapper licenseWrapper;
+ @Autowired
+ private WorkstationDatapointsService dataPointService;
private final String NAME = "榛樿宸ヤ綔鍙�";
private final Integer SORT = 1;
@@ -237,9 +239,12 @@
}
return workstationVO;
}
+
+ /**
+ * 楠岃瘉璁稿彲涓厤缃殑璁惧鏁伴噺
+ */
void checkLicenseCount() {
-
Wrapper<Workstation> wrapper = Wrappers.lambdaQuery(Workstation.class).eq(Workstation::getIsDeleted, 0);
Long count = workstationMapper.selectCount(wrapper);
@@ -376,6 +381,9 @@
this.workstationWcsService.deleteByWorkstationIdList(workstationIds);
this.workstationOfMachineService.remove(Wrappers.<WorkstationOfMachine>lambdaQuery().in(WorkstationOfMachine::getWorkstationId, workstationIds));
this.commonGroupOfItemService.remove(Wrappers.<CommonGroupOfItem>lambdaQuery().in(CommonGroupOfItem::getItemId, workstationIds));
+
+ //20250324鏂板锛屽垹闄ゅ伐浣嶅搴旂殑鏁版嵁鐐逛綅閰嶇疆銆�
+ dataPointService.removeByWorkstation(workstationIds);
/*
this.workstationOfMachineService.remove((Wrapper) Wrappers.lambdaQuery().in((v0) -> {
return v0.getWorkstationId();
@@ -407,7 +415,7 @@
return String.valueOf(item.getId());
}).collect(Collectors.toList()));
}
- List<WorkstationVO> workstationVOS = this.workstationMapper.listPage(workStationGroupIdList, workstationVOIPage, keyWord, groupId, CommonGroupConstant.ALL_WORKSTATION_ID, status == null ? CommonConstant.ENABLE : status, type, Integer.valueOf(LocalDate.now().getYear()));
+ List<WorkstationVO> workstationVOS = this.workstationMapper.listPage(workStationGroupIdList, workstationVOIPage, keyWord, groupId, CommonGroupConstant.ALL_WORKSTATION_ID, status == null ? CommonConstant.ENABLE : status, type, LocalDate.now().getYear());
workstationVOS.forEach(workstationVO -> {
String calendarName = workstationVO.getCalendarName();
if (Func.isBlank(calendarName)) {
diff --git a/smart-man-boot/src/main/resources/application-test.yml b/smart-man-boot/src/main/resources/application-test.yml
index e775ca3..a92d39f 100644
--- a/smart-man-boot/src/main/resources/application-test.yml
+++ b/smart-man-boot/src/main/resources/application-test.yml
@@ -1,6 +1,6 @@
# redis
redis:
- host: localhost
+ host: 120.46.212.231
port: 6379
password: root
database: 11
@@ -8,11 +8,11 @@
# database config
datasource:
type: mysql
- url: localhost
+ url: 120.46.212.231
port: 3306
#鏁版嵁搴撳唴濡傛灉娌℃湁琛紝浼氬紩鍙戣繘鍏ュ垵濮嬪寲鐣岄潰
- database: smart_man
- username: root
+ database: smartman
+ username: qwmdc
password: Kknd_1234
driver-class-name: com.mysql.cj.jdbc.Driver
#datasource:
@@ -29,17 +29,6 @@
enabled: true
domain: http://127.0.0.1:1888
-# rocketmq
-rocketmq-name-server: localhost:9876
-
-# tdengine
-tdengine:
- driver: com.taosdata.jdbc.rs.RestfulDriver
- #url: jdbc:TAOS-RS://192.168.1.41:6041/iot_data?charset=UTF-8&locale=en_US.UTF-8&timezone=UTC-8
- url: jdbc:TAOS-RS://localhost:6041/iot_data?charset=UTF-8&locale=en_US.UTF-8&timezone=UTC-8
- username: root
- password: taosdata
-
iotdb:
driver: org.apache.iotdb.jdbc.IoTDBDriver
host: localhost
@@ -48,17 +37,31 @@
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 #褰撳墠瀹㈡埛绔殑榛樿涓婚(澶у鏁版椂鍊欐病浠�涔堢敤)
+ #鍙戦�佽秴鏃舵椂闂�
+ timeout: 3000
+ #蹇冭烦鏃堕棿
+ keepalive: 10
+ connectionTimeout: 3000 #杩炴帴瓒呮椂鏃堕棿
+ isRecevieMsg: false
xxl:
job:
admin:
### xxl-job admin address list, such as "http://address" or "http://address01,http://address02"
- addresses: http://192.168.1.40:31137/xxl-job-admin
+ addresses: http://localhost:8080/xxl-job-admin
### xxl-job executor address
executor:
- appname: phoenix
+ appname: smartman
ip:
# 閮ㄧ讲39锛屼复鏃惰皟鏁� 7017 -> 7117
- port: 7079
+ port: 7089
### xxl-job log path
logpath: /data/applogs/xxl-job/jobhandler
### xxl-job log retention days
diff --git a/smart-man-boot/src/main/resources/application.yml b/smart-man-boot/src/main/resources/application.yml
index 3f14e1c..79c2ba7 100644
--- a/smart-man-boot/src/main/resources/application.yml
+++ b/smart-man-boot/src/main/resources/application.yml
@@ -359,9 +359,9 @@
license:
subject: user #涓讳綋 - 娉ㄦ剰涓讳綋瑕佷笌鐢熸垚璇佷功鐨勪富浣撲竴鑷翠竴鑷达紝涓嶇劧楠岃瘉閫氳繃涓嶄簡
publicAlias: publiccert #鍏挜鍒О
- storePass: a1b2c3 #璁块棶鍏挜搴撶殑瀵嗙爜
- licensePath: D:\lictest\ctest.lic #license浣嶇疆
- publicKeysStorePath: D:\lictest\publicCerts.store #鍏挜浣嶇疆
+ storePass: a1b2c3z4 #璁块棶鍏挜搴撶殑瀵嗙爜
+ licensePath: D:\certs\hwserver\mdc.lic #license浣嶇疆
+ publicKeysStorePath: D:\certs\hwserver\publicCerts.store #鍏挜浣嶇疆
forest:
bean-id: config0 # 鍦╯pring涓婁笅鏂囦腑bean鐨刬d, 榛樿鍊间负forestConfiguration
backend: okhttp3 # 鍚庣HTTP API锛� okhttp3 銆愭敮鎸乣okhttp3`/`httpclient`銆�
diff --git "a/smart-man-boot/src/main/resources/dp/dpend-\345\270\246\350\256\241\347\256\227\350\247\204\345\210\231.json" "b/smart-man-boot/src/main/resources/dp/dpend-\345\270\246\350\256\241\347\256\227\350\247\204\345\210\231.json"
deleted file mode 100644
index 1577a2b..0000000
--- "a/smart-man-boot/src/main/resources/dp/dpend-\345\270\246\350\256\241\347\256\227\350\247\204\345\210\231.json"
+++ /dev/null
@@ -1 +0,0 @@
-[{"prop":"dpUnit","label":"鍗曚綅"},{"prop":"ruleContent","label":"璁$畻瑙勫垯","describe":"璁$畻瑙勫垯鏉ユ簮浜嶽瑙勫垯绠$悊-璁$畻瑙勫垯]锛岄�氳繃lua鑴氭湰缂栧啓璁$畻瑙勫垯锛屽鏁版嵁鐐圭殑鍘熷鏁版嵁杩涜璁$畻锛岀敓鎴愭柊鐨勬暟鎹偣鍙婃暟鎹偣鍊笺��","sendCode":1,"isReqOptions":true,"type":"option","options":["s7status_trans"]},{"prop":"ruleArgs","label":"璁$畻鍙傛暟","describe":"鏍规嵁璁$畻瑙勫垯锛屽~鍐欒绠楀弬鏁帮紝澶氫釜璁$畻鍙傛暟鐢ㄨ嫳鏂団�滐紝鈥濋殧寮�锛涙敞鎰�:dpValue涓洪噰闆嗗埌鐨勫�间笉闇�瑕佸~鍐欍��","sendCode":1},{"prop":"access","isRequired":true,"sendCode":1,"label":"鏉冮檺","describe":"璇诲啓鏉冮檺\\n RO(鍙)锛氬彧鍏佽璇诲彇鐐逛綅鏁版嵁銆乗\nRW(璇�/鍐�)锛氭棦鑳借鍙栨暟鎹篃鑳藉啓鍏ユ暟鎹��","default":"RO","type":"option","options":["RO","RW"]},{"prop":"pollingInterval","isRequired":true,"label":"杞闂撮殧锛坢s锛�","describe":"杞闂撮殧锛坢s锛�","default":1000},{"prop":"keepOriginalValue","isRequired":true,"sendCode":1,"label":"淇濈暀鍘熷鍊�","describe":"淇濈暀鍘熷鍊�","default":true,"type":"boolean"},{"prop":"isSave","isRequired":true,"sendCode":1,"label":"鏄惁瀛樺偍","describe":"鏄惁瀛樺偍","default":true,"type":"boolean"}]
\ No newline at end of file
diff --git "a/smart-man-boot/src/main/resources/dp/dpend-\346\227\240\350\256\241\347\256\227\350\247\204\345\210\231.json" "b/smart-man-boot/src/main/resources/dp/dpend-\346\227\240\350\256\241\347\256\227\350\247\204\345\210\231.json"
new file mode 100644
index 0000000..bb122e8
--- /dev/null
+++ "b/smart-man-boot/src/main/resources/dp/dpend-\346\227\240\350\256\241\347\256\227\350\247\204\345\210\231.json"
@@ -0,0 +1 @@
+[{"prop":"dpUnit","label":"鍗曚綅"},{"prop":"access","isRequired":true,"sendCode":1,"label":"鏉冮檺","describe":"璇诲啓鏉冮檺\\n RO(鍙)锛氬彧鍏佽璇诲彇鐐逛綅鏁版嵁銆乗\nRW(璇�/鍐�)锛氭棦鑳借鍙栨暟鎹篃鑳藉啓鍏ユ暟鎹��","default":"RO","type":"option","options":["RO","RW"]},{"prop":"pollingInterval","isRequired":true,"label":"杞闂撮殧锛坢s锛�","describe":"杞闂撮殧锛坢s锛�","default":1000},{"prop":"keepOriginalValue","isRequired":true,"sendCode":1,"label":"淇濈暀鍘熷鍊�","describe":"淇濈暀鍘熷鍊�","default":true,"type":"boolean"},{"prop":"isSave","isRequired":true,"sendCode":1,"label":"鏄惁瀛樺偍","describe":"鏄惁瀛樺偍","default":true,"type":"boolean"}]
\ No newline at end of file
diff --git a/smart-man-boot/src/main/resources/dp/dpend.json b/smart-man-boot/src/main/resources/dp/dpend.json
index bb122e8..f8060da 100644
--- a/smart-man-boot/src/main/resources/dp/dpend.json
+++ b/smart-man-boot/src/main/resources/dp/dpend.json
@@ -1 +1 @@
-[{"prop":"dpUnit","label":"鍗曚綅"},{"prop":"access","isRequired":true,"sendCode":1,"label":"鏉冮檺","describe":"璇诲啓鏉冮檺\\n RO(鍙)锛氬彧鍏佽璇诲彇鐐逛綅鏁版嵁銆乗\nRW(璇�/鍐�)锛氭棦鑳借鍙栨暟鎹篃鑳藉啓鍏ユ暟鎹��","default":"RO","type":"option","options":["RO","RW"]},{"prop":"pollingInterval","isRequired":true,"label":"杞闂撮殧锛坢s锛�","describe":"杞闂撮殧锛坢s锛�","default":1000},{"prop":"keepOriginalValue","isRequired":true,"sendCode":1,"label":"淇濈暀鍘熷鍊�","describe":"淇濈暀鍘熷鍊�","default":true,"type":"boolean"},{"prop":"isSave","isRequired":true,"sendCode":1,"label":"鏄惁瀛樺偍","describe":"鏄惁瀛樺偍","default":true,"type":"boolean"}]
\ No newline at end of file
+[{"prop":"dpUnit","label":"鍗曚綅"},{"prop":"ruleContent","label":"璁$畻瑙勫垯","describe":"璁$畻瑙勫垯鏉ユ簮浜嶽瑙勫垯绠$悊-璁$畻瑙勫垯]锛岄�氳繃lua鑴氭湰缂栧啓璁$畻瑙勫垯锛屽鏁版嵁鐐圭殑鍘熷鏁版嵁杩涜璁$畻锛岀敓鎴愭柊鐨勬暟鎹偣鍙婃暟鎹偣鍊笺��","sendCode":1,"isReqOptions":true,"type":"option","options":["榛樿"]},{"prop":"ruleArgs","label":"璁$畻鍙傛暟","describe":"鏍规嵁璁$畻瑙勫垯锛屽~鍐欒绠楀弬鏁帮紝澶氫釜璁$畻鍙傛暟鐢ㄨ嫳鏂団�滐紝鈥濋殧寮�锛涙敞鎰�:dpValue涓洪噰闆嗗埌鐨勫�间笉闇�瑕佸~鍐欍��","sendCode":1},{"prop":"access","isRequired":true,"sendCode":1,"label":"鏉冮檺","describe":"璇诲啓鏉冮檺\\n RO(鍙)锛氬彧鍏佽璇诲彇鐐逛綅鏁版嵁銆乗\nRW(璇�/鍐�)锛氭棦鑳借鍙栨暟鎹篃鑳藉啓鍏ユ暟鎹��","default":"RO","type":"option","options":["RO","RW"]},{"prop":"pollingInterval","isRequired":true,"label":"杞闂撮殧锛坢s锛�","describe":"杞闂撮殧锛坢s锛�","default":1000},{"prop":"keepOriginalValue","isRequired":true,"sendCode":1,"label":"淇濈暀鍘熷鍊�","describe":"淇濈暀鍘熷鍊�","default":true,"type":"boolean"},{"prop":"isSave","isRequired":true,"sendCode":1,"label":"鏄惁瀛樺偍","describe":"鏄惁瀛樺偍","default":true,"type":"boolean"}]
\ No newline at end of file
diff --git a/smart-man-boot/src/main/resources/log/logback-test.xml b/smart-man-boot/src/main/resources/log/logback-test.xml
index 4a8ef26..22bf4c6 100644
--- a/smart-man-boot/src/main/resources/log/logback-test.xml
+++ b/smart-man-boot/src/main/resources/log/logback-test.xml
@@ -27,7 +27,7 @@
<appender name="INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 鏃ュ織鏂囦欢杈撳嚭鐨勬枃浠跺悕 -->
- <FileNamePattern>target/blade/log/info-%d{yyyy-MM-dd}.%i.log</FileNamePattern>
+ <FileNamePattern>/var/smartman/logs/info-%d{yyyy-MM-dd}.%i.log</FileNamePattern>
<maxHistory>30</maxHistory>
<totalSizeCap>3GB</totalSizeCap>
<!--鎸夊ぇ灏忓垎鍓插悓涓�澶╃殑-->
--
Gitblit v1.9.3