|
|
@ -53,17 +53,18 @@ public class DeviceInspectTakeController {
|
|
|
|
PageInfo<DeviceInspectTakeResponse> pageInfo = new PageInfo<>(list);
|
|
|
|
PageInfo<DeviceInspectTakeResponse> pageInfo = new PageInfo<>(list);
|
|
|
|
return ResultVOUtils.page(pageInfo);
|
|
|
|
return ResultVOUtils.page(pageInfo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/udiwms/inv/device/inspect/take/uploadDeviceInspecTake")
|
|
|
|
@PostMapping("/udiwms/inv/device/inspect/take/uploadDeviceInspecTake")
|
|
|
|
public BaseResponse uploadDeviceInspecTake(@RequestBody DeviceInspectTaskEntity deviceInspectTaskEntity) {
|
|
|
|
public BaseResponse uploadDeviceInspecTake(@RequestBody DeviceInspectTaskEntity deviceInspectTaskEntity) {
|
|
|
|
deviceInspectTaskEntity.setUpdateTime(new Date());
|
|
|
|
deviceInspectTaskEntity.setUpdateTime(new Date());
|
|
|
|
if(deviceInspectTaskEntity.getStatus() == DeviceStatus.DEVICE_STATUS_TEMP_DURINGINSPECTTION){
|
|
|
|
if (deviceInspectTaskEntity.getStatus() == DeviceStatus.DEVICE_STATUS_TEMP_DURINGINSPECTTION) {
|
|
|
|
deviceInspectTaskEntity.setStrartTime(new Date());
|
|
|
|
deviceInspectTaskEntity.setStrartTime(new Date());
|
|
|
|
}else if (deviceInspectTaskEntity.getStatus() == DeviceStatus.DEVICE_STATUS_TEMP_INSPECTED){
|
|
|
|
} else if (deviceInspectTaskEntity.getStatus() == DeviceStatus.DEVICE_STATUS_TEMP_INSPECTED) {
|
|
|
|
deviceInspectTaskEntity.setEndTime(new Date());
|
|
|
|
deviceInspectTaskEntity.setEndTime(new Date());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
boolean falg=deviceInspectTaskService.updateById(deviceInspectTaskEntity);
|
|
|
|
boolean falg = deviceInspectTaskService.updateById(deviceInspectTaskEntity);
|
|
|
|
if(!falg){
|
|
|
|
if (!falg) {
|
|
|
|
return ResultVOUtils.error(999,"更新失败");
|
|
|
|
return ResultVOUtils.error(999, "更新失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -71,71 +72,67 @@ public class DeviceInspectTakeController {
|
|
|
|
@PostMapping("/udiwms/inv/device/inspect/take/uploadDeviceTake")
|
|
|
|
@PostMapping("/udiwms/inv/device/inspect/take/uploadDeviceTake")
|
|
|
|
public BaseResponse uploadDeviceTake(@RequestBody DeviceInspectTaskEntity deviceInspectTaskEntity) {
|
|
|
|
public BaseResponse uploadDeviceTake(@RequestBody DeviceInspectTaskEntity deviceInspectTaskEntity) {
|
|
|
|
deviceInspectTaskEntity.setUpdateTime(new Date());
|
|
|
|
deviceInspectTaskEntity.setUpdateTime(new Date());
|
|
|
|
boolean falg=deviceInspectTaskService.updateById(deviceInspectTaskEntity);
|
|
|
|
boolean falg = deviceInspectTaskService.updateById(deviceInspectTaskEntity);
|
|
|
|
if(!falg){
|
|
|
|
if (!falg) {
|
|
|
|
return ResultVOUtils.error(999,"更新失败");
|
|
|
|
return ResultVOUtils.error(999, "更新失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/udiwms/inv/device/inspect/take/addDeviceInspecTake")
|
|
|
|
@PostMapping("/udiwms/inv/device/inspect/take/addDeviceInspecTake")
|
|
|
|
public BaseResponse addDeviceInspecTake(@RequestBody DeviceInspectTaskEntity deviceInspectTaskEntity) {
|
|
|
|
public BaseResponse addDeviceInspecTake(@RequestBody DeviceInspectTaskEntity deviceInspectTaskEntity) {
|
|
|
|
String orderId = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.DEVICE_INSPECT_PLAN_ORDER, "yyyyMMdd"));
|
|
|
|
String orderId = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.DEVICE_INSPECT_PLAN_ORDER, "yyyyMMdd"));
|
|
|
|
deviceInspectTaskEntity.setOrderId(orderId);
|
|
|
|
deviceInspectTaskEntity.setOrderId(orderId);
|
|
|
|
deviceInspectTaskEntity.setCreateTime(new Date());
|
|
|
|
deviceInspectTaskEntity.setCreateTime(new Date());
|
|
|
|
deviceInspectTaskService.addDeviceInspectTask(deviceInspectTaskEntity);
|
|
|
|
deviceInspectTaskService.addDeviceInspectTask(deviceInspectTaskEntity);
|
|
|
|
return ResultVOUtils.success(deviceInspectTaskEntity);
|
|
|
|
return ResultVOUtils.success(deviceInspectTaskEntity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@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.delectDeviceInspectTask(deviceInspectTaskEntity);
|
|
|
|
return ResultVOUtils.success(deviceInspectTaskEntity);
|
|
|
|
return ResultVOUtils.success(deviceInspectTaskEntity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//从管理接收任务信息
|
|
|
|
//从管理接收任务信息
|
|
|
|
@PostMapping("/deviceTakeApi/sps/sync/deviceTake/upload")
|
|
|
|
@PostMapping("/deviceTakeApi/sps/sync/deviceTake/upload")
|
|
|
|
public BaseResponse getDeviceInspecTake(@RequestBody SpsSyncDeviceTakeResponse spsSyncDeviceTakeResponse) {
|
|
|
|
public BaseResponse getDeviceInspecTake(@RequestBody SpsSyncDeviceTakeResponse spsSyncDeviceTakeResponse) {
|
|
|
|
|
|
|
|
|
|
|
|
//新增
|
|
|
|
//新增
|
|
|
|
if(spsSyncDeviceTakeResponse.getType() == 1){
|
|
|
|
if (spsSyncDeviceTakeResponse.getType() == 1) {
|
|
|
|
DeviceInspectTaskEntity deviceInspectTaskEntity = spsSyncDeviceTakeResponse.getDeviceInspectTaskEntity();
|
|
|
|
DeviceInspectTaskEntity deviceInspectTaskEntity = spsSyncDeviceTakeResponse.getDeviceInspectTaskEntity();
|
|
|
|
deviceInspectTaskEntity.setId(null);
|
|
|
|
deviceInspectTaskEntity.setId(null);
|
|
|
|
deviceInspectTaskService.save(deviceInspectTaskEntity);
|
|
|
|
deviceInspectTaskService.save(deviceInspectTaskEntity);
|
|
|
|
List<DeviceInspectTaskDetailEntity> deviceInspectTaskDetailEntityList = spsSyncDeviceTakeResponse.getDeviceInspectTaskDetailEntityList();
|
|
|
|
List<DeviceInspectTaskDetailEntity> deviceInspectTaskDetailEntityList = spsSyncDeviceTakeResponse.getDeviceInspectTaskDetailEntityList();
|
|
|
|
for (DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity : deviceInspectTaskDetailEntityList) {
|
|
|
|
for (DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity : deviceInspectTaskDetailEntityList) {
|
|
|
|
deviceInspectTaskDetailEntity.setId(null);
|
|
|
|
deviceInspectTaskDetailEntity.setId(null);
|
|
|
|
deviceInspectTaskDetailService.save(deviceInspectTaskDetailEntity);
|
|
|
|
deviceInspectTaskDetailService.save(deviceInspectTaskDetailEntity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else if(spsSyncDeviceTakeResponse.getType() == 2){
|
|
|
|
} else if (spsSyncDeviceTakeResponse.getType() == 2) {
|
|
|
|
//编辑
|
|
|
|
//编辑
|
|
|
|
DeviceInspectTaskEntity deviceInspectTaskEntity = spsSyncDeviceTakeResponse.getDeviceInspectTaskEntity();
|
|
|
|
DeviceInspectTaskEntity deviceInspectTaskEntity = spsSyncDeviceTakeResponse.getDeviceInspectTaskEntity();
|
|
|
|
deviceInspectTaskService.updateById(deviceInspectTaskEntity);
|
|
|
|
deviceInspectTaskService.updateById(deviceInspectTaskEntity);
|
|
|
|
deviceInspectTaskDetailService.remove(new QueryWrapper<DeviceInspectTaskDetailEntity>().eq("taskOrderIdFk",deviceInspectTaskEntity.getOrderId()));
|
|
|
|
deviceInspectTaskDetailService.remove(new QueryWrapper<DeviceInspectTaskDetailEntity>().eq("taskOrderIdFk", deviceInspectTaskEntity.getOrderId()));
|
|
|
|
List<DeviceInspectTaskDetailEntity> deviceInspectTaskDetailEntityList = spsSyncDeviceTakeResponse.getDeviceInspectTaskDetailEntityList();
|
|
|
|
List<DeviceInspectTaskDetailEntity> deviceInspectTaskDetailEntityList = spsSyncDeviceTakeResponse.getDeviceInspectTaskDetailEntityList();
|
|
|
|
for (DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity : deviceInspectTaskDetailEntityList) {
|
|
|
|
for (DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity : deviceInspectTaskDetailEntityList) {
|
|
|
|
deviceInspectTaskDetailService.save(deviceInspectTaskDetailEntity);
|
|
|
|
deviceInspectTaskDetailService.save(deviceInspectTaskDetailEntity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else if(spsSyncDeviceTakeResponse.getType() == 3){
|
|
|
|
} else if (spsSyncDeviceTakeResponse.getType() == 3) {
|
|
|
|
//删除
|
|
|
|
//删除
|
|
|
|
DeviceInspectTaskEntity deviceInspectTaskEntity = spsSyncDeviceTakeResponse.getDeviceInspectTaskEntity();
|
|
|
|
DeviceInspectTaskEntity deviceInspectTaskEntity = spsSyncDeviceTakeResponse.getDeviceInspectTaskEntity();
|
|
|
|
deviceInspectTaskService.removeById(deviceInspectTaskEntity);
|
|
|
|
deviceInspectTaskService.removeById(deviceInspectTaskEntity);
|
|
|
|
List<DeviceInspectTaskDetailEntity> deviceInspectTaskDetailEntityList = spsSyncDeviceTakeResponse.getDeviceInspectTaskDetailEntityList();
|
|
|
|
List<DeviceInspectTaskDetailEntity> deviceInspectTaskDetailEntityList = spsSyncDeviceTakeResponse.getDeviceInspectTaskDetailEntityList();
|
|
|
|
for (DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity : deviceInspectTaskDetailEntityList) {
|
|
|
|
for (DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity : deviceInspectTaskDetailEntityList) {
|
|
|
|
deviceInspectTaskDetailService.removeById(deviceInspectTaskDetailEntity);
|
|
|
|
deviceInspectTaskDetailService.removeById(deviceInspectTaskDetailEntity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//------------------------------------------ 详情方法--------------------------------------------------------------//
|
|
|
|
//------------------------------------------ 详情方法--------------------------------------------------------------//
|
|
|
|
@GetMapping("/udiwms/inv/device/inspect/take/detail/selectDeviceInspecTakeDetail")
|
|
|
|
@GetMapping("/udiwms/inv/device/inspect/take/detail/selectDeviceInspecTakeDetail")
|
|
|
|
public BaseResponse selectDeviceInspecTakeDetail(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) {
|
|
|
|
public BaseResponse selectDeviceInspecTakeDetail(DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) {
|
|
|
@ -144,21 +141,21 @@ public class DeviceInspectTakeController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/udiwms/inv/device/inspect/take/detail/uploadDeviceInspecTakeDetail")
|
|
|
|
@PostMapping("/udiwms/inv/device/inspect/take/detail/uploadDeviceInspecTakeDetail")
|
|
|
|
public BaseResponse uploadDeviceInspecTakeDetail(@RequestBody DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) {
|
|
|
|
public BaseResponse uploadDeviceInspecTakeDetail(@RequestBody DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) {
|
|
|
|
deviceInspectTaskDetailEntity.setUpdateTime(new Date());
|
|
|
|
deviceInspectTaskDetailEntity.setUpdateTime(new Date());
|
|
|
|
boolean falg=deviceInspectTaskDetailService.uploadDeviceInspecTakeDetail(deviceInspectTaskDetailEntity);
|
|
|
|
boolean falg = deviceInspectTaskDetailService.uploadDeviceInspecTakeDetail(deviceInspectTaskDetailEntity);
|
|
|
|
if(!falg){
|
|
|
|
if (!falg) {
|
|
|
|
return ResultVOUtils.error(999,"更新失败");
|
|
|
|
return ResultVOUtils.error(999, "更新失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/udiwms/inv/device/inspect/take/detail/addDeviceInspecTakeDetail")
|
|
|
|
@PostMapping("/udiwms/inv/device/inspect/take/detail/addDeviceInspecTakeDetail")
|
|
|
|
public BaseResponse addDeviceInspecTakeDetail(@RequestBody DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) {
|
|
|
|
public BaseResponse addDeviceInspecTakeDetail(@RequestBody DeviceInspectTaskDetailEntity deviceInspectTaskDetailEntity) {
|
|
|
|
|
|
|
|
|
|
|
|
boolean falg=deviceInspectTaskDetailService.addDeviceInspectTaskDelect(deviceInspectTaskDetailEntity);
|
|
|
|
boolean falg = deviceInspectTaskDetailService.addDeviceInspectTaskDelect(deviceInspectTaskDetailEntity);
|
|
|
|
if(!falg){
|
|
|
|
if (!falg) {
|
|
|
|
return ResultVOUtils.error(999,"更新失败");
|
|
|
|
return ResultVOUtils.error(999, "更新失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -166,13 +163,12 @@ public class DeviceInspectTakeController {
|
|
|
|
@GetMapping("/udiwms/inv/device/inspect/take/detail/delectDeviceInspecTakeDetail")
|
|
|
|
@GetMapping("/udiwms/inv/device/inspect/take/detail/delectDeviceInspecTakeDetail")
|
|
|
|
public BaseResponse delecttDeviceInspecTakeDetail(String id) {
|
|
|
|
public BaseResponse delecttDeviceInspecTakeDetail(String id) {
|
|
|
|
|
|
|
|
|
|
|
|
boolean falg=deviceInspectTaskDetailService.removeById(id);
|
|
|
|
boolean falg = deviceInspectTaskDetailService.removeById(id);
|
|
|
|
if(!falg){
|
|
|
|
if (!falg) {
|
|
|
|
return ResultVOUtils.error(999,"删除失败");
|
|
|
|
return ResultVOUtils.error(999, "删除失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|