From 90f695daf5942ec72337014a7961d49aa75b9c47 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期三, 16 十月 2024 15:05:02 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPlatformsServiceImpl.java | 24 ++++++++++++++++++++++--
1 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPlatformsServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPlatformsServiceImpl.java
index b418e56..ec7fc9d 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPlatformsServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPlatformsServiceImpl.java
@@ -1,6 +1,7 @@
package com.doumee.service.business.impl.hksync;
import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
@@ -13,10 +14,12 @@
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DateUtil;
import com.doumee.dao.business.PlatformDeviceMapper;
+import com.doumee.dao.business.PlatformJobMapper;
import com.doumee.dao.business.PlatformMapper;
import com.doumee.dao.business.model.Device;
import com.doumee.dao.business.model.Platform;
import com.doumee.dao.business.model.PlatformDevice;
+import com.doumee.dao.business.model.PlatformJob;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -35,6 +38,8 @@
public class HkSyncPlatformsServiceImpl extends HkSyncBaseServiceImpl {
@Autowired
private PlatformMapper platformMapper;
+ @Autowired
+ private PlatformJobMapper platformJobMapper;
@Autowired
private PlatformDeviceMapper platformDeviceMapper;
@@ -57,7 +62,7 @@
List<PlatformDevice> deviceList = new ArrayList<>();
Date date = new Date();
//鏌ヨ鍏ㄩ儴闂ㄧ璁惧鏁版嵁
- List<Platform> allList = platformMapper.selectList(null);
+ List<Platform> allList = platformMapper.selectList(new QueryWrapper<Platform>().lambda().eq(Platform::getIsdeleted,Constants.ZERO));
List<PlatformListInfoResponse> allHkList = getAllHkList(param);
/**
* 鑾峰彇澧炲垹鏀规暟鎹泦鍚�
@@ -65,9 +70,24 @@
getDataChangeList(allList,allHkList,addList,deviceList,editList,deleteList,date);
if(deleteList.size()>0){
//閫昏緫鍒犻櫎
+ List<Integer> platIds = new ArrayList<>();
for(Platform d : deleteList){
platformMapper.updateById(d);
+ platIds.add(d.getId());
}
+ //鏇存柊鍒犻櫎鐨勬湀鍙颁俊鎭垹姝e湪鎵ц鐨勪綔涓氱姸鎬佷负銆愬緟绛惧埌銆戠姸鎬�
+ platformJobMapper.update(null, new UpdateWrapper<PlatformJob>().lambda()
+ .eq(PlatformJob::getIsdeleted,Constants.ZERO)
+ .notIn(PlatformJob::getStatus,Constants.PlatformJobStatus.WART_SIGN_IN.getKey()
+ ,Constants.PlatformJobStatus.WAIT_CONFIRM.getKey()
+ ,Constants.PlatformJobStatus.DONE.getKey()
+ ,Constants.PlatformJobStatus.LEAVED.getKey()
+ ,Constants.PlatformJobStatus.CANCEL.getKey() )
+ .in(PlatformJob::getPlatformId,platIds)
+ .set(PlatformJob::getPlatformId,null)
+ .set(PlatformJob::getPlatforms,null)
+ .set(PlatformJob::getStatus,Constants.PlatformJobStatus.WART_SIGN_IN.getKey())
+ );
}
if(deviceList.size()>0){
platformDeviceMapper.insert(deviceList);
@@ -188,7 +208,7 @@
d.setCreateDate(model.getCreateDate());
d.setPlatformId(model.getId());
d.setIsdeleted(Constants.ZERO);
- d.setDeviceId(param.getCameraIdompan());
+ d.setDeviceId(param.getCameraId());
d.setName(param.getCameraName());
d.setType(Constants.ONE);
list.add(d);
--
Gitblit v1.9.3