Commit e4fa5a84f0861f9ee6444314282455df6d9a23ee

Authored by wangqian
1 parent 3c45ba64

耗材登记bug修改

urbanops-module-api/urbanops-module-garden-api/src/main/java/com/zteits/urbanops/module/garden/dto/material/MaterialInventoryOutDto.java
@@ -17,6 +17,9 @@ public class MaterialInventoryOutDto { @@ -17,6 +17,9 @@ public class MaterialInventoryOutDto {
17 @Schema(description = "入库ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18713") 17 @Schema(description = "入库ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18713")
18 private Long id; 18 private Long id;
19 19
  20 + @Schema(description = "库存ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "111")
  21 + private Long inventoryId;
  22 +
20 @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14541") 23 @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14541")
21 @NotNull(message = "物料ID不能为空") 24 @NotNull(message = "物料ID不能为空")
22 private Long materialId; 25 private Long materialId;
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/materialinventoryout/vo/MaterialInventoryOutSaveReqVO.java
@@ -14,7 +14,7 @@ public class MaterialInventoryOutSaveReqVO { @@ -14,7 +14,7 @@ public class MaterialInventoryOutSaveReqVO {
14 @Schema(description = "入库ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18713") 14 @Schema(description = "入库ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18713")
15 private Long id; 15 private Long id;
16 @Schema(description = "库存ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") 16 @Schema(description = "库存ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
17 - //@NotNull(message = "库存ID不能为空") 17 + @NotNull(message = "库存ID不能为空")
18 private Long inventoryId; 18 private Long inventoryId;
19 19
20 @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14541") 20 @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14541")
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/materialinventoryout/MaterialInventoryOutServiceImpl.java
@@ -57,13 +57,7 @@ public class MaterialInventoryOutServiceImpl implements MaterialInventoryOutServ @@ -57,13 +57,7 @@ public class MaterialInventoryOutServiceImpl implements MaterialInventoryOutServ
57 throw exception0(BAD_REQUEST.getCode(), "无效参数-materialId"); 57 throw exception0(BAD_REQUEST.getCode(), "无效参数-materialId");
58 } 58 }
59 59
60 - MaterialInventoryDO materialInventory = null;  
61 - if(createReqVO.getInventoryId() != null) {  
62 - materialInventory = materialInventoryService.getMaterialInventory(createReqVO.getInventoryId());  
63 - } else {  
64 - //耗材登记没有库存id,只能使用耗材id+单位查询  
65 - materialInventory = materialInventoryService.selectMaterialInventoryByMaterialId(material.getMaterialId(), getCompanyId());  
66 - } 60 + MaterialInventoryDO materialInventory = materialInventoryService.getMaterialInventory(createReqVO.getInventoryId());
67 if(null == materialInventory){ 61 if(null == materialInventory){
68 throw exception0(BAD_REQUEST.getCode(),createReqVO.getMaterialName()+"没有库存"); 62 throw exception0(BAD_REQUEST.getCode(),createReqVO.getMaterialName()+"没有库存");
69 } 63 }
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/materialdetail/vo/MaterialDetailSaveReqVO.java
@@ -79,4 +79,7 @@ public class MaterialDetailSaveReqVO { @@ -79,4 +79,7 @@ public class MaterialDetailSaveReqVO {
79 @Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED, example = "规格") 79 @Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED, example = "规格")
80 @NotEmpty(message = "规格不能为空") 80 @NotEmpty(message = "规格不能为空")
81 private String specifications; 81 private String specifications;
  82 +
  83 + @Schema(description = "库存ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "111")
  84 + private Long inventoryId;
82 } 85 }
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/materialdetail/MaterialDetailServiceImpl.java
@@ -133,12 +133,13 @@ public class MaterialDetailServiceImpl implements MaterialDetailService { @@ -133,12 +133,13 @@ public class MaterialDetailServiceImpl implements MaterialDetailService {
133 // } 133 // }
134 // } 134 // }
135 //耗材出库 135 //耗材出库
136 - for (MaterialDetailDO materialDetailDO : materialDetailList) { 136 + for (MaterialDetailSaveReqVO materialDetailDO : createReqVO) {
137 MaterialInventoryOutDto outDto = new MaterialInventoryOutDto(); 137 MaterialInventoryOutDto outDto = new MaterialInventoryOutDto();
138 outDto.setMaterialId(materialDetailDO.getMaterialId()); 138 outDto.setMaterialId(materialDetailDO.getMaterialId());
139 outDto.setMaterialName(materialDetailDO.getMaterialName()); 139 outDto.setMaterialName(materialDetailDO.getMaterialName());
140 - outDto.setOutInventoryNum(materialDetailDO.getUserCount()); 140 + outDto.setOutInventoryNum(Long.valueOf(materialDetailDO.getUserCount()));
141 outDto.setOutDate(LocalDateTime.now()); 141 outDto.setOutDate(LocalDateTime.now());
  142 + outDto.setInventoryId(materialDetailDO.getInventoryId());
142 materialApi.createMaterialInventoryOut(outDto); 143 materialApi.createMaterialInventoryOut(outDto);
143 } 144 }
144 //保存耗材 145 //保存耗材