设备任务相互同步

dev2.0
anthonywj 2 years ago
parent c3a8c5da54
commit 113457a42a

@ -110,7 +110,7 @@ public class DeviceInspectTakeController extends BaseController {
@PostMapping("/udiwms/inv/device/inspect/take/delectDeviceInspecTake") @PostMapping("/udiwms/inv/device/inspect/take/delectDeviceInspecTake")
public BaseResponse delectDeviceInspecTake(@RequestBody DeviceInspectTaskEntity deviceInspectTaskEntity) { public BaseResponse delectDeviceInspecTake(@RequestBody DeviceInspectTaskEntity deviceInspectTaskEntity) {
deviceInspectTaskService.delectDeviceInspectTask(deviceInspectTaskEntity); deviceInspectTaskService.removeById(deviceInspectTaskEntity.getId());
deviceInspectTaskDetailService.remove(new QueryWrapper<DeviceInspectTaskDetailEntity>().eq("taskOrderIdFk", deviceInspectTaskEntity.getOrderId())); deviceInspectTaskDetailService.remove(new QueryWrapper<DeviceInspectTaskDetailEntity>().eq("taskOrderIdFk", deviceInspectTaskEntity.getOrderId()));
UploadDeviceTake(deviceInspectTaskEntity.getId(), 3); UploadDeviceTake(deviceInspectTaskEntity.getId(), 3);
BasicDataRequest basicDataRequest = new BasicDataRequest(); BasicDataRequest basicDataRequest = new BasicDataRequest();

@ -1,6 +1,8 @@
package com.glxp.api.dao.inv; package com.glxp.api.dao.inv;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.inv.DeviceInspectTaskDetailEntity;
import com.glxp.api.entity.inv.DeviceInspectTaskEntity; import com.glxp.api.entity.inv.DeviceInspectTaskEntity;
import com.glxp.api.req.inv.FilterDeviceInspectPlanRequest; import com.glxp.api.req.inv.FilterDeviceInspectPlanRequest;
import com.glxp.api.req.inv.FilterDeviceInspectTakeRequest; import com.glxp.api.req.inv.FilterDeviceInspectTakeRequest;
@ -11,7 +13,6 @@ import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
@Mapper @Mapper
public interface DeviceInspectTaskMapper extends BaseMapper<DeviceInspectTaskEntity> { public interface DeviceInspectTaskMapper extends BaseMapperPlus<DeviceInspectTaskMapper, DeviceInspectTaskEntity, DeviceInspectTaskEntity> {
List<DeviceInspectTakeResponse> filterList(FilterDeviceInspectTakeRequest filterDeviceInspectTakeRequest); List<DeviceInspectTakeResponse> filterList(FilterDeviceInspectTakeRequest filterDeviceInspectTakeRequest);
} }

@ -17,6 +17,8 @@ import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.*; import com.glxp.api.constant.*;
import com.glxp.api.dao.basic.*; import com.glxp.api.dao.basic.*;
import com.glxp.api.dao.inout.*; import com.glxp.api.dao.inout.*;
import com.glxp.api.dao.inv.DeviceInspectTaskDetailMapper;
import com.glxp.api.dao.inv.DeviceInspectTaskMapper;
import com.glxp.api.dao.purchase.*; import com.glxp.api.dao.purchase.*;
import com.glxp.api.dao.thrsys.ThrBusTypeOriginDao; import com.glxp.api.dao.thrsys.ThrBusTypeOriginDao;
import com.glxp.api.dto.RelaySyncDto; import com.glxp.api.dto.RelaySyncDto;
@ -1695,6 +1697,10 @@ public class HeartService {
case DOCUMENT_TYPE_DATA: case DOCUMENT_TYPE_DATA:
this.insertDocumentTypeData(bean.getFileContent()); this.insertDocumentTypeData(bean.getFileContent());
break; break;
case DEVICE_TASK:
this.insertDevTaskData(bean.getFileContent());
break;
} }
String taskId = bean.getTaskId(); String taskId = bean.getTaskId();
if (StrUtil.isNotBlank(taskId)) { if (StrUtil.isNotBlank(taskId)) {
@ -1848,6 +1854,35 @@ public class HeartService {
} }
} }
@Resource
DeviceInspectTaskMapper deviceInspectTaskMapper;
@Resource
DeviceInspectTaskDetailMapper deviceInspectTaskDetailMapper;
/**
*
*/
@Transactional(propagation = Propagation.NESTED)
public void insertDevTaskData(String content) {
cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(content);
List<DeviceInspectTaskEntity> deviceInspectTaskEntities = JSONUtil.toList(jsonObject.getJSONArray(DeviceInspectTaskEntity.class.getSimpleName()), DeviceInspectTaskEntity.class);
List<DeviceInspectTaskDetailEntity> deviceInspectTaskDetailEntities = JSONUtil.toList(jsonObject.getJSONArray(DeviceInspectTaskDetailEntity.class.getSimpleName()), DeviceInspectTaskDetailEntity.class);
if (CollectionUtil.isNotEmpty(deviceInspectTaskEntities)) {
for (DeviceInspectTaskEntity deviceInspectTaskEntity : deviceInspectTaskEntities) {
deviceInspectTaskEntity.setUpdateTime(null);
}
deviceInspectTaskMapper.replaceBatchs(deviceInspectTaskEntities);
}
if (CollectionUtil.isNotEmpty(deviceInspectTaskDetailEntities)) {
deviceInspectTaskDetailMapper.replaceBatchs(deviceInspectTaskDetailEntities);
}
List<String> syncFiles = JSONUtil.toList(jsonObject.getJSONArray("syncFiles"), String.class);
if (CollUtil.isNotEmpty(syncFiles)) {
fileService.download(syncFiles);
}
}
/** /**
* UDI * UDI
*/ */

Loading…
Cancel
Save