| | |
| | | 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.*; |
| | |
| | | import org.apache.commons.lang.StringUtils; |
| | | 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; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Slf4j |
| | |
| | | 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 |
| | | * |
| | |
| | | * @return |
| | | */ |
| | | @Expose |
| | | public String ajaxTestWeight(GateWayTestParam parameter) { |
| | | double weigh = (double) parameter.getWeight(); |
| | | //double weigh = Double.parseDouble("3500.0"); |
| | | 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 "没有设备"; |
| | |
| | | * @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 "没有设备"; |
| | |
| | | packet.setHeaders(header); |
| | | packet.setMessageType(ScConstant.MESSAGE_TYPE_REPORT_PROPERTY); |
| | | packet.setDeviceId(device.getDeviceId()); |
| | | |
| | | packet.setMessageId(System.currentTimeMillis() + ""); |
| | | //设置信息主体 |
| | | LprData lpr = new LprData(); |
| | | lpr.setDeviceId(device.getDeviceId()); |
| | |
| | | * @return |
| | | */ |
| | | @Expose |
| | | public String ajaxTestGrain(GateWayTestParam parameter) { |
| | | public String ajaxTestGrain(Map<String ,Object> parameter) { |
| | | |
| | | //获取设备配置,只针对粮情设备进行执行 |
| | | |
| | |
| | | return "ERROR:为获取到系统中设备配置,取消执行"; |
| | | } |
| | | |
| | | Date dayTime = (Date) parameter.getDayTime(); |
| | | Date dayTime = (Date) parameter.get("dayTime"); |
| | | if (null == dayTime) dayTime = new Date(); |
| | | |
| | | Date start = DateUtil.getCurZero(dayTime); |