mirror of
https://gitee.com/zhijiantianya/ruoyi-vue-pro.git
synced 2026-03-22 05:07:17 +08:00
♻️ refactor(mes): 移除流转卡相关的状态和时间字段,简化请求和响应对象
This commit is contained in:
@@ -5,11 +5,6 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - MES 生产流转卡分页 Request VO")
|
||||
@Data
|
||||
@@ -29,11 +24,5 @@ public class MesProCardPageReqVO extends PageParam {
|
||||
@Schema(description = "批次号", example = "BATCH-001")
|
||||
private String batchCode;
|
||||
|
||||
@Schema(description = "状态", example = "0")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.pro.card.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
import cn.iocoder.yudao.module.mes.enums.DictTypeConstants;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -61,18 +58,10 @@ public class MesProCardRespVO {
|
||||
@ExcelProperty("单位")
|
||||
private String unitMeasureName;
|
||||
|
||||
@Schema(description = "条码地址", example = "https://xxx")
|
||||
private String barcodeUrl;
|
||||
|
||||
@Schema(description = "流转数量", example = "100.00")
|
||||
@ExcelProperty("流转数量")
|
||||
private BigDecimal transferedQuantity;
|
||||
|
||||
@Schema(description = "状态", example = "0")
|
||||
@ExcelProperty(value = "状态", converter = DictConvert.class)
|
||||
@DictFormat(DictTypeConstants.MES_PRO_WORK_ORDER_STATUS)
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@@ -33,10 +33,7 @@ public class MesProCardSaveReqVO {
|
||||
@NotNull(message = "流转数量不能为空")
|
||||
private BigDecimal transferedQuantity;
|
||||
|
||||
@Schema(description = "状态", example = "0")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,10 +40,6 @@ public class MesProCardDO extends BaseDO {
|
||||
* 关联 {@link MesProWorkOrderDO#getId()}
|
||||
*/
|
||||
private Long workOrderId;
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String batchCode;
|
||||
/**
|
||||
* 产品物料编号
|
||||
*
|
||||
@@ -51,15 +47,14 @@ public class MesProCardDO extends BaseDO {
|
||||
*/
|
||||
private Long itemId;
|
||||
/**
|
||||
* 条码地址
|
||||
*
|
||||
* TODO @芋艿:条码生成功能,需等条码模块(wm_barcode)迁移后再对接
|
||||
* 批次号
|
||||
*/
|
||||
private String barcodeUrl;
|
||||
private String batchCode;
|
||||
/**
|
||||
* 流转数量
|
||||
*/
|
||||
private BigDecimal transferedQuantity;
|
||||
// TODO @芋艿:预留字段,暂未使用;
|
||||
/**
|
||||
* 状态
|
||||
*
|
||||
|
||||
@@ -21,8 +21,6 @@ public interface MesProCardMapper extends BaseMapperX<MesProCardDO> {
|
||||
.eqIfPresent(MesProCardDO::getWorkOrderId, reqVO.getWorkOrderId())
|
||||
.eqIfPresent(MesProCardDO::getItemId, reqVO.getItemId())
|
||||
.likeIfPresent(MesProCardDO::getBatchCode, reqVO.getBatchCode())
|
||||
.eqIfPresent(MesProCardDO::getStatus, reqVO.getStatus())
|
||||
.betweenIfPresent(MesProCardDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(MesProCardDO::getId));
|
||||
}
|
||||
|
||||
|
||||
@@ -51,4 +51,11 @@ public interface MesProCardProcessService {
|
||||
*/
|
||||
PageResult<MesProCardProcessDO> getCardProcessPage(MesProCardProcessPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 根据流转卡编号,删除工序记录
|
||||
*
|
||||
* @param cardId 流转卡编号
|
||||
*/
|
||||
void deleteCardProcessByCardId(Long cardId);
|
||||
|
||||
}
|
||||
|
||||
@@ -80,4 +80,9 @@ public class MesProCardProcessServiceImpl implements MesProCardProcessService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteCardProcessByCardId(Long cardId) {
|
||||
cardProcessMapper.deleteByCardId(cardId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,17 +7,18 @@ import cn.iocoder.yudao.module.mes.controller.admin.pro.card.vo.MesProCardPageRe
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.pro.card.vo.MesProCardSaveReqVO;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.pro.card.MesProCardDO;
|
||||
import cn.iocoder.yudao.module.mes.dal.mysql.pro.card.MesProCardMapper;
|
||||
import cn.iocoder.yudao.module.mes.dal.mysql.pro.card.MesProCardProcessMapper;
|
||||
import cn.iocoder.yudao.module.mes.enums.wm.BarcodeBizTypeEnum;
|
||||
import cn.iocoder.yudao.module.mes.service.pro.workorder.MesProWorkOrderService;
|
||||
import cn.iocoder.yudao.module.mes.service.wm.barcode.MesWmBarcodeService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.*;
|
||||
import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.PRO_CARD_CODE_DUPLICATE;
|
||||
import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.PRO_CARD_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* MES 生产流转卡 Service 实现类
|
||||
@@ -31,12 +32,13 @@ public class MesProCardServiceImpl implements MesProCardService {
|
||||
@Resource
|
||||
private MesProCardMapper cardMapper;
|
||||
|
||||
// DONE @AI:会用对应的 service
|
||||
@Resource
|
||||
private MesProCardProcessMapper cardProcessMapper;
|
||||
@Lazy
|
||||
private MesProCardProcessService cardProcessService;
|
||||
|
||||
@Resource
|
||||
private MesProWorkOrderService workOrderService;
|
||||
|
||||
@Resource
|
||||
private MesWmBarcodeService barcodeService;
|
||||
|
||||
@@ -77,7 +79,7 @@ public class MesProCardServiceImpl implements MesProCardService {
|
||||
|
||||
// 2. 删除流转卡 + 级联删除工序记录
|
||||
cardMapper.deleteById(id);
|
||||
cardProcessMapper.deleteByCardId(id);
|
||||
cardProcessService.deleteCardProcessByCardId(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user