doum
9 天以前 0201c32312f6478b2bde706607c8c6338e9e1d06
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
package com.doumee.service.business.impl;
 
import com.alibaba.fastjson.JSONObject;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.device.ElectronicToolUtil;
import com.doumee.core.device.WaterElectricityUtil;
import com.doumee.core.device.model.response.CollectorStatusResponse;
import com.doumee.core.device.model.response.ElectronicDataResponse;
import com.doumee.core.device.model.response.MeterInfoResponse;
import com.doumee.core.exception.BusinessException;
import com.doumee.core.haikang.model.param.respose.AcsDeviceInfoResponse;
import com.doumee.core.haikang.model.param.respose.AscDeviceStatusInfoResponse;
import com.doumee.core.haikang.model.param.respose.DoorsInfoResponse;
import com.doumee.core.haikang.model.param.respose.LedRecordsInfoResponse;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DateUtil;
import com.doumee.dao.business.model.Device;
import com.doumee.dao.business.model.DeviceData;
import com.doumee.dao.business.model.YwDevice;
import com.doumee.dao.business.model.YwElectrical;
import com.doumee.dao.business.model.YwElectricalParam;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.YwElectricalMapper;
import com.doumee.service.business.YwElectricalBizService;
import com.doumee.service.business.YwElectricalService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.doumee.core.model.LoginUserInfo;
 
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
 
/**
 * 电表设备信息Service实现
 * @author doumee
 * @date 2026-05-20 14:59:06
 */
@Service
public class YwElectricalServiceImpl implements YwElectricalService {
 
    @Autowired
    private YwElectricalMapper ywElectricalMapper;
    @Autowired
    private YwElectricalBizService ywElectricalBizService;
 
    @Override
    public Integer create(YwElectrical ywElectrical) {
        ywElectricalMapper.insert(ywElectrical);
        return ywElectrical.getId();
    }
 
    @Override
    public void deleteById(Integer id) {
        ywElectricalMapper.deleteById(id);
    }
  @Override
    public void deleteByIdInBatch(List<Integer> ids ) {
        if (CollectionUtils.isEmpty(ids)) {
            return;
        }
        for(Integer id :ids){
            deleteById(id);
        }
    }
    @Override
    public void deleteById(Integer id, LoginUserInfo user) {
        ywElectricalMapper.deleteById(id);
    }
  @Override
    public void deleteByIdInBatch(List<Integer> ids, LoginUserInfo user) {
        if (CollectionUtils.isEmpty(ids)) {
            return;
        }
       for(Integer id :ids){
            deleteById(id,user);
        }
    }
    @Override
    public void delete(YwElectrical ywElectrical) {
        UpdateWrapper<YwElectrical> deleteWrapper = new UpdateWrapper<>(ywElectrical);
        ywElectricalMapper.delete(deleteWrapper);
    }
 
 
    @Override
    public void updateById(YwElectrical ywElectrical) {
        ywElectricalMapper.updateById(ywElectrical);
    }
 
    @Override
    public void updateByIdInBatch(List<YwElectrical> ywElectricals) {
        if (CollectionUtils.isEmpty(ywElectricals)) {
            return;
        }
        for (YwElectrical ywElectrical: ywElectricals) {
            this.updateById(ywElectrical);
        }
    }
 
    @Override
    public YwElectrical findById(Integer id) {
        return ywElectricalMapper.selectById(id);
    }
 
    @Override
    public YwElectrical findOne(YwElectrical ywElectrical) {
        QueryWrapper<YwElectrical> wrapper = new QueryWrapper<>(ywElectrical).last("limit 1");
        return ywElectricalMapper.selectOne(wrapper);
    }
 
    @Override
    public List<YwElectrical> findList(YwElectrical ywElectrical) {
        QueryWrapper<YwElectrical> wrapper = new QueryWrapper<>(ywElectrical);
        return ywElectricalMapper.selectList(wrapper);
    }
  
    @Override
    public PageData<YwElectrical> findPage(PageWrap<YwElectrical> pageWrap) {
        IPage<YwElectrical> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
        MPJLambdaWrapper<YwElectrical> queryWrapper = new MPJLambdaWrapper<>();
        Utils.MP.blankToNull(pageWrap.getModel());
        queryWrapper.selectAll(YwElectrical.class)
                .selectAs(YwElectricalParam::getName, YwElectrical::getParamName)
                .leftJoin(YwElectricalParam.class, on -> on
                        .eq(YwElectricalParam::getId, YwElectrical::getElectricalParamId)
                        .eq(YwElectricalParam::getIsdeleted, Constants.ZERO))
                .eq(YwElectrical::getIsdeleted, Constants.ZERO);
        if (StringUtils.isNotBlank(pageWrap.getModel().getMeterKeyword())) {
            String kw = pageWrap.getModel().getMeterKeyword().trim();
            queryWrapper.and(w -> w.like(YwElectrical::getName, kw).or().like(YwElectrical::getAddress, kw));
        }
        queryWrapper.eq(pageWrap.getModel().getId() != null,YwElectrical::getId, pageWrap.getModel().getId());
        queryWrapper.eq(pageWrap.getModel().getCreator() != null,YwElectrical::getCreator, pageWrap.getModel().getCreator());
        if (pageWrap.getModel().getCreateDate() != null) {
            queryWrapper.ge(YwElectrical::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDate()));
            queryWrapper.le(YwElectrical::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateDate()));
        }
        queryWrapper.eq(pageWrap.getModel().getEdirot() != null,YwElectrical::getEdirot, pageWrap.getModel().getEdirot());
        if (pageWrap.getModel().getEditDate() != null) {
            queryWrapper.ge(YwElectrical::getEditDate, Utils.Date.getStart(pageWrap.getModel().getEditDate()));
            queryWrapper.le(YwElectrical::getEditDate, Utils.Date.getEnd(pageWrap.getModel().getEditDate()));
        }
        queryWrapper.eq(pageWrap.getModel().getIsdeleted() != null,YwElectrical::getIsdeleted, pageWrap.getModel().getIsdeleted());
        queryWrapper.eq(pageWrap.getModel().getRemark() != null,YwElectrical::getRemark, pageWrap.getModel().getRemark());
        queryWrapper.eq(pageWrap.getModel().getCollectorId() != null,YwElectrical::getCollectorId, pageWrap.getModel().getCollectorId());
        queryWrapper.eq(pageWrap.getModel().getCode() != null,YwElectrical::getCode, pageWrap.getModel().getCode());
        queryWrapper.eq(pageWrap.getModel().getAddress() != null,YwElectrical::getAddress, pageWrap.getModel().getAddress());
        queryWrapper.eq(pageWrap.getModel().getDeviceType() != null,YwElectrical::getDeviceType, pageWrap.getModel().getDeviceType());
        queryWrapper.eq(pageWrap.getModel().getRate() != null,YwElectrical::getRate, pageWrap.getModel().getRate());
        queryWrapper.eq(pageWrap.getModel().getPayType() != null,YwElectrical::getPayType, pageWrap.getModel().getPayType());
        queryWrapper.eq(pageWrap.getModel().getName() != null,YwElectrical::getName, pageWrap.getModel().getName());
        queryWrapper.eq(pageWrap.getModel().getGatewayId() != null,YwElectrical::getGatewayId, pageWrap.getModel().getGatewayId());
        queryWrapper.eq(pageWrap.getModel().getGatewayPort() != null,YwElectrical::getGatewayPort, pageWrap.getModel().getGatewayPort());
        if (pageWrap.getModel().getLastHeartbeatDate() != null) {
            queryWrapper.ge(YwElectrical::getLastHeartbeatDate, Utils.Date.getStart(pageWrap.getModel().getLastHeartbeatDate()));
            queryWrapper.le(YwElectrical::getLastHeartbeatDate, Utils.Date.getEnd(pageWrap.getModel().getLastHeartbeatDate()));
        }
        queryWrapper.eq(pageWrap.getModel().getBalance() != null,YwElectrical::getBalance, pageWrap.getModel().getBalance());
        queryWrapper.eq(pageWrap.getModel().getRelayStatus() != null,YwElectrical::getRelayStatus, pageWrap.getModel().getRelayStatus());
        if (pageWrap.getModel().getLastOpenDate() != null) {
            queryWrapper.ge(YwElectrical::getLastOpenDate, Utils.Date.getStart(pageWrap.getModel().getLastOpenDate()));
            queryWrapper.le(YwElectrical::getLastOpenDate, Utils.Date.getEnd(pageWrap.getModel().getLastOpenDate()));
        }
        if (pageWrap.getModel().getLastCleanDate() != null) {
            queryWrapper.ge(YwElectrical::getLastCleanDate, Utils.Date.getStart(pageWrap.getModel().getLastCleanDate()));
            queryWrapper.le(YwElectrical::getLastCleanDate, Utils.Date.getEnd(pageWrap.getModel().getLastCleanDate()));
        }
        queryWrapper.eq(pageWrap.getModel().getOnline() != null,YwElectrical::getOnline, pageWrap.getModel().getOnline());
        queryWrapper.eq(pageWrap.getModel().getAccountStatus() != null,YwElectrical::getAccountStatus, pageWrap.getModel().getAccountStatus());
        queryWrapper.eq(pageWrap.getModel().getStatus() != null,YwElectrical::getStatus, pageWrap.getModel().getStatus());
        queryWrapper.eq(pageWrap.getModel().getWarnType() != null,YwElectrical::getWarnType, pageWrap.getModel().getWarnType());
        queryWrapper.eq(pageWrap.getModel().getType() != null,YwElectrical::getType, pageWrap.getModel().getType());
        queryWrapper.eq(pageWrap.getModel().getDId() != null,YwElectrical::getDId, pageWrap.getModel().getDId());
        queryWrapper.eq(pageWrap.getModel().getCId() != null,YwElectrical::getCId, pageWrap.getModel().getCId());
        queryWrapper.eq(pageWrap.getModel().getDescription() != null,YwElectrical::getDescription, pageWrap.getModel().getDescription());
        queryWrapper.eq(pageWrap.getModel().getCsq() != null,YwElectrical::getCsq, pageWrap.getModel().getCsq());
        if (pageWrap.getModel().getDisconnectTime() != null) {
            queryWrapper.ge(YwElectrical::getDisconnectTime, Utils.Date.getStart(pageWrap.getModel().getDisconnectTime()));
            queryWrapper.le(YwElectrical::getDisconnectTime, Utils.Date.getEnd(pageWrap.getModel().getDisconnectTime()));
        }
        if (pageWrap.getModel().getConnectTime() != null) {
            queryWrapper.ge(YwElectrical::getConnectTime, Utils.Date.getStart(pageWrap.getModel().getConnectTime()));
            queryWrapper.le(YwElectrical::getConnectTime, Utils.Date.getEnd(pageWrap.getModel().getConnectTime()));
        }
        queryWrapper.eq(pageWrap.getModel().getBalanceBattery() != null,YwElectrical::getBalanceBattery, pageWrap.getModel().getBalanceBattery());
        if (pageWrap.getModel().getBalanceTime() != null) {
            queryWrapper.ge(YwElectrical::getBalanceTime, Utils.Date.getStart(pageWrap.getModel().getBalanceTime()));
            queryWrapper.le(YwElectrical::getBalanceTime, Utils.Date.getEnd(pageWrap.getModel().getBalanceTime()));
        }
         queryWrapper.orderByDesc(YwElectrical::getId);
         IPage<YwElectrical> result = ywElectricalMapper.selectJoinPage(page, YwElectrical.class,queryWrapper);
         PageData<YwElectrical> pageData = PageData.from(result);
         ywElectricalBizService.enrichList(pageData.getRecords());
         return pageData;
    }
    @Override
    public long count(YwElectrical ywElectrical) {
        QueryWrapper<YwElectrical> wrapper = new QueryWrapper<>(ywElectrical);
        return ywElectricalMapper.selectCount(wrapper);
    }
    @Override
    @Transactional
    public void getElectricalStatus(){
        if(Constants.DEALING_ELECTRICAL_STATUS){
            return ;
        }
        Constants.DEALING_ELECTRICAL_STATUS =true;
        try {
            List<Device> editList = new ArrayList<>();
            Date date = new Date();
            //查询全部门禁设备数据
            ElectronicDataResponse<List<CollectorStatusResponse>>  response = ElectronicToolUtil.collectorStatus();
            if (!ElectronicToolUtil.isDataApiSuccess(response)) {
                throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),
                        ElectronicToolUtil.dataApiErrorMessage(response, "同步采集器状态异常"));
            }
            if(response.getData()!=null && response.getData().size()>0){
                //逻辑删除
                for(CollectorStatusResponse d : response.getData()){
                    ywElectricalMapper.update(null,new UpdateWrapper<YwElectrical>().lambda()
                            .set(YwElectrical::getOnline, d.getOnline()?1:0)
                            .set(YwElectrical::getDescription,d.getDescription())
                            .set(YwElectrical::getCsq,d.getCsq())
                            .set(YwElectrical::getDisconnectTime,d.getDisconnect_time())
                            .set(YwElectrical::getConnectTime,d.getConnect_time())
                            .set(YwElectrical::getEditDate,date)
                            .eq(YwElectrical::getCollectorId,d.getCollectorid()));
                }
            }
        }catch (Exception e){
            throw  new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "同步设备状态失败!");
        }finally {
            Constants.DEALING_ELECTRICAL_STATUS =false;
        }
    }
    @Override
    @Transactional
    public String syncAll(YwElectrical ywElectrical){
        if(Constants.DEALING_ELECTRICAL_SYNCDEVICE){
            throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "同步任务正在执行哦,请稍后查看结果!") ;
        }
        Constants.DEALING_ELECTRICAL_SYNCDEVICE =true;
        try {
            List<YwElectrical> deleteList = new ArrayList<>();
            List<YwElectrical> addList = new ArrayList<>();
            List<YwElectrical> editList = new ArrayList<>();
            Date date = new Date();
            //查询全部门禁设备数据
            List<YwElectrical> allList = ywElectricalMapper.selectList(new QueryWrapper<YwElectrical>().lambda()
                    .eq(YwElectrical::getIsdeleted,Constants.ZERO));
            ElectronicDataResponse<List<MeterInfoResponse>>  response = ElectronicToolUtil.meterList();
            if (!ElectronicToolUtil.isDataApiSuccess(response)) {
                throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),
                        ElectronicToolUtil.dataApiErrorMessage(response, "同步电表数据异常"));
            }
            List<MeterInfoResponse> meterData = response.getData();
            if (meterData == null) {
                meterData = Collections.emptyList();
            }
            if (meterData.isEmpty()) {
                return "同步完成:第三方平台暂无电表数据";
            }
            getDataChangeList(allList, meterData, addList, editList, deleteList, date);
            if(deleteList.size()>0){
                for(YwElectrical d : deleteList){
                    ywElectricalMapper.updateById(d);
                }
            }
            if(addList.size()>0){
                for (YwElectrical d : addList) {
                    ywElectricalMapper.insert(d);
                }
            }
            if(editList.size()>0){
                for(YwElectrical d : editList){
                    ywElectricalMapper.updateById(d);
                }
            }
            return "同步数据:新增【"+addList.size()+"】条,更新【"+editList.size()+"】条,删除【"+deleteList.size()+"】条";
        } catch (BusinessException e) {
            throw e;
        } catch (Exception e) {
            e.printStackTrace();
            String detail = StringUtils.isNotBlank(e.getMessage()) ? e.getMessage() : e.getClass().getSimpleName();
            throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "同步失败:" + detail);
        } finally {
            Constants.DEALING_ELECTRICAL_SYNCDEVICE =false;
        }
    }
    private void getDataChangeList(List<YwElectrical> allList,
                                   List<MeterInfoResponse> dataList ,
                                   List<YwElectrical> addList,
                                   List<YwElectrical> editList,
                                   List<YwElectrical> deleteList,
                                   Date date ) {
        if(dataList!=null && dataList.size()>0){
            //获取海康全部门禁组数据
            for(MeterInfoResponse device : dataList){
                YwElectrical model = getExistedDevice(device,allList);
                if(model !=null){
                    //如果已存在,则更新数据
                    model =  initDeviceDataByData(model,device,date,dataList);
                    editList.add(model);
                }else{
                    //如果不存在,则新增数据
                    model = new YwElectrical();
                    model =  initDeviceDataByData(model,device,date,dataList);
                    addList.add(model);
                }
            }
        }
        if (dataList != null && !dataList.isEmpty()) {
            getDeleteDeviceList(allList, dataList, deleteList, date);
        }
    }
    private boolean isDeletedDevice(YwElectrical device, List<MeterInfoResponse> allHkList) {
        if (allHkList != null && allHkList.size() > 0) {
            for(MeterInfoResponse r : allHkList){
                if(StringUtils.equals(device.getDId(), r.getId())){
                    //表示未删除
                    return  false;
                }
            }
        }
        return  true;
 
    }
    private void getDeleteDeviceList(List<YwElectrical> allList,  List<MeterInfoResponse> allHkList,List<YwElectrical> deleteList ,Date date) {
        if(allList!=null && allList.size()>0){
            for(YwElectrical device : allList){
                if(isDeletedDevice(device,allHkList)){
                    device.setIsdeleted(Constants.ONE);
                    device.setEditDate(date);
                    deleteList.add(device);
                }
            }
        }
    }
    private YwElectrical initDeviceDataByData(YwElectrical model, MeterInfoResponse door, Date date, List<MeterInfoResponse> allHkList) {
        MeterInfoResponse device = getDeviceByid(door.getCollectorid(),allHkList);
        Date originCreateDate = model.getCreateDate();
        model.setIsdeleted(Constants.ZERO);
        model.setEditDate(date);
        if (originCreateDate == null) {
            model.setCreateDate(date);
        }
        model.setDescription(door.getDescription());
        model.setName(door.getDescription());
        model.setCId(door.getCid());
        model.setDId(door.getId());
        model.setPriceid(door.getPriceid());
        model.setParamId(door.getParam_id());
        model.setDeviceType(door.getDevice_type());
        model.setAccountId(door.getAccount_id());
        model.setAddress(door.getAddress());
        model.setCollectorId(door.getCollectorid());
        model.setType(door.getType());
        model.setRelayStatus(door.getRelay_state());
        model.setCsq(door.getCsq());
        model.setAccountStatus(resolveAccountStatusByPurchaseCount(door.getCount()));
        model.setRemark(JSONObject.toJSONString(device));
        return  model;
    }
 
    /** 购买次数大于 0 视为已开户 */
    private Integer resolveAccountStatusByPurchaseCount(String purchaseCount) {
        if (StringUtils.isBlank(purchaseCount)) {
            return Constants.ZERO;
        }
        try {
            return new BigDecimal(purchaseCount.trim()).compareTo(BigDecimal.ZERO) > 0
                    ? Constants.ONE : Constants.ZERO;
        } catch (NumberFormatException e) {
            return Constants.ZERO;
        }
    }
    private MeterInfoResponse getDeviceByid(String indexCode, List<MeterInfoResponse> allHkList ) {
        if(allHkList!=null && allHkList.size()>0){
            for(MeterInfoResponse info : allHkList){
                if(StringUtils.equals(indexCode,info.getCollectorid())){
                    return info;
                }
            }
        }
 
        return new MeterInfoResponse();
    }
    private YwElectrical getExistedDevice(MeterInfoResponse device, List<YwElectrical> allList) {
        if(allList.size()>0){
            for(YwElectrical r : allList){
                if(StringUtils.equals(r.getCollectorId(), device.getCollectorid())){
                    //表示未删除
                    return  r;
                }
            }
        }
        return  null;
    }
 
    @Override
    public void controlDo(Device param){
        YwElectrical model = ywElectricalMapper.selectById(param.getId());
        if(model ==null && Constants.equalsInteger(param.getType(),Constants.DEVICE_TYPE.dianbiao)){
            throw  new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        if (param.getStatus() == null || param.getCmdDate() == null
                ||param.getCmdDate().getTime() <= System.currentTimeMillis()) {
            //如果是开闸
            throw  new BusinessException(ResponseStatus.BAD_REQUEST);
        }
 
        boolean r ;
        String date = DateUtil.formatDate(new Date(),"yyyyMMddHHmmss");
        if(Constants.equalsInteger(param.getStatus(),Constants.ONE)) {
            //如果是开闸
            r = WaterElectricityUtil.electricityAct(param.getIp(),Integer.parseInt(param.getPort()),param.getNo(),0,date);
        }else {
            //如果是合闸
            r = WaterElectricityUtil.electricityAct(param.getIp(),Integer.parseInt(param.getPort()),param.getNo(),1,date);
        }
        if(!r){
            throw  new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"远程控制电表失败,请稍后重试!");
        }
        /*String curremak = "【"+param.getLoginUserInfo().getRealname()
                +"】于"+ DateUtil.getPlusTime2(new Date()) +"进行了"+(Constants.equalsInteger(param.getStatus(),Constants.ONE)?"【合闸】":"【分闸】")+"操作,开关【"+param.getChannelNo()+"】;";
        deviceMapper.update(null,new UpdateWrapper<Device>().lambda()
                .set(Device::getRemark,curremak)
                .set(Device::getEditDate,new Date())
                .set(Device::getEdirot,param.getLoginUserInfo().getId())
                .eq(Device::getId,param.getId()));
        DeviceData data = new DeviceData();
        data.setCreateDate(new Date());
        data.setEditDate(new Date());
        data.setCreator(param.getLoginUserInfo().getId());
        data.setEditor(param.getLoginUserInfo().getId());
        data.setDeviceId(param.getId()+"");
        data.setDataType(Constants.ONE);//
        data.setVal1("远程控制");
        data.setVal2(curremak);
        data.setHappenTime(DateUtil.getPlusTime2(data.getCreateDate()));
        data.setVal3((Constants.equalsInteger(param.getStatus(),Constants.ONE)?"【合闸】":"【分闸】"));
        data.setVal4(param.getLoginUserInfo().getRealname());
        data.setVal5(param.getChannelNo());
        deviceDataMapper.insert(data);
*/
    }
}