|
@@ -39,6 +39,7 @@ public class MeasurementSettlementRecordHander {
|
|
|
MeasurementSettlementMapper measurementSettlementMapper;
|
|
|
@Resource
|
|
|
DeviceMapper deviceMapper;
|
|
|
+ int theDeviceDoesNotStart=5;
|
|
|
private String dateFormat="yyyyMMdd";
|
|
|
@XxlJob("measurementHandler")
|
|
|
public ReturnT<String> execute(String info) {
|
|
@@ -182,12 +183,14 @@ public class MeasurementSettlementRecordHander {
|
|
|
*/
|
|
|
protected MeterReadRecordDTO getClearingStartMeterRecord(Device device,Date clearingStartDate ,MeasurementRecord lastItem,List<MeterReadRecord> records) {
|
|
|
MeterReadRecordDTO r = new MeterReadRecordDTO();
|
|
|
- if(device.getDeviceStatus() == 5) { // 设备为未启动则直接设置为 0
|
|
|
+ // 设备为未启动则直接设置为 0
|
|
|
+ if(device.getDeviceStatus()==theDeviceDoesNotStart) {
|
|
|
r.setReadDateTime(clearingStartDate);
|
|
|
r.setReadData(0d);
|
|
|
}
|
|
|
else {
|
|
|
- if(lastItem != null) { // 将上期抄表止度作为本期抄表开始起度
|
|
|
+ // 将上期抄表止度作为本期抄表开始起度
|
|
|
+ if(lastItem != null) {
|
|
|
r.setReadDateTime(lastItem.getCurrentPeriodDate());
|
|
|
r.setReadData(Double.valueOf(lastItem.getCurrentReading()));
|
|
|
}
|
|
@@ -225,12 +228,14 @@ public class MeasurementSettlementRecordHander {
|
|
|
*/
|
|
|
protected MeterReadRecordDTO getClearingEndMeterRecord(Device device,Date clearingEndDate ,MeasurementRecord lastItem,List<MeterReadRecord> records) {
|
|
|
MeterReadRecordDTO r = new MeterReadRecordDTO();
|
|
|
- if(device.getDeviceStatus() == 5) { // 设备为未启动则直接设置为 0
|
|
|
+ // 设备为未启动则直接设置为 0
|
|
|
+ if(device.getDeviceStatus() == theDeviceDoesNotStart) {
|
|
|
r.setReadDateTime(clearingEndDate);
|
|
|
r.setReadData(0d);
|
|
|
}
|
|
|
else {
|
|
|
- if(CollectionUtils.isEmpty(records)) { // 本期结算周期内无数据,则直接取上期的结束数据
|
|
|
+ // 本期结算周期内无数据,则直接取上期的结束数据
|
|
|
+ if(CollectionUtils.isEmpty(records)) {
|
|
|
if(lastItem != null) {
|
|
|
r.setReadDateTime(lastItem.getCurrentPeriodDate());
|
|
|
r.setReadData(Double.valueOf(lastItem.getCurrentReading()));
|