parent
dcbce638df
commit
29aa9483fa
@ -1,15 +1,24 @@
|
||||
package com.foreverwin.iep.qms.constant;
|
||||
|
||||
public class Factor {
|
||||
|
||||
|
||||
public static final String OPERATION = "Operation";
|
||||
|
||||
public static final String PRODUCT = "Product";
|
||||
|
||||
public static final String QC_USER = "QCUser";
|
||||
|
||||
public static final String VENDOR = "Vendor";
|
||||
|
||||
public static final String SHIFT = "Shift";
|
||||
|
||||
public static final String EQUIPMENT = "Equipment";
|
||||
|
||||
public static final String INSTRUMENT = "Instrument";
|
||||
|
||||
public static final String MATERIAL = "Material";
|
||||
|
||||
public static final String SUPPLIER = "Supplier";
|
||||
|
||||
public static final String SUPPLIER_BATCH = "SupplierBatch";
|
||||
}
|
||||
|
||||
@ -4,18 +4,27 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Freq {
|
||||
|
||||
|
||||
public static final String CHK_FIRST_SFC = "CHK_FIRST_SFC"; // 工单第一个生产的生产批
|
||||
|
||||
public static final String CHK_DAILY_FIRST_SFC = "CHK_DAILY_FIRST_SFC"; // 每日第一个生产的生产批
|
||||
|
||||
public static final String CHK_CHANGE_PRODUCT = "CHK_CHANGE_PRODUCT"; // 更换产品后第一个生产的生产批
|
||||
|
||||
public static final String CHK_CHANGE_MOULD = "CHK_CHANGE_MOULD"; // 设备换工具后第一个生产的生产批
|
||||
|
||||
public static final String CHK_MAINTEN_FIRST_SFC = "CHK_MAINTEN_FIRST_SFC"; // 设备维修后第一个生产的生产批
|
||||
|
||||
public static final String CHK_STOP_AFTER_SFC = "CHK_STOP_AFTER_SFC"; // 设备停机N小时以上, 生产的第一个生产批
|
||||
|
||||
public static final String CHK_SEVERAL_SFC = "CHK_SEVERAL_SFC"; // 每N个生产批
|
||||
|
||||
public static final String CHK_INTERVAL_HOUR2 = "CHK_INTERVAL_HOUR2"; // 机台生产每N小时
|
||||
|
||||
public static final String CHK_DAILY_FIXED_TIME = "CHK_DAILY_FIXED_TIME"; // 每日固定N点
|
||||
|
||||
public static final String MANUAL = "MANUAL"; // 手动
|
||||
|
||||
|
||||
public static List<String> getFreq() {
|
||||
List<String> freqList = new ArrayList<>();
|
||||
freqList.add(CHK_FIRST_SFC);
|
||||
|
||||
@ -6,8 +6,8 @@ import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class Aql {
|
||||
|
||||
|
||||
private BigDecimal sampleSize;
|
||||
|
||||
|
||||
private BigDecimal returnQty;
|
||||
}
|
||||
|
||||
@ -6,16 +6,22 @@ import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AutoCreateJobRequest {
|
||||
|
||||
|
||||
private List<BasisInfo> lotBasisList;
|
||||
|
||||
private String operation;
|
||||
|
||||
private String resource;
|
||||
|
||||
private String user;
|
||||
|
||||
|
||||
@Data
|
||||
public static class BasisInfo {
|
||||
|
||||
private String lotNo;
|
||||
|
||||
private String shopOrderBo;
|
||||
|
||||
private String itemBo;
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,16 +6,26 @@ import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class ChkInfo {
|
||||
|
||||
|
||||
private String lotNo;
|
||||
|
||||
private String item;
|
||||
|
||||
private String operation;
|
||||
|
||||
private String resrce;
|
||||
|
||||
private String status;
|
||||
|
||||
private String qcPlanBo;
|
||||
|
||||
private String qcPlan;
|
||||
|
||||
private String chkDailyFixedTime;
|
||||
|
||||
private String dailyFixedTime;
|
||||
|
||||
private LocalDateTime startTime;
|
||||
|
||||
private LocalDateTime eventTime;
|
||||
}
|
||||
|
||||
@ -4,7 +4,8 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FactorDataSourceInfo {
|
||||
|
||||
|
||||
private String name;
|
||||
|
||||
private String description;
|
||||
}
|
||||
|
||||
@ -8,10 +8,10 @@ import lombok.NoArgsConstructor;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class FreqItem {
|
||||
|
||||
|
||||
private String selected;
|
||||
|
||||
|
||||
private String item;
|
||||
|
||||
|
||||
private String hourValue;
|
||||
}
|
||||
|
||||
@ -12,8 +12,8 @@ import java.util.Map;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class InspecFreq {
|
||||
|
||||
|
||||
private QmsInspecFreq qmsInspecFreq;
|
||||
|
||||
|
||||
private Map<String, List<FreqItem>> inspecFreqMap;
|
||||
}
|
||||
|
||||
@ -6,76 +6,77 @@ import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class InspecJob {
|
||||
|
||||
|
||||
private String jobNo;
|
||||
|
||||
|
||||
private String qcPlan;
|
||||
|
||||
|
||||
private String lotNo;
|
||||
|
||||
|
||||
private String operation;
|
||||
|
||||
|
||||
private String resrce;
|
||||
|
||||
|
||||
private String executionType;
|
||||
|
||||
|
||||
private String result;
|
||||
|
||||
|
||||
private String abnGroup;
|
||||
|
||||
|
||||
private String reasonCode;
|
||||
|
||||
|
||||
private boolean createAbn;
|
||||
|
||||
|
||||
private String judgeRemark;
|
||||
|
||||
|
||||
private String qcFreq;
|
||||
|
||||
|
||||
private String remark;
|
||||
|
||||
|
||||
private String user;
|
||||
|
||||
|
||||
private String item;
|
||||
|
||||
|
||||
private String targetBo;
|
||||
|
||||
|
||||
private BigDecimal populationQty;
|
||||
|
||||
|
||||
private String nextNumberType = "QMS_INSPEC_JOB";
|
||||
|
||||
|
||||
private String inspecType = "0";
|
||||
|
||||
|
||||
/**
|
||||
* 入库数量
|
||||
*/
|
||||
private BigDecimal storageQty = BigDecimal.ZERO;
|
||||
|
||||
|
||||
/**
|
||||
* 特采数量
|
||||
*/
|
||||
private BigDecimal waiverQty = BigDecimal.ZERO;
|
||||
|
||||
|
||||
/**
|
||||
* 退回数量
|
||||
*/
|
||||
private BigDecimal returnQty = BigDecimal.ZERO;
|
||||
|
||||
|
||||
/**
|
||||
* 破坏数量
|
||||
*/
|
||||
private BigDecimal destructiveQty = BigDecimal.ZERO;
|
||||
|
||||
|
||||
/**
|
||||
* 留样数量
|
||||
*/
|
||||
private BigDecimal testsampleQty = BigDecimal.ZERO;
|
||||
|
||||
|
||||
/**
|
||||
* 原检验任务编号
|
||||
*/
|
||||
private String originalJobNo;
|
||||
|
||||
|
||||
private String supplier;
|
||||
|
||||
private String supplierBatch;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -4,10 +4,10 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Item {
|
||||
|
||||
|
||||
private String itemBo;
|
||||
|
||||
|
||||
private String item;
|
||||
|
||||
|
||||
private String description;
|
||||
}
|
||||
|
||||
@ -4,9 +4,12 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ReceiptInfo {
|
||||
|
||||
|
||||
private String receiptNo;
|
||||
|
||||
private String purchaseNo;
|
||||
|
||||
private String supplierNo;
|
||||
|
||||
private String supplierName;
|
||||
}
|
||||
|
||||
@ -4,17 +4,18 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Resource {
|
||||
|
||||
private String resourceBo;
|
||||
|
||||
|
||||
private String resrce;
|
||||
|
||||
|
||||
private String description;
|
||||
|
||||
|
||||
private String categoryNo;
|
||||
|
||||
|
||||
private String categoryDesc;
|
||||
|
||||
|
||||
private String typeNo;
|
||||
|
||||
|
||||
private String typeDesc;
|
||||
}
|
||||
|
||||
@ -4,8 +4,10 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UserGroup {
|
||||
|
||||
|
||||
private String userGroup;
|
||||
|
||||
private String roleName;
|
||||
|
||||
private String roleDesc;
|
||||
}
|
||||
|
||||
@ -8,8 +8,8 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class QmsInspecAttachmentDTO extends QmsInspecAttachment {
|
||||
|
||||
|
||||
private MultipartFile file;
|
||||
|
||||
|
||||
private byte[] bytes;
|
||||
}
|
||||
|
||||
@ -15,45 +15,45 @@ import java.util.Map;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class QmsInspecDetailDTO extends QmsInspecDetail {
|
||||
|
||||
|
||||
public QmsInspecDetailDTO() {
|
||||
}
|
||||
|
||||
|
||||
public QmsInspecDetailDTO(String inspecJobBo) {
|
||||
super(inspecJobBo);
|
||||
}
|
||||
|
||||
|
||||
private String qcItem;
|
||||
|
||||
|
||||
private String qcItemDesc;
|
||||
|
||||
|
||||
private String itemType;
|
||||
|
||||
|
||||
private String controlMode;
|
||||
|
||||
|
||||
private String samplePlan;
|
||||
|
||||
|
||||
private String samplePlanType;
|
||||
|
||||
|
||||
private String areaInfo;
|
||||
|
||||
|
||||
private String contentDesc;
|
||||
|
||||
|
||||
private String eqpCategoryBo;
|
||||
|
||||
|
||||
/**
|
||||
* 允退数
|
||||
*/
|
||||
@ApiModelProperty(value = "允退数")
|
||||
private BigDecimal returnAllowedQty;
|
||||
|
||||
|
||||
private List<Map<String, Object>> resultList;
|
||||
|
||||
|
||||
private QmsInspecResult contentResult;
|
||||
|
||||
|
||||
private List<QmsInspecFactorDTO> factorList;
|
||||
|
||||
|
||||
private List<QmsInspecResultDTO> inspecResultList = new ArrayList<>();
|
||||
|
||||
|
||||
private List<QmsInspecAttachment> attachmentList;
|
||||
}
|
||||
|
||||
@ -7,13 +7,13 @@ import lombok.EqualsAndHashCode;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class QmsInspecFactorDTO extends QmsInspecFactor {
|
||||
|
||||
|
||||
private String factor;
|
||||
|
||||
|
||||
private String description;
|
||||
|
||||
|
||||
private String inputMode;
|
||||
|
||||
|
||||
private String dataSource;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -11,47 +11,64 @@ import java.util.List;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class QmsInspecJobDTO extends QmsInspecJob {
|
||||
|
||||
|
||||
private String qcPlan;
|
||||
|
||||
private String qcPlanDesc;
|
||||
|
||||
|
||||
private String shopOrder;
|
||||
|
||||
|
||||
private String lotNo;
|
||||
|
||||
|
||||
private String item;
|
||||
|
||||
private String itemDesc;
|
||||
|
||||
|
||||
private String operation;
|
||||
|
||||
private String operationDesc;
|
||||
|
||||
|
||||
private String resrce;
|
||||
|
||||
private String resrceDesc;
|
||||
|
||||
|
||||
private LocalDateTime from;
|
||||
|
||||
private LocalDateTime to;
|
||||
|
||||
|
||||
private String seq;
|
||||
|
||||
private String receiptNo;
|
||||
|
||||
private BigDecimal receiptQuantity;
|
||||
|
||||
|
||||
private String inspecResult;
|
||||
|
||||
|
||||
private boolean personal;
|
||||
|
||||
|
||||
private List<String> userGroups;
|
||||
|
||||
|
||||
private String abnNo;
|
||||
|
||||
private String abnStatus;
|
||||
|
||||
private String reasonCode;
|
||||
|
||||
private String purchaseNo;
|
||||
|
||||
private String supplierNo;
|
||||
|
||||
private String supplierName;
|
||||
|
||||
private String inspectLevel;
|
||||
|
||||
private String supplierBatch;
|
||||
|
||||
private String currentResponsible;
|
||||
|
||||
|
||||
private String groupName;
|
||||
|
||||
private String groupNo;
|
||||
|
||||
private String calibrationType;
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ import java.util.List;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class QmsInspecResultDTO extends QmsInspecResult {
|
||||
|
||||
|
||||
private List<QmsInspecResultNccodeDTO> qmsInspecResultNccodeList = new ArrayList<>();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -7,12 +7,12 @@ import lombok.EqualsAndHashCode;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class QmsInspecResultNccodeDTO extends QmsInspecResultNccode {
|
||||
|
||||
|
||||
private String handle;
|
||||
|
||||
|
||||
private String ncCode;
|
||||
|
||||
|
||||
private String description;
|
||||
|
||||
|
||||
private String type;
|
||||
}
|
||||
|
||||
@ -9,14 +9,22 @@ import java.math.BigDecimal;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class QmsQcPlanDetailDTO extends QmsQcPlanDetail {
|
||||
|
||||
|
||||
private String qcItem;
|
||||
|
||||
private String qcItemDesc;
|
||||
|
||||
private String samplePlan;
|
||||
|
||||
private String controlMode;
|
||||
|
||||
private String chartControl;
|
||||
|
||||
private BigDecimal sampleSize;
|
||||
|
||||
private String itemType;
|
||||
|
||||
private BigDecimal areaQty;
|
||||
|
||||
private BigDecimal dieQty;
|
||||
}
|
||||
|
||||
@ -9,13 +9,18 @@ import java.util.List;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class QmsQcPlanTargetDTO extends QmsQcPlanTarget {
|
||||
|
||||
|
||||
private String userGroup;
|
||||
|
||||
private String qcPlanDesc;
|
||||
|
||||
private List<QmsQcPlanTarget> qmsQcPlanTargets;
|
||||
|
||||
|
||||
private String resourceBo;
|
||||
|
||||
private String qcPlanBo;
|
||||
|
||||
private String calibrationFreq;
|
||||
|
||||
private List<String> freq;
|
||||
}
|
||||
|
||||
@ -14,34 +14,34 @@ import java.util.List;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "抽样计划传输对象")
|
||||
public class QmsSamplePlanDTO extends QmsSamplePlan {
|
||||
|
||||
|
||||
/**
|
||||
* 抽样数
|
||||
*/
|
||||
@ApiModelProperty(value = "抽样数")
|
||||
private BigDecimal sampleSize;
|
||||
|
||||
|
||||
/**
|
||||
* 母体数
|
||||
*/
|
||||
@ApiModelProperty(value = "母体数")
|
||||
private BigDecimal qty;
|
||||
|
||||
|
||||
/**
|
||||
* 允退数
|
||||
*/
|
||||
@ApiModelProperty(value = "允退数")
|
||||
private BigDecimal returnAllowedQty;
|
||||
|
||||
|
||||
/**
|
||||
* samplePlanTypes
|
||||
*/
|
||||
@ApiModelProperty(value = "抽样类型列表")
|
||||
private List<String> samplePlanTypes;
|
||||
|
||||
|
||||
private List<QmsSamplePlanCustomize> customizeList;
|
||||
|
||||
|
||||
private String wafer;
|
||||
|
||||
|
||||
private boolean iqc;
|
||||
}
|
||||
|
||||
@ -9,58 +9,56 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 1916表-抽样代码
|
||||
*
|
||||
* @author paul
|
||||
* @date 2022-12-28 14:28:41
|
||||
* @since 2022-12-28 14:28:41
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_1916_code")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "1916表-抽样代码")
|
||||
public class Qms1916Code extends Model<Qms1916Code> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value="主键")
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String handle;
|
||||
|
||||
|
||||
/**
|
||||
* 最小批量
|
||||
*/
|
||||
@ApiModelProperty(value="最小批量")
|
||||
@ApiModelProperty(value = "最小批量")
|
||||
private Integer lotminqty;
|
||||
|
||||
|
||||
/**
|
||||
* 最大批量
|
||||
*/
|
||||
@ApiModelProperty(value="最大批量")
|
||||
@ApiModelProperty(value = "最大批量")
|
||||
private Integer lotmaxqty;
|
||||
|
||||
|
||||
/**
|
||||
* 检验水平
|
||||
*/
|
||||
@ApiModelProperty(value="检验水平")
|
||||
@ApiModelProperty(value = "检验水平")
|
||||
private String qcLevel;
|
||||
|
||||
|
||||
/**
|
||||
* 检验水平说明
|
||||
*/
|
||||
@ApiModelProperty(value="检验水平说明")
|
||||
@ApiModelProperty(value = "检验水平说明")
|
||||
private String qcLevelDesc;
|
||||
|
||||
|
||||
/**
|
||||
* 检验码
|
||||
*/
|
||||
@ApiModelProperty(value="检验码")
|
||||
@ApiModelProperty(value = "检验码")
|
||||
private String code;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -9,71 +9,70 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 1916表-抽样数
|
||||
*
|
||||
* @author paul
|
||||
* @date 2022-12-28 14:32:12
|
||||
* @since 2022-12-28 14:32:12
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_1916_sample_plan")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "1916表-抽样数")
|
||||
public class Qms1916SamplePlan extends Model<Qms1916SamplePlan> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value="主键")
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String handle;
|
||||
|
||||
|
||||
/**
|
||||
* 检验码
|
||||
*/
|
||||
@ApiModelProperty(value="检验码")
|
||||
@ApiModelProperty(value = "检验码")
|
||||
private String code;
|
||||
|
||||
|
||||
/**
|
||||
* 检验水平
|
||||
*/
|
||||
@ApiModelProperty(value="检验水平")
|
||||
@ApiModelProperty(value = "检验水平")
|
||||
private String qcLevel;
|
||||
|
||||
|
||||
/**
|
||||
* 检验水平说明
|
||||
*/
|
||||
@ApiModelProperty(value="检验水平说明")
|
||||
@ApiModelProperty(value = "检验水平说明")
|
||||
private String qcLevelDesc;
|
||||
|
||||
|
||||
/**
|
||||
* 允收水平
|
||||
*/
|
||||
@ApiModelProperty(value="允收水平")
|
||||
@ApiModelProperty(value = "允收水平")
|
||||
private String allowLevel;
|
||||
|
||||
|
||||
/**
|
||||
* 允收水平说明
|
||||
*/
|
||||
@ApiModelProperty(value="允收水平说明")
|
||||
@ApiModelProperty(value = "允收水平说明")
|
||||
private String allowLevelDesc;
|
||||
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@ApiModelProperty(value="类型")
|
||||
@ApiModelProperty(value = "类型")
|
||||
private String type;
|
||||
|
||||
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
@ApiModelProperty(value="值")
|
||||
@ApiModelProperty(value = "值")
|
||||
private BigDecimal value;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -13,44 +13,50 @@ import lombok.EqualsAndHashCode;
|
||||
* AQL表-抽样代码
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-05 10:56:30
|
||||
* @since 2023-07-05 10:56:30
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_aql_sample_code")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "AQL表-抽样代码")
|
||||
public class QmsAqlSampleCode extends Model<QmsAqlSampleCode> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String KW_QMS_AQL_SAMPLE_CODE_BO = "QmsAqlSampleCodeBO";
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String handle;
|
||||
|
||||
/**
|
||||
* 最小批量
|
||||
*/
|
||||
@ApiModelProperty(value = "最小批量")
|
||||
private Integer lotminqty;
|
||||
|
||||
/**
|
||||
* 最大批量
|
||||
*/
|
||||
@ApiModelProperty(value = "最大批量")
|
||||
private Integer lotmaxqty;
|
||||
|
||||
/**
|
||||
* 检验水平
|
||||
*/
|
||||
@ApiModelProperty(value = "检验水平")
|
||||
private Integer qcLevel;
|
||||
|
||||
/**
|
||||
* 检验水平说明
|
||||
*/
|
||||
@ApiModelProperty(value = "检验水平说明")
|
||||
private String qcLevelDesc;
|
||||
|
||||
/**
|
||||
* 检验码
|
||||
*/
|
||||
|
||||
@ -15,49 +15,56 @@ import java.math.BigDecimal;
|
||||
* AQL表-抽样数
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-05 10:58:38
|
||||
* @since 2023-07-05 10:58:38
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_aql_sample_map")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "AQL表-抽样数")
|
||||
public class QmsAqlSampleMap extends Model<QmsAqlSampleMap> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String KW_QMS_AQL_SAMPLE_MAP_BO = "QmsAqlSampleMapBO";
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String handle;
|
||||
|
||||
/**
|
||||
* allowLevel
|
||||
*/
|
||||
@ApiModelProperty(value = "allowLevel")
|
||||
private Integer allowLevel;
|
||||
|
||||
/**
|
||||
* 检验码
|
||||
*/
|
||||
@ApiModelProperty(value = "检验码")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 抽样比率
|
||||
*/
|
||||
@ApiModelProperty(value = "抽样比率")
|
||||
private BigDecimal samplingRatio;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@ApiModelProperty(value = "类型")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 下一阶检验码
|
||||
*/
|
||||
@ApiModelProperty(value = "下一阶检验码")
|
||||
private String nextCode;
|
||||
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
|
||||
@ -15,58 +15,65 @@ import lombok.EqualsAndHashCode;
|
||||
* 要因主表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-06-07 11:55:53
|
||||
* @since 2023-06-07 11:55:53
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_factor")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "要因主表")
|
||||
public class QmsFactor extends Model<QmsFactor> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String handle;
|
||||
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
@ApiModelProperty(value = "工厂")
|
||||
private String site;
|
||||
|
||||
/**
|
||||
* 要因
|
||||
*/
|
||||
@ApiModelProperty(value = "要因")
|
||||
private String factor;
|
||||
|
||||
/**
|
||||
* 顺序
|
||||
*/
|
||||
@ApiModelProperty(value = "顺序")
|
||||
private String seq;
|
||||
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
@ApiModelProperty(value = "说明")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 输入框类型
|
||||
*/
|
||||
@ApiModelProperty(value = "输入框类型")
|
||||
private String inputMode;
|
||||
|
||||
/**
|
||||
* 数据源
|
||||
*/
|
||||
@ApiModelProperty(value = "数据源")
|
||||
private String dataSource;
|
||||
|
||||
/**
|
||||
* 是否预设
|
||||
*/
|
||||
@ApiModelProperty(value = "是否预设")
|
||||
private String isDefault;
|
||||
|
||||
|
||||
public static String genHandle(String site, String factor) {
|
||||
return HandleBoProcessor.genHandle("FactorBO", site, factor);
|
||||
}
|
||||
|
||||
@ -13,52 +13,59 @@ import lombok.EqualsAndHashCode;
|
||||
* 检验频率现况
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-31 09:28:49
|
||||
* @since 2023-07-31 09:28:49
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_freq_state")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "检验频率现况")
|
||||
public class QmsFreqState extends Model<QmsFreqState> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String sid;
|
||||
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
@ApiModelProperty(value = "工厂")
|
||||
private String site;
|
||||
|
||||
/**
|
||||
* 检验频率
|
||||
*/
|
||||
@ApiModelProperty(value = "检验频率")
|
||||
private String qcFreq;
|
||||
|
||||
/**
|
||||
* 工序主鍵
|
||||
*/
|
||||
@ApiModelProperty(value = "工序主鍵")
|
||||
private String operationBo;
|
||||
|
||||
/**
|
||||
* 设备主键
|
||||
*/
|
||||
@ApiModelProperty(value = "设备主键")
|
||||
private String resourceBo;
|
||||
|
||||
/**
|
||||
* 产品主鍵
|
||||
*/
|
||||
@ApiModelProperty(value = "产品主鍵")
|
||||
private String itemBo;
|
||||
|
||||
/**
|
||||
* 检验计划主鍵
|
||||
*/
|
||||
@ApiModelProperty(value = "检验计划主鍵")
|
||||
private String qcPlanBo;
|
||||
|
||||
/**
|
||||
* 开单指定时间,每日固定时间频率用
|
||||
*/
|
||||
|
||||
@ -8,43 +8,48 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 检验频率-工具
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-25 14:01:42
|
||||
* @since 2023-07-25 14:01:42
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_freq_tools")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "检验频率-工具")
|
||||
public class QmsFreqTools extends Model<QmsFreqTools> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String sid;
|
||||
|
||||
/**
|
||||
* 设备主键
|
||||
*/
|
||||
@ApiModelProperty(value = "设备主键")
|
||||
private String resourceBo;
|
||||
|
||||
/**
|
||||
* 工具主数据主键
|
||||
*/
|
||||
@ApiModelProperty(value = "工具主数据主键")
|
||||
private String toolBasisBo;
|
||||
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private LocalDateTime dateCreate;
|
||||
|
||||
/**
|
||||
* 创建人员
|
||||
*/
|
||||
|
||||
@ -8,53 +8,60 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 检验单单身-附件
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2024-03-12 16:58:15
|
||||
* @since 2024-03-12 16:58:15
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_inspec_attachment")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "检验单单身-附件")
|
||||
public class QmsInspecAttachment extends Model<QmsInspecAttachment> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String sid;
|
||||
|
||||
/**
|
||||
* 检验单主键
|
||||
*/
|
||||
@ApiModelProperty(value = "检验单主键")
|
||||
private String inspecJobBo;
|
||||
|
||||
/**
|
||||
* 检验单单身主键
|
||||
*/
|
||||
@ApiModelProperty(value = "检验单单身主键")
|
||||
private String inspecDetailBo;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@ApiModelProperty(value = "类型")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 文件名
|
||||
*/
|
||||
@ApiModelProperty(value = "文件名")
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private LocalDateTime dateCreate;
|
||||
|
||||
/**
|
||||
* 创建人员
|
||||
*/
|
||||
|
||||
@ -17,111 +17,128 @@ import java.time.LocalDateTime;
|
||||
* 检验任务-明细
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-17 09:27:49
|
||||
* @since 2023-07-17 09:27:49
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_inspec_detail")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "检验任务-明细")
|
||||
public class QmsInspecDetail extends Order<QmsInspecDetail> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String KW_QMS_INSPEC_DETAIL_BO = "InspecDetailBO";
|
||||
|
||||
|
||||
public QmsInspecDetail() {
|
||||
}
|
||||
|
||||
|
||||
public QmsInspecDetail(String inspecJobBo) {
|
||||
this.inspecJobBo = inspecJobBo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String handle;
|
||||
|
||||
/**
|
||||
* 检验任务主表的主键
|
||||
*/
|
||||
@ApiModelProperty(value = "检验任务主表的主键")
|
||||
private String inspecJobBo;
|
||||
|
||||
/**
|
||||
* 顺序
|
||||
*/
|
||||
@ApiModelProperty(value = "顺序")
|
||||
private String seq;
|
||||
|
||||
/**
|
||||
* 检验计划明细主键
|
||||
*/
|
||||
@ApiModelProperty(value = "检验计划明细主键")
|
||||
private String qcPlanDetailBo;
|
||||
|
||||
/**
|
||||
* 抽样数
|
||||
*/
|
||||
@ApiModelProperty(value = "抽样数")
|
||||
private BigDecimal sampleSize;
|
||||
|
||||
/**
|
||||
* 每笔抽N区
|
||||
*/
|
||||
@ApiModelProperty(value = "每笔抽N区")
|
||||
private BigDecimal areaQty;
|
||||
|
||||
/**
|
||||
* 每区抽N点
|
||||
*/
|
||||
@ApiModelProperty(value = "每区抽N点")
|
||||
private BigDecimal dieQty;
|
||||
|
||||
/**
|
||||
* 规格上限
|
||||
*/
|
||||
@ApiModelProperty(value = "规格上限")
|
||||
private BigDecimal maxValue;
|
||||
|
||||
/**
|
||||
* 规格下限
|
||||
*/
|
||||
@ApiModelProperty(value = "规格下限")
|
||||
private BigDecimal minValue;
|
||||
|
||||
/**
|
||||
* 中心
|
||||
*/
|
||||
@ApiModelProperty(value = "中心")
|
||||
private BigDecimal centerValue;
|
||||
|
||||
/**
|
||||
* 内文
|
||||
*/
|
||||
@ApiModelProperty(value = "内文")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 检验人员
|
||||
*/
|
||||
@ApiModelProperty(value = "检验人员")
|
||||
private String inspecUser;
|
||||
|
||||
/**
|
||||
* 检验时间
|
||||
*/
|
||||
@ApiModelProperty(value = "检验时间")
|
||||
private LocalDateTime inspecDateTime;
|
||||
|
||||
/**
|
||||
* 结果
|
||||
*/
|
||||
@ApiModelProperty(value = "结果")
|
||||
private String result;
|
||||
|
||||
/**
|
||||
* 判定结果备注
|
||||
*/
|
||||
@ApiModelProperty(value = "判定结果备注")
|
||||
private String resultRemark;
|
||||
|
||||
/**
|
||||
* 量测结果超规值
|
||||
*/
|
||||
@ApiModelProperty(value = "量测结果超规值")
|
||||
private String oocRemark;
|
||||
|
||||
|
||||
public static String genHandle(String site, String inspecJobBo, String seq) {
|
||||
return HandleBoProcessor.genHandle(KW_QMS_INSPEC_DETAIL_BO, inspecJobBo, seq);
|
||||
}
|
||||
|
||||
@ -13,32 +13,35 @@ import lombok.EqualsAndHashCode;
|
||||
* 检验任务-要因
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-17 09:29:13
|
||||
* @since 2023-07-17 09:29:13
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_inspec_factor")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "检验任务-要因")
|
||||
public class QmsInspecFactor extends Model<QmsInspecFactor> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String sid;
|
||||
|
||||
/**
|
||||
* 检验任务-明细主键
|
||||
*/
|
||||
@ApiModelProperty(value = "检验任务-明细主键")
|
||||
private String inspecDetailBo;
|
||||
|
||||
/**
|
||||
* 要因主键
|
||||
*/
|
||||
@ApiModelProperty(value = "要因主键")
|
||||
private String factorBo;
|
||||
|
||||
/**
|
||||
* 要因值
|
||||
*/
|
||||
|
||||
@ -17,135 +17,158 @@ import java.time.LocalDateTime;
|
||||
* 检验频率表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-06 09:12:51
|
||||
* @since 2023-07-06 09:12:51
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_inspec_freq")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "检验频率表")
|
||||
public class QmsInspecFreq extends Model<QmsInspecFreq> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String KW_QMS_INSPEC_FREQ_BO = "InspecFreqBO";
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String handle;
|
||||
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
@ApiModelProperty(value = "工厂")
|
||||
private String site;
|
||||
|
||||
/**
|
||||
* 检验类型
|
||||
*/
|
||||
@ApiModelProperty(value = "检验类型")
|
||||
private String inspecType;
|
||||
|
||||
/**
|
||||
* 检验频率编号
|
||||
*/
|
||||
@ApiModelProperty(value = "检验频率编号")
|
||||
private String inspecNo;
|
||||
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
@ApiModelProperty(value = "说明")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 工单第一个生产的生产批
|
||||
*/
|
||||
@ApiModelProperty(value = "工单第一个生产的生产批")
|
||||
private String chkFirstSfc;
|
||||
|
||||
/**
|
||||
* 每日第一个生产的生产批
|
||||
*/
|
||||
@ApiModelProperty(value = "每日第一个生产的生产批")
|
||||
private String chkDailyFirstSfc;
|
||||
|
||||
/**
|
||||
* 每日起始時間
|
||||
*/
|
||||
@ApiModelProperty(value = "每日起始時間")
|
||||
private String dailyFirstSfc;
|
||||
|
||||
/**
|
||||
* 更换产品后第一个生产的生产批
|
||||
*/
|
||||
@ApiModelProperty(value = "更换产品后第一个生产的生产批")
|
||||
private String chkChangeProduct;
|
||||
|
||||
/**
|
||||
* 设备换工具后第一个生产的生产批
|
||||
*/
|
||||
@ApiModelProperty(value = "设备换工具后第一个生产的生产批")
|
||||
private String chkChangeMould;
|
||||
|
||||
/**
|
||||
* 设备维修后第一个生产的生产批
|
||||
*/
|
||||
@ApiModelProperty(value = "设备维修后第一个生产的生产批")
|
||||
private String chkMaintenFirstSfc;
|
||||
|
||||
/**
|
||||
* 设备停机N小时以上, 生產的第一个生产批
|
||||
*/
|
||||
@ApiModelProperty(value = "设备停机N小时以上, 生產的第一个生产批")
|
||||
private String chkStopAfterSfc;
|
||||
|
||||
/**
|
||||
* 停机小时数
|
||||
*/
|
||||
@ApiModelProperty(value = "停机小时数")
|
||||
private BigDecimal stopAfterSfc;
|
||||
|
||||
/**
|
||||
* 生产单一产品每N小时
|
||||
*/
|
||||
@ApiModelProperty(value = "生产单一产品每N小时")
|
||||
private String chkIntervalHour;
|
||||
|
||||
/**
|
||||
* 间隔小时数
|
||||
*/
|
||||
@ApiModelProperty(value = "间隔小时数")
|
||||
private BigDecimal intervalHour;
|
||||
|
||||
/**
|
||||
* 每N个生产批
|
||||
*/
|
||||
@ApiModelProperty(value = "每N个生产批")
|
||||
private String chkSeveralSfc;
|
||||
|
||||
/**
|
||||
* 生产批批数
|
||||
*/
|
||||
@ApiModelProperty(value = "生产批批数")
|
||||
private Integer severalSfc;
|
||||
|
||||
/**
|
||||
* 机台生产每N小时
|
||||
*/
|
||||
@ApiModelProperty(value = "机台生产每N小时")
|
||||
private String chkIntervalHour2;
|
||||
|
||||
/**
|
||||
* 间隔小时数
|
||||
*/
|
||||
@ApiModelProperty(value = "间隔小时数")
|
||||
private BigDecimal intervalHour2;
|
||||
|
||||
/**
|
||||
* 每日固定N点
|
||||
*/
|
||||
@ApiModelProperty(value = "每日固定N点")
|
||||
private String chkDailyFixedTime;
|
||||
|
||||
/**
|
||||
* 每日固定N点
|
||||
*/
|
||||
@ApiModelProperty(value = "每日固定N点")
|
||||
private String dailyFixedTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private LocalDateTime modifiedDateTime;
|
||||
|
||||
/**
|
||||
* 修改人员
|
||||
*/
|
||||
@ApiModelProperty(value = "修改人员")
|
||||
private String modifiedUser;
|
||||
|
||||
|
||||
public static String genHandle(String site, String inspecNo) {
|
||||
return HandleBoProcessor.genHandle(KW_QMS_INSPEC_FREQ_BO, site, inspecNo);
|
||||
}
|
||||
|
||||
@ -17,186 +17,212 @@ import java.time.LocalDateTime;
|
||||
* 检验任务-主表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-17 09:26:41
|
||||
* @since 2023-07-17 09:26:41
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_inspec_job")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "检验任务-主表")
|
||||
public class QmsInspecJob extends Model<QmsInspecJob> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String KW_QMS_INSPEC_JOB_BO = "InspecJobBO";
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String handle;
|
||||
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
@ApiModelProperty(value = "工厂")
|
||||
private String site;
|
||||
|
||||
/**
|
||||
* 检验类型
|
||||
*/
|
||||
@ApiModelProperty(value = "检验类型")
|
||||
private String inspecType;
|
||||
|
||||
/**
|
||||
* 检验任务编号
|
||||
*/
|
||||
@ApiModelProperty(value = "检验任务编号")
|
||||
private String jobNo;
|
||||
|
||||
/**
|
||||
* 检验对象主键
|
||||
*/
|
||||
@ApiModelProperty(value = "检验对象主键")
|
||||
private String targetBo;
|
||||
|
||||
/**
|
||||
* 工序主键
|
||||
*/
|
||||
@ApiModelProperty(value = "工序主键")
|
||||
private String operationBo;
|
||||
|
||||
/**
|
||||
* 设备主键
|
||||
*/
|
||||
@ApiModelProperty(value = "设备主键")
|
||||
private String resourceBo;
|
||||
|
||||
/**
|
||||
* 检验计划主键
|
||||
*/
|
||||
@ApiModelProperty(value = "检验计划主键")
|
||||
private String qcPlanBo;
|
||||
|
||||
/**
|
||||
* 检验人员群组
|
||||
*/
|
||||
@ApiModelProperty(value = "检验人员群组")
|
||||
private String userGroup;
|
||||
|
||||
/**
|
||||
* 检验频率主键
|
||||
*/
|
||||
@ApiModelProperty(value = "检验频率主键")
|
||||
private String inspecFreqBo;
|
||||
|
||||
/**
|
||||
* 开单频率
|
||||
*/
|
||||
@ApiModelProperty(value = "开单频率")
|
||||
private String qcFreq;
|
||||
|
||||
/**
|
||||
* 母体数
|
||||
*/
|
||||
@ApiModelProperty(value = "母体数")
|
||||
private BigDecimal populationQty;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@ApiModelProperty(value = "状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 创建人员
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人员")
|
||||
private String creator;
|
||||
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private LocalDateTime dateCreate;
|
||||
|
||||
/**
|
||||
* 更新人员
|
||||
*/
|
||||
@ApiModelProperty(value = "更新人员")
|
||||
private String updater;
|
||||
|
||||
/**
|
||||
* 更新日期
|
||||
*/
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private LocalDateTime dateUpdate;
|
||||
|
||||
/**
|
||||
* 完成/关闭人员
|
||||
*/
|
||||
@ApiModelProperty(value = "完成/关闭人员")
|
||||
private String completeUser;
|
||||
|
||||
/**
|
||||
* 完成/关闭时间
|
||||
*/
|
||||
@ApiModelProperty(value = "完成/关闭时间")
|
||||
private LocalDateTime completeDateTime;
|
||||
|
||||
/**
|
||||
* 判定人员
|
||||
*/
|
||||
@ApiModelProperty(value = "判定人员")
|
||||
private String judgeUser;
|
||||
|
||||
/**
|
||||
* 判定时间
|
||||
*/
|
||||
@ApiModelProperty(value = "判定时间")
|
||||
private LocalDateTime judgeDateTime;
|
||||
|
||||
/**
|
||||
* 判定结果
|
||||
*/
|
||||
@ApiModelProperty(value = "判定结果")
|
||||
private String result;
|
||||
|
||||
/**
|
||||
* 异常单群组
|
||||
*/
|
||||
@ApiModelProperty(value = "异常单群组")
|
||||
private String abnGroup;
|
||||
|
||||
/**
|
||||
* 原因代码主键
|
||||
*/
|
||||
@ApiModelProperty(value = "原因代码主键")
|
||||
private String reasonCodeBo;
|
||||
|
||||
/**
|
||||
* 完成/关闭备注
|
||||
*/
|
||||
@ApiModelProperty(value = "完成/关闭备注")
|
||||
private String completeRemark;
|
||||
|
||||
/**
|
||||
* 判定备注
|
||||
*/
|
||||
@ApiModelProperty(value = "判定备注")
|
||||
private String judgeRemark;
|
||||
|
||||
|
||||
/**
|
||||
* 入库数量
|
||||
*/
|
||||
@ApiModelProperty(value="入库数量")
|
||||
@ApiModelProperty(value = "入库数量")
|
||||
private BigDecimal storageQty;
|
||||
|
||||
|
||||
/**
|
||||
* 特采数量
|
||||
*/
|
||||
@ApiModelProperty(value="特采数量")
|
||||
@ApiModelProperty(value = "特采数量")
|
||||
private BigDecimal waiverQty;
|
||||
|
||||
|
||||
/**
|
||||
* 退回数量
|
||||
*/
|
||||
@ApiModelProperty(value="退回数量")
|
||||
@ApiModelProperty(value = "退回数量")
|
||||
private BigDecimal returnQty;
|
||||
|
||||
|
||||
/**
|
||||
* 破坏数量
|
||||
*/
|
||||
@ApiModelProperty(value="破坏数量")
|
||||
@ApiModelProperty(value = "破坏数量")
|
||||
private BigDecimal destructiveQty;
|
||||
|
||||
|
||||
/**
|
||||
* 留样数量
|
||||
*/
|
||||
@ApiModelProperty(value="留样数量")
|
||||
@ApiModelProperty(value = "留样数量")
|
||||
private BigDecimal testsampleQty;
|
||||
|
||||
|
||||
/**
|
||||
* 原检验任务编号
|
||||
*/
|
||||
@ApiModelProperty(value="原检验任务编号")
|
||||
@ApiModelProperty(value = "原检验任务编号")
|
||||
private String originalJobNo;
|
||||
|
||||
|
||||
public static String genHandle(String site, String jobNo) {
|
||||
return HandleBoProcessor.genHandle(KW_QMS_INSPEC_JOB_BO, site, jobNo);
|
||||
}
|
||||
|
||||
@ -16,58 +16,65 @@ import java.math.BigDecimal;
|
||||
* 检验任务-检验结果
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-17 09:31:34
|
||||
* @since 2023-07-17 09:31:34
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_inspec_result")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "检验任务-检验结果")
|
||||
public class QmsInspecResult extends Model<QmsInspecResult> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String sid;
|
||||
|
||||
/**
|
||||
* 检验任务-明细的主键
|
||||
*/
|
||||
@ApiModelProperty(value = "检验任务-明细的主键")
|
||||
private String inspecDetailBo;
|
||||
|
||||
/**
|
||||
* 顺序
|
||||
*/
|
||||
@ApiModelProperty(value = "顺序")
|
||||
private String seq;
|
||||
|
||||
/**
|
||||
* 区域
|
||||
*/
|
||||
@ApiModelProperty(value = "区域")
|
||||
private Integer area;
|
||||
|
||||
/**
|
||||
* 点
|
||||
*/
|
||||
@ApiModelProperty(value = "点")
|
||||
private Integer series;
|
||||
|
||||
/**
|
||||
* 检验结果(值)
|
||||
*/
|
||||
@ApiModelProperty(value = "检验结果(值)")
|
||||
private BigDecimal result;
|
||||
|
||||
/**
|
||||
* 内文
|
||||
*/
|
||||
@ApiModelProperty(value = "内文")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String memo;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer sequence;
|
||||
}
|
||||
|
||||
@ -13,32 +13,35 @@ import lombok.EqualsAndHashCode;
|
||||
* 检验任务-不合格代码
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-17 09:32:45
|
||||
* @since 2023-07-17 09:32:45
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_inspec_result_nccode")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "检验任务-不合格代码")
|
||||
public class QmsInspecResultNccode extends Model<QmsInspecResultNccode> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String sid;
|
||||
|
||||
/**
|
||||
* 检验任务-检验结果的主鍵
|
||||
*/
|
||||
@ApiModelProperty(value = "检验任务-检验结果的主鍵")
|
||||
private String inspecResultSid;
|
||||
|
||||
/**
|
||||
* 顺序
|
||||
*/
|
||||
@ApiModelProperty(value = "顺序")
|
||||
private String seq;
|
||||
|
||||
/**
|
||||
* 不合格代码主键
|
||||
*/
|
||||
|
||||
@ -8,48 +8,54 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 检验任务-SN
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-17 09:30:31
|
||||
* @since 2023-07-17 09:30:31
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_inspec_sn")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "检验任务-SN")
|
||||
public class QmsInspecSn extends Model<QmsInspecSn> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String sid;
|
||||
|
||||
/**
|
||||
* 检验任务-明细主键
|
||||
*/
|
||||
@ApiModelProperty(value = "检验任务-明细主键")
|
||||
private String inspecDetailBo;
|
||||
|
||||
/**
|
||||
* 顺序
|
||||
*/
|
||||
@ApiModelProperty(value = "顺序")
|
||||
private String seq;
|
||||
|
||||
/**
|
||||
* SN
|
||||
*/
|
||||
@ApiModelProperty(value = "SN")
|
||||
private String sn;
|
||||
|
||||
/**
|
||||
* 创建人员
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人员")
|
||||
private String creator;
|
||||
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
|
||||
@ -9,88 +9,88 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 产品检验计划表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-06-06 16:41:41
|
||||
* @since 2023-06-06 16:41:41
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_prod_qc_plan")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "产品检验计划表")
|
||||
public class QmsProdQcPlan extends Model<QmsProdQcPlan> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value="主键")
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String sid;
|
||||
|
||||
|
||||
/**
|
||||
* 生产点
|
||||
*/
|
||||
@ApiModelProperty(value="生产点")
|
||||
@ApiModelProperty(value = "生产点")
|
||||
private String site;
|
||||
|
||||
|
||||
/**
|
||||
* 生产产品
|
||||
*/
|
||||
@ApiModelProperty(value="生产产品")
|
||||
@ApiModelProperty(value = "生产产品")
|
||||
private String item;
|
||||
|
||||
|
||||
/**
|
||||
* 工作中心
|
||||
*/
|
||||
@ApiModelProperty(value="工作中心")
|
||||
@ApiModelProperty(value = "工作中心")
|
||||
private String workCenter;
|
||||
|
||||
|
||||
/**
|
||||
* 作业站
|
||||
*/
|
||||
@ApiModelProperty(value="作业站")
|
||||
@ApiModelProperty(value = "作业站")
|
||||
private String operation;
|
||||
|
||||
|
||||
/**
|
||||
* 资源
|
||||
*/
|
||||
@ApiModelProperty(value="资源")
|
||||
@ApiModelProperty(value = "资源")
|
||||
private String resrce;
|
||||
|
||||
|
||||
/**
|
||||
* 检验计划
|
||||
*/
|
||||
@ApiModelProperty(value="检验计划")
|
||||
@ApiModelProperty(value = "检验计划")
|
||||
private String qcPlan;
|
||||
|
||||
|
||||
/**
|
||||
* 版本
|
||||
*/
|
||||
@ApiModelProperty(value="版本")
|
||||
@ApiModelProperty(value = "版本")
|
||||
private String qcPlanRevision;
|
||||
|
||||
|
||||
/**
|
||||
* 建立人
|
||||
*/
|
||||
@ApiModelProperty(value="建立人")
|
||||
@ApiModelProperty(value = "建立人")
|
||||
private String createdUser;
|
||||
|
||||
|
||||
/**
|
||||
* 建立日期
|
||||
*/
|
||||
@ApiModelProperty(value="建立日期")
|
||||
@ApiModelProperty(value = "建立日期")
|
||||
private LocalDateTime createdDateTime;
|
||||
|
||||
|
||||
/**
|
||||
* IQC 物料
|
||||
*/
|
||||
@ApiModelProperty(value="IQC 物料")
|
||||
@ApiModelProperty(value = "IQC 物料")
|
||||
private String materialNo;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -19,107 +19,124 @@ import java.util.List;
|
||||
* 检验项目表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-11 11:36:25
|
||||
* @since 2023-07-11 11:36:25
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_qc_item")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "检验项目表")
|
||||
public class QmsQcItem extends Model<QmsQcItem> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String KW_QMS_QC_ITEM_BO = "QcItemBO";
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String handle;
|
||||
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
@ApiModelProperty(value = "工厂")
|
||||
private String site;
|
||||
|
||||
/**
|
||||
* 检验类型
|
||||
*/
|
||||
@ApiModelProperty(value = "检验类型")
|
||||
private String inspecType;
|
||||
|
||||
/**
|
||||
* 检验项目编号
|
||||
*/
|
||||
@ApiModelProperty(value = "检验项目编号")
|
||||
private String qcItem;
|
||||
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
@ApiModelProperty(value = "说明")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 品管方式
|
||||
*/
|
||||
@ApiModelProperty(value = "品管方式")
|
||||
private String itemType;
|
||||
|
||||
/**
|
||||
* 仪器类型
|
||||
*/
|
||||
@ApiModelProperty(value = "仪器类型")
|
||||
private String eqpCategoryBo;
|
||||
|
||||
/**
|
||||
* 检测说明
|
||||
*/
|
||||
@ApiModelProperty(value = "检测说明")
|
||||
private String qcDescription;
|
||||
|
||||
/**
|
||||
* 计量单位
|
||||
*/
|
||||
@ApiModelProperty(value = "计量单位")
|
||||
private String units;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@ApiModelProperty(value = "状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 规格管控
|
||||
*/
|
||||
@ApiModelProperty(value = "规格管控")
|
||||
private String controlMode;
|
||||
|
||||
/**
|
||||
* 管制图
|
||||
*/
|
||||
@ApiModelProperty(value = "管制图")
|
||||
private String chartControl;
|
||||
|
||||
/**
|
||||
* 样本数
|
||||
*/
|
||||
@ApiModelProperty(value = "样本数")
|
||||
private BigDecimal sampleSize;
|
||||
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private LocalDateTime dateCreate;
|
||||
|
||||
/**
|
||||
* 更新日期
|
||||
*/
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private LocalDateTime dateUpdate;
|
||||
|
||||
/**
|
||||
* 创建人员
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人员")
|
||||
private String creator;
|
||||
|
||||
/**
|
||||
* 更新人员
|
||||
*/
|
||||
@ApiModelProperty(value = "更新人员")
|
||||
private String updater;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<QmsQcItemFactor> factors;
|
||||
|
||||
|
||||
public static String genHandle(String site, String qcItem) {
|
||||
return HandleBoProcessor.genHandle(KW_QMS_QC_ITEM_BO, site, qcItem);
|
||||
}
|
||||
|
||||
@ -14,34 +14,37 @@ import lombok.EqualsAndHashCode;
|
||||
* 检验项目要因表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-11 11:38:01
|
||||
* @since 2023-07-11 11:38:01
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_qc_item_factor")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "检验项目要因表")
|
||||
public class QmsQcItemFactor extends Model<QmsQcItemFactor> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String KW_QMS_QC_ITEM_FACTOR_BO = "QcItemFactorBO";
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String handle;
|
||||
|
||||
/**
|
||||
* 检验项目主键
|
||||
*/
|
||||
@ApiModelProperty(value = "检验项目主键")
|
||||
private String qcItemBo;
|
||||
|
||||
/**
|
||||
* 要因主键
|
||||
*/
|
||||
@ApiModelProperty(value = "要因主键")
|
||||
private String factorBo;
|
||||
|
||||
|
||||
public static String genHandle(String site, String qcItemBo, String factorBo) {
|
||||
return HandleBoProcessor.genHandle(KW_QMS_QC_ITEM_FACTOR_BO, site, qcItemBo, factorBo);
|
||||
}
|
||||
|
||||
@ -38,128 +38,130 @@ import java.util.List;
|
||||
* 检验计划
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-11 16:28:57
|
||||
* @since 2023-07-11 16:28:57
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_qc_plan")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "检验计划")
|
||||
public class QmsQcPlan extends Model<QmsQcPlan> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String KW_QMS_QC_PLAN_BO = "QcPlanBO";
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String handle;
|
||||
|
||||
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
@ApiModelProperty(value = "工厂")
|
||||
private String site;
|
||||
|
||||
|
||||
/**
|
||||
* 检验计划
|
||||
*/
|
||||
@ApiModelProperty(value = "检验计划")
|
||||
private String qcPlan;
|
||||
|
||||
|
||||
/**
|
||||
* 版本
|
||||
*/
|
||||
@ApiModelProperty(value = "版本")
|
||||
private String revision;
|
||||
|
||||
|
||||
/**
|
||||
* 当前版本
|
||||
*/
|
||||
@ApiModelProperty(value = "当前版本")
|
||||
private String currentRevision;
|
||||
|
||||
|
||||
/**
|
||||
* 检验计划说明
|
||||
*/
|
||||
@ApiModelProperty(value = "检验计划说明")
|
||||
private String description;
|
||||
|
||||
|
||||
/**
|
||||
* 检验类型
|
||||
*/
|
||||
@ApiModelProperty(value = "检验类型")
|
||||
private String inspecType;
|
||||
|
||||
|
||||
/**
|
||||
* 检验频率主键
|
||||
*/
|
||||
@ApiModelProperty(value = "检验频率主键")
|
||||
private String inspecFreqBo;
|
||||
|
||||
|
||||
/**
|
||||
* 检验人员群组
|
||||
*/
|
||||
@ApiModelProperty(value = "检验人员群组")
|
||||
private String userGroup;
|
||||
|
||||
|
||||
/**
|
||||
* 抛送至SPC
|
||||
*/
|
||||
@ApiModelProperty(value = "抛送至SPC")
|
||||
private String toSpc;
|
||||
|
||||
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private LocalDateTime dateCreate;
|
||||
|
||||
|
||||
/**
|
||||
* 更新日期
|
||||
*/
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private LocalDateTime dateUpdate;
|
||||
|
||||
|
||||
/**
|
||||
* 创建人员
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人员")
|
||||
private String creator;
|
||||
|
||||
|
||||
/**
|
||||
* 更新人员
|
||||
*/
|
||||
@ApiModelProperty(value = "更新人员")
|
||||
private String updater;
|
||||
|
||||
|
||||
/**
|
||||
* 校验类型
|
||||
*/
|
||||
@ApiModelProperty(value = "校验类型")
|
||||
private String calibrationType;
|
||||
|
||||
|
||||
/**
|
||||
* 校验频率
|
||||
*/
|
||||
@ApiModelProperty(value = "校验频率")
|
||||
private String calibrationFreq;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private String inspecFreqNo;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private String inspecFreqDesc;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private boolean createdJob;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<QmsQcPlanDetailDTO> qcPlanDetailList;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<CustomValue> customFields;
|
||||
|
||||
|
||||
public static String genHandle(String site, String qcPlan, String revision) {
|
||||
return HandleBoProcessor.genHandle(KW_QMS_QC_PLAN_BO, site, qcPlan, revision);
|
||||
}
|
||||
|
||||
@ -27,85 +27,86 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 检验计划明细表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-11 16:30:35
|
||||
* @since 2023-07-11 16:30:35
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_qc_plan_detail")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "检验计划明细表")
|
||||
public class QmsQcPlanDetail extends Model<QmsQcPlanDetail> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String KW_QMS_QC_PLAN_DETAIL_BO = "QcPlanDetailBO";
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value="主键")
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String handle;
|
||||
|
||||
|
||||
/**
|
||||
* 检验计划主表主键
|
||||
*/
|
||||
@ApiModelProperty(value="检验计划主表主键")
|
||||
@ApiModelProperty(value = "检验计划主表主键")
|
||||
private String qcPlanBo;
|
||||
|
||||
|
||||
/**
|
||||
* 顺序
|
||||
*/
|
||||
@ApiModelProperty(value="顺序")
|
||||
@ApiModelProperty(value = "顺序")
|
||||
private String seq;
|
||||
|
||||
|
||||
/**
|
||||
* 检验项目主键
|
||||
*/
|
||||
@ApiModelProperty(value="检验项目主键")
|
||||
@ApiModelProperty(value = "检验项目主键")
|
||||
private String qcItemBo;
|
||||
|
||||
|
||||
/**
|
||||
* 抽样计划主键
|
||||
*/
|
||||
@ApiModelProperty(value="抽样计划主键")
|
||||
@ApiModelProperty(value = "抽样计划主键")
|
||||
private String samplePlanBo;
|
||||
|
||||
|
||||
/**
|
||||
* 规格上限
|
||||
*/
|
||||
@ApiModelProperty(value="规格上限")
|
||||
@ApiModelProperty(value = "规格上限")
|
||||
private BigDecimal maxValue;
|
||||
|
||||
|
||||
/**
|
||||
* 规格下限
|
||||
*/
|
||||
@ApiModelProperty(value="规格下限")
|
||||
@ApiModelProperty(value = "规格下限")
|
||||
private BigDecimal minValue;
|
||||
|
||||
|
||||
/**
|
||||
* 中心
|
||||
*/
|
||||
@ApiModelProperty(value="中心")
|
||||
@ApiModelProperty(value = "中心")
|
||||
private BigDecimal centerValue;
|
||||
|
||||
|
||||
/**
|
||||
* 内文
|
||||
*/
|
||||
@ApiModelProperty(value="内文")
|
||||
@ApiModelProperty(value = "内文")
|
||||
private String content;
|
||||
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty(value="备注")
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
public static String genHandle(String qcPlanBo, String qcItemBo) {
|
||||
return HandleBoProcessor.genHandle(KW_QMS_QC_PLAN_DETAIL_BO, qcPlanBo, qcItemBo);
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ import java.time.LocalDateTime;
|
||||
* 检验计划使用对象
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-12 11:23:14
|
||||
* @since 2023-07-12 11:23:14
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_qc_plan_target")
|
||||
@ -26,71 +26,72 @@ import java.time.LocalDateTime;
|
||||
@ApiModel(value = "检验计划使用对象")
|
||||
@NoArgsConstructor
|
||||
public class QmsQcPlanTarget extends Model<QmsQcPlanTarget> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String KW_QMS_QC_PLAN_TARGET_BO = "QcPlanTargetBO";
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value="主键")
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String handle;
|
||||
|
||||
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
@ApiModelProperty(value="工厂")
|
||||
@ApiModelProperty(value = "工厂")
|
||||
private String site;
|
||||
|
||||
|
||||
/**
|
||||
* 检验计划编号
|
||||
*/
|
||||
@ApiModelProperty(value="检验计划编号")
|
||||
@ApiModelProperty(value = "检验计划编号")
|
||||
private String qcPlan;
|
||||
|
||||
|
||||
/**
|
||||
* 顺序
|
||||
*/
|
||||
@ApiModelProperty(value="顺序")
|
||||
@ApiModelProperty(value = "顺序")
|
||||
private String seq;
|
||||
|
||||
|
||||
/**
|
||||
* 使用对象的主键
|
||||
*/
|
||||
@ApiModelProperty(value="使用对象的主键")
|
||||
@ApiModelProperty(value = "使用对象的主键")
|
||||
private String targetBo;
|
||||
|
||||
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@ApiModelProperty(value="创建日期")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private LocalDateTime dateCreate;
|
||||
|
||||
|
||||
/**
|
||||
* 更新日期
|
||||
*/
|
||||
@ApiModelProperty(value="更新日期")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private LocalDateTime dateUpdate;
|
||||
|
||||
|
||||
/**
|
||||
* 创建人员
|
||||
*/
|
||||
@ApiModelProperty(value="创建人员")
|
||||
@ApiModelProperty(value = "创建人员")
|
||||
private String creator;
|
||||
|
||||
|
||||
/**
|
||||
* 更新人员
|
||||
*/
|
||||
@ApiModelProperty(value="更新人员")
|
||||
@ApiModelProperty(value = "更新人员")
|
||||
private String updater;
|
||||
|
||||
|
||||
/**
|
||||
* 检验等级
|
||||
*/
|
||||
@ApiModelProperty(value="检验等级")
|
||||
@ApiModelProperty(value = "检验等级")
|
||||
private String inspectLevel = "0";
|
||||
|
||||
|
||||
public static String genHandle(String site, String qcPlan, String targetBo, String inspectLevel) {
|
||||
return HandleBoProcessor.genHandle(KW_QMS_QC_PLAN_TARGET_BO, site, qcPlan, targetBo, inspectLevel);
|
||||
}
|
||||
|
||||
@ -17,105 +17,122 @@ import java.time.LocalDateTime;
|
||||
* 抽样计划主表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2022-12-27 11:42:02
|
||||
* @since 2022-12-27 11:42:02
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_sample_plan")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "抽样计划主表")
|
||||
public class QmsSamplePlan extends Model<QmsSamplePlan> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
public static final String KW_QMS_SAMPLE_PLAN_BO = "SamplePlanBO";
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String handle;
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
@ApiModelProperty(value = "工厂")
|
||||
private String site;
|
||||
/**
|
||||
* 抽样计划
|
||||
*/
|
||||
@ApiModelProperty(value = "抽样计划")
|
||||
private String samplePlan;
|
||||
/**
|
||||
* 抽样计划名称
|
||||
*/
|
||||
@ApiModelProperty(value = "抽样计划名称")
|
||||
private String description;
|
||||
/**
|
||||
* 抽样类型
|
||||
*/
|
||||
@ApiModelProperty(value = "抽样类型")
|
||||
private String samplePlanType;
|
||||
/**
|
||||
* 固定抽样数
|
||||
*/
|
||||
@ApiModelProperty(value = "固定抽样数")
|
||||
private BigDecimal fixedNumber;
|
||||
/**
|
||||
* 固定百分比
|
||||
*/
|
||||
@ApiModelProperty(value = "固定百分比")
|
||||
private BigDecimal fixedPercentage;
|
||||
/**
|
||||
* 检验水平
|
||||
*/
|
||||
@ApiModelProperty(value = "检验水平")
|
||||
private String qcLevel;
|
||||
/**
|
||||
* 允收水平
|
||||
*/
|
||||
@ApiModelProperty(value = "允收水平")
|
||||
private String allowLevel;
|
||||
/**
|
||||
* 抽样比率
|
||||
*/
|
||||
@ApiModelProperty(value = "抽样比率")
|
||||
private BigDecimal sampleRatio;
|
||||
/**
|
||||
* 建立人
|
||||
*/
|
||||
@ApiModelProperty(value = "建立人")
|
||||
private String createdUser;
|
||||
/**
|
||||
* 建立日期
|
||||
*/
|
||||
@ApiModelProperty(value = "建立日期")
|
||||
private LocalDateTime createdDateTime;
|
||||
/**
|
||||
* 判退模式
|
||||
*/
|
||||
@ApiModelProperty(value = "判退模式")
|
||||
private String judgeMode;
|
||||
/**
|
||||
* kind
|
||||
*/
|
||||
@ApiModelProperty(value = "kind")
|
||||
private String kind;
|
||||
/**
|
||||
* 每片抽N區
|
||||
*/
|
||||
@ApiModelProperty(value = "每片抽N區")
|
||||
private BigDecimal areaQty;
|
||||
/**
|
||||
* 每區抽N個die
|
||||
*/
|
||||
@ApiModelProperty(value = "每區抽N個die")
|
||||
private BigDecimal dieQty;
|
||||
/**
|
||||
* areaInfo
|
||||
*/
|
||||
@ApiModelProperty(value = "areaInfo")
|
||||
private String areaInfo;
|
||||
|
||||
public static String genHandle( String site, String samplePlan ) {
|
||||
return HandleBoProcessor.genHandle(KW_QMS_SAMPLE_PLAN_BO, site, samplePlan);
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String KW_QMS_SAMPLE_PLAN_BO = "SamplePlanBO";
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String handle;
|
||||
|
||||
/**
|
||||
* 工厂
|
||||
*/
|
||||
@ApiModelProperty(value = "工厂")
|
||||
private String site;
|
||||
|
||||
/**
|
||||
* 抽样计划
|
||||
*/
|
||||
@ApiModelProperty(value = "抽样计划")
|
||||
private String samplePlan;
|
||||
|
||||
/**
|
||||
* 抽样计划名称
|
||||
*/
|
||||
@ApiModelProperty(value = "抽样计划名称")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 抽样类型
|
||||
*/
|
||||
@ApiModelProperty(value = "抽样类型")
|
||||
private String samplePlanType;
|
||||
|
||||
/**
|
||||
* 固定抽样数
|
||||
*/
|
||||
@ApiModelProperty(value = "固定抽样数")
|
||||
private BigDecimal fixedNumber;
|
||||
|
||||
/**
|
||||
* 固定百分比
|
||||
*/
|
||||
@ApiModelProperty(value = "固定百分比")
|
||||
private BigDecimal fixedPercentage;
|
||||
|
||||
/**
|
||||
* 检验水平
|
||||
*/
|
||||
@ApiModelProperty(value = "检验水平")
|
||||
private String qcLevel;
|
||||
|
||||
/**
|
||||
* 允收水平
|
||||
*/
|
||||
@ApiModelProperty(value = "允收水平")
|
||||
private String allowLevel;
|
||||
|
||||
/**
|
||||
* 抽样比率
|
||||
*/
|
||||
@ApiModelProperty(value = "抽样比率")
|
||||
private BigDecimal sampleRatio;
|
||||
|
||||
/**
|
||||
* 建立人
|
||||
*/
|
||||
@ApiModelProperty(value = "建立人")
|
||||
private String createdUser;
|
||||
|
||||
/**
|
||||
* 建立日期
|
||||
*/
|
||||
@ApiModelProperty(value = "建立日期")
|
||||
private LocalDateTime createdDateTime;
|
||||
|
||||
/**
|
||||
* 判退模式
|
||||
*/
|
||||
@ApiModelProperty(value = "判退模式")
|
||||
private String judgeMode;
|
||||
|
||||
/**
|
||||
* kind
|
||||
*/
|
||||
@ApiModelProperty(value = "kind")
|
||||
private String kind;
|
||||
|
||||
/**
|
||||
* 每片抽N區
|
||||
*/
|
||||
@ApiModelProperty(value = "每片抽N區")
|
||||
private BigDecimal areaQty;
|
||||
|
||||
/**
|
||||
* 每區抽N個die
|
||||
*/
|
||||
@ApiModelProperty(value = "每區抽N個die")
|
||||
private BigDecimal dieQty;
|
||||
|
||||
/**
|
||||
* areaInfo
|
||||
*/
|
||||
@ApiModelProperty(value = "areaInfo")
|
||||
private String areaInfo;
|
||||
|
||||
public static String genHandle(String site, String samplePlan) {
|
||||
return HandleBoProcessor.genHandle(KW_QMS_SAMPLE_PLAN_BO, site, samplePlan);
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,64 +9,62 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 抽样计划主表自定义
|
||||
*
|
||||
* @author paul
|
||||
* @date 2022-12-28 14:42:35
|
||||
* @since 2022-12-28 14:42:35
|
||||
*/
|
||||
@Data
|
||||
@TableName("qms_sample_plan_customize")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "抽样计划主表自定义")
|
||||
public class QmsSamplePlanCustomize extends Model<QmsSamplePlanCustomize> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value="主键")
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String sid;
|
||||
|
||||
|
||||
/**
|
||||
* 生产点
|
||||
*/
|
||||
@ApiModelProperty(value="生产点")
|
||||
@ApiModelProperty(value = "生产点")
|
||||
private String site;
|
||||
|
||||
|
||||
/**
|
||||
* 抽样计划主表的Handle
|
||||
*/
|
||||
@ApiModelProperty(value="抽样计划主表的Handle")
|
||||
@ApiModelProperty(value = "抽样计划主表的Handle")
|
||||
private String samplePlanBo;
|
||||
|
||||
|
||||
/**
|
||||
* 序号
|
||||
*/
|
||||
@ApiModelProperty(value="序号")
|
||||
@ApiModelProperty(value = "序号")
|
||||
private String seq;
|
||||
|
||||
|
||||
/**
|
||||
* 最小值
|
||||
*/
|
||||
@ApiModelProperty(value="最小值")
|
||||
@ApiModelProperty(value = "最小值")
|
||||
private Integer minValue;
|
||||
|
||||
|
||||
/**
|
||||
* 最大值
|
||||
*/
|
||||
@ApiModelProperty(value="最大值")
|
||||
@ApiModelProperty(value = "最大值")
|
||||
private Integer maxValue;
|
||||
|
||||
|
||||
/**
|
||||
* 抽样数
|
||||
*/
|
||||
@ApiModelProperty(value="抽样数")
|
||||
@ApiModelProperty(value = "抽样数")
|
||||
private Integer sampleSize;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -6,17 +6,21 @@ import com.foreverwin.iep.qms.entity.QmsInspecJob;
|
||||
import com.foreverwin.mom.common.core.constant.SecurityConstants;
|
||||
import com.foreverwin.mom.common.core.util.R;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
|
||||
@FeignClient(contextId = "remoteQmsInspecJobService", value = "iep-qms")
|
||||
public interface RemoteQmsInspecJobService {
|
||||
|
||||
|
||||
@PostMapping("/inspec-job/api/auto")
|
||||
R<String> auto(@RequestBody AutoCreateJobRequest request, @RequestHeader(SecurityConstants.FROM) String from);
|
||||
|
||||
|
||||
@PostMapping("/inspec-job/api/create")
|
||||
R<QmsInspecJob> create( @RequestBody InspecJob inspecJob);
|
||||
|
||||
R<QmsInspecJob> create(@RequestBody InspecJob inspecJob);
|
||||
|
||||
@GetMapping("/inspec-job/api/closeByTargetBo/{targetBo}")
|
||||
void closeByTargetBo( @PathVariable("targetBo" ) String targetBo);
|
||||
void closeByTargetBo(@PathVariable("targetBo") String targetBo);
|
||||
}
|
||||
|
||||
@ -4,19 +4,23 @@ import com.foreverwin.iep.qms.dto.QmsQcPlanTargetDTO;
|
||||
import com.foreverwin.mom.common.core.constant.SecurityConstants;
|
||||
import com.foreverwin.mom.common.core.util.R;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(contextId = "remoteQmsQcPlanTargetService", value = "iep-qms")
|
||||
public interface RemoteQmsQcPlanTargetService {
|
||||
|
||||
|
||||
@PostMapping("/qc-plan-target/api")
|
||||
R<Boolean> save(@RequestBody QmsQcPlanTargetDTO dto, @RequestHeader(SecurityConstants.FROM) String from);
|
||||
|
||||
|
||||
@GetMapping("/qc-plan-target/{targetBo}")
|
||||
R<List<QmsQcPlanTargetDTO>> getByTargetBo(@PathVariable("targetBo") String targetBo);
|
||||
|
||||
|
||||
@GetMapping("/qc-plan-target/{targetBo}/{inspectLevel}")
|
||||
R<List<QmsQcPlanTargetDTO>> getByTargetBoAndInspectLevel(@PathVariable("targetBo") String targetBo,
|
||||
@PathVariable("inspectLevel") String inspectLevel);
|
||||
|
||||
@ -5,14 +5,18 @@ import com.foreverwin.iep.qms.entity.QmsSamplePlan;
|
||||
import com.foreverwin.mom.common.core.constant.SecurityConstants;
|
||||
import com.foreverwin.mom.common.core.util.R;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
|
||||
@FeignClient(contextId = "remoteQmsSamplePlanService", value = "iep-qms")
|
||||
public interface RemoteQmsSamplePlanService {
|
||||
|
||||
|
||||
@GetMapping("/sample-plan/api/{handle}/info")
|
||||
R<QmsSamplePlan> getById(@PathVariable("handle") String handle, @RequestHeader(SecurityConstants.FROM) String from);
|
||||
|
||||
|
||||
@PostMapping("/sample-plan/api/calculate")
|
||||
R<QmsSamplePlanDTO> calculate(@RequestBody QmsSamplePlanDTO qmsSamplePlanDTO,
|
||||
@RequestHeader(SecurityConstants.FROM) String from);
|
||||
|
||||
@ -18,12 +18,12 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
// 需配置不然扫不到mes-db的mapper
|
||||
@MapperScan({"com.foreverwin.iep.**.mapper"})
|
||||
public class Application {
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication springApplication = new SpringApplication(Application.class);
|
||||
// 启用循环引用
|
||||
springApplication.setAllowCircularReferences(Boolean.TRUE);
|
||||
springApplication.run(args);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -9,10 +9,11 @@ import javax.annotation.PostConstruct;
|
||||
|
||||
@Configuration
|
||||
public class QmsMessagesConfig {
|
||||
|
||||
|
||||
@PostConstruct
|
||||
public MessageSource addMessageSource() {
|
||||
ReloadableResourceBundleMessageSource messageSource = (ReloadableResourceBundleMessageSource) SpringContextHolder.getBean("messageSource");
|
||||
ReloadableResourceBundleMessageSource messageSource = com.foreverwin.mom.common.core.util.SpringContextHolder.getBean(
|
||||
"messageSource");
|
||||
messageSource.addBasenames("classpath:qms/i18n/messages");
|
||||
return messageSource;
|
||||
}
|
||||
|
||||
@ -18,16 +18,16 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* 要因主表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-06-07 15:40:43
|
||||
* @since 2023-06-07 15:40:43
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/factor")
|
||||
@Api(value = "factor", tags = "要因主表管理")
|
||||
public class QmsFactorController {
|
||||
|
||||
|
||||
private final QmsFactorService qmsFactorService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
@ -38,16 +38,15 @@ public class QmsFactorController {
|
||||
@GetMapping("/page")
|
||||
public R getQmsFactorPage(FrontPage page) {
|
||||
return R.ok(qmsFactorService.page(page, Wrappers.<QmsFactor>lambdaQuery()
|
||||
.eq(QmsFactor::getSite, TenantContextHolder.getTenantId())
|
||||
.orderByAsc(QmsFactor::getSeq)));
|
||||
.eq(QmsFactor::getSite, TenantContextHolder.getTenantId()).orderByAsc(QmsFactor::getSeq)));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "要因开窗-EQP_BASIS", notes = "要因开窗-EQP_BASIS")
|
||||
@GetMapping("/dataSource/eqpBasis/{eqpCategoryBo}" )
|
||||
public R getDataSourceEqpBasis( @PathVariable("eqpCategoryBo") String eqpCategoryBo) {
|
||||
return R.ok(qmsFactorService.getDataSourceEqpBasis(eqpCategoryBo));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "要因开窗-SYS_USER", notes = "要因开窗-SYS_USER")
|
||||
@GetMapping("/dataSource/sysUser/{userGroup}" )
|
||||
public R getDataSourceSysUser( @PathVariable("userGroup") String userGroup) {
|
||||
|
||||
@ -13,34 +13,34 @@ import org.springframework.web.bind.annotation.*;
|
||||
* 检验单单身-附件
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2024-03-12 16:58:15
|
||||
* @since 2024-03-12 16:58:15
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/inspec-attachment")
|
||||
@Api(value = "inspec-attachment", tags = "检验单单身-附件管理")
|
||||
public class QmsInspecAttachmentController {
|
||||
|
||||
|
||||
private final QmsInspecAttachmentService qmsInspecAttachmentService;
|
||||
|
||||
|
||||
@ApiOperation(value = "附件查詢", notes = "附件查詢")
|
||||
@GetMapping("/{inspecDetailBo}/list")
|
||||
public R getList(@PathVariable("inspecDetailBo") String inspecDetailBo) {
|
||||
return R.ok(qmsInspecAttachmentService.getDetailAttachment(inspecDetailBo));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "附件上傳", notes = "附件上傳")
|
||||
@PostMapping
|
||||
public R upload(QmsInspecAttachmentDTO dto) {
|
||||
return R.ok(qmsInspecAttachmentService.save(dto));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "附件下載", notes = "附件下載")
|
||||
@GetMapping("/{sid}")
|
||||
public R download(@PathVariable("sid") String sid) {
|
||||
return R.ok(qmsInspecAttachmentService.get(sid));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "附件刪除", notes = "附件刪除")
|
||||
@DeleteMapping("/{sid}")
|
||||
public R delete(@PathVariable("sid") String sid) {
|
||||
|
||||
@ -16,16 +16,16 @@ import org.springframework.web.bind.annotation.*;
|
||||
* 检验频率表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-06-06 15:15:24
|
||||
* @since 2023-06-06 15:15:24
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/inspec-freq")
|
||||
@Api(value = "inspec-freq", tags = "检验频率表管理")
|
||||
public class QmsInspecFreqController {
|
||||
|
||||
|
||||
private final QmsInspecFreqService qmsInspecFreqService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
@ -37,27 +37,29 @@ public class QmsInspecFreqController {
|
||||
@GetMapping("/page")
|
||||
public R getQmsInspecFreqPage(FrontPage page, QmsInspecFreq qmsInspecFreq) {
|
||||
return R.ok(qmsInspecFreqService.page(page.genOrders(), Wrappers.lambdaQuery(QmsInspecFreq.class)
|
||||
.eq(QmsInspecFreq::getSite, TenantContextHolder.getTenantId())
|
||||
.like(StrUtil.isNotBlank(qmsInspecFreq.getInspecNo()), QmsInspecFreq::getInspecNo, qmsInspecFreq.getInspecNo())
|
||||
.eq(StrUtil.isNotBlank(qmsInspecFreq.getInspecType()), QmsInspecFreq::getInspecType, qmsInspecFreq.getInspecType())
|
||||
.like(StrUtil.isNotBlank(qmsInspecFreq.getDescription()), QmsInspecFreq::getDescription, qmsInspecFreq.getDescription())
|
||||
.orderByAsc(QmsInspecFreq::getInspecNo)));
|
||||
.eq(QmsInspecFreq::getSite, TenantContextHolder.getTenantId())
|
||||
.like(StrUtil.isNotBlank(qmsInspecFreq.getInspecNo()), QmsInspecFreq::getInspecNo,
|
||||
qmsInspecFreq.getInspecNo())
|
||||
.eq(StrUtil.isNotBlank(qmsInspecFreq.getInspecType()), QmsInspecFreq::getInspecType,
|
||||
qmsInspecFreq.getInspecType())
|
||||
.like(StrUtil.isNotBlank(qmsInspecFreq.getDescription()), QmsInspecFreq::getDescription,
|
||||
qmsInspecFreq.getDescription()).orderByAsc(QmsInspecFreq::getInspecNo)));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping
|
||||
public R save(@RequestBody QmsInspecFreq qmsInspecFreq) {
|
||||
qmsInspecFreq.setSite(TenantContextHolder.getTenantId());
|
||||
qmsInspecFreqService.insertFreq(qmsInspecFreq);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "通过id删除检验频率表", notes = "通过id删除检验频率表")
|
||||
@DeleteMapping("/{handle}")
|
||||
public R removeById(@PathVariable String handle) {
|
||||
qmsInspecFreqService.deleteFreq(handle);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/info/{inspecNo}")
|
||||
public R getFreq(@PathVariable("inspecNo") String inspecNo) {
|
||||
return R.ok(qmsInspecFreqService.getFreq(TenantContextHolder.getTenantId(), inspecNo));
|
||||
|
||||
@ -23,111 +23,110 @@ import org.springframework.web.bind.annotation.*;
|
||||
* 检验任务-主表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-17 09:43:04
|
||||
* @since 2023-07-17 09:43:04
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/inspec-job")
|
||||
@Api(value = "inspec-job", tags = "检验任务-主表管理")
|
||||
public class QmsInspecJobController {
|
||||
|
||||
|
||||
private final QmsInspecJobService qmsInspecJobService;
|
||||
|
||||
private final QmsInspecDetailService qmsInspecDetailService;
|
||||
|
||||
private final AutoCreateJobService autoCreateJobService;
|
||||
|
||||
|
||||
@ApiOperation(value = "檢驗任務查詢", notes = "檢驗任務查詢")
|
||||
@GetMapping("/page")
|
||||
public R getList(FrontPage page, QmsInspecJobDTO dto) {
|
||||
return R.ok(qmsInspecJobService.selectAll(page.genOrders(), dto));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "檢驗任務明細查詢", notes = "檢驗任務明細查詢")
|
||||
@GetMapping("/detail/{inspecJobBo}")
|
||||
public R getDetails(QmsInspecDetailDTO dto) {
|
||||
dto.genOrders();
|
||||
return R.ok(qmsInspecDetailService.selectAll(dto));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "產品編號開窗", notes = "產品編號開窗")
|
||||
@GetMapping("/item/page")
|
||||
public R getItem(FrontPage page,
|
||||
@RequestParam(value = "item", required = false) String item) {
|
||||
public R getItem(FrontPage page, @RequestParam(value = "item", required = false) String item) {
|
||||
return R.ok(qmsInspecJobService.getItem(page, item));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "設備編號開窗", notes = "設備編號開窗")
|
||||
@GetMapping("/resrce/page")
|
||||
public R getResrce(FrontPage page,
|
||||
@RequestParam(value = "resrce", required = false) String resrce,
|
||||
public R getResrce(FrontPage page, @RequestParam(value = "resrce", required = false) String resrce,
|
||||
@RequestParam(value = "operation", required = false) String operation) {
|
||||
return R.ok(qmsInspecJobService.getResrce(page, resrce, operation));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "收料单号開窗", notes = "收料单号開窗")
|
||||
@GetMapping("/receiptNo/page")
|
||||
public R getReceiptNo(FrontPage page,
|
||||
@RequestParam(value = "receiptNo", required = false) String receiptNo) {
|
||||
public R getReceiptNo(FrontPage page, @RequestParam(value = "receiptNo", required = false) String receiptNo) {
|
||||
return R.ok(qmsInspecJobService.getReceiptNo(page, receiptNo));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "檢驗任務創建", notes = "檢驗任務創建")
|
||||
@PostMapping("/create")
|
||||
public R create(@RequestBody InspecJob inspecJob) {
|
||||
return R.ok(qmsInspecJobService.create(inspecJob));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "檢驗任務編輯", notes = "檢驗任務編輯")
|
||||
@PutMapping("/update")
|
||||
public R update(@RequestBody InspecJob inspecJob) {
|
||||
qmsInspecJobService.update(inspecJob);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@GlobalTransactional
|
||||
@ApiOperation(value = "檢驗任務操作", notes = "檢驗任務操作")
|
||||
@PutMapping("/operate")
|
||||
public R operate(@RequestBody InspecJob inspecJob) {
|
||||
return R.ok(qmsInspecJobService.operate(inspecJob));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "檢驗任務明細-檢驗項目查詢", notes = "檢驗任務明細-檢驗項目查詢")
|
||||
@GetMapping("/detail/result/{inspecDetailBo}")
|
||||
public R getDetailResult(@PathVariable("inspecDetailBo") String inspecDetailBo) {
|
||||
return R.ok(qmsInspecDetailService.getDetailResult(inspecDetailBo));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "IQC檢驗任務明細-檢驗項目查詢", notes = "IQC檢驗任務明細-檢驗項目查詢")
|
||||
@GetMapping("/iqc/detail/result/{inspecDetailBo}")
|
||||
public R getIQCDetailResult(@PathVariable("inspecDetailBo") String inspecDetailBo) {
|
||||
return R.ok(qmsInspecDetailService.getIQCDetailResult(inspecDetailBo));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "儀器校驗檢驗任務明細-檢驗項目查詢", notes = "IQC檢驗任務明細-檢驗項目查詢")
|
||||
@GetMapping("/instrument/detail/result/{inspecDetailBo}")
|
||||
public R getInstrumentDetailResult(@PathVariable("inspecDetailBo") String inspecDetailBo) {
|
||||
return R.ok(qmsInspecDetailService.getInstrumentDetailResult(inspecDetailBo));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "檢驗任務明細-檢驗項目結果保存", notes = "檢驗任務明細-檢驗項目結果保存")
|
||||
@PostMapping("/detail/result")
|
||||
public R saveDetailResult(@RequestBody QmsInspecDetailDTO dto) {
|
||||
qmsInspecDetailService.saveResult(dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "IQC檢驗任務明細-檢驗項目結果保存", notes = "IQC檢驗任務明細-檢驗項目結果保存")
|
||||
@PostMapping("/iqc/detail/result")
|
||||
public R saveIQCResult(@RequestBody QmsInspecDetailDTO dto) {
|
||||
qmsInspecDetailService.saveIQCResult(dto);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "檢驗任務-不合格代碼", notes = "檢驗任務-不合格代碼")
|
||||
@GetMapping("/nc/{inspecJobBo}")
|
||||
public R getNc(@PathVariable("inspecJobBo") String inspecJobBo) {
|
||||
return R.ok(qmsInspecJobService.getNc(inspecJobBo));
|
||||
}
|
||||
|
||||
|
||||
@GlobalTransactional(rollbackFor = Exception.class)
|
||||
@ApiOperation(value = "檢驗任務-判定", notes = "檢驗任務-判定")
|
||||
@PutMapping("/judge")
|
||||
@ -135,7 +134,7 @@ public class QmsInspecJobController {
|
||||
qmsInspecJobService.judge(inspecJob);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@GlobalTransactional
|
||||
@ApiOperation(value = "檢驗任務-關閉", notes = "檢驗任務-關閉")
|
||||
@PutMapping("/close")
|
||||
@ -143,18 +142,17 @@ public class QmsInspecJobController {
|
||||
qmsInspecJobService.close(inspecJob);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@GlobalTransactional
|
||||
@ApiOperation(value = "IQC創建异常单", notes = "IQC創建异常单")
|
||||
@PostMapping("/iqcCreateAbn")
|
||||
public R iqcCreateAbn(@RequestBody InspecJob inspecJob) {
|
||||
qmsInspecJobService.iqcCreateAbn(QmsInspecJob.genHandle(TenantContextHolder.getTenantId(), inspecJob.getJobNo())
|
||||
, inspecJob.getAbnGroup()
|
||||
, inspecJob.getReasonCode()
|
||||
, inspecJob.getSupplier());
|
||||
qmsInspecJobService.iqcCreateAbn(
|
||||
QmsInspecJob.genHandle(TenantContextHolder.getTenantId(), inspecJob.getJobNo()),
|
||||
inspecJob.getAbnGroup(), inspecJob.getReasonCode(), inspecJob.getSupplier());
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@GlobalTransactional
|
||||
@ApiOperation(value = "IQC判定", notes = "IQC判定")
|
||||
@PostMapping("/iqcJudge")
|
||||
@ -162,7 +160,7 @@ public class QmsInspecJobController {
|
||||
qmsInspecJobService.iqcJudge(inspecJob);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@GlobalTransactional
|
||||
@ApiOperation(value = "儀器校驗判定", notes = "儀器校驗判定")
|
||||
@PostMapping("/instrumentJudge")
|
||||
@ -170,7 +168,7 @@ public class QmsInspecJobController {
|
||||
qmsInspecJobService.instrumentJudge(inspecJob);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "檢驗任務-自動開立", notes = "檢驗任務-自動開立")
|
||||
@Inner
|
||||
@PostMapping("/api/auto")
|
||||
@ -178,13 +176,13 @@ public class QmsInspecJobController {
|
||||
autoCreateJobService.invoke(request);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "檢驗任務創建", notes = "檢驗任務創建")
|
||||
@PostMapping("/api/create")
|
||||
public R createApi(@RequestBody InspecJob inspecJob) {
|
||||
return R.ok(qmsInspecJobService.createJob(inspecJob));
|
||||
}
|
||||
|
||||
|
||||
@GlobalTransactional
|
||||
@ApiOperation(value = "檢驗任務-关闭,根据targetBo", notes = "檢驗任務-关闭,根据targetBo")
|
||||
@GetMapping("/api/closeByTargetBo/{targetBo}")
|
||||
|
||||
@ -11,23 +11,29 @@ import com.foreverwin.mom.common.log.annotation.SysLog;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
||||
/**
|
||||
* 检验项目表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-06-07 10:23:18
|
||||
* @since 2023-06-07 10:23:18
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/qc-item")
|
||||
@Api(value = "qc-item", tags = "检验项目表管理")
|
||||
public class QmsQcItemController {
|
||||
|
||||
|
||||
private final QmsQcItemService qmsQcItemService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
@ -39,16 +45,17 @@ public class QmsQcItemController {
|
||||
@GetMapping("/page")
|
||||
public R getQmsQcItemPage(FrontPage page, QmsQcItem qmsQcItem) {
|
||||
return R.ok(qmsQcItemService.page(page.genOrders(), Wrappers.lambdaQuery(QmsQcItem.class)
|
||||
.eq(QmsQcItem::getSite, TenantContextHolder.getTenantId())
|
||||
.like(StrUtil.isNotBlank(qmsQcItem.getQcItem()), QmsQcItem::getQcItem, qmsQcItem.getQcItem())
|
||||
.eq(StrUtil.isNotBlank(qmsQcItem.getItemType()), QmsQcItem::getItemType, qmsQcItem.getItemType())
|
||||
.eq(StrUtil.isNotBlank(qmsQcItem.getInspecType()), QmsQcItem::getInspecType, qmsQcItem.getInspecType())
|
||||
.eq(StrUtil.isNotBlank(qmsQcItem.getStatus()), QmsQcItem::getStatus, qmsQcItem.getStatus())
|
||||
.like(StrUtil.isNotBlank(qmsQcItem.getDescription()), QmsQcItem::getDescription, qmsQcItem.getDescription())
|
||||
.eq(StrUtil.isNotBlank(qmsQcItem.getChartControl()), QmsQcItem::getChartControl, qmsQcItem.getChartControl())
|
||||
.orderByAsc(QmsQcItem::getQcItem)));
|
||||
.eq(QmsQcItem::getSite, TenantContextHolder.getTenantId())
|
||||
.like(StrUtil.isNotBlank(qmsQcItem.getQcItem()), QmsQcItem::getQcItem, qmsQcItem.getQcItem())
|
||||
.eq(StrUtil.isNotBlank(qmsQcItem.getItemType()), QmsQcItem::getItemType, qmsQcItem.getItemType())
|
||||
.eq(StrUtil.isNotBlank(qmsQcItem.getInspecType()), QmsQcItem::getInspecType, qmsQcItem.getInspecType())
|
||||
.eq(StrUtil.isNotBlank(qmsQcItem.getStatus()), QmsQcItem::getStatus, qmsQcItem.getStatus())
|
||||
.like(StrUtil.isNotBlank(qmsQcItem.getDescription()), QmsQcItem::getDescription,
|
||||
qmsQcItem.getDescription())
|
||||
.eq(StrUtil.isNotBlank(qmsQcItem.getChartControl()), QmsQcItem::getChartControl,
|
||||
qmsQcItem.getChartControl()).orderByAsc(QmsQcItem::getQcItem)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增检验项目表
|
||||
*
|
||||
@ -63,7 +70,7 @@ public class QmsQcItemController {
|
||||
qmsQcItemService.insertOrUpdate(qmsQcItem);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id删除检验项目表
|
||||
*
|
||||
@ -77,7 +84,7 @@ public class QmsQcItemController {
|
||||
qmsQcItemService.delete(handle);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/info/{qcItem}")
|
||||
public R getOne(@PathVariable("qcItem") String qcItem) {
|
||||
return R.ok(qmsQcItemService.getOne(TenantContextHolder.getTenantId(), qcItem));
|
||||
|
||||
@ -20,16 +20,16 @@ import org.springframework.web.bind.annotation.*;
|
||||
* 检验计划
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-11 16:28:57
|
||||
* @since 2023-07-11 16:28:57
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/qc-plan")
|
||||
@Api(value = "qc-plan", tags = "检验计划管理")
|
||||
public class QmsQcPlanController {
|
||||
|
||||
|
||||
private final QmsQcPlanService qmsQcPlanService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
@ -41,21 +41,25 @@ public class QmsQcPlanController {
|
||||
@GetMapping("/page")
|
||||
public R getQmsQcPlanPage(FrontPage page, QmsQcPlan qmsQcPlan) {
|
||||
IPage<QmsQcPlan> iPage = qmsQcPlanService.page(page.genOrders(), Wrappers.<QmsQcPlan>lambdaQuery()
|
||||
.eq(QmsQcPlan::getSite, TenantContextHolder.getTenantId())
|
||||
.like(StrUtil.isNotBlank(qmsQcPlan.getQcPlan()), QmsQcPlan::getQcPlan, qmsQcPlan.getQcPlan())
|
||||
.eq(StrUtil.isNotBlank(qmsQcPlan.getInspecType()), QmsQcPlan::getInspecType, qmsQcPlan.getInspecType())
|
||||
.eq(StrUtil.isNotBlank(qmsQcPlan.getUserGroup()), QmsQcPlan::getUserGroup, qmsQcPlan.getUserGroup())
|
||||
.eq(StrUtil.isNotBlank(qmsQcPlan.getCurrentRevision()), QmsQcPlan::getCurrentRevision, qmsQcPlan.getCurrentRevision())
|
||||
.eq(StrUtil.isNotBlank(qmsQcPlan.getRevision()), QmsQcPlan::getRevision, qmsQcPlan.getRevision())
|
||||
.like(StrUtil.isNotBlank(qmsQcPlan.getDescription()), QmsQcPlan::getDescription, qmsQcPlan.getDescription())
|
||||
.like(StrUtil.isNotBlank(qmsQcPlan.getInspecFreqNo()), QmsQcPlan::getInspecFreqBo, qmsQcPlan.getInspecFreqNo())
|
||||
.eq(StrUtil.isNotBlank(qmsQcPlan.getToSpc()), QmsQcPlan::getToSpc, qmsQcPlan.getToSpc())
|
||||
.like(StrUtil.isNotBlank(qmsQcPlan.getUserGroup()), QmsQcPlan::getUserGroup, qmsQcPlan.getUserGroup())
|
||||
.orderByAsc(QmsQcPlan::getQcPlan));
|
||||
iPage.getRecords().forEach(qcPlan -> qcPlan.setInspecFreqNo(HandleBoProcessor.trimHandle(qcPlan.getInspecFreqBo())));
|
||||
.eq(QmsQcPlan::getSite, TenantContextHolder.getTenantId())
|
||||
.like(StrUtil.isNotBlank(qmsQcPlan.getQcPlan()), QmsQcPlan::getQcPlan, qmsQcPlan.getQcPlan())
|
||||
.eq(StrUtil.isNotBlank(qmsQcPlan.getInspecType()), QmsQcPlan::getInspecType, qmsQcPlan.getInspecType())
|
||||
.eq(StrUtil.isNotBlank(qmsQcPlan.getUserGroup()), QmsQcPlan::getUserGroup, qmsQcPlan.getUserGroup())
|
||||
.eq(StrUtil.isNotBlank(qmsQcPlan.getCurrentRevision()), QmsQcPlan::getCurrentRevision,
|
||||
qmsQcPlan.getCurrentRevision())
|
||||
.eq(StrUtil.isNotBlank(qmsQcPlan.getRevision()), QmsQcPlan::getRevision, qmsQcPlan.getRevision())
|
||||
.like(StrUtil.isNotBlank(qmsQcPlan.getDescription()), QmsQcPlan::getDescription,
|
||||
qmsQcPlan.getDescription())
|
||||
.like(StrUtil.isNotBlank(qmsQcPlan.getInspecFreqNo()), QmsQcPlan::getInspecFreqBo,
|
||||
qmsQcPlan.getInspecFreqNo())
|
||||
.eq(StrUtil.isNotBlank(qmsQcPlan.getToSpc()), QmsQcPlan::getToSpc, qmsQcPlan.getToSpc())
|
||||
.like(StrUtil.isNotBlank(qmsQcPlan.getUserGroup()), QmsQcPlan::getUserGroup, qmsQcPlan.getUserGroup())
|
||||
.orderByAsc(QmsQcPlan::getQcPlan));
|
||||
iPage.getRecords()
|
||||
.forEach(qcPlan -> qcPlan.setInspecFreqNo(HandleBoProcessor.trimHandle(qcPlan.getInspecFreqBo())));
|
||||
return R.ok(iPage);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询检验计划
|
||||
*
|
||||
@ -67,13 +71,13 @@ public class QmsQcPlanController {
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
return R.ok(qmsQcPlanService.getFullById(handle));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "通过qcPlan查询当前版本", notes = "通过qcPlan查询当前版本")
|
||||
@GetMapping("/getCurrent/{qcPlan}")
|
||||
public R getCurrentFullById(@PathVariable("qcPlan") String qcPlan) {
|
||||
return R.ok(qmsQcPlanService.getCurrentFullById(qcPlan));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增检验计划
|
||||
*
|
||||
@ -88,7 +92,7 @@ public class QmsQcPlanController {
|
||||
qmsQcPlanService.validateAndSave(qmsQcPlan);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改检验计划
|
||||
*
|
||||
@ -103,7 +107,7 @@ public class QmsQcPlanController {
|
||||
qmsQcPlanService.validateAndUpdate(qmsQcPlan);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id删除检验计划
|
||||
*
|
||||
@ -118,20 +122,18 @@ public class QmsQcPlanController {
|
||||
qmsQcPlanService.validateAndDelete(handle);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "使用者群组开窗", notes = "使用者群组开窗")
|
||||
@SysLog("使用者群组开窗")
|
||||
@GetMapping("/getUserGroup")
|
||||
public R getUserGroup(FrontPage page,
|
||||
@RequestParam(value = "userGroup", required = false) String group) {
|
||||
public R getUserGroup(FrontPage page, @RequestParam(value = "userGroup", required = false) String group) {
|
||||
return R.ok(qmsQcPlanService.getUserGroup(page, group));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "检验计划开窗", notes = "检验计划开窗")
|
||||
@SysLog("检验计划开窗")
|
||||
@GetMapping("/getDistinctQcPlan")
|
||||
public R getDistinctQcPlan(FrontPage page,
|
||||
@RequestParam(value = "qcPlan", required = false) String qcPlan) {
|
||||
public R getDistinctQcPlan(FrontPage page, @RequestParam(value = "qcPlan", required = false) String qcPlan) {
|
||||
return R.ok(qmsQcPlanService.getDistinctQcPlan(page, qcPlan));
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,37 +19,37 @@ import java.util.List;
|
||||
* 检验计划使用对象
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-12 11:23:14
|
||||
* @since 2023-07-12 11:23:14
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/qc-plan-target")
|
||||
@Api(value = "qc-plan-target", tags = "检验计划使用对象管理")
|
||||
public class QmsQcPlanTargetController {
|
||||
|
||||
|
||||
private final QmsQcPlanTargetService qmsQcPlanTargetService;
|
||||
|
||||
|
||||
@ApiOperation(value = "检验计划使用对象-检索", notes = "检验计划使用对象-检索")
|
||||
@SysLog("检验计划使用对象-检索")
|
||||
@GetMapping("/{targetBo}")
|
||||
public R getByTargetBo(@PathVariable String targetBo) {
|
||||
return R.ok(qmsQcPlanTargetService.getByTargetBo(targetBo));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "储存检验计划使用对象", notes = "储存检验计划使用对象")
|
||||
@SysLog("储存检验计划使用对象")
|
||||
@PostMapping("/{targetBo}")
|
||||
public R save(@PathVariable String targetBo, @RequestBody List<QmsQcPlanTarget> qmsQcPlanTargetList) {
|
||||
return R.ok(qmsQcPlanTargetService.saveFullByTargetBo(targetBo, qmsQcPlanTargetList));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "检验计划使用对象-检索", notes = "检验计划使用对象-检索")
|
||||
@SysLog("检验计划使用对象-检索")
|
||||
@GetMapping("/{targetBo}/{inspectLevel}")
|
||||
public R getByTargetBoAndInspectLevel(@PathVariable String targetBo, @PathVariable String inspectLevel) {
|
||||
return R.ok(qmsQcPlanTargetService.getByTargetBoAndInspectLevel(targetBo, inspectLevel));
|
||||
}
|
||||
|
||||
|
||||
@Inner
|
||||
@ApiOperation(value = "储存检验计划使用对象", notes = "储存检验计划使用对象")
|
||||
@SysLog("储存检验计划使用对象")
|
||||
@ -57,7 +57,7 @@ public class QmsQcPlanTargetController {
|
||||
public R saveApi(@RequestBody QmsQcPlanTargetDTO dto) {
|
||||
TenantContextHolder.setTenantId(dto.getSite());
|
||||
SecurityUtils.setUserName(dto.getCreator());
|
||||
|
||||
|
||||
String targetBo = dto.getTargetBo();
|
||||
List<QmsQcPlanTarget> qmsQcPlanTargetList = dto.getQmsQcPlanTargets();
|
||||
return R.ok(qmsQcPlanTargetService.saveFullByTargetBo(targetBo, qmsQcPlanTargetList));
|
||||
|
||||
@ -24,17 +24,18 @@ import org.springframework.web.bind.annotation.*;
|
||||
* 抽样计划主表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2022-12-28 10:01:27
|
||||
* @since 2022-12-28 10:01:27
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/sample-plan")
|
||||
@Api(value = "sample-plan", tags = "抽样规则主表管理")
|
||||
public class QmsSamplePlanController {
|
||||
|
||||
|
||||
private final QmsSamplePlanService qmsSamplePlanService;
|
||||
|
||||
public final QmsAqlSampleMapService qmsAqlSampleMapService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
@ -46,32 +47,37 @@ public class QmsSamplePlanController {
|
||||
@GetMapping("/page")
|
||||
public R getQmsSamplePlanPage(FrontPage page, QmsSamplePlanDTO qmsSamplePlan) {
|
||||
return R.ok(qmsSamplePlanService.page(page.genOrders(), Wrappers.<QmsSamplePlan>lambdaQuery()
|
||||
.eq(QmsSamplePlan::getSite, TenantContextHolder.getTenantId())
|
||||
.like(StrUtil.isNotBlank(qmsSamplePlan.getSamplePlan()), QmsSamplePlan::getSamplePlan, qmsSamplePlan.getSamplePlan())
|
||||
.in(!ListUtils.isEmpty(qmsSamplePlan.getSamplePlanTypes()), QmsSamplePlan::getSamplePlanType, qmsSamplePlan.getSamplePlanTypes())
|
||||
.and(StrUtil.isNotBlank(qmsSamplePlan.getWafer()),
|
||||
lambda -> lambda.isNull("false".equals(qmsSamplePlan.getWafer()), QmsSamplePlan::getAreaQty)
|
||||
.isNotNull("true".equals(qmsSamplePlan.getWafer()), QmsSamplePlan::getAreaQty))
|
||||
.orderByAsc(QmsSamplePlan::getSamplePlan)));
|
||||
.eq(QmsSamplePlan::getSite, TenantContextHolder.getTenantId())
|
||||
.like(StrUtil.isNotBlank(qmsSamplePlan.getSamplePlan()), QmsSamplePlan::getSamplePlan,
|
||||
qmsSamplePlan.getSamplePlan())
|
||||
.in(!ListUtils.isEmpty(qmsSamplePlan.getSamplePlanTypes()), QmsSamplePlan::getSamplePlanType,
|
||||
qmsSamplePlan.getSamplePlanTypes()).and(StrUtil.isNotBlank(qmsSamplePlan.getWafer()),
|
||||
lambda -> lambda.isNull(
|
||||
"false".equals(qmsSamplePlan.getWafer()),
|
||||
QmsSamplePlan::getAreaQty)
|
||||
.isNotNull("true".equals(qmsSamplePlan.getWafer()),
|
||||
QmsSamplePlan::getAreaQty))
|
||||
.orderByAsc(QmsSamplePlan::getSamplePlan)));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "查询", notes = "查询")
|
||||
@GetMapping("/search")
|
||||
public R getPage(FrontPage page, QmsSamplePlanDTO qmsSamplePlan) {
|
||||
return R.ok(qmsSamplePlanService.page(page.genOrders(), Wrappers.<QmsSamplePlan>lambdaQuery()
|
||||
.eq(QmsSamplePlan::getSite, TenantContextHolder.getTenantId())
|
||||
.like(StrUtil.isNotBlank(qmsSamplePlan.getSamplePlan()), QmsSamplePlan::getSamplePlan, qmsSamplePlan.getSamplePlan())
|
||||
.eq(StrUtil.isNotBlank(qmsSamplePlan.getSamplePlanType()), QmsSamplePlan::getSamplePlanType, qmsSamplePlan.getSamplePlanType())
|
||||
.isNull(qmsSamplePlan.isIqc(), QmsSamplePlan::getAreaQty)
|
||||
.like(StrUtil.isNotBlank(qmsSamplePlan.getDescription()), QmsSamplePlan::getDescription, qmsSamplePlan.getDescription())
|
||||
.orderByAsc(QmsSamplePlan::getSamplePlan)));
|
||||
.eq(QmsSamplePlan::getSite, TenantContextHolder.getTenantId())
|
||||
.like(StrUtil.isNotBlank(qmsSamplePlan.getSamplePlan()), QmsSamplePlan::getSamplePlan,
|
||||
qmsSamplePlan.getSamplePlan())
|
||||
.eq(StrUtil.isNotBlank(qmsSamplePlan.getSamplePlanType()), QmsSamplePlan::getSamplePlanType,
|
||||
qmsSamplePlan.getSamplePlanType()).isNull(qmsSamplePlan.isIqc(), QmsSamplePlan::getAreaQty)
|
||||
.like(StrUtil.isNotBlank(qmsSamplePlan.getDescription()), QmsSamplePlan::getDescription,
|
||||
qmsSamplePlan.getDescription()).orderByAsc(QmsSamplePlan::getSamplePlan)));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/{samplePlan}")
|
||||
public R getSamplePlan(@PathVariable("samplePlan") String samplePlan) {
|
||||
return R.ok(qmsSamplePlanService.getSamplePlan(TenantContextHolder.getTenantId(), samplePlan));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增抽样计划主表
|
||||
*
|
||||
@ -91,7 +97,7 @@ public class QmsSamplePlanController {
|
||||
qmsSamplePlanService.save(qmsSamplePlanDTO);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除抽样计划主表
|
||||
*
|
||||
@ -103,7 +109,7 @@ public class QmsSamplePlanController {
|
||||
qmsSamplePlanService.delete(TenantContextHolder.getTenantId(), samplePlan);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 计算抽样数&允退数
|
||||
*
|
||||
@ -116,7 +122,7 @@ public class QmsSamplePlanController {
|
||||
public R calculate(@RequestBody QmsSamplePlanDTO qmsSamplePlan) {
|
||||
return R.ok(qmsSamplePlanService.calculate(qmsSamplePlan));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 计算抽样数&允退数
|
||||
*
|
||||
@ -128,18 +134,18 @@ public class QmsSamplePlanController {
|
||||
public R calculateApi(@RequestBody QmsSamplePlanDTO qmsSamplePlan) {
|
||||
return R.ok(qmsSamplePlanService.calculate(qmsSamplePlan));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/{handle}/info")
|
||||
public R getById(@PathVariable("handle") String handle) {
|
||||
return R.ok(qmsSamplePlanService.getById(handle));
|
||||
}
|
||||
|
||||
|
||||
@Inner
|
||||
@GetMapping("/api/{handle}/info")
|
||||
public R getByIdApi(@PathVariable("handle") String handle) {
|
||||
return R.ok(qmsSamplePlanService.getById(handle));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/aql")
|
||||
public R getAql() {
|
||||
QueryWrapper<QmsAqlSampleMap> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
@ -14,14 +14,14 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class JobMethod {
|
||||
|
||||
|
||||
private final AutoCreateJobService autoCreateJobService;
|
||||
|
||||
|
||||
@XxlJob("demo")
|
||||
public void demo() {
|
||||
String param = XxlJobHelper.getJobParam();
|
||||
}
|
||||
|
||||
|
||||
@XxlJob("InspecDailyFixedTime")
|
||||
public void inspecDailyFixedTime() {
|
||||
String param = XxlJobHelper.getJobParam();
|
||||
@ -33,7 +33,7 @@ public class JobMethod {
|
||||
log.info("End autoCreateJobService.dailyFixedTime");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@XxlJob("InspecInstrument")
|
||||
public void instrument() {
|
||||
String param = XxlJobHelper.getJobParam();
|
||||
|
||||
@ -3,25 +3,24 @@ package com.foreverwin.iep.qms.service;
|
||||
import com.foreverwin.iep.qms.domain.AutoCreateJobRequest;
|
||||
|
||||
/**
|
||||
* 自動創建工作服務介面
|
||||
* 提供與自動創建工作相關的服務方法
|
||||
* 自動創建工作服務介面 提供與自動創建工作相關的服務方法
|
||||
*/
|
||||
public interface AutoCreateJobService {
|
||||
|
||||
|
||||
/**
|
||||
* 調用自動創建工作請求
|
||||
*
|
||||
* @param autoCreateJobRequest 自動創建工作請求對象
|
||||
*/
|
||||
void invoke(AutoCreateJobRequest autoCreateJobRequest);
|
||||
|
||||
|
||||
/**
|
||||
* 每日固定時間執行
|
||||
*
|
||||
* @param site 站點名稱
|
||||
*/
|
||||
void dailyFixedTime(String site);
|
||||
|
||||
|
||||
/**
|
||||
* 儀器相關操作
|
||||
*
|
||||
|
||||
@ -10,4 +10,5 @@ import com.foreverwin.iep.qms.entity.QmsAqlSampleCode;
|
||||
* @since 2023-07-05 10:56:30
|
||||
*/
|
||||
public interface QmsAqlSampleCodeService extends IService<QmsAqlSampleCode> {
|
||||
|
||||
}
|
||||
|
||||
@ -10,4 +10,5 @@ import com.foreverwin.iep.qms.entity.QmsAqlSampleMap;
|
||||
* @since 2023-07-05 10:58:38
|
||||
*/
|
||||
public interface QmsAqlSampleMapService extends IService<QmsAqlSampleMap> {
|
||||
|
||||
}
|
||||
|
||||
@ -7,14 +7,13 @@ import com.foreverwin.iep.qms.entity.QmsFactor;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 要因主表服務介面
|
||||
* 提供與QmsFactor相關的服務方法
|
||||
* 要因主表服務介面 提供與QmsFactor相關的服務方法
|
||||
*
|
||||
* @author
|
||||
* @since 2023-06-07 11:55:53
|
||||
*/
|
||||
public interface QmsFactorService extends IService<QmsFactor> {
|
||||
|
||||
|
||||
/**
|
||||
* 根據設備類別獲取數據源信息
|
||||
*
|
||||
@ -22,7 +21,7 @@ public interface QmsFactorService extends IService<QmsFactor> {
|
||||
* @return 包含FactorDataSourceInfo的列表
|
||||
*/
|
||||
List<FactorDataSourceInfo> getDataSourceEqpBasis(String eqpCategoryBo);
|
||||
|
||||
|
||||
/**
|
||||
* 根據用戶組獲取數據源信息
|
||||
*
|
||||
|
||||
@ -10,4 +10,5 @@ import com.foreverwin.iep.qms.entity.QmsFreqState;
|
||||
* @since 2023-07-31 09:28:49
|
||||
*/
|
||||
public interface QmsFreqStateService extends IService<QmsFreqState> {
|
||||
|
||||
}
|
||||
|
||||
@ -10,4 +10,5 @@ import com.foreverwin.iep.qms.entity.QmsFreqTools;
|
||||
* @since 2023-07-25 14:01:42
|
||||
*/
|
||||
public interface QmsFreqToolsService extends IService<QmsFreqTools> {
|
||||
|
||||
}
|
||||
|
||||
@ -6,14 +6,13 @@ import com.foreverwin.iep.qms.dto.QmsInspecDetailDTO;
|
||||
import com.foreverwin.iep.qms.entity.QmsInspecAttachment;
|
||||
|
||||
/**
|
||||
* 檢驗單單身-附件服務介面
|
||||
* 提供與QmsInspecAttachment相關的服務方法
|
||||
* 檢驗單單身-附件服務介面 提供與QmsInspecAttachment相關的服務方法
|
||||
*
|
||||
* @author mom code generator
|
||||
* @since 2024-03-12 16:58:15
|
||||
*/
|
||||
public interface QmsInspecAttachmentService extends IService<QmsInspecAttachment> {
|
||||
|
||||
|
||||
/**
|
||||
* 根據檢驗單詳情獲取附件信息
|
||||
*
|
||||
@ -21,7 +20,7 @@ public interface QmsInspecAttachmentService extends IService<QmsInspecAttachment
|
||||
* @return 包含檢驗單詳情的QmsInspecDetailDTO對象
|
||||
*/
|
||||
QmsInspecDetailDTO getDetailAttachment(String inspecDetailBo);
|
||||
|
||||
|
||||
/**
|
||||
* 根據ID獲取附件信息
|
||||
*
|
||||
@ -29,7 +28,7 @@ public interface QmsInspecAttachmentService extends IService<QmsInspecAttachment
|
||||
* @return 包含附件信息的QmsInspecAttachmentDTO對象
|
||||
*/
|
||||
QmsInspecAttachmentDTO get(String sid);
|
||||
|
||||
|
||||
/**
|
||||
* 保存附件信息
|
||||
*
|
||||
@ -37,7 +36,7 @@ public interface QmsInspecAttachmentService extends IService<QmsInspecAttachment
|
||||
* @return 保存的QmsInspecAttachment對象
|
||||
*/
|
||||
QmsInspecAttachment save(QmsInspecAttachmentDTO dto);
|
||||
|
||||
|
||||
/**
|
||||
* 根據ID刪除附件信息
|
||||
*
|
||||
|
||||
@ -7,14 +7,13 @@ import com.foreverwin.mom.common.data.mybatis.expand.service.ExpansionService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 檢驗任務-明細服務介面
|
||||
* 提供與QmsInspecDetail相關的服務方法
|
||||
* 檢驗任務-明細服務介面 提供與QmsInspecDetail相關的服務方法
|
||||
*
|
||||
* @author mom code generator
|
||||
* @since 2023-07-17 09:27:49
|
||||
*/
|
||||
public interface QmsInspecDetailService extends ExpansionService<QmsInspecDetail> {
|
||||
|
||||
|
||||
/**
|
||||
* 根據檢驗任務獲取所有檢驗明細
|
||||
*
|
||||
@ -22,7 +21,7 @@ public interface QmsInspecDetailService extends ExpansionService<QmsInspecDetail
|
||||
* @return 包含檢驗明細的QmsInspecDetailDTO列表
|
||||
*/
|
||||
List<QmsInspecDetailDTO> selectAll(String inspecJobBo);
|
||||
|
||||
|
||||
/**
|
||||
* 根據檢驗明細DTO獲取所有檢驗明細
|
||||
*
|
||||
@ -30,7 +29,7 @@ public interface QmsInspecDetailService extends ExpansionService<QmsInspecDetail
|
||||
* @return 包含檢驗明細的QmsInspecDetailDTO列表
|
||||
*/
|
||||
List<QmsInspecDetailDTO> selectAll(QmsInspecDetailDTO dto);
|
||||
|
||||
|
||||
/**
|
||||
* 根據檢驗明細獲取檢驗結果
|
||||
*
|
||||
@ -38,14 +37,14 @@ public interface QmsInspecDetailService extends ExpansionService<QmsInspecDetail
|
||||
* @return 包含檢驗結果的QmsInspecDetailDTO對象
|
||||
*/
|
||||
QmsInspecDetailDTO getDetailResult(String inspecDetailBo);
|
||||
|
||||
|
||||
/**
|
||||
* 保存檢驗結果
|
||||
*
|
||||
* @param dto 檢驗明細DTO
|
||||
*/
|
||||
void saveResult(QmsInspecDetailDTO dto);
|
||||
|
||||
|
||||
/**
|
||||
* 根據檢驗明細獲取IQC檢驗結果
|
||||
*
|
||||
@ -53,14 +52,14 @@ public interface QmsInspecDetailService extends ExpansionService<QmsInspecDetail
|
||||
* @return 包含IQC檢驗結果的QmsInspecDetailDTO對象
|
||||
*/
|
||||
QmsInspecDetailDTO getIQCDetailResult(String inspecDetailBo);
|
||||
|
||||
|
||||
/**
|
||||
* 保存IQC檢驗結果
|
||||
*
|
||||
* @param dto 檢驗明細DTO
|
||||
*/
|
||||
void saveIQCResult(QmsInspecDetailDTO dto);
|
||||
|
||||
|
||||
/**
|
||||
* 根據檢驗明細獲取儀器檢驗結果
|
||||
*
|
||||
@ -68,7 +67,7 @@ public interface QmsInspecDetailService extends ExpansionService<QmsInspecDetail
|
||||
* @return 包含儀器檢驗結果的QmsInspecDetailDTO對象
|
||||
*/
|
||||
QmsInspecDetailDTO getInstrumentDetailResult(String inspecDetailBo);
|
||||
|
||||
|
||||
/**
|
||||
* 根據檢驗明細獲取檢驗明細
|
||||
*
|
||||
|
||||
@ -12,11 +12,11 @@ import java.util.List;
|
||||
* 提供檢驗任務要因的相關操作方法。
|
||||
* </p>
|
||||
*
|
||||
* @author mom
|
||||
* @since 2023-07-17 09:29:13
|
||||
* @author mom code generator
|
||||
* @date 2023-07-17 09:29:13
|
||||
*/
|
||||
public interface QmsInspecFactorService extends ExpansionService<QmsInspecFactor> {
|
||||
|
||||
|
||||
/**
|
||||
* 查詢所有檢驗要因
|
||||
*
|
||||
|
||||
@ -16,34 +16,34 @@ import java.util.List;
|
||||
* @since 2023-06-06 15:15:24
|
||||
*/
|
||||
public interface QmsInspecFreqService extends IService<QmsInspecFreq> {
|
||||
|
||||
|
||||
/**
|
||||
* 根據站點和檢驗編號獲取檢驗頻率
|
||||
*
|
||||
* @param site 檢驗站點
|
||||
* @param site 檢驗站點
|
||||
* @param inspecNo 檢驗編號
|
||||
* @return 檢驗頻率對象
|
||||
*/
|
||||
InspecFreq getFreq(String site, String inspecNo);
|
||||
|
||||
|
||||
/**
|
||||
* 插入新的檢驗頻率
|
||||
*
|
||||
* @param qmsInspecFreq 檢驗頻率實體
|
||||
*/
|
||||
void insertFreq(QmsInspecFreq qmsInspecFreq);
|
||||
|
||||
|
||||
/**
|
||||
* 根據處理標識刪除檢驗頻率
|
||||
*
|
||||
* @param handle 處理標識
|
||||
*/
|
||||
void deleteFreq(String handle);
|
||||
|
||||
|
||||
/**
|
||||
* 根據站點和檢驗編號查找檢驗頻率
|
||||
*
|
||||
* @param site 檢驗站點
|
||||
* @param site 檢驗站點
|
||||
* @param inspecNo 檢驗編號
|
||||
* @return 檢驗頻率列表
|
||||
*/
|
||||
|
||||
@ -23,7 +23,7 @@ import java.util.List;
|
||||
* @since 2023-06-07 10:22:48
|
||||
*/
|
||||
public interface QmsInspecJobService extends IService<QmsInspecJob> {
|
||||
|
||||
|
||||
/**
|
||||
* 獲取項目列表
|
||||
*
|
||||
@ -32,35 +32,35 @@ public interface QmsInspecJobService extends IService<QmsInspecJob> {
|
||||
* @return 項目列表的分頁結果
|
||||
*/
|
||||
IPage<Item> getItem(FrontPage page, String item);
|
||||
|
||||
|
||||
/**
|
||||
* 獲取資源列表
|
||||
*
|
||||
* @param page 分頁信息
|
||||
* @param resrce 資源名稱
|
||||
* @param page 分頁信息
|
||||
* @param resrce 資源名稱
|
||||
* @param operation 操作名稱
|
||||
* @return 資源列表的分頁結果
|
||||
*/
|
||||
IPage<Resource> getResrce(FrontPage page, String resrce, String operation);
|
||||
|
||||
|
||||
/**
|
||||
* 獲取收據號碼列表
|
||||
*
|
||||
* @param page 分頁信息
|
||||
* @param page 分頁信息
|
||||
* @param receiptNo 收據號碼
|
||||
* @return 收據號碼列表的分頁結果
|
||||
*/
|
||||
IPage<ReceiptInfo> getReceiptNo(FrontPage page, String receiptNo);
|
||||
|
||||
|
||||
/**
|
||||
* 查詢所有檢驗任務
|
||||
*
|
||||
* @param page 分頁信息
|
||||
* @param dto 檢驗任務的數據傳輸對象
|
||||
* @param dto 檢驗任務的數據傳輸對象
|
||||
* @return 檢驗任務列表的分頁結果
|
||||
*/
|
||||
IPage<QmsInspecJobDTO> selectAll(FrontPage page, QmsInspecJobDTO dto);
|
||||
|
||||
|
||||
/**
|
||||
* 創建新的檢驗任務
|
||||
*
|
||||
@ -68,14 +68,14 @@ public interface QmsInspecJobService extends IService<QmsInspecJob> {
|
||||
* @return 創建的檢驗任務
|
||||
*/
|
||||
QmsInspecJob create(InspecJob inspecJob);
|
||||
|
||||
|
||||
/**
|
||||
* 更新檢驗任務
|
||||
*
|
||||
* @param inspecJob 檢驗任務實體
|
||||
*/
|
||||
void update(InspecJob inspecJob);
|
||||
|
||||
|
||||
/**
|
||||
* 操作檢驗任務
|
||||
*
|
||||
@ -83,7 +83,7 @@ public interface QmsInspecJobService extends IService<QmsInspecJob> {
|
||||
* @return 操作後的檢驗任務
|
||||
*/
|
||||
QmsInspecJob operate(InspecJob inspecJob);
|
||||
|
||||
|
||||
/**
|
||||
* 獲取不合格代碼列表
|
||||
*
|
||||
@ -91,21 +91,21 @@ public interface QmsInspecJobService extends IService<QmsInspecJob> {
|
||||
* @return 不合格代碼列表
|
||||
*/
|
||||
List<QmsInspecResultNccodeDTO> getNc(String inspecJobBo);
|
||||
|
||||
|
||||
/**
|
||||
* 判斷檢驗任務
|
||||
*
|
||||
* @param inspecJob 檢驗任務實體
|
||||
*/
|
||||
void judge(InspecJob inspecJob);
|
||||
|
||||
|
||||
/**
|
||||
* 關閉檢驗任務
|
||||
*
|
||||
* @param inspecJob 檢驗任務實體
|
||||
*/
|
||||
void close(InspecJob inspecJob);
|
||||
|
||||
|
||||
/**
|
||||
* 創建檢驗任務
|
||||
*
|
||||
@ -113,41 +113,41 @@ public interface QmsInspecJobService extends IService<QmsInspecJob> {
|
||||
* @return 創建的檢驗任務
|
||||
*/
|
||||
QmsInspecJob createJob(InspecJob inspecJob);
|
||||
|
||||
|
||||
/**
|
||||
* 創建異常
|
||||
*
|
||||
* @param inspecJobBo 檢驗任務的業務對象
|
||||
* @param abnGroup 異常組
|
||||
* @param reasonCode 原因代碼
|
||||
* @param supplier 供應商
|
||||
* @param abnGroup 異常組
|
||||
* @param reasonCode 原因代碼
|
||||
* @param supplier 供應商
|
||||
*/
|
||||
void createAbn(String inspecJobBo, String abnGroup, String reasonCode, String supplier);
|
||||
|
||||
|
||||
/**
|
||||
* IQC創建異常
|
||||
*
|
||||
* @param inspecJobBo 檢驗任務的業務對象
|
||||
* @param abnGroup 異常組
|
||||
* @param reasonCode 原因代碼
|
||||
* @param supplier 供應商
|
||||
* @param abnGroup 異常組
|
||||
* @param reasonCode 原因代碼
|
||||
* @param supplier 供應商
|
||||
*/
|
||||
void iqcCreateAbn(String inspecJobBo, String abnGroup, String reasonCode, String supplier);
|
||||
|
||||
|
||||
/**
|
||||
* IQC判斷檢驗任務
|
||||
*
|
||||
* @param inspecJob 檢驗任務實體
|
||||
*/
|
||||
void iqcJudge(InspecJob inspecJob);
|
||||
|
||||
|
||||
/**
|
||||
* 根據目標業務對象關閉檢驗任務
|
||||
*
|
||||
* @param targetBo 目標業務對象
|
||||
*/
|
||||
void closeByTargetBo(String targetBo);
|
||||
|
||||
|
||||
/**
|
||||
* 儀器判斷檢驗任務
|
||||
*
|
||||
|
||||
@ -16,7 +16,7 @@ import java.util.List;
|
||||
* @since 2023-07-17 09:32:45
|
||||
*/
|
||||
public interface QmsInspecResultNccodeService extends ExpansionService<QmsInspecResultNccode> {
|
||||
|
||||
|
||||
/**
|
||||
* 查詢所有不合格代碼
|
||||
*
|
||||
@ -24,7 +24,7 @@ public interface QmsInspecResultNccodeService extends ExpansionService<QmsInspec
|
||||
* @return 包含所有不合格代碼的列表
|
||||
*/
|
||||
List<QmsInspecResultNccodeDTO> selectAll(String inspecResultSid);
|
||||
|
||||
|
||||
/**
|
||||
* 根據操作標識查詢不合格代碼
|
||||
*
|
||||
|
||||
@ -7,7 +7,8 @@ import com.foreverwin.mom.common.data.mybatis.expand.service.ExpansionService;
|
||||
* 检验任务-检验结果
|
||||
*
|
||||
* @author mom code generator
|
||||
* @since 2023-07-17 09:31:34
|
||||
* @date 2023-07-17 09:31:34
|
||||
*/
|
||||
public interface QmsInspecResultService extends ExpansionService<QmsInspecResult> {
|
||||
|
||||
}
|
||||
|
||||
@ -10,4 +10,5 @@ import com.foreverwin.mom.common.data.mybatis.expand.service.ExpansionService;
|
||||
* @since 2023-07-17 09:30:31
|
||||
*/
|
||||
public interface QmsInspecSnService extends ExpansionService<QmsInspecSn> {
|
||||
|
||||
}
|
||||
|
||||
@ -10,4 +10,5 @@ import com.foreverwin.mom.common.data.mybatis.expand.service.ExpansionService;
|
||||
* @since 2023-07-11 11:38:01
|
||||
*/
|
||||
public interface QmsQcItemFactorService extends ExpansionService<QmsQcItemFactor> {
|
||||
|
||||
}
|
||||
|
||||
@ -13,23 +13,23 @@ import com.foreverwin.iep.qms.entity.QmsQcItem;
|
||||
* @since 2023-06-07 10:23:18
|
||||
*/
|
||||
public interface QmsQcItemService extends IService<QmsQcItem> {
|
||||
|
||||
|
||||
/**
|
||||
* 根據站點和檢驗項目獲取檢驗項目
|
||||
*
|
||||
* @param site 檢驗站點
|
||||
* @param site 檢驗站點
|
||||
* @param qcItem 檢驗項目
|
||||
* @return 檢驗項目實體
|
||||
*/
|
||||
QmsQcItem getOne(String site, String qcItem);
|
||||
|
||||
|
||||
/**
|
||||
* 插入或更新檢驗項目
|
||||
*
|
||||
* @param qmsQcItem 檢驗項目實體
|
||||
*/
|
||||
void insertOrUpdate(QmsQcItem qmsQcItem);
|
||||
|
||||
|
||||
/**
|
||||
* 根據處理標識刪除檢驗項目
|
||||
*
|
||||
|
||||
@ -15,7 +15,7 @@ import com.foreverwin.iep.qms.entity.QmsQcPlan;
|
||||
* @since 2023-07-11 16:28:57
|
||||
*/
|
||||
public interface QmsQcPlanService extends IService<QmsQcPlan> {
|
||||
|
||||
|
||||
/**
|
||||
* 根據處理標識獲取完整的檢驗計劃
|
||||
*
|
||||
@ -23,7 +23,7 @@ public interface QmsQcPlanService extends IService<QmsQcPlan> {
|
||||
* @return 檢驗計劃實體
|
||||
*/
|
||||
QmsQcPlan getFullById(String handle);
|
||||
|
||||
|
||||
/**
|
||||
* 根據檢驗計劃標識獲取當前完整的檢驗計劃
|
||||
*
|
||||
@ -31,41 +31,41 @@ public interface QmsQcPlanService extends IService<QmsQcPlan> {
|
||||
* @return 檢驗計劃實體
|
||||
*/
|
||||
QmsQcPlan getCurrentFullById(String qcPlan);
|
||||
|
||||
|
||||
/**
|
||||
* 驗證並保存檢驗計劃
|
||||
*
|
||||
* @param qmsQcPlan 檢驗計劃實體
|
||||
*/
|
||||
void validateAndSave(QmsQcPlan qmsQcPlan);
|
||||
|
||||
|
||||
/**
|
||||
* 驗證並更新檢驗計劃
|
||||
*
|
||||
* @param qmsQcPlan 檢驗計劃實體
|
||||
*/
|
||||
void validateAndUpdate(QmsQcPlan qmsQcPlan);
|
||||
|
||||
|
||||
/**
|
||||
* 驗證並刪除檢驗計劃
|
||||
*
|
||||
* @param handle 處理標識
|
||||
*/
|
||||
void validateAndDelete(String handle);
|
||||
|
||||
|
||||
/**
|
||||
* 獲取用戶組列表
|
||||
*
|
||||
* @param page 分頁信息
|
||||
* @param page 分頁信息
|
||||
* @param group 用戶組名稱
|
||||
* @return 用戶組列表的分頁結果
|
||||
*/
|
||||
IPage<UserGroup> getUserGroup(FrontPage page, String group);
|
||||
|
||||
|
||||
/**
|
||||
* 獲取不同的檢驗計劃列表
|
||||
*
|
||||
* @param page 分頁信息
|
||||
* @param page 分頁信息
|
||||
* @param qcPlan 檢驗計劃名稱
|
||||
* @return 檢驗計劃列表的分頁結果
|
||||
*/
|
||||
|
||||
@ -15,7 +15,7 @@ import java.util.List;
|
||||
* @since 2023-07-12 11:23:14
|
||||
*/
|
||||
public interface QmsQcPlanTargetService extends IService<QmsQcPlanTarget> {
|
||||
|
||||
|
||||
/**
|
||||
* 根據目標業務對象獲取檢驗計劃目標
|
||||
*
|
||||
@ -23,25 +23,25 @@ public interface QmsQcPlanTargetService extends IService<QmsQcPlanTarget> {
|
||||
* @return 檢驗計劃目標的數據傳輸對象列表
|
||||
*/
|
||||
List<QmsQcPlanTargetDTO> getByTargetBo(String targetBo);
|
||||
|
||||
|
||||
/**
|
||||
* 根據目標業務對象保存完整的檢驗計劃目標
|
||||
*
|
||||
* @param targetBo 目標業務對象
|
||||
* @param targetBo 目標業務對象
|
||||
* @param qmsQcPlanTargetList 檢驗計劃目標實體列表
|
||||
* @return 保存操作的結果
|
||||
*/
|
||||
boolean saveFullByTargetBo(String targetBo, List<QmsQcPlanTarget> qmsQcPlanTargetList);
|
||||
|
||||
|
||||
/**
|
||||
* 根據目標業務對象和檢驗等級獲取檢驗計劃目標
|
||||
*
|
||||
* @param targetBo 目標業務對象
|
||||
* @param targetBo 目標業務對象
|
||||
* @param inspectLevel 檢驗等級
|
||||
* @return 檢驗計劃目標的數據傳輸對象列表
|
||||
*/
|
||||
List<QmsQcPlanTargetDTO> getByTargetBoAndInspectLevel(String targetBo, String inspectLevel);
|
||||
|
||||
|
||||
/**
|
||||
* 根據站點獲取儀器組的檢驗計劃目標
|
||||
*
|
||||
|
||||
@ -14,7 +14,7 @@ import com.foreverwin.iep.qms.entity.QmsSamplePlan;
|
||||
* @since 2022-12-28 09:46:03
|
||||
*/
|
||||
public interface QmsSamplePlanService extends IService<QmsSamplePlan> {
|
||||
|
||||
|
||||
/**
|
||||
* 計算抽樣計劃
|
||||
*
|
||||
@ -22,26 +22,26 @@ public interface QmsSamplePlanService extends IService<QmsSamplePlan> {
|
||||
* @return 計算後的抽樣計劃數據傳輸對象
|
||||
*/
|
||||
QmsSamplePlanDTO calculate(QmsSamplePlanDTO qmsSamplePlanDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 保存抽樣計劃
|
||||
*
|
||||
* @param qmsSamplePlanDTO 抽樣計劃的數據傳輸對象
|
||||
*/
|
||||
void save(QmsSamplePlanDTO qmsSamplePlanDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 刪除抽樣計劃
|
||||
*
|
||||
* @param site 站點
|
||||
* @param site 站點
|
||||
* @param samplePlan 抽樣計劃名稱
|
||||
*/
|
||||
void delete(String site, String samplePlan);
|
||||
|
||||
|
||||
/**
|
||||
* 獲取抽樣計劃
|
||||
*
|
||||
* @param site 站點
|
||||
* @param site 站點
|
||||
* @param samplePlan 抽樣計劃名稱
|
||||
* @return 抽樣計劃的數據傳輸對象
|
||||
*/
|
||||
|
||||
@ -20,9 +20,20 @@ import com.foreverwin.iep.qms.domain.AutoCreateJobRequest;
|
||||
import com.foreverwin.iep.qms.domain.ChkInfo;
|
||||
import com.foreverwin.iep.qms.domain.InspecJob;
|
||||
import com.foreverwin.iep.qms.dto.QmsQcPlanTargetDTO;
|
||||
import com.foreverwin.iep.qms.entity.*;
|
||||
import com.foreverwin.iep.qms.entity.QmsFreqState;
|
||||
import com.foreverwin.iep.qms.entity.QmsFreqTools;
|
||||
import com.foreverwin.iep.qms.entity.QmsInspecFreq;
|
||||
import com.foreverwin.iep.qms.entity.QmsInspecJob;
|
||||
import com.foreverwin.iep.qms.entity.QmsQcPlan;
|
||||
import com.foreverwin.iep.qms.entity.QmsQcPlanTarget;
|
||||
import com.foreverwin.iep.qms.mapper.AutoCreateJobMapper;
|
||||
import com.foreverwin.iep.qms.service.*;
|
||||
import com.foreverwin.iep.qms.service.AutoCreateJobService;
|
||||
import com.foreverwin.iep.qms.service.QmsFreqStateService;
|
||||
import com.foreverwin.iep.qms.service.QmsFreqToolsService;
|
||||
import com.foreverwin.iep.qms.service.QmsInspecFreqService;
|
||||
import com.foreverwin.iep.qms.service.QmsInspecJobService;
|
||||
import com.foreverwin.iep.qms.service.QmsQcPlanService;
|
||||
import com.foreverwin.iep.qms.service.QmsQcPlanTargetService;
|
||||
import com.foreverwin.iep.smd.entity.Resrce;
|
||||
import com.foreverwin.iep.smd.entity.ToolBasis;
|
||||
import com.foreverwin.iep.wip.entity.LotBasis;
|
||||
@ -39,69 +50,91 @@ import java.math.BigDecimal;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
||||
|
||||
|
||||
private QmsQcPlanTargetService qmsQcPlanTargetService;
|
||||
|
||||
private QmsQcPlanService qmsQcPlanService;
|
||||
|
||||
private QmsInspecFreqService qmsInspecFreqService;
|
||||
|
||||
private QmsInspecJobService qmsInspecJobService;
|
||||
|
||||
private QmsFreqToolsService qmsFreqToolsService;
|
||||
|
||||
private QmsFreqStateService qmsFreqStateService;
|
||||
|
||||
private AutoCreateJobMapper autoCreateJobMapper;
|
||||
|
||||
private RemoteDictService remoteDictService;
|
||||
|
||||
private CustomFieldsMapper customFieldsMapper;
|
||||
|
||||
|
||||
private static final String ADMIN = "admin";
|
||||
|
||||
private static final String REPAIR_FIRST_LOT = "REPAIR_FIRST_LOT";
|
||||
|
||||
private static final String QC_INTERVAL_LOT = "QC_INTERVAL_LOT";
|
||||
|
||||
private static final String TRUE = "true";
|
||||
|
||||
private static String $site;
|
||||
|
||||
private static String $user;
|
||||
|
||||
private static String $qcPlan;
|
||||
|
||||
private static String $resource;
|
||||
|
||||
private static String $operation;
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void invoke(AutoCreateJobRequest autoCreateJobRequest) {
|
||||
$site = TenantContextHolder.getTenantId();
|
||||
$user = autoCreateJobRequest.getUser();
|
||||
List<AutoCreateJobRequest.BasisInfo> objects = autoCreateJobRequest.getLotBasisList();
|
||||
$resource = autoCreateJobRequest.getResource();
|
||||
$resource = autoCreateJobRequest.getResource();
|
||||
$operation = autoCreateJobRequest.getOperation();
|
||||
|
||||
|
||||
if (ListUtils.isEmpty(objects) && StrUtil.isBlank($resource)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
List<LotBasis> lotBasisList = toLotBasis(objects);
|
||||
String itemBo = getItemBo(lotBasisList);
|
||||
|
||||
|
||||
List<QmsQcPlanTarget> qcPlanTargets = getQcPlanTargets(itemBo);
|
||||
if (ListUtils.isEmpty(qcPlanTargets)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
List<QmsQcPlan> qcPlans = getQcPlans($site, qcPlanTargets);
|
||||
if (ListUtils.isEmpty(qcPlans)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// 頻率
|
||||
List<String> freqList = getFreq();
|
||||
// 依工單分組
|
||||
Map<String, List<LotBasis>> shopOrderBoMap = groupByShopOrder(lotBasisList);
|
||||
|
||||
|
||||
qcPlans.forEach(qcPlan -> {
|
||||
$qcPlan = qcPlan.getQcPlan();
|
||||
QmsInspecFreq inspecFreq = qmsInspecFreqService.getById(qcPlan.getInspecFreqBo());
|
||||
|
||||
|
||||
String chkFirstSfc = inspecFreq.getChkFirstSfc();
|
||||
String chkDailyFirstSfc = inspecFreq.getChkDailyFirstSfc();
|
||||
String dailyFirstSfc = inspecFreq.getDailyFirstSfc();
|
||||
@ -113,13 +146,13 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
||||
String chkSeveralSfc = inspecFreq.getChkSeveralSfc();
|
||||
Integer severalSfc = inspecFreq.getSeveralSfc();
|
||||
String chkIntervalHour2 = inspecFreq.getChkIntervalHour2();
|
||||
|
||||
|
||||
String flag = null;
|
||||
for (String freq : freqList) {
|
||||
if (StrUtil.isNotBlank(flag)) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
switch (freq) {
|
||||
case Freq.CHK_FIRST_SFC:
|
||||
if (execute(flag, chkFirstSfc)) {
|
||||
@ -165,49 +198,49 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void dailyFixedTime(String site) {
|
||||
TenantContextHolder.setTenantId(site);
|
||||
|
||||
|
||||
Date now = new Date();
|
||||
String date = DateUtils.parseDateToStr("yyyy-MM-dd", now);
|
||||
String time = DateUtils.parseDateToStr("HH:mm", now);
|
||||
String yesterday = DateUtils.parseDateToStr("yyyy-MM-dd", DateUtils.addDay(now, -1));
|
||||
|
||||
|
||||
List<String> resrces = autoCreateJobMapper.getProductionResrce(site);
|
||||
resrces.forEach(resrce -> {
|
||||
String resourceBo = Resrce.genHandle(site, resrce);
|
||||
|
||||
|
||||
List<ChkInfo> productionLots = autoCreateJobMapper.getProductionLot(site, resrce);
|
||||
if (!ListUtils.isEmpty(productionLots)) {
|
||||
// 取最小時間
|
||||
Optional<ChkInfo> optional = productionLots.stream()
|
||||
.min(Comparator.comparing(ChkInfo::getEventTime));
|
||||
Optional<ChkInfo> optional = productionLots.stream().min(Comparator.comparing(ChkInfo::getEventTime));
|
||||
if (optional.isPresent()) {
|
||||
String lotNo = optional.get().getLotNo();
|
||||
List<ChkInfo> chkInfos = productionLots.stream()
|
||||
.filter(filters -> lotNo.equals(filters.getLotNo()))
|
||||
.collect(Collectors.toList());
|
||||
List<ChkInfo> chkInfos = productionLots.stream().filter(filters -> lotNo.equals(filters.getLotNo()))
|
||||
.collect(Collectors.toList());
|
||||
chkInfos.forEach(chkInfo -> {
|
||||
String operation = chkInfo.getOperation();
|
||||
String qcPlan = chkInfo.getQcPlan();
|
||||
String qcPlanBo = chkInfo.getQcPlanBo();
|
||||
String dailyFixedTime = chkInfo.getDailyFixedTime();
|
||||
String specifiedTime = getSpecifiedTime(dailyFixedTime, time);
|
||||
Date target = DateUtils.parseStrToDate(String.format("%s %s:00", date, specifiedTime), "yyyy-MM-dd HH:mm:ss");
|
||||
Date target = DateUtils.parseStrToDate(String.format("%s %s:00", date, specifiedTime),
|
||||
"yyyy-MM-dd HH:mm:ss");
|
||||
if (now.compareTo(target) < 0) {
|
||||
// 跨天
|
||||
target = DateUtils.parseStrToDate(String.format("%s %s:00", yesterday, specifiedTime), "yyyy-MM-dd HH:mm:ss");
|
||||
target = DateUtils.parseStrToDate(String.format("%s %s:00", yesterday, specifiedTime),
|
||||
"yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
String specified = DateUtils.parseDateToStr("yyyy-MM-dd HH:mm", target);
|
||||
|
||||
if (qmsFreqStateService.count(Wrappers.lambdaQuery(QmsFreqState.class)
|
||||
.eq(QmsFreqState::getQcFreq, "1")
|
||||
.eq(QmsFreqState::getResourceBo, resourceBo)
|
||||
.eq(QmsFreqState::getQcPlanBo, qcPlanBo)
|
||||
.eq(QmsFreqState::getSpecifiedTime, specified)) == 0) {
|
||||
|
||||
if (qmsFreqStateService.count(
|
||||
Wrappers.lambdaQuery(QmsFreqState.class).eq(QmsFreqState::getQcFreq, "1")
|
||||
.eq(QmsFreqState::getResourceBo, resourceBo)
|
||||
.eq(QmsFreqState::getQcPlanBo, qcPlanBo)
|
||||
.eq(QmsFreqState::getSpecifiedTime, specified)) == 0) {
|
||||
createJob(lotNo, operation, resrce, qcPlan, Freq.CHK_DAILY_FIXED_TIME, ADMIN);
|
||||
saveFreqState(site, resourceBo, qcPlanBo, specified);
|
||||
}
|
||||
@ -216,50 +249,43 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void instrument(String site) {
|
||||
TenantContextHolder.setTenantId(site);
|
||||
|
||||
|
||||
LocalDateTime now = LocalDateTime.now().withHour(23).withMinute(59).withSecond(59);
|
||||
LocalDateTime before = now.plusDays(-7).withHour(0).withMinute(0).withSecond(0);
|
||||
|
||||
|
||||
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("MMdd");
|
||||
String immediately = now.format(dtf);
|
||||
String after = now.plusDays(7).format(dtf);
|
||||
|
||||
List<QmsQcPlanTargetDTO> targets = qmsQcPlanTargetService.getTargetByInstrumentGroup(site)
|
||||
.stream()
|
||||
.filter(filters -> {
|
||||
List<String> freq = new ArrayList<>(Arrays.asList(filters.getCalibrationFreq().split(",")));
|
||||
filters.setFreq(freq.stream()
|
||||
.filter(date -> date.compareTo(immediately) >= 0 && date.compareTo(after) <= 0)
|
||||
.collect(Collectors.toList()));
|
||||
return !filters.getFreq().isEmpty();
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<QmsQcPlanTargetDTO> targets = qmsQcPlanTargetService.getTargetByInstrumentGroup(site).stream()
|
||||
.filter(filters -> {
|
||||
List<String> freq = new ArrayList<>(Arrays.asList(filters.getCalibrationFreq().split(",")));
|
||||
filters.setFreq(
|
||||
freq.stream().filter(date -> date.compareTo(immediately) >= 0 && date.compareTo(after) <= 0)
|
||||
.collect(Collectors.toList()));
|
||||
return !filters.getFreq().isEmpty();
|
||||
}).collect(Collectors.toList());
|
||||
if (targets.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
targets.forEach(target -> {
|
||||
String resourceBO = target.getResourceBo();
|
||||
String qcPlan = target.getQcPlan();
|
||||
|
||||
List<String> exist = qmsInspecJobService.list(Wrappers.lambdaQuery(QmsInspecJob.class)
|
||||
.eq(QmsInspecJob::getQcPlanBo, target.getQcPlanBo())
|
||||
.eq(QmsInspecJob::getTargetBo, target.getResourceBo())
|
||||
.in(QmsInspecJob::getQcFreq, target.getFreq())
|
||||
.le(QmsInspecJob::getDateCreate, now)
|
||||
.ge(QmsInspecJob::getDateCreate, before))
|
||||
.stream()
|
||||
.map(QmsInspecJob::getQcFreq)
|
||||
.collect(Collectors.toList());
|
||||
List<String> freq = target.getFreq()
|
||||
.stream()
|
||||
.filter(date -> !exist.contains(date))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<String> exist = qmsInspecJobService.list(
|
||||
Wrappers.lambdaQuery(QmsInspecJob.class).eq(QmsInspecJob::getQcPlanBo, target.getQcPlanBo())
|
||||
.eq(QmsInspecJob::getTargetBo, target.getResourceBo())
|
||||
.in(QmsInspecJob::getQcFreq, target.getFreq()).le(QmsInspecJob::getDateCreate, now)
|
||||
.ge(QmsInspecJob::getDateCreate, before)).stream().map(QmsInspecJob::getQcFreq)
|
||||
.collect(Collectors.toList());
|
||||
List<String> freq = target.getFreq().stream().filter(date -> !exist.contains(date))
|
||||
.collect(Collectors.toList());
|
||||
freq.forEach(date -> {
|
||||
InspecJob inspecJob = new InspecJob();
|
||||
inspecJob.setTargetBo(resourceBO);
|
||||
@ -272,9 +298,9 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
||||
qmsInspecJobService.createJob(inspecJob);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public String chkFirstSfc(Map<String, List<LotBasis>> shopOrderBoMap) {
|
||||
AtomicInteger count = new AtomicInteger(0);
|
||||
shopOrderBoMap.forEach((shopOrderBo, lotBasisList) -> {
|
||||
@ -282,7 +308,7 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
||||
Integer i = autoCreateJobMapper.chkFirstSfcByLotEquipment($site, shopOrder, $resource);
|
||||
Integer j = autoCreateJobMapper.chkFirstSfcByLotState($site, shopOrder, $resource);
|
||||
int k = i + j;
|
||||
|
||||
|
||||
if (k <= 0) {
|
||||
String lotNo = getLot(lotBasisList);
|
||||
if (StrUtil.isNotBlank(lotNo)) {
|
||||
@ -291,22 +317,23 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
||||
count.getAndIncrement();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (count.get() > 0) {
|
||||
return Freq.CHK_FIRST_SFC;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public String chkDailyFirstSfc(List<LotBasis> lotBasisList, String dailyFirstSfc) {
|
||||
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
String dailyFirst = String.format("%s %s:00", DateUtils.parseDateToStr("yyyy-MM-dd", new Date()), dailyFirstSfc);
|
||||
String dailyFirst = String.format("%s %s:00", DateUtils.parseDateToStr("yyyy-MM-dd", new Date()),
|
||||
dailyFirstSfc);
|
||||
LocalDateTime daily = LocalDateTime.parse(dailyFirst, dtf);
|
||||
|
||||
|
||||
Integer i = autoCreateJobMapper.chkDailyFirstSfcByLotEquipment($site, $resource, daily);
|
||||
Integer j = autoCreateJobMapper.chkDailyFirstSfcByLotState($site, $resource, daily);
|
||||
int k = i + j;
|
||||
|
||||
|
||||
if (k <= 0) {
|
||||
String lotNo = getLot(lotBasisList);
|
||||
if (StrUtil.isNotBlank(lotNo)) {
|
||||
@ -315,11 +342,11 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public String chkChangeProduct(List<LotBasis> lotBasisList, String itemBo) {
|
||||
String lotNo = getLot(lotBasisList);
|
||||
String item = HandleBoProcessor.trimHandle(itemBo);
|
||||
|
||||
|
||||
String product = autoCreateJobMapper.chkChangeProduct($site, $resource);
|
||||
if (StrUtil.isBlank(product) || !item.equals(product)) {
|
||||
if (StrUtil.isNotBlank(lotNo)) {
|
||||
@ -328,11 +355,11 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public String chkChangeMould(List<LotBasis> lotBasisList) {
|
||||
List<String> chkTools = autoCreateJobMapper.chkMould($site, $resource);
|
||||
List<String> tools = autoCreateJobMapper.getMould($site, $resource);
|
||||
|
||||
|
||||
int i = chkTools.size();
|
||||
int j = tools.size();
|
||||
AtomicInteger k = new AtomicInteger(0);
|
||||
@ -341,11 +368,11 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
||||
k.getAndIncrement();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
boolean create = ListUtils.isEmpty(chkTools) || ListUtils.isEmpty(tools) || i != j || k.get() > 0;
|
||||
if (create) {
|
||||
saveFreqTool($resource, tools);
|
||||
|
||||
|
||||
String lotNo = getLot(lotBasisList);
|
||||
if (StrUtil.isNotBlank(lotNo)) {
|
||||
return createJob(lotNo, Freq.CHK_CHANGE_MOULD);
|
||||
@ -353,12 +380,12 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public String chkMaintenFirstSfc(List<LotBasis> lotBasisList) {
|
||||
String value = autoCreateJobMapper.chkMaintenFirstSfc($site, $resource);
|
||||
if (StrUtil.isNotBlank(value)) {
|
||||
updateOrInsertCustomFields(REPAIR_FIRST_LOT, null);
|
||||
|
||||
|
||||
String lotNo = getLot(lotBasisList);
|
||||
if (StrUtil.isNotBlank(lotNo)) {
|
||||
return createJob(lotNo, Freq.CHK_MAINTEN_FIRST_SFC);
|
||||
@ -366,36 +393,35 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public String chkStopAfterSfc(List<LotBasis> lotBasisList, BigDecimal stopAfterSfc) {
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
int stopAfterSfcMinutes = stopAfterSfc.multiply(BigDecimal.valueOf(60)).intValue();
|
||||
LocalDateTime afterTime = now.minusMinutes(stopAfterSfcMinutes);
|
||||
|
||||
|
||||
ChkInfo chkState = autoCreateJobMapper.chkState($site, $resource);
|
||||
List<ChkInfo> stopLogs = autoCreateJobMapper.getStopTime($site, $resource, afterTime);
|
||||
|
||||
|
||||
String production = "1";
|
||||
if (!production.equals(chkState.getStatus())) {
|
||||
LocalDateTime start = chkState.getStartTime();
|
||||
Duration duration = Duration.between(now, start);
|
||||
long stopMinutes = Math.abs(duration.toMinutes());
|
||||
|
||||
|
||||
String lotNo = getLot(lotBasisList);
|
||||
if (stopMinutes > stopAfterSfcMinutes) {
|
||||
if (StrUtil.isNotBlank(lotNo)) {
|
||||
return createJob(lotNo, Freq.CHK_STOP_AFTER_SFC);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (stopLogs.stream().noneMatch(match -> production.equals(match.getStatus()))) {
|
||||
Optional<ChkInfo> min = stopLogs.stream()
|
||||
.min(Comparator.comparing(ChkInfo::getStartTime));
|
||||
Optional<ChkInfo> min = stopLogs.stream().min(Comparator.comparing(ChkInfo::getStartTime));
|
||||
if (min.isPresent()) {
|
||||
start = min.get().getStartTime();
|
||||
duration = Duration.between(now, start);
|
||||
start = min.get().getStartTime();
|
||||
duration = Duration.between(now, start);
|
||||
stopMinutes = Math.abs(duration.toMinutes());
|
||||
|
||||
|
||||
if (stopMinutes > stopAfterSfcMinutes) {
|
||||
if (StrUtil.isNotBlank(lotNo)) {
|
||||
return createJob(lotNo, Freq.CHK_STOP_AFTER_SFC);
|
||||
@ -406,23 +432,22 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public String chkSeveralSfc(List<LotBasis> lotBasisList, Integer severalSfc) {
|
||||
String value = autoCreateJobMapper.getIntervalLot($site, $resource);
|
||||
if (StrUtil.isBlank(value)) {
|
||||
value = "0";
|
||||
}
|
||||
|
||||
List<LotBasis> sort = lotBasisList.stream()
|
||||
.sorted(Comparator.comparing(LotBasis::getLotNo))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
||||
List<LotBasis> sort = lotBasisList.stream().sorted(Comparator.comparing(LotBasis::getLotNo))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
int size = lotBasisList.size();
|
||||
int interval = Integer.parseInt(value);
|
||||
int sum = size + interval;
|
||||
int quotient = sum / severalSfc;
|
||||
int remainder = sum % severalSfc;
|
||||
|
||||
|
||||
boolean flag = false;
|
||||
for (int i = 1; i <= quotient; i++) {
|
||||
int target = (i * severalSfc) - interval;
|
||||
@ -431,50 +456,47 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
||||
// prevent out of list range
|
||||
String lotNo = sort.get(index).getLotNo();
|
||||
createJob(lotNo, Freq.CHK_SEVERAL_SFC);
|
||||
|
||||
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
updateOrInsertCustomFields(QC_INTERVAL_LOT, String.valueOf(remainder));
|
||||
|
||||
|
||||
if (flag) {
|
||||
return Freq.CHK_SEVERAL_SFC;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public String chkIntervalHour2() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private List<QmsQcPlanTarget> getQcPlanTargets(String itemBo) {
|
||||
String operationBo = Operation.genHandle($site, $operation, BaseConstants.CURRENT_REVISION);
|
||||
|
||||
|
||||
String productOpBo = ProductOp.genHandle(ProductConfig.genHandle(itemBo), operationBo);
|
||||
return qmsQcPlanTargetService.list(Wrappers.lambdaQuery(QmsQcPlanTarget.class)
|
||||
.eq(QmsQcPlanTarget::getTargetBo, productOpBo));
|
||||
return qmsQcPlanTargetService.list(
|
||||
Wrappers.lambdaQuery(QmsQcPlanTarget.class).eq(QmsQcPlanTarget::getTargetBo, productOpBo));
|
||||
}
|
||||
|
||||
|
||||
private List<QmsQcPlan> getQcPlans(String site, List<QmsQcPlanTarget> qcPlanTargets) {
|
||||
return qmsQcPlanService.list(Wrappers.lambdaQuery(QmsQcPlan.class)
|
||||
.eq(QmsQcPlan::getSite, site)
|
||||
.in(QmsQcPlan::getQcPlan, qcPlanTargets.stream()
|
||||
.map(QmsQcPlanTarget::getQcPlan)
|
||||
.collect(Collectors.toList()))
|
||||
return qmsQcPlanService.list(Wrappers.lambdaQuery(QmsQcPlan.class).eq(QmsQcPlan::getSite, site)
|
||||
.in(QmsQcPlan::getQcPlan,
|
||||
qcPlanTargets.stream().map(QmsQcPlanTarget::getQcPlan)
|
||||
.collect(Collectors.toList()))
|
||||
.eq(QmsQcPlan::getCurrentRevision, BaseConstants.Y));
|
||||
}
|
||||
|
||||
|
||||
private Map<String, List<LotBasis>> groupByShopOrder(List<LotBasis> lotBasisList) {
|
||||
return lotBasisList.stream()
|
||||
.collect(Collectors.groupingBy(LotBasis::getShopOrderBo));
|
||||
return lotBasisList.stream().collect(Collectors.groupingBy(LotBasis::getShopOrderBo));
|
||||
}
|
||||
|
||||
|
||||
private String createJob(String lotNo, String freq) {
|
||||
return createJob(lotNo, $operation, $resource, $qcPlan, freq, $user);
|
||||
}
|
||||
|
||||
private String createJob(String lotNo, String operation, String resource,
|
||||
String qcPlan, String freq, String user) {
|
||||
|
||||
private String createJob(String lotNo, String operation, String resource, String qcPlan, String freq, String user) {
|
||||
InspecJob inspecJob = new InspecJob();
|
||||
inspecJob.setLotNo(lotNo);
|
||||
inspecJob.setOperation(operation);
|
||||
@ -485,36 +507,32 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
||||
QmsInspecJob qmsInspecJob = qmsInspecJobService.create(inspecJob);
|
||||
return qmsInspecJob.getJobNo();
|
||||
}
|
||||
|
||||
|
||||
private String getLot(List<LotBasis> lotBasisList) {
|
||||
Optional<LotBasis> optional = lotBasisList.stream()
|
||||
.min(Comparator.comparing(LotBasis::getLotNo));
|
||||
return optional.map(LotBasis::getLotNo)
|
||||
.orElse(null);
|
||||
Optional<LotBasis> optional = lotBasisList.stream().min(Comparator.comparing(LotBasis::getLotNo));
|
||||
return optional.map(LotBasis::getLotNo).orElse(null);
|
||||
}
|
||||
|
||||
|
||||
private List<String> getFreq() {
|
||||
List<SysDictItem> dictItems = remoteDictService.getDictByType("inspec_freq", SecurityConstants.FROM_IN)
|
||||
.getData();
|
||||
.getData();
|
||||
if (!ListUtils.isEmpty(dictItems)) {
|
||||
return dictItems.stream()
|
||||
.sorted(Comparator.comparing(SysDictItem::getSortOrder))
|
||||
.map(SysDictItem::getLabel)
|
||||
.collect(Collectors.toList());
|
||||
return dictItems.stream().sorted(Comparator.comparing(SysDictItem::getSortOrder)).map(SysDictItem::getLabel)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
return Freq.getFreq();
|
||||
}
|
||||
|
||||
|
||||
private boolean execute(String flag, String type) {
|
||||
return StrUtil.isBlank(flag) && TRUE.equals(type);
|
||||
}
|
||||
|
||||
|
||||
private void saveFreqTool(String $resource, List<String> tools) {
|
||||
String resourceBo = Resrce.genHandle($site, $resource);
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
|
||||
qmsFreqToolsService.remove(Wrappers.lambdaQuery(QmsFreqTools.class)
|
||||
.eq(QmsFreqTools::getResourceBo, resourceBo));
|
||||
|
||||
qmsFreqToolsService.remove(
|
||||
Wrappers.lambdaQuery(QmsFreqTools.class).eq(QmsFreqTools::getResourceBo, resourceBo));
|
||||
tools.forEach(tool -> {
|
||||
QmsFreqTools qmsFreqTools = new QmsFreqTools();
|
||||
qmsFreqTools.setSid(SidUtils.genSid());
|
||||
@ -525,15 +543,14 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
||||
qmsFreqToolsService.save(qmsFreqTools);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void updateOrInsertCustomFields(String key, String value) {
|
||||
String resourceBo = Resrce.genHandle($site, $resource);
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
|
||||
|
||||
LambdaQueryWrapper<CustomFields> queryWrapper = Wrappers.lambdaQuery(CustomFields.class)
|
||||
.eq(CustomFields::getHandle, resourceBo)
|
||||
.eq(CustomFields::getFieldName, key);
|
||||
|
||||
.eq(CustomFields::getHandle, resourceBo).eq(CustomFields::getFieldName, key);
|
||||
|
||||
CustomFields customFields = customFieldsMapper.selectOne(queryWrapper);
|
||||
if (ObjectUtil.isNotNull(customFields)) {
|
||||
customFields.setFieldValue(value);
|
||||
@ -542,7 +559,7 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
||||
customFieldsMapper.update(customFields, queryWrapper);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
customFields = new CustomFields();
|
||||
customFields.setHandle(resourceBo);
|
||||
customFields.setSite($site);
|
||||
@ -553,30 +570,23 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
||||
customFields.setCreator($user);
|
||||
customFieldsMapper.insert(customFields);
|
||||
}
|
||||
|
||||
|
||||
private List<LotBasis> toLotBasis(List<AutoCreateJobRequest.BasisInfo> objects) {
|
||||
return objects.stream()
|
||||
.map(object -> {
|
||||
LotBasis lotBasis = new LotBasis();
|
||||
BeanUtils.copyProperties(object, lotBasis);
|
||||
return lotBasis;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
return objects.stream().map(object -> {
|
||||
LotBasis lotBasis = new LotBasis();
|
||||
BeanUtils.copyProperties(object, lotBasis);
|
||||
return lotBasis;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
private String getItemBo(List<LotBasis> lotBasisList) {
|
||||
return lotBasisList.stream()
|
||||
.findFirst()
|
||||
.orElse(new LotBasis())
|
||||
.getItemBo();
|
||||
return lotBasisList.stream().findFirst().orElse(new LotBasis()).getItemBo();
|
||||
}
|
||||
|
||||
|
||||
private String getSpecifiedTime(String dailyFixedTime, String localTime) {
|
||||
List<String> dailyFixedTimes = new ArrayList<>(Arrays.asList(dailyFixedTime.split(",")));
|
||||
// 時間由小到大排序
|
||||
dailyFixedTimes = dailyFixedTimes.stream()
|
||||
.sorted()
|
||||
.collect(Collectors.toList());
|
||||
dailyFixedTimes = dailyFixedTimes.stream().sorted().collect(Collectors.toList());
|
||||
// 判斷頻率時間
|
||||
int index = -1;
|
||||
for (int i = 0; i < dailyFixedTimes.size(); i++) {
|
||||
@ -585,28 +595,25 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (fixedTime.compareTo(localTime) < 0) {
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (index < 0) {
|
||||
index = dailyFixedTimes.size() - 1;
|
||||
}
|
||||
return dailyFixedTimes.get(index);
|
||||
}
|
||||
|
||||
private void saveFreqState(String site, String resourceBo,
|
||||
String qcPlanBo, String specifiedTime) {
|
||||
|
||||
private void saveFreqState(String site, String resourceBo, String qcPlanBo, String specifiedTime) {
|
||||
String ONE = "1";
|
||||
|
||||
qmsFreqStateService.remove(Wrappers.lambdaQuery(QmsFreqState.class)
|
||||
.eq(QmsFreqState::getSite, site)
|
||||
.eq(QmsFreqState::getQcFreq, ONE)
|
||||
.eq(QmsFreqState::getResourceBo, resourceBo)
|
||||
|
||||
qmsFreqStateService.remove(Wrappers.lambdaQuery(QmsFreqState.class).eq(QmsFreqState::getSite, site)
|
||||
.eq(QmsFreqState::getQcFreq, ONE).eq(QmsFreqState::getResourceBo, resourceBo)
|
||||
.eq(QmsFreqState::getQcPlanBo, qcPlanBo));
|
||||
|
||||
|
||||
QmsFreqState qmsFreqState = new QmsFreqState();
|
||||
qmsFreqState.setSid(SidUtils.genSid());
|
||||
qmsFreqState.setSite(site);
|
||||
|
||||
@ -10,7 +10,7 @@ import org.springframework.stereotype.Service;
|
||||
* 1916表-抽样代码
|
||||
*
|
||||
* @author paul
|
||||
* @date 2022-12-28 14:28:41
|
||||
* @since 2022-12-28 14:28:41
|
||||
*/
|
||||
@Service
|
||||
public class Qms1916CodeServiceImpl extends ServiceImpl<Qms1916CodeMapper, Qms1916Code> implements Qms1916CodeService {
|
||||
|
||||
@ -10,9 +10,10 @@ import org.springframework.stereotype.Service;
|
||||
* 1916表-抽样数
|
||||
*
|
||||
* @author paul
|
||||
* @date 2022-12-28 14:32:12
|
||||
* @since 2022-12-28 14:32:12
|
||||
*/
|
||||
@Service
|
||||
public class Qms1916SamplePlanServiceImpl extends ServiceImpl<Qms1916SamplePlanMapper, Qms1916SamplePlan> implements Qms1916SamplePlanService {
|
||||
|
||||
public class Qms1916SamplePlanServiceImpl extends ServiceImpl<Qms1916SamplePlanMapper, Qms1916SamplePlan>
|
||||
implements Qms1916SamplePlanService {
|
||||
|
||||
}
|
||||
|
||||
@ -11,9 +11,11 @@ import org.springframework.stereotype.Service;
|
||||
* AQL表-抽样代码
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-05 10:56:30
|
||||
* @since 2023-07-05 10:56:30
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class QmsAqlSampleCodeServiceImpl extends ServiceImpl<QmsAqlSampleCodeMapper, QmsAqlSampleCode> implements QmsAqlSampleCodeService {
|
||||
public class QmsAqlSampleCodeServiceImpl extends ServiceImpl<QmsAqlSampleCodeMapper, QmsAqlSampleCode>
|
||||
implements QmsAqlSampleCodeService {
|
||||
|
||||
}
|
||||
|
||||
@ -11,9 +11,11 @@ import org.springframework.stereotype.Service;
|
||||
* AQL表-抽样数
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-05 10:58:38
|
||||
* @since 2023-07-05 10:58:38
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class QmsAqlSampleMapServiceImpl extends ServiceImpl<QmsAqlSampleMapMapper, QmsAqlSampleMap> implements QmsAqlSampleMapService {
|
||||
public class QmsAqlSampleMapServiceImpl extends ServiceImpl<QmsAqlSampleMapMapper, QmsAqlSampleMap>
|
||||
implements QmsAqlSampleMapService {
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.foreverwin.iep.qms.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.foreverwin.iep.qms.domain.FactorDataSourceInfo;
|
||||
import com.foreverwin.iep.qms.entity.QmsFactor;
|
||||
@ -20,24 +19,24 @@ import java.util.stream.Collectors;
|
||||
* 要因主表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-06-07 11:55:53
|
||||
* @since 2023-06-07 11:55:53
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class QmsFactorServiceImpl extends ServiceImpl<QmsFactorMapper, QmsFactor> implements QmsFactorService {
|
||||
|
||||
|
||||
private final RemoteUserService remoteUserService;
|
||||
|
||||
|
||||
@Override
|
||||
public List<FactorDataSourceInfo> getDataSourceEqpBasis( String eqpCategoryBo ) {
|
||||
public List<FactorDataSourceInfo> getDataSourceEqpBasis(String eqpCategoryBo) {
|
||||
return super.baseMapper.getDataSourceEqpBasis(eqpCategoryBo);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<FactorDataSourceInfo> getDataSourceSysUser( String userGroup ) {
|
||||
|
||||
public List<FactorDataSourceInfo> getDataSourceSysUser(String userGroup) {
|
||||
|
||||
R<List<SysUser>> list = remoteUserService.listUserByRoleCode(userGroup, SecurityConstants.FROM_IN);
|
||||
|
||||
|
||||
return list.getData().stream().map(sysUser -> {
|
||||
FactorDataSourceInfo info = new FactorDataSourceInfo();
|
||||
info.setName(sysUser.getUsername());
|
||||
|
||||
@ -11,9 +11,11 @@ import org.springframework.stereotype.Service;
|
||||
* 检验频率现况
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-31 09:28:49
|
||||
* @since 2023-07-31 09:28:49
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class QmsFreqStateServiceImpl extends ServiceImpl<QmsFreqStateMapper, QmsFreqState> implements QmsFreqStateService {
|
||||
public class QmsFreqStateServiceImpl extends ServiceImpl<QmsFreqStateMapper, QmsFreqState>
|
||||
implements QmsFreqStateService {
|
||||
|
||||
}
|
||||
|
||||
@ -11,9 +11,11 @@ import org.springframework.stereotype.Service;
|
||||
* 检验频率-工具
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-25 14:01:42
|
||||
* @since 2023-07-25 14:01:42
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class QmsFreqToolsServiceImpl extends ServiceImpl<QmsFreqToolsMapper, QmsFreqTools> implements QmsFreqToolsService {
|
||||
public class QmsFreqToolsServiceImpl extends ServiceImpl<QmsFreqToolsMapper, QmsFreqTools>
|
||||
implements QmsFreqToolsService {
|
||||
|
||||
}
|
||||
|
||||
@ -40,16 +40,19 @@ import java.util.stream.Collectors;
|
||||
* 检验单单身-附件
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2024-03-12 16:58:15
|
||||
* @since 2024-03-12 16:58:15
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class QmsInspecAttachmentServiceImpl extends ServiceImpl<QmsInspecAttachmentMapper, QmsInspecAttachment> implements QmsInspecAttachmentService {
|
||||
|
||||
public class QmsInspecAttachmentServiceImpl extends ServiceImpl<QmsInspecAttachmentMapper, QmsInspecAttachment>
|
||||
implements QmsInspecAttachmentService {
|
||||
|
||||
private final QmsInspecJobService qmsInspecJobService;
|
||||
|
||||
private final QmsInspecDetailService qmsInspecDetailService;
|
||||
|
||||
private final RemoteRoleService remoteRoleService;
|
||||
|
||||
|
||||
@Override
|
||||
public QmsInspecDetailDTO getDetailAttachment(String inspecDetailBo) {
|
||||
QmsInspecDetailDTO inspecDetail = qmsInspecDetailService.getDetail(inspecDetailBo);
|
||||
@ -57,7 +60,7 @@ public class QmsInspecAttachmentServiceImpl extends ServiceImpl<QmsInspecAttachm
|
||||
.eq(QmsInspecAttachment::getInspecDetailBo, inspecDetailBo)));
|
||||
return inspecDetail;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public QmsInspecAttachmentDTO get(String sid) {
|
||||
Map<String, String> config = ConfigUtils.getFileServerConfig();
|
||||
@ -65,12 +68,12 @@ public class QmsInspecAttachmentServiceImpl extends ServiceImpl<QmsInspecAttachm
|
||||
if (ObjectUtil.isNull(attachment)) {
|
||||
return new QmsInspecAttachmentDTO();
|
||||
}
|
||||
|
||||
|
||||
String url = config.get("FILE_SERVER_URL");
|
||||
String path = config.get("FILE_SERVER_PATH");
|
||||
String username = config.get("FILE_SERVER_ID");
|
||||
String password = config.get("FILE_SERVER_PW");
|
||||
|
||||
|
||||
SmbFileInfo smbFileInfo = new SmbFileInfo();
|
||||
smbFileInfo.setHost(url);
|
||||
smbFileInfo.setUsername(username);
|
||||
@ -78,13 +81,13 @@ public class QmsInspecAttachmentServiceImpl extends ServiceImpl<QmsInspecAttachm
|
||||
smbFileInfo.setPath(getPath(attachment.getInspecJobBo(), attachment.getInspecDetailBo(), path));
|
||||
smbFileInfo.setFileName(attachment.getFileName());
|
||||
smbFileInfo = SmbUtils.downloadFile(smbFileInfo);
|
||||
|
||||
|
||||
QmsInspecAttachmentDTO dto = new QmsInspecAttachmentDTO();
|
||||
BeanUtils.copyProperties(attachment, dto);
|
||||
dto.setBytes(smbFileInfo.getBytes());
|
||||
return dto;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public QmsInspecAttachment save(QmsInspecAttachmentDTO dto) {
|
||||
Map<String, String> config = ConfigUtils.getFileServerConfig();
|
||||
@ -92,22 +95,22 @@ public class QmsInspecAttachmentServiceImpl extends ServiceImpl<QmsInspecAttachm
|
||||
if (multipartFile == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String fileName = new String(multipartFile.getOriginalFilename()
|
||||
.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8);
|
||||
|
||||
String fileName = new String(multipartFile.getOriginalFilename().getBytes(StandardCharsets.ISO_8859_1),
|
||||
StandardCharsets.UTF_8);
|
||||
if (super.count(Wrappers.lambdaQuery(QmsInspecAttachment.class)
|
||||
.eq(QmsInspecAttachment::getInspecDetailBo, dto.getInspecDetailBo())
|
||||
.eq(QmsInspecAttachment::getFileName, fileName)) > 0) {
|
||||
throw BusinessException.build(I18nUtil.getI18nText("qms.attachment.error1", fileName));
|
||||
}
|
||||
|
||||
|
||||
valid(config);
|
||||
|
||||
|
||||
String url = config.get("FILE_SERVER_URL");
|
||||
String path = config.get("FILE_SERVER_PATH");
|
||||
String username = config.get("FILE_SERVER_ID");
|
||||
String password = config.get("FILE_SERVER_PW");
|
||||
|
||||
|
||||
SmbFileInfo smbFileInfo = new SmbFileInfo();
|
||||
smbFileInfo.setHost(url);
|
||||
smbFileInfo.setUsername(username);
|
||||
@ -116,7 +119,7 @@ public class QmsInspecAttachmentServiceImpl extends ServiceImpl<QmsInspecAttachm
|
||||
smbFileInfo.setFileName(fileName);
|
||||
smbFileInfo.setMultipartFile(multipartFile);
|
||||
SmbUtils.uploadFile(smbFileInfo);
|
||||
|
||||
|
||||
QmsInspecAttachment attachment = new QmsInspecAttachment();
|
||||
BeanUtils.copyProperties(dto, attachment);
|
||||
attachment.setSid(SidUtils.genSid());
|
||||
@ -126,7 +129,7 @@ public class QmsInspecAttachmentServiceImpl extends ServiceImpl<QmsInspecAttachm
|
||||
super.save(attachment);
|
||||
return attachment;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void delete(String sid) {
|
||||
Map<String, String> config = ConfigUtils.getFileServerConfig();
|
||||
@ -135,12 +138,12 @@ public class QmsInspecAttachmentServiceImpl extends ServiceImpl<QmsInspecAttachm
|
||||
return;
|
||||
}
|
||||
valid(attachment, config);
|
||||
|
||||
|
||||
String url = config.get("FILE_SERVER_URL");
|
||||
String path = config.get("FILE_SERVER_PATH");
|
||||
String username = config.get("FILE_SERVER_ID");
|
||||
String password = config.get("FILE_SERVER_PW");
|
||||
|
||||
|
||||
SmbFileInfo smbFileInfo = new SmbFileInfo();
|
||||
smbFileInfo.setHost(url);
|
||||
smbFileInfo.setUsername(username);
|
||||
@ -150,11 +153,11 @@ public class QmsInspecAttachmentServiceImpl extends ServiceImpl<QmsInspecAttachm
|
||||
SmbUtils.deleteFile(smbFileInfo);
|
||||
super.removeById(sid);
|
||||
}
|
||||
|
||||
|
||||
private void valid(Map<String, String> config) {
|
||||
valid(null, config);
|
||||
}
|
||||
|
||||
|
||||
private void valid(QmsInspecAttachment attachment, Map<String, String> config) {
|
||||
if (StrUtil.isBlank(config.get("FILE_SERVER_URL"))) {
|
||||
throw BusinessException.build(I18nUtil.getI18nText("qms.global.error1"));
|
||||
@ -168,23 +171,22 @@ public class QmsInspecAttachmentServiceImpl extends ServiceImpl<QmsInspecAttachm
|
||||
if (StrUtil.isBlank(config.get("FILE_SERVER_PW"))) {
|
||||
throw BusinessException.build(I18nUtil.getI18nText("qms.global.error3"));
|
||||
}
|
||||
|
||||
|
||||
if (ObjectUtil.isNotNull(attachment)) {
|
||||
String user = SecurityUtils.getUserName();
|
||||
String creator = attachment.getCreator();
|
||||
|
||||
R<List<SysRoleDTO>> resp = remoteRoleService.findRolesByUser(Arrays.asList(user, creator), SecurityConstants.FROM_IN);
|
||||
|
||||
R<List<SysRoleDTO>> resp = remoteRoleService.findRolesByUser(Arrays.asList(user, creator),
|
||||
SecurityConstants.FROM_IN);
|
||||
List<SysRoleDTO> roleList = resp.getData();
|
||||
Map<String, List<SysRoleDTO>> roleMap = roleList.stream()
|
||||
.collect(Collectors.groupingBy(SysRoleDTO::getUsername));
|
||||
|
||||
List<String> userRoles = roleMap.get(user).stream()
|
||||
.map(SysRoleDTO::getRoleCode)
|
||||
.collect(Collectors.toList());
|
||||
List<String> creatorRoles = roleMap.get(creator).stream()
|
||||
.map(SysRoleDTO::getRoleCode)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
.collect(Collectors.groupingBy(SysRoleDTO::getUsername));
|
||||
|
||||
List<String> userRoles = roleMap.get(user).stream().map(SysRoleDTO::getRoleCode)
|
||||
.collect(Collectors.toList());
|
||||
List<String> creatorRoles = roleMap.get(creator).stream().map(SysRoleDTO::getRoleCode)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
boolean flag = false;
|
||||
for (String role : userRoles) {
|
||||
if (creatorRoles.contains(role)) {
|
||||
@ -192,29 +194,24 @@ public class QmsInspecAttachmentServiceImpl extends ServiceImpl<QmsInspecAttachm
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!flag) {
|
||||
throw BusinessException.build(I18nUtil.getI18nText("qms.attachment.error2"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String getPath(String inspecJobBo,
|
||||
String inspecDetailBo,
|
||||
String path) {
|
||||
|
||||
private String getPath(String inspecJobBo, String inspecDetailBo, String path) {
|
||||
QmsInspecJob qmsInspecJob = qmsInspecJobService.getById(inspecJobBo);
|
||||
QmsInspecDetailDTO qmsInspecDetail = qmsInspecDetailService.getDetail(inspecDetailBo);
|
||||
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
if (StrUtil.isNotBlank(path)) {
|
||||
builder.append(path);
|
||||
builder.append(FileUtil.FILE_SEPARATOR);
|
||||
}
|
||||
builder.append("CalInspect")
|
||||
.append(FileUtil.FILE_SEPARATOR)
|
||||
.append(qmsInspecJob.getJobNo())
|
||||
.append(FileUtil.FILE_SEPARATOR)
|
||||
.append(qmsInspecDetail.getQcItem());
|
||||
builder.append("CalInspect").append(FileUtil.FILE_SEPARATOR).append(qmsInspecJob.getJobNo())
|
||||
.append(FileUtil.FILE_SEPARATOR).append(qmsInspecDetail.getQcItem());
|
||||
return builder.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,10 +9,29 @@ import com.foreverwin.iep.common.utils.ListUtils;
|
||||
import com.foreverwin.iep.common.utils.SidUtils;
|
||||
import com.foreverwin.iep.prd.entity.NcBasis;
|
||||
import com.foreverwin.iep.prd.mapper.NcBasisMapper;
|
||||
import com.foreverwin.iep.qms.dto.*;
|
||||
import com.foreverwin.iep.qms.entity.*;
|
||||
import com.foreverwin.iep.qms.dto.QmsInspecDetailDTO;
|
||||
import com.foreverwin.iep.qms.dto.QmsInspecFactorDTO;
|
||||
import com.foreverwin.iep.qms.dto.QmsInspecResultDTO;
|
||||
import com.foreverwin.iep.qms.dto.QmsInspecResultNccodeDTO;
|
||||
import com.foreverwin.iep.qms.dto.QmsSamplePlanDTO;
|
||||
import com.foreverwin.iep.qms.entity.QmsFactor;
|
||||
import com.foreverwin.iep.qms.entity.QmsInspecDetail;
|
||||
import com.foreverwin.iep.qms.entity.QmsInspecFactor;
|
||||
import com.foreverwin.iep.qms.entity.QmsInspecJob;
|
||||
import com.foreverwin.iep.qms.entity.QmsInspecResult;
|
||||
import com.foreverwin.iep.qms.entity.QmsInspecResultNccode;
|
||||
import com.foreverwin.iep.qms.entity.QmsInspecSn;
|
||||
import com.foreverwin.iep.qms.entity.QmsQcPlanDetail;
|
||||
import com.foreverwin.iep.qms.entity.QmsSamplePlan;
|
||||
import com.foreverwin.iep.qms.mapper.QmsInspecDetailMapper;
|
||||
import com.foreverwin.iep.qms.service.*;
|
||||
import com.foreverwin.iep.qms.service.QmsInspecDetailService;
|
||||
import com.foreverwin.iep.qms.service.QmsInspecFactorService;
|
||||
import com.foreverwin.iep.qms.service.QmsInspecJobService;
|
||||
import com.foreverwin.iep.qms.service.QmsInspecResultNccodeService;
|
||||
import com.foreverwin.iep.qms.service.QmsInspecResultService;
|
||||
import com.foreverwin.iep.qms.service.QmsInspecSnService;
|
||||
import com.foreverwin.iep.qms.service.QmsQcPlanDetailService;
|
||||
import com.foreverwin.iep.qms.service.QmsSamplePlanService;
|
||||
import com.foreverwin.iep.qms.utils.Area;
|
||||
import com.foreverwin.mom.common.core.util.I18nUtil;
|
||||
import com.foreverwin.mom.common.data.mybatis.expand.service.ExpansionServiceImpl;
|
||||
@ -25,67 +44,78 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 检验任务-明细
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-17 09:27:49
|
||||
* @since 2023-07-17 09:27:49
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class QmsInspecDetailServiceImpl extends ExpansionServiceImpl<QmsInspecDetailMapper, QmsInspecDetail> implements QmsInspecDetailService {
|
||||
|
||||
public class QmsInspecDetailServiceImpl extends ExpansionServiceImpl<QmsInspecDetailMapper, QmsInspecDetail>
|
||||
implements QmsInspecDetailService {
|
||||
|
||||
private QmsInspecJobService getQmsInspecJobService() {
|
||||
return SpringUtil.getBean(QmsInspecJobService.class);
|
||||
}
|
||||
|
||||
|
||||
private QmsSamplePlanService getQmsSamplePlanService() {
|
||||
return SpringUtil.getBean(QmsSamplePlanService.class);
|
||||
}
|
||||
|
||||
|
||||
private final QmsInspecSnService qmsInspecSnService;
|
||||
|
||||
private final QmsInspecResultService qmsInspecResultService;
|
||||
|
||||
private final QmsQcPlanDetailService qmsQcPlanDetailService;
|
||||
|
||||
private final QmsInspecFactorService qmsInspecFactorService;
|
||||
|
||||
private final QmsInspecResultNccodeService qmsInspecResultNccodeService;
|
||||
|
||||
private final NcBasisMapper ncBasisMapper;
|
||||
|
||||
|
||||
private static final String percent = "%";
|
||||
|
||||
|
||||
private static String user;
|
||||
|
||||
private static LocalDateTime now;
|
||||
|
||||
|
||||
@Override
|
||||
public List<QmsInspecDetailDTO> selectAll(String inspecJobBo) {
|
||||
return selectAll(new QmsInspecDetailDTO(inspecJobBo));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<QmsInspecDetailDTO> selectAll(QmsInspecDetailDTO dto) {
|
||||
return baseMapper.selectAll(dto);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public QmsInspecDetailDTO getDetailResult(String inspecDetailBo) {
|
||||
QmsInspecDetailDTO inspecDetail = baseMapper.selectDetail(inspecDetailBo);
|
||||
String itemType = inspecDetail.getItemType();
|
||||
Map<String, String> tempArea = Area.formatter(inspecDetail.getAreaInfo());
|
||||
|
||||
|
||||
// 初始化區域
|
||||
Map<String, String> area = Area.reset(inspecDetail.getAreaQty(), tempArea);
|
||||
inspecDetail.setAreaInfo(JsonUtils.toString(area));
|
||||
|
||||
|
||||
BigDecimal sampleSize = inspecDetail.getSampleSize();
|
||||
BigDecimal dieQty = inspecDetail.getDieQty();
|
||||
|
||||
List<QmsInspecSn> inspecSns = qmsInspecSnService.list(Wrappers.lambdaQuery(QmsInspecSn.class)
|
||||
.eq(QmsInspecSn::getInspecDetailBo, inspecDetailBo));
|
||||
List<QmsInspecResult> inspecResults = qmsInspecResultService.list(Wrappers.lambdaQuery(QmsInspecResult.class)
|
||||
.eq(QmsInspecResult::getInspecDetailBo, inspecDetailBo));
|
||||
|
||||
|
||||
List<QmsInspecSn> inspecSns = qmsInspecSnService.list(
|
||||
Wrappers.lambdaQuery(QmsInspecSn.class).eq(QmsInspecSn::getInspecDetailBo, inspecDetailBo));
|
||||
List<QmsInspecResult> inspecResults = qmsInspecResultService.list(
|
||||
Wrappers.lambdaQuery(QmsInspecResult.class).eq(QmsInspecResult::getInspecDetailBo, inspecDetailBo));
|
||||
|
||||
inspecDetail.setFactorList(qmsInspecFactorService.selectAll(inspecDetailBo));
|
||||
// 內文
|
||||
if ("2".equals(itemType)) {
|
||||
@ -96,7 +126,7 @@ public class QmsInspecDetailServiceImpl extends ExpansionServiceImpl<QmsInspecDe
|
||||
}
|
||||
return inspecDetail;
|
||||
}
|
||||
|
||||
|
||||
// 計數
|
||||
// 計量
|
||||
int size = sampleSize.intValue();
|
||||
@ -104,7 +134,7 @@ public class QmsInspecDetailServiceImpl extends ExpansionServiceImpl<QmsInspecDe
|
||||
if (ObjectUtil.isNotNull(dieQty)) {
|
||||
die = dieQty.intValue();
|
||||
}
|
||||
|
||||
|
||||
List<Map<String, Object>> resultList = new ArrayList<>();
|
||||
for (int i = 0; i < size; i++) {
|
||||
int seq = i + 1;
|
||||
@ -113,23 +143,24 @@ public class QmsInspecDetailServiceImpl extends ExpansionServiceImpl<QmsInspecDe
|
||||
if (ObjectUtil.isNotNull(sn)) {
|
||||
snValue = sn.getSn();
|
||||
}
|
||||
|
||||
|
||||
for (int j = 0; j < die; j++) {
|
||||
int series = j + 1;
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("seq", seq);
|
||||
map.put("sn", snValue);
|
||||
|
||||
|
||||
area.forEach((k, v) -> {
|
||||
String value = v;
|
||||
if (StrUtil.isBlank(value)) {
|
||||
value = k;
|
||||
}
|
||||
|
||||
QmsInspecResult result = filtersResult(inspecResults, String.valueOf(seq), Integer.parseInt(k), series);
|
||||
|
||||
QmsInspecResult result = filtersResult(inspecResults, String.valueOf(seq), Integer.parseInt(k),
|
||||
series);
|
||||
String resultValue = null;
|
||||
List<QmsInspecResultNccodeDTO> resultNcCodeList = new ArrayList<>();
|
||||
|
||||
|
||||
if (ObjectUtil.isNotNull(result)) {
|
||||
if (ObjectUtil.isNotNull(result.getResult())) {
|
||||
resultValue = result.getResult().stripTrailingZeros().toPlainString();
|
||||
@ -148,7 +179,7 @@ public class QmsInspecDetailServiceImpl extends ExpansionServiceImpl<QmsInspecDe
|
||||
inspecDetail.setResultRemark(formatter(inspecDetail.getResultRemark()));
|
||||
return inspecDetail;
|
||||
}
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void saveResult(QmsInspecDetailDTO dto) {
|
||||
@ -157,17 +188,17 @@ public class QmsInspecDetailServiceImpl extends ExpansionServiceImpl<QmsInspecDe
|
||||
String inspecDetailBo = dto.getHandle();
|
||||
List<Map<String, Object>> resultList = dto.getResultList();
|
||||
List<QmsInspecFactorDTO> factorList = dto.getFactorList();
|
||||
|
||||
|
||||
QmsInspecDetailDTO inspecDetail = baseMapper.selectDetail(inspecDetailBo);
|
||||
String inspecJobBo = inspecDetail.getInspecJobBo();
|
||||
String itemType = inspecDetail.getItemType();
|
||||
Map<String, String> tempArea = Area.formatter(inspecDetail.getAreaInfo());
|
||||
Map<String, String> areaMap = Area.reset(inspecDetail.getAreaQty(), tempArea);
|
||||
|
||||
|
||||
remove(inspecDetailBo);
|
||||
updateJobStatus(inspecJobBo);
|
||||
saveFactor(inspecDetailBo, factorList);
|
||||
|
||||
|
||||
// 內文
|
||||
if ("2".equals(itemType)) {
|
||||
QmsInspecResult inspecResult = new QmsInspecResult();
|
||||
@ -175,21 +206,21 @@ public class QmsInspecDetailServiceImpl extends ExpansionServiceImpl<QmsInspecDe
|
||||
inspecResult.setInspecDetailBo(inspecDetailBo);
|
||||
inspecResult.setContent(dto.getContentResult().getContent());
|
||||
qmsInspecResultService.save(inspecResult);
|
||||
|
||||
|
||||
updateDetail(inspecDetailBo);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// 計數
|
||||
// 計量
|
||||
saveSn(inspecDetailBo, resultList);
|
||||
|
||||
|
||||
List<QmsInspecResult> inspecResultList = new ArrayList<>();
|
||||
List<QmsInspecResultNccode> inspecResultNcList = new ArrayList<>();
|
||||
resultList.forEach(objectMap -> {
|
||||
String seq = String.valueOf(objectMap.get("seq"));
|
||||
int series = (int) objectMap.get("series");
|
||||
|
||||
|
||||
areaMap.forEach((k, v) -> {
|
||||
QmsInspecResult inspecResult = new QmsInspecResult();
|
||||
inspecResult.setSid(SidUtils.genSid());
|
||||
@ -197,19 +228,19 @@ public class QmsInspecDetailServiceImpl extends ExpansionServiceImpl<QmsInspecDe
|
||||
inspecResult.setSeq(seq);
|
||||
inspecResult.setArea(Integer.parseInt(k));
|
||||
inspecResult.setSeries(series);
|
||||
|
||||
|
||||
String value = v;
|
||||
if (StrUtil.isBlank(value)) {
|
||||
value = k;
|
||||
}
|
||||
|
||||
|
||||
String resultValue = (String) objectMap.get(value);
|
||||
if (StrUtil.isNotBlank(resultValue)) {
|
||||
BigDecimal result = new BigDecimal(resultValue);
|
||||
inspecResult.setResult(result);
|
||||
}
|
||||
inspecResultList.add(inspecResult);
|
||||
|
||||
|
||||
if ("0".equals(itemType)) {
|
||||
Object ncValue = objectMap.get(String.format("%s$%s", value, "NC"));
|
||||
if (ObjectUtil.isNotNull(ncValue)) {
|
||||
@ -217,7 +248,7 @@ public class QmsInspecDetailServiceImpl extends ExpansionServiceImpl<QmsInspecDe
|
||||
if (!ListUtils.isEmpty(resultNcList)) {
|
||||
resultNcList.forEach(resultNc -> {
|
||||
String ncCode = resultNc.get("ncCode");
|
||||
|
||||
|
||||
QmsInspecResultNccode inspecResultNc = new QmsInspecResultNccodeDTO();
|
||||
inspecResultNc.setSid(SidUtils.genSid());
|
||||
inspecResultNc.setInspecResultSid(inspecResult.getSid());
|
||||
@ -229,42 +260,43 @@ public class QmsInspecDetailServiceImpl extends ExpansionServiceImpl<QmsInspecDe
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
updateDetail(inspecDetailBo);
|
||||
qmsInspecResultService.saveMulti(inspecResultList);
|
||||
qmsInspecResultNccodeService.saveMulti(inspecResultNcList);
|
||||
qmsInspecResultService.saveBatch(inspecResultList);
|
||||
qmsInspecResultNccodeService.saveBatch(inspecResultNcList);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public QmsInspecDetailDTO getIQCDetailResult(String inspecDetailBo) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
QmsInspecDetailDTO inspecDetail = baseMapper.selectDetail(inspecDetailBo);
|
||||
QmsInspecJob inspecJob = getQmsInspecJobService().getById(inspecDetail.getInspecJobBo());
|
||||
|
||||
|
||||
QmsSamplePlanDTO samplePlan = new QmsSamplePlanDTO();
|
||||
samplePlan.setHandle(QmsSamplePlan.genHandle(site, inspecDetail.getSamplePlan()));
|
||||
samplePlan.setQty(inspecJob.getPopulationQty());
|
||||
QmsSamplePlanDTO qmsSamplePlan = getQmsSamplePlanService().calculate(samplePlan);
|
||||
|
||||
inspecDetail.setReturnAllowedQty("2".equals(inspecDetail.getSamplePlanType()) ? qmsSamplePlan.getReturnAllowedQty() : BigDecimal.ONE);
|
||||
|
||||
List<QmsInspecResult> inspecResults = qmsInspecResultService.list(Wrappers.lambdaQuery(QmsInspecResult.class)
|
||||
.eq(QmsInspecResult::getInspecDetailBo, inspecDetailBo));
|
||||
|
||||
|
||||
inspecDetail.setReturnAllowedQty(
|
||||
"2".equals(inspecDetail.getSamplePlanType()) ? qmsSamplePlan.getReturnAllowedQty() : BigDecimal.ONE);
|
||||
|
||||
List<QmsInspecResult> inspecResults = qmsInspecResultService.list(
|
||||
Wrappers.lambdaQuery(QmsInspecResult.class).eq(QmsInspecResult::getInspecDetailBo, inspecDetailBo));
|
||||
|
||||
inspecDetail.setFactorList(qmsInspecFactorService.selectAll(inspecDetailBo));
|
||||
|
||||
|
||||
inspecResults.forEach(result -> {
|
||||
QmsInspecResultDTO resultDTO = new QmsInspecResultDTO();
|
||||
BeanUtils.copyProperties(result, resultDTO);
|
||||
resultDTO.setQmsInspecResultNccodeList(qmsInspecResultNccodeService.selectAll(result.getSid()));
|
||||
inspecDetail.getInspecResultList().add(resultDTO);
|
||||
});
|
||||
|
||||
|
||||
inspecDetail.setOocRemark(formatter(inspecDetail.getOocRemark()));
|
||||
inspecDetail.setResultRemark(formatter(inspecDetail.getResultRemark()));
|
||||
return inspecDetail;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void saveIQCResult(QmsInspecDetailDTO dto) {
|
||||
@ -273,38 +305,38 @@ public class QmsInspecDetailServiceImpl extends ExpansionServiceImpl<QmsInspecDe
|
||||
String inspecDetailBo = dto.getHandle();
|
||||
List<QmsInspecFactorDTO> factorList = dto.getFactorList();
|
||||
List<QmsInspecResultDTO> resultList = dto.getInspecResultList();
|
||||
|
||||
|
||||
remove(dto.getHandle());
|
||||
updateJobStatus(inspecJobBo);
|
||||
saveFactor(inspecDetailBo, factorList);
|
||||
|
||||
|
||||
List<QmsInspecResult> inspecResultList = new ArrayList<>();
|
||||
List<QmsInspecResultNccode> inspecResultNcList = new ArrayList<>();
|
||||
|
||||
|
||||
resultList.forEach(result -> {
|
||||
result.setSid(SidUtils.genSid());
|
||||
result.setInspecDetailBo(dto.getHandle());
|
||||
inspecResultList.add(result);
|
||||
|
||||
|
||||
result.getQmsInspecResultNccodeList().forEach(ncCode -> {
|
||||
ncCode.setSid(SidUtils.genSid());
|
||||
ncCode.setInspecResultSid(result.getSid());
|
||||
inspecResultNcList.add(ncCode);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
updateDetail(dto.getHandle());
|
||||
qmsInspecResultService.saveMulti(inspecResultList);
|
||||
qmsInspecResultNccodeService.saveMulti(inspecResultNcList);
|
||||
qmsInspecResultService.saveBatch(inspecResultList);
|
||||
qmsInspecResultNccodeService.saveBatch(inspecResultNcList);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public QmsInspecDetailDTO getInstrumentDetailResult(String inspecDetailBo) {
|
||||
QmsInspecDetailDTO inspecDetail = baseMapper.selectDetail(inspecDetailBo);
|
||||
String itemType = inspecDetail.getItemType();
|
||||
|
||||
List<QmsInspecResult> inspecResults = qmsInspecResultService.list(Wrappers.lambdaQuery(QmsInspecResult.class)
|
||||
.eq(QmsInspecResult::getInspecDetailBo, inspecDetailBo));
|
||||
|
||||
List<QmsInspecResult> inspecResults = qmsInspecResultService.list(
|
||||
Wrappers.lambdaQuery(QmsInspecResult.class).eq(QmsInspecResult::getInspecDetailBo, inspecDetailBo));
|
||||
inspecResults.forEach(result -> {
|
||||
QmsInspecResultDTO resultDTO = new QmsInspecResultDTO();
|
||||
BeanUtils.copyProperties(result, resultDTO);
|
||||
@ -314,96 +346,80 @@ public class QmsInspecDetailServiceImpl extends ExpansionServiceImpl<QmsInspecDe
|
||||
}
|
||||
inspecDetail.getInspecResultList().add(resultDTO);
|
||||
});
|
||||
|
||||
|
||||
inspecDetail.setOocRemark(formatter(inspecDetail.getOocRemark()));
|
||||
inspecDetail.setResultRemark(formatter(inspecDetail.getResultRemark()));
|
||||
return inspecDetail;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public QmsInspecDetailDTO getDetail(String inspecDetailBo) {
|
||||
return baseMapper.selectDetail(inspecDetailBo);
|
||||
}
|
||||
|
||||
|
||||
private QmsInspecSn filterSn(List<QmsInspecSn> inspecSns, String seq) {
|
||||
return inspecSns.stream()
|
||||
.filter(filters -> filters.getSeq().equals(seq))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
return inspecSns.stream().filter(filters -> filters.getSeq().equals(seq)).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
|
||||
private QmsInspecResult filtersResult(List<QmsInspecResult> inspecResults, String seq, int area, int series) {
|
||||
return inspecResults.stream()
|
||||
.filter(filters -> filters.getSeq().equals(seq) &&
|
||||
filters.getArea() == area &&
|
||||
filters.getSeries() == series)
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
return inspecResults.stream().filter(filters -> filters.getSeq().equals(seq) && filters.getArea() == area
|
||||
&& filters.getSeries() == series).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
|
||||
private void remove(String inspecDetailBo) {
|
||||
qmsInspecSnService.remove(Wrappers.lambdaQuery(QmsInspecSn.class)
|
||||
.eq(QmsInspecSn::getInspecDetailBo, inspecDetailBo));
|
||||
|
||||
List<String> resultSidList = qmsInspecResultService.list(Wrappers.lambdaQuery(QmsInspecResult.class)
|
||||
.eq(QmsInspecResult::getInspecDetailBo, inspecDetailBo))
|
||||
.stream()
|
||||
.map(QmsInspecResult::getSid)
|
||||
.collect(Collectors.toList());
|
||||
qmsInspecSnService.remove(
|
||||
Wrappers.lambdaQuery(QmsInspecSn.class).eq(QmsInspecSn::getInspecDetailBo, inspecDetailBo));
|
||||
|
||||
List<String> resultSidList = qmsInspecResultService.list(
|
||||
Wrappers.lambdaQuery(QmsInspecResult.class).eq(QmsInspecResult::getInspecDetailBo, inspecDetailBo))
|
||||
.stream().map(QmsInspecResult::getSid).collect(Collectors.toList());
|
||||
if (ListUtils.isNotEmpty(resultSidList)) {
|
||||
qmsInspecResultService.removeBatchByIds(resultSidList);
|
||||
qmsInspecResultNccodeService.remove(Wrappers.lambdaQuery(QmsInspecResultNccode.class)
|
||||
.in(QmsInspecResultNccode::getInspecResultSid, resultSidList));
|
||||
}
|
||||
qmsInspecFactorService.remove(Wrappers.lambdaQuery(QmsInspecFactor.class)
|
||||
.eq(QmsInspecFactor::getInspecDetailBo, inspecDetailBo));
|
||||
|
||||
qmsInspecFactorService.remove(
|
||||
Wrappers.lambdaQuery(QmsInspecFactor.class).eq(QmsInspecFactor::getInspecDetailBo, inspecDetailBo));
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void updateJobStatus(String inspecJobBo) {
|
||||
getQmsInspecJobService().update(Wrappers.lambdaUpdate(QmsInspecJob.class)
|
||||
.set(QmsInspecJob::getStatus, "2")
|
||||
getQmsInspecJobService().update(Wrappers.lambdaUpdate(QmsInspecJob.class).set(QmsInspecJob::getStatus, "2")
|
||||
.eq(QmsInspecJob::getHandle, inspecJobBo));
|
||||
}
|
||||
|
||||
|
||||
private void updateDetail(String inspecDetailBo) {
|
||||
update(Wrappers.lambdaUpdate(QmsInspecDetail.class)
|
||||
.set(QmsInspecDetail::getInspecUser, user)
|
||||
.set(QmsInspecDetail::getInspecDateTime, now)
|
||||
.eq(QmsInspecDetail::getHandle, inspecDetailBo));
|
||||
update(Wrappers.lambdaUpdate(QmsInspecDetail.class).set(QmsInspecDetail::getInspecUser, user)
|
||||
.set(QmsInspecDetail::getInspecDateTime, now).eq(QmsInspecDetail::getHandle, inspecDetailBo));
|
||||
}
|
||||
|
||||
|
||||
private void saveFactor(String inspecDetailBo, List<QmsInspecFactorDTO> factors) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
qmsInspecFactorService.saveMulti(factors.stream()
|
||||
.map(dto -> {
|
||||
String factor = dto.getFactor();
|
||||
|
||||
QmsInspecFactor inspecFactor = new QmsInspecFactor();
|
||||
BeanUtils.copyProperties(dto, inspecFactor);
|
||||
|
||||
inspecFactor.setSid(SidUtils.genSid());
|
||||
inspecFactor.setInspecDetailBo(inspecDetailBo);
|
||||
inspecFactor.setFactorBo(QmsFactor.genHandle(site, factor));
|
||||
return inspecFactor;
|
||||
})
|
||||
.collect(Collectors.toList()));
|
||||
qmsInspecFactorService.saveBatch(factors.stream().map(dto -> {
|
||||
String factor = dto.getFactor();
|
||||
|
||||
QmsInspecFactor inspecFactor = new QmsInspecFactor();
|
||||
BeanUtils.copyProperties(dto, inspecFactor);
|
||||
|
||||
inspecFactor.setSid(SidUtils.genSid());
|
||||
inspecFactor.setInspecDetailBo(inspecDetailBo);
|
||||
inspecFactor.setFactorBo(QmsFactor.genHandle(site, factor));
|
||||
return inspecFactor;
|
||||
}).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
|
||||
private void saveSn(String inspecDetailBo, List<Map<String, Object>> resultList) {
|
||||
List<QmsInspecSn> inspecSnList = new ArrayList<>();
|
||||
Map<String, List<Map<String, Object>>> snMap = resultList.stream()
|
||||
.collect(Collectors.groupingBy(group -> String.valueOf(group.get("seq"))));
|
||||
.collect(Collectors.groupingBy(group -> String.valueOf(group.get("seq"))));
|
||||
snMap.forEach((seq, v) -> {
|
||||
Map<String, Object> objectMap = v.stream()
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
Map<String, Object> objectMap = v.stream().findFirst().orElse(null);
|
||||
if (ObjectUtil.isNotNull(objectMap)) {
|
||||
String sn = String.valueOf(objectMap.get("sn"));
|
||||
if ("null".equals(sn) || StrUtil.isBlank(sn)) {
|
||||
sn = null;
|
||||
}
|
||||
|
||||
|
||||
QmsInspecSn inspecSn = new QmsInspecSn();
|
||||
inspecSn.setSid(SidUtils.genSid());
|
||||
inspecSn.setInspecDetailBo(inspecDetailBo);
|
||||
@ -414,29 +430,27 @@ public class QmsInspecDetailServiceImpl extends ExpansionServiceImpl<QmsInspecDe
|
||||
inspecSnList.add(inspecSn);
|
||||
}
|
||||
});
|
||||
qmsInspecSnService.saveMulti(inspecSnList);
|
||||
qmsInspecSnService.saveBatch(inspecSnList);
|
||||
}
|
||||
|
||||
|
||||
private void init() {
|
||||
user = SecurityUtils.getUserName();
|
||||
now = LocalDateTime.now();
|
||||
now = LocalDateTime.now();
|
||||
}
|
||||
|
||||
|
||||
private String formatter(String str) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
if (StrUtil.isNotBlank(str)) {
|
||||
List<String> strList = new ArrayList<>(Arrays.asList(str.split("\\|")));
|
||||
stringBuilder.append(strList.stream()
|
||||
.map(this::format)
|
||||
.collect(Collectors.joining("\n")));
|
||||
stringBuilder.append(strList.stream().map(this::format).collect(Collectors.joining("\n")));
|
||||
stringBuilder.append("\n");
|
||||
}
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
|
||||
private String format(String str){
|
||||
|
||||
private String format(String str) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
|
||||
|
||||
do {
|
||||
String key = keyword(str);
|
||||
if (StrUtil.isBlank(key)) {
|
||||
@ -444,7 +458,7 @@ public class QmsInspecDetailServiceImpl extends ExpansionServiceImpl<QmsInspecDe
|
||||
}
|
||||
String target = String.format("%s%s%s", percent, key, percent);
|
||||
StringBuilder i18n = new StringBuilder(key);
|
||||
|
||||
|
||||
int start = str.indexOf("{");
|
||||
int end = str.indexOf("}");
|
||||
List<String> parameters = new ArrayList<>();
|
||||
@ -452,22 +466,22 @@ public class QmsInspecDetailServiceImpl extends ExpansionServiceImpl<QmsInspecDe
|
||||
i18n.append(".withParameter");
|
||||
String parameter = str.substring(start, end + 1);
|
||||
str = str.replace(parameter, "");
|
||||
|
||||
|
||||
String params = parameter.replace("{", "").replace("}", "");
|
||||
parameters.addAll(Arrays.asList(params.split(",")));
|
||||
}
|
||||
String[] objects = parameters.toArray(new String[parameters.size()]);
|
||||
|
||||
|
||||
if ("nc.description".equalsIgnoreCase(key)) {
|
||||
String ncCode = str.split(":")[0];
|
||||
|
||||
|
||||
String value = "";
|
||||
if (StrUtil.isNotBlank(ncCode)) {
|
||||
NcBasis ncBasis = ncBasisMapper.selectById(NcBasis.genHandle(site, ncCode));
|
||||
if (ObjectUtil.isNotNull(ncBasis)) {
|
||||
value = ncBasis.getDescription();
|
||||
}
|
||||
|
||||
|
||||
if (StrUtil.isBlank(value)) {
|
||||
value = ncCode;
|
||||
}
|
||||
@ -475,21 +489,22 @@ public class QmsInspecDetailServiceImpl extends ExpansionServiceImpl<QmsInspecDe
|
||||
str = replace(str, target, value);
|
||||
continue;
|
||||
}
|
||||
str = replace(str, target, I18nUtil.getMessageSource().getMessage(i18n.toString(), objects, I18nUtil.getLocale()));
|
||||
str = replace(str, target,
|
||||
I18nUtil.getMessageSource().getMessage(i18n.toString(), objects, I18nUtil.getLocale()));
|
||||
} while (str.contains("%"));
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
private String keyword(String str) {
|
||||
int start = str.indexOf(percent) + 1;
|
||||
int end = str.indexOf(percent, start);
|
||||
|
||||
|
||||
if (start < 1 || end < 0) {
|
||||
return null;
|
||||
}
|
||||
return str.substring(start, end);
|
||||
}
|
||||
|
||||
|
||||
private String replace(String str, String oldChar, String newChar) {
|
||||
return str.replace(oldChar, newChar);
|
||||
}
|
||||
|
||||
@ -14,12 +14,13 @@ import java.util.List;
|
||||
* 检验任务-要因
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-17 09:29:13
|
||||
* @since 2023-07-17 09:29:13
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class QmsInspecFactorServiceImpl extends ExpansionServiceImpl<QmsInspecFactorMapper, QmsInspecFactor> implements QmsInspecFactorService {
|
||||
|
||||
public class QmsInspecFactorServiceImpl extends ExpansionServiceImpl<QmsInspecFactorMapper, QmsInspecFactor>
|
||||
implements QmsInspecFactorService {
|
||||
|
||||
@Override
|
||||
public List<QmsInspecFactorDTO> selectAll(String inspecDetailBo) {
|
||||
return baseMapper.selectAll(inspecDetailBo);
|
||||
|
||||
@ -24,18 +24,18 @@ import java.util.Map;
|
||||
* 检验频率表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-06-06 15:15:24
|
||||
* @since 2023-06-06 15:15:24
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class QmsInspecFreqServiceImpl extends ServiceImpl<QmsInspecFreqMapper, QmsInspecFreq> implements QmsInspecFreqService {
|
||||
|
||||
public class QmsInspecFreqServiceImpl extends ServiceImpl<QmsInspecFreqMapper, QmsInspecFreq>
|
||||
implements QmsInspecFreqService {
|
||||
|
||||
@Override
|
||||
public InspecFreq getFreq(String site, String inspecNo) {
|
||||
QmsInspecFreq inspecFreq = getOne(Wrappers.lambdaQuery(QmsInspecFreq.class)
|
||||
.eq(QmsInspecFreq::getSite, site)
|
||||
QmsInspecFreq inspecFreq = getOne(Wrappers.lambdaQuery(QmsInspecFreq.class).eq(QmsInspecFreq::getSite, site)
|
||||
.eq(QmsInspecFreq::getInspecNo, inspecNo));
|
||||
|
||||
|
||||
Map<String, List<FreqItem>> inspecFreqMap = new HashMap<>();
|
||||
if (ObjectUtil.isNotNull(inspecFreq)) {
|
||||
String afterSfc = inspecFreq.getStopAfterSfc().stripTrailingZeros().toPlainString();
|
||||
@ -44,7 +44,7 @@ public class QmsInspecFreqServiceImpl extends ServiceImpl<QmsInspecFreqMapper, Q
|
||||
String severalSfc = inspecFreq.getSeveralSfc().toString();
|
||||
String dailyFixedTime = inspecFreq.getDailyFixedTime();
|
||||
String dailyFirstSfc = inspecFreq.getDailyFirstSfc();
|
||||
|
||||
|
||||
List<FreqItem> iList = new ArrayList<>();
|
||||
iList.add(new FreqItem(inspecFreq.getChkFirstSfc(), "inspec.chk.first.sfc", null));
|
||||
iList.add(new FreqItem(inspecFreq.getChkDailyFirstSfc(), "inspec.chk.daily.first.sfc", dailyFirstSfc));
|
||||
@ -59,13 +59,13 @@ public class QmsInspecFreqServiceImpl extends ServiceImpl<QmsInspecFreqMapper, Q
|
||||
}
|
||||
return new InspecFreq(inspecFreq, inspecFreqMap);
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void insertFreq(QmsInspecFreq qmsInspecFreq) {
|
||||
QmsInspecFreq inspecFreq = getOne(Wrappers.lambdaQuery(QmsInspecFreq.class)
|
||||
.eq(QmsInspecFreq::getSite, qmsInspecFreq.getSite())
|
||||
.eq(QmsInspecFreq::getInspecNo, qmsInspecFreq.getInspecNo()));
|
||||
QmsInspecFreq inspecFreq = getOne(
|
||||
Wrappers.lambdaQuery(QmsInspecFreq.class).eq(QmsInspecFreq::getSite, qmsInspecFreq.getSite())
|
||||
.eq(QmsInspecFreq::getInspecNo, qmsInspecFreq.getInspecNo()));
|
||||
if (ObjectUtil.isNotNull(inspecFreq)) {
|
||||
removeById(inspecFreq.getHandle());
|
||||
}
|
||||
@ -74,17 +74,16 @@ public class QmsInspecFreqServiceImpl extends ServiceImpl<QmsInspecFreqMapper, Q
|
||||
qmsInspecFreq.setModifiedDateTime(LocalDateTime.now());
|
||||
save(qmsInspecFreq);
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void deleteFreq(String handle) {
|
||||
removeById(handle);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<QmsInspecFreq> findInspec(String site, String inspecNo) {
|
||||
return super.list(Wrappers.<QmsInspecFreq>lambdaQuery()
|
||||
.eq(QmsInspecFreq::getSite, site)
|
||||
return super.list(Wrappers.<QmsInspecFreq>lambdaQuery().eq(QmsInspecFreq::getSite, site)
|
||||
.eq(StrUtil.isNotBlank(inspecNo), QmsInspecFreq::getInspecNo, inspecNo)
|
||||
.orderByAsc(QmsInspecFreq::getInspecNo));
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -14,17 +14,19 @@ import java.util.List;
|
||||
* 检验任务-不合格代码
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-17 09:32:45
|
||||
* @since 2023-07-17 09:32:45
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class QmsInspecResultNccodeServiceImpl extends ExpansionServiceImpl<QmsInspecResultNccodeMapper, QmsInspecResultNccode> implements QmsInspecResultNccodeService {
|
||||
|
||||
public class QmsInspecResultNccodeServiceImpl
|
||||
extends ExpansionServiceImpl<QmsInspecResultNccodeMapper, QmsInspecResultNccode>
|
||||
implements QmsInspecResultNccodeService {
|
||||
|
||||
@Override
|
||||
public List<QmsInspecResultNccodeDTO> selectAll(String inspecResultSid) {
|
||||
return baseMapper.selectAll(inspecResultSid);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<QmsInspecResultNccodeDTO> selectNc(String operationBo) {
|
||||
return baseMapper.selectNcByOperation(operationBo);
|
||||
|
||||
@ -11,9 +11,11 @@ import org.springframework.stereotype.Service;
|
||||
* 检验任务-检验结果
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-17 09:31:34
|
||||
* @since 2023-07-17 09:31:34
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class QmsInspecResultServiceImpl extends ExpansionServiceImpl<QmsInspecResultMapper, QmsInspecResult> implements QmsInspecResultService {
|
||||
public class QmsInspecResultServiceImpl extends ExpansionServiceImpl<QmsInspecResultMapper, QmsInspecResult>
|
||||
implements QmsInspecResultService {
|
||||
|
||||
}
|
||||
|
||||
@ -11,9 +11,11 @@ import org.springframework.stereotype.Service;
|
||||
* 检验任务-SN
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-17 09:30:31
|
||||
* @since 2023-07-17 09:30:31
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class QmsInspecSnServiceImpl extends ExpansionServiceImpl<QmsInspecSnMapper, QmsInspecSn> implements QmsInspecSnService {
|
||||
public class QmsInspecSnServiceImpl extends ExpansionServiceImpl<QmsInspecSnMapper, QmsInspecSn>
|
||||
implements QmsInspecSnService {
|
||||
|
||||
}
|
||||
|
||||
@ -11,9 +11,11 @@ import org.springframework.stereotype.Service;
|
||||
* 检验项目要因表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-11 11:38:01
|
||||
* @since 2023-07-11 11:38:01
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class QmsQcItemFactorServiceImpl extends ExpansionServiceImpl<QmsQcItemFactorMapper, QmsQcItemFactor> implements QmsQcItemFactorService {
|
||||
public class QmsQcItemFactorServiceImpl extends ExpansionServiceImpl<QmsQcItemFactorMapper, QmsQcItemFactor>
|
||||
implements QmsQcItemFactorService {
|
||||
|
||||
}
|
||||
|
||||
@ -36,39 +36,39 @@ import java.util.List;
|
||||
* 检验项目表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-06-07 10:23:18
|
||||
* @since 2023-06-07 10:23:18
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class QmsQcItemServiceImpl extends ServiceImpl<QmsQcItemMapper, QmsQcItem> implements QmsQcItemService {
|
||||
|
||||
|
||||
private final QmsQcItemFactorService qmsQcItemFactorService;
|
||||
|
||||
|
||||
private final RemoteParamService remoteParamService;
|
||||
|
||||
|
||||
private final RemoteSystemTransactionLogService remoteSystemTransactionLogService;
|
||||
|
||||
|
||||
private QmsQcPlanDetailService getQmsQcPlanDetailService() {
|
||||
return SpringUtil.getBean(QmsQcPlanDetailService.class);
|
||||
}
|
||||
|
||||
|
||||
private static final String UPD = "UPD";
|
||||
|
||||
private static final String DEL = "DEL";
|
||||
|
||||
|
||||
@Override
|
||||
public QmsQcItem getOne(String site, String qcItem) {
|
||||
QmsQcItem qmsQcItem = getOne(Wrappers.lambdaQuery(QmsQcItem.class)
|
||||
.eq(QmsQcItem::getSite, site)
|
||||
.eq(QmsQcItem::getQcItem, qcItem));
|
||||
QmsQcItem qmsQcItem = getOne(
|
||||
Wrappers.lambdaQuery(QmsQcItem.class).eq(QmsQcItem::getSite, site).eq(QmsQcItem::getQcItem, qcItem));
|
||||
if (ObjectUtil.isNull(qmsQcItem)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
qmsQcItem.setFactors(qmsQcItemFactorService.list(Wrappers.lambdaQuery(QmsQcItemFactor.class)
|
||||
.eq(QmsQcItemFactor::getQcItemBo, qmsQcItem.getHandle())));
|
||||
|
||||
qmsQcItem.setFactors(qmsQcItemFactorService.list(
|
||||
Wrappers.lambdaQuery(QmsQcItemFactor.class).eq(QmsQcItemFactor::getQcItemBo, qmsQcItem.getHandle())));
|
||||
return qmsQcItem;
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void insertOrUpdate(QmsQcItem qmsQcItem) {
|
||||
@ -76,7 +76,7 @@ public class QmsQcItemServiceImpl extends ServiceImpl<QmsQcItemMapper, QmsQcItem
|
||||
if (StrUtil.isBlank(qmsQcItem.getHandle()) && ObjectUtil.isNotNull(oriQcItem)) {
|
||||
throw BusinessException.build(I18nUtil.getI18nText("qc.item.error1", qmsQcItem.getQcItem()));
|
||||
}
|
||||
|
||||
|
||||
if (ObjectUtil.isNull(oriQcItem)) {
|
||||
qmsQcItem.setHandle(QmsQcItem.genHandle(qmsQcItem.getSite(), qmsQcItem.getQcItem()));
|
||||
qmsQcItem.setDateCreate(LocalDateTime.now());
|
||||
@ -86,9 +86,9 @@ public class QmsQcItemServiceImpl extends ServiceImpl<QmsQcItemMapper, QmsQcItem
|
||||
syncSpc(qmsQcItem, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
valida(qmsQcItem.getHandle(), UPD);
|
||||
|
||||
|
||||
qmsQcItem.setCreator(oriQcItem.getCreator());
|
||||
qmsQcItem.setDateCreate(oriQcItem.getDateCreate());
|
||||
qmsQcItem.setDateUpdate(LocalDateTime.now());
|
||||
@ -97,29 +97,29 @@ public class QmsQcItemServiceImpl extends ServiceImpl<QmsQcItemMapper, QmsQcItem
|
||||
saveFactors(qmsQcItem.getHandle(), qmsQcItem.getFactors());
|
||||
syncSpc(qmsQcItem, 1);
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void delete(String handle) {
|
||||
valida(handle, DEL);
|
||||
syncSpc(super.getById(handle), 2);
|
||||
removeById(handle);
|
||||
qmsQcItemFactorService.remove(Wrappers.lambdaQuery(QmsQcItemFactor.class)
|
||||
.eq(QmsQcItemFactor::getQcItemBo, handle));
|
||||
qmsQcItemFactorService.remove(
|
||||
Wrappers.lambdaQuery(QmsQcItemFactor.class).eq(QmsQcItemFactor::getQcItemBo, handle));
|
||||
}
|
||||
|
||||
|
||||
private void saveFactors(String qcItemBo, List<QmsQcItemFactor> factorList) {
|
||||
String site = HandleBoProcessor.trimSite(qcItemBo);
|
||||
qmsQcItemFactorService.remove(Wrappers.lambdaQuery(QmsQcItemFactor.class)
|
||||
.eq(QmsQcItemFactor::getQcItemBo, qcItemBo));
|
||||
|
||||
qmsQcItemFactorService.remove(
|
||||
Wrappers.lambdaQuery(QmsQcItemFactor.class).eq(QmsQcItemFactor::getQcItemBo, qcItemBo));
|
||||
|
||||
factorList.forEach(qmsQcItemFactor -> {
|
||||
qmsQcItemFactor.setHandle(QmsQcItemFactor.genHandle(site, qcItemBo, qmsQcItemFactor.getFactorBo()));
|
||||
qmsQcItemFactor.setQcItemBo(qcItemBo);
|
||||
});
|
||||
qmsQcItemFactorService.saveMulti(factorList);
|
||||
}
|
||||
|
||||
|
||||
//type : 1:save , 2:delete
|
||||
private void syncSpc(QmsQcItem qmsQcItem, int type) {
|
||||
String url = remoteParamService.getByKey("SPC_RESTFUL_URL", SecurityConstants.FROM_IN).getData();
|
||||
@ -138,7 +138,7 @@ public class QmsQcItemServiceImpl extends ServiceImpl<QmsQcItemMapper, QmsQcItem
|
||||
log.setFunctionName("/targetTypeParams/{qcItem}");
|
||||
log.setMethodName("QmsQcItemService.delete");
|
||||
}
|
||||
|
||||
|
||||
SpcExecuteRequest spcExecuteRequest = new SpcExecuteRequest();
|
||||
spcExecuteRequest.setUrl(url);
|
||||
spcExecuteRequest.setSite(qmsQcItem.getSite());
|
||||
@ -150,7 +150,7 @@ public class QmsQcItemServiceImpl extends ServiceImpl<QmsQcItemMapper, QmsQcItem
|
||||
spcExecuteRequest.setSampleSize(qmsQcItem.getSampleSize());
|
||||
spcExecuteRequest.setChartControl(qmsQcItem.getChartControl());
|
||||
spcExecuteRequest.setInspecType(qmsQcItem.getInspecType());
|
||||
|
||||
|
||||
HttpResponse response;
|
||||
if (type == 1) {
|
||||
spcExecuteRequest.setMethod(SpcMethod.TARGET_PARAM_SYNC);
|
||||
@ -158,7 +158,7 @@ public class QmsQcItemServiceImpl extends ServiceImpl<QmsQcItemMapper, QmsQcItem
|
||||
spcExecuteRequest.setMethod(SpcMethod.TARGET_PARAM_DEL_SYNC);
|
||||
}
|
||||
response = SpcInvoke.sync(spcExecuteRequest);
|
||||
|
||||
|
||||
if (response != null) {
|
||||
log.setRequest(response.getRequest());
|
||||
if (StrUtil.isBlank(response.getResponse())) {
|
||||
@ -174,17 +174,17 @@ public class QmsQcItemServiceImpl extends ServiceImpl<QmsQcItemMapper, QmsQcItem
|
||||
log.setMessage(response.getResponse());
|
||||
}
|
||||
remoteSystemTransactionLogService.save(log);
|
||||
|
||||
|
||||
if ("Fail".equals(log.getResult())) {
|
||||
throw BusinessException.build(I18nUtil.getI18nText("qms.spc.sync.msg", response.getResponse()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void valida(String handle, String type) {
|
||||
QmsQcPlanDetail planDetail = getQmsQcPlanDetailService().getOne(Wrappers.lambdaQuery(QmsQcPlanDetail.class)
|
||||
.eq(QmsQcPlanDetail::getQcItemBo, handle), false);
|
||||
QmsQcPlanDetail planDetail = getQmsQcPlanDetailService().getOne(
|
||||
Wrappers.lambdaQuery(QmsQcPlanDetail.class).eq(QmsQcPlanDetail::getQcItemBo, handle), false);
|
||||
if (ObjectUtil.isNotNull(planDetail)) {
|
||||
String qcPlan = HandleBoProcessor.trimHandle(planDetail.getQcPlanBo());
|
||||
String qcItem = HandleBoProcessor.trimHandle(handle);
|
||||
|
||||
@ -10,9 +10,10 @@ import org.springframework.stereotype.Service;
|
||||
* 检验计划明细表
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-11 16:30:35
|
||||
* @since 2023-07-11 16:30:35
|
||||
*/
|
||||
@Service
|
||||
public class QmsQcPlanDetailServiceImpl extends ExpansionServiceImpl<QmsQcPlanDetailMapper, QmsQcPlanDetail> implements QmsQcPlanDetailService {
|
||||
|
||||
public class QmsQcPlanDetailServiceImpl extends ExpansionServiceImpl<QmsQcPlanDetailMapper, QmsQcPlanDetail>
|
||||
implements QmsQcPlanDetailService {
|
||||
|
||||
}
|
||||
|
||||
@ -17,10 +17,19 @@ import com.foreverwin.iep.common.utils.SidUtils;
|
||||
import com.foreverwin.iep.prd.domain.SaveCustomDataRequest;
|
||||
import com.foreverwin.iep.prd.feign.RemoteCustomFieldsService;
|
||||
import com.foreverwin.iep.qms.domain.UserGroup;
|
||||
import com.foreverwin.iep.qms.entity.*;
|
||||
import com.foreverwin.iep.qms.entity.QmsInspecFreq;
|
||||
import com.foreverwin.iep.qms.entity.QmsInspecJob;
|
||||
import com.foreverwin.iep.qms.entity.QmsQcItem;
|
||||
import com.foreverwin.iep.qms.entity.QmsQcPlan;
|
||||
import com.foreverwin.iep.qms.entity.QmsQcPlanDetail;
|
||||
import com.foreverwin.iep.qms.entity.QmsSamplePlan;
|
||||
import com.foreverwin.iep.qms.mapper.QmsQcPlanDetailMapper;
|
||||
import com.foreverwin.iep.qms.mapper.QmsQcPlanMapper;
|
||||
import com.foreverwin.iep.qms.service.*;
|
||||
import com.foreverwin.iep.qms.service.QmsInspecFreqService;
|
||||
import com.foreverwin.iep.qms.service.QmsInspecJobService;
|
||||
import com.foreverwin.iep.qms.service.QmsQcItemService;
|
||||
import com.foreverwin.iep.qms.service.QmsQcPlanDetailService;
|
||||
import com.foreverwin.iep.qms.service.QmsQcPlanService;
|
||||
import com.foreverwin.iep.sys.entity.SystemTransactionLog;
|
||||
import com.foreverwin.iep.sys.feign.RemoteSystemTransactionLogService;
|
||||
import com.foreverwin.mom.admin.api.entity.SysRole;
|
||||
@ -29,7 +38,6 @@ import com.foreverwin.mom.admin.api.feign.RemoteRoleService;
|
||||
import com.foreverwin.mom.common.core.constant.SecurityConstants;
|
||||
import com.foreverwin.mom.common.core.exception.BusinessException;
|
||||
import com.foreverwin.mom.common.core.util.I18nUtil;
|
||||
import com.foreverwin.mom.common.core.util.R;
|
||||
import com.foreverwin.mom.common.data.tenant.TenantContextHolder;
|
||||
import com.foreverwin.mom.common.security.util.SecurityUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -45,84 +53,90 @@ import java.util.stream.Collectors;
|
||||
* 检验计划
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-11 16:28:57
|
||||
* @since 2023-07-11 16:28:57
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class QmsQcPlanServiceImpl extends ServiceImpl<QmsQcPlanMapper, QmsQcPlan> implements QmsQcPlanService {
|
||||
|
||||
|
||||
private QmsQcPlanDetailService qmsQcPlanDetailService;
|
||||
|
||||
private QmsInspecFreqService qmsInspecFreqService;
|
||||
|
||||
private QmsQcPlanDetailMapper qmsQcPlanDetailMapper;
|
||||
|
||||
private QmsQcItemService qmsQcItemService;
|
||||
|
||||
private final RemoteParamService remoteParamService;
|
||||
|
||||
private final RemoteSystemTransactionLogService remoteSystemTransactionLogService;
|
||||
|
||||
private final RemoteRoleService remoteRoleService;
|
||||
|
||||
private final RemoteCustomFieldsService remoteCustomFieldsService;
|
||||
|
||||
|
||||
private QmsInspecJobService getQmsInspecJobService() {
|
||||
return SpringUtil.getBean(QmsInspecJobService.class);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public QmsQcPlan getFullById(String handle) {
|
||||
|
||||
|
||||
QmsQcPlan qcPlan = super.getById(handle);
|
||||
|
||||
|
||||
QmsInspecFreq inspecFreq = qmsInspecFreqService.getById(qcPlan.getInspecFreqBo());
|
||||
|
||||
|
||||
if (inspecFreq != null) {
|
||||
qcPlan.setInspecFreqNo(inspecFreq.getInspecNo());
|
||||
qcPlan.setInspecFreqDesc(inspecFreq.getDescription());
|
||||
}
|
||||
|
||||
|
||||
qcPlan.setQcPlanDetailList(qmsQcPlanDetailMapper.getFullDetailByQcPlanBo(handle));
|
||||
|
||||
qcPlan.setCreatedJob(getQmsInspecJobService().count(Wrappers.<QmsInspecJob>lambdaQuery()
|
||||
.eq(QmsInspecJob::getQcPlanBo, handle)) > 0);
|
||||
|
||||
|
||||
qcPlan.setCreatedJob(getQmsInspecJobService().count(
|
||||
Wrappers.<QmsInspecJob>lambdaQuery().eq(QmsInspecJob::getQcPlanBo, handle)) > 0);
|
||||
|
||||
return qcPlan;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public QmsQcPlan getCurrentFullById(String qcPlan) {
|
||||
QmsQcPlan qmsQcPlan = super.getOne(Wrappers.<QmsQcPlan>lambdaQuery()
|
||||
.eq(QmsQcPlan::getSite, TenantContextHolder.getTenantId())
|
||||
.eq(QmsQcPlan::getQcPlan, qcPlan)
|
||||
.eq(QmsQcPlan::getCurrentRevision, "Y"));
|
||||
QmsQcPlan qmsQcPlan = super.getOne(
|
||||
Wrappers.<QmsQcPlan>lambdaQuery().eq(QmsQcPlan::getSite, TenantContextHolder.getTenantId())
|
||||
.eq(QmsQcPlan::getQcPlan, qcPlan).eq(QmsQcPlan::getCurrentRevision, "Y"));
|
||||
if (qmsQcPlan == null) {
|
||||
throw BusinessException.build(I18nUtil.getI18nText("qms.qc.plan.error3", qcPlan));
|
||||
} else {
|
||||
return this.getFullById(qmsQcPlan.getHandle());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void validateAndSave(QmsQcPlan qmsQcPlan) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
qmsQcPlan.setHandle(QmsQcPlan.genHandle(site, qmsQcPlan.getQcPlan(), qmsQcPlan.getRevision()));
|
||||
if (super.baseMapper.exists(Wrappers.<QmsQcPlan>lambdaQuery()
|
||||
.eq(QmsQcPlan::getHandle, qmsQcPlan.getHandle()))) {
|
||||
throw BusinessException.build(I18nUtil.getI18nText("qms.qc.plan.error1", qmsQcPlan.getQcPlan(), qmsQcPlan.getRevision()));
|
||||
if (super.baseMapper.exists(
|
||||
Wrappers.<QmsQcPlan>lambdaQuery().eq(QmsQcPlan::getHandle, qmsQcPlan.getHandle()))) {
|
||||
throw BusinessException.build(
|
||||
I18nUtil.getI18nText("qms.qc.plan.error1", qmsQcPlan.getQcPlan(), qmsQcPlan.getRevision()));
|
||||
}
|
||||
|
||||
|
||||
qmsQcPlan.setDateCreate(LocalDateTime.now());
|
||||
qmsQcPlan.setCreator(SecurityUtils.getUserName());
|
||||
|
||||
|
||||
if ("Y".equals(qmsQcPlan.getCurrentRevision())) {
|
||||
super.update(Wrappers.<QmsQcPlan>lambdaUpdate()
|
||||
.eq(QmsQcPlan::getSite, site)
|
||||
super.update(Wrappers.<QmsQcPlan>lambdaUpdate().eq(QmsQcPlan::getSite, site)
|
||||
.eq(QmsQcPlan::getQcPlan, qmsQcPlan.getQcPlan())
|
||||
.set(QmsQcPlan::getCurrentRevision, "N"));
|
||||
}
|
||||
|
||||
|
||||
super.save(qmsQcPlan);
|
||||
saveCustomData(qmsQcPlan);
|
||||
|
||||
qmsQcPlanDetailService.remove(Wrappers.<QmsQcPlanDetail>lambdaQuery()
|
||||
.eq(QmsQcPlanDetail::getQcPlanBo, qmsQcPlan.getHandle()));
|
||||
|
||||
|
||||
qmsQcPlanDetailService.remove(
|
||||
Wrappers.<QmsQcPlanDetail>lambdaQuery().eq(QmsQcPlanDetail::getQcPlanBo, qmsQcPlan.getHandle()));
|
||||
|
||||
qmsQcPlan.getQcPlanDetailList().forEach(detail -> {
|
||||
detail.setQcPlanBo(qmsQcPlan.getHandle());
|
||||
detail.setQcItemBo(QmsQcItem.genHandle(site, detail.getQcItem()));
|
||||
@ -134,28 +148,27 @@ public class QmsQcPlanServiceImpl extends ServiceImpl<QmsQcPlanMapper, QmsQcPlan
|
||||
});
|
||||
syncSpc(qmsQcPlan, 1);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void validateAndUpdate(QmsQcPlan qmsQcPlan) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
|
||||
|
||||
qmsQcPlan.setUpdater(SecurityUtils.getUserName());
|
||||
qmsQcPlan.setDateUpdate(LocalDateTime.now());
|
||||
|
||||
|
||||
if ("Y".equals(qmsQcPlan.getCurrentRevision())) {
|
||||
super.update(Wrappers.<QmsQcPlan>lambdaUpdate()
|
||||
.eq(QmsQcPlan::getSite, site)
|
||||
super.update(Wrappers.<QmsQcPlan>lambdaUpdate().eq(QmsQcPlan::getSite, site)
|
||||
.eq(QmsQcPlan::getQcPlan, qmsQcPlan.getQcPlan())
|
||||
.set(QmsQcPlan::getCurrentRevision, "N"));
|
||||
}
|
||||
|
||||
|
||||
super.updateById(qmsQcPlan);
|
||||
saveCustomData(qmsQcPlan);
|
||||
|
||||
qmsQcPlanDetailService.remove(Wrappers.<QmsQcPlanDetail>lambdaQuery()
|
||||
.eq(QmsQcPlanDetail::getQcPlanBo, qmsQcPlan.getHandle()));
|
||||
|
||||
|
||||
qmsQcPlanDetailService.remove(
|
||||
Wrappers.<QmsQcPlanDetail>lambdaQuery().eq(QmsQcPlanDetail::getQcPlanBo, qmsQcPlan.getHandle()));
|
||||
|
||||
qmsQcPlan.getQcPlanDetailList().forEach(detail -> {
|
||||
detail.setQcItemBo(QmsQcItem.genHandle(site, detail.getQcItem()));
|
||||
detail.setHandle(QmsQcPlanDetail.genHandle(qmsQcPlan.getHandle(), detail.getQcItemBo()));
|
||||
@ -167,23 +180,22 @@ public class QmsQcPlanServiceImpl extends ServiceImpl<QmsQcPlanMapper, QmsQcPlan
|
||||
});
|
||||
syncSpc(qmsQcPlan, 2);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void validateAndDelete(String handle) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
QmsQcPlan qcPlan = getById(handle);
|
||||
|
||||
if (getQmsInspecJobService().count(Wrappers.<QmsInspecJob>lambdaQuery()
|
||||
.eq(QmsInspecJob::getQcPlanBo, handle)) > 0) {
|
||||
|
||||
if (getQmsInspecJobService().count(Wrappers.<QmsInspecJob>lambdaQuery().eq(QmsInspecJob::getQcPlanBo, handle))
|
||||
> 0) {
|
||||
throw BusinessException.build(I18nUtil.getI18nText("qms.qc.plan.error2", qcPlan.getQcPlan()));
|
||||
}
|
||||
|
||||
|
||||
super.removeById(handle);
|
||||
qmsQcPlanDetailService.remove(Wrappers.<QmsQcPlanDetail>lambdaQuery()
|
||||
.eq(QmsQcPlanDetail::getQcPlanBo, handle));
|
||||
qmsQcPlanDetailService.remove(Wrappers.<QmsQcPlanDetail>lambdaQuery().eq(QmsQcPlanDetail::getQcPlanBo, handle));
|
||||
remoteCustomFieldsService.removeCustomData(handle, SecurityConstants.FROM_IN);
|
||||
|
||||
|
||||
String url = remoteParamService.getByKey("SPC_RESTFUL_URL", SecurityConstants.FROM_IN).getData();
|
||||
if (StrUtil.isNotBlank(url) && "1".equals(qcPlan.getToSpc())) {
|
||||
SpcExecuteRequest spcExecuteRequest = new SpcExecuteRequest();
|
||||
@ -199,33 +211,28 @@ public class QmsQcPlanServiceImpl extends ServiceImpl<QmsQcPlanMapper, QmsQcPlan
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<UserGroup> getUserGroup(FrontPage page, String group) {
|
||||
List<SysRole> roles = remoteRoleService.listRoles(SecurityConstants.FROM_IN).getData();
|
||||
|
||||
|
||||
IPage<UserGroup> iPage = super.baseMapper.getUserGroup(page, TenantContextHolder.getTenantId(), group);
|
||||
iPage.setRecords(iPage.getRecords().stream()
|
||||
.peek(userGroup -> {
|
||||
SysRole sysRole = roles.stream()
|
||||
.filter(filters -> filters.getRoleCode()
|
||||
.equals(userGroup.getUserGroup()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
if (ObjectUtil.isNotNull(sysRole)) {
|
||||
userGroup.setRoleName(sysRole.getRoleName());
|
||||
userGroup.setRoleDesc(sysRole.getRoleDesc());
|
||||
}
|
||||
})
|
||||
.collect(Collectors.toList()));
|
||||
iPage.setRecords(iPage.getRecords().stream().peek(userGroup -> {
|
||||
SysRole sysRole = roles.stream().filter(filters -> filters.getRoleCode().equals(userGroup.getUserGroup()))
|
||||
.findFirst().orElse(null);
|
||||
if (ObjectUtil.isNotNull(sysRole)) {
|
||||
userGroup.setRoleName(sysRole.getRoleName());
|
||||
userGroup.setRoleDesc(sysRole.getRoleDesc());
|
||||
}
|
||||
}).collect(Collectors.toList()));
|
||||
return iPage;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<QmsQcPlan> getDistinctQcPlan(FrontPage page, String qcPlan) {
|
||||
return super.baseMapper.getDistinctQcPlan(page, TenantContextHolder.getTenantId(), qcPlan);
|
||||
}
|
||||
|
||||
|
||||
//type : 1:save, 2:update , 3:delete
|
||||
private void syncSpc(QmsQcPlan qcPlan, int type) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
@ -245,7 +252,7 @@ public class QmsQcPlanServiceImpl extends ServiceImpl<QmsQcPlanMapper, QmsQcPlan
|
||||
log.setFunctionName("/dc/planData/_sync");
|
||||
log.setMethodName("QmsQcPlanService.validateAndUpdate");
|
||||
}
|
||||
|
||||
|
||||
SpcExecuteRequest spcExecuteRequest = new SpcExecuteRequest();
|
||||
spcExecuteRequest.setUrl(url);
|
||||
spcExecuteRequest.setSite(site);
|
||||
@ -253,17 +260,16 @@ public class QmsQcPlanServiceImpl extends ServiceImpl<QmsQcPlanMapper, QmsQcPlan
|
||||
spcExecuteRequest.setDescription(qcPlan.getDescription());
|
||||
spcExecuteRequest.setCreatedUser(qcPlan.getCreator());
|
||||
spcExecuteRequest.setRevision(qcPlan.getRevision());
|
||||
|
||||
|
||||
List<PlanItem> items = new ArrayList<>();
|
||||
qcPlan.getQcPlanDetailList().forEach(detail -> {
|
||||
String qcItem = detail.getQcItem();
|
||||
if (StrUtil.isBlank(detail.getItemType()) ||
|
||||
StrUtil.isBlank(detail.getQcItemDesc())) {
|
||||
if (StrUtil.isBlank(detail.getItemType()) || StrUtil.isBlank(detail.getQcItemDesc())) {
|
||||
QmsQcItem qmsQcItem = qmsQcItemService.getOne(site, qcItem);
|
||||
detail.setItemType(qmsQcItem.getItemType());
|
||||
detail.setQcItemDesc(qmsQcItem.getDescription());
|
||||
}
|
||||
|
||||
|
||||
if (StrUtil.isNotBlank(detail.getChartControl())) {
|
||||
if (!"2".equals(detail.getItemType())) {
|
||||
PlanItem planItem = new PlanItem();
|
||||
@ -295,21 +301,21 @@ public class QmsQcPlanServiceImpl extends ServiceImpl<QmsQcPlanMapper, QmsQcPlan
|
||||
log.setMessage(response.getResponse());
|
||||
}
|
||||
remoteSystemTransactionLogService.save(log);
|
||||
|
||||
|
||||
if ("Fail".equals(log.getResult())) {
|
||||
throw BusinessException.build(I18nUtil.getI18nText("qms.spc.sync.msg", response.getResponse()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void saveCustomData(QmsQcPlan qmsQcPlan) {
|
||||
SaveCustomDataRequest saveCustomDataRequest = new SaveCustomDataRequest();
|
||||
saveCustomDataRequest.setRef(qmsQcPlan.getHandle());
|
||||
saveCustomDataRequest.setDoFieldMerge(false);
|
||||
saveCustomDataRequest.setObjectAlias(TableInfoHelper.getTableInfo(currentModelClass()).getTableName()
|
||||
.toUpperCase());
|
||||
saveCustomDataRequest.setObjectAlias(
|
||||
TableInfoHelper.getTableInfo(currentModelClass()).getTableName().toUpperCase());
|
||||
saveCustomDataRequest.setCustomData(qmsQcPlan.getCustomFields());
|
||||
remoteCustomFieldsService.saveCustomData(saveCustomDataRequest, SecurityConstants.FROM_IN);
|
||||
}
|
||||
|
||||
@ -18,26 +18,28 @@ import java.util.List;
|
||||
* 检验计划使用对象
|
||||
*
|
||||
* @author mom code generator
|
||||
* @date 2023-07-12 11:23:14
|
||||
* @since 2023-07-12 11:23:14
|
||||
*/
|
||||
@Service
|
||||
public class QmsQcPlanTargetServiceImpl extends ServiceImpl<QmsQcPlanTargetMapper, QmsQcPlanTarget> implements QmsQcPlanTargetService {
|
||||
|
||||
public class QmsQcPlanTargetServiceImpl extends ServiceImpl<QmsQcPlanTargetMapper, QmsQcPlanTarget>
|
||||
implements QmsQcPlanTargetService {
|
||||
|
||||
@Override
|
||||
public List<QmsQcPlanTargetDTO> getByTargetBo(String targetBo) {
|
||||
return super.baseMapper.get(targetBo, null);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public boolean saveFullByTargetBo(String targetBo, List<QmsQcPlanTarget> qmsQcPlanTargetList) {
|
||||
String site = TenantContextHolder.getTenantId();
|
||||
|
||||
|
||||
super.remove(Wrappers.<QmsQcPlanTarget>lambdaQuery().eq(QmsQcPlanTarget::getTargetBo, targetBo));
|
||||
|
||||
|
||||
qmsQcPlanTargetList.forEach(qmsQcPlanTarget -> {
|
||||
qmsQcPlanTarget.setSite(site);
|
||||
qmsQcPlanTarget.setHandle(QmsQcPlanTarget.genHandle(site, qmsQcPlanTarget.getQcPlan(), targetBo, qmsQcPlanTarget.getInspectLevel()));
|
||||
qmsQcPlanTarget.setHandle(QmsQcPlanTarget.genHandle(site, qmsQcPlanTarget.getQcPlan(), targetBo,
|
||||
qmsQcPlanTarget.getInspectLevel()));
|
||||
qmsQcPlanTarget.setTargetBo(targetBo);
|
||||
qmsQcPlanTarget.setDateCreate(LocalDateTime.now());
|
||||
qmsQcPlanTarget.setCreator(SecurityUtils.getUserName());
|
||||
@ -45,12 +47,12 @@ public class QmsQcPlanTargetServiceImpl extends ServiceImpl<QmsQcPlanTargetMappe
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<QmsQcPlanTargetDTO> getByTargetBoAndInspectLevel(String targetBo, String inspectLevel) {
|
||||
return super.baseMapper.get(targetBo, inspectLevel);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<QmsQcPlanTargetDTO> getTargetByInstrumentGroup(String site) {
|
||||
return baseMapper.selectTargetByInstrumentGroup(site);
|
||||
|
||||
@ -10,9 +10,10 @@ import org.springframework.stereotype.Service;
|
||||
* 抽样计划主表自定义
|
||||
*
|
||||
* @author paul
|
||||
* @date 2022-12-28 14:42:35
|
||||
* @since 2022-12-28 14:42:35
|
||||
*/
|
||||
@Service
|
||||
public class QmsSamplePlanCustomizeServiceImpl extends ServiceImpl<QmsSamplePlanCustomizeMapper, QmsSamplePlanCustomize> implements QmsSamplePlanCustomizeService {
|
||||
|
||||
public class QmsSamplePlanCustomizeServiceImpl extends ServiceImpl<QmsSamplePlanCustomizeMapper, QmsSamplePlanCustomize>
|
||||
implements QmsSamplePlanCustomizeService {
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user