From 93e01fa050330ead95041ed11cc85e9765c19fc1 Mon Sep 17 00:00:00 2001 From: vince <757871790@qq.com> Date: 星期四, 09 十一月 2023 12:06:52 +0800 Subject: [PATCH] 手动测试 --- /dev/null | 20 ------ src/main/java/com/fzzy/gateway/hx2023/service/HxGatewaySyncGrainImpl.java | 3 src/main/java/com/fzzy/gateway/service/GatewayDeviceService.java | 35 +++++++---- src/main/java/com/fzzy/gateway/entity/GateWayTestParam.java | 22 +++++++ src/main/java/com/fzzy/gateway/view/GatewayConf.view.xml | 26 ++++---- pom.xml | 34 ++++++++--- 6 files changed, 85 insertions(+), 55 deletions(-) diff --git a/pom.xml b/pom.xml index f07fe00..dbf365c 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <spring.boot.version>2.1.2.RELEASE</spring.boot.version> <spring.version>5.1.1.RELEASE</spring.version> - <dorado.version>7.6.0-SNAPSHOT</dorado.version> + <dorado.version>7.5.16</dorado.version> <druid.version>1.2.8</druid.version> <mysql.version>5.1.45</mysql.version> <fastjson.version>2.0.10</fastjson.version> @@ -232,20 +232,24 @@ <systemPath>${project.basedir}/src/main/resources/lib/examples.jar</systemPath> </dependency> +<!-- <dependency>--> +<!-- <groupId>net.java.dev.jna</groupId>--> +<!-- <artifactId>jna</artifactId>--> +<!-- <version>4.2.1</version>--> +<!-- </dependency>--> +<!-- <dependency>--> +<!-- <groupId>com.sun.jna</groupId>--> +<!-- <artifactId>jna</artifactId>--> +<!-- <version>3.0.9</version>--> +<!-- <scope>system</scope>--> +<!-- <systemPath>${project.basedir}/src/main/resources/lib/jna.jar</systemPath>--> +<!-- </dependency>--> <dependency> <groupId>com.sun.jna</groupId> <artifactId>jna</artifactId> <version>3.0.9</version> - <scope>system</scope> - <systemPath>${project.basedir}/src/main/resources/lib/jna.jar</systemPath> </dependency> - -<!-- <dependency>--> -<!-- <groupId>com.sun.jna</groupId>--> -<!-- <artifactId>jna</artifactId>--> -<!-- <version>3.0.9</version>--> -<!-- </dependency>--> @@ -340,7 +344,6 @@ <build> - <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -352,6 +355,17 @@ <encoding>UTF-8</encoding> </configuration> </plugin> + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>repackage</goal> + </goals> + </execution> + </executions> + </plugin> <!-- <plugin>--> <!-- <groupId>org.springframework.boot</groupId>--> <!-- <artifactId>spring-boot-maven-plugin</artifactId>--> diff --git a/src/main/java/com/fzzy/gateway/entity/GateWayTestParam.java b/src/main/java/com/fzzy/gateway/entity/GateWayTestParam.java new file mode 100644 index 0000000..0dac24d --- /dev/null +++ b/src/main/java/com/fzzy/gateway/entity/GateWayTestParam.java @@ -0,0 +1,22 @@ +package com.fzzy.gateway.entity; + +import com.bstek.dorado.annotation.PropertyDef; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +public class GateWayTestParam implements Serializable { + private static final long serialVersionUID = 1L; + @PropertyDef(label = "寮�濮嬫椂闂�") + private Date start; + @PropertyDef(label = "鎴鏃堕棿") + private Date end; + @PropertyDef(label = "鎵ц鏃堕棿") + private Date dayTime; + @PropertyDef(label = "閲嶉噺") + private Double weight; + @PropertyDef(label = "杞︾墝鍙�") + private String carNumber; +} diff --git a/src/main/java/com/fzzy/gateway/hx2023/data/GateWayTestParam.java b/src/main/java/com/fzzy/gateway/hx2023/data/GateWayTestParam.java deleted file mode 100644 index c2bbde3..0000000 --- a/src/main/java/com/fzzy/gateway/hx2023/data/GateWayTestParam.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.fzzy.gateway.hx2023.data; - -import lombok.Data; - -import java.util.Date; - -@Data -public class GateWayTestParam { - - private Date start; - - private Date end; - - private Date dayTime; - - private Double weight; - - private String carNumber; - -} diff --git a/src/main/java/com/fzzy/gateway/hx2023/service/HxGatewaySyncGrainImpl.java b/src/main/java/com/fzzy/gateway/hx2023/service/HxGatewaySyncGrainImpl.java index eba0819..d6f948e 100644 --- a/src/main/java/com/fzzy/gateway/hx2023/service/HxGatewaySyncGrainImpl.java +++ b/src/main/java/com/fzzy/gateway/hx2023/service/HxGatewaySyncGrainImpl.java @@ -13,6 +13,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; import org.springframework.stereotype.Component; +import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; @@ -22,7 +23,7 @@ */ @Slf4j @Data -@Component +@Service public class HxGatewaySyncGrainImpl implements GatewaySyncGranService { diff --git a/src/main/java/com/fzzy/gateway/service/GatewayDeviceService.java b/src/main/java/com/fzzy/gateway/service/GatewayDeviceService.java index 55c6cf2..cd59c8f 100644 --- a/src/main/java/com/fzzy/gateway/service/GatewayDeviceService.java +++ b/src/main/java/com/fzzy/gateway/service/GatewayDeviceService.java @@ -13,7 +13,7 @@ import com.fzzy.gateway.GatewayUtils; import com.fzzy.gateway.api.DeviceReportService; import com.fzzy.gateway.api.GatewayRemoteManager; -import com.fzzy.gateway.data.BaseResp; +import com.fzzy.gateway.entity.GateWayTestParam; import com.fzzy.gateway.entity.GatewayDevice; import com.fzzy.gateway.hx2023.ScConstant; import com.fzzy.gateway.hx2023.data.*; @@ -24,10 +24,8 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang.math.RandomUtils; import org.apache.commons.lang.time.DateFormatUtils; import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Sort; import org.springframework.stereotype.Component; @@ -61,7 +59,20 @@ Sort sort = new Sort(Sort.Direction.ASC, "deviceId"); return gatewayDeviceRep.findAll(sort); } - + /** + * gatewayDeviceService#getQuery + * @return + */ + @DataProvider + public GateWayTestParam getQuery() { + GateWayTestParam param = new GateWayTestParam(); + param.setDayTime(new Date()); + param.setCarNumber("宸滱12345"); + param.setEnd(new Date()); + param.setStart(new Date()); + param.setWeight(25000.00); + return param; + } /** * gatewayDeviceService#updateSave * @@ -124,9 +135,9 @@ * @return */ @Expose - public String ajaxTestWeight() { - //double weigh = (double) parameter.getWeight(); - double weigh = Math.random() * (35000 - 16000 + 1) + 16000; + public String ajaxTestWeight(Map<String ,Object> parameter) { + double weigh = (double) parameter.get("weight"); + //sdouble weigh = Math.random() * (35000 - 16000 + 1) + 16000; List<GatewayDevice> devices = listAll(); if (devices == null || devices.size() <= 0) { return "娌℃湁璁惧"; @@ -176,9 +187,9 @@ * @return */ @Expose - public String ajaxTestLpr() { - //String carNumber = parameter.getCarNumber(); - String carNumber = "宸滱12345"; + public String ajaxTestLpr(Map<String ,Object> parameter) { + String carNumber = (String) parameter.get("carNumber"); + //String carNumber = "宸滱12345"; List<GatewayDevice> devices = listAll(); if (devices == null || devices.size() <= 0) { return "娌℃湁璁惧"; @@ -227,7 +238,7 @@ * @return */ @Expose - public String ajaxTestGrain(GateWayTestParam parameter) { + public String ajaxTestGrain(Map<String ,Object> parameter) { //鑾峰彇璁惧閰嶇疆锛屽彧閽堝绮儏璁惧杩涜鎵ц @@ -237,7 +248,7 @@ return "ERROR锛氫负鑾峰彇鍒扮郴缁熶腑璁惧閰嶇疆锛屽彇娑堟墽琛�"; } - Date dayTime = (Date) parameter.getDayTime(); + Date dayTime = (Date) parameter.get("dayTime"); if (null == dayTime) dayTime = new Date(); Date start = DateUtil.getCurZero(dayTime); diff --git a/src/main/java/com/fzzy/gateway/view/GatewayConf.view.xml b/src/main/java/com/fzzy/gateway/view/GatewayConf.view.xml index 9b9ec87..3e6254f 100644 --- a/src/main/java/com/fzzy/gateway/view/GatewayConf.view.xml +++ b/src/main/java/com/fzzy/gateway/view/GatewayConf.view.xml @@ -82,8 +82,8 @@ <Property name="label">绮簱绯荤粺涓簱鍖虹紪鐮�</Property> </PropertyDef> </DataType> - <DataType name="dtParam" parent="Map"> - <Property name="creationType">com.fzzy.gateway.hx2023.data.GateWayTestParam</Property> + <DataType name="dtParam"> + <Property name="creationType">com.fzzy.gateway.entity.GateWayTestParam</Property> <PropertyDef name="start"> <Property name="dataType">DateTime</Property> </PropertyDef> @@ -111,8 +111,8 @@ <Property name="dataProvider">gatewayConfService#listAll</Property> </DataSet> <DataSet id="dsQuery"> - <ClientEvent name="onReady">self.insert({});</ClientEvent> <Property name="dataType">dtParam</Property> + <Property name="dataProvider">gatewayDeviceService#getQuery</Property> </DataSet> <ToolBar> <ToolBarLabel> @@ -170,12 +170,12 @@ <Property name="iconClass">fa fa-search</Property> <Property name="exClassName">toolbar-button-push</Property> </ToolBarButton> - <ToolBarButton> - <ClientEvent name="onClick">view.get("#dialogLpr").show();</ClientEvent> - <Property name="caption">杞︾墝璇嗗埆鎺ㄩ�佹祴璇�</Property> - <Property name="iconClass">fa fa-search</Property> - <Property name="exClassName">toolbar-button-push</Property> - </ToolBarButton> + <ToolBarButton> + <ClientEvent name="onClick">view.get("#dialogLpr").show();</ClientEvent> + <Property name="caption">杞︾墝璇嗗埆鎺ㄩ�佹祴璇�</Property> + <Property name="iconClass">fa fa-search</Property> + <Property name="exClassName">toolbar-button-push</Property> + </ToolBarButton> <ToolBarButton> <Property name="caption">缃戝叧鍒濆鍖�</Property> <Property name="iconClass">fa fa-search</Property> @@ -404,7 +404,7 @@ <Buttons> <Button> <ClientEvent name="onClick">var data = view.get("#dsQuery.data");
 -view.get("#ajaxTestWeight").set("parameter",data.get("weight")).execute(function(result){
 +view.get("#ajaxTestWeight").set("parameter",data.toJSON()).execute(function(result){
 self.get("parent").hide();
 $alert(result);
 });</ClientEvent> @@ -439,11 +439,13 @@ <Buttons> <Button> <ClientEvent name="onClick">var data = view.get("#dsQuery.data");
 -view.get("#ajaxTestLpr").set("parameter",data).execute(function(result){
 +console.log(data.toJSON());
 +view.get("#ajaxTestLpr").set("parameter",data.toJSON()).execute(function(result){
 self.get("parent").hide();
 $alert(result);
 });</ClientEvent> <Property name="caption">纭畾鎵ц</Property> + <Property name="action">updateAction1</Property> </Button> <Button> <ClientEvent name="onClick">view.get("#dialogLpr").hide();</ClientEvent> @@ -464,8 +466,8 @@ <Tools/> </Dialog> <AjaxAction id="ajaxTestLpr"> - <Property name="service">gatewayDeviceService#ajaxTestLpr</Property> <Property name="executingMessage">鍦ㄥ姫鍔涙墽琛屼腑鈥︹��</Property> + <Property name="service">gatewayDeviceService#ajaxTestLpr</Property> </AjaxAction> </View> </ViewConfig> -- Gitblit v1.9.3