feat:新增LMS 生箔工序工单管理。
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
package cn.code.nl.module.base.api.materialbase;
|
||||
|
||||
import cn.code.nl.framework.common.pojo.CommonResult;
|
||||
import cn.code.nl.framework.common.util.object.BeanUtils;
|
||||
import cn.code.nl.module.base.api.materialbase.dto.MaterialBaseListReqDTO;
|
||||
import cn.code.nl.module.base.api.materialbase.dto.MaterialBaseRespDTO;
|
||||
import cn.code.nl.module.base.dal.dataobject.materialbase.MaterialBaseDO;
|
||||
import cn.code.nl.module.base.service.materialbase.MaterialBaseService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.code.nl.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* RPC 服务 - 物料基本信息 API 实现类
|
||||
* 单体模式:注册为本地 Bean,供其他模块直接注入调用
|
||||
* 微服务模式:提供 RESTful API 接口,给 Feign 调用
|
||||
*
|
||||
* @author 诺力管理员
|
||||
*/
|
||||
@RestController
|
||||
@Validated
|
||||
public class MaterialBaseApiImpl implements MaterialBaseApi {
|
||||
|
||||
@Resource
|
||||
private MaterialBaseService materialBaseService;
|
||||
|
||||
/**
|
||||
* 根据物料 ID 查询物料
|
||||
*/
|
||||
@Override
|
||||
public CommonResult<MaterialBaseRespDTO> getMaterialBase(Long id) {
|
||||
MaterialBaseDO materialBase = materialBaseService.getMaterialBase(id);
|
||||
return success(BeanUtils.toBean(materialBase, MaterialBaseRespDTO.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据条件查询物料列表
|
||||
*/
|
||||
@Override
|
||||
public CommonResult<List<MaterialBaseRespDTO>> getMaterialBaseList(MaterialBaseListReqDTO reqDTO) {
|
||||
List<MaterialBaseDO> list = materialBaseService.getMaterialBaseList(reqDTO);
|
||||
return success(BeanUtils.toBean(list, MaterialBaseRespDTO.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据物料编码查询物料
|
||||
*/
|
||||
@Override
|
||||
public CommonResult<MaterialBaseRespDTO> getMaterialBaseByCode(String materialCode) {
|
||||
MaterialBaseDO materialBase = materialBaseService.getMaterialBaseByCode(materialCode);
|
||||
return success(BeanUtils.toBean(materialBase, MaterialBaseRespDTO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,4 +11,10 @@ public interface ErrorCodeConstants {
|
||||
// ========== 生箔点位库存 ==========
|
||||
ErrorCode RAW_FOIL_POINT_IVT_NOT_EXISTS = new ErrorCode(1, "生箔点位库存不存在");
|
||||
|
||||
// ========== 生箔工序工单 ==========
|
||||
ErrorCode RAW_FOIL_WORK_ORDER_NOT_EXISTS = new ErrorCode(2, "生箔工序工单不存在");
|
||||
ErrorCode RAW_FOIL_WORK_ORDER_CONTAINER_NAME_EXISTS = new ErrorCode(3, "母卷号已存在");
|
||||
ErrorCode RAW_FOIL_WORK_ORDER_POINT_CODE_NOT_EXISTS = new ErrorCode(4, "点位设备不存在");
|
||||
ErrorCode RAW_FOIL_WORK_ORDER_MATERIAL_NOT_EXISTS = new ErrorCode(5, "物料不存在");
|
||||
ErrorCode RAW_FOIL_WORK_ORDER_ALREADY_ENDED = new ErrorCode(6, "不能对完成状态的工单强制结束");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package cn.code.nl.module.lms.enums;
|
||||
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2026/7/20
|
||||
*/
|
||||
@Getter
|
||||
public enum RawFoilWorkOrderStatusEnum {
|
||||
|
||||
START("01","开始"),
|
||||
EMPTY_OUT("02","空轴搬出"),
|
||||
CONFIRM_VOLUME("03","确认下卷"),
|
||||
VOLUME_COMPLETE("04","下卷完成"),
|
||||
END("09","结束");
|
||||
|
||||
|
||||
private String code;
|
||||
|
||||
private String name;
|
||||
|
||||
RawFoilWorkOrderStatusEnum(String code,String name){
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,11 @@
|
||||
<artifactId>nl-module-lms-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.nl.cloud</groupId>
|
||||
<artifactId>nl-module-base-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 业务组件 -->
|
||||
<dependency>
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
package cn.code.nl.module.lms.controller.admin.rawfoilworkorder;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.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 jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.code.nl.framework.common.pojo.PageParam;
|
||||
import cn.code.nl.framework.common.pojo.PageResult;
|
||||
import cn.code.nl.framework.common.pojo.CommonResult;
|
||||
import cn.code.nl.framework.common.util.object.BeanUtils;
|
||||
import static cn.code.nl.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.code.nl.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.code.nl.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.code.nl.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.code.nl.module.lms.controller.admin.rawfoilworkorder.vo.*;
|
||||
import cn.code.nl.module.lms.dal.dataobject.rawfoilworkorder.RawFoilWorkOrderDO;
|
||||
import cn.code.nl.module.lms.service.rawfoilworkorder.RawFoilWorkOrderService;
|
||||
|
||||
@Tag(name = "管理后台 - 生箔工序工单")
|
||||
@RestController
|
||||
@RequestMapping("/lms/raw-foil-work-order")
|
||||
@Validated
|
||||
public class RawFoilWorkOrderController {
|
||||
|
||||
@Resource
|
||||
private RawFoilWorkOrderService rawFoilWorkOrderService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建生箔工序工单")
|
||||
@PreAuthorize("@ss.hasPermission('lms:raw-foil-work-order:create')")
|
||||
public CommonResult<Long> createRawFoilWorkOrder(@Valid @RequestBody RawFoilWorkOrderSaveReqVO createReqVO) {
|
||||
return success(rawFoilWorkOrderService.createRawFoilWorkOrder(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新生箔工序工单")
|
||||
@PreAuthorize("@ss.hasPermission('lms:raw-foil-work-order:update')")
|
||||
public CommonResult<Boolean> updateRawFoilWorkOrder(@Valid @RequestBody RawFoilWorkOrderSaveReqVO updateReqVO) {
|
||||
rawFoilWorkOrderService.updateRawFoilWorkOrder(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/update-weight")
|
||||
@Operation(summary = "称重:更新生箔工序工单重量")
|
||||
@Parameter(name = "id", description = "工单标识", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('lms:raw-foil-work-order:update')")
|
||||
public CommonResult<Boolean> updateRawFoilWorkOrderWeight(@RequestParam("id") Long id,
|
||||
@RequestParam("productWeight") BigDecimal productWeight) {
|
||||
rawFoilWorkOrderService.updateRawFoilWorkOrderWeight(id, productWeight);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/force-end")
|
||||
@Operation(summary = "强制结束生箔工序工单")
|
||||
@Parameter(name = "id", description = "工单标识", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('lms:raw-foil-work-order:update')")
|
||||
public CommonResult<Boolean> forceEndRawFoilWorkOrder(@RequestParam("id") Long id) {
|
||||
rawFoilWorkOrderService.forceEndRawFoilWorkOrder(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/update-remark")
|
||||
@Operation(summary = "检验:更新生箔工序工单备注")
|
||||
@Parameter(name = "id", description = "工单标识", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('lms:raw-foil-work-order:update')")
|
||||
public CommonResult<Boolean> updateRawFoilWorkOrderRemark(@RequestParam("id") Long id,
|
||||
@RequestParam("remark") String remark) {
|
||||
rawFoilWorkOrderService.updateRawFoilWorkOrderRemark(id, remark);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除生箔工序工单")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('lms:raw-foil-work-order:delete')")
|
||||
public CommonResult<Boolean> deleteRawFoilWorkOrder(@RequestParam("id") Long id) {
|
||||
rawFoilWorkOrderService.deleteRawFoilWorkOrder(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除生箔工序工单")
|
||||
@PreAuthorize("@ss.hasPermission('lms:raw-foil-work-order:delete')")
|
||||
public CommonResult<Boolean> deleteRawFoilWorkOrderList(@RequestParam("ids") List<Long> ids) {
|
||||
rawFoilWorkOrderService.deleteRawFoilWorkOrderListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得生箔工序工单")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('lms:raw-foil-work-order:query')")
|
||||
public CommonResult<RawFoilWorkOrderRespVO> getRawFoilWorkOrder(@RequestParam("id") Long id) {
|
||||
RawFoilWorkOrderDO rawFoilWorkOrder = rawFoilWorkOrderService.getRawFoilWorkOrder(id);
|
||||
return success(BeanUtils.toBean(rawFoilWorkOrder, RawFoilWorkOrderRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得生箔工序工单分页")
|
||||
@PreAuthorize("@ss.hasPermission('lms:raw-foil-work-order:query')")
|
||||
public CommonResult<PageResult<RawFoilWorkOrderRespVO>> getRawFoilWorkOrderPage(@Valid RawFoilWorkOrderPageReqVO pageReqVO) {
|
||||
PageResult<RawFoilWorkOrderDO> pageResult = rawFoilWorkOrderService.getRawFoilWorkOrderPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, RawFoilWorkOrderRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出生箔工序工单 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('lms:raw-foil-work-order:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportRawFoilWorkOrderExcel(@Valid RawFoilWorkOrderPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<RawFoilWorkOrderDO> list = rawFoilWorkOrderService.getRawFoilWorkOrderPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "生箔工序工单.xls", "数据", RawFoilWorkOrderRespVO.class,
|
||||
BeanUtils.toBean(list, RawFoilWorkOrderRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package cn.code.nl.module.lms.controller.admin.rawfoilworkorder.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.code.nl.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.code.nl.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 生箔工序工单分页 Request VO")
|
||||
@Data
|
||||
public class RawFoilWorkOrderPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "母卷号", example = "王五")
|
||||
private String containerName;
|
||||
|
||||
@Schema(description = "时间范围(工单开始时间不早于起点,且结束时间不晚于终点)")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] timeRange;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "生产区域")
|
||||
private String productionArea;
|
||||
|
||||
@Schema(description = "点位编码")
|
||||
private String pointCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package cn.code.nl.module.lms.controller.admin.rawfoilworkorder.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 生箔工序工单 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class RawFoilWorkOrderRespVO {
|
||||
|
||||
@Schema(description = "工单标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "4374")
|
||||
@ExcelProperty("工单标识")
|
||||
private Long workorderId;
|
||||
|
||||
@Schema(description = "母卷号", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@ExcelProperty("母卷号")
|
||||
private String containerName;
|
||||
|
||||
@Schema(description = "生产工单", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("生产工单")
|
||||
private String productionOrder;
|
||||
|
||||
@Schema(description = "产品编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("产品编码")
|
||||
private String productCode;
|
||||
|
||||
@Schema(description = "产品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@ExcelProperty("产品名称")
|
||||
private String productName;
|
||||
|
||||
@Schema(description = "重量")
|
||||
@ExcelProperty("重量")
|
||||
private BigDecimal productWeight;
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
@ExcelProperty("开始时间")
|
||||
private LocalDateTime realstartTime;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
@ExcelProperty("结束时间")
|
||||
private LocalDateTime realendTime;
|
||||
|
||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "车号")
|
||||
@ExcelProperty("车号")
|
||||
private String agvno;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建人")
|
||||
@ExcelProperty("创建人")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改人")
|
||||
@ExcelProperty("修改人")
|
||||
private String updater;
|
||||
|
||||
@Schema(description = "修改时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@Schema(description = "是否删除", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否删除")
|
||||
private String deleted;
|
||||
|
||||
@Schema(description = "生产区域")
|
||||
@ExcelProperty("生产区域")
|
||||
private String productionArea;
|
||||
|
||||
@Schema(description = "点位编码")
|
||||
@ExcelProperty("点位编码")
|
||||
private String pointCode;
|
||||
|
||||
@Schema(description = "收卷辊重量")
|
||||
@ExcelProperty("收卷辊重量")
|
||||
private BigDecimal windRollWeight;
|
||||
|
||||
@Schema(description = "收卷辊编码")
|
||||
@ExcelProperty("收卷辊编码")
|
||||
private String windRollCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package cn.code.nl.module.lms.controller.admin.rawfoilworkorder.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 生箔工序工单新增/修改 Request VO")
|
||||
@Data
|
||||
public class RawFoilWorkOrderSaveReqVO {
|
||||
|
||||
@Schema(description = "工单标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "4374")
|
||||
private Long workorderId;
|
||||
|
||||
@Schema(description = "母卷号", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@NotEmpty(message = "母卷号不能为空")
|
||||
private String containerName;
|
||||
|
||||
@Schema(description = "生产工单", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "生产工单不能为空")
|
||||
private String productionOrder;
|
||||
|
||||
@Schema(description = "产品编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "产品编码不能为空")
|
||||
private String productCode;
|
||||
|
||||
@Schema(description = "产品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@NotEmpty(message = "产品名称不能为空")
|
||||
private String productName;
|
||||
|
||||
@Schema(description = "重量")
|
||||
private BigDecimal productWeight;
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
private LocalDateTime realstartTime;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
private LocalDateTime realendTime;
|
||||
|
||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "车号")
|
||||
private String agvno;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建人")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改人")
|
||||
private String updater;
|
||||
|
||||
@Schema(description = "修改时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@Schema(description = "是否删除", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String deleted;
|
||||
|
||||
@Schema(description = "生产区域")
|
||||
private String productionArea;
|
||||
|
||||
@Schema(description = "点位编码")
|
||||
private String pointCode;
|
||||
|
||||
@Schema(description = "收卷辊重量")
|
||||
private BigDecimal windRollWeight;
|
||||
|
||||
@Schema(description = "收卷辊编码")
|
||||
private String windRollCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package cn.code.nl.module.lms.dal.dataobject.rawfoilworkorder;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.code.nl.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 生箔工序工单 DO
|
||||
*
|
||||
* @author 诺力管理员
|
||||
*/
|
||||
@TableName("lms_rawfoil_workorder")
|
||||
@KeySequence("lms_rawfoil_workorder_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class RawFoilWorkOrderDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 工单标识
|
||||
*/
|
||||
@TableId
|
||||
private Long workorderId;
|
||||
/**
|
||||
* 母卷号
|
||||
*/
|
||||
private String containerName;
|
||||
/**
|
||||
* 生产工单
|
||||
*/
|
||||
private String productionOrder;
|
||||
/**
|
||||
* 产品编码
|
||||
*/
|
||||
private String productCode;
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 重量
|
||||
*/
|
||||
private BigDecimal productWeight;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private LocalDateTime realstartTime;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private LocalDateTime realendTime;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 车号
|
||||
*/
|
||||
private String agvno;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 生产区域
|
||||
*/
|
||||
private String productionArea;
|
||||
/**
|
||||
* 点位编码
|
||||
*/
|
||||
private String pointCode;
|
||||
/**
|
||||
* 收卷辊重量
|
||||
*/
|
||||
private BigDecimal windRollWeight;
|
||||
/**
|
||||
* 收卷辊编码
|
||||
*/
|
||||
private String windRollCode;
|
||||
|
||||
|
||||
}
|
||||
@@ -28,4 +28,13 @@ public interface RawFoilPointIVTMapper extends BaseMapperX<RawFoilPointIVTDO> {
|
||||
.orderByDesc(RawFoilPointIVTDO::getPointId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据点位编码查询
|
||||
* @param pointCode
|
||||
* @return RawFoilPointIVTDO
|
||||
*/
|
||||
default RawFoilPointIVTDO selectByPointCode(String pointCode){
|
||||
return selectOne(RawFoilPointIVTDO::getPointCode,pointCode);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package cn.code.nl.module.lms.dal.mysql.rawfoilworkorder;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.code.nl.framework.common.pojo.PageResult;
|
||||
import cn.code.nl.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.code.nl.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.code.nl.module.lms.dal.dataobject.rawfoilworkorder.RawFoilWorkOrderDO;
|
||||
import cn.code.nl.module.lms.enums.RawFoilWorkOrderStatusEnum;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.code.nl.module.lms.controller.admin.rawfoilworkorder.vo.*;
|
||||
|
||||
/**
|
||||
* 生箔工序工单 Mapper
|
||||
*
|
||||
* @author 诺力管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface RawFoilWorkOrderMapper extends BaseMapperX<RawFoilWorkOrderDO> {
|
||||
|
||||
default PageResult<RawFoilWorkOrderDO> selectPage(RawFoilWorkOrderPageReqVO reqVO) {
|
||||
// 时间范围:开始时间 >= 区间起点,结束时间 <= 区间终点(未结束工单结束时间为空,不会命中)
|
||||
LocalDateTime[] timeRange = reqVO.getTimeRange();
|
||||
boolean hasTimeRange = ArrayUtil.isNotEmpty(timeRange) && timeRange.length == 2;
|
||||
LambdaQueryWrapperX<RawFoilWorkOrderDO> wrapper = new LambdaQueryWrapperX<RawFoilWorkOrderDO>()
|
||||
.likeIfPresent(RawFoilWorkOrderDO::getContainerName, reqVO.getContainerName())
|
||||
.eqIfPresent(RawFoilWorkOrderDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(RawFoilWorkOrderDO::getProductionArea, reqVO.getProductionArea())
|
||||
.eqIfPresent(RawFoilWorkOrderDO::getPointCode, reqVO.getPointCode());
|
||||
wrapper.ge(hasTimeRange, RawFoilWorkOrderDO::getRealstartTime, hasTimeRange ? timeRange[0] : null);
|
||||
wrapper.le(hasTimeRange, RawFoilWorkOrderDO::getRealendTime, hasTimeRange ? timeRange[1] : null);
|
||||
wrapper.orderByDesc(RawFoilWorkOrderDO::getWorkorderId);
|
||||
return selectPage(reqVO, wrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否存在相同母卷号未结束的生箔工序工单
|
||||
* @param containerName
|
||||
* @return RawFoilWorkOrderDO
|
||||
*/
|
||||
default RawFoilWorkOrderDO selectByContainerNameAndNotEndStatus(String containerName){
|
||||
return selectOne(new LambdaQueryWrapperX<RawFoilWorkOrderDO>()
|
||||
.eq(RawFoilWorkOrderDO::getContainerName,containerName)
|
||||
.ne(RawFoilWorkOrderDO::getStatus, RawFoilWorkOrderStatusEnum.END.getCode())
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package cn.code.nl.module.lms.framwork.rpc.config;
|
||||
|
||||
import cn.code.nl.module.base.api.materialbase.MaterialBaseApi;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* LMS 服务 RPC 配置
|
||||
* 业务 API 的 Feign Client 在此处声明注册,后续新增的业务 Feign 接口需追加到 clients 列表
|
||||
*/
|
||||
@Configuration(value = "lmsRpcConfiguration", proxyBeanMethods = false)
|
||||
@EnableFeignClients(clients = MaterialBaseApi.class)
|
||||
public class RpcConfiguration {
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package cn.code.nl.module.lms.pda.controller.rawfoil.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2026/7/23
|
||||
*/
|
||||
@Schema(description = "手持 - 生箔工序工单新增 Request VO")
|
||||
public class RawFoilWorkOrderCreateReqVO {
|
||||
|
||||
@Schema(description = "母卷号", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@NotEmpty(message = "母卷号不能为空")
|
||||
private String containerName;
|
||||
|
||||
@Schema(description = "生产工单", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "生产工单不能为空")
|
||||
private String productionOrder;
|
||||
|
||||
@Schema(description = "产品编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "产品编码不能为空")
|
||||
private String productCode;
|
||||
|
||||
@Schema(description = "产品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@NotEmpty(message = "产品名称不能为空")
|
||||
private String productName;
|
||||
|
||||
@Schema(description = "重量")
|
||||
private BigDecimal productWeight;
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
private LocalDateTime realstartTime;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
private LocalDateTime realendTime;
|
||||
|
||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "车号")
|
||||
private String agvno;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建人")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改人")
|
||||
private String updater;
|
||||
|
||||
@Schema(description = "修改时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@Schema(description = "是否删除", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String deleted;
|
||||
|
||||
@Schema(description = "生产区域")
|
||||
private String productionArea;
|
||||
|
||||
@Schema(description = "点位编码")
|
||||
private String pointCode;
|
||||
|
||||
@Schema(description = "收卷辊重量")
|
||||
private BigDecimal windRollWeight;
|
||||
|
||||
@Schema(description = "收卷辊编码")
|
||||
private String windRollCode;
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package cn.code.nl.module.lms.service.rawfoilworkorder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import cn.code.nl.module.lms.controller.admin.rawfoilworkorder.vo.*;
|
||||
import cn.code.nl.module.lms.dal.dataobject.rawfoilworkorder.RawFoilWorkOrderDO;
|
||||
import cn.code.nl.framework.common.pojo.PageResult;
|
||||
import cn.code.nl.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 生箔工序工单 Service 接口
|
||||
*
|
||||
* @author 诺力管理员
|
||||
*/
|
||||
public interface RawFoilWorkOrderService {
|
||||
|
||||
/**
|
||||
* 创建生箔工序工单
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createRawFoilWorkOrder(@Valid RawFoilWorkOrderSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新生箔工序工单
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateRawFoilWorkOrder(@Valid RawFoilWorkOrderSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除生箔工序工单
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteRawFoilWorkOrder(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除生箔工序工单
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteRawFoilWorkOrderListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得生箔工序工单
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 生箔工序工单
|
||||
*/
|
||||
RawFoilWorkOrderDO getRawFoilWorkOrder(Long id);
|
||||
|
||||
/**
|
||||
* 获得生箔工序工单分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 生箔工序工单分页
|
||||
*/
|
||||
PageResult<RawFoilWorkOrderDO> getRawFoilWorkOrderPage(RawFoilWorkOrderPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 称重:更新生箔工序工单重量
|
||||
*
|
||||
* @param id 工单标识
|
||||
* @param productWeight 重量
|
||||
*/
|
||||
void updateRawFoilWorkOrderWeight(Long id, BigDecimal productWeight);
|
||||
|
||||
/**
|
||||
* 强制结束生箔工序工单
|
||||
*
|
||||
* @param id 工单标识
|
||||
*/
|
||||
void forceEndRawFoilWorkOrder(Long id);
|
||||
|
||||
/**
|
||||
* 检验:更新生箔工序工单备注
|
||||
*
|
||||
* @param id 工单标识
|
||||
* @param remark 备注
|
||||
*/
|
||||
void updateRawFoilWorkOrderRemark(Long id, String remark);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,200 @@
|
||||
package cn.code.nl.module.lms.service.rawfoilworkorder;
|
||||
|
||||
import cn.code.nl.framework.common.enums.CommonStatusEnum;
|
||||
import cn.code.nl.framework.common.pojo.CommonResult;
|
||||
import cn.code.nl.module.base.api.materialbase.MaterialBaseApi;
|
||||
import cn.code.nl.module.base.api.materialbase.dto.MaterialBaseRespDTO;
|
||||
import cn.code.nl.module.lms.dal.dataobject.rawfoilpointivt.RawFoilPointIVTDO;
|
||||
import cn.code.nl.module.lms.dal.mysql.rawfoilpointivt.RawFoilPointIVTMapper;
|
||||
import cn.code.nl.module.lms.enums.RawFoilWorkOrderStatusEnum;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import cn.code.nl.module.lms.controller.admin.rawfoilworkorder.vo.*;
|
||||
import cn.code.nl.module.lms.dal.dataobject.rawfoilworkorder.RawFoilWorkOrderDO;
|
||||
import cn.code.nl.framework.common.pojo.PageResult;
|
||||
import cn.code.nl.framework.common.pojo.PageParam;
|
||||
import cn.code.nl.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.code.nl.module.lms.dal.mysql.rawfoilworkorder.RawFoilWorkOrderMapper;
|
||||
|
||||
import static cn.code.nl.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.code.nl.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.code.nl.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static cn.code.nl.module.lms.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 生箔工序工单 Service 实现类
|
||||
*
|
||||
* @author 诺力管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class RawFoilWorkOrderServiceImpl implements RawFoilWorkOrderService {
|
||||
|
||||
@Resource
|
||||
private RawFoilWorkOrderMapper rawFoilWorkOrderMapper;
|
||||
|
||||
@Resource
|
||||
private RawFoilPointIVTMapper rawFoilPointIVTMapper;
|
||||
|
||||
@Resource
|
||||
private MaterialBaseApi materialBaseApi;
|
||||
|
||||
@Override
|
||||
public Long createRawFoilWorkOrder(RawFoilWorkOrderSaveReqVO createReqVO) {
|
||||
|
||||
RawFoilWorkOrderDO rawFoilWorkOrder = BeanUtils.toBean(createReqVO, RawFoilWorkOrderDO.class);
|
||||
|
||||
// 校验是否存在相同母卷号未结束的生箔工序工单
|
||||
validateRawFoilWorkOrderContainerNameNotEndExists(createReqVO.getContainerName());
|
||||
|
||||
//校验生箔机点位是否存在
|
||||
RawFoilPointIVTDO rawFoilPointIVTDO = validateRawFoilWorkOrderPointExists(createReqVO.getPointCode());
|
||||
|
||||
//判断物料是否存在
|
||||
validateRawFoilWorkOrderMaterialExists(createReqVO.getProductCode());
|
||||
|
||||
rawFoilWorkOrder.setWorkorderId(IdUtil.getSnowflakeNextId());
|
||||
rawFoilWorkOrder.setProductionArea(rawFoilPointIVTDO.getProductionArea());
|
||||
rawFoilWorkOrder.setStatus(RawFoilWorkOrderStatusEnum.START.getCode());
|
||||
|
||||
// 插入
|
||||
rawFoilWorkOrderMapper.insert(rawFoilWorkOrder);
|
||||
|
||||
// 返回
|
||||
return rawFoilWorkOrder.getWorkorderId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRawFoilWorkOrder(RawFoilWorkOrderSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateRawFoilWorkOrderExists(updateReqVO.getWorkorderId());
|
||||
|
||||
// 校验是否存在相同母卷号未结束的生箔工序工单
|
||||
validateRawFoilWorkOrderContainerNameNotEndExists(updateReqVO.getContainerName());
|
||||
|
||||
// 校验生箔机点位是否存在
|
||||
RawFoilPointIVTDO rawFoilPointIVTDO = validateRawFoilWorkOrderPointExists(updateReqVO.getPointCode());
|
||||
|
||||
// 校验物料是否存在
|
||||
validateRawFoilWorkOrderMaterialExists(updateReqVO.getProductCode());
|
||||
|
||||
// 更新
|
||||
RawFoilWorkOrderDO updateObj = BeanUtils.toBean(updateReqVO, RawFoilWorkOrderDO.class);
|
||||
|
||||
updateObj.setProductionArea(rawFoilPointIVTDO.getProductionArea());
|
||||
|
||||
rawFoilWorkOrderMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRawFoilWorkOrder(Long id) {
|
||||
// 校验存在
|
||||
validateRawFoilWorkOrderExists(id);
|
||||
// 删除
|
||||
rawFoilWorkOrderMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRawFoilWorkOrderListByIds(List<Long> ids) {
|
||||
// 删除
|
||||
rawFoilWorkOrderMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
|
||||
private void validateRawFoilWorkOrderExists(Long id) {
|
||||
if (rawFoilWorkOrderMapper.selectById(id) == null) {
|
||||
throw exception(RAW_FOIL_WORK_ORDER_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
// 校验生箔机点位是否存在
|
||||
private RawFoilPointIVTDO validateRawFoilWorkOrderPointExists(String pointCode){
|
||||
RawFoilPointIVTDO rawFoilPointIVTDO = rawFoilPointIVTMapper.selectByPointCode(pointCode);
|
||||
if (ObjectUtil.isEmpty(rawFoilPointIVTDO)){
|
||||
throw exception(RAW_FOIL_WORK_ORDER_POINT_CODE_NOT_EXISTS);
|
||||
}
|
||||
return rawFoilPointIVTDO;
|
||||
}
|
||||
|
||||
//校验物料是否存在
|
||||
private void validateRawFoilWorkOrderMaterialExists(String productCode){
|
||||
//远程调用物料API
|
||||
CommonResult<MaterialBaseRespDTO> result = materialBaseApi.getMaterialBaseByCode(productCode);
|
||||
// 判断是否访问成功 || 是否存在物料数据 || 物料是否已启用
|
||||
if (result.isError() || ObjectUtil.isEmpty(result.getData()) || String.valueOf(CommonStatusEnum.ENABLE.getStatus()).equals(result.getData().getIsUsed())){
|
||||
throw exception(RAW_FOIL_WORK_ORDER_MATERIAL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
// 校验是否存在相同母卷号未结束的生箔工序工单
|
||||
private void validateRawFoilWorkOrderContainerNameNotEndExists(String containerName){
|
||||
RawFoilWorkOrderDO rawFoilWorkOrderDO = rawFoilWorkOrderMapper.selectByContainerNameAndNotEndStatus(containerName);
|
||||
if (ObjectUtil.isNotEmpty(rawFoilWorkOrderDO)){
|
||||
throw exception(RAW_FOIL_WORK_ORDER_CONTAINER_NAME_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RawFoilWorkOrderDO getRawFoilWorkOrder(Long id) {
|
||||
return rawFoilWorkOrderMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<RawFoilWorkOrderDO> getRawFoilWorkOrderPage(RawFoilWorkOrderPageReqVO pageReqVO) {
|
||||
return rawFoilWorkOrderMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRawFoilWorkOrderWeight(Long id, BigDecimal productWeight) {
|
||||
// 校验存在
|
||||
validateRawFoilWorkOrderExists(id);
|
||||
// 更新重量
|
||||
RawFoilWorkOrderDO updateObj = new RawFoilWorkOrderDO();
|
||||
updateObj.setWorkorderId(id);
|
||||
updateObj.setProductWeight(productWeight);
|
||||
rawFoilWorkOrderMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forceEndRawFoilWorkOrder(Long id) {
|
||||
// 校验存在
|
||||
RawFoilWorkOrderDO workOrder = rawFoilWorkOrderMapper.selectById(id);
|
||||
if (workOrder == null) {
|
||||
throw exception(RAW_FOIL_WORK_ORDER_NOT_EXISTS);
|
||||
}
|
||||
// 校验状态:完成(结束)状态不允许强制结束
|
||||
if (RawFoilWorkOrderStatusEnum.END.getCode().equals(workOrder.getStatus())) {
|
||||
throw exception(RAW_FOIL_WORK_ORDER_ALREADY_ENDED);
|
||||
}
|
||||
|
||||
// TODO 校验该生箔工单存在未完成的任务,请先完成任务。
|
||||
|
||||
// 更新为结束状态,并记录结束时间
|
||||
RawFoilWorkOrderDO updateObj = new RawFoilWorkOrderDO();
|
||||
updateObj.setWorkorderId(id);
|
||||
updateObj.setStatus(RawFoilWorkOrderStatusEnum.END.getCode());
|
||||
updateObj.setRealendTime(LocalDateTime.now());
|
||||
rawFoilWorkOrderMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRawFoilWorkOrderRemark(Long id, String remark) {
|
||||
// 校验存在
|
||||
validateRawFoilWorkOrderExists(id);
|
||||
// 更新备注
|
||||
RawFoilWorkOrderDO updateObj = new RawFoilWorkOrderDO();
|
||||
updateObj.setWorkorderId(id);
|
||||
updateObj.setRemark(remark);
|
||||
rawFoilWorkOrderMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -31,6 +31,11 @@
|
||||
<artifactId>nl-module-infra-server</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.nl.cloud</groupId>
|
||||
<artifactId>nl-module-base-server</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.nl.cloud</groupId>
|
||||
<artifactId>nl-module-lms-server</artifactId>
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
import type { PageParam, PageResult } from '@vben/request';
|
||||
import type { Dayjs } from 'dayjs';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace LmsRawFoilWorkOrderApi {
|
||||
/** 生箔工序工单信息 */
|
||||
export interface RawFoilWorkOrder {
|
||||
workorderId: number; // 工单标识
|
||||
containerName?: string; // 母卷号
|
||||
productionOrder?: string; // 生产工单
|
||||
productCode?: string; // 产品编码
|
||||
productName?: string; // 产品名称
|
||||
productWeight: number; // 重量
|
||||
realstartTime: string | Dayjs; // 开始时间
|
||||
realendTime: string | Dayjs; // 结束时间
|
||||
status?: string; // 状态
|
||||
agvno: string; // 车号
|
||||
remark: string; // 备注
|
||||
creator: string; // 创建人
|
||||
createTime?: string | Dayjs; // 创建时间
|
||||
updater: string; // 修改人
|
||||
updateTime?: string | Dayjs; // 修改时间
|
||||
deleted?: string; // 是否删除
|
||||
productionArea: string; // 生产区域
|
||||
pointCode: string; // 点位编码
|
||||
windRollWeight: number; // 收卷辊重量
|
||||
windRollCode: string; // 收卷辊编码
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询生箔工序工单分页 */
|
||||
export function getRawFoilWorkOrderPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<LmsRawFoilWorkOrderApi.RawFoilWorkOrder>>(
|
||||
'/lms/raw-foil-work-order/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询生箔工序工单详情 */
|
||||
export function getRawFoilWorkOrder(id: number) {
|
||||
return requestClient.get<LmsRawFoilWorkOrderApi.RawFoilWorkOrder>(
|
||||
`/lms/raw-foil-work-order/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增生箔工序工单 */
|
||||
export function createRawFoilWorkOrder(data: LmsRawFoilWorkOrderApi.RawFoilWorkOrder) {
|
||||
return requestClient.post('/lms/raw-foil-work-order/create', data);
|
||||
}
|
||||
|
||||
/** 修改生箔工序工单 */
|
||||
export function updateRawFoilWorkOrder(data: LmsRawFoilWorkOrderApi.RawFoilWorkOrder) {
|
||||
return requestClient.put('/lms/raw-foil-work-order/update', data);
|
||||
}
|
||||
|
||||
/** 称重:修改生箔工序工单重量 */
|
||||
export function updateRawFoilWorkOrderWeight(id: number, productWeight: number) {
|
||||
return requestClient.put('/lms/raw-foil-work-order/update-weight', null, {
|
||||
params: { id, productWeight },
|
||||
});
|
||||
}
|
||||
|
||||
/** 强制结束生箔工序工单 */
|
||||
export function forceEndRawFoilWorkOrder(id: number) {
|
||||
return requestClient.put('/lms/raw-foil-work-order/force-end', null, {
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
|
||||
/** 检验:修改生箔工序工单备注 */
|
||||
export function updateRawFoilWorkOrderRemark(id: number, remark: string) {
|
||||
return requestClient.put('/lms/raw-foil-work-order/update-remark', null, {
|
||||
params: { id, remark },
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除生箔工序工单 */
|
||||
export function deleteRawFoilWorkOrder(id: number) {
|
||||
return requestClient.delete(`/lms/raw-foil-work-order/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除生箔工序工单 */
|
||||
export function deleteRawFoilWorkOrderList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/lms/raw-foil-work-order/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出生箔工序工单 */
|
||||
export function exportRawFoilWorkOrder(params: any) {
|
||||
return requestClient.download('/lms/raw-foil-work-order/export-excel', { params });
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,260 @@
|
||||
import type { VbenFormSchema } from '#/adapter/form';
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
|
||||
import { DICT_TYPE } from '@vben/constants';
|
||||
import { getDictOptions } from '@vben/hooks';
|
||||
|
||||
import { getRangePickerDefaultProps } from '#/utils';
|
||||
|
||||
/** 新增/修改的表单 */
|
||||
export function useFormSchema(): VbenFormSchema[] {
|
||||
return [
|
||||
{
|
||||
fieldName: 'workorderId',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
triggerFields: [''],
|
||||
show: () => false,
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'containerName',
|
||||
label: '母卷号',
|
||||
rules: 'required',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入母卷号',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'pointCode',
|
||||
label: '点位编码',
|
||||
rules: 'required',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入点位编码',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'productionOrder',
|
||||
label: '生产工单',
|
||||
rules: 'required',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入生产工单',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'productCode',
|
||||
label: '产品编码',
|
||||
rules: 'required',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入产品编码',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'productName',
|
||||
label: '产品名称',
|
||||
rules: 'required',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入产品名称',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'productWeight',
|
||||
label: '重量',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入重量',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'realstartTime',
|
||||
label: '开始时间',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'x',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'agvno',
|
||||
label: '车号',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入车号',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'windRollWeight',
|
||||
label: '收卷辊重量',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入收卷辊重量',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'windRollCode',
|
||||
label: '收卷辊编码',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入收卷辊编码',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'remark',
|
||||
label: '备注',
|
||||
component: 'TextArea',
|
||||
componentProps: {
|
||||
placeholder: '请输入备注',
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/** 列表的搜索表单 */
|
||||
export function useGridFormSchema(): VbenFormSchema[] {
|
||||
return [
|
||||
{
|
||||
fieldName: 'containerName',
|
||||
label: '母卷号',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入母卷号',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'timeRange',
|
||||
label: '时间范围',
|
||||
component: 'RangePicker',
|
||||
componentProps: {
|
||||
...getRangePickerDefaultProps(),
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'status',
|
||||
label: '状态',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
options: getDictOptions(DICT_TYPE.RAWFOIL_WORKORDER_STATUS),
|
||||
placeholder: '请选择状态',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'productionArea',
|
||||
label: '生产区域',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
options: getDictOptions(DICT_TYPE.PRODUCT_AREA),
|
||||
placeholder: '请选择生产区域',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'pointCode',
|
||||
label: '点位编码',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入点位编码',
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns(): VxeTableGridOptions['columns'] {
|
||||
return [
|
||||
{ type: 'checkbox', width: 40 },
|
||||
{
|
||||
field: 'productionOrder',
|
||||
title: '生产工单',
|
||||
minWidth: 200,
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '状态',
|
||||
minWidth: 120,
|
||||
cellRender: {
|
||||
name: 'CellDict',
|
||||
props: { type: DICT_TYPE.RAWFOIL_WORKORDER_STATUS },
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'containerName',
|
||||
title: '母卷号',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'pointCode',
|
||||
title: '点位编码',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'productCode',
|
||||
title: '产品编码',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'productWeight',
|
||||
title: '重量',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'realstartTime',
|
||||
title: '开始时间',
|
||||
minWidth: 160,
|
||||
formatter: 'formatDateTime',
|
||||
},
|
||||
{
|
||||
field: 'realendTime',
|
||||
title: '结束时间',
|
||||
minWidth: 160,
|
||||
formatter: 'formatDateTime',
|
||||
},
|
||||
{
|
||||
field: 'agvno',
|
||||
title: '车号',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'updateTime',
|
||||
title: '修改时间',
|
||||
minWidth: 160,
|
||||
formatter: 'formatDateTime',
|
||||
},
|
||||
{
|
||||
field: 'productionArea',
|
||||
title: '生产区域',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'windRollWeight',
|
||||
title: '收卷辊重量',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'windRollCode',
|
||||
title: '收卷辊编码',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
title: '备注',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: 200,
|
||||
fixed: 'right',
|
||||
slots: { default: 'actions' },
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,254 @@
|
||||
<script lang="ts" setup>
|
||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { LmsRawFoilWorkOrderApi } from '#/api/lms/rawfoilworkorder';
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { confirm, Page, useVbenModal } from '@vben/common-ui';
|
||||
import { downloadFileFromBlobPart } from '@vben/utils';
|
||||
|
||||
import { message } from 'antdv-next';
|
||||
|
||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import {
|
||||
deleteRawFoilWorkOrder,
|
||||
exportRawFoilWorkOrder,
|
||||
forceEndRawFoilWorkOrder,
|
||||
getRawFoilWorkOrderPage,
|
||||
} from '#/api/lms/rawfoilworkorder';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useGridColumns, useGridFormSchema } from './data';
|
||||
import Form from './modules/form.vue';
|
||||
import Remark from './modules/remark.vue';
|
||||
import Weight from './modules/weight.vue';
|
||||
|
||||
/** 开始状态码:仅开始状态的工单可修改/删除 */
|
||||
const STATUS_START = '01';
|
||||
/** 结束状态码:结束状态的工单不可强制结束 */
|
||||
const STATUS_END = '09';
|
||||
|
||||
const [FormModal, formModalApi] = useVbenModal({
|
||||
connectedComponent: Form,
|
||||
destroyOnClose: true,
|
||||
});
|
||||
|
||||
const [WeightModal, weightModalApi] = useVbenModal({
|
||||
connectedComponent: Weight,
|
||||
destroyOnClose: true,
|
||||
});
|
||||
|
||||
const [RemarkModal, remarkModalApi] = useVbenModal({
|
||||
connectedComponent: Remark,
|
||||
destroyOnClose: true,
|
||||
});
|
||||
|
||||
/** 刷新表格 */
|
||||
function handleRefresh() {
|
||||
gridApi.query();
|
||||
}
|
||||
|
||||
/** 创建生箔工序工单 */
|
||||
function handleCreate() {
|
||||
formModalApi.setData(null).open();
|
||||
}
|
||||
|
||||
/** 编辑生箔工序工单 */
|
||||
function handleEdit(row: LmsRawFoilWorkOrderApi.RawFoilWorkOrder) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 删除生箔工序工单 */
|
||||
async function handleDelete(row: LmsRawFoilWorkOrderApi.RawFoilWorkOrder) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.workorderId]),
|
||||
duration: 0,
|
||||
});
|
||||
try {
|
||||
await deleteRawFoilWorkOrder(row.workorderId!);
|
||||
message.success($t('ui.actionMessage.deleteSuccess', [row.workorderId]));
|
||||
handleRefresh();
|
||||
} finally {
|
||||
hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
/** 选中的表格行(称重/强制结束/检验需要整行数据判断状态) */
|
||||
const checkedRows = ref<LmsRawFoilWorkOrderApi.RawFoilWorkOrder[]>([]);
|
||||
function handleRowCheckboxChange({
|
||||
records,
|
||||
}: {
|
||||
records: LmsRawFoilWorkOrderApi.RawFoilWorkOrder[];
|
||||
}) {
|
||||
checkedRows.value = records;
|
||||
}
|
||||
|
||||
/** 清空表格勾选状态 */
|
||||
async function clearChecked() {
|
||||
checkedRows.value = [];
|
||||
await gridApi.grid?.clearCheckboxRow();
|
||||
}
|
||||
|
||||
/** 称重:弹框录入重量 */
|
||||
function handleWeight() {
|
||||
weightModalApi.setData(checkedRows.value[0]).open();
|
||||
}
|
||||
|
||||
/** 称重成功:清空选中并刷新 */
|
||||
async function handleWeightSuccess() {
|
||||
await clearChecked();
|
||||
handleRefresh();
|
||||
}
|
||||
|
||||
/** 强制结束工单 */
|
||||
async function handleForceEnd() {
|
||||
const row = checkedRows.value[0]!;
|
||||
// 结束状态不允许强制结束
|
||||
if (row.status === STATUS_END) {
|
||||
message.warning('不能对完成状态的工单强制结束');
|
||||
return;
|
||||
}
|
||||
await confirm(`确认强制结束工单「${row.productionOrder}」吗?`);
|
||||
const hideLoading = message.loading({
|
||||
content: '正在强制结束工单...',
|
||||
duration: 0,
|
||||
});
|
||||
try {
|
||||
await forceEndRawFoilWorkOrder(row.workorderId!);
|
||||
await clearChecked();
|
||||
message.success($t('ui.actionMessage.operationSuccess'));
|
||||
handleRefresh();
|
||||
} finally {
|
||||
hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
/** 检验:弹框修改备注 */
|
||||
function handleRemark() {
|
||||
remarkModalApi.setData(checkedRows.value[0]).open();
|
||||
}
|
||||
|
||||
/** 检验成功:清空选中并刷新 */
|
||||
async function handleRemarkSuccess() {
|
||||
await clearChecked();
|
||||
handleRefresh();
|
||||
}
|
||||
|
||||
/** 导出表格 */
|
||||
async function handleExport() {
|
||||
const data = await exportRawFoilWorkOrder(await gridApi.formApi.getValues());
|
||||
downloadFileFromBlobPart({ fileName: '生箔工序工单.xls', source: data });
|
||||
}
|
||||
|
||||
const [Grid, gridApi] = useVbenVxeGrid({
|
||||
formOptions: {
|
||||
schema: useGridFormSchema(),
|
||||
},
|
||||
gridOptions: {
|
||||
columns: useGridColumns(),
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues) => {
|
||||
return await getRawFoilWorkOrderPage({
|
||||
pageNo: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'workorderId',
|
||||
isHover: true,
|
||||
},
|
||||
toolbarConfig: {
|
||||
refresh: true,
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<LmsRawFoilWorkOrderApi.RawFoilWorkOrder>,
|
||||
gridEvents: {
|
||||
checkboxAll: handleRowCheckboxChange,
|
||||
checkboxChange: handleRowCheckboxChange,
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page auto-content-height>
|
||||
<FormModal @success="handleRefresh" />
|
||||
<WeightModal @success="handleWeightSuccess" />
|
||||
<RemarkModal @success="handleRemarkSuccess" />
|
||||
<Grid table-title="生箔工序工单列表">
|
||||
<template #toolbar-tools>
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: $t('ui.actionTitle.create', ['生箔工序工单']),
|
||||
type: 'primary',
|
||||
icon: ACTION_ICON.ADD,
|
||||
auth: ['lms:raw-foil-work-order:create'],
|
||||
onClick: handleCreate,
|
||||
},
|
||||
{
|
||||
label: $t('ui.actionTitle.export'),
|
||||
type: 'primary',
|
||||
icon: ACTION_ICON.DOWNLOAD,
|
||||
auth: ['lms:raw-foil-work-order:export'],
|
||||
onClick: handleExport,
|
||||
},
|
||||
{
|
||||
label: '称重',
|
||||
type: 'primary',
|
||||
auth: ['lms:raw-foil-work-order:update'],
|
||||
disabled: checkedRows.length !== 1,
|
||||
onClick: handleWeight,
|
||||
},
|
||||
{
|
||||
label: '检验',
|
||||
type: 'primary',
|
||||
auth: ['lms:raw-foil-work-order:update'],
|
||||
disabled: checkedRows.length !== 1,
|
||||
onClick: handleRemark,
|
||||
},
|
||||
{
|
||||
label: '强制结束',
|
||||
type: 'primary',
|
||||
danger: true,
|
||||
auth: ['lms:raw-foil-work-order:update'],
|
||||
disabled: checkedRows.length !== 1,
|
||||
onClick: handleForceEnd,
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
<template #actions="{ row }">
|
||||
<TableAction
|
||||
:actions="[
|
||||
{
|
||||
label: $t('common.edit'),
|
||||
type: 'link',
|
||||
icon: ACTION_ICON.EDIT,
|
||||
auth: ['lms:raw-foil-work-order:update'],
|
||||
disabled: row.status !== STATUS_START,
|
||||
onClick: handleEdit.bind(null, row),
|
||||
},
|
||||
{
|
||||
label: $t('common.delete'),
|
||||
type: 'link',
|
||||
danger: true,
|
||||
icon: ACTION_ICON.DELETE,
|
||||
auth: ['lms:raw-foil-work-order:delete'],
|
||||
disabled: row.status !== STATUS_START,
|
||||
popConfirm: {
|
||||
title: $t('ui.actionMessage.deleteConfirm', [row.workorderId]),
|
||||
confirm: handleDelete.bind(null, row),
|
||||
},
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</template>
|
||||
</Grid>
|
||||
</Page>
|
||||
</template>
|
||||
@@ -0,0 +1,82 @@
|
||||
<script lang="ts" setup>
|
||||
import type { LmsRawFoilWorkOrderApi } from '#/api/lms/rawfoilworkorder';
|
||||
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { message } from 'antdv-next';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { createRawFoilWorkOrder, getRawFoilWorkOrder, updateRawFoilWorkOrder } from '#/api/lms/rawfoilworkorder';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<LmsRawFoilWorkOrderApi.RawFoilWorkOrder>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.workorderId
|
||||
? $t('ui.actionTitle.edit', ['生箔工序工单'])
|
||||
: $t('ui.actionTitle.create', ['生箔工序工单']);
|
||||
});
|
||||
|
||||
const [Form, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
},
|
||||
formItemClass: 'col-span-2',
|
||||
labelWidth: 80,
|
||||
},
|
||||
layout: 'horizontal',
|
||||
schema: useFormSchema(),
|
||||
showDefaultActions: false,
|
||||
});
|
||||
|
||||
const [Modal, modalApi] = useVbenModal({
|
||||
async onConfirm() {
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data = (await formApi.getValues()) as LmsRawFoilWorkOrderApi.RawFoilWorkOrder;
|
||||
try {
|
||||
await (formData.value?.workorderId ? updateRawFoilWorkOrder(data) : createRawFoilWorkOrder(data));
|
||||
// 关闭并提示
|
||||
await modalApi.close();
|
||||
emit('success');
|
||||
message.success($t('ui.actionMessage.operationSuccess'));
|
||||
} finally {
|
||||
modalApi.unlock();
|
||||
}
|
||||
},
|
||||
async onOpenChange(isOpen: boolean) {
|
||||
if (!isOpen) {
|
||||
formData.value = undefined;
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<LmsRawFoilWorkOrderApi.RawFoilWorkOrder>();
|
||||
if (!data || !data.workorderId) {
|
||||
return;
|
||||
}
|
||||
modalApi.lock();
|
||||
try {
|
||||
formData.value = await getRawFoilWorkOrder(data.workorderId);
|
||||
// 设置到 values
|
||||
await formApi.setValues(formData.value);
|
||||
} finally {
|
||||
modalApi.unlock();
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Modal :title="getTitle">
|
||||
<Form class="mx-4" />
|
||||
</Modal>
|
||||
</template>
|
||||
@@ -289,6 +289,11 @@ const TASK_DICT = {
|
||||
TASK_ACS_TASK_TYPE: 'task_acs_task_type', // 任务状态
|
||||
} as const;
|
||||
|
||||
/** ========== RawFoil - 生箔管理模块 ========== */
|
||||
const RawFoil_DICT = {
|
||||
RAWFOIL_WORKORDER_STATUS: 'rawfoil_workorder_status', // 生箔工序工单状态
|
||||
} as const;
|
||||
|
||||
/** 字典类型枚举 - 统一导出 */
|
||||
const DICT_TYPE = {
|
||||
...AI_DICT,
|
||||
@@ -307,6 +312,7 @@ const DICT_TYPE = {
|
||||
...SYSTEM_DICT,
|
||||
...COMMON_DICT,
|
||||
...TASK_DICT,
|
||||
...RawFoil_DICT,
|
||||
} as const;
|
||||
|
||||
export { DICT_TYPE };
|
||||
|
||||
Reference in New Issue
Block a user