vince
2023-11-09 93e01fa050330ead95041ed11cc85e9765c19fc1
手动测试
已删除1个文件
已修改4个文件
已添加1个文件
128 ■■■■■ 文件已修改
pom.xml 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/gateway/entity/GateWayTestParam.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/gateway/hx2023/data/GateWayTestParam.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/gateway/hx2023/service/HxGatewaySyncGrainImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/gateway/service/GatewayDeviceService.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/gateway/view/GatewayConf.view.xml 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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>-->
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;
}
src/main/java/com/fzzy/gateway/hx2023/data/GateWayTestParam.java
ÎļþÒÑɾ³ý
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 {
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("川A12345");
        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 = "川A12345";
    public String ajaxTestLpr(Map<String ,Object> parameter) {
        String carNumber = (String) parameter.get("carNumber");
        //String carNumber = "川A12345";
        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);
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>
@@ -404,7 +404,7 @@
      <Buttons>
        <Button>
          <ClientEvent name="onClick">var data = view.get(&quot;#dsQuery.data&quot;);&#xD;
view.get(&quot;#ajaxTestWeight&quot;).set(&quot;parameter&quot;,data.get(&quot;weight&quot;)).execute(function(result){&#xD;
view.get(&quot;#ajaxTestWeight&quot;).set(&quot;parameter&quot;,data.toJSON()).execute(function(result){&#xD;
    self.get(&quot;parent&quot;).hide();&#xD;
    $alert(result);&#xD;
});</ClientEvent>
@@ -439,11 +439,13 @@
      <Buttons>
        <Button>
          <ClientEvent name="onClick">var data = view.get(&quot;#dsQuery.data&quot;);&#xD;
view.get(&quot;#ajaxTestLpr&quot;).set(&quot;parameter&quot;,data).execute(function(result){&#xD;
console.log(data.toJSON());&#xD;
view.get(&quot;#ajaxTestLpr&quot;).set(&quot;parameter&quot;,data.toJSON()).execute(function(result){&#xD;
    self.get(&quot;parent&quot;).hide();&#xD;
    $alert(result);&#xD;
});</ClientEvent>
          <Property name="caption">确定执行</Property>
          <Property name="action">updateAction1</Property>
        </Button>
        <Button>
          <ClientEvent name="onClick">view.get(&quot;#dialogLpr&quot;).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>