|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.glxp.api.controller.inv;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
@ -11,6 +12,7 @@ import com.glxp.api.req.inv.FilterDeviceInspectTakeRequest;
|
|
|
|
|
import com.glxp.api.res.inv.DeviceInspectTakeResponse;
|
|
|
|
|
import com.glxp.api.service.inv.DeviceInspectTaskDetailService;
|
|
|
|
|
import com.glxp.api.service.inv.DeviceInspectTaskService;
|
|
|
|
|
import com.glxp.api.upload.SpsSyncDeviceTakeResponse;
|
|
|
|
|
import com.glxp.api.util.GennerOrderUtils;
|
|
|
|
|
import com.glxp.api.util.OrderNoTypeBean;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
@ -20,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.lang.reflect.Type;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
@ -94,7 +97,40 @@ public class DeviceInspectTakeController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//从管理接收任务信息
|
|
|
|
|
@PostMapping("/deviceTakeApi/sps/sync/deviceTake/upload")
|
|
|
|
|
public BaseResponse getDeviceInspecTake(@RequestBody SpsSyncDeviceTakeResponse spsSyncDeviceTakeResponse) {
|
|
|
|
|
|
|
|
|
|
//新增
|
|
|
|
|
if(spsSyncDeviceTakeResponse.getType() == 1){
|
|
|
|
|
DeviceInspectTaskEntity deviceInspectTaskEntity = spsSyncDeviceTakeResponse.getDeviceInspectTaskEntity();
|
|
|
|
|
deviceInspectTaskEntity.setId(null);
|
|
|
|
|
deviceInspectTaskService.save(deviceInspectTaskEntity);
|
|
|
|
|
List<DeviceInspectTaskDetailEntity> deviceInspectTaskDetailEntityList = spsSyncDeviceTakeResponse.getDeviceInspectTaskDetailEntityList();
|
|
|
|
|
for (DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity : deviceInspectTaskDetailEntityList) {
|
|
|
|
|
deviceInspectTaskDetailEntity.setId(null);
|
|
|
|
|
deviceInspectTaskDetailService.save(deviceInspectTaskDetailEntity);
|
|
|
|
|
}
|
|
|
|
|
}else if(spsSyncDeviceTakeResponse.getType() == 2){
|
|
|
|
|
//编辑
|
|
|
|
|
DeviceInspectTaskEntity deviceInspectTaskEntity = spsSyncDeviceTakeResponse.getDeviceInspectTaskEntity();
|
|
|
|
|
deviceInspectTaskService.updateById(deviceInspectTaskEntity);
|
|
|
|
|
deviceInspectTaskDetailService.remove(new QueryWrapper<DeviceInspectTaskDetailEntity>().eq("taskOrderIdFk",deviceInspectTaskEntity.getOrderId()));
|
|
|
|
|
List<DeviceInspectTaskDetailEntity> deviceInspectTaskDetailEntityList = spsSyncDeviceTakeResponse.getDeviceInspectTaskDetailEntityList();
|
|
|
|
|
for (DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity : deviceInspectTaskDetailEntityList) {
|
|
|
|
|
deviceInspectTaskDetailService.save(deviceInspectTaskDetailEntity);
|
|
|
|
|
}
|
|
|
|
|
}else if(spsSyncDeviceTakeResponse.getType() == 3){
|
|
|
|
|
//删除
|
|
|
|
|
DeviceInspectTaskEntity deviceInspectTaskEntity = spsSyncDeviceTakeResponse.getDeviceInspectTaskEntity();
|
|
|
|
|
deviceInspectTaskService.removeById(deviceInspectTaskEntity);
|
|
|
|
|
List<DeviceInspectTaskDetailEntity> deviceInspectTaskDetailEntityList = spsSyncDeviceTakeResponse.getDeviceInspectTaskDetailEntityList();
|
|
|
|
|
for (DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity : deviceInspectTaskDetailEntityList) {
|
|
|
|
|
deviceInspectTaskDetailService.removeById(deviceInspectTaskDetailEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|