|
|
|
@ -6,6 +6,7 @@ import com.glxp.api.dao.thrsys.ThrManufacturerMapper;
|
|
|
|
|
import com.glxp.api.entity.dev.*;
|
|
|
|
|
import com.glxp.api.res.inv.InnerOrderPrintResponse;
|
|
|
|
|
import com.glxp.api.service.dev.*;
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
@ -276,25 +277,30 @@ public class HeartService {
|
|
|
|
|
// if (needExec())
|
|
|
|
|
break;
|
|
|
|
|
case DEVICE_INFO_DATA:
|
|
|
|
|
if (needExec(info.getDeviceInfo())) {
|
|
|
|
|
if (needExec(info.getDeviceInfo(),info.getDeviceCheck(),info.getDeviceRepairApply(),info.getDeviceUpkeep())) {
|
|
|
|
|
uploadData(exportType, taskId, x -> x.getDeviceInfoData(info, taskId, now, syncTime));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case DEVICE_CHECK_DATA:
|
|
|
|
|
if (needExec(info.getDeviceCheck(),info.getDeviceCheckDetail(),info.getDeviceCheckDetailItem())) {
|
|
|
|
|
uploadData(exportType, taskId, x -> x.getDeviceCheckData(info, taskId, now, syncTime));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case DEVICE_REPAIR_DATA:
|
|
|
|
|
if (needExec(info.getDeviceRepairApply(),info.getDeviceRepairDetail(),info.getDeviceRepair())) {
|
|
|
|
|
uploadData(exportType, taskId, x -> x.getDeviceRepair(info, taskId, now, syncTime));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case PRODUCE_BUSINESS_DATA:
|
|
|
|
|
// case DEVICE_CHECK_DATA:
|
|
|
|
|
// if (needExec(info.getDeviceCheck(),info.getDeviceCheckDetail(),info.getDeviceCheckDetailItem())) {
|
|
|
|
|
// uploadData(exportType, taskId, x -> x.getDeviceCheckData(info, taskId, now, syncTime));
|
|
|
|
|
// }
|
|
|
|
|
// break;
|
|
|
|
|
// case DEVICE_REPAIR_DATA:
|
|
|
|
|
// if (needExec(info.getDeviceRepairApply(),info.getDeviceRepairDetail(),info.getDeviceRepair())) {
|
|
|
|
|
// uploadData(exportType, taskId, x -> x.getDeviceRepair(info, taskId, now, syncTime));
|
|
|
|
|
// }
|
|
|
|
|
// break;
|
|
|
|
|
case PRODUCE_BUSINESS_DATA:
|
|
|
|
|
if (needExec(info.getProduceBusiness())) {
|
|
|
|
|
uploadData(exportType, taskId, x -> x.getProBusinessData(info, taskId, now, syncTime));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
// case DEVICE_UPKEEP_DATA:
|
|
|
|
|
// if (needExec(info.getDeviceUpkeep())) {
|
|
|
|
|
// uploadData(exportType, taskId, x -> x.getDeviceUpkeepData(info, taskId, now, syncTime));
|
|
|
|
|
// }
|
|
|
|
|
// break;
|
|
|
|
|
case DEVICE_TASK:
|
|
|
|
|
// if (needExec(info.getDeviceTask())) {
|
|
|
|
|
//默认开启
|
|
|
|
@ -1098,6 +1104,7 @@ public class HeartService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceInspectTaskService deviceInspectTaskService;
|
|
|
|
|
@Resource
|
|
|
|
@ -1695,8 +1702,7 @@ public class HeartService {
|
|
|
|
|
}
|
|
|
|
|
Date startTime = new Date();
|
|
|
|
|
|
|
|
|
|
String data = spGetHttp.pullData(exportType);
|
|
|
|
|
log.warn("打印出来{}",data);
|
|
|
|
|
String data = spGetHttp.pullData(exportType);;
|
|
|
|
|
cn.hutool.json.JSONObject obj = JSONUtil.parseObj(data);
|
|
|
|
|
Integer code = obj.getInt("code");
|
|
|
|
|
if (!code.equals(20000)) {
|
|
|
|
@ -1706,7 +1712,7 @@ public class HeartService {
|
|
|
|
|
}
|
|
|
|
|
//数据内容
|
|
|
|
|
String dataStr = obj.getStr("data");
|
|
|
|
|
log.error("shujv neirong xiwangshi duide bushi cuode {}",dataStr);
|
|
|
|
|
// log.error("shujv neirong xiwangshi duide bushi cuode {}",dataStr);
|
|
|
|
|
if (StrUtil.isNotBlank(dataStr)) {
|
|
|
|
|
RelaySyncDto bean = JSONUtil.toBean(dataStr, RelaySyncDto.class);
|
|
|
|
|
log.error("??????????????????{}",bean);
|
|
|
|
@ -1733,6 +1739,9 @@ public class HeartService {
|
|
|
|
|
case DEVICE_REPAIR_DATA:
|
|
|
|
|
this.insertDeviceRepairData(bean.getFileContent());
|
|
|
|
|
break;
|
|
|
|
|
case DEVICE_UPKEEP_DATA:
|
|
|
|
|
this.insertDeviceUpkeepData(bean.getFileContent());
|
|
|
|
|
break;
|
|
|
|
|
case PRODUCE_BUSINESS_DATA:
|
|
|
|
|
this.insertProBusinessData(bean.getFileContent());
|
|
|
|
|
break;
|
|
|
|
@ -1968,12 +1977,16 @@ public class HeartService {
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceCheckDetailItemMapper deviceCheckDetailItemMapper;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceCheckItemDictMapper deviceCheckItemDictMapper;
|
|
|
|
|
|
|
|
|
|
@Transactional(propagation = Propagation.NESTED)
|
|
|
|
|
public void insertDeviceCheckData(String content){
|
|
|
|
|
cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(content);
|
|
|
|
|
List<DeviceCheckEntity> deviceCheckEntities = JSONUtil.toList(jsonObject.getJSONArray(DeviceCheckEntity.class.getSimpleName()), DeviceCheckEntity.class);
|
|
|
|
|
List<DeviceCheckDetailEntity> deviceCheckDetailEntities = JSONUtil.toList(jsonObject.getJSONArray(DeviceCheckDetailEntity.class.getSimpleName()), DeviceCheckDetailEntity.class);
|
|
|
|
|
List<DeviceCheckDetailItemEntity> deviceCheckDetailItemEntities = JSONUtil.toList(jsonObject.getJSONArray(DeviceCheckDetailItemEntity.class.getSimpleName()), DeviceCheckDetailItemEntity.class);
|
|
|
|
|
List<DeviceCheckItemDictEntity> deviceCheckItemDictEntities = JSONUtil.toList(jsonObject.getJSONArray(DeviceCheckItemDictEntity.class.getSimpleName()), DeviceCheckItemDictEntity.class);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(deviceCheckEntities)) {
|
|
|
|
|
for (DeviceCheckEntity deviceCheckEntity : deviceCheckEntities) {
|
|
|
|
|
deviceCheckEntity.setUpdateTime(null);
|
|
|
|
@ -1992,6 +2005,12 @@ public class HeartService {
|
|
|
|
|
}
|
|
|
|
|
deviceCheckDetailItemMapper.replaceBatchs(deviceCheckDetailItemEntities);
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(deviceCheckItemDictEntities)) {
|
|
|
|
|
for (DeviceCheckItemDictEntity deviceCheckItemDictEntity : deviceCheckItemDictEntities) {
|
|
|
|
|
deviceCheckItemDictEntity.setUpdateTime(null);
|
|
|
|
|
}
|
|
|
|
|
deviceCheckItemDictMapper.replaceBatchs(deviceCheckItemDictEntities);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<String> syncFiles = JSONUtil.toList(jsonObject.getJSONArray("syncFiles"), String.class);
|
|
|
|
|
if (CollUtil.isNotEmpty(syncFiles)) {
|
|
|
|
@ -2018,6 +2037,8 @@ public class HeartService {
|
|
|
|
|
List<DeviceRepairApplyEntity> deviceRepairApplyEntities = JSONUtil.toList(jsonObject.getJSONArray(DeviceRepairApplyEntity.class.getSimpleName()), DeviceRepairApplyEntity.class);
|
|
|
|
|
List<DeviceRepairApplyDetailEntity> deviceRepairApplyDetailEntities = JSONUtil.toList(jsonObject.getJSONArray(DeviceRepairApplyDetailEntity.class.getSimpleName()), DeviceRepairApplyDetailEntity.class);
|
|
|
|
|
List<DeviceRepairEntity> deviceRepairEntities = JSONUtil.toList(jsonObject.getJSONArray(DeviceRepairEntity.class.getSimpleName()), DeviceRepairEntity.class);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(deviceRepairApplyEntities)) {
|
|
|
|
|
for (DeviceRepairApplyEntity deviceRepairApplyEntity : deviceRepairApplyEntities) {
|
|
|
|
|
deviceRepairApplyEntity.setUpdateTime(null);
|
|
|
|
@ -2037,6 +2058,54 @@ public class HeartService {
|
|
|
|
|
deviceRepairMapper.replaceBatchs(deviceRepairEntities);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<String> syncFiles = JSONUtil.toList(jsonObject.getJSONArray("syncFiles"), String.class);
|
|
|
|
|
// if (CollUtil.isNotEmpty(syncFiles)) {
|
|
|
|
|
// fileService.download(syncFiles);
|
|
|
|
|
// }
|
|
|
|
|
if (CollUtil.isNotEmpty(syncFiles)) {
|
|
|
|
|
// fileService.download(syncFiles);
|
|
|
|
|
idcService.batchDownloadFile(spGetHttp.getIpUrl(), syncFiles.toArray(new String[syncFiles.size()]));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceUpkeepMapper deviceUpkeepMapper;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceUpkeepDetailMapper deviceUpkeepDetailMapper;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceUpkeepDetailItemMapper deviceUpkeepDetailItemMapper;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 批量 插入 || 更新 报修管理
|
|
|
|
|
* @param content
|
|
|
|
|
*/
|
|
|
|
|
@Transactional(propagation = Propagation.NESTED)
|
|
|
|
|
public void insertDeviceUpkeepData(String content){
|
|
|
|
|
cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(content);
|
|
|
|
|
List<DeviceUpkeepEntity> deviceUpkeepEntities = JSONUtil.toList(jsonObject.getJSONArray(DeviceUpkeepEntity.class.getSimpleName()), DeviceUpkeepEntity.class);
|
|
|
|
|
List<DeviceUpkeepDetailEntity> deviceUpkeepDetailEntities = JSONUtil.toList(jsonObject.getJSONArray(DeviceUpkeepDetailEntity.class.getSimpleName()), DeviceUpkeepDetailEntity.class);
|
|
|
|
|
List<DeviceUpkeepDetailItemEntity> deviceUpkeepDetailItemEntities = JSONUtil.toList(jsonObject.getJSONArray(DeviceUpkeepDetailItemEntity.class.getSimpleName()), DeviceUpkeepDetailItemEntity.class);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(deviceUpkeepEntities)) {
|
|
|
|
|
for (DeviceUpkeepEntity entity : deviceUpkeepEntities) {
|
|
|
|
|
entity.setUpdateTime(null);
|
|
|
|
|
}
|
|
|
|
|
deviceUpkeepMapper.replaceBatchs(deviceUpkeepEntities);
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(deviceUpkeepDetailEntities)) {
|
|
|
|
|
for (DeviceUpkeepDetailEntity entity : deviceUpkeepDetailEntities) {
|
|
|
|
|
entity.setUpdateTime(null);
|
|
|
|
|
}
|
|
|
|
|
deviceUpkeepDetailMapper.replaceBatchs(deviceUpkeepDetailEntities);
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(deviceUpkeepDetailItemEntities)) {
|
|
|
|
|
for (DeviceUpkeepDetailItemEntity entity : deviceUpkeepDetailItemEntities) {
|
|
|
|
|
entity.setUpdateTime(null);
|
|
|
|
|
}
|
|
|
|
|
deviceUpkeepDetailItemMapper.replaceBatchs(deviceUpkeepDetailItemEntities);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<String> syncFiles = JSONUtil.toList(jsonObject.getJSONArray("syncFiles"), String.class);
|
|
|
|
|
if (CollUtil.isNotEmpty(syncFiles)) {
|
|
|
|
|
fileService.download(syncFiles);
|
|
|
|
@ -2499,11 +2568,41 @@ public class HeartService {
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceChangeOrderService deviceChangeOrderService;
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceCheckService deviceCheckService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceCheckDetailService deviceCheckDetailService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceCheckDetailItemService deviceCheckDetailItemService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceCheckItemDictService deviceCheckItemDictService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceUpkeepService deviceUpkeepService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceUpkeepDetailService deviceUpkeepDetailService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceUpkeepDetailItemService deviceUpkeepDetailItemService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceRepairApplyService deviceRepairApplyService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceRepairApplyDetailService deviceRepairApplyDetailService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceRepairService deviceRepairService;
|
|
|
|
|
|
|
|
|
|
public SpsSyncDeviceDataResponse getDeviceInfoData(SyncDataSetEntity info, String taskId, Date now, Date syncTime){
|
|
|
|
|
SpsSyncDeviceDataResponse dataResponse = null;
|
|
|
|
|
Map<String, Object> syncTimeMap = new WeakHashMap<>(3);
|
|
|
|
|
syncTimeMap.put("isNew", true);
|
|
|
|
|
List<String> list = new ArrayList<>();
|
|
|
|
|
boolean ge = false;
|
|
|
|
|
if (syncTime != null) {
|
|
|
|
|
ge = true;
|
|
|
|
@ -2527,33 +2626,6 @@ public class HeartService {
|
|
|
|
|
remark.append("设备基础信息:").append(deptEntityList.size()).append("条\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (dataResponse != null) {
|
|
|
|
|
dataResponse.setTaskId(taskId);
|
|
|
|
|
dataResponse.setType(BasicExportTypeEnum.DEVICE_INFO_DATA.getRemark());
|
|
|
|
|
dataResponse.setSyncRemark(remark.toString());
|
|
|
|
|
}
|
|
|
|
|
log.error("这是第三方数据库的东西 嘿嘿嘿嘿{}",dataResponse);
|
|
|
|
|
return dataResponse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceCheckService deviceCheckService;
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceCheckDetailService deviceCheckDetailService;
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceCheckDetailItemService deviceCheckDetailItemService;
|
|
|
|
|
public SpsSyncDeviceDataResponse getDeviceCheckData(SyncDataSetEntity info, String taskId, Date now, Date syncTime){
|
|
|
|
|
SpsSyncDeviceDataResponse dataResponse = null;
|
|
|
|
|
Map<String, Object> syncTimeMap = new WeakHashMap<>(3);
|
|
|
|
|
syncTimeMap.put("isNew", true);
|
|
|
|
|
boolean ge = false;
|
|
|
|
|
if (syncTime != null) {
|
|
|
|
|
ge = true;
|
|
|
|
|
}
|
|
|
|
|
StringBuffer remark = new StringBuffer();
|
|
|
|
|
/**
|
|
|
|
|
* 确认巡检任务管理开启
|
|
|
|
|
*/
|
|
|
|
@ -2566,14 +2638,13 @@ public class HeartService {
|
|
|
|
|
, map.get("oldDate"), now)
|
|
|
|
|
);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(deviceCheckEntities)) {
|
|
|
|
|
dataResponse = new SpsSyncDeviceDataResponse();
|
|
|
|
|
if (dataResponse == null) {
|
|
|
|
|
dataResponse = new SpsSyncDeviceDataResponse();
|
|
|
|
|
}
|
|
|
|
|
dataResponse.setDeviceCheckEntities(deviceCheckEntities);
|
|
|
|
|
remark.append("巡检任务信息:").append(deviceCheckEntities.size()).append("条\n");
|
|
|
|
|
remark.append("巡检设备数据:").append(deviceCheckEntities.size()).append("条\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//巡检任务具体数据 deviceCheckDetail
|
|
|
|
|
if (needExec(info.getDeviceCheckDetail())) {
|
|
|
|
|
Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.DEV_CHECK_DETAIL);
|
|
|
|
|
|
|
|
|
|
List<DeviceCheckDetailEntity> deviceCheckDetailEntities = deviceCheckDetailService.list(Wrappers.lambdaQuery(DeviceCheckDetailEntity.class)
|
|
|
|
|
.le(!ge && (boolean) map.get("isNew"), DeviceCheckDetailEntity::getUpdateTime, now)
|
|
|
|
|
.between(ge, DeviceCheckDetailEntity::getUpdateTime, syncTime, now)
|
|
|
|
@ -2585,13 +2656,9 @@ public class HeartService {
|
|
|
|
|
dataResponse = new SpsSyncDeviceDataResponse();
|
|
|
|
|
}
|
|
|
|
|
dataResponse.setDeviceCheckDetailEntities(deviceCheckDetailEntities);
|
|
|
|
|
remark.append("巡检设备具体信息:").append(deviceCheckDetailEntities.size()).append("条\n");
|
|
|
|
|
remark.append("巡检设备具体数据:").append(deviceCheckDetailEntities.size()).append("条\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//巡检设备项目表
|
|
|
|
|
if (needExec(info.getDeviceCheckDetailItem())) {
|
|
|
|
|
Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.DEV_CHECK_DETAIL_ITEM);
|
|
|
|
|
//巡检设备项目表
|
|
|
|
|
List<DeviceCheckDetailItemEntity> deviceCheckDetailItemEntities = deviceCheckDetailItemService.list(Wrappers.lambdaQuery(DeviceCheckDetailItemEntity.class)
|
|
|
|
|
.le(!ge && (boolean) map.get("isNew"), DeviceCheckDetailItemEntity::getUpdateTime, now)
|
|
|
|
|
.between(ge, DeviceCheckDetailItemEntity::getUpdateTime, syncTime, now)
|
|
|
|
@ -2603,37 +2670,24 @@ public class HeartService {
|
|
|
|
|
dataResponse = new SpsSyncDeviceDataResponse();
|
|
|
|
|
}
|
|
|
|
|
dataResponse.setDeviceCheckDetailItemEntities(deviceCheckDetailItemEntities);
|
|
|
|
|
remark.append("巡检设备项目表:").append(deviceCheckDetailItemEntities.size()).append("条\n");
|
|
|
|
|
remark.append("巡检设备项目明细表:").append(deviceCheckDetailItemEntities.size()).append("条\n");
|
|
|
|
|
}
|
|
|
|
|
//巡检设备项目字典表
|
|
|
|
|
List<DeviceCheckItemDictEntity> deviceCheckItemDictEntities = deviceCheckItemDictService.list(Wrappers.lambdaQuery(DeviceCheckItemDictEntity.class)
|
|
|
|
|
.le(!ge && (boolean) map.get("isNew"), DeviceCheckItemDictEntity::getUpdateTime, now)
|
|
|
|
|
.between(ge, DeviceCheckItemDictEntity::getUpdateTime, syncTime, now)
|
|
|
|
|
.between(!ge && !(boolean) map.get("isNew"), DeviceCheckItemDictEntity::getUpdateTime
|
|
|
|
|
, map.get("oldDate"), now)
|
|
|
|
|
);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(deviceCheckItemDictEntities)) {
|
|
|
|
|
if (dataResponse == null) {
|
|
|
|
|
dataResponse = new SpsSyncDeviceDataResponse();
|
|
|
|
|
}
|
|
|
|
|
dataResponse.setDeviceCheckItemDictEntities(deviceCheckItemDictEntities);
|
|
|
|
|
remark.append("巡检设备项目字典表:").append(deviceCheckItemDictEntities.size()).append("条\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (dataResponse != null) {
|
|
|
|
|
dataResponse.setTaskId(taskId);
|
|
|
|
|
dataResponse.setType(BasicExportTypeEnum.DEVICE_CHECK_DATA.getRemark());
|
|
|
|
|
dataResponse.setSyncRemark(remark.toString());
|
|
|
|
|
}
|
|
|
|
|
log.error("巡检任务管理的数据,zzhzzhzzh{}",dataResponse);
|
|
|
|
|
return dataResponse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceRepairApplyService deviceRepairApplyService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceRepairApplyDetailService deviceRepairApplyDetailService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceRepairService deviceRepairService;
|
|
|
|
|
// 报修表
|
|
|
|
|
public SpsSyncDeviceDataResponse getDeviceRepair(SyncDataSetEntity info, String taskId, Date now, Date syncTime){
|
|
|
|
|
SpsSyncDeviceDataResponse dataResponse = null;
|
|
|
|
|
Map<String, Object> syncTimeMap = new WeakHashMap<>(3);
|
|
|
|
|
syncTimeMap.put("isNew", true);
|
|
|
|
|
boolean ge = false;
|
|
|
|
|
if (syncTime != null) {
|
|
|
|
|
ge = true;
|
|
|
|
|
}
|
|
|
|
|
StringBuffer remark = new StringBuffer();
|
|
|
|
|
//确认同步报修单开启
|
|
|
|
|
if (needExec(info.getDeviceRepairApply())) {
|
|
|
|
|
Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.DEV_REPAIR_APPLY);
|
|
|
|
@ -2644,14 +2698,13 @@ public class HeartService {
|
|
|
|
|
, map.get("oldDate"), now)
|
|
|
|
|
);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(deviceRepairApplyEntities)) {
|
|
|
|
|
dataResponse = new SpsSyncDeviceDataResponse();
|
|
|
|
|
if (dataResponse == null) {
|
|
|
|
|
dataResponse = new SpsSyncDeviceDataResponse();
|
|
|
|
|
}
|
|
|
|
|
dataResponse.setDeviceRepairApplyEntities(deviceRepairApplyEntities);
|
|
|
|
|
remark.append("报修单数据:").append(deviceRepairApplyEntities.size()).append("条\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//确认开启报修单明细同步
|
|
|
|
|
if (needExec(info.getDeviceRepairDetail())) {
|
|
|
|
|
Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.DEV_REPAIR_APPLY_DETAIL);
|
|
|
|
|
//报修单明细数据
|
|
|
|
|
List<DeviceRepairApplyDetailEntity> deviceRepairApplyDetailEntities = deviceRepairApplyDetailService.list(Wrappers.lambdaQuery(DeviceRepairApplyDetailEntity.class)
|
|
|
|
|
.le(!ge && (boolean) map.get("isNew"), DeviceRepairApplyDetailEntity::getUpdateTime, now)
|
|
|
|
|
.between(ge, DeviceRepairApplyDetailEntity::getUpdateTime, syncTime, now)
|
|
|
|
@ -2664,12 +2717,32 @@ public class HeartService {
|
|
|
|
|
}
|
|
|
|
|
dataResponse.setDeviceRepairApplyDetailEntities(deviceRepairApplyDetailEntities);
|
|
|
|
|
remark.append("报修单明细数据:").append(deviceRepairApplyDetailEntities.size()).append("条\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (dataResponse != null) {
|
|
|
|
|
dataResponse.setTaskId(taskId);
|
|
|
|
|
dataResponse.setType(BasicExportTypeEnum.SYS_SET_DATA.getRemark());
|
|
|
|
|
dataResponse.setSyncRemark(remark.toString());
|
|
|
|
|
if (CollUtil.isNotEmpty(dataResponse.getDeviceRepairApplyDetailEntities())) {
|
|
|
|
|
// List<Map<String, String>> list = new ArrayList<>(spsSyncSysSettingResponse.getSystemPDFTemplateEntities().size() * 2);
|
|
|
|
|
dataResponse.getDeviceRepairApplyDetailEntities().forEach(deviceRepairApplyDetailEntity -> {
|
|
|
|
|
list.add(deviceRepairApplyDetailEntity.getLivePath());
|
|
|
|
|
if (deviceRepairApplyDetailEntity.getDiagnosisLivePath() != null){
|
|
|
|
|
list.add(deviceRepairApplyDetailEntity.getDiagnosisLivePath());
|
|
|
|
|
}
|
|
|
|
|
log.error("当前数据接受到的报修单明细list{}",list);
|
|
|
|
|
// BaseResponse<String> response = spGetHttp.postTemplateFile(list);
|
|
|
|
|
// if (response.getCode() == 20000) {
|
|
|
|
|
// log.error("图片列表上传成功");
|
|
|
|
|
//// uploadFileLog = "\n模板文件列表上传成功";
|
|
|
|
|
// } else {
|
|
|
|
|
// log.info("模板文件上传失败,响应信息:{}", response.getMessage());
|
|
|
|
|
//// uploadFileLog = "\n模板文件列表上传失败,错误信息:" + response.getMessage();
|
|
|
|
|
// }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//确认开启维修单同步
|
|
|
|
|
if (needExec(info.getDeviceRepair())) {
|
|
|
|
|
Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.DEV_REPAIR);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//维修单数据
|
|
|
|
|
List<DeviceRepairEntity> deviceRepairEntities = deviceRepairService.list(Wrappers.lambdaQuery(DeviceRepairEntity.class)
|
|
|
|
|
.le(!ge && (boolean) map.get("isNew"), DeviceRepairEntity::getUpdateTime, now)
|
|
|
|
|
.between(ge, DeviceRepairEntity::getUpdateTime, syncTime, now)
|
|
|
|
@ -2682,19 +2755,274 @@ public class HeartService {
|
|
|
|
|
}
|
|
|
|
|
dataResponse.setDeviceRepairEntities(deviceRepairEntities);
|
|
|
|
|
remark.append("维修单数据:").append(deviceRepairEntities.size()).append("条\n");
|
|
|
|
|
dataResponse.getDeviceRepairEntities().forEach(deviceRepair -> {
|
|
|
|
|
list.add(deviceRepair.getLivePath());
|
|
|
|
|
if (deviceRepair.getDiagnosisLivePath() != null){
|
|
|
|
|
list.add(deviceRepair.getDiagnosisLivePath());
|
|
|
|
|
}
|
|
|
|
|
if (deviceRepair.getServiceLivePath() != null){
|
|
|
|
|
list.add(deviceRepair.getServiceLivePath());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
log.error("当前数据接受到的维修单list{}",list);
|
|
|
|
|
BaseResponse<String> response = spGetHttp.postTemplateFile(list);
|
|
|
|
|
if (response.getCode() == 20000) {
|
|
|
|
|
log.error("图片列表上传成功");
|
|
|
|
|
// uploadFileLog = "\n模板文件列表上传成功";
|
|
|
|
|
} else {
|
|
|
|
|
log.info("模板文件上传失败,响应信息:{}", response.getMessage());
|
|
|
|
|
// uploadFileLog = "\n模板文件列表上传失败,错误信息:" + response.getMessage();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//确认开启同步保养单
|
|
|
|
|
if (needExec(info.getDeviceUpkeep())) {
|
|
|
|
|
Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.DEV_UPKEEP_DATA);
|
|
|
|
|
List<DeviceUpkeepEntity> deviceUpkeepEntities = deviceUpkeepService.list(Wrappers.lambdaQuery(DeviceUpkeepEntity.class)
|
|
|
|
|
.le(!ge && (boolean) map.get("isNew"), DeviceUpkeepEntity::getUpdateTime, now)
|
|
|
|
|
.between(ge, DeviceUpkeepEntity::getUpdateTime, syncTime, now)
|
|
|
|
|
.between(!ge && !(boolean) map.get("isNew"), DeviceUpkeepEntity::getUpdateTime
|
|
|
|
|
, map.get("oldDate"), now)
|
|
|
|
|
);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(deviceUpkeepEntities)) {
|
|
|
|
|
if (dataResponse == null) {
|
|
|
|
|
dataResponse = new SpsSyncDeviceDataResponse();
|
|
|
|
|
}
|
|
|
|
|
dataResponse.setDeviceUpkeepEntities(deviceUpkeepEntities);
|
|
|
|
|
remark.append("保养单数据:").append(deviceUpkeepEntities.size()).append("条\n");
|
|
|
|
|
}
|
|
|
|
|
//保养单明细数据
|
|
|
|
|
List<DeviceUpkeepDetailEntity> deviceUpkeepDetailEntities = deviceUpkeepDetailService.list(Wrappers.lambdaQuery(DeviceUpkeepDetailEntity.class)
|
|
|
|
|
.le(!ge && (boolean) map.get("isNew"), DeviceUpkeepDetailEntity::getUpdateTime, now)
|
|
|
|
|
.between(ge, DeviceUpkeepDetailEntity::getUpdateTime, syncTime, now)
|
|
|
|
|
.between(!ge && !(boolean) map.get("isNew"), DeviceUpkeepDetailEntity::getUpdateTime
|
|
|
|
|
, map.get("oldDate"), now)
|
|
|
|
|
);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(deviceUpkeepDetailEntities)) {
|
|
|
|
|
if (dataResponse == null) {
|
|
|
|
|
dataResponse = new SpsSyncDeviceDataResponse();
|
|
|
|
|
}
|
|
|
|
|
dataResponse.setDeviceUpkeepDetailEntities(deviceUpkeepDetailEntities);
|
|
|
|
|
remark.append("保养单明细数据:").append(deviceUpkeepDetailEntities.size()).append("条\n");
|
|
|
|
|
}
|
|
|
|
|
//维修单数据
|
|
|
|
|
List<DeviceUpkeepDetailItemEntity> deviceUpkeepDetailItemEntities = deviceUpkeepDetailItemService.list(Wrappers.lambdaQuery(DeviceUpkeepDetailItemEntity.class)
|
|
|
|
|
.le(!ge && (boolean) map.get("isNew"), DeviceUpkeepDetailItemEntity::getUpdateTime, now)
|
|
|
|
|
.between(ge, DeviceUpkeepDetailItemEntity::getUpdateTime, syncTime, now)
|
|
|
|
|
.between(!ge && !(boolean) map.get("isNew"), DeviceUpkeepDetailItemEntity::getUpdateTime
|
|
|
|
|
, map.get("oldDate"), now)
|
|
|
|
|
);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(deviceUpkeepDetailItemEntities)) {
|
|
|
|
|
if (dataResponse == null) {
|
|
|
|
|
dataResponse = new SpsSyncDeviceDataResponse();
|
|
|
|
|
}
|
|
|
|
|
dataResponse.setDeviceUpkeepDetailItemEntities(deviceUpkeepDetailItemEntities);
|
|
|
|
|
remark.append("设备保养项目数据:").append(deviceUpkeepDetailItemEntities.size()).append("条\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (dataResponse != null) {
|
|
|
|
|
dataResponse.setTaskId(taskId);
|
|
|
|
|
dataResponse.setType(BasicExportTypeEnum.DEVICE_REPAIR_DATA.getRemark());
|
|
|
|
|
dataResponse.setType(BasicExportTypeEnum.DEVICE_INFO_DATA.getRemark());
|
|
|
|
|
dataResponse.setSyncRemark(remark.toString());
|
|
|
|
|
}
|
|
|
|
|
log.error("自主平台服务数据{}",dataResponse);
|
|
|
|
|
return dataResponse;
|
|
|
|
|
|
|
|
|
|
// if (dataResponse != null) {
|
|
|
|
|
// dataResponse.setTaskId(taskId);
|
|
|
|
|
// dataResponse.setType(BasicExportTypeEnum.SYS_SET_DATA.getRemark());
|
|
|
|
|
// dataResponse.setSyncRemark(remark.toString());
|
|
|
|
|
// if (CollUtil.isNotEmpty(dataResponse.getSystemPDFTemplateEntities())) {
|
|
|
|
|
//// List<Map<String, String>> list = new ArrayList<>(spsSyncSysSettingResponse.getSystemPDFTemplateEntities().size() * 2);
|
|
|
|
|
// List<String> list = new ArrayList<>();
|
|
|
|
|
// dataResponse.getSystemPDFTemplateEntities().forEach(systemPDFTemplateEntity -> {
|
|
|
|
|
// list.add(systemPDFTemplateEntity.getPath());
|
|
|
|
|
// });
|
|
|
|
|
//
|
|
|
|
|
// BaseResponse<String> response = spGetHttp.postTemplateFile(list);
|
|
|
|
|
// if (response.getCode() == 20000) {
|
|
|
|
|
// log.info("模板文件列表上传成功");
|
|
|
|
|
//// uploadFileLog = "\n模板文件列表上传成功";
|
|
|
|
|
// } else {
|
|
|
|
|
// log.info("模板文件上传失败,响应信息:{}", response.getMessage());
|
|
|
|
|
//// uploadFileLog = "\n模板文件列表上传失败,错误信息:" + response.getMessage();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
log.error("这是设备管理数据{}",dataResponse);
|
|
|
|
|
return dataResponse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// public SpsSyncDeviceDataResponse getDeviceCheckData(SyncDataSetEntity info, String taskId, Date now, Date syncTime){
|
|
|
|
|
// SpsSyncDeviceDataResponse dataResponse = null;
|
|
|
|
|
// Map<String, Object> syncTimeMap = new WeakHashMap<>(3);
|
|
|
|
|
// syncTimeMap.put("isNew", true);
|
|
|
|
|
// boolean ge = false;
|
|
|
|
|
// if (syncTime != null) {
|
|
|
|
|
// ge = true;
|
|
|
|
|
// }
|
|
|
|
|
// StringBuffer remark = new StringBuffer();
|
|
|
|
|
// /**
|
|
|
|
|
// * 确认巡检任务管理开启
|
|
|
|
|
// */
|
|
|
|
|
// if (needExec(info.getDeviceCheck())) {
|
|
|
|
|
// Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.DEV_CHECK_DATA);
|
|
|
|
|
// List<DeviceCheckEntity> deviceCheckEntities = deviceCheckService.list(Wrappers.lambdaQuery(DeviceCheckEntity.class)
|
|
|
|
|
// .le(!ge && (boolean) map.get("isNew"), DeviceCheckEntity::getUpdateTime, now)
|
|
|
|
|
// .between(ge, DeviceCheckEntity::getUpdateTime, syncTime, now)
|
|
|
|
|
// .between(!ge && !(boolean) map.get("isNew"), DeviceCheckEntity::getUpdateTime
|
|
|
|
|
// , map.get("oldDate"), now)
|
|
|
|
|
// );
|
|
|
|
|
// if (CollectionUtil.isNotEmpty(deviceCheckEntities)) {
|
|
|
|
|
// dataResponse = new SpsSyncDeviceDataResponse();
|
|
|
|
|
// dataResponse.setDeviceCheckEntities(deviceCheckEntities);
|
|
|
|
|
// remark.append("巡检任务信息:").append(deviceCheckEntities.size()).append("条\n");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// List<DeviceCheckDetailEntity> deviceCheckDetailEntities = deviceCheckDetailService.list(Wrappers.lambdaQuery(DeviceCheckDetailEntity.class)
|
|
|
|
|
// .le(!ge && (boolean) map.get("isNew"), DeviceCheckDetailEntity::getUpdateTime, now)
|
|
|
|
|
// .between(ge, DeviceCheckDetailEntity::getUpdateTime, syncTime, now)
|
|
|
|
|
// .between(!ge && !(boolean) map.get("isNew"), DeviceCheckDetailEntity::getUpdateTime
|
|
|
|
|
// , map.get("oldDate"), now)
|
|
|
|
|
// );
|
|
|
|
|
// if (CollectionUtil.isNotEmpty(deviceCheckDetailEntities)) {
|
|
|
|
|
// if (dataResponse == null) {
|
|
|
|
|
// dataResponse = new SpsSyncDeviceDataResponse();
|
|
|
|
|
// }
|
|
|
|
|
// dataResponse.setDeviceCheckDetailEntities(deviceCheckDetailEntities);
|
|
|
|
|
// remark.append("巡检设备具体信息:").append(deviceCheckDetailEntities.size()).append("条\n");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// //巡检任务具体数据 deviceCheckDetail
|
|
|
|
|
// Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.DEV_CHECK_DETAIL);
|
|
|
|
|
// List<DeviceCheckDetailEntity> deviceCheckDetailEntities = deviceCheckDetailService.list(Wrappers.lambdaQuery(DeviceCheckDetailEntity.class)
|
|
|
|
|
// .le(!ge && (boolean) map.get("isNew"), DeviceCheckDetailEntity::getUpdateTime, now)
|
|
|
|
|
// .between(ge, DeviceCheckDetailEntity::getUpdateTime, syncTime, now)
|
|
|
|
|
// .between(!ge && !(boolean) map.get("isNew"), DeviceCheckDetailEntity::getUpdateTime
|
|
|
|
|
// , map.get("oldDate"), now)
|
|
|
|
|
// );
|
|
|
|
|
// if (CollectionUtil.isNotEmpty(deviceCheckDetailEntities)) {
|
|
|
|
|
// if (dataResponse == null) {
|
|
|
|
|
// dataResponse = new SpsSyncDeviceDataResponse();
|
|
|
|
|
// }
|
|
|
|
|
// dataResponse.setDeviceCheckDetailEntities(deviceCheckDetailEntities);
|
|
|
|
|
// remark.append("巡检设备具体信息:").append(deviceCheckDetailEntities.size()).append("条\n");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// //巡检设备项目表
|
|
|
|
|
//
|
|
|
|
|
//// Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.DEV_CHECK_DETAIL_ITEM);
|
|
|
|
|
// List<DeviceCheckDetailItemEntity> deviceCheckDetailItemEntities = deviceCheckDetailItemService.list(Wrappers.lambdaQuery(DeviceCheckDetailItemEntity.class)
|
|
|
|
|
// .le(!ge && (boolean) map.get("isNew"), DeviceCheckDetailItemEntity::getUpdateTime, now)
|
|
|
|
|
// .between(ge, DeviceCheckDetailItemEntity::getUpdateTime, syncTime, now)
|
|
|
|
|
// .between(!ge && !(boolean) map.get("isNew"), DeviceCheckDetailItemEntity::getUpdateTime
|
|
|
|
|
// , map.get("oldDate"), now)
|
|
|
|
|
// );
|
|
|
|
|
// if (CollectionUtil.isNotEmpty(deviceCheckDetailItemEntities)) {
|
|
|
|
|
// if (dataResponse == null) {
|
|
|
|
|
// dataResponse = new SpsSyncDeviceDataResponse();
|
|
|
|
|
// }
|
|
|
|
|
// dataResponse.setDeviceCheckDetailItemEntities(deviceCheckDetailItemEntities);
|
|
|
|
|
// remark.append("巡检设备项目表:").append(deviceCheckDetailItemEntities.size()).append("条\n");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// if (dataResponse != null) {
|
|
|
|
|
// dataResponse.setTaskId(taskId);
|
|
|
|
|
// dataResponse.setType(BasicExportTypeEnum.DEVICE_CHECK_DATA.getRemark());
|
|
|
|
|
// dataResponse.setSyncRemark(remark.toString());
|
|
|
|
|
// }
|
|
|
|
|
// log.error("巡检任务管理的数据,zzhzzhzzh{}",dataResponse);
|
|
|
|
|
// return dataResponse;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// @Resource
|
|
|
|
|
// DeviceRepairApplyService deviceRepairApplyService;
|
|
|
|
|
//
|
|
|
|
|
// @Resource
|
|
|
|
|
// DeviceRepairApplyDetailService deviceRepairApplyDetailService;
|
|
|
|
|
//
|
|
|
|
|
// @Resource
|
|
|
|
|
// DeviceRepairService deviceRepairService;
|
|
|
|
|
// 报修表
|
|
|
|
|
// public SpsSyncDeviceDataResponse getDeviceRepair(SyncDataSetEntity info, String taskId, Date now, Date syncTime){
|
|
|
|
|
// SpsSyncDeviceDataResponse dataResponse = null;
|
|
|
|
|
// Map<String, Object> syncTimeMap = new WeakHashMap<>(3);
|
|
|
|
|
// syncTimeMap.put("isNew", true);
|
|
|
|
|
// boolean ge = false;
|
|
|
|
|
// if (syncTime != null) {
|
|
|
|
|
// ge = true;
|
|
|
|
|
// }
|
|
|
|
|
// StringBuffer remark = new StringBuffer();
|
|
|
|
|
// //确认同步报修单开启
|
|
|
|
|
// if (needExec(info.getDeviceRepairApply())) {
|
|
|
|
|
// Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.DEV_REPAIR_APPLY);
|
|
|
|
|
// List<DeviceRepairApplyEntity> deviceRepairApplyEntities = deviceRepairApplyService.list(Wrappers.lambdaQuery(DeviceRepairApplyEntity.class)
|
|
|
|
|
// .le(!ge && (boolean) map.get("isNew"), DeviceRepairApplyEntity::getUpdateTime, now)
|
|
|
|
|
// .between(ge, DeviceRepairApplyEntity::getUpdateTime, syncTime, now)
|
|
|
|
|
// .between(!ge && !(boolean) map.get("isNew"), DeviceRepairApplyEntity::getUpdateTime
|
|
|
|
|
// , map.get("oldDate"), now)
|
|
|
|
|
// );
|
|
|
|
|
// if (CollectionUtil.isNotEmpty(deviceRepairApplyEntities)) {
|
|
|
|
|
// dataResponse = new SpsSyncDeviceDataResponse();
|
|
|
|
|
// dataResponse.setDeviceRepairApplyEntities(deviceRepairApplyEntities);
|
|
|
|
|
// remark.append("报修单数据:").append(deviceRepairApplyEntities.size()).append("条\n");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// //确认开启报修单明细同步
|
|
|
|
|
// if (needExec(info.getDeviceRepairDetail())) {
|
|
|
|
|
// Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.DEV_REPAIR_APPLY_DETAIL);
|
|
|
|
|
// List<DeviceRepairApplyDetailEntity> deviceRepairApplyDetailEntities = deviceRepairApplyDetailService.list(Wrappers.lambdaQuery(DeviceRepairApplyDetailEntity.class)
|
|
|
|
|
// .le(!ge && (boolean) map.get("isNew"), DeviceRepairApplyDetailEntity::getUpdateTime, now)
|
|
|
|
|
// .between(ge, DeviceRepairApplyDetailEntity::getUpdateTime, syncTime, now)
|
|
|
|
|
// .between(!ge && !(boolean) map.get("isNew"), DeviceRepairApplyDetailEntity::getUpdateTime
|
|
|
|
|
// , map.get("oldDate"), now)
|
|
|
|
|
// );
|
|
|
|
|
// if (CollectionUtil.isNotEmpty(deviceRepairApplyDetailEntities)) {
|
|
|
|
|
// if (dataResponse == null) {
|
|
|
|
|
// dataResponse = new SpsSyncDeviceDataResponse();
|
|
|
|
|
// }
|
|
|
|
|
// dataResponse.setDeviceRepairApplyDetailEntities(deviceRepairApplyDetailEntities);
|
|
|
|
|
// remark.append("报修单明细数据:").append(deviceRepairApplyDetailEntities.size()).append("条\n");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// //确认开启维修单同步
|
|
|
|
|
// if (needExec(info.getDeviceRepair())) {
|
|
|
|
|
// Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.DEV_REPAIR);
|
|
|
|
|
// List<DeviceRepairEntity> deviceRepairEntities = deviceRepairService.list(Wrappers.lambdaQuery(DeviceRepairEntity.class)
|
|
|
|
|
// .le(!ge && (boolean) map.get("isNew"), DeviceRepairEntity::getUpdateTime, now)
|
|
|
|
|
// .between(ge, DeviceRepairEntity::getUpdateTime, syncTime, now)
|
|
|
|
|
// .between(!ge && !(boolean) map.get("isNew"), DeviceRepairEntity::getUpdateTime
|
|
|
|
|
// , map.get("oldDate"), now)
|
|
|
|
|
// );
|
|
|
|
|
// if (CollectionUtil.isNotEmpty(deviceRepairEntities)) {
|
|
|
|
|
// if (dataResponse == null) {
|
|
|
|
|
// dataResponse = new SpsSyncDeviceDataResponse();
|
|
|
|
|
// }
|
|
|
|
|
// dataResponse.setDeviceRepairEntities(deviceRepairEntities);
|
|
|
|
|
// remark.append("维修单数据:").append(deviceRepairEntities.size()).append("条\n");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// if (dataResponse != null) {
|
|
|
|
|
// dataResponse.setTaskId(taskId);
|
|
|
|
|
// dataResponse.setType(BasicExportTypeEnum.DEVICE_REPAIR_DATA.getRemark());
|
|
|
|
|
// dataResponse.setSyncRemark(remark.toString());
|
|
|
|
|
// }
|
|
|
|
|
// log.error("自主平台服务数据{}",dataResponse);
|
|
|
|
|
// return dataResponse;
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
ThrManufacturerService thrManufacturerService;
|
|
|
|
|
//生产企业
|
|
|
|
@ -2732,4 +3060,6 @@ public class HeartService {
|
|
|
|
|
return dataResponse;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|