|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.logpm.warehouse.controller; |
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
|
|
|
@ -248,6 +249,45 @@ public class OldSystemPushController {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ResponseBody |
|
|
|
|
@PostMapping("/addCreateTrayData") |
|
|
|
|
@ApiOperationSupport(order = 1) |
|
|
|
|
@ApiOperation(value = "老系统创建托盘数据", notes = "传入waybillDTO") |
|
|
|
|
public R addCreateTrayData(@RequestBody TrayInfoDTO trayInfoDTO) { |
|
|
|
|
log.info("############addCreateTrayData: 请求参数{}",trayInfoDTO); |
|
|
|
|
try{ |
|
|
|
|
|
|
|
|
|
List<String> trayNos = trayInfoDTO.getTrayNos(); |
|
|
|
|
Integer warehouseId = trayInfoDTO.getWarehouseId(); |
|
|
|
|
|
|
|
|
|
if(trayNos.isEmpty()){ |
|
|
|
|
log.warn("##############addCreateTrayData: 托盘id不存在 trayNos={}",trayNos); |
|
|
|
|
return R.fail(405,"托盘id不存在"); |
|
|
|
|
} |
|
|
|
|
if(Objects.isNull(warehouseId)){ |
|
|
|
|
log.warn("##############addCreateTrayData: 仓库id不存在 warehouseId={}",warehouseId); |
|
|
|
|
return R.fail(405,"仓库id不存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//先保存原始请求数据
|
|
|
|
|
WarehouseLog warehouseLog = new WarehouseLog(); |
|
|
|
|
warehouseLog.setArgs(JSON.toJSONString(trayInfoDTO)); |
|
|
|
|
warehouseLog.setStatus(0); |
|
|
|
|
warehouseLog.setType(5); |
|
|
|
|
warehouseLogService.save(warehouseLog); |
|
|
|
|
|
|
|
|
|
asyncDataService.addCreateTrayData(trayInfoDTO); |
|
|
|
|
|
|
|
|
|
warehouseLog.setStatus(1); |
|
|
|
|
warehouseLogService.updateById(warehouseLog); |
|
|
|
|
return R.success("操作成功"); |
|
|
|
|
}catch (CustomerException e){ |
|
|
|
|
log.error(e.message,e); |
|
|
|
|
return R.fail(e.code,e.message); |
|
|
|
|
}catch (Exception e){ |
|
|
|
|
log.error("############sendOrders: 系统异常",e); |
|
|
|
|
return R.fail(500,"############sendOrders: 系统异常"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|