From fbab81db2c109a91c8368175deaa7575cb5be9fd Mon Sep 17 00:00:00 2001 From: z Date: Wed, 25 Jun 2025 19:09:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=8D=95=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/heli/enums/ErrorCodeConstants.java | 2 + .../materialplan/MaterialPlanController.java | 7 + .../vo/MaterialPlanPageReqVO.java | 3 + .../admin/storagein/StorageInController.java | 104 +++++++++ .../storagein/vo/StorageInPageReqVO.java | 63 ++++++ .../admin/storagein/vo/StorageInRespVO.java | 70 +++++++ .../storagein/vo/StorageInSaveReqVO.java | 53 +++++ .../StorageInDetailController.java | 105 ++++++++++ .../vo/StorageInDetailPageReqVO.java | 109 ++++++++++ .../vo/StorageInDetailRespVO.java | 143 +++++++++++++ .../vo/StorageInDetailSaveReqVO.java | 104 +++++++++ .../purchaseorderno/PurchaseOrderNoDO.java | 6 + .../dal/dataobject/storagein/StorageInDO.java | 83 ++++++++ .../storageindetail/StorageInDetailDO.java | 163 +++++++++++++++ .../materialplan/MaterialPlanMapper.java | 6 +- .../MaterialPlanBoomMapper.java | 3 +- .../PurchaseOrderNoDetailMapper.java | 4 +- .../dal/mysql/storagein/StorageInMapper.java | 45 ++++ .../StorageInDetailMapper.java | 72 +++++++ .../materialplan/MaterialPlanService.java | 2 + .../materialplan/MaterialPlanServiceImpl.java | 24 ++- .../PurchaseOrderNoServiceImpl.java | 17 +- .../service/storagein/StorageInService.java | 55 +++++ .../storagein/StorageInServiceImpl.java | 126 +++++++++++ .../StorageInDetailService.java | 56 +++++ .../StorageInDetailServiceImpl.java | 79 +++++++ .../mapper/storagein/StorageInMapper.xml | 12 ++ .../storageindetail/StorageInDetailMapper.xml | 12 ++ .../src/api/heli/materialplan/index.ts | 4 + .../src/api/heli/storagein/index.ts | 50 +++++ .../src/api/heli/storageindetail/index.ts | 67 ++++++ mes-ui/mes-ui-admin-vue3/src/utils/dict.ts | 3 +- .../src/views/heli/storagein/detail.vue | 168 +++++++++++++++ .../src/views/heli/storagein/index.vue | 182 ++++++++++++++++ .../storagelog/supplemanagementdetail.vue | 156 ++++++++++++++ .../heli/storagelog/supplementManagement.vue | 197 ++++++++++++++++++ 36 files changed, 2341 insertions(+), 14 deletions(-) create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagein/StorageInController.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagein/vo/StorageInPageReqVO.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagein/vo/StorageInRespVO.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagein/vo/StorageInSaveReqVO.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storageindetail/StorageInDetailController.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storageindetail/vo/StorageInDetailPageReqVO.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storageindetail/vo/StorageInDetailRespVO.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storageindetail/vo/StorageInDetailSaveReqVO.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storagein/StorageInDO.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storageindetail/StorageInDetailDO.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagein/StorageInMapper.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storageindetail/StorageInDetailMapper.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagein/StorageInService.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagein/StorageInServiceImpl.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storageindetail/StorageInDetailService.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storageindetail/StorageInDetailServiceImpl.java create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/storagein/StorageInMapper.xml create mode 100644 mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/storageindetail/StorageInDetailMapper.xml create mode 100644 mes-ui/mes-ui-admin-vue3/src/api/heli/storagein/index.ts create mode 100644 mes-ui/mes-ui-admin-vue3/src/api/heli/storageindetail/index.ts create mode 100644 mes-ui/mes-ui-admin-vue3/src/views/heli/storagein/detail.vue create mode 100644 mes-ui/mes-ui-admin-vue3/src/views/heli/storagein/index.vue create mode 100644 mes-ui/mes-ui-admin-vue3/src/views/heli/storagelog/supplemanagementdetail.vue create mode 100644 mes-ui/mes-ui-admin-vue3/src/views/heli/storagelog/supplementManagement.vue diff --git a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java index 81a5b1b..0c39f2a 100644 --- a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java +++ b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/ErrorCodeConstants.java @@ -65,6 +65,8 @@ public interface ErrorCodeConstants { ErrorCode STORAGE_CHECK_NOT_EXISTS = new ErrorCode(1_003_007, "库存盘点不存在"); ErrorCode STORAGE_CHECK_MAT_NOT_EXISTS = new ErrorCode(1_003_008, "盘点物料不存在"); ErrorCode BEFORE_STORAGE_NOT_EXISTS = new ErrorCode(1_003_009, "物料原仓库查询错误"); + ErrorCode STORAGE_IN_NOT_EXISTS = new ErrorCode(1_003_010, "入库单不存在"); + ErrorCode STORAGE_IN_DETAIL_NOT_EXISTS = new ErrorCode(1_003_011, "入库单明细不存在"); /************订单管理***********/ ErrorCode PROJECT_ORDER_NOT_EXISTS = new ErrorCode(1_004_001, "项目订单不存在"); /************发货管理***********/ diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplan/MaterialPlanController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplan/MaterialPlanController.java index d9559af..34557a0 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplan/MaterialPlanController.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplan/MaterialPlanController.java @@ -192,4 +192,11 @@ public class MaterialPlanController { public CommonResult supplement(@Valid @RequestBody List list) { return success(materialPlanService.supplement(list)); } + @DeleteMapping("/delMaterial") + @Operation(summary = "删除库存补充") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:material-plan:delete')") + public CommonResult delMaterial(@RequestParam("id") Long id) { + return materialPlanService.delMaterial(id); + } } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplan/vo/MaterialPlanPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplan/vo/MaterialPlanPageReqVO.java index 476f67c..748e764 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplan/vo/MaterialPlanPageReqVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/materialplan/vo/MaterialPlanPageReqVO.java @@ -66,5 +66,8 @@ public class MaterialPlanPageReqVO extends PageParam { private String matType; @Schema(description = "类型") private String type; + @Schema(description = "制单日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] matPlanDate; } \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagein/StorageInController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagein/StorageInController.java new file mode 100644 index 0000000..c4dadaa --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagein/StorageInController.java @@ -0,0 +1,104 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.storagein; + +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; + +import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; + +import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; +import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*; + +import com.chanko.yunxi.mes.module.heli.controller.admin.storagein.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagein.StorageInDO; +import com.chanko.yunxi.mes.module.heli.service.storagein.StorageInService; + +@Tag(name = "管理后台 - 入库单") +@RestController +@RequestMapping("/heli/storage-in") +@Validated +public class StorageInController { + + @Resource + private StorageInService storageInService; + + @PostMapping("/create") + @Operation(summary = "创建入库单") + @PreAuthorize("@ss.hasPermission('heli:storage-in:create')") + public CommonResult createStorageIn(@Valid @RequestBody StorageInSaveReqVO createReqVO) { + return success(storageInService.createStorageIn(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新入库单") + @PreAuthorize("@ss.hasPermission('heli:storage-in:update')") + public CommonResult updateStorageIn(@Valid @RequestBody StorageInSaveReqVO updateReqVO) { + storageInService.updateStorageIn(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除入库单") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:storage-in:delete')") + public CommonResult deleteStorageIn(@RequestParam("id") Long id) { + storageInService.deleteStorageIn(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得入库单") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('heli:storage-in:query')") + public CommonResult getStorageIn(@RequestParam("id") Long id) { + StorageInDO storageIn = storageInService.getStorageIn(id); + return success(BeanUtils.toBean(storageIn, StorageInRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得入库单分页") + @PreAuthorize("@ss.hasPermission('heli:storage-in:query')") + public CommonResult> getStorageInPage(@Valid StorageInPageReqVO pageReqVO) { + PageResult pageResult = storageInService.getStorageInPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, StorageInRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出入库单 Excel") + @PreAuthorize("@ss.hasPermission('heli:storage-in:export')") + @OperateLog(type = EXPORT) + public void exportStorageInExcel(@Valid StorageInPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = storageInService.getStorageInPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "入库单.xls", "数据", StorageInRespVO.class, + BeanUtils.toBean(list, StorageInRespVO.class)); + } + @GetMapping("/isPrint") + @Operation(summary = "打印") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('heli:storage-in:query')") + public CommonResult isPrint(@RequestParam("id") Long id) { + + return success(storageInService.isPrint(id)); + + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagein/vo/StorageInPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagein/vo/StorageInPageReqVO.java new file mode 100644 index 0000000..c8e1a3e --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagein/vo/StorageInPageReqVO.java @@ -0,0 +1,63 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.storagein.vo; + +import lombok.*; + +import java.time.LocalDate; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 入库单分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class StorageInPageReqVO extends PageParam { + @Schema(description = "入库id") + private String storageId; + @Schema(description = "入库单号") + private String storageNo; + + @Schema(description = "采购单类型,1按物料需求计划采购,2备库采购", example = "2") + private Integer purchaseType; + + @Schema(description = "入库单类型,1物料,2加工件", example = "1") + private Integer goodsType; + + @Schema(description = "暂估价金额", example = "9239") + private BigDecimal estimatedPrice; + + @Schema(description = "实际价金额", example = "2208") + private BigDecimal actualPrice; + + @Schema(description = "单据状态,0 未确认,1已确认", example = "1") + private Integer status; + + @Schema(description = "备注", example = "随便") + private String description; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "是否打印") + private String isPrint; + + @Schema(description = "打印时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] printDtime; + + @Schema(description = "入库日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDate[] ordDate; + @Schema(description = "子项目名称") + private String projectSubName; + @Schema(description = "项目名称") + private String projectName; + @Schema(description = "供应商名称") + private String supplierName; +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagein/vo/StorageInRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagein/vo/StorageInRespVO.java new file mode 100644 index 0000000..f579e58 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagein/vo/StorageInRespVO.java @@ -0,0 +1,70 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.storagein.vo; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDate; +import java.util.*; +import java.util.*; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 入库单 Response VO") +@Data +@ExcelIgnoreUnannotated +public class StorageInRespVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "7657") + @ExcelProperty("自增字段,唯一") + private Long id; + + @Schema(description = "入库单号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("入库单号") + private String storageNo; + + @Schema(description = "采购单类型,1按物料需求计划采购,2备库采购", example = "2") + @ExcelProperty("采购单类型,1按物料需求计划采购,2备库采购") + private Integer purchaseType; + + @Schema(description = "入库单类型,1物料,2加工件", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty("入库单类型,1物料,2加工件") + private Integer goodsType; + + @Schema(description = "暂估价金额", example = "9239") + @ExcelProperty("暂估价金额") + private BigDecimal estimatedPrice; + + @Schema(description = "实际价金额", example = "2208") + @ExcelProperty("实际价金额") + private BigDecimal actualPrice; + + @Schema(description = "单据状态,0 未确认,1已确认", example = "1") + @ExcelProperty("单据状态,0 未确认,1已确认") + private Integer status; + + @Schema(description = "备注", example = "随便") + @ExcelProperty("备注") + private String description; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "是否打印") + @ExcelProperty("是否打印") + private String isPrint; + + @Schema(description = "打印时间") + @ExcelProperty("打印时间") + private LocalDateTime printDtime; + + @Schema(description = "入库日期") + @ExcelProperty("入库日期") + private Date ordDate; + @Schema(description = "供应商") + private String supplierName; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagein/vo/StorageInSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagein/vo/StorageInSaveReqVO.java new file mode 100644 index 0000000..37b1d0b --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagein/vo/StorageInSaveReqVO.java @@ -0,0 +1,53 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.storagein.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +import java.time.LocalDate; +import java.util.*; +import javax.validation.constraints.*; +import java.util.*; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 入库单新增/修改 Request VO") +@Data +public class StorageInSaveReqVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "7657") + private Long id; + + @Schema(description = "入库单号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "入库单号不能为空") + private String storageNo; + + @Schema(description = "采购单类型,1按物料需求计划采购,2备库采购", example = "2") + private Integer purchaseType; + + @Schema(description = "入库单类型,1物料,2加工件", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotNull(message = "入库单类型,1物料,2加工件不能为空") + private Integer goodsType; + + @Schema(description = "暂估价金额", example = "9239") + private BigDecimal estimatedPrice; + + @Schema(description = "实际价金额", example = "2208") + private BigDecimal actualPrice; + + @Schema(description = "单据状态,0 未确认,1已确认", example = "1") + private Integer status; + + @Schema(description = "备注", example = "随便") + private String description; + + @Schema(description = "是否打印") + private String isPrint; + + @Schema(description = "打印时间") + private LocalDateTime printDtime; + + @Schema(description = "入库日期") + private LocalDate ordDate; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storageindetail/StorageInDetailController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storageindetail/StorageInDetailController.java new file mode 100644 index 0000000..529ea2d --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storageindetail/StorageInDetailController.java @@ -0,0 +1,105 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.storageindetail; + +import com.chanko.yunxi.mes.module.heli.controller.admin.purchaseordermake.vo.PartPurchaseOrderPageRespVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.storagein.vo.StorageInPageReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.storagein.vo.StorageInRespVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagein.StorageInDO; +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import javax.validation.constraints.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; + +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.CommonResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success; + +import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils; + +import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog; +import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*; + +import com.chanko.yunxi.mes.module.heli.controller.admin.storageindetail.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storageindetail.StorageInDetailDO; +import com.chanko.yunxi.mes.module.heli.service.storageindetail.StorageInDetailService; + +@Tag(name = "管理后台 - 入库单明细") +@RestController +@RequestMapping("/heli/storage-in-detail") +@Validated +public class StorageInDetailController { + + @Resource + private StorageInDetailService storageInDetailService; + + @PostMapping("/create") + @Operation(summary = "创建入库单明细") + @PreAuthorize("@ss.hasPermission('heli:storage-in-detail:create')") + public CommonResult createStorageInDetail(@Valid @RequestBody StorageInDetailSaveReqVO createReqVO) { + return success(storageInDetailService.createStorageInDetail(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新入库单明细") + @PreAuthorize("@ss.hasPermission('heli:storage-in-detail:update')") + public CommonResult updateStorageInDetail(@Valid @RequestBody StorageInDetailSaveReqVO updateReqVO) { + storageInDetailService.updateStorageInDetail(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除入库单明细") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('heli:storage-in-detail:delete')") + public CommonResult deleteStorageInDetail(@RequestParam("id") Long id) { + storageInDetailService.deleteStorageInDetail(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得入库单明细") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('heli:storage-in-detail:query')") + public CommonResult getStorageInDetail(@RequestParam("id") Long id) { + StorageInDetailDO storageInDetail = storageInDetailService.getStorageInDetail(id); + return success(BeanUtils.toBean(storageInDetail, StorageInDetailRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得入库单明细分页") + @PreAuthorize("@ss.hasPermission('heli:storage-in-detail:query')") + public CommonResult> getStorageInDetailPage(@Valid StorageInDetailPageReqVO pageReqVO) { + PageResult pageResult = storageInDetailService.getStorageInDetailPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, StorageInDetailRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出入库单明细 Excel") + @PreAuthorize("@ss.hasPermission('heli:storage-in-detail:export')") + @OperateLog(type = EXPORT) + public void exportStorageInDetailExcel(@Valid StorageInDetailPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = storageInDetailService.getStorageInDetailPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "入库单明细.xls", "数据", StorageInDetailRespVO.class, + BeanUtils.toBean(list, StorageInDetailRespVO.class)); + } + @GetMapping("/getByStorageId") + @Operation(summary = "根据入库单id获取入库单明细") + @PreAuthorize("@ss.hasPermission('heli:storage-in:query')") + public CommonResult> getByStorageId(@Valid StorageInDetailPageReqVO pageReqVO) { + PageResult pageResult = storageInDetailService.getByStorageId(pageReqVO); + return success(BeanUtils.toBean(pageResult, StorageInDetailRespVO.class)); + } +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storageindetail/vo/StorageInDetailPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storageindetail/vo/StorageInDetailPageReqVO.java new file mode 100644 index 0000000..f07f7cd --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storageindetail/vo/StorageInDetailPageReqVO.java @@ -0,0 +1,109 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.storageindetail.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 入库单明细分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class StorageInDetailPageReqVO extends PageParam { + + @Schema(description = "入库单id", example = "23487") + private Long storageNoId; + + @Schema(description = "加工件boom detail id", example = "32678") + private Long boomDetailId; + + @Schema(description = "零件名称", example = "张三") + private String boomName; + + @Schema(description = "规格型号") + private String boomSpec; + + @Schema(description = "系统单位") + private String boomUnit; + + @Schema(description = "材质") + private String composition; + + @Schema(description = "采购数量") + private BigDecimal purchaseAmount; + + @Schema(description = "暂估价金额", example = "26185") + private BigDecimal estimatedPrice; + + @Schema(description = "实际价金额", example = "14940") + private BigDecimal actualPrice; + + @Schema(description = "预计到货日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] arriveTime; + + @Schema(description = "备注", example = "随便") + private String description; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "需求数量") + private BigDecimal boomAmount; + + @Schema(description = "需求到货日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] requireTime; + + @Schema(description = "物料需求计划id", example = "27752") + private Long projectMaterialPlanId; + + @Schema(description = "物料需求计划子项目id", example = "18434") + private Long projectMaterialPlanBoomId; + + @Schema(description = "订单子项目id", example = "2100") + private Long projectPlanSubId; + + @Schema(description = "子项目名称,唯一", example = "张三") + private String name; + + @Schema(description = "子项目简码") + private String nameSim; + + @Schema(description = "订单id", example = "17123") + private Long projectId; + + @Schema(description = "生产计划id", example = "31057") + private Long projectPlanId; + + @Schema(description = "客户id", example = "3397") + private Long customerId; + + @Schema(description = "客户简称") + private String brief; + + @Schema(description = "项目名称", example = "李四") + private String projectName; + + @Schema(description = "项目名称简码") + private String projectNameSim; + + @Schema(description = "物料id", example = "6259") + private Long materialId; + + @Schema(description = "收货状态 未收货/收货中/收货完成 1/2/3", example = "2") + private Boolean receivingStatus; + + @Schema(description = "供应商id", example = "24202") + private Long supplierId; + + @Schema(description = "入库数量") + private BigDecimal storageAmount; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storageindetail/vo/StorageInDetailRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storageindetail/vo/StorageInDetailRespVO.java new file mode 100644 index 0000000..f47baa5 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storageindetail/vo/StorageInDetailRespVO.java @@ -0,0 +1,143 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.storageindetail.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import java.util.*; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 入库单明细 Response VO") +@Data +@ExcelIgnoreUnannotated +public class StorageInDetailRespVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "21640") + @ExcelProperty("自增字段,唯一") + private Long id; + + @Schema(description = "入库单id", requiredMode = Schema.RequiredMode.REQUIRED, example = "23487") + @ExcelProperty("入库单id") + private Long storageNoId; + + @Schema(description = "加工件boom detail id", example = "32678") + @ExcelProperty("加工件boom detail id") + private Long boomDetailId; + + @Schema(description = "零件名称", example = "张三") + @ExcelProperty("零件名称") + private String boomName; + + @Schema(description = "规格型号") + @ExcelProperty("规格型号") + private String boomSpec; + + @Schema(description = "系统单位") + @ExcelProperty("系统单位") + private String boomUnit; + + @Schema(description = "材质") + @ExcelProperty("材质") + private String composition; + + @Schema(description = "采购数量") + @ExcelProperty("采购数量") + private BigDecimal purchaseAmount; + + @Schema(description = "暂估价金额", example = "26185") + @ExcelProperty("暂估价金额") + private BigDecimal estimatedPrice; + + @Schema(description = "实际价金额", example = "14940") + @ExcelProperty("实际价金额") + private BigDecimal actualPrice; + + @Schema(description = "预计到货日期") + @ExcelProperty("预计到货日期") + private LocalDateTime arriveTime; + + @Schema(description = "备注", example = "随便") + @ExcelProperty("备注") + private String description; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "需求数量") + @ExcelProperty("需求数量") + private BigDecimal boomAmount; + + @Schema(description = "需求到货日期") + @ExcelProperty("需求到货日期") + private LocalDateTime requireTime; + + @Schema(description = "物料需求计划id", example = "27752") + @ExcelProperty("物料需求计划id") + private Long projectMaterialPlanId; + + @Schema(description = "物料需求计划子项目id", example = "18434") + @ExcelProperty("物料需求计划子项目id") + private Long projectMaterialPlanBoomId; + + @Schema(description = "订单子项目id", example = "2100") + @ExcelProperty("订单子项目id") + private Long projectPlanSubId; + + @Schema(description = "子项目名称,唯一", example = "张三") + @ExcelProperty("子项目名称,唯一") + private String name; + + @Schema(description = "子项目简码") + @ExcelProperty("子项目简码") + private String nameSim; + + @Schema(description = "订单id", example = "17123") + @ExcelProperty("订单id") + private Long projectId; + + @Schema(description = "生产计划id", example = "31057") + @ExcelProperty("生产计划id") + private Long projectPlanId; + + @Schema(description = "客户id", example = "3397") + @ExcelProperty("客户id") + private Long customerId; + + @Schema(description = "客户简称") + @ExcelProperty("客户简称") + private String brief; + + @Schema(description = "项目名称", example = "李四") + @ExcelProperty("项目名称") + private String projectName; + + @Schema(description = "项目名称简码") + @ExcelProperty("项目名称简码") + private String projectNameSim; + + @Schema(description = "物料id", example = "6259") + @ExcelProperty("物料id") + private Long materialId; + + @Schema(description = "收货状态 未收货/收货中/收货完成 1/2/3", example = "2") + @ExcelProperty("收货状态 未收货/收货中/收货完成 1/2/3") + private Integer receivingStatus; + + @Schema(description = "供应商id", example = "24202") + @ExcelProperty("供应商id") + private Long supplierId; + + @Schema(description = "入库数量") + @ExcelProperty("入库数量") + private BigDecimal storageAmount; + @Schema(description = "供应商名称") + private String supplierName; + @Schema(description = "物料编码") + private String materialCode; + @Schema(description = "子项目编码") + @ExcelProperty("子项目编码") + private String projectSubCode; +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storageindetail/vo/StorageInDetailSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storageindetail/vo/StorageInDetailSaveReqVO.java new file mode 100644 index 0000000..b9f1710 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storageindetail/vo/StorageInDetailSaveReqVO.java @@ -0,0 +1,104 @@ +package com.chanko.yunxi.mes.module.heli.controller.admin.storageindetail.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; +import java.util.*; +import java.math.BigDecimal; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 入库单明细新增/修改 Request VO") +@Data +public class StorageInDetailSaveReqVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "21640") + private Long id; + + @Schema(description = "入库单id", requiredMode = Schema.RequiredMode.REQUIRED, example = "23487") + @NotNull(message = "入库单id不能为空") + private Long storageNoId; + + @Schema(description = "加工件boom detail id", example = "32678") + private Long boomDetailId; + + @Schema(description = "零件名称", example = "张三") + private String boomName; + + @Schema(description = "规格型号") + private String boomSpec; + + @Schema(description = "系统单位") + private String boomUnit; + + @Schema(description = "材质") + private String composition; + + @Schema(description = "采购数量") + private BigDecimal purchaseAmount; + + @Schema(description = "暂估价金额", example = "26185") + private BigDecimal estimatedPrice; + + @Schema(description = "实际价金额", example = "14940") + private BigDecimal actualPrice; + + @Schema(description = "预计到货日期") + private LocalDateTime arriveTime; + + @Schema(description = "备注", example = "随便") + private String description; + + @Schema(description = "需求数量") + private BigDecimal boomAmount; + + @Schema(description = "需求到货日期") + private LocalDateTime requireTime; + + @Schema(description = "物料需求计划id", example = "27752") + private Long projectMaterialPlanId; + + @Schema(description = "物料需求计划子项目id", example = "18434") + private Long projectMaterialPlanBoomId; + + @Schema(description = "订单子项目id", example = "2100") + private Long projectPlanSubId; + + @Schema(description = "子项目名称,唯一", example = "张三") + private String name; + + @Schema(description = "子项目简码") + private String nameSim; + + @Schema(description = "订单id", example = "17123") + private Long projectId; + + @Schema(description = "生产计划id", example = "31057") + private Long projectPlanId; + + @Schema(description = "客户id", example = "3397") + private Long customerId; + + @Schema(description = "客户简称") + private String brief; + + @Schema(description = "项目名称", example = "李四") + private String projectName; + + @Schema(description = "项目名称简码") + private String projectNameSim; + + @Schema(description = "物料id", example = "6259") + private Long materialId; + + @Schema(description = "收货状态 未收货/收货中/收货完成 1/2/3", example = "2") + private Boolean receivingStatus; + + @Schema(description = "供应商id", example = "24202") + private Long supplierId; + + @Schema(description = "入库数量") + private BigDecimal storageAmount; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/purchaseorderno/PurchaseOrderNoDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/purchaseorderno/PurchaseOrderNoDO.java index 23db3a2..14cf877 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/purchaseorderno/PurchaseOrderNoDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/purchaseorderno/PurchaseOrderNoDO.java @@ -142,6 +142,12 @@ public class PurchaseOrderNoDO extends BaseDO { @TableField(exist = false) private String contactMobile; @TableField(exist = false) + private String buyer; + @TableField(exist = false) + private String postalCode; + @TableField(exist = false) + private String deliveryAddress; + @TableField(exist = false) private Integer receivingStatus1; @TableField(exist = false) private List PurchaseOrderNoDetailList; diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storagein/StorageInDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storagein/StorageInDO.java new file mode 100644 index 0000000..4bafd4e --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storagein/StorageInDO.java @@ -0,0 +1,83 @@ +package com.chanko.yunxi.mes.module.heli.dal.dataobject.storagein; + +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storageindetail.StorageInDetailDO; +import lombok.*; + +import java.time.LocalDate; +import java.util.*; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; + +/** + * 入库单 DO + * + * @author 管理员 + */ +@TableName("project_storage_in") +@KeySequence("project_storage_in_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class StorageInDO extends BaseDO { + + /** + * 自增字段,唯一 + */ + @TableId + private Long id; + /** + * 入库单号 + */ + private String storageNo; + /** + * 采购单类型,1按物料需求计划采购,2备库采购 + */ + private Integer purchaseType; + /** + * 入库单类型,1物料,2加工件 + */ + private Integer goodsType; + /** + * 暂估价金额 + */ + private BigDecimal estimatedPrice; + /** + * 实际价金额 + */ + private BigDecimal actualPrice; + /** + * 单据状态,0 未确认,1已确认 + */ + private Integer status; + /** + * 备注 + */ + private String description; + /** + * 是否打印 + */ + private String isPrint; + /** + * 打印时间 + */ + private LocalDateTime printDtime; + /** + * 入库日期 + */ + private Date ordDate; + /** + * 供应商名称 + */ + @TableField(exist = false) + private String supplierName; + @TableField(exist = false) + private List storageInDetailDOList; +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storageindetail/StorageInDetailDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storageindetail/StorageInDetailDO.java new file mode 100644 index 0000000..3ff66e2 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storageindetail/StorageInDetailDO.java @@ -0,0 +1,163 @@ +package com.chanko.yunxi.mes.module.heli.dal.dataobject.storageindetail; + +import lombok.*; +import java.util.*; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.*; +import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; + +/** + * 入库单明细 DO + * + * @author 管理员 + */ +@TableName("project_storage_in_detail") +@KeySequence("project_storage_in_detail_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class StorageInDetailDO extends BaseDO { + + /** + * 自增字段,唯一 + */ + @TableId + private Long id; + /** + * 入库单id + */ + private Long storageNoId; + /** + * 加工件boom detail id + */ + private Long boomDetailId; + /** + * 零件名称 + */ + private String boomName; + /** + * 规格型号 + */ + private String boomSpec; + /** + * 系统单位 + */ + private String boomUnit; + /** + * 材质 + */ + private String composition; + /** + * 采购数量 + */ + private BigDecimal purchaseAmount; + /** + * 暂估价金额 + */ + private BigDecimal estimatedPrice; + /** + * 实际价金额 + */ + private BigDecimal actualPrice; + /** + * 预计到货日期 + */ + private LocalDateTime arriveTime; + /** + * 备注 + */ + private String description; + /** + * 需求数量 + */ + private BigDecimal boomAmount; + /** + * 需求到货日期 + */ + private LocalDateTime requireTime; + /** + * 物料需求计划id + */ + private Long projectMaterialPlanId; + /** + * 物料需求计划子项目id + */ + private Long projectMaterialPlanBoomId; + /** + * 订单子项目id + */ + private Long projectPlanSubId; + /** + * 子项目名称,唯一 + */ + private String name; + /** + * 子项目简码 + */ + private String nameSim; + /** + * 订单id + */ + private Long projectId; + /** + * 生产计划id + */ + private Long projectPlanId; + /** + * 客户id + */ + private Long customerId; + /** + * 客户简称 + */ + private String brief; + /** + * 项目名称 + */ + private String projectName; + /** + * 项目名称简码 + */ + private String projectNameSim; + /** + * 物料id + */ + private Long materialId; + /** + * 收货状态 未收货/收货中/收货完成 1/2/3 + */ + private Boolean receivingStatus; + /** + * 供应商id + */ + private Long supplierId; + /** + * 入库数量 + */ + private BigDecimal storageAmount; + private String projectSubCode; + + + /** + * 供应商名称 + */ + @TableField(exist = false) + private String supplierName; + /** + * 物料编码 + */ + @TableField(exist = false) + private String materialCode; + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplan/MaterialPlanMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplan/MaterialPlanMapper.java index 47de98d..a98c873 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplan/MaterialPlanMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplan/MaterialPlanMapper.java @@ -11,6 +11,7 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplan.MaterialPlan import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.plan.PlanDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskreport.TaskReportDO; import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO; import com.github.yulichang.wrapper.MPJLambdaWrapper; import org.apache.ibatis.annotations.Mapper; @@ -54,8 +55,9 @@ public interface MaterialPlanMapper extends BaseMapperX { .like(!StringUtils.isEmpty(pageReqVO.getProjectSubName()), MaterialPlanDO::getName, pageReqVO.getProjectSubName()) .like(!StringUtils.isEmpty(pageReqVO.getMaterialName()), MaterialPlanBoomDO::getMatName, pageReqVO.getMaterialName()) .eq(!StringUtils.isEmpty(pageReqVO.getMatType()), MaterialPlanDO::getMatType, pageReqVO.getMatType()); - - + if (pageReqVO.getMatPlanDate() != null) { + query.between( MaterialPlanDO::getMatPlanDate, pageReqVO.getMatPlanDate()[0], pageReqVO.getMatPlanDate()[1]); + } return selectPage(pageReqVO, query); } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplanboom/MaterialPlanBoomMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplanboom/MaterialPlanBoomMapper.java index 03676b5..6ef13c3 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplanboom/MaterialPlanBoomMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/materialplanboom/MaterialPlanBoomMapper.java @@ -135,10 +135,12 @@ public interface MaterialPlanBoomMapper extends BaseMapperX MPJLambdaWrapper query = new MPJLambdaWrapper<>(); query.selectAll(MaterialPlanBoomDO.class) .select("a.nickname as nickname,b.spec as boomSpec,g.name as procedureName,bc.`name` as compositionName") + .select("m.code as matCode,m.spec as matSpec,m.unit as matUnit") .leftJoin(AdminUserDO.class, "a", AdminUserDO::getId, MaterialPlanBoomDO::getDuEmpId) .leftJoin(ProcessBomDetailDO.class, "b", ProcessBomDetailDO::getId, MaterialPlanBoomDO::getBoomDetailId) .leftJoin(CompositionDO.class, "bc", CompositionDO::getId, ProcessBomDetailDO::getCompositionId) .leftJoin(ProcedureDO.class, "g", ProcedureDO::getId, MaterialPlanBoomDO::getProcedureId) + .leftJoin(MaterialDO.class,"m",MaterialDO::getId, MaterialPlanBoomDO::getMaterialId) .orderByDesc(MaterialPlanBoomDO::getId) .disableSubLogicDel() ; @@ -173,7 +175,6 @@ public interface MaterialPlanBoomMapper extends BaseMapperX .leftJoin(MaterialPlanDO.class, "p", MaterialPlanDO::getId,MaterialPlanBoomDO::getProjectMaterialPlanId) .leftJoin(ProjectOrderDO.class,"b",ProjectOrderDO::getId,MaterialPlanDO::getProjectId) .leftJoin(ProcessBomDetailDO.class,"d",ProcessBomDetailDO::getId,MaterialPlanBoomDO::getBoomDetailId) -// .leftJoin(MatReqDetailDO.class,"mat",MatReqDetailDO::getProjectMaterialPlanDetailId,MaterialPlanBoomDO::getId) .leftJoin("project_mat_req_detail mat on (t.id=mat.project_material_plan_detail_id and mat.deleted=0)") .leftJoin(MaterialDO.class,"m",MaterialDO::getId,MatReqDetailDO::getMaterialId) .disableSubLogicDel() diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/purchaseordernodetail/PurchaseOrderNoDetailMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/purchaseordernodetail/PurchaseOrderNoDetailMapper.java index 84775f8..35b9bac 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/purchaseordernodetail/PurchaseOrderNoDetailMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/purchaseordernodetail/PurchaseOrderNoDetailMapper.java @@ -58,11 +58,11 @@ public interface PurchaseOrderNoDetailMapper extends BaseMapperX query = new MPJLambdaWrapper<>(); query.selectAll(PurchaseOrderNoDetailDO.class) - .select("com.name as compositionName","t.purchase_rem_amount as purchaseRemAmounts","mat.code as matCode","pro.name as procedureName") + .select("t.composition as compositionName","t.purchase_rem_amount as purchaseRemAmounts","mat.code as matCode","pro.name as procedureName") .leftJoin(PurchaseOrderNoDO.class, "pb", PurchaseOrderNoDO::getId, PurchaseOrderBoomDO::getPurchaseOrderId) .leftJoin(ProcessBomDetailDO.class,"bom", ProcessBomDetailDO::getId, PurchaseOrderNoDetailDO::getBoomDetailId) .leftJoin(MaterialPlanBoomDO.class,"plan", MaterialPlanBoomDO::getId, PurchaseOrderNoDetailDO::getProjectMaterialPlanBoomId) - .leftJoin(ProcedureDO.class,"pro", ProcedureDO::getId, MaterialPlanBoomDO::getProcedureId) + .leftJoin(ProcedureDO.class,"pro", ProcedureDO::getId, PurchaseOrderNoDetailDO::getProcedureId) .leftJoin(CompositionDO.class, "com", CompositionDO::getId, PurchaseOrderNoDetailDO::getComposition) .leftJoin(ProjectOrderSubDO.class,"sub",ProjectOrderSubDO::getId, PurchaseOrderNoDetailDO::getProjectPlanSubId) .leftJoin(MaterialDO.class,"mat",MaterialDO::getId,PurchaseOrderNoDetailDO::getMaterialId) diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagein/StorageInMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagein/StorageInMapper.java new file mode 100644 index 0000000..ef47f0e --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagein/StorageInMapper.java @@ -0,0 +1,45 @@ +package com.chanko.yunxi.mes.module.heli.dal.mysql.storagein; + +import java.util.*; + +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplan.MaterialPlanDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorder.PurchaseOrderDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagein.StorageInDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storageindetail.StorageInDetailDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.supplier.SupplierDO; +import com.chanko.yunxi.mes.module.heli.dal.mysql.storageindetail.StorageInDetailMapper; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import org.apache.ibatis.annotations.Mapper; +import com.chanko.yunxi.mes.module.heli.controller.admin.storagein.vo.*; +import org.springframework.util.StringUtils; + +/** + * 入库单 Mapper + * + * @author 管理员 + */ +@Mapper +public interface StorageInMapper extends BaseMapperX { + + default PageResult selectPage(StorageInPageReqVO reqVO) { + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + + query.selectAll(StorageInDO.class) + .select("sup.name as supplierName") + .leftJoin(StorageInDetailDO.class, "s", StorageInDetailDO::getStorageNoId, StorageInDO::getId) + .leftJoin(SupplierDO.class,"sup", SupplierDO::getId, StorageInDetailDO::getSupplierId) + .disableSubLogicDel() + .groupBy(StorageInDO::getId) + .orderByDesc(PurchaseOrderDO::getCreateTime); + query.like(!StringUtils.isEmpty(reqVO.getStorageNo()), StorageInDO::getStorageNo, reqVO.getStorageNo()); + query.like(!StringUtils.isEmpty(reqVO.getProjectName()), StorageInDetailDO::getProjectName, reqVO.getProjectName()); + query.like(!StringUtils.isEmpty(reqVO.getProjectSubName()), StorageInDetailDO::getName, reqVO.getProjectSubName()); + query.like(!StringUtils.isEmpty(reqVO.getSupplierName()), SupplierDO::getName, reqVO.getSupplierName()); + query.eq(reqVO.getGoodsType() != null, StorageInDO::getGoodsType, reqVO.getGoodsType()); + return selectPage(reqVO, query); + } + +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storageindetail/StorageInDetailMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storageindetail/StorageInDetailMapper.java new file mode 100644 index 0000000..d37e4c6 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storageindetail/StorageInDetailMapper.java @@ -0,0 +1,72 @@ +package com.chanko.yunxi.mes.module.heli.dal.mysql.storageindetail; + +import java.util.*; + +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorder.PurchaseOrderDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagein.StorageInDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storageindetail.StorageInDetailDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.supplier.SupplierDO; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import org.apache.ibatis.annotations.Mapper; +import com.chanko.yunxi.mes.module.heli.controller.admin.storageindetail.vo.*; +import org.springframework.util.StringUtils; + +/** + * 入库单明细 Mapper + * + * @author 管理员 + */ +@Mapper +public interface StorageInDetailMapper extends BaseMapperX { + + default PageResult selectPage(StorageInDetailPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(StorageInDetailDO::getStorageNoId, reqVO.getStorageNoId()) + .eqIfPresent(StorageInDetailDO::getBoomDetailId, reqVO.getBoomDetailId()) + .likeIfPresent(StorageInDetailDO::getBoomName, reqVO.getBoomName()) + .eqIfPresent(StorageInDetailDO::getBoomSpec, reqVO.getBoomSpec()) + .eqIfPresent(StorageInDetailDO::getBoomUnit, reqVO.getBoomUnit()) + .eqIfPresent(StorageInDetailDO::getComposition, reqVO.getComposition()) + .eqIfPresent(StorageInDetailDO::getPurchaseAmount, reqVO.getPurchaseAmount()) + .eqIfPresent(StorageInDetailDO::getEstimatedPrice, reqVO.getEstimatedPrice()) + .eqIfPresent(StorageInDetailDO::getActualPrice, reqVO.getActualPrice()) + .betweenIfPresent(StorageInDetailDO::getArriveTime, reqVO.getArriveTime()) + .eqIfPresent(StorageInDetailDO::getDescription, reqVO.getDescription()) + .betweenIfPresent(StorageInDetailDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(StorageInDetailDO::getBoomAmount, reqVO.getBoomAmount()) + .betweenIfPresent(StorageInDetailDO::getRequireTime, reqVO.getRequireTime()) + .eqIfPresent(StorageInDetailDO::getProjectMaterialPlanId, reqVO.getProjectMaterialPlanId()) + .eqIfPresent(StorageInDetailDO::getProjectMaterialPlanBoomId, reqVO.getProjectMaterialPlanBoomId()) + .eqIfPresent(StorageInDetailDO::getProjectPlanSubId, reqVO.getProjectPlanSubId()) + .likeIfPresent(StorageInDetailDO::getName, reqVO.getName()) + .eqIfPresent(StorageInDetailDO::getNameSim, reqVO.getNameSim()) + .eqIfPresent(StorageInDetailDO::getProjectId, reqVO.getProjectId()) + .eqIfPresent(StorageInDetailDO::getProjectPlanId, reqVO.getProjectPlanId()) + .eqIfPresent(StorageInDetailDO::getCustomerId, reqVO.getCustomerId()) + .eqIfPresent(StorageInDetailDO::getBrief, reqVO.getBrief()) + .likeIfPresent(StorageInDetailDO::getProjectName, reqVO.getProjectName()) + .eqIfPresent(StorageInDetailDO::getProjectNameSim, reqVO.getProjectNameSim()) + .eqIfPresent(StorageInDetailDO::getMaterialId, reqVO.getMaterialId()) + .eqIfPresent(StorageInDetailDO::getReceivingStatus, reqVO.getReceivingStatus()) + .eqIfPresent(StorageInDetailDO::getSupplierId, reqVO.getSupplierId()) + .eqIfPresent(StorageInDetailDO::getStorageAmount, reqVO.getStorageAmount()) + .orderByDesc(StorageInDetailDO::getId)); + } + + default PageResult getByStorageId(StorageInDetailPageReqVO pageReqVO){ + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + + query.selectAll(StorageInDetailDO.class) + .select("sup.name as supplierName","m.code as materialCode") + .leftJoin(SupplierDO.class,"sup", SupplierDO::getId, StorageInDetailDO::getSupplierId) + .leftJoin(MaterialDO.class,"m", MaterialDO::getId, StorageInDetailDO::getMaterialId) + .groupBy(StorageInDetailDO::getId) + .orderByDesc(StorageInDetailDO::getCreateTime); + query.eq(pageReqVO.getStorageNoId() != null, StorageInDetailDO::getStorageNoId, pageReqVO.getStorageNoId()); + return selectPage(pageReqVO, query); + } +} \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplan/MaterialPlanService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplan/MaterialPlanService.java index 465ec2b..734b85d 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplan/MaterialPlanService.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplan/MaterialPlanService.java @@ -78,4 +78,6 @@ public interface MaterialPlanService { CommonResult operation(MaterialPlanPageReqVO pageReqVO); Boolean supplement(List list); + + CommonResult delMaterial(Long id); } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplan/MaterialPlanServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplan/MaterialPlanServiceImpl.java index be30ea3..ed7e0cb 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplan/MaterialPlanServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/materialplan/MaterialPlanServiceImpl.java @@ -11,6 +11,7 @@ import com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthing import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.materialplanboom.MaterialPlanBoomDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.processbom.ProcessBomDetailDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseorderno.PurchaseOrderNoDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.serialnumber.SerialNumberDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagelogNow.StorageLogNowDO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.taskdispatch.TaskDispatchDetailDO; @@ -18,6 +19,7 @@ import com.chanko.yunxi.mes.module.heli.dal.mysql.attentiontodo.AttentiontodoMap import com.chanko.yunxi.mes.module.heli.dal.mysql.material.MaterialMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.materialplanboom.MaterialPlanBoomMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.processbom.ProcessBomDetailMapper; +import com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseorderno.PurchaseOrderNoMapper; import com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatch.TaskDispatchDetailMapper; import com.chanko.yunxi.mes.module.heli.service.attentiontodo.AttentiontodoService; import com.chanko.yunxi.mes.module.heli.service.serialnumber.SerialNumberService; @@ -79,6 +81,8 @@ public class MaterialPlanServiceImpl implements MaterialPlanService { @Resource private ProcessBomDetailMapper processBomDetailMapper; @Resource + private PurchaseOrderNoMapper purchaseOrderNoMapper; + @Resource private TaskDispatchDetailMapper taskDispatchDetailMapper; @Resource private MaterialMapper materialMapper; @@ -355,7 +359,7 @@ public class MaterialPlanServiceImpl implements MaterialPlanService { if (ObjectUtil.isNotEmpty(boomDO)){ switch (pageReqVO.getType()){ case "del": - if (boomDO.getIsPurYard()!=5||boomDO.getIsPurYard()!=2) return CommonResult.error(400,"该物料信息状态非确认状态,请刷新界面!"); + if (boomDO.getIsPurYard()!=5&&boomDO.getIsPurYard()!=2) return CommonResult.error(400,"该物料信息状态非确认状态,请刷新界面!"); boomDO.setIsPurYard(1); break; case "queren": @@ -396,8 +400,9 @@ public class MaterialPlanServiceImpl implements MaterialPlanService { boomDO.setMplanStatus(0); LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(MaterialDO::getCode, nowDO.getMatCode()); - MaterialDO materialDO = materialMapper.selectOne(queryWrapper); - if (ObjectUtil.isNotEmpty(materialDO)){ + List materialDOS = materialMapper.selectList(queryWrapper); + if (ObjectUtil.isNotEmpty(materialDOS)){ + MaterialDO materialDO = materialDOS.get(0); boomDO.setMatName(materialDO.getName()); boomDO.setMaterialId(materialDO.getId()); } @@ -407,4 +412,17 @@ public class MaterialPlanServiceImpl implements MaterialPlanService { return true; } + @Override + public CommonResult delMaterial(Long id) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(PurchaseOrderNoDO::getProjectMaterialPlanId, id); + wrapper.eq(PurchaseOrderNoDO::getDeleted, 0); + if (purchaseOrderNoMapper.selectCount(wrapper) > 0) return CommonResult.error(400, "该单据已做采购订单,请确认!"); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(MaterialPlanBoomDO::getProjectMaterialPlanId, id); + materialPlanBoomMapper.delete(queryWrapper); + materialPlanMapper.deleteById(id); + return null; + } + } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/purchaseorderno/PurchaseOrderNoServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/purchaseorderno/PurchaseOrderNoServiceImpl.java index 33b8e5f..4c10a4d 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/purchaseorderno/PurchaseOrderNoServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/purchaseorderno/PurchaseOrderNoServiceImpl.java @@ -301,12 +301,19 @@ public class PurchaseOrderNoServiceImpl implements PurchaseOrderNoService { PurchaseOrderNoDO purchaseOrderNoDO = purchaseOrderNoMapper.selectById(id); if (ObjectUtil.isNotEmpty(purchaseOrderNoDO)){ AdminUserDO user = adminUserService.getUser(getLoginUser().getId()); - purchaseOrderNoDO.setUsername(user.getNickname()); - purchaseOrderNoDO.setUserMobile(user.getMobile()); + if (ObjectUtil.isNotEmpty(user)){ + purchaseOrderNoDO.setUsername(user.getNickname()); + purchaseOrderNoDO.setUserMobile(user.getMobile()); + } SupplierDO supplierDO = supplierMapper.selectById(purchaseOrderNoDO.getSupplierId()); - purchaseOrderNoDO.setSupplierName(supplierDO.getName()); - purchaseOrderNoDO.setContactName(supplierDO.getContact1Name()); - purchaseOrderNoDO.setContactMobile(supplierDO.getContact1Method()); + if (ObjectUtil.isNotEmpty(supplierDO)){ + purchaseOrderNoDO.setSupplierName(supplierDO.getName()); + purchaseOrderNoDO.setContactName(supplierDO.getContact1Name()); + purchaseOrderNoDO.setContactMobile(supplierDO.getContact1Method()); + } + purchaseOrderNoDO.setPostalCode("311113"); + purchaseOrderNoDO.setDeliveryAddress("浙江省杭州市余杭区良渚街道刘林圩路5号"); + purchaseOrderNoDO.setBuyer("杭州合立机械有限公司"); List detailList = purchaseOrderNoDetailMapper.getPurchaseOrderNoDetailById(id); purchaseOrderNoDO.setPurchaseOrderNoDetailList(detailList); } diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagein/StorageInService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagein/StorageInService.java new file mode 100644 index 0000000..d3e5ee8 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagein/StorageInService.java @@ -0,0 +1,55 @@ +package com.chanko.yunxi.mes.module.heli.service.storagein; + +import javax.validation.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.storagein.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagein.StorageInDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; + +/** + * 入库单 Service 接口 + * + * @author 管理员 + */ +public interface StorageInService { + + /** + * 创建入库单 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createStorageIn(@Valid StorageInSaveReqVO createReqVO); + + /** + * 更新入库单 + * + * @param updateReqVO 更新信息 + */ + void updateStorageIn(@Valid StorageInSaveReqVO updateReqVO); + + /** + * 删除入库单 + * + * @param id 编号 + */ + void deleteStorageIn(Long id); + + /** + * 获得入库单 + * + * @param id 编号 + * @return 入库单 + */ + StorageInDO getStorageIn(Long id); + + /** + * 获得入库单分页 + * + * @param pageReqVO 分页查询 + * @return 入库单分页 + */ + PageResult getStorageInPage(StorageInPageReqVO pageReqVO); + + + StorageInDO isPrint(Long id); +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagein/StorageInServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagein/StorageInServiceImpl.java new file mode 100644 index 0000000..8dad26b --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagein/StorageInServiceImpl.java @@ -0,0 +1,126 @@ +package com.chanko.yunxi.mes.module.heli.service.storagein; + +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.chanko.yunxi.mes.module.heli.controller.admin.storageindetail.vo.StorageInDetailPageReqVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.purchaseordernodetail.PurchaseOrderNoDetailDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storageindetail.StorageInDetailDO; +import com.chanko.yunxi.mes.module.heli.dal.mysql.purchaseordernodetail.PurchaseOrderNoDetailMapper; +import com.chanko.yunxi.mes.module.heli.dal.mysql.storageindetail.StorageInDetailMapper; +import com.sun.corba.se.spi.ior.IdentifiableFactory; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.storagein.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagein.StorageInDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; + +import com.chanko.yunxi.mes.module.heli.dal.mysql.storagein.StorageInMapper; + +import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; + +/** + * 入库单 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class StorageInServiceImpl implements StorageInService { + + @Resource + private StorageInMapper storageInMapper; + @Resource + private StorageInDetailMapper storageInDetailMapper; + @Resource + private PurchaseOrderNoDetailMapper purchaseOrderNoDetailMapper; + @Override + public Long createStorageIn(StorageInSaveReqVO createReqVO) { + // 插入 + StorageInDO storageIn = BeanUtils.toBean(createReqVO, StorageInDO.class); + storageInMapper.insert(storageIn); + // 返回 + return storageIn.getId(); + } + + @Override + public void updateStorageIn(StorageInSaveReqVO updateReqVO) { + // 校验存在 + validateStorageInExists(updateReqVO.getId()); + // 更新 + StorageInDO updateObj = BeanUtils.toBean(updateReqVO, StorageInDO.class); + storageInMapper.updateById(updateObj); + } + + @Override + public void deleteStorageIn(Long id) { + // 校验存在 + validateStorageInExists(id); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(StorageInDetailDO::getStorageNoId,id); + wrapper.eq(StorageInDetailDO::getDeleted,0); + List storageInDetailDOS = storageInDetailMapper.selectList(wrapper); + if (ObjectUtil.isNotEmpty(storageInDetailDOS)){ + for (StorageInDetailDO storageInDetailDO : storageInDetailDOS) { + LambdaQueryWrapper wrapper1 = new LambdaQueryWrapper<>(); + wrapper1.eq(PurchaseOrderNoDetailDO::getStorageId,storageInDetailDO.getStorageNoId()); + wrapper1.eq(PurchaseOrderNoDetailDO::getStorageMatId,storageInDetailDO.getMaterialId()); + PurchaseOrderNoDetailDO purchaseOrderNoDetailDO = purchaseOrderNoDetailMapper.selectOne(wrapper1); + if (ObjectUtil.isNotEmpty(purchaseOrderNoDetailDO)){ + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(PurchaseOrderNoDetailDO::getId,purchaseOrderNoDetailDO.getId()); + updateWrapper.set(PurchaseOrderNoDetailDO::getStorageId,null); + updateWrapper.set(PurchaseOrderNoDetailDO::getStorageMatId,null); + + if (purchaseOrderNoDetailDO.getPurchaseAmount().compareTo(purchaseOrderNoDetailDO.getPurchaseRemAmount())==0){ + updateWrapper.set(PurchaseOrderNoDetailDO::getReceivingStatus,1); + }else { + updateWrapper.set(PurchaseOrderNoDetailDO::getReceivingStatus,2); + } + updateWrapper.set(PurchaseOrderNoDetailDO::getPurchaseRemAmount,purchaseOrderNoDetailDO.getPurchaseRemAmount().add(storageInDetailDO.getStorageAmount())); + purchaseOrderNoDetailMapper.update(updateWrapper); + } + } + } + storageInDetailMapper.delete(new LambdaQueryWrapper().eq(StorageInDetailDO::getStorageNoId,id)); + // 删除 + storageInMapper.deleteById(id); + } + + private void validateStorageInExists(Long id) { + if (storageInMapper.selectById(id) == null) { + throw exception(STORAGE_IN_NOT_EXISTS); + } + } + + @Override + public StorageInDO getStorageIn(Long id) { + return storageInMapper.selectById(id); + } + + @Override + public PageResult getStorageInPage(StorageInPageReqVO pageReqVO) { + return storageInMapper.selectPage(pageReqVO); + } + + @Override + public StorageInDO isPrint(Long id) { + StorageInDO storageInDO = storageInMapper.selectById(id); + if (ObjectUtil.isNotEmpty(storageInDO)){ + StorageInDetailPageReqVO page = new StorageInDetailPageReqVO(); + page.setStorageNoId(id); + page.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = storageInDetailMapper.getByStorageId(page).getList(); + storageInDO.setStorageInDetailDOList(list); + } + return storageInDO; + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storageindetail/StorageInDetailService.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storageindetail/StorageInDetailService.java new file mode 100644 index 0000000..86d64aa --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storageindetail/StorageInDetailService.java @@ -0,0 +1,56 @@ +package com.chanko.yunxi.mes.module.heli.service.storageindetail; + +import java.util.*; +import javax.validation.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.storageindetail.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storageindetail.StorageInDetailDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; + +/** + * 入库单明细 Service 接口 + * + * @author 管理员 + */ +public interface StorageInDetailService { + + /** + * 创建入库单明细 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createStorageInDetail(@Valid StorageInDetailSaveReqVO createReqVO); + + /** + * 更新入库单明细 + * + * @param updateReqVO 更新信息 + */ + void updateStorageInDetail(@Valid StorageInDetailSaveReqVO updateReqVO); + + /** + * 删除入库单明细 + * + * @param id 编号 + */ + void deleteStorageInDetail(Long id); + + /** + * 获得入库单明细 + * + * @param id 编号 + * @return 入库单明细 + */ + StorageInDetailDO getStorageInDetail(Long id); + + /** + * 获得入库单明细分页 + * + * @param pageReqVO 分页查询 + * @return 入库单明细分页 + */ + PageResult getStorageInDetailPage(StorageInDetailPageReqVO pageReqVO); + + PageResult getByStorageId(StorageInDetailPageReqVO pageReqVO); +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storageindetail/StorageInDetailServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storageindetail/StorageInDetailServiceImpl.java new file mode 100644 index 0000000..803dddd --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storageindetail/StorageInDetailServiceImpl.java @@ -0,0 +1,79 @@ +package com.chanko.yunxi.mes.module.heli.service.storageindetail; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import com.chanko.yunxi.mes.module.heli.controller.admin.storageindetail.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storageindetail.StorageInDetailDO; +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; + +import com.chanko.yunxi.mes.module.heli.dal.mysql.storageindetail.StorageInDetailMapper; + +import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; + +/** + * 入库单明细 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class StorageInDetailServiceImpl implements StorageInDetailService { + + @Resource + private StorageInDetailMapper storageInDetailMapper; + + @Override + public Long createStorageInDetail(StorageInDetailSaveReqVO createReqVO) { + // 插入 + StorageInDetailDO storageInDetail = BeanUtils.toBean(createReqVO, StorageInDetailDO.class); + storageInDetailMapper.insert(storageInDetail); + // 返回 + return storageInDetail.getId(); + } + + @Override + public void updateStorageInDetail(StorageInDetailSaveReqVO updateReqVO) { + // 校验存在 + validateStorageInDetailExists(updateReqVO.getId()); + // 更新 + StorageInDetailDO updateObj = BeanUtils.toBean(updateReqVO, StorageInDetailDO.class); + storageInDetailMapper.updateById(updateObj); + } + + @Override + public void deleteStorageInDetail(Long id) { + // 校验存在 + validateStorageInDetailExists(id); + // 删除 + storageInDetailMapper.deleteById(id); + } + + private void validateStorageInDetailExists(Long id) { + if (storageInDetailMapper.selectById(id) == null) { + throw exception(STORAGE_IN_DETAIL_NOT_EXISTS); + } + } + + @Override + public StorageInDetailDO getStorageInDetail(Long id) { + return storageInDetailMapper.selectById(id); + } + + @Override + public PageResult getStorageInDetailPage(StorageInDetailPageReqVO pageReqVO) { + return storageInDetailMapper.selectPage(pageReqVO); + } + + @Override + public PageResult getByStorageId(StorageInDetailPageReqVO pageReqVO) { + return storageInDetailMapper.getByStorageId(pageReqVO); + } + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/storagein/StorageInMapper.xml b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/storagein/StorageInMapper.xml new file mode 100644 index 0000000..f8dcb02 --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/storagein/StorageInMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/storageindetail/StorageInDetailMapper.xml b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/storageindetail/StorageInDetailMapper.xml new file mode 100644 index 0000000..6db5a3c --- /dev/null +++ b/mes-module-heli/mes-module-heli-biz/src/main/resources/mapper/storageindetail/StorageInDetailMapper.xml @@ -0,0 +1,12 @@ + + + + + + + \ No newline at end of file diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/materialplan/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/materialplan/index.ts index cc06ab1..4622a51 100644 --- a/mes-ui/mes-ui-admin-vue3/src/api/heli/materialplan/index.ts +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/materialplan/index.ts @@ -90,3 +90,7 @@ export const exportStandardParts = async (params) => { export const supplement = async (data) => { return await request.post({ url: `/heli/material-plan/supplement`, data }) } +// 删除库存补充 +export const delMaterial = async (id: number) => { + return await request.delete({ url: `/heli/material-plan/delMaterial?id=` + id }) +} diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/storagein/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/storagein/index.ts new file mode 100644 index 0000000..e9e9447 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/storagein/index.ts @@ -0,0 +1,50 @@ +import request from '@/config/axios' + +export interface StorageInVO { + id: number + storageNo: string + purchaseType: boolean + goodsType: boolean + estimatedPrice: number + actualPrice: number + status: boolean + description: string + isPrint: string + printDtime: Date + ordDate: Date +} + +// 查询入库单分页 +export const getStorageInPage = async (params) => { + return await request.get({ url: `/heli/storage-in/page`, params }) +} + +// 查询入库单详情 +export const getStorageIn = async (id: number) => { + return await request.get({ url: `/heli/storage-in/get?id=` + id }) +} + +// 新增入库单 +export const createStorageIn = async (data: StorageInVO) => { + return await request.post({ url: `/heli/storage-in/create`, data }) +} + +// 修改入库单 +export const updateStorageIn = async (data: StorageInVO) => { + return await request.put({ url: `/heli/storage-in/update`, data }) +} + +// 删除入库单 +export const deleteStorageIn = async (id: number) => { + return await request.delete({ url: `/heli/storage-in/delete?id=` + id }) +} + +// 导出入库单 Excel +export const exportStorageIn = async (params) => { + return await request.download({ url: `/heli/storage-in/export-excel`, params }) +} + +// 查询入库单详情 +export const isPrint = async (id: number) => { + return await request.get({ url: `/heli/storage-in/isPrint?id=` + id }) +} diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/storageindetail/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/storageindetail/index.ts new file mode 100644 index 0000000..df38f2a --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/storageindetail/index.ts @@ -0,0 +1,67 @@ +import request from '@/config/axios' + +export interface StorageInDetailVO { + id: number + storageNoId: number + boomDetailId: number + boomName: string + boomSpec: string + boomUnit: string + composition: string + purchaseAmount: number + estimatedPrice: number + actualPrice: number + arriveTime: Date + description: string + boomAmount: number + requireTime: Date + projectMaterialPlanId: number + projectMaterialPlanBoomId: number + projectPlanSubId: number + name: string + nameSim: string + projectId: number + projectPlanId: number + customerId: number + brief: string + projectName: string + projectNameSim: string + materialId: number + receivingStatus: boolean + supplierId: number + storageAmount: number +} + +// 查询入库单明细分页 +export const getStorageInDetailPage = async (params) => { + return await request.get({ url: `/heli/storage-in-detail/page`, params }) +} + +// 查询入库单明细详情 +export const getStorageInDetail = async (id: number) => { + return await request.get({ url: `/heli/storage-in-detail/get?id=` + id }) +} + +// 新增入库单明细 +export const createStorageInDetail = async (data: StorageInDetailVO) => { + return await request.post({ url: `/heli/storage-in-detail/create`, data }) +} + +// 修改入库单明细 +export const updateStorageInDetail = async (data: StorageInDetailVO) => { + return await request.put({ url: `/heli/storage-in-detail/update`, data }) +} + +// 删除入库单明细 +export const deleteStorageInDetail = async (id: number) => { + return await request.delete({ url: `/heli/storage-in-detail/delete?id=` + id }) +} + +// 导出入库单明细 Excel +export const exportStorageInDetail = async (params) => { + return await request.download({ url: `/heli/storage-in-detail/export-excel`, params }) +} +//根据入库id查询入库明细 +export const getByStorageId = async (params) => { + return await request.get({ url: `/heli/storage-in-detail/getByStorageId`, params }) +} diff --git a/mes-ui/mes-ui-admin-vue3/src/utils/dict.ts b/mes-ui/mes-ui-admin-vue3/src/utils/dict.ts index b9038a9..b9407cb 100644 --- a/mes-ui/mes-ui-admin-vue3/src/utils/dict.ts +++ b/mes-ui/mes-ui-admin-vue3/src/utils/dict.ts @@ -291,5 +291,6 @@ export enum DICT_TYPE { HELI_MAT_REQ_TYPE='heli_mat_req_type', HELI_MAT_REQ_STATUS='heli_mat_req_status', HELI_MATERIAL_STATUS='heli_material_status', - HELI_DOCUMENT_STATUS='heli_document_status' + HELI_DOCUMENT_STATUS='heli_document_status', + HELI_STORAGEIN_STATUS='heli_storagein_status' } diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/storagein/detail.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/storagein/detail.vue new file mode 100644 index 0000000..ae8ef76 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/storagein/detail.vue @@ -0,0 +1,168 @@ + + diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/storagein/index.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/storagein/index.vue new file mode 100644 index 0000000..015bcd8 --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/storagein/index.vue @@ -0,0 +1,182 @@ + + + diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/storagelog/supplemanagementdetail.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/storagelog/supplemanagementdetail.vue new file mode 100644 index 0000000..4314dfe --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/storagelog/supplemanagementdetail.vue @@ -0,0 +1,156 @@ + + diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/storagelog/supplementManagement.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/storagelog/supplementManagement.vue new file mode 100644 index 0000000..aead1cf --- /dev/null +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/storagelog/supplementManagement.vue @@ -0,0 +1,197 @@ + + +