Commit 40d69a4bb2518e772e0382a0e78ea120f19539a7
Merge remote-tracking branch 'origin/dev' into dev
Showing
4 changed files
with
88 additions
and
7 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/api/material/MaterialApi.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.api.material; | |
| 2 | + | |
| 3 | +import com.zteits.urbanops.module.garden.api.material.dto.MaterialInventoryOutDto; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * @Classname MaterialApi | |
| 7 | + * @Description 物料出库 | |
| 8 | + * @Date 2025/12/16 16:19 | |
| 9 | + * @Created by wangqian | |
| 10 | + */ | |
| 11 | +public interface MaterialApi { | |
| 12 | + | |
| 13 | + /** | |
| 14 | + * 创建物料出库 | |
| 15 | + * | |
| 16 | + * @param outDto 创建信息 | |
| 17 | + * @return 编号 | |
| 18 | + */ | |
| 19 | + Long createMaterialInventoryOut(MaterialInventoryOutDto outDto); | |
| 20 | +} | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/api/material/MaterialApiImpl.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.api.material; | |
| 2 | + | |
| 3 | +import cn.hutool.core.bean.BeanUtil; | |
| 4 | +import com.zteits.urbanops.module.garden.api.material.dto.MaterialInventoryOutDto; | |
| 5 | +import com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.vo.MaterialInventoryOutSaveReqVO; | |
| 6 | +import com.zteits.urbanops.module.garden.service.materialinventoryout.MaterialInventoryOutService; | |
| 7 | +import jakarta.annotation.Resource; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * @Classname MaterialApiImpl | |
| 11 | + * @Description 物料接口 | |
| 12 | + * @Date 2025/12/16 16:21 | |
| 13 | + * @Created by wangqian | |
| 14 | + */ | |
| 15 | +public class MaterialApiImpl implements MaterialApi{ | |
| 16 | + | |
| 17 | + @Resource | |
| 18 | + private MaterialInventoryOutService materialInventoryOutService; | |
| 19 | + @Override | |
| 20 | + public Long createMaterialInventoryOut(MaterialInventoryOutDto outDto) { | |
| 21 | + MaterialInventoryOutSaveReqVO createReqVO = BeanUtil.toBean(outDto, MaterialInventoryOutSaveReqVO.class); | |
| 22 | + return materialInventoryOutService.createMaterialInventoryOut(createReqVO); | |
| 23 | + } | |
| 24 | +} | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/api/material/dto/MaterialInventoryOutDto.java
0 → 100644
| 1 | +package com.zteits.urbanops.module.garden.api.material.dto; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import jakarta.validation.constraints.NotNull; | |
| 5 | +import lombok.Data; | |
| 6 | + | |
| 7 | +import java.time.LocalDateTime; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * @Classname MaterialInventoryOutDto | |
| 11 | + * @Description 物料出库 | |
| 12 | + * @Date 2025/12/16 16:22 | |
| 13 | + * @Created by wangqian | |
| 14 | + */ | |
| 15 | +@Data | |
| 16 | +public class MaterialInventoryOutDto { | |
| 17 | + @Schema(description = "入库ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18713") | |
| 18 | + private Long id; | |
| 19 | + | |
| 20 | + @Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14541") | |
| 21 | + @NotNull(message = "物料ID不能为空") | |
| 22 | + private Long materialId; | |
| 23 | + | |
| 24 | + @Schema(description = "物料名称", example = "芋艿") | |
| 25 | + private String materialName; | |
| 26 | + | |
| 27 | + @Schema(description = "出库数量", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 28 | + @NotNull(message = "出库数量不能为空") | |
| 29 | + private Long outInventoryNum; | |
| 30 | + | |
| 31 | + @Schema(description = "出库日期", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 32 | + @NotNull(message = "出库日期不能为空") | |
| 33 | + private LocalDateTime outDate; | |
| 34 | + | |
| 35 | +} | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/materialdetail/MaterialDetailServiceImpl.java
| ... | ... | @@ -2,6 +2,8 @@ package com.zteits.urbanops.module.workorder.service.materialdetail; |
| 2 | 2 | |
| 3 | 3 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 4 | 4 | import com.zteits.urbanops.framework.common.util.object.BeanUtils; |
| 5 | +import com.zteits.urbanops.module.garden.api.material.MaterialApi; | |
| 6 | +import com.zteits.urbanops.module.garden.api.material.dto.MaterialInventoryOutDto; | |
| 5 | 7 | import com.zteits.urbanops.module.garden.controller.admin.materialinventoryout.vo.MaterialInventoryOutSaveReqVO; |
| 6 | 8 | import com.zteits.urbanops.module.garden.service.materialinventoryout.MaterialInventoryOutService; |
| 7 | 9 | import com.zteits.urbanops.module.workorder.controller.admin.materialdetail.vo.MaterialDetailPageReqVO; |
| ... | ... | @@ -39,7 +41,7 @@ public class MaterialDetailServiceImpl implements MaterialDetailService { |
| 39 | 41 | private MaterialDetailMapper materialDetailMapper; |
| 40 | 42 | |
| 41 | 43 | @Resource |
| 42 | - private MaterialInventoryOutService materialInventoryOutService; | |
| 44 | + private MaterialApi materialApi; | |
| 43 | 45 | |
| 44 | 46 | @Resource |
| 45 | 47 | private MainInfoService mainInfoService; |
| ... | ... | @@ -119,12 +121,12 @@ public class MaterialDetailServiceImpl implements MaterialDetailService { |
| 119 | 121 | } |
| 120 | 122 | //耗材出库 |
| 121 | 123 | for (MaterialDetailDO materialDetailDO : materialDetailList) { |
| 122 | - MaterialInventoryOutSaveReqVO materialInventoryOutSaveReqVO = new MaterialInventoryOutSaveReqVO(); | |
| 123 | - materialInventoryOutSaveReqVO.setMaterialId(materialDetailDO.getMaterialId()); | |
| 124 | - materialInventoryOutSaveReqVO.setMaterialName(materialDetailDO.getMaterialName()); | |
| 125 | - materialInventoryOutSaveReqVO.setOutInventoryNum(materialDetailDO.getUserCount()); | |
| 126 | - materialInventoryOutSaveReqVO.setOutDate(LocalDateTime.now()); | |
| 127 | - materialInventoryOutService.createMaterialInventoryOut(materialInventoryOutSaveReqVO); | |
| 124 | + MaterialInventoryOutDto outDto = new MaterialInventoryOutDto(); | |
| 125 | + outDto.setMaterialId(materialDetailDO.getMaterialId()); | |
| 126 | + outDto.setMaterialName(materialDetailDO.getMaterialName()); | |
| 127 | + outDto.setOutInventoryNum(materialDetailDO.getUserCount()); | |
| 128 | + outDto.setOutDate(LocalDateTime.now()); | |
| 129 | + materialApi.createMaterialInventoryOut(outDto); | |
| 128 | 130 | } |
| 129 | 131 | //保存耗材 |
| 130 | 132 | materialDetailMapper.insertBatch(materialDetailList); | ... | ... |