diff --git a/src/main/java/com/glxp/udi/admin/controller/inout/WareHouseController.java b/src/main/java/com/glxp/udi/admin/controller/inout/WareHouseController.java index 44c1aed..53ba38d 100644 --- a/src/main/java/com/glxp/udi/admin/controller/inout/WareHouseController.java +++ b/src/main/java/com/glxp/udi/admin/controller/inout/WareHouseController.java @@ -36,10 +36,7 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import javax.validation.Valid; -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; -import java.util.Map; +import java.util.*; @RestController public class WareHouseController { @@ -318,8 +315,9 @@ public class WareHouseController { } UdiEntity udiEntity = FilterUdiUtils.getUdi(code); - if (udiEntity == null) + if (udiEntity == null) { return ResultVOUtils.error(500, "无效条码!"); + } if (StrUtil.isNotEmpty(addOrderRequest.getBatchNo())) { udiEntity.setBatchNo(addOrderRequest.getBatchNo()); } @@ -449,11 +447,7 @@ public class WareHouseController { } warehousetempEntity.setCount(warehousetempEntity.getCount() * actCount); } else { - if (unitFk == null) - return ResultVOUtils.error(500, "耗材字典不存在此产品!"); - else - return ResultVOUtils.error(500, "当前供应商不存在此配送产品!"); - + return ResultVOUtils.error(500, "耗材字典不存在此产品!"); } OrderEntity isExit = orderService.findById(orderId); @@ -480,6 +474,7 @@ public class WareHouseController { orderSaveRequest.setCustomerId(customerId); orderService.insertOrder(orderSaveRequest); } + warehouseTempService.insertTempWarehouses(warehousetempEntities); } addCodeResult.setOrderId(orderId); @@ -517,4 +512,28 @@ public class WareHouseController { } return null; } + + @AuthRuleAnnotation("") + @PostMapping("warehouse/inout/saveOrderWeb") + public BaseResponse saveOrderWeb(@RequestBody AddOrderRequest addOrderRequest) { + OrderEntity orderEntity = new OrderEntity(); + orderEntity.setOrderId(addOrderRequest.getOrderId()); + BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(addOrderRequest.getAction(), addOrderRequest.getCustomerId()); + orderEntity.setAction(addOrderRequest.getAction()); + orderEntity.setMainAction(bussinessTypeEntity.getMainAction()); + orderEntity.setFromCorp(addOrderRequest.getFromCorp()); + orderEntity.setFromCorpId(addOrderRequest.getFromCorpId()); + orderEntity.setLocStorageCode(addOrderRequest.getLocStorageCode()); + orderEntity.setUpdateTime(new Date()); + orderService.updateOrder(orderEntity); + WarehouseEntity warehouseEntity = new WarehouseEntity(); + warehouseEntity.setOrderId(addOrderRequest.getOrderId()); + warehouseEntity.setAction(addOrderRequest.getAction()); + warehouseEntity.setMainAction(addOrderRequest.getMainAction()); + warehouseEntity.setFromCorp(addOrderRequest.getFromCorp()); + warehouseEntity.setFromCorpId(addOrderRequest.getFromCorpId()); + warehouseEntity.setLocStorageCode(addOrderRequest.getLocStorageCode()); + warehouseTempService.updateByOrderId(warehouseEntity); + return ResultVOUtils.success(); + } } diff --git a/src/main/java/com/glxp/udi/admin/dao/inout/CodesTempDao.java b/src/main/java/com/glxp/udi/admin/dao/inout/CodesTempDao.java index 5455a72..2affc3b 100644 --- a/src/main/java/com/glxp/udi/admin/dao/inout/CodesTempDao.java +++ b/src/main/java/com/glxp/udi/admin/dao/inout/CodesTempDao.java @@ -69,4 +69,11 @@ public interface CodesTempDao extends BaseMapper { * @return */ List findByOrderIdAndCode(WarehouseQueryRequest warehouseQueryRequest); + + /** + * 根据单据信息修改临时码表 + * + * @param warehouseEntity + */ + void updateByOrderId(WarehouseEntity warehouseEntity); } diff --git a/src/main/java/com/glxp/udi/admin/service/inout/WarehouseTempService.java b/src/main/java/com/glxp/udi/admin/service/inout/WarehouseTempService.java index 89ff8af..56ca1cc 100644 --- a/src/main/java/com/glxp/udi/admin/service/inout/WarehouseTempService.java +++ b/src/main/java/com/glxp/udi/admin/service/inout/WarehouseTempService.java @@ -130,4 +130,12 @@ public class WarehouseTempService { return codesTempDao.findByOrderIdAndCode(warehouseQueryRequest); } + /** + * 根据单据内容修改临时码表信息 + * + * @param warehouseEntity + */ + public void updateByOrderId(WarehouseEntity warehouseEntity) { + codesTempDao.updateByOrderId(warehouseEntity); + } } diff --git a/src/main/resources/mybatis/mapper/inout/CodesTempDao.xml b/src/main/resources/mybatis/mapper/inout/CodesTempDao.xml index d38cd78..609bd97 100644 --- a/src/main/resources/mybatis/mapper/inout/CodesTempDao.xml +++ b/src/main/resources/mybatis/mapper/inout/CodesTempDao.xml @@ -45,4 +45,19 @@ where orderId = #{orderId} and code = #{code} + + + update io_codes_temp + + `action`=#{action}, + mainAction=#{mainAction}, + fromCorp=#{fromCorp}, + fromCorpId=#{fromCorpId}, + locStorageCode=#{locStorageCode}, + supId=#{supId}, + serialNo=#{serialNo}, + relId=#{relId}, + + where orderId = #{orderId} + \ No newline at end of file