diff --git a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/CodeEnum.java b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/CodeEnum.java index 83269644..ffb1b6fb 100644 --- a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/CodeEnum.java +++ b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/CodeEnum.java @@ -40,6 +40,7 @@ public enum CodeEnum { WAREHOUSE("仓库", "Wa", 4), STOCK_IN("入库单", "WI", 4, "yyyyMMdd"), STOCK_OUT("出库单", "WO", 4, "yyyyMMdd"), + STOCK_CHECK("盘点单据", "WC", 4, "yyyyMMdd"), PROJECT_ORDER("业务订单", 3, "yyyyMM"), PROJECT_DELIVERY_ORDER("发货单", "HL", 3, "yyyyMM"), ; diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagecheck/vo/StorageCheckRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagecheck/vo/StorageCheckRespVO.java index 72027852..96a8a5ec 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagecheck/vo/StorageCheckRespVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagecheck/vo/StorageCheckRespVO.java @@ -86,4 +86,9 @@ public class StorageCheckRespVO { @ExcelProperty("作废时间") private LocalDateTime cancelTime; + @Schema(description = "盘点单据时间") + @ExcelProperty("盘点单据时间") + private LocalDateTime checkTime; + + } \ 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/storagecheck/vo/StorageCheckSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagecheck/vo/StorageCheckSaveReqVO.java index 2ed796cc..8c67e0f9 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagecheck/vo/StorageCheckSaveReqVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagecheck/vo/StorageCheckSaveReqVO.java @@ -1,56 +1,58 @@ -package com.chanko.yunxi.mes.module.heli.controller.admin.storagecheck.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.util.*; -import javax.validation.constraints.*; -import java.util.*; -import org.springframework.format.annotation.DateTimeFormat; -import java.time.LocalDateTime; - -@Schema(description = "管理后台 - 入/出库盘点新增/修改 Request VO") -@Data -public class StorageCheckSaveReqVO { - - @Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED) - private Long id; - - @Schema(description = "盘点单号", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "盘点单号不能为空") - private String stockNo; - - @Schema(description = "盘点类型:1部分盘点2整体盘点") - private Integer checkType; - - @Schema(description = "排除库存为0的物料:1是2否") - private Integer noZero; - - @Schema(description = "备注") - private String description; - - @Schema(description = "状态:1已保存;2已提交;3已删除") - private Integer status; - - @Schema(description = "仓库Id,对应 wms_wh 表中的Id", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "仓库Id,对应 wms_wh 表中的Id不能为空") - private Long whId; - - @Schema(description = "入库人") - private Long keeper; - - @Schema(description = "入库时间") - private LocalDateTime keeperTime; - - @Schema(description = "出库人") - private Long outbound; - - @Schema(description = "出库时间") - private LocalDateTime outboundTime; - - @Schema(description = "作废人") - private Long cancel; - - @Schema(description = "作废时间") - private LocalDateTime cancelTime; - -} \ No newline at end of file +package com.chanko.yunxi.mes.module.heli.controller.admin.storagecheck.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import javax.validation.constraints.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 入/出库盘点新增/修改 Request VO") +@Data +public class StorageCheckSaveReqVO { + + @Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED) + private Long id; + + @Schema(description = "盘点单号", requiredMode = Schema.RequiredMode.REQUIRED) + private String stockNo; + + @Schema(description = "盘点类型:1部分盘点2整体盘点") + private Integer checkType; + + @Schema(description = "盘点开始时间") + private LocalDateTime checkTime; + + @Schema(description = "排除库存为0的物料:1是2否") + private Integer noZero; + + @Schema(description = "备注") + private String description; + + @Schema(description = "状态:1已保存;2已提交;3已删除") + private Integer status; + + @Schema(description = "仓库Id,对应 wms_wh 表中的Id", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "仓库Id,对应 wms_wh 表中的Id不能为空") + private Long whId; + + @Schema(description = "入库人") + private Long keeper; + + @Schema(description = "入库时间") + private LocalDateTime keeperTime; + + @Schema(description = "出库人") + private Long outbound; + + @Schema(description = "出库时间") + private LocalDateTime outboundTime; + + @Schema(description = "作废人") + private Long cancel; + + @Schema(description = "作废时间") + private LocalDateTime cancelTime; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storagecheck/StorageCheckDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storagecheck/StorageCheckDO.java index cc341263..f4da222f 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storagecheck/StorageCheckDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/storagecheck/StorageCheckDO.java @@ -85,4 +85,6 @@ public class StorageCheckDO extends BaseDO { */ private LocalDateTime cancelTime; + private LocalDateTime checkTime; + } \ 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/storagecheck/StorageCheckServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagecheck/StorageCheckServiceImpl.java index 5ab69dda..192e32ce 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagecheck/StorageCheckServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/storagecheck/StorageCheckServiceImpl.java @@ -1,74 +1,81 @@ -package com.chanko.yunxi.mes.module.heli.service.storagecheck; - -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.storagecheck.vo.*; -import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagecheck.StorageCheckDO; -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.storagecheck.StorageCheckMapper; - -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 StorageCheckServiceImpl implements StorageCheckService { - - @Resource - private StorageCheckMapper storageCheckMapper; - - @Override - public Long createStorageCheck(StorageCheckSaveReqVO createReqVO) { - // 插入 - StorageCheckDO storageCheck = BeanUtils.toBean(createReqVO, StorageCheckDO.class); - storageCheckMapper.insert(storageCheck); - // 返回 - return storageCheck.getId(); - } - - @Override - public void updateStorageCheck(StorageCheckSaveReqVO updateReqVO) { - // 校验存在 - validateStorageCheckExists(updateReqVO.getId()); - // 更新 - StorageCheckDO updateObj = BeanUtils.toBean(updateReqVO, StorageCheckDO.class); - storageCheckMapper.updateById(updateObj); - } - - @Override - public void deleteStorageCheck(Long id) { - // 校验存在 - validateStorageCheckExists(id); - // 删除 - storageCheckMapper.deleteById(id); - } - - private void validateStorageCheckExists(Long id) { - if (storageCheckMapper.selectById(id) == null) { - throw exception(STORAGE_CHECK_NOT_EXISTS); - } - } - - @Override - public StorageCheckDO getStorageCheck(Long id) { - return storageCheckMapper.selectById(id); - } - - @Override - public PageResult getStorageCheckPage(StorageCheckPageReqVO pageReqVO) { - return storageCheckMapper.selectPage(pageReqVO); - } - -} \ No newline at end of file +package com.chanko.yunxi.mes.module.heli.service.storagecheck; + +import cn.hutool.core.lang.UUID; +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.storagecheck.vo.*; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagecheck.StorageCheckDO; +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.storagecheck.StorageCheckMapper; + +import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.chanko.yunxi.mes.module.heli.enums.CodeEnum.STOCK_CHECK; +import static com.chanko.yunxi.mes.module.heli.enums.CodeEnum.STOCK_IN; +import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; + +/** + * 入/出库盘点 Service 实现类 + * + * @author 管理员 + */ +@Service +@Validated +public class StorageCheckServiceImpl implements StorageCheckService { + + @Resource + private StorageCheckMapper storageCheckMapper; + + @Override + public Long createStorageCheck(StorageCheckSaveReqVO createReqVO) { + // 插入 + StorageCheckDO storageCheck = BeanUtils.toBean(createReqVO, StorageCheckDO.class); + storageCheck.setStockNo(UUID.fastUUID().toString(true)); + storageCheckMapper.insert(storageCheck); + + storageCheck.setStockNo(STOCK_CHECK.getCode(storageCheck.getId().toString())); + storageCheckMapper.updateById(storageCheck); + // 返回 + return storageCheck.getId(); + } + + @Override + public void updateStorageCheck(StorageCheckSaveReqVO updateReqVO) { + // 校验存在 + validateStorageCheckExists(updateReqVO.getId()); + // 更新 + StorageCheckDO updateObj = BeanUtils.toBean(updateReqVO, StorageCheckDO.class); + storageCheckMapper.updateById(updateObj); + } + + @Override + public void deleteStorageCheck(Long id) { + // 校验存在 + validateStorageCheckExists(id); + // 删除 + storageCheckMapper.deleteById(id); + } + + private void validateStorageCheckExists(Long id) { + if (storageCheckMapper.selectById(id) == null) { + throw exception(STORAGE_CHECK_NOT_EXISTS); + } + } + + @Override + public StorageCheckDO getStorageCheck(Long id) { + return storageCheckMapper.selectById(id); + } + + @Override + public PageResult getStorageCheckPage(StorageCheckPageReqVO pageReqVO) { + return storageCheckMapper.selectPage(pageReqVO); + } + +} diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/storagecheck/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/storagecheck/index.ts index 6eec5658..1a596650 100644 --- a/mes-ui/mes-ui-admin-vue3/src/api/heli/storagecheck/index.ts +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/storagecheck/index.ts @@ -1,47 +1,48 @@ -import request from '@/config/axios' - -export interface StorageCheckVO { - id: number - stockNo: string - checkType: number - noZero: number - description: string - status: number - whId: number - keeper: number - keeperTime: Date - outbound: number - outboundTime: Date - cancel: number - cancelTime: Date -} - -// 查询入/出库盘点分页 -export const getStorageCheckPage = async (params) => { - return await request.get({ url: `/heli/storage-check/page`, params }) -} - -// 查询入/出库盘点详情 -export const getStorageCheck = async (id: number) => { - return await request.get({ url: `/heli/storage-check/get?id=` + id }) -} - -// 新增入/出库盘点 -export const createStorageCheck = async (data: StorageCheckVO) => { - return await request.post({ url: `/heli/storage-check/create`, data }) -} - -// 修改入/出库盘点 -export const updateStorageCheck = async (data: StorageCheckVO) => { - return await request.put({ url: `/heli/storage-check/update`, data }) -} - -// 删除入/出库盘点 -export const deleteStorageCheck = async (id: number) => { - return await request.delete({ url: `/heli/storage-check/delete?id=` + id }) -} - -// 导出入/出库盘点 Excel -export const exportStorageCheck = async (params) => { - return await request.download({ url: `/heli/storage-check/export-excel`, params }) -} \ No newline at end of file +import request from '@/config/axios' + +export interface StorageCheckVO { + id: number + stockNo: string + checkType: number + checkTime: Date + noZero: number + description: string + status: number + whId: number + keeper: number + keeperTime: Date + outbound: number + outboundTime: Date + cancel: number + cancelTime: Date +} + +// 查询入/出库盘点分页 +export const getStorageCheckPage = async (params) => { + return await request.get({ url: `/heli/storage-check/page`, params }) +} + +// 查询入/出库盘点详情 +export const getStorageCheck = async (id: number) => { + return await request.get({ url: `/heli/storage-check/get?id=` + id }) +} + +// 新增入/出库盘点 +export const createStorageCheck = async (data: StorageCheckVO) => { + return await request.post({ url: `/heli/storage-check/create`, data }) +} + +// 修改入/出库盘点 +export const updateStorageCheck = async (data: StorageCheckVO) => { + return await request.put({ url: `/heli/storage-check/update`, data }) +} + +// 删除入/出库盘点 +export const deleteStorageCheck = async (id: number) => { + return await request.delete({ url: `/heli/storage-check/delete?id=` + id }) +} + +// 导出入/出库盘点 Excel +export const exportStorageCheck = async (params) => { + return await request.download({ url: `/heli/storage-check/export-excel`, 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 6eb36029..3a981dc0 100644 --- a/mes-ui/mes-ui-admin-vue3/src/utils/dict.ts +++ b/mes-ui/mes-ui-admin-vue3/src/utils/dict.ts @@ -224,6 +224,8 @@ export enum DICT_TYPE { HELI_STORAGE_OUT_TYPE = 'heli_storage_out_type',//出库类型 HELI_STORAGE_STATUS = 'heli_storage_status',//入库出库状态 HELI_STORAGE_TYPE = 'heli_storage_type', // 入库类型 + HELI_STORAGE_MAT_CHECK_TYPE = 'heli_storage_mat_check_type',//盘点类型 + HELI_STORAGE_MAT_CHECK_STATUS = 'heli_storage_mat_check_status',//盘点状态 HELI_PROJECT_ORDER_STATUS = 'heli_project_order_status', //项目订单状态 HELI_DELIVERY_STATUS = 'heli_delivery_status', // 发货状态 diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheck/StorageCheckForm.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheck/StorageCheckForm.vue index 2518bfd1..300758e6 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheck/StorageCheckForm.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/storagecheck/StorageCheckForm.vue @@ -1,84 +1,42 @@