生产管理(未完成2)
This commit is contained in:
@@ -1,11 +1,14 @@
|
|||||||
package top.mes.admin.bom.service;
|
package top.mes.admin.bom.service;
|
||||||
|
|
||||||
|
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
|
||||||
import top.continew.starter.extension.crud.service.BaseService;
|
import top.continew.starter.extension.crud.service.BaseService;
|
||||||
import top.mes.admin.bom.model.query.BomQuery;
|
import top.mes.admin.bom.model.query.BomQuery;
|
||||||
import top.mes.admin.bom.model.req.BomReq;
|
import top.mes.admin.bom.model.req.BomReq;
|
||||||
import top.mes.admin.bom.model.resp.BomDetailResp;
|
import top.mes.admin.bom.model.resp.BomDetailResp;
|
||||||
import top.mes.admin.bom.model.resp.BomResp;
|
import top.mes.admin.bom.model.resp.BomResp;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BOM物料清单(单)业务接口
|
* BOM物料清单(单)业务接口
|
||||||
*
|
*
|
||||||
@@ -14,4 +17,5 @@ import top.mes.admin.bom.model.resp.BomResp;
|
|||||||
*/
|
*/
|
||||||
public interface BomService extends BaseService<BomResp, BomResp, BomQuery, BomReq> {
|
public interface BomService extends BaseService<BomResp, BomResp, BomQuery, BomReq> {
|
||||||
|
|
||||||
|
List<LabelValueResp> getBomSelect(BomQuery query);
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
package top.mes.admin.bom.service.impl;
|
package top.mes.admin.bom.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
|
||||||
import top.continew.starter.extension.crud.service.BaseServiceImpl;
|
import top.continew.starter.extension.crud.service.BaseServiceImpl;
|
||||||
import top.mes.admin.bom.mapper.BomMapper;
|
import top.mes.admin.bom.mapper.BomMapper;
|
||||||
import top.mes.admin.bom.model.entity.BomDO;
|
import top.mes.admin.bom.model.entity.BomDO;
|
||||||
@@ -13,6 +15,9 @@ import top.mes.admin.bom.model.resp.BomDetailResp;
|
|||||||
import top.mes.admin.bom.model.resp.BomResp;
|
import top.mes.admin.bom.model.resp.BomResp;
|
||||||
import top.mes.admin.bom.service.BomService;
|
import top.mes.admin.bom.service.BomService;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BOM物料清单(单)业务实现
|
* BOM物料清单(单)业务实现
|
||||||
*
|
*
|
||||||
@@ -23,4 +28,14 @@ import top.mes.admin.bom.service.BomService;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class BomServiceImpl extends BaseServiceImpl<BomMapper, BomDO, BomResp, BomResp, BomQuery, BomReq> implements BomService {
|
public class BomServiceImpl extends BaseServiceImpl<BomMapper, BomDO, BomResp, BomResp, BomQuery, BomReq> implements BomService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LabelValueResp> getBomSelect(BomQuery query) {
|
||||||
|
QueryWrapper<BomDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
List<BomDO> bomDOS = baseMapper.selectList(queryWrapper);
|
||||||
|
List<LabelValueResp> labelValueResps = new ArrayList<>();
|
||||||
|
for (BomDO bomDO : bomDOS) {
|
||||||
|
labelValueResps.add(new LabelValueResp(bomDO.getBomName(), bomDO.getId()));
|
||||||
|
}
|
||||||
|
return labelValueResps;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package top.mes.admin.process.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
import top.continew.starter.data.mp.base.BaseMapper;
|
||||||
|
import top.mes.admin.process.model.entity.ProcessBomDO;
|
||||||
|
import top.mes.admin.process.model.resp.ProcessBomResp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序基础信息 Mapper
|
||||||
|
*
|
||||||
|
* @author zc
|
||||||
|
* @since 2026/06/18 15:48
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface ProcessBomMapper extends BaseMapper<ProcessBomDO> {
|
||||||
|
|
||||||
|
IPage<ProcessBomResp> selectProcessBomPage(@Param("page") Page<Object> objectPage, @Param(Constants.WRAPPER) QueryWrapper<ProcessBomDO> queryWrapper);
|
||||||
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package top.mes.admin.process.mapper;
|
package top.mes.admin.process.mapper;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
import top.continew.starter.data.mp.base.BaseMapper;
|
import top.continew.starter.data.mp.base.BaseMapper;
|
||||||
import top.mes.admin.process.model.entity.ProcessDO;
|
import top.mes.admin.process.model.entity.ProcessDO;
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工序基础信息 Mapper
|
* 工序基础信息 Mapper
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package top.mes.admin.process.model.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序基础信息实体
|
||||||
|
*
|
||||||
|
* @author zc
|
||||||
|
* @since 2026/06/18 15:48
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("sys_process_bom")
|
||||||
|
public class ProcessBomDO implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料ID
|
||||||
|
*/
|
||||||
|
private Long bomId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序ID
|
||||||
|
*/
|
||||||
|
private Long processId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
private Integer quantity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package top.mes.admin.process.model.query;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import top.continew.starter.data.core.annotation.Query;
|
||||||
|
import top.continew.starter.data.core.enums.QueryType;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序基础信息查询条件
|
||||||
|
*
|
||||||
|
* @author zc
|
||||||
|
* @since 2026/06/18 15:48
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "工序基础信息查询条件")
|
||||||
|
public class ProcessBomQuery implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序ID
|
||||||
|
*/
|
||||||
|
@Query(type = QueryType.EQ)
|
||||||
|
private Long processId;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package top.mes.admin.process.model.req;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建或修改工序基础信息参数
|
||||||
|
*
|
||||||
|
* @author zc
|
||||||
|
* @since 2026/06/18 15:48
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "创建或修改工序基础信息参数")
|
||||||
|
public class ProcessBomDetailReq implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料ID
|
||||||
|
*/
|
||||||
|
private List<Long> bomIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
private Integer quantity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package top.mes.admin.process.model.req;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建或修改工序基础信息参数
|
||||||
|
*
|
||||||
|
* @author zc
|
||||||
|
* @since 2026/06/18 15:48
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "创建或修改工序基础信息参数")
|
||||||
|
public class ProcessBomReq implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料信息列表
|
||||||
|
*/
|
||||||
|
private List<ProcessBomDetailReq> processBomDetailList;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序ID
|
||||||
|
*/
|
||||||
|
private Long processId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package top.mes.admin.process.model.resp;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
|
||||||
|
import top.mes.admin.common.model.resp.BaseDetailResp;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序基础信息详情信息
|
||||||
|
*
|
||||||
|
* @author zc
|
||||||
|
* @since 2026/06/18 15:48
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@Schema(description = "工序基础信息详情信息")
|
||||||
|
public class ProcessBomResp implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料ID
|
||||||
|
*/
|
||||||
|
private List<Long> bomIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
private Integer quantity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
}
|
||||||
@@ -1,218 +0,0 @@
|
|||||||
package top.mes.admin.process.model.resp;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
|
||||||
|
|
||||||
import top.mes.admin.common.model.resp.BaseDetailResp;
|
|
||||||
|
|
||||||
import java.io.Serial;
|
|
||||||
import java.time.*;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工序基础信息详情信息
|
|
||||||
*
|
|
||||||
* @author zc
|
|
||||||
* @since 2026/06/18 15:48
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@ExcelIgnoreUnannotated
|
|
||||||
@Schema(description = "工序基础信息详情信息")
|
|
||||||
public class ProcessDetailResp extends BaseDetailResp {
|
|
||||||
|
|
||||||
@Serial
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工序编号(唯一)
|
|
||||||
*/
|
|
||||||
@Schema(description = "工序编号(唯一)")
|
|
||||||
@ExcelProperty(value = "工序编号(唯一)")
|
|
||||||
private String processCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工序名称
|
|
||||||
*/
|
|
||||||
@Schema(description = "工序名称")
|
|
||||||
@ExcelProperty(value = "工序名称")
|
|
||||||
private String processName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工序类型:1-生产工序 2-检测工序 3-返工工序 4-包装工序 5-仓储工序 6-物流工序
|
|
||||||
*/
|
|
||||||
@Schema(description = "工序类型:1-生产工序 2-检测工序 3-返工工序 4-包装工序 5-仓储工序 6-物流工序")
|
|
||||||
@ExcelProperty(value = "工序类型:1-生产工序 2-检测工序 3-返工工序 4-包装工序 5-仓储工序 6-物流工序")
|
|
||||||
private Integer processType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工序分类(如:SMT、组装、测试)
|
|
||||||
*/
|
|
||||||
@Schema(description = "工序分类(如:SMT、组装、测试)")
|
|
||||||
@ExcelProperty(value = "工序分类(如:SMT、组装、测试)")
|
|
||||||
private String processCategory;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否关键工序:0-否 1-是
|
|
||||||
*/
|
|
||||||
@Schema(description = "是否关键工序:0-否 1-是")
|
|
||||||
@ExcelProperty(value = "是否关键工序:0-否 1-是")
|
|
||||||
private Integer isKeyProcess;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否特殊工序:0-否 1-是
|
|
||||||
*/
|
|
||||||
@Schema(description = "是否特殊工序:0-否 1-是")
|
|
||||||
@ExcelProperty(value = "是否特殊工序:0-否 1-是")
|
|
||||||
private Integer isSpecialProcess;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否质量门禁:0-否 1-是(必须检验合格才能流转)
|
|
||||||
*/
|
|
||||||
@Schema(description = "是否质量门禁:0-否 1-是(必须检验合格才能流转)")
|
|
||||||
@ExcelProperty(value = "是否质量门禁:0-否 1-是(必须检验合格才能流转)")
|
|
||||||
private Integer isQualityGate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 标准工时(分钟/件)
|
|
||||||
*/
|
|
||||||
@Schema(description = "标准工时(分钟/件)")
|
|
||||||
@ExcelProperty(value = "标准工时(分钟/件)")
|
|
||||||
private Integer standardDurationMinutes;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 换型/准备时间(分钟)
|
|
||||||
*/
|
|
||||||
@Schema(description = "换型/准备时间(分钟)")
|
|
||||||
@ExcelProperty(value = "换型/准备时间(分钟)")
|
|
||||||
private Integer setupDurationMinutes;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 等待时间(分钟)
|
|
||||||
*/
|
|
||||||
@Schema(description = "等待时间(分钟)")
|
|
||||||
@ExcelProperty(value = "等待时间(分钟)")
|
|
||||||
private Integer waitingDurationMinutes;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 搬运时间(分钟)
|
|
||||||
*/
|
|
||||||
@Schema(description = "搬运时间(分钟)")
|
|
||||||
@ExcelProperty(value = "搬运时间(分钟)")
|
|
||||||
private Integer moveDurationMinutes;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 默认工作中心/设备组
|
|
||||||
*/
|
|
||||||
@Schema(description = "默认工作中心/设备组")
|
|
||||||
@ExcelProperty(value = "默认工作中心/设备组")
|
|
||||||
private String defaultWorkCenter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所需技能等级:1-初级 2-中级 3-高级 4-专家
|
|
||||||
*/
|
|
||||||
@Schema(description = "所需技能等级:1-初级 2-中级 3-高级 4-专家")
|
|
||||||
@ExcelProperty(value = "所需技能等级:1-初级 2-中级 3-高级 4-专家")
|
|
||||||
private Integer requiredSkillLevel;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 最少操作人数
|
|
||||||
*/
|
|
||||||
@Schema(description = "最少操作人数")
|
|
||||||
@ExcelProperty(value = "最少操作人数")
|
|
||||||
private Integer minOperatorCount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工序参数模板
|
|
||||||
*/
|
|
||||||
@Schema(description = "工序参数模板")
|
|
||||||
@ExcelProperty(value = "工序参数模板")
|
|
||||||
private String parameterTemplate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否需要质量检验:0-否 1-是
|
|
||||||
*/
|
|
||||||
@Schema(description = "是否需要质量检验:0-否 1-是")
|
|
||||||
@ExcelProperty(value = "是否需要质量检验:0-否 1-是")
|
|
||||||
private Integer qualityCheckRequired;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 默认抽检比例(%)
|
|
||||||
*/
|
|
||||||
@Schema(description = "默认抽检比例(%)")
|
|
||||||
@ExcelProperty(value = "默认抽检比例(%)")
|
|
||||||
private BigDecimal defaultCheckRate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 允许不良率(%)
|
|
||||||
*/
|
|
||||||
@Schema(description = "允许不良率(%)")
|
|
||||||
@ExcelProperty(value = "允许不良率(%)")
|
|
||||||
private BigDecimal allowableDefectRate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否需要领料:0-否 1-是
|
|
||||||
*/
|
|
||||||
@Schema(description = "是否需要领料:0-否 1-是")
|
|
||||||
@ExcelProperty(value = "是否需要领料:0-否 1-是")
|
|
||||||
private Integer needMaterial;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发料方式:1-按单发料 2-按工序发料 3-按线边仓发料
|
|
||||||
*/
|
|
||||||
@Schema(description = "发料方式:1-按单发料 2-按工序发料 3-按线边仓发料")
|
|
||||||
@ExcelProperty(value = "发料方式:1-按单发料 2-按工序发料 3-按线边仓发料")
|
|
||||||
private Integer materialIssueMethod;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:1-启用 0-停用 2-草稿 3-已废弃
|
|
||||||
*/
|
|
||||||
@Schema(description = "状态:1-启用 0-停用 2-草稿 3-已废弃")
|
|
||||||
@ExcelProperty(value = "状态:1-启用 0-停用 2-草稿 3-已废弃")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 版本号(修改自动+1)
|
|
||||||
*/
|
|
||||||
@Schema(description = "版本号(修改自动+1)")
|
|
||||||
@ExcelProperty(value = "版本号(修改自动+1)")
|
|
||||||
private Integer version;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 排序号
|
|
||||||
*/
|
|
||||||
@Schema(description = "排序号")
|
|
||||||
@ExcelProperty(value = "排序号")
|
|
||||||
private Integer sortOrder;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SOP文件URL
|
|
||||||
*/
|
|
||||||
@Schema(description = "SOP文件URL")
|
|
||||||
@ExcelProperty(value = "SOP文件URL")
|
|
||||||
private String sopUrl;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 操作视频URL
|
|
||||||
*/
|
|
||||||
@Schema(description = "操作视频URL")
|
|
||||||
@ExcelProperty(value = "操作视频URL")
|
|
||||||
private String videoUrl;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
@Schema(description = "备注")
|
|
||||||
@ExcelProperty(value = "备注")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 附件ID列表(逗号分隔)
|
|
||||||
*/
|
|
||||||
@Schema(description = "附件ID列表(逗号分隔)")
|
|
||||||
@ExcelProperty(value = "附件ID列表(逗号分隔)")
|
|
||||||
private String attachmentIds;
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,13 @@
|
|||||||
package top.mes.admin.process.service;
|
package top.mes.admin.process.service;
|
||||||
|
|
||||||
|
import top.continew.starter.extension.crud.model.query.PageQuery;
|
||||||
|
import top.continew.starter.extension.crud.model.resp.PageResp;
|
||||||
import top.continew.starter.extension.crud.service.BaseService;
|
import top.continew.starter.extension.crud.service.BaseService;
|
||||||
|
import top.mes.admin.process.model.query.ProcessBomQuery;
|
||||||
import top.mes.admin.process.model.query.ProcessQuery;
|
import top.mes.admin.process.model.query.ProcessQuery;
|
||||||
|
import top.mes.admin.process.model.req.ProcessBomReq;
|
||||||
import top.mes.admin.process.model.req.ProcessReq;
|
import top.mes.admin.process.model.req.ProcessReq;
|
||||||
import top.mes.admin.process.model.resp.ProcessDetailResp;
|
import top.mes.admin.process.model.resp.ProcessBomResp;
|
||||||
import top.mes.admin.process.model.resp.ProcessResp;
|
import top.mes.admin.process.model.resp.ProcessResp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -14,4 +18,16 @@ import top.mes.admin.process.model.resp.ProcessResp;
|
|||||||
*/
|
*/
|
||||||
public interface ProcessService extends BaseService<ProcessResp, ProcessResp, ProcessQuery, ProcessReq> {
|
public interface ProcessService extends BaseService<ProcessResp, ProcessResp, ProcessQuery, ProcessReq> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存工序BOM
|
||||||
|
* @param req
|
||||||
|
*/
|
||||||
|
void saveProcessBom(ProcessBomReq req);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取工序BOM分页列表
|
||||||
|
* @param query
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PageResp<ProcessBomResp> getProcessBomPage(ProcessBomQuery query, PageQuery pageQuery);
|
||||||
}
|
}
|
||||||
@@ -1,18 +1,31 @@
|
|||||||
package top.mes.admin.process.service.impl;
|
package top.mes.admin.process.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import top.continew.starter.extension.crud.model.query.PageQuery;
|
||||||
|
import top.continew.starter.extension.crud.model.resp.PageResp;
|
||||||
import top.continew.starter.extension.crud.service.BaseServiceImpl;
|
import top.continew.starter.extension.crud.service.BaseServiceImpl;
|
||||||
|
import top.mes.admin.process.mapper.ProcessBomMapper;
|
||||||
import top.mes.admin.process.mapper.ProcessMapper;
|
import top.mes.admin.process.mapper.ProcessMapper;
|
||||||
|
import top.mes.admin.process.model.entity.ProcessBomDO;
|
||||||
import top.mes.admin.process.model.entity.ProcessDO;
|
import top.mes.admin.process.model.entity.ProcessDO;
|
||||||
|
import top.mes.admin.process.model.query.ProcessBomQuery;
|
||||||
import top.mes.admin.process.model.query.ProcessQuery;
|
import top.mes.admin.process.model.query.ProcessQuery;
|
||||||
|
import top.mes.admin.process.model.req.ProcessBomReq;
|
||||||
import top.mes.admin.process.model.req.ProcessReq;
|
import top.mes.admin.process.model.req.ProcessReq;
|
||||||
import top.mes.admin.process.model.resp.ProcessDetailResp;
|
import top.mes.admin.process.model.resp.ProcessBomResp;
|
||||||
import top.mes.admin.process.model.resp.ProcessResp;
|
import top.mes.admin.process.model.resp.ProcessResp;
|
||||||
import top.mes.admin.process.service.ProcessService;
|
import top.mes.admin.process.service.ProcessService;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工序基础信息业务实现
|
* 工序基础信息业务实现
|
||||||
*
|
*
|
||||||
@@ -23,4 +36,50 @@ import top.mes.admin.process.service.ProcessService;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class ProcessServiceImpl extends BaseServiceImpl<ProcessMapper, ProcessDO, ProcessResp, ProcessResp, ProcessQuery, ProcessReq> implements ProcessService {
|
public class ProcessServiceImpl extends BaseServiceImpl<ProcessMapper, ProcessDO, ProcessResp, ProcessResp, ProcessQuery, ProcessReq> implements ProcessService {
|
||||||
|
|
||||||
|
private final ProcessBomMapper processBomMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void saveProcessBom(ProcessBomReq req) {
|
||||||
|
processBomMapper.delete(new QueryWrapper<ProcessBomDO>().eq("process_id", req.getProcessId()));
|
||||||
|
|
||||||
|
List<ProcessBomDO> list = new ArrayList<>();
|
||||||
|
req.getProcessBomDetailList().forEach(item -> {
|
||||||
|
item.getBomIds().forEach(bomId -> {
|
||||||
|
ProcessBomDO processBomDO = new ProcessBomDO();
|
||||||
|
processBomDO.setBomId(bomId);
|
||||||
|
processBomDO.setProcessId(req.getProcessId());
|
||||||
|
processBomDO.setQuantity(item.getQuantity());
|
||||||
|
processBomDO.setSort(item.getSort());
|
||||||
|
list.add(processBomDO);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
|
processBomMapper.insertBatch(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResp<ProcessBomResp> getProcessBomPage(ProcessBomQuery query, PageQuery pageQuery) {
|
||||||
|
QueryWrapper<ProcessBomDO> queryWrapper = new QueryWrapper<ProcessBomDO>().eq("process_id", query.getProcessId());
|
||||||
|
queryWrapper.groupBy("sort", "process_id", "quantity");
|
||||||
|
IPage<ProcessBomResp> page = processBomMapper.selectProcessBomPage(new Page<>(pageQuery.getPage(), pageQuery
|
||||||
|
.getSize()), queryWrapper);
|
||||||
|
|
||||||
|
List<ProcessBomDO> processBomDOS = processBomMapper.selectList(new QueryWrapper<ProcessBomDO>().eq("process_id", query.getProcessId()).select("bom_id", "sort"));
|
||||||
|
Map<Integer, List<Long>> sortBomIdMap = processBomDOS.stream()
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
ProcessBomDO::getSort,
|
||||||
|
Collectors.mapping(
|
||||||
|
ProcessBomDO::getBomId,
|
||||||
|
Collectors.toList()
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
|
page.getRecords().forEach(item -> {
|
||||||
|
item.setBomIds(sortBomIdMap.get(item.getSort()));
|
||||||
|
});
|
||||||
|
|
||||||
|
return PageResp.build(page);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,14 @@
|
|||||||
package top.mes.admin.production.service;
|
package top.mes.admin.production.service;
|
||||||
|
|
||||||
|
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
|
||||||
import top.continew.starter.extension.crud.service.BaseService;
|
import top.continew.starter.extension.crud.service.BaseService;
|
||||||
import top.mes.admin.production.model.query.ProductionLineQuery;
|
import top.mes.admin.production.model.query.ProductionLineQuery;
|
||||||
import top.mes.admin.production.model.req.ProductionLineReq;
|
import top.mes.admin.production.model.req.ProductionLineReq;
|
||||||
import top.mes.admin.production.model.resp.ProductionLineDetailResp;
|
import top.mes.admin.production.model.resp.ProductionLineDetailResp;
|
||||||
import top.mes.admin.production.model.resp.ProductionLineResp;
|
import top.mes.admin.production.model.resp.ProductionLineResp;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 产线基础业务接口
|
* 产线基础业务接口
|
||||||
*
|
*
|
||||||
@@ -14,4 +17,11 @@ import top.mes.admin.production.model.resp.ProductionLineResp;
|
|||||||
*/
|
*/
|
||||||
public interface ProductionLineService extends BaseService<ProductionLineResp, ProductionLineResp, ProductionLineQuery, ProductionLineReq> {
|
public interface ProductionLineService extends BaseService<ProductionLineResp, ProductionLineResp, ProductionLineQuery, ProductionLineReq> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取产线下拉列表
|
||||||
|
*
|
||||||
|
* @param query 查询参数
|
||||||
|
* @return 产线下拉列表
|
||||||
|
*/
|
||||||
|
List<LabelValueResp> getProductionLineSelect(ProductionLineQuery query);
|
||||||
}
|
}
|
||||||
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import top.continew.starter.extension.crud.model.query.PageQuery;
|
import top.continew.starter.extension.crud.model.query.PageQuery;
|
||||||
|
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
|
||||||
import top.continew.starter.extension.crud.model.resp.PageResp;
|
import top.continew.starter.extension.crud.model.resp.PageResp;
|
||||||
import top.continew.starter.extension.crud.service.BaseServiceImpl;
|
import top.continew.starter.extension.crud.service.BaseServiceImpl;
|
||||||
import top.mes.admin.production.mapper.ProductionLineMapper;
|
import top.mes.admin.production.mapper.ProductionLineMapper;
|
||||||
@@ -16,6 +17,9 @@ import top.mes.admin.production.model.req.ProductionLineReq;
|
|||||||
import top.mes.admin.production.model.resp.ProductionLineResp;
|
import top.mes.admin.production.model.resp.ProductionLineResp;
|
||||||
import top.mes.admin.production.service.ProductionLineService;
|
import top.mes.admin.production.service.ProductionLineService;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 产线基础业务实现
|
* 产线基础业务实现
|
||||||
*
|
*
|
||||||
@@ -36,7 +40,7 @@ public class ProductionLineServiceImpl extends BaseServiceImpl<ProductionLineMap
|
|||||||
queryWrapper.like(StrUtil.isNotBlank(query.getLineName()), "pl.line_name", query.getLineName());
|
queryWrapper.like(StrUtil.isNotBlank(query.getLineName()), "pl.line_name", query.getLineName());
|
||||||
queryWrapper.eq(query.getLineType() != null, "pl.line_type", query.getLineType());
|
queryWrapper.eq(query.getLineType() != null, "pl.line_type", query.getLineType());
|
||||||
queryWrapper.eq(query.getStatus() != null, "pl.status", query.getStatus());
|
queryWrapper.eq(query.getStatus() != null, "pl.status", query.getStatus());
|
||||||
this.sort(queryWrapper, pageQuery);
|
queryWrapper.orderByDesc("pl.id");
|
||||||
|
|
||||||
IPage<ProductionLineResp> page = baseMapper.selectProductionLinePage(new Page<>(pageQuery.getPage(), pageQuery
|
IPage<ProductionLineResp> page = baseMapper.selectProductionLinePage(new Page<>(pageQuery.getPage(), pageQuery
|
||||||
.getSize()), queryWrapper);
|
.getSize()), queryWrapper);
|
||||||
@@ -44,4 +48,14 @@ public class ProductionLineServiceImpl extends BaseServiceImpl<ProductionLineMap
|
|||||||
return PageResp.build(page);
|
return PageResp.build(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LabelValueResp> getProductionLineSelect(ProductionLineQuery query) {
|
||||||
|
QueryWrapper<ProductionLineDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
List<ProductionLineDO> productionLineDOS = baseMapper.selectList(queryWrapper);
|
||||||
|
List<LabelValueResp> labelValueResps = new ArrayList<>();
|
||||||
|
for (ProductionLineDO productionLineDO : productionLineDOS) {
|
||||||
|
labelValueResps.add(new LabelValueResp(productionLineDO.getLineName(), productionLineDO.getId()));
|
||||||
|
}
|
||||||
|
return labelValueResps;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,14 @@
|
|||||||
package top.mes.admin.routing.mapper;
|
package top.mes.admin.routing.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import top.continew.starter.data.mp.base.BaseMapper;
|
import top.continew.starter.data.mp.base.BaseMapper;
|
||||||
import top.mes.admin.routing.model.entity.RoutingDO;
|
import top.mes.admin.routing.model.entity.RoutingDO;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
import top.mes.admin.routing.model.resp.RoutingResp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工艺路线主 Mapper
|
* 工艺路线主 Mapper
|
||||||
@@ -13,4 +19,5 @@ import org.springframework.stereotype.Repository;
|
|||||||
@Repository
|
@Repository
|
||||||
public interface RoutingMapper extends BaseMapper<RoutingDO> {
|
public interface RoutingMapper extends BaseMapper<RoutingDO> {
|
||||||
|
|
||||||
|
IPage<RoutingResp> selectRoutingPage(@Param("page") Page<Object> objectPage,@Param(Constants.WRAPPER) QueryWrapper<RoutingDO> queryWrapper);
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package top.mes.admin.routing.model.entity;
|
package top.mes.admin.routing.model.entity;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
@@ -32,35 +33,15 @@ public class RoutingDO extends BaseDO {
|
|||||||
private String routingName;
|
private String routingName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关联产品ID(适用产品)
|
* 默认生产线
|
||||||
*/
|
*/
|
||||||
private Long productId;
|
private Long defaultLine;
|
||||||
|
|
||||||
/**
|
|
||||||
* 适用产品分类(如不指定具体产品)
|
|
||||||
*/
|
|
||||||
private String productCategory;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 默认产线ID
|
|
||||||
*/
|
|
||||||
private Long lineId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 版本号
|
|
||||||
*/
|
|
||||||
private Integer version;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否启用:0-否 1-是
|
* 是否启用:0-否 1-是
|
||||||
*/
|
*/
|
||||||
private Integer isActive;
|
private Integer isActive;
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:1-草稿 2-已发布 3-已废弃
|
|
||||||
*/
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -38,13 +38,6 @@ public class RoutingQuery implements Serializable {
|
|||||||
@Query(type = QueryType.EQ)
|
@Query(type = QueryType.EQ)
|
||||||
private String routingName;
|
private String routingName;
|
||||||
|
|
||||||
/**
|
|
||||||
* 版本号
|
|
||||||
*/
|
|
||||||
@Schema(description = "版本号")
|
|
||||||
@Query(type = QueryType.EQ)
|
|
||||||
private Integer version;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否启用:0-否 1-是
|
* 是否启用:0-否 1-是
|
||||||
*/
|
*/
|
||||||
@@ -52,10 +45,4 @@ public class RoutingQuery implements Serializable {
|
|||||||
@Query(type = QueryType.EQ)
|
@Query(type = QueryType.EQ)
|
||||||
private Integer isActive;
|
private Integer isActive;
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:1-草稿 2-已发布 3-已废弃
|
|
||||||
*/
|
|
||||||
@Schema(description = "状态:1-草稿 2-已发布 3-已废弃")
|
|
||||||
@Query(type = QueryType.EQ)
|
|
||||||
private Integer status;
|
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,6 @@ public class RoutingReq implements Serializable {
|
|||||||
* 工艺路线编码
|
* 工艺路线编码
|
||||||
*/
|
*/
|
||||||
@Schema(description = "工艺路线编码")
|
@Schema(description = "工艺路线编码")
|
||||||
@NotBlank(message = "工艺路线编码不能为空")
|
|
||||||
@Length(max = 32, message = "工艺路线编码长度不能超过 {max} 个字符")
|
@Length(max = 32, message = "工艺路线编码长度不能超过 {max} 个字符")
|
||||||
private String routingCode;
|
private String routingCode;
|
||||||
|
|
||||||
@@ -42,30 +41,10 @@ public class RoutingReq implements Serializable {
|
|||||||
private String routingName;
|
private String routingName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关联产品ID(适用产品)
|
* 默认生产线
|
||||||
*/
|
*/
|
||||||
@Schema(description = "关联产品ID(适用产品)")
|
@Schema(description = "默认生产线")
|
||||||
private Long productId;
|
private Long defaultLine;
|
||||||
|
|
||||||
/**
|
|
||||||
* 适用产品分类(如不指定具体产品)
|
|
||||||
*/
|
|
||||||
@Schema(description = "适用产品分类(如不指定具体产品)")
|
|
||||||
@Length(max = 32, message = "适用产品分类(如不指定具体产品)长度不能超过 {max} 个字符")
|
|
||||||
private String productCategory;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 默认产线ID
|
|
||||||
*/
|
|
||||||
@Schema(description = "默认产线ID")
|
|
||||||
private Long lineId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 版本号
|
|
||||||
*/
|
|
||||||
@Schema(description = "版本号")
|
|
||||||
@NotNull(message = "版本号不能为空")
|
|
||||||
private Integer version;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否启用:0-否 1-是
|
* 是否启用:0-否 1-是
|
||||||
@@ -74,13 +53,6 @@ public class RoutingReq implements Serializable {
|
|||||||
@NotNull(message = "是否启用:0-否 1-是不能为空")
|
@NotNull(message = "是否启用:0-否 1-是不能为空")
|
||||||
private Integer isActive;
|
private Integer isActive;
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:1-草稿 2-已发布 3-已废弃
|
|
||||||
*/
|
|
||||||
@Schema(description = "状态:1-草稿 2-已发布 3-已废弃")
|
|
||||||
@NotNull(message = "状态:1-草稿 2-已发布 3-已废弃不能为空")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,91 +0,0 @@
|
|||||||
package top.mes.admin.routing.model.resp;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
|
||||||
|
|
||||||
import top.mes.admin.common.model.resp.BaseDetailResp;
|
|
||||||
|
|
||||||
import java.io.Serial;
|
|
||||||
import java.time.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工艺路线主详情信息
|
|
||||||
*
|
|
||||||
* @author zc
|
|
||||||
* @since 2026/06/23 15:53
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@ExcelIgnoreUnannotated
|
|
||||||
@Schema(description = "工艺路线主详情信息")
|
|
||||||
public class RoutingDetailResp extends BaseDetailResp {
|
|
||||||
|
|
||||||
@Serial
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工艺路线编码
|
|
||||||
*/
|
|
||||||
@Schema(description = "工艺路线编码")
|
|
||||||
@ExcelProperty(value = "工艺路线编码")
|
|
||||||
private String routingCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工艺路线名称
|
|
||||||
*/
|
|
||||||
@Schema(description = "工艺路线名称")
|
|
||||||
@ExcelProperty(value = "工艺路线名称")
|
|
||||||
private String routingName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联产品ID(适用产品)
|
|
||||||
*/
|
|
||||||
@Schema(description = "关联产品ID(适用产品)")
|
|
||||||
@ExcelProperty(value = "关联产品ID(适用产品)")
|
|
||||||
private Long productId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 适用产品分类(如不指定具体产品)
|
|
||||||
*/
|
|
||||||
@Schema(description = "适用产品分类(如不指定具体产品)")
|
|
||||||
@ExcelProperty(value = "适用产品分类(如不指定具体产品)")
|
|
||||||
private String productCategory;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 默认产线ID
|
|
||||||
*/
|
|
||||||
@Schema(description = "默认产线ID")
|
|
||||||
@ExcelProperty(value = "默认产线ID")
|
|
||||||
private Long lineId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 版本号
|
|
||||||
*/
|
|
||||||
@Schema(description = "版本号")
|
|
||||||
@ExcelProperty(value = "版本号")
|
|
||||||
private Integer version;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否启用:0-否 1-是
|
|
||||||
*/
|
|
||||||
@Schema(description = "是否启用:0-否 1-是")
|
|
||||||
@ExcelProperty(value = "是否启用:0-否 1-是")
|
|
||||||
private Integer isActive;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:1-草稿 2-已发布 3-已废弃
|
|
||||||
*/
|
|
||||||
@Schema(description = "状态:1-草稿 2-已发布 3-已废弃")
|
|
||||||
@ExcelProperty(value = "状态:1-草稿 2-已发布 3-已废弃")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
@Schema(description = "备注")
|
|
||||||
@ExcelProperty(value = "备注")
|
|
||||||
private String remark;
|
|
||||||
}
|
|
||||||
@@ -35,40 +35,22 @@ public class RoutingResp extends BaseDetailResp {
|
|||||||
private String routingName;
|
private String routingName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关联产品ID(适用产品)
|
* 默认生产线
|
||||||
*/
|
*/
|
||||||
@Schema(description = "关联产品ID(适用产品)")
|
@Schema(description = "默认生产线")
|
||||||
private Long productId;
|
private Long defaultLine;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 适用产品分类(如不指定具体产品)
|
* 默认生产线名称
|
||||||
*/
|
*/
|
||||||
@Schema(description = "适用产品分类(如不指定具体产品)")
|
@Schema(description = "默认生产线名称")
|
||||||
private String productCategory;
|
private String defaultLineName;
|
||||||
|
|
||||||
/**
|
|
||||||
* 默认产线ID
|
|
||||||
*/
|
|
||||||
@Schema(description = "默认产线ID")
|
|
||||||
private Long lineId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 版本号
|
|
||||||
*/
|
|
||||||
@Schema(description = "版本号")
|
|
||||||
private Integer version;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否启用:0-否 1-是
|
* 是否启用:0-否 1-是
|
||||||
*/
|
*/
|
||||||
@Schema(description = "是否启用:0-否 1-是")
|
@Schema(description = "是否启用:0-否 1-是")
|
||||||
private Integer isActive;
|
private String isActive;
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:1-草稿 2-已发布 3-已废弃
|
|
||||||
*/
|
|
||||||
@Schema(description = "状态:1-草稿 2-已发布 3-已废弃")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
@@ -76,15 +58,4 @@ public class RoutingResp extends BaseDetailResp {
|
|||||||
@Schema(description = "备注")
|
@Schema(description = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改人
|
|
||||||
*/
|
|
||||||
@Schema(description = "修改人")
|
|
||||||
private Long updateUser;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改时间
|
|
||||||
*/
|
|
||||||
@Schema(description = "修改时间")
|
|
||||||
private LocalDateTime updateTime;
|
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,6 @@ package top.mes.admin.routing.service;
|
|||||||
import top.continew.starter.extension.crud.service.BaseService;
|
import top.continew.starter.extension.crud.service.BaseService;
|
||||||
import top.mes.admin.routing.model.query.RoutingQuery;
|
import top.mes.admin.routing.model.query.RoutingQuery;
|
||||||
import top.mes.admin.routing.model.req.RoutingReq;
|
import top.mes.admin.routing.model.req.RoutingReq;
|
||||||
import top.mes.admin.routing.model.resp.RoutingDetailResp;
|
|
||||||
import top.mes.admin.routing.model.resp.RoutingResp;
|
import top.mes.admin.routing.model.resp.RoutingResp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,15 +1,23 @@
|
|||||||
package top.mes.admin.routing.service.impl;
|
package top.mes.admin.routing.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import top.continew.starter.core.exception.BusinessException;
|
||||||
|
import top.continew.starter.core.validation.CheckUtils;
|
||||||
|
import top.continew.starter.extension.crud.model.query.PageQuery;
|
||||||
|
import top.continew.starter.extension.crud.model.resp.PageResp;
|
||||||
import top.continew.starter.extension.crud.service.BaseServiceImpl;
|
import top.continew.starter.extension.crud.service.BaseServiceImpl;
|
||||||
import top.mes.admin.routing.mapper.RoutingMapper;
|
import top.mes.admin.routing.mapper.RoutingMapper;
|
||||||
import top.mes.admin.routing.model.entity.RoutingDO;
|
import top.mes.admin.routing.model.entity.RoutingDO;
|
||||||
import top.mes.admin.routing.model.query.RoutingQuery;
|
import top.mes.admin.routing.model.query.RoutingQuery;
|
||||||
import top.mes.admin.routing.model.req.RoutingReq;
|
import top.mes.admin.routing.model.req.RoutingReq;
|
||||||
import top.mes.admin.routing.model.resp.RoutingDetailResp;
|
|
||||||
import top.mes.admin.routing.model.resp.RoutingResp;
|
import top.mes.admin.routing.model.resp.RoutingResp;
|
||||||
import top.mes.admin.routing.service.RoutingService;
|
import top.mes.admin.routing.service.RoutingService;
|
||||||
|
|
||||||
@@ -23,4 +31,31 @@ import top.mes.admin.routing.service.RoutingService;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class RoutingServiceImpl extends BaseServiceImpl<RoutingMapper, RoutingDO, RoutingResp, RoutingResp, RoutingQuery, RoutingReq> implements RoutingService {
|
public class RoutingServiceImpl extends BaseServiceImpl<RoutingMapper, RoutingDO, RoutingResp, RoutingResp, RoutingQuery, RoutingReq> implements RoutingService {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResp<RoutingResp> page(RoutingQuery query, PageQuery pageQuery) {
|
||||||
|
QueryWrapper<RoutingDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
|
||||||
|
// 构建查询条件
|
||||||
|
queryWrapper.eq(StrUtil.isNotBlank(query.getRoutingCode()), "r.routing_code", query.getRoutingCode());
|
||||||
|
queryWrapper.like(StrUtil.isNotBlank(query.getRoutingName()), "r.routing_name", query.getRoutingName());
|
||||||
|
queryWrapper.eq(query.getIsActive() != null, "r.is_active", query.getIsActive());
|
||||||
|
queryWrapper.orderByDesc("r.id");
|
||||||
|
|
||||||
|
IPage<RoutingResp> page = baseMapper.selectRoutingPage(new Page<>(pageQuery.getPage(), pageQuery.getSize()), queryWrapper);
|
||||||
|
|
||||||
|
return PageResp.build(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beforeAdd(RoutingReq req) {
|
||||||
|
if (StrUtil.isBlank(req.getRoutingCode())) {
|
||||||
|
req.setRoutingCode(IdUtil.getSnowflakeNextIdStr());
|
||||||
|
}
|
||||||
|
boolean exists = baseMapper.exists(new QueryWrapper<RoutingDO>().eq("routing_code", req.getRoutingCode()));
|
||||||
|
CheckUtils.throwIf(exists, "工艺路线编码重复!");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
<mapper namespace="top.mes.admin.bom.mapper.BomMapper">
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
<mapper namespace="top.mes.admin.process.mapper.ProcessBomMapper">
|
||||||
|
<select id="selectProcessBomPage" resultType="top.mes.admin.process.model.resp.ProcessBomResp">
|
||||||
|
select
|
||||||
|
process_id as processId,
|
||||||
|
quantity,
|
||||||
|
sort
|
||||||
|
from sys_process_bom
|
||||||
|
${ew.getCustomSqlSegment}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
<mapper namespace="top.mes.admin.process.mapper.ProcessMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
<mapper namespace="top.mes.admin.routing.mapper.RoutingMapper">
|
||||||
|
<select id="selectRoutingPage" resultType="top.mes.admin.routing.model.resp.RoutingResp">
|
||||||
|
select
|
||||||
|
r.*,
|
||||||
|
pl.line_name as defaultLineName
|
||||||
|
from sys_routing r
|
||||||
|
left join sys_production_line pl on r.default_line = pl.id
|
||||||
|
${ew.customSqlSegment}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
<mapper namespace="top.mes.admin.routing.mapper.RoutingStepMapper">
|
||||||
|
</mapper>
|
||||||
@@ -8,11 +8,16 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import top.continew.starter.extension.crud.annotation.CrudRequestMapping;
|
import top.continew.starter.extension.crud.annotation.CrudRequestMapping;
|
||||||
|
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
|
||||||
|
import top.continew.starter.log.annotation.Log;
|
||||||
import top.mes.admin.common.controller.BaseController;
|
import top.mes.admin.common.controller.BaseController;
|
||||||
import top.mes.admin.bom.model.query.BomQuery;
|
import top.mes.admin.bom.model.query.BomQuery;
|
||||||
import top.mes.admin.bom.model.req.BomReq;
|
import top.mes.admin.bom.model.req.BomReq;
|
||||||
import top.mes.admin.bom.model.resp.BomResp;
|
import top.mes.admin.bom.model.resp.BomResp;
|
||||||
import top.mes.admin.bom.service.BomService;
|
import top.mes.admin.bom.service.BomService;
|
||||||
|
import top.mes.admin.peopleBranch.model.query.PeopleQuery;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BOM物料清单(单)管理 API
|
* BOM物料清单(单)管理 API
|
||||||
@@ -26,4 +31,11 @@ import top.mes.admin.bom.service.BomService;
|
|||||||
@CrudRequestMapping(value = "/bom/bom", api = {Api.PAGE, Api.DETAIL, Api.ADD, Api.UPDATE, Api.DELETE, Api.EXPORT})
|
@CrudRequestMapping(value = "/bom/bom", api = {Api.PAGE, Api.DETAIL, Api.ADD, Api.UPDATE, Api.DELETE, Api.EXPORT})
|
||||||
public class BomController extends BaseController<BomService, BomResp, BomResp, BomQuery, BomReq> {
|
public class BomController extends BaseController<BomService, BomResp, BomResp, BomQuery, BomReq> {
|
||||||
|
|
||||||
|
|
||||||
|
@Log(ignore = true)
|
||||||
|
@GetMapping(value = "/getBomSelect")
|
||||||
|
public List<LabelValueResp> getBomSelect(BomQuery query) {
|
||||||
|
return baseService.getBomSelect(query);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -8,12 +8,22 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import top.continew.starter.extension.crud.annotation.CrudRequestMapping;
|
import top.continew.starter.extension.crud.annotation.CrudRequestMapping;
|
||||||
|
import top.continew.starter.extension.crud.model.query.PageQuery;
|
||||||
|
import top.continew.starter.extension.crud.model.resp.PageResp;
|
||||||
|
import top.continew.starter.log.annotation.Log;
|
||||||
|
import top.continew.starter.web.model.R;
|
||||||
import top.mes.admin.common.controller.BaseController;
|
import top.mes.admin.common.controller.BaseController;
|
||||||
|
import top.mes.admin.peopleBranch.model.resp.PeopleResp;
|
||||||
|
import top.mes.admin.process.model.query.ProcessBomQuery;
|
||||||
import top.mes.admin.process.model.query.ProcessQuery;
|
import top.mes.admin.process.model.query.ProcessQuery;
|
||||||
|
import top.mes.admin.process.model.req.ProcessBomReq;
|
||||||
import top.mes.admin.process.model.req.ProcessReq;
|
import top.mes.admin.process.model.req.ProcessReq;
|
||||||
|
import top.mes.admin.process.model.resp.ProcessBomResp;
|
||||||
import top.mes.admin.process.model.resp.ProcessResp;
|
import top.mes.admin.process.model.resp.ProcessResp;
|
||||||
import top.mes.admin.process.service.ProcessService;
|
import top.mes.admin.process.service.ProcessService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工序基础信息管理 API
|
* 工序基础信息管理 API
|
||||||
*
|
*
|
||||||
@@ -26,4 +36,18 @@ import top.mes.admin.process.service.ProcessService;
|
|||||||
@CrudRequestMapping(value = "/process/process", api = {Api.PAGE, Api.DETAIL, Api.ADD, Api.UPDATE, Api.DELETE, Api.EXPORT})
|
@CrudRequestMapping(value = "/process/process", api = {Api.PAGE, Api.DETAIL, Api.ADD, Api.UPDATE, Api.DELETE, Api.EXPORT})
|
||||||
public class ProcessController extends BaseController<ProcessService, ProcessResp, ProcessResp, ProcessQuery, ProcessReq> {
|
public class ProcessController extends BaseController<ProcessService, ProcessResp, ProcessResp, ProcessQuery, ProcessReq> {
|
||||||
|
|
||||||
|
|
||||||
|
@Log(module = "工序BOM保存")
|
||||||
|
@PostMapping("/saveProcessBom")
|
||||||
|
public void saveProcessBom(@RequestBody ProcessBomReq processBomReq) {
|
||||||
|
baseService.saveProcessBom(processBomReq);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(ignore = true)
|
||||||
|
@GetMapping("/getProcessBomPage")
|
||||||
|
public R getProcessBomPage(ProcessBomQuery query, PageQuery pageQuery) {
|
||||||
|
PageResp<ProcessBomResp> pageResp = baseService.getProcessBomPage(query, pageQuery);
|
||||||
|
return R.ok(pageResp);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,21 @@
|
|||||||
package top.mes.admin.controller.production;
|
package top.mes.admin.controller.production;
|
||||||
|
|
||||||
import top.continew.starter.extension.crud.enums.Api;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import top.continew.starter.extension.crud.annotation.CrudRequestMapping;
|
import top.continew.starter.extension.crud.annotation.CrudRequestMapping;
|
||||||
|
import top.continew.starter.extension.crud.enums.Api;
|
||||||
|
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
|
||||||
|
import top.continew.starter.log.annotation.Log;
|
||||||
import top.mes.admin.common.controller.BaseController;
|
import top.mes.admin.common.controller.BaseController;
|
||||||
import top.mes.admin.production.model.query.ProductionLineQuery;
|
import top.mes.admin.production.model.query.ProductionLineQuery;
|
||||||
import top.mes.admin.production.model.req.ProductionLineReq;
|
import top.mes.admin.production.model.req.ProductionLineReq;
|
||||||
import top.mes.admin.production.model.resp.ProductionLineResp;
|
import top.mes.admin.production.model.resp.ProductionLineResp;
|
||||||
import top.mes.admin.production.service.ProductionLineService;
|
import top.mes.admin.production.service.ProductionLineService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 产线基础管理 API
|
* 产线基础管理 API
|
||||||
*
|
*
|
||||||
@@ -26,4 +28,11 @@ import top.mes.admin.production.service.ProductionLineService;
|
|||||||
@CrudRequestMapping(value = "/production/productionLine", api = {Api.PAGE, Api.DETAIL, Api.ADD, Api.UPDATE, Api.DELETE, Api.EXPORT})
|
@CrudRequestMapping(value = "/production/productionLine", api = {Api.PAGE, Api.DETAIL, Api.ADD, Api.UPDATE, Api.DELETE, Api.EXPORT})
|
||||||
public class ProductionLineController extends BaseController<ProductionLineService, ProductionLineResp, ProductionLineResp, ProductionLineQuery, ProductionLineReq> {
|
public class ProductionLineController extends BaseController<ProductionLineService, ProductionLineResp, ProductionLineResp, ProductionLineQuery, ProductionLineReq> {
|
||||||
|
|
||||||
|
|
||||||
|
@Log(ignore = true)
|
||||||
|
@GetMapping(value = "/getProductionLineSelect")
|
||||||
|
public List<LabelValueResp> getProductionLineSelect(ProductionLineQuery query) {
|
||||||
|
return baseService.getProductionLineSelect(query);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user