feat(触发全检/抽检):进出站调用质量模块逻辑大修改
This commit is contained in:
parent
d4f5d5e9e9
commit
36b5ec7afd
@ -15,8 +15,8 @@ public class AutoCreateJobRequest {
|
|||||||
|
|
||||||
private String user;
|
private String user;
|
||||||
|
|
||||||
// 进出站触发标识 S:进站 E:出站
|
// 进出站触发点 S:开始时 E:完成后
|
||||||
private String triggerType ;
|
private String triggerPoint ;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public static class BasisInfo {
|
public static class BasisInfo {
|
||||||
|
|||||||
@ -94,4 +94,15 @@ public class QmsInspecJobDTO extends QmsInspecJob {
|
|||||||
private String approvalMessage;//申请消息
|
private String approvalMessage;//申请消息
|
||||||
private String orgLotNo;//大批次
|
private String orgLotNo;//大批次
|
||||||
private String orgLot;//大批次对应的lot
|
private String orgLot;//大批次对应的lot
|
||||||
|
|
||||||
|
// 触发点 S:开始时 E:完成后
|
||||||
|
private String triggerPoint ;
|
||||||
|
// // 质检等级
|
||||||
|
// private String inspectionLevel ;
|
||||||
|
// 库存状态
|
||||||
|
private String inventoryStatus ;
|
||||||
|
// 检验频率 主键
|
||||||
|
private String inspecFreqBo;
|
||||||
|
// 工单主键
|
||||||
|
private String shopOrderBo;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,6 +47,12 @@ public class ZProductionLotInspectTaskRelation extends Model<ZProductionLotInspe
|
|||||||
@ApiModelProperty(value="生产批号")
|
@ApiModelProperty(value="生产批号")
|
||||||
private String lotNo;
|
private String lotNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="工单号")
|
||||||
|
private String shopOrder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工序
|
* 工序
|
||||||
*/
|
*/
|
||||||
@ -90,7 +96,7 @@ public class ZProductionLotInspectTaskRelation extends Model<ZProductionLotInspe
|
|||||||
private String updater;
|
private String updater;
|
||||||
|
|
||||||
// 生产批号+工序+检验细类+触发点
|
// 生产批号+工序+检验细类+触发点
|
||||||
public static String genHandle(String site, String lotNo, String operation, String qcSubCategories, String triggerPoint) {
|
public static String genHandle(String site, String lotNo,String shopOrder, String operation, String qcSubCategories, String triggerPoint) {
|
||||||
return HandleBoProcessor.genHandle(KW_Z_PRODUCTION_LOT_INSPECT_TASK_RELATION_BO, site, lotNo, operation, qcSubCategories, triggerPoint);
|
return HandleBoProcessor.genHandle(KW_Z_PRODUCTION_LOT_INSPECT_TASK_RELATION_BO, site, lotNo, shopOrder, operation, qcSubCategories, triggerPoint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,198 @@
|
|||||||
|
package com.foreverwin.iep.qms.entity;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||||
|
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 leiqiaozhen
|
||||||
|
* @date 2024-12-25 18:40:25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("z_qms_lot_quality_inspect_status_log")
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel(value = "生产批检验任务质检等级与状态日志")
|
||||||
|
public class ZQmsLotQualityInspectStatusLog extends Model<ZQmsLotQualityInspectStatusLog> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UUID
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value="UUID")
|
||||||
|
private String sid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工厂
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="工厂")
|
||||||
|
private String site;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批次/条码
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="批次/条码")
|
||||||
|
private String inventoryId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="工单")
|
||||||
|
private String shopOrder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="工序")
|
||||||
|
private String operation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="设备")
|
||||||
|
private String resrce;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 复判前等级
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="复判前等级")
|
||||||
|
private String originalLevel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 复判后等级
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="复判后等级")
|
||||||
|
private String rejudgLevel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 复判前物料
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="复判前物料")
|
||||||
|
private String itemBo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 复判后物料
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="复判后物料")
|
||||||
|
private String newItemBo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 复判前长度
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="复判前长度")
|
||||||
|
private String originalLength;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 复判后长度
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="复判后长度")
|
||||||
|
private String newLength;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否变更料号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="是否变更料号")
|
||||||
|
private String changeItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 降级过程履历
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="降级过程履历")
|
||||||
|
private String demotionProcessHistory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 复判降级原因
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="复判降级原因")
|
||||||
|
private String degradationReasons;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注描述
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="备注描述")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检验细类
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="检验细类")
|
||||||
|
private String inspectSubclass;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检验任务编号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="检验任务编号")
|
||||||
|
private String inspectionTaskNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 存储地点
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="存储地点")
|
||||||
|
private String storageBin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品编号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="产品编号")
|
||||||
|
private String item;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料描述
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="物料描述")
|
||||||
|
private String itemDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 冻结/解冻原因
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="冻结/解冻原因")
|
||||||
|
private String reason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建日期
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="创建日期")
|
||||||
|
private LocalDateTime dateCreate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新日期
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="更新日期")
|
||||||
|
private LocalDateTime dateUpdate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人员
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="创建人员")
|
||||||
|
private String creator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新人员
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="更新人员")
|
||||||
|
private String updater;
|
||||||
|
|
||||||
|
}
|
||||||
@ -4,10 +4,10 @@ import com.foreverwin.iep.qms.domain.AutoCreateJobRequest;
|
|||||||
import com.foreverwin.iep.qms.domain.CreateAndCollectInspectDataSourceResponse;
|
import com.foreverwin.iep.qms.domain.CreateAndCollectInspectDataSourceResponse;
|
||||||
import com.foreverwin.iep.qms.domain.InspecJob;
|
import com.foreverwin.iep.qms.domain.InspecJob;
|
||||||
import com.foreverwin.iep.qms.domain.InspecJobExtend;
|
import com.foreverwin.iep.qms.domain.InspecJobExtend;
|
||||||
|
import com.foreverwin.iep.qms.dto.QmsInspecJobDTO;
|
||||||
import com.foreverwin.iep.qms.entity.QmsInspecJob;
|
import com.foreverwin.iep.qms.entity.QmsInspecJob;
|
||||||
import com.foreverwin.mom.common.core.constant.SecurityConstants;
|
import com.foreverwin.mom.common.core.constant.SecurityConstants;
|
||||||
import com.foreverwin.mom.common.core.util.R;
|
import com.foreverwin.mom.common.core.util.R;
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
@ -21,7 +21,7 @@ import java.util.List;
|
|||||||
public interface RemoteQmsInspecJobService {
|
public interface RemoteQmsInspecJobService {
|
||||||
|
|
||||||
@PostMapping("/inspec-job/api/auto")
|
@PostMapping("/inspec-job/api/auto")
|
||||||
R<List<String>>auto(@RequestBody AutoCreateJobRequest request, @RequestHeader(SecurityConstants.FROM) String from);
|
R<List<QmsInspecJobDTO>>auto(@RequestBody AutoCreateJobRequest request, @RequestHeader(SecurityConstants.FROM) String from);
|
||||||
|
|
||||||
@PostMapping("/inspec-job/api/create")
|
@PostMapping("/inspec-job/api/create")
|
||||||
R<QmsInspecJob> create(@RequestBody InspecJob inspecJob);
|
R<QmsInspecJob> create(@RequestBody InspecJob inspecJob);
|
||||||
|
|||||||
@ -0,0 +1,23 @@
|
|||||||
|
package com.foreverwin.iep.qms.feign;
|
||||||
|
|
||||||
|
import com.foreverwin.iep.qms.entity.QmsRejudgmentLog;
|
||||||
|
import com.foreverwin.iep.qms.entity.ZQmsLotQualityInspectStatusLog;
|
||||||
|
import com.foreverwin.mom.common.core.util.R;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
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 java.util.List;
|
||||||
|
|
||||||
|
@FeignClient(contextId = "remoteQmsLotQualityInspectStatusLogService", value = "iep-qms")
|
||||||
|
public interface RemoteQmsLotQualityInspectStatusLogService {
|
||||||
|
|
||||||
|
@PostMapping({"/z-qms-lot-quality-inspect-status-log/api/createQmsLotQualityInspectStatusLog"})
|
||||||
|
R createQmsLotQualityInspectStatusLog(@RequestBody ZQmsLotQualityInspectStatusLog var1);
|
||||||
|
|
||||||
|
// 根据 站点+lotNo 查询生产批检验任务质检等级与状态日志 Z_QMS_LOT_QUALITY_INSPECT_STATUS_LOG
|
||||||
|
@GetMapping("/z-qms-lot-quality-inspect-status-log/api/getQmsLotQualityInspectStatusLogs/{site}/{lotNo}")
|
||||||
|
R<List<ZQmsLotQualityInspectStatusLog>> getQmsLotQualityInspectStatusLogs(@PathVariable("site") String site, @PathVariable("lotNo") String lotNo);
|
||||||
|
}
|
||||||
@ -0,0 +1,130 @@
|
|||||||
|
package com.foreverwin.iep.qms.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.foreverwin.iep.qms.entity.ZQmsLotQualityInspectStatusLog;
|
||||||
|
import com.foreverwin.iep.qms.service.ZQmsLotQualityInspectStatusLogService;
|
||||||
|
import com.foreverwin.mom.common.core.util.R;
|
||||||
|
import com.foreverwin.mom.common.log.annotation.SysLog;
|
||||||
|
import io.seata.spring.annotation.GlobalTransactional;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import com.foreverwin.mom.common.excel.annotation.ResponseExcel;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产批检验任务质检等级与状态日志
|
||||||
|
*
|
||||||
|
* @author leiqiaozhen
|
||||||
|
* @date 2024-12-25 18:40:25
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RequestMapping("/z-qms-lot-quality-inspect-status-log" )
|
||||||
|
@Api(value = "z-qms-lot-quality-inspect-status-log", tags = "生产批检验任务质检等级与状态日志管理")
|
||||||
|
public class ZQmsLotQualityInspectStatusLogController {
|
||||||
|
private final ZQmsLotQualityInspectStatusLogService zQmsLotQualityInspectStatusLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增生产批检验任务质检等级与状态日志(远程api)
|
||||||
|
* @param zQmsLotQualityInspectStatusLog 生产批检验任务质检等级与状态日志
|
||||||
|
* @return R
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增生产批检验任务质检等级与状态日志(远程api)", notes = "新增生产批检验任务质检等级与状态日志(远程api)")
|
||||||
|
@SysLog("新增生产批检验任务质检等级与状态日志(远程api)" )
|
||||||
|
@PostMapping("/api/createQmsLotQualityInspectStatusLog")
|
||||||
|
@GlobalTransactional
|
||||||
|
public R createQmsLotQualityInspectStatusLog(@RequestBody ZQmsLotQualityInspectStatusLog zQmsLotQualityInspectStatusLog) {
|
||||||
|
return R.ok(zQmsLotQualityInspectStatusLogService.save(zQmsLotQualityInspectStatusLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GlobalTransactional
|
||||||
|
@ApiOperation(value = "根据site+lotNo查询生产批检验任务质检等级与状态日志表", notes = "根据site+lotNo查询生产批检验任务质检等级与状态日志表")
|
||||||
|
@GetMapping("/api/getQmsLotQualityInspectStatusLogs/{site}/{lotNo}")
|
||||||
|
public R getQmsLotQualityInspectStatusLogs(@PathVariable("site") String site, @PathVariable("lotNo") String lotNo) {
|
||||||
|
return R.ok(zQmsLotQualityInspectStatusLogService.getQmsLotQualityInspectStatusLogs(site, lotNo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param zQmsLotQualityInspectStatusLog 生产批检验任务质检等级与状态日志
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "分页查询", notes = "分页查询")
|
||||||
|
@GetMapping("/page" )
|
||||||
|
@PreAuthorize("@pms.hasPermission('generator_zqmslotqualityinspectstatuslog_view')" )
|
||||||
|
public R getZQmsLotQualityInspectStatusLogPage(Page page, ZQmsLotQualityInspectStatusLog zQmsLotQualityInspectStatusLog) {
|
||||||
|
return R.ok(zQmsLotQualityInspectStatusLogService.page(page, Wrappers.query(zQmsLotQualityInspectStatusLog)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询生产批检验任务质检等级与状态日志
|
||||||
|
* @param sid id
|
||||||
|
* @return R
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||||
|
@GetMapping("/{sid}" )
|
||||||
|
@PreAuthorize("@pms.hasPermission('generator_zqmslotqualityinspectstatuslog_view')" )
|
||||||
|
public R getById(@PathVariable("sid" ) String sid) {
|
||||||
|
return R.ok(zQmsLotQualityInspectStatusLogService.getById(sid));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增生产批检验任务质检等级与状态日志
|
||||||
|
* @param zQmsLotQualityInspectStatusLog 生产批检验任务质检等级与状态日志
|
||||||
|
* @return R
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增生产批检验任务质检等级与状态日志", notes = "新增生产批检验任务质检等级与状态日志")
|
||||||
|
@SysLog("新增生产批检验任务质检等级与状态日志" )
|
||||||
|
@PostMapping
|
||||||
|
@PreAuthorize("@pms.hasPermission('generator_zqmslotqualityinspectstatuslog_add')" )
|
||||||
|
public R save(@RequestBody ZQmsLotQualityInspectStatusLog zQmsLotQualityInspectStatusLog) {
|
||||||
|
return R.ok(zQmsLotQualityInspectStatusLogService.save(zQmsLotQualityInspectStatusLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改生产批检验任务质检等级与状态日志
|
||||||
|
* @param zQmsLotQualityInspectStatusLog 生产批检验任务质检等级与状态日志
|
||||||
|
* @return R
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改生产批检验任务质检等级与状态日志", notes = "修改生产批检验任务质检等级与状态日志")
|
||||||
|
@SysLog("修改生产批检验任务质检等级与状态日志" )
|
||||||
|
@PutMapping
|
||||||
|
@PreAuthorize("@pms.hasPermission('generator_zqmslotqualityinspectstatuslog_edit')" )
|
||||||
|
public R updateById(@RequestBody ZQmsLotQualityInspectStatusLog zQmsLotQualityInspectStatusLog) {
|
||||||
|
return R.ok(zQmsLotQualityInspectStatusLogService.updateById(zQmsLotQualityInspectStatusLog));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除生产批检验任务质检等级与状态日志
|
||||||
|
* @param sid id
|
||||||
|
* @return R
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "通过id删除生产批检验任务质检等级与状态日志", notes = "通过id删除生产批检验任务质检等级与状态日志")
|
||||||
|
@SysLog("通过id删除生产批检验任务质检等级与状态日志" )
|
||||||
|
@DeleteMapping("/{sid}" )
|
||||||
|
@PreAuthorize("@pms.hasPermission('generator_zqmslotqualityinspectstatuslog_del')" )
|
||||||
|
public R removeById(@PathVariable String sid) {
|
||||||
|
return R.ok(zQmsLotQualityInspectStatusLogService.removeById(sid));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel 表格
|
||||||
|
* @param zQmsLotQualityInspectStatusLog 查询条件
|
||||||
|
* @return excel 文件流
|
||||||
|
*/
|
||||||
|
@ResponseExcel
|
||||||
|
@GetMapping("/export")
|
||||||
|
@PreAuthorize("@pms.hasPermission('generator_zqmslotqualityinspectstatuslog_export')" )
|
||||||
|
public List<ZQmsLotQualityInspectStatusLog> export(ZQmsLotQualityInspectStatusLog zQmsLotQualityInspectStatusLog) {
|
||||||
|
return zQmsLotQualityInspectStatusLogService.list(Wrappers.query(zQmsLotQualityInspectStatusLog));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
package com.foreverwin.iep.qms.service;
|
package com.foreverwin.iep.qms.service;
|
||||||
|
|
||||||
import com.foreverwin.iep.qms.domain.AutoCreateJobRequest;
|
import com.foreverwin.iep.qms.domain.AutoCreateJobRequest;
|
||||||
|
import com.foreverwin.iep.qms.dto.QmsInspecJobDTO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -14,7 +15,7 @@ public interface AutoCreateJobService {
|
|||||||
*
|
*
|
||||||
* @param autoCreateJobRequest 自動創建工作請求對象
|
* @param autoCreateJobRequest 自動創建工作請求對象
|
||||||
*/
|
*/
|
||||||
List<String> invoke(AutoCreateJobRequest autoCreateJobRequest);
|
List<QmsInspecJobDTO> invoke(AutoCreateJobRequest autoCreateJobRequest);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 每日固定時間執行
|
* 每日固定時間執行
|
||||||
|
|||||||
@ -0,0 +1,19 @@
|
|||||||
|
package com.foreverwin.iep.qms.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.foreverwin.iep.qms.entity.QmsRejudgmentLog;
|
||||||
|
import com.foreverwin.iep.qms.entity.ZQmsLotQualityInspectStatusLog;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产批检验任务质检等级与状态日志
|
||||||
|
*
|
||||||
|
* @author leiqiaozhen
|
||||||
|
* @date 2024-12-25 18:40:25
|
||||||
|
*/
|
||||||
|
public interface ZQmsLotQualityInspectStatusLogService extends IService<ZQmsLotQualityInspectStatusLog> {
|
||||||
|
|
||||||
|
List<ZQmsLotQualityInspectStatusLog> getQmsLotQualityInspectStatusLogs(String site, String lotNo);
|
||||||
|
}
|
||||||
@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
|
import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.foreverwin.iep.common.constant.BaseConstants;
|
import com.foreverwin.iep.common.constant.BaseConstants;
|
||||||
@ -17,6 +18,7 @@ import com.foreverwin.iep.qms.constant.Freq;
|
|||||||
import com.foreverwin.iep.qms.domain.AutoCreateJobRequest;
|
import com.foreverwin.iep.qms.domain.AutoCreateJobRequest;
|
||||||
import com.foreverwin.iep.qms.domain.ChkInfo;
|
import com.foreverwin.iep.qms.domain.ChkInfo;
|
||||||
import com.foreverwin.iep.qms.domain.InspecJob;
|
import com.foreverwin.iep.qms.domain.InspecJob;
|
||||||
|
import com.foreverwin.iep.qms.dto.QmsInspecJobDTO;
|
||||||
import com.foreverwin.iep.qms.dto.QmsQcPlanTargetDTO;
|
import com.foreverwin.iep.qms.dto.QmsQcPlanTargetDTO;
|
||||||
import com.foreverwin.iep.qms.entity.QmsFreqState;
|
import com.foreverwin.iep.qms.entity.QmsFreqState;
|
||||||
import com.foreverwin.iep.qms.entity.QmsFreqTools;
|
import com.foreverwin.iep.qms.entity.QmsFreqTools;
|
||||||
@ -103,12 +105,20 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
|||||||
|
|
||||||
private static String $operation;
|
private static String $operation;
|
||||||
|
|
||||||
private static String $triggerType;
|
private static String $triggerPoint;
|
||||||
|
|
||||||
private static List<String> $hasInsTaskLotNoList;
|
private static String $currentQcSubCategory;
|
||||||
|
|
||||||
|
private static String $currentInsLevel;
|
||||||
|
|
||||||
|
private static String $currentInvStatus;
|
||||||
|
|
||||||
|
private static String $inspecFreqBo;
|
||||||
|
|
||||||
|
private static List<QmsInspecJobDTO> $hasInsTaskLotNoList;
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public List<String> invoke(AutoCreateJobRequest autoCreateJobRequest) {
|
public List<QmsInspecJobDTO> invoke(AutoCreateJobRequest autoCreateJobRequest) {
|
||||||
// 用于存储有检验任务的值
|
// 用于存储有检验任务的值
|
||||||
$hasInsTaskLotNoList = new ArrayList<>();
|
$hasInsTaskLotNoList = new ArrayList<>();
|
||||||
// 获取 站点
|
// 获取 站点
|
||||||
@ -121,19 +131,10 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
|||||||
$resource = autoCreateJobRequest.getResource();
|
$resource = autoCreateJobRequest.getResource();
|
||||||
// 获取 工序
|
// 获取 工序
|
||||||
$operation = autoCreateJobRequest.getOperation();
|
$operation = autoCreateJobRequest.getOperation();
|
||||||
// 判断 该工序是否是 SH 熟化工序,如果是,则转化为工序对应车间上的工序【JMSH基膜熟化】或【TBSH涂布熟化】,否则为原始工序
|
// 定义 转化后的工序operationNew
|
||||||
if ($operation.equals("SH")) {
|
String operationNew = getOperation($site, $resource, $operation);
|
||||||
String sHOperation = autoCreateJobMapper.selectOperationFabTypeList($site, $resource, $operation).get(0);
|
// 获取 开始完成后触发点 S:开始 E:完成后
|
||||||
// 如果 sHOperation 不为空,则转化为工序对应车间上的工序,否则为原始工序
|
$triggerPoint = autoCreateJobRequest.getTriggerPoint();
|
||||||
if (StringUtils.isNotBlank(sHOperation)) {
|
|
||||||
$operation = sHOperation;
|
|
||||||
} else {
|
|
||||||
// 报错
|
|
||||||
throw BusinessException.build("品质报错:设备[" + $resource + "],工序["+ $operation + "]对应车间上的工序不存在");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 获取 开始完成后触发标识 S:开始 E:完成后
|
|
||||||
$triggerType = autoCreateJobRequest.getTriggerType();
|
|
||||||
|
|
||||||
// 如果批次基础信息列表为空且设备为空,则直接返回
|
// 如果批次基础信息列表为空且设备为空,则直接返回
|
||||||
if (ListUtils.isEmpty(objects) && StrUtil.isBlank($resource)) {
|
if (ListUtils.isEmpty(objects) && StrUtil.isBlank($resource)) {
|
||||||
@ -142,7 +143,6 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
|||||||
|
|
||||||
// 将批次基础信息列表转换为LotBasis对象列表
|
// 将批次基础信息列表转换为LotBasis对象列表
|
||||||
List<LotBasis> lotBasisList = toLotBasis(objects);
|
List<LotBasis> lotBasisList = toLotBasis(objects);
|
||||||
// $resultLotBasisList = new ArrayList<>();
|
|
||||||
// 根据LotBasis对象列表获取itemBo
|
// 根据LotBasis对象列表获取itemBo
|
||||||
String itemBo = getItemBo(lotBasisList);
|
String itemBo = getItemBo(lotBasisList);
|
||||||
// 根据itemBo获取检验计划使用对象(即获取物料上挂的检验计划)
|
// 根据itemBo获取检验计划使用对象(即获取物料上挂的检验计划)
|
||||||
@ -167,184 +167,163 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
|||||||
// 获取当前qcPlan的检验计划编号
|
// 获取当前qcPlan的检验计划编号
|
||||||
$qcPlan = qcPlan.getQcPlan();
|
$qcPlan = qcPlan.getQcPlan();
|
||||||
// 获取当前qcPlan的检验计划编号上的 检验细类
|
// 获取当前qcPlan的检验计划编号上的 检验细类
|
||||||
String currentQcSubCategories = qcPlan.getQcSubCategories();
|
$currentQcSubCategory = qcPlan.getQcSubCategories();
|
||||||
// 获取当前qcPlan的检验计划编号上的 检验频率
|
// 获取当前qcPlan的检验计划编号上的 检验频率
|
||||||
String inspecFreqBo = qcPlan.getInspecFreqBo();
|
$inspecFreqBo = qcPlan.getInspecFreqBo();
|
||||||
String opAndQcSubCategoriesAndTriggerType = $operation + ";" + currentQcSubCategories + ";" + $triggerType;
|
// 如果该检验计划上的检验细类和检验频率都不为空时,才会去调用创建检验计划的逻辑
|
||||||
// 如果检验细类和检验频率都不为空时,才会去调用创建检验计划的逻辑
|
if (StrUtil.isNotBlank($currentQcSubCategory) && StrUtil.isNotBlank($inspecFreqBo)) {
|
||||||
if (StrUtil.isNotBlank(currentQcSubCategories) && StrUtil.isNotBlank(inspecFreqBo)) {
|
// 获取当前检验计划对应检验细类在快码维护上对应的触发点(扩展字段2)+质检等级(扩展字段5)+库存状态(扩展字段6)
|
||||||
// 根据 当前工序查询 快码编号为 INSPECT_TASK_TRIGGER_RULE 的快码维护明细表
|
List<QmsInspecJobDTO> fastCodeQcSubCategoriesAndTriggerPointList = getFastCodeQcSubCategoriesAndTriggerPointList($site, operationNew, $currentQcSubCategory);
|
||||||
String fastCodeBo = FastCode.genHandle($site,INSPECT_TASK_TRIGGER_RULE);
|
// 筛选触发点为 当前触发点的 $triggerPoint 数据
|
||||||
|
List<QmsInspecJobDTO> triggerPointList = fastCodeQcSubCategoriesAndTriggerPointList.stream().filter(qmsInspecJobDTO -> qmsInspecJobDTO.getTriggerPoint().equals($triggerPoint)).collect(Collectors.toList());
|
||||||
|
// 如果 triggerPointList 数据不为空,才会去调用创建检验计划的逻辑
|
||||||
|
if (ListUtils.isNotEmpty(triggerPointList)) {
|
||||||
|
// 如果 triggerPointList 的长度大于1,则报错
|
||||||
|
if (triggerPointList.size() > 1) {
|
||||||
|
throw BusinessException.build("品质报错:在[快码维护]功能中,找到快码编号为[" + INSPECT_TASK_TRIGGER_RULE + "],字段代码为[" + operationNew +"],扩展字段1中的检验细类"+$currentQcSubCategory+"在扩展字段2触发点上"+$triggerPoint+"有多个重复值,请检查!");
|
||||||
|
}
|
||||||
|
// 当前检验细类对应质检等级(扩展字段5)
|
||||||
|
$currentInsLevel = triggerPointList.get(0).getInspectLevel();
|
||||||
|
// 当前检验细类对应库存状态(扩展字段6)
|
||||||
|
$currentInvStatus = triggerPointList.get(0).getInventoryStatus();
|
||||||
|
// 获取检验计划的新检验频率主键
|
||||||
|
String newInspecFreqBo = qcPlan.getNewInspecFreqBo();
|
||||||
|
// 根据检验计划上的检验频率主键查询检验频率表
|
||||||
|
QmsInspecFreq inspecFreq = qmsInspecFreqService.getById($inspecFreqBo);
|
||||||
|
// 获取各种检验频率配置项
|
||||||
|
// 工单第一个生产的生产批
|
||||||
|
String chkFirstSfc = inspecFreq.getChkFirstSfc();
|
||||||
|
// 每日第一个生产的生产批
|
||||||
|
String chkDailyFirstSfc = inspecFreq.getChkDailyFirstSfc();
|
||||||
|
// 每日起始時間
|
||||||
|
String dailyFirstSfc = inspecFreq.getDailyFirstSfc();
|
||||||
|
// 更换产品后第一个生产的生产批
|
||||||
|
String chkChangeProduct = inspecFreq.getChkChangeProduct();
|
||||||
|
// 设备维修后第一个生产的生产批
|
||||||
|
String chkChangeMould = inspecFreq.getChkChangeMould();
|
||||||
|
// 设备维修后第一个生产的生产批
|
||||||
|
String chkMaintenFirstSfc = inspecFreq.getChkMaintenFirstSfc();
|
||||||
|
// 设备停机N小时以上, 生產的第一个生产批
|
||||||
|
String chkStopAfterSfc = inspecFreq.getChkStopAfterSfc();
|
||||||
|
// 停机小时数
|
||||||
|
BigDecimal stopAfterSfc = inspecFreq.getStopAfterSfc();
|
||||||
|
// 每N个生产批(以机台计算)
|
||||||
|
String chkSeveralSfc = inspecFreq.getChkSeveralSfc();
|
||||||
|
// 生产批批数
|
||||||
|
Integer severalSfc = inspecFreq.getSeveralSfc();
|
||||||
|
// 机台生产每N小时
|
||||||
|
String chkIntervalHour2 = inspecFreq.getChkIntervalHour2();
|
||||||
|
// 每N个生产批(以机台+工单计算)
|
||||||
|
String chkSeveralSfc2 = inspecFreq.getChkSeveralSfc2();
|
||||||
|
// 每N个生产批(以机台+工单计算)
|
||||||
|
Integer severalSfc2 = inspecFreq.getSeveralSfc2();
|
||||||
|
// 每N卷+N等级(自动切换频率)
|
||||||
|
String chkIntervalSfcInspecLevel = inspecFreq.getChkIntervalSfcInspecLevel();
|
||||||
|
// 间隔N卷(自动切换频率)
|
||||||
|
Integer intervalSfcInspecLevel = inspecFreq.getIntervalSfcInspecLevel();
|
||||||
|
|
||||||
FastCodeDetail detail = fastCodeDetailMapper.selectOne(Wrappers.<FastCodeDetail>lambdaQuery()
|
// 如果 每N卷+N等级(自动切换频率) 为 true ,且 新检验频率主键 不为空时,则切换新的检验频率
|
||||||
.eq(FastCodeDetail::getFastCodeBo, fastCodeBo)
|
if (Boolean.parseBoolean(chkIntervalSfcInspecLevel) && StrUtil.isNotBlank(newInspecFreqBo)) {
|
||||||
.eq(FastCodeDetail::getCode, $operation));
|
// 新检验频率
|
||||||
|
inspecFreq = qmsInspecFreqService.getById(newInspecFreqBo);
|
||||||
|
|
||||||
// 如果 快码详情detail 不为空
|
// 获取各种检验频率配置项
|
||||||
if (ObjectUtil.isNotNull(detail)) {
|
// 工单第一个生产的生产批
|
||||||
// 获取 检验细类
|
chkFirstSfc = inspecFreq.getChkFirstSfc();
|
||||||
String qcSubCategories = detail.getEf1();
|
// 每日第一个生产的生产批
|
||||||
// 获取 进出站触发标识
|
chkDailyFirstSfc = inspecFreq.getChkDailyFirstSfc();
|
||||||
String triggerType = detail.getEf2();
|
// 每日起始時間
|
||||||
|
dailyFirstSfc = inspecFreq.getDailyFirstSfc();
|
||||||
|
// 更换产品后第一个生产的生产批
|
||||||
|
chkChangeProduct = inspecFreq.getChkChangeProduct();
|
||||||
|
// 设备维修后第一个生产的生产批
|
||||||
|
chkChangeMould = inspecFreq.getChkChangeMould();
|
||||||
|
// 设备维修后第一个生产的生产批
|
||||||
|
chkMaintenFirstSfc = inspecFreq.getChkMaintenFirstSfc();
|
||||||
|
// 设备停机N小时以上, 生產的第一个生产批
|
||||||
|
chkStopAfterSfc = inspecFreq.getChkStopAfterSfc();
|
||||||
|
// 停机小时数
|
||||||
|
stopAfterSfc = inspecFreq.getStopAfterSfc();
|
||||||
|
// 每N个生产批(以机台计算)
|
||||||
|
chkSeveralSfc = inspecFreq.getChkSeveralSfc();
|
||||||
|
// 生产批批数
|
||||||
|
severalSfc = inspecFreq.getSeveralSfc();
|
||||||
|
// 机台生产每N小时
|
||||||
|
chkIntervalHour2 = inspecFreq.getChkIntervalHour2();
|
||||||
|
// 每N个生产批(以机台+工单计算)
|
||||||
|
chkSeveralSfc2 = inspecFreq.getChkSeveralSfc2();
|
||||||
|
// 每N个生产批(以机台+工单计算)
|
||||||
|
severalSfc2 = inspecFreq.getSeveralSfc2();
|
||||||
|
// 每N卷+N等级(自动切换频率)
|
||||||
|
chkIntervalSfcInspecLevel = inspecFreq.getChkIntervalSfcInspecLevel();
|
||||||
|
// 间隔N卷(自动切换频率)
|
||||||
|
intervalSfcInspecLevel = inspecFreq.getIntervalSfcInspecLevel();
|
||||||
|
}
|
||||||
|
|
||||||
// 如果 qcSubCategories 和 triggerType 都不为空
|
// 初始化标志位
|
||||||
if (StrUtil.isNotBlank(qcSubCategories) && StrUtil.isNotBlank(triggerType)) {
|
String flag = null;
|
||||||
// 把 qcSubCategories 和 triggerType 分别以分号分割,按照每个位置一一对应,并拼接上工序, 组装成一个List<String>
|
// 遍历频率列表,根据不同的频率执行相应的检查方法
|
||||||
List<String> opAndQcSubCategoriesAndTriggerTypeList = assembleList($operation, qcSubCategories, triggerType);
|
for (String freq : freqList) {
|
||||||
// 如果 opAndQcSubCategoriesAndTriggerTypeList 的长度大于 0
|
if (StrUtil.isNotBlank(flag)) {
|
||||||
if (opAndQcSubCategoriesAndTriggerTypeList.size() > 0 ) {
|
// 如果标志位已设置,则跳出循环
|
||||||
// 判断 opAndQcSubCategoriesAndTriggerType 是否在 opAndQcSubCategoriesAndTriggerTypeList 中,如果在则执行下一步
|
break;
|
||||||
if (opAndQcSubCategoriesAndTriggerTypeList.contains(opAndQcSubCategoriesAndTriggerType)) {
|
}
|
||||||
// // 如果是涂布熟化工序 TBSH,并且检验细类为涂布完工检 TBWG,检验任务按照按大批次创建,否则按照正常工序创建
|
|
||||||
// if ($operation.equals("TBSH") && currentQcSubCategories.equals("TBWG")) {
|
|
||||||
// // 组装大批次号的信息
|
|
||||||
// List<LotBasis> processedLotBasisList = getLargeLotBasisList(lotBasisList);
|
|
||||||
// $resultLotBasisList = processedLotBasisList;
|
|
||||||
// } else {
|
|
||||||
// $resultLotBasisList = lotBasisList;
|
|
||||||
// }
|
|
||||||
// 获取检验计划的新检验频率主键
|
|
||||||
String newInspecFreqBo = qcPlan.getNewInspecFreqBo();
|
|
||||||
// 根据检验计划上的检验频率主键查询检验频率表
|
|
||||||
QmsInspecFreq inspecFreq = qmsInspecFreqService.getById(inspecFreqBo);
|
|
||||||
|
|
||||||
// 获取各种检验频率配置项
|
switch (freq) {
|
||||||
// 工单第一个生产的生产批
|
// 工单第一个生产的生产批
|
||||||
String chkFirstSfc = inspecFreq.getChkFirstSfc();
|
case Freq.CHK_FIRST_SFC:
|
||||||
// 每日第一个生产的生产批
|
if (execute(flag, chkFirstSfc)) {
|
||||||
String chkDailyFirstSfc = inspecFreq.getChkDailyFirstSfc();
|
flag = chkFirstSfc(shopOrderBoMap);
|
||||||
// 每日起始時間
|
|
||||||
String dailyFirstSfc = inspecFreq.getDailyFirstSfc();
|
|
||||||
// 更换产品后第一个生产的生产批
|
|
||||||
String chkChangeProduct = inspecFreq.getChkChangeProduct();
|
|
||||||
// 设备维修后第一个生产的生产批
|
|
||||||
String chkChangeMould = inspecFreq.getChkChangeMould();
|
|
||||||
// 设备维修后第一个生产的生产批
|
|
||||||
String chkMaintenFirstSfc = inspecFreq.getChkMaintenFirstSfc();
|
|
||||||
// 设备停机N小时以上, 生產的第一个生产批
|
|
||||||
String chkStopAfterSfc = inspecFreq.getChkStopAfterSfc();
|
|
||||||
// 停机小时数
|
|
||||||
BigDecimal stopAfterSfc = inspecFreq.getStopAfterSfc();
|
|
||||||
// 每N个生产批(以机台计算)
|
|
||||||
String chkSeveralSfc = inspecFreq.getChkSeveralSfc();
|
|
||||||
// 生产批批数
|
|
||||||
Integer severalSfc = inspecFreq.getSeveralSfc();
|
|
||||||
// 机台生产每N小时
|
|
||||||
String chkIntervalHour2 = inspecFreq.getChkIntervalHour2();
|
|
||||||
// 每N个生产批(以机台+工单计算)
|
|
||||||
String chkSeveralSfc2 = inspecFreq.getChkSeveralSfc2();
|
|
||||||
// 每N个生产批(以机台+工单计算)
|
|
||||||
Integer severalSfc2 = inspecFreq.getSeveralSfc2();
|
|
||||||
// 每N卷+N等级(自动切换频率)
|
|
||||||
String chkIntervalSfcInspecLevel = inspecFreq.getChkIntervalSfcInspecLevel();
|
|
||||||
// 间隔N卷(自动切换频率)
|
|
||||||
Integer intervalSfcInspecLevel = inspecFreq.getIntervalSfcInspecLevel();
|
|
||||||
|
|
||||||
// 如果 每N卷+N等级(自动切换频率) 为 true ,且 新检验频率主键 不为空时,则切换新的检验频率
|
|
||||||
if (Boolean.parseBoolean(chkIntervalSfcInspecLevel) && StrUtil.isNotBlank(newInspecFreqBo)) {
|
|
||||||
// 新检验频率
|
|
||||||
inspecFreq = qmsInspecFreqService.getById(newInspecFreqBo);
|
|
||||||
|
|
||||||
// 获取各种检验频率配置项
|
|
||||||
// 工单第一个生产的生产批
|
|
||||||
chkFirstSfc = inspecFreq.getChkFirstSfc();
|
|
||||||
// 每日第一个生产的生产批
|
|
||||||
chkDailyFirstSfc = inspecFreq.getChkDailyFirstSfc();
|
|
||||||
// 每日起始時間
|
|
||||||
dailyFirstSfc = inspecFreq.getDailyFirstSfc();
|
|
||||||
// 更换产品后第一个生产的生产批
|
|
||||||
chkChangeProduct = inspecFreq.getChkChangeProduct();
|
|
||||||
// 设备维修后第一个生产的生产批
|
|
||||||
chkChangeMould = inspecFreq.getChkChangeMould();
|
|
||||||
// 设备维修后第一个生产的生产批
|
|
||||||
chkMaintenFirstSfc = inspecFreq.getChkMaintenFirstSfc();
|
|
||||||
// 设备停机N小时以上, 生產的第一个生产批
|
|
||||||
chkStopAfterSfc = inspecFreq.getChkStopAfterSfc();
|
|
||||||
// 停机小时数
|
|
||||||
stopAfterSfc = inspecFreq.getStopAfterSfc();
|
|
||||||
// 每N个生产批(以机台计算)
|
|
||||||
chkSeveralSfc = inspecFreq.getChkSeveralSfc();
|
|
||||||
// 生产批批数
|
|
||||||
severalSfc = inspecFreq.getSeveralSfc();
|
|
||||||
// 机台生产每N小时
|
|
||||||
chkIntervalHour2 = inspecFreq.getChkIntervalHour2();
|
|
||||||
// 每N个生产批(以机台+工单计算)
|
|
||||||
chkSeveralSfc2 = inspecFreq.getChkSeveralSfc2();
|
|
||||||
// 每N个生产批(以机台+工单计算)
|
|
||||||
severalSfc2 = inspecFreq.getSeveralSfc2();
|
|
||||||
// 每N卷+N等级(自动切换频率)
|
|
||||||
chkIntervalSfcInspecLevel = inspecFreq.getChkIntervalSfcInspecLevel();
|
|
||||||
// 间隔N卷(自动切换频率)
|
|
||||||
intervalSfcInspecLevel = inspecFreq.getIntervalSfcInspecLevel();
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
// 初始化标志位
|
case Freq.CHK_DAILY_FIRST_SFC:
|
||||||
String flag = null;
|
if (execute(flag, chkDailyFirstSfc)) {
|
||||||
// 遍历频率列表,根据不同的频率执行相应的检查方法
|
flag = chkDailyFirstSfc(lotBasisList, dailyFirstSfc);
|
||||||
for (String freq : freqList) {
|
|
||||||
if (StrUtil.isNotBlank(flag)) {
|
|
||||||
// 如果标志位已设置,则跳出循环
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (freq) {
|
|
||||||
// 工单第一个生产的生产批
|
|
||||||
case Freq.CHK_FIRST_SFC:
|
|
||||||
if (execute(flag, chkFirstSfc)) {
|
|
||||||
flag = chkFirstSfc(shopOrderBoMap);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Freq.CHK_DAILY_FIRST_SFC:
|
|
||||||
if (execute(flag, chkDailyFirstSfc)) {
|
|
||||||
flag = chkDailyFirstSfc(lotBasisList, dailyFirstSfc);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Freq.CHK_CHANGE_PRODUCT:
|
|
||||||
if (execute(flag, chkChangeProduct)) {
|
|
||||||
flag = chkChangeProduct(lotBasisList, itemBo);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Freq.CHK_CHANGE_MOULD:
|
|
||||||
if (execute(flag, chkChangeMould)) {
|
|
||||||
flag = chkChangeMould(lotBasisList);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Freq.CHK_MAINTEN_FIRST_SFC:
|
|
||||||
if (execute(flag, chkMaintenFirstSfc)) {
|
|
||||||
flag = chkMaintenFirstSfc(lotBasisList);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Freq.CHK_STOP_AFTER_SFC:
|
|
||||||
if (execute(flag, chkStopAfterSfc)) {
|
|
||||||
flag = chkStopAfterSfc(lotBasisList, stopAfterSfc);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Freq.CHK_SEVERAL_SFC:
|
|
||||||
if (execute(flag, chkSeveralSfc)) {
|
|
||||||
flag = chkSeveralSfc(lotBasisList, severalSfc);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
// 每N个生产批(以机台+工单计算)
|
|
||||||
case Freq.CHK_SEVERAL_SFC2:
|
|
||||||
if (execute(flag, chkSeveralSfc2)) {
|
|
||||||
flag = chkSeveralSfc2(lotBasisList, severalSfc2);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Freq.CHK_INTERVAL_HOUR2:
|
|
||||||
if (execute(flag, chkIntervalHour2)) {
|
|
||||||
flag = chkIntervalHour2();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
// 每N卷+N等级(自动切换频率)
|
|
||||||
case Freq.CHK_INTERVAL_SFC_INSPEC_LEVEL:
|
|
||||||
// 如果 开启频率切换 为 true
|
|
||||||
if (execute(flag, chkIntervalSfcInspecLevel)) {
|
|
||||||
flag = chkIntervalSfcInspecLevel(lotBasisList, intervalSfcInspecLevel);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
|
case Freq.CHK_CHANGE_PRODUCT:
|
||||||
|
if (execute(flag, chkChangeProduct)) {
|
||||||
|
flag = chkChangeProduct(lotBasisList, itemBo);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Freq.CHK_CHANGE_MOULD:
|
||||||
|
if (execute(flag, chkChangeMould)) {
|
||||||
|
flag = chkChangeMould(lotBasisList);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Freq.CHK_MAINTEN_FIRST_SFC:
|
||||||
|
if (execute(flag, chkMaintenFirstSfc)) {
|
||||||
|
flag = chkMaintenFirstSfc(lotBasisList);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Freq.CHK_STOP_AFTER_SFC:
|
||||||
|
if (execute(flag, chkStopAfterSfc)) {
|
||||||
|
flag = chkStopAfterSfc(lotBasisList, stopAfterSfc);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Freq.CHK_SEVERAL_SFC:
|
||||||
|
if (execute(flag, chkSeveralSfc)) {
|
||||||
|
flag = chkSeveralSfc(lotBasisList, severalSfc);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
// 每N个生产批(以机台+工单计算)
|
||||||
|
case Freq.CHK_SEVERAL_SFC2:
|
||||||
|
if (execute(flag, chkSeveralSfc2)) {
|
||||||
|
flag = chkSeveralSfc2(lotBasisList, severalSfc2);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Freq.CHK_INTERVAL_HOUR2:
|
||||||
|
if (execute(flag, chkIntervalHour2)) {
|
||||||
|
flag = chkIntervalHour2();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
// 每N卷+N等级(自动切换频率)
|
||||||
|
case Freq.CHK_INTERVAL_SFC_INSPEC_LEVEL:
|
||||||
|
// 如果 开启频率切换 为 true
|
||||||
|
if (execute(flag, chkIntervalSfcInspecLevel)) {
|
||||||
|
flag = chkIntervalSfcInspecLevel(lotBasisList, intervalSfcInspecLevel);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -352,10 +331,10 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 返回值
|
// 返回值
|
||||||
List<String> resultHasInsTaskLotNoList = new ArrayList<>();
|
List<QmsInspecJobDTO> resultHasInsTaskLotNoList = new ArrayList<>();
|
||||||
// 如果 $hasInsTaskLotNoList 不为空
|
// 如果 $hasInsTaskLotNoList 不为空
|
||||||
if (ListUtils.isNotEmpty($hasInsTaskLotNoList)) {
|
if (ListUtils.isNotEmpty($hasInsTaskLotNoList)) {
|
||||||
// 把有检验任务的 $hasInsTaskLotNoList 的 lotNo 去重后添加到 resultHasInsTaskLotNoList
|
// 把有检验任务的 $hasInsTaskLotNoList 的 lotNo 去重后添加到 resultHasInsTaskLotNoList
|
||||||
resultHasInsTaskLotNoList = new ArrayList<>(new HashSet<>($hasInsTaskLotNoList));
|
resultHasInsTaskLotNoList = new ArrayList<>(new HashSet<>($hasInsTaskLotNoList));
|
||||||
}
|
}
|
||||||
return resultHasInsTaskLotNoList;
|
return resultHasInsTaskLotNoList;
|
||||||
@ -394,9 +373,104 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
|||||||
return processedLotBasisList;
|
return processedLotBasisList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 熟化工序转换成车间对应的工序
|
||||||
|
public String getOperation(String site, String resource, String operation) {
|
||||||
|
// 定义转化后的数据
|
||||||
|
String operationNew = operation;
|
||||||
|
// 判断 该工序是否是 SH 熟化工序,如果是,则转化为工序对应车间上的工序【JMSH基膜熟化】或【TBSH涂布熟化】,否则为原始工序
|
||||||
|
if (operationNew.equals("SH")) {
|
||||||
|
List<String> operationFabTypeList = autoCreateJobMapper.selectOperationFabTypeList(site, resource, operationNew);
|
||||||
|
if (CollectionUtils.isNotEmpty(operationFabTypeList)) {
|
||||||
|
operationNew = operationFabTypeList.get(0);
|
||||||
|
} else {
|
||||||
|
// 报错
|
||||||
|
throw BusinessException.build("品质报错:设备[" + resource + "],工序["+ operation +"]对应车间上的工序不存在,请检查[工序和设备是否选择错误]或者[主数据是否配置错误]等");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return operationNew;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 获取当前检验计划对应检验细类在快码维护上对应的触发点(扩展字段2)+质检等级(扩展字段5)+库存状态(扩展字段6)
|
||||||
|
public List<QmsInspecJobDTO> getFastCodeQcSubCategoriesAndTriggerPointList(String site, String operationNew, String currentQcSubCategories) {
|
||||||
|
// 定义要返回的数据信息 检验细类(扩展字段1)+ 触发点(扩展字段2)+质检等级(扩展字段5)+库存状态(扩展字段6)
|
||||||
|
List<QmsInspecJobDTO> assyLotStateDtoList = new ArrayList<>();
|
||||||
|
String fastCodeBo = FastCode.genHandle(site,INSPECT_TASK_TRIGGER_RULE);
|
||||||
|
// 根据 当前工序查询 快码编号为 INSPECT_TASK_TRIGGER_RULE 的快码维护明细表
|
||||||
|
FastCodeDetail fastCodeDetail = fastCodeDetailMapper.selectOne(Wrappers.<FastCodeDetail>lambdaQuery()
|
||||||
|
.eq(FastCodeDetail::getFastCodeBo, fastCodeBo)
|
||||||
|
.eq(FastCodeDetail::getCode, operationNew));
|
||||||
|
// 如果 fastCodeDetail 为空,则报错
|
||||||
|
if (fastCodeDetail == null) {
|
||||||
|
// 报错
|
||||||
|
throw BusinessException.build("品质报错:在[快码维护]功能中,未找到快码编号为[" + INSPECT_TASK_TRIGGER_RULE + "],字段代码为[" + operationNew +"],对应的快码明细,请检查!");
|
||||||
|
} else {
|
||||||
|
// 获取扩展字段1检验细类的值
|
||||||
|
String ef1 = fastCodeDetail.getEf1();
|
||||||
|
if (StringUtils.isBlank(ef1)) {
|
||||||
|
// 报错
|
||||||
|
throw BusinessException.build("品质报错:在[快码维护]功能中,快码编号为[" + INSPECT_TASK_TRIGGER_RULE + "],工序["+ operationNew +"]对应快码维护明细扩展字段1为空,请维护");
|
||||||
|
}
|
||||||
|
// 获取扩展字段2触发点的值
|
||||||
|
String ef2 = fastCodeDetail.getEf2();
|
||||||
|
if (StringUtils.isBlank(ef2)) {
|
||||||
|
// 报错
|
||||||
|
throw BusinessException.build("品质报错:在[快码维护]功能中,快码编号为[" + INSPECT_TASK_TRIGGER_RULE + "],工序["+ operationNew +"]对应快码维护明细扩展字段2为空,请维护");
|
||||||
|
}
|
||||||
|
// 获取扩展字段5质检等级的值
|
||||||
|
String ef5 = fastCodeDetail.getEf5();
|
||||||
|
if (StringUtils.isBlank(ef5)) {
|
||||||
|
// 报错
|
||||||
|
throw BusinessException.build("品质报错:在[快码维护]功能中,快码编号为[" + INSPECT_TASK_TRIGGER_RULE + "],工序["+ operationNew +"]对应快码维护明细扩展字段5为空,请维护");
|
||||||
|
}
|
||||||
|
// 获取扩展字段6库存状态的值
|
||||||
|
String ef6 = fastCodeDetail.getEf6();
|
||||||
|
if (StringUtils.isBlank(ef6)) {
|
||||||
|
// 报错
|
||||||
|
throw BusinessException.build("品质报错:在[快码维护]功能中,快码编号为[" + INSPECT_TASK_TRIGGER_RULE + "],工序["+ operationNew +"]对应快码维护明细扩展字段6为空,请维护");
|
||||||
|
}
|
||||||
|
// 将扩展字段1、2、5、6的值转换为List
|
||||||
|
List<String> fastCodeQcSubCategoriesList = Arrays.asList(ef1.split(";"));
|
||||||
|
List<String> fastCodeTriggerPointList = Arrays.asList(ef2.split(";"));
|
||||||
|
List<String> fastCodeInspectLevelList = Arrays.asList(ef5.split(";"));
|
||||||
|
List<String> fastCodeInvStatusList = Arrays.asList(ef6.split(";"));
|
||||||
|
// 判断 fastCodeQcSubCategoriesList,fastCodeTriggerPointList,fastCodeInspectLevelList,fastCodeInvStatusList 这4个集合的长度是否相等,如果不相等则报错
|
||||||
|
if (fastCodeQcSubCategoriesList.size() != fastCodeTriggerPointList.size() || fastCodeQcSubCategoriesList.size() != fastCodeInspectLevelList.size() || fastCodeQcSubCategoriesList.size() != fastCodeInvStatusList.size()) {
|
||||||
|
throw BusinessException.build("品质报错:在[快码维护]功能中,快码编号为[" + INSPECT_TASK_TRIGGER_RULE + "],字段代码为[" + operationNew +"]的扩展字段1、2、5、6所维护数据数量不匹配,请检查!");
|
||||||
|
} else {
|
||||||
|
for (int i = 0; i < fastCodeQcSubCategoriesList.size(); i++) {
|
||||||
|
String qcSubCate = fastCodeQcSubCategoriesList.get(i);
|
||||||
|
String trigger = fastCodeTriggerPointList.get(i);
|
||||||
|
String inspectLevel = fastCodeInspectLevelList.get(i);
|
||||||
|
String invStatus = fastCodeInvStatusList.get(i);
|
||||||
|
QmsInspecJobDTO qmsInspecJobDTO = new QmsInspecJobDTO();
|
||||||
|
qmsInspecJobDTO.setQcSubCategories(qcSubCate);
|
||||||
|
qmsInspecJobDTO.setTriggerPoint(trigger);
|
||||||
|
qmsInspecJobDTO.setInspectLevel(inspectLevel);
|
||||||
|
qmsInspecJobDTO.setInventoryStatus(invStatus);
|
||||||
|
assyLotStateDtoList.add(qmsInspecJobDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 筛选出 assyLotStateDtoList 中,检验细类 为 currentQcSubCategories 的数据
|
||||||
|
assyLotStateDtoList = assyLotStateDtoList.stream()
|
||||||
|
.filter(qmsInspecJobDTO -> qmsInspecJobDTO.getQcSubCategories().equals(currentQcSubCategories))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 如果 assyLotStateDtoList 为空,则报错
|
||||||
|
if (CollectionUtils.isEmpty(assyLotStateDtoList)) {
|
||||||
|
// 报错
|
||||||
|
throw BusinessException.build("品质报错:在[快码维护]功能中,快码编号为[" + INSPECT_TASK_TRIGGER_RULE + "],字段代码为[" + operationNew +"]的扩展字段1所维护数据中,没有检验细类为[" + currentQcSubCategories + "]的数据,请检查!");
|
||||||
|
} else {
|
||||||
|
return assyLotStateDtoList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 按照 工序_检验细类_进出站标识 op_qcSubCate_trigger 组装数据
|
// 按照 工序_检验细类_进出站标识 op_qcSubCate_trigger 组装数据
|
||||||
|
|
||||||
public static List<String> assembleList(String op, String qcSubCategories, String triggerType) {
|
public static List<String> assembleList(String op, String qcSubCategories, String triggerPoint) {
|
||||||
|
|
||||||
// 获取检验细类 qcSubCategoriesList
|
// 获取检验细类 qcSubCategoriesList
|
||||||
List<String> qcSubCategoriesList = null;
|
List<String> qcSubCategoriesList = null;
|
||||||
@ -404,10 +478,10 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
|||||||
qcSubCategoriesList = Arrays.asList(qcSubCategories.split("[;]"));
|
qcSubCategoriesList = Arrays.asList(qcSubCategories.split("[;]"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取进出站触发类型 triggerList
|
// 获取进出站触发点 triggerList
|
||||||
List<String> triggerList = null;
|
List<String> triggerList = null;
|
||||||
if (StrUtil.isNotBlank(triggerType)) {
|
if (StrUtil.isNotBlank(triggerPoint)) {
|
||||||
triggerList = Arrays.asList(triggerType.split("[;]"));
|
triggerList = Arrays.asList(triggerPoint.split("[;]"));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> resultList = new ArrayList<>();
|
List<String> resultList = new ArrayList<>();
|
||||||
@ -537,7 +611,14 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
|||||||
String lotNo = getLot(lotBasisList);
|
String lotNo = getLot(lotBasisList);
|
||||||
if (StrUtil.isNotBlank(lotNo)) {
|
if (StrUtil.isNotBlank(lotNo)) {
|
||||||
createJob(lotNo, Freq.CHK_FIRST_SFC);
|
createJob(lotNo, Freq.CHK_FIRST_SFC);
|
||||||
$hasInsTaskLotNoList.add(lotNo);
|
QmsInspecJobDTO qmsInspecJobDTO = new QmsInspecJobDTO();
|
||||||
|
qmsInspecJobDTO.setLotNo(lotNo);
|
||||||
|
qmsInspecJobDTO.setQcSubCategories($currentQcSubCategory);
|
||||||
|
qmsInspecJobDTO.setTriggerPoint($triggerPoint);
|
||||||
|
qmsInspecJobDTO.setInspectLevel($currentInsLevel);
|
||||||
|
qmsInspecJobDTO.setInventoryStatus($currentInvStatus);
|
||||||
|
qmsInspecJobDTO.setInspecFreqBo($inspecFreqBo);
|
||||||
|
$hasInsTaskLotNoList.add(qmsInspecJobDTO);
|
||||||
}
|
}
|
||||||
count.getAndIncrement();
|
count.getAndIncrement();
|
||||||
}
|
}
|
||||||
@ -562,7 +643,14 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
|||||||
if (k <= 0) {
|
if (k <= 0) {
|
||||||
String lotNo = getLot(lotBasisList);
|
String lotNo = getLot(lotBasisList);
|
||||||
if (StrUtil.isNotBlank(lotNo)) {
|
if (StrUtil.isNotBlank(lotNo)) {
|
||||||
$hasInsTaskLotNoList.add(lotNo);
|
QmsInspecJobDTO qmsInspecJobDTO = new QmsInspecJobDTO();
|
||||||
|
qmsInspecJobDTO.setLotNo(lotNo);
|
||||||
|
qmsInspecJobDTO.setQcSubCategories($currentQcSubCategory);
|
||||||
|
qmsInspecJobDTO.setTriggerPoint($triggerPoint);
|
||||||
|
qmsInspecJobDTO.setInspectLevel($currentInsLevel);
|
||||||
|
qmsInspecJobDTO.setInventoryStatus($currentInvStatus);
|
||||||
|
qmsInspecJobDTO.setInspecFreqBo($inspecFreqBo);
|
||||||
|
$hasInsTaskLotNoList.add(qmsInspecJobDTO);
|
||||||
return createJob(lotNo, Freq.CHK_DAILY_FIRST_SFC);
|
return createJob(lotNo, Freq.CHK_DAILY_FIRST_SFC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -576,7 +664,14 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
|||||||
String product = autoCreateJobMapper.chkChangeProduct($site, $resource);
|
String product = autoCreateJobMapper.chkChangeProduct($site, $resource);
|
||||||
if (StrUtil.isBlank(product) || !item.equals(product)) {
|
if (StrUtil.isBlank(product) || !item.equals(product)) {
|
||||||
if (StrUtil.isNotBlank(lotNo)) {
|
if (StrUtil.isNotBlank(lotNo)) {
|
||||||
$hasInsTaskLotNoList.add(lotNo);
|
QmsInspecJobDTO qmsInspecJobDTO = new QmsInspecJobDTO();
|
||||||
|
qmsInspecJobDTO.setLotNo(lotNo);
|
||||||
|
qmsInspecJobDTO.setQcSubCategories($currentQcSubCategory);
|
||||||
|
qmsInspecJobDTO.setTriggerPoint($triggerPoint);
|
||||||
|
qmsInspecJobDTO.setInspectLevel($currentInsLevel);
|
||||||
|
qmsInspecJobDTO.setInventoryStatus($currentInvStatus);
|
||||||
|
qmsInspecJobDTO.setInspecFreqBo($inspecFreqBo);
|
||||||
|
$hasInsTaskLotNoList.add(qmsInspecJobDTO);
|
||||||
return createJob(lotNo, Freq.CHK_CHANGE_PRODUCT);
|
return createJob(lotNo, Freq.CHK_CHANGE_PRODUCT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -602,7 +697,14 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
|||||||
|
|
||||||
String lotNo = getLot(lotBasisList);
|
String lotNo = getLot(lotBasisList);
|
||||||
if (StrUtil.isNotBlank(lotNo)) {
|
if (StrUtil.isNotBlank(lotNo)) {
|
||||||
$hasInsTaskLotNoList.add(lotNo);
|
QmsInspecJobDTO qmsInspecJobDTO = new QmsInspecJobDTO();
|
||||||
|
qmsInspecJobDTO.setLotNo(lotNo);
|
||||||
|
qmsInspecJobDTO.setQcSubCategories($currentQcSubCategory);
|
||||||
|
qmsInspecJobDTO.setTriggerPoint($triggerPoint);
|
||||||
|
qmsInspecJobDTO.setInspectLevel($currentInsLevel);
|
||||||
|
qmsInspecJobDTO.setInventoryStatus($currentInvStatus);
|
||||||
|
qmsInspecJobDTO.setInspecFreqBo($inspecFreqBo);
|
||||||
|
$hasInsTaskLotNoList.add(qmsInspecJobDTO);
|
||||||
return createJob(lotNo, Freq.CHK_CHANGE_MOULD);
|
return createJob(lotNo, Freq.CHK_CHANGE_MOULD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -616,7 +718,14 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
|||||||
|
|
||||||
String lotNo = getLot(lotBasisList);
|
String lotNo = getLot(lotBasisList);
|
||||||
if (StrUtil.isNotBlank(lotNo)) {
|
if (StrUtil.isNotBlank(lotNo)) {
|
||||||
$hasInsTaskLotNoList.add(lotNo);
|
QmsInspecJobDTO qmsInspecJobDTO = new QmsInspecJobDTO();
|
||||||
|
qmsInspecJobDTO.setLotNo(lotNo);
|
||||||
|
qmsInspecJobDTO.setQcSubCategories($currentQcSubCategory);
|
||||||
|
qmsInspecJobDTO.setTriggerPoint($triggerPoint);
|
||||||
|
qmsInspecJobDTO.setInspectLevel($currentInsLevel);
|
||||||
|
qmsInspecJobDTO.setInventoryStatus($currentInvStatus);
|
||||||
|
qmsInspecJobDTO.setInspecFreqBo($inspecFreqBo);
|
||||||
|
$hasInsTaskLotNoList.add(qmsInspecJobDTO);
|
||||||
return createJob(lotNo, Freq.CHK_MAINTEN_FIRST_SFC);
|
return createJob(lotNo, Freq.CHK_MAINTEN_FIRST_SFC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -684,7 +793,14 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
|||||||
if (index >= 0 && index < size) {
|
if (index >= 0 && index < size) {
|
||||||
// prevent out of list range
|
// prevent out of list range
|
||||||
String lotNo = sort.get(index).getLotNo();
|
String lotNo = sort.get(index).getLotNo();
|
||||||
$hasInsTaskLotNoList.add(lotNo);
|
QmsInspecJobDTO qmsInspecJobDTO = new QmsInspecJobDTO();
|
||||||
|
qmsInspecJobDTO.setLotNo(lotNo);
|
||||||
|
qmsInspecJobDTO.setQcSubCategories($currentQcSubCategory);
|
||||||
|
qmsInspecJobDTO.setTriggerPoint($triggerPoint);
|
||||||
|
qmsInspecJobDTO.setInspectLevel($currentInsLevel);
|
||||||
|
qmsInspecJobDTO.setInventoryStatus($currentInvStatus);
|
||||||
|
qmsInspecJobDTO.setInspecFreqBo($inspecFreqBo);
|
||||||
|
$hasInsTaskLotNoList.add(qmsInspecJobDTO);
|
||||||
createJob(lotNo, Freq.CHK_SEVERAL_SFC);
|
createJob(lotNo, Freq.CHK_SEVERAL_SFC);
|
||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
@ -729,7 +845,14 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
|||||||
if (index >= 0 && index < size) {
|
if (index >= 0 && index < size) {
|
||||||
// prevent out of list range
|
// prevent out of list range
|
||||||
String lotNo = sort.get(index).getLotNo();
|
String lotNo = sort.get(index).getLotNo();
|
||||||
$hasInsTaskLotNoList.add(lotNo);
|
QmsInspecJobDTO qmsInspecJobDTO = new QmsInspecJobDTO();
|
||||||
|
qmsInspecJobDTO.setLotNo(lotNo);
|
||||||
|
qmsInspecJobDTO.setQcSubCategories($currentQcSubCategory);
|
||||||
|
qmsInspecJobDTO.setTriggerPoint($triggerPoint);
|
||||||
|
qmsInspecJobDTO.setInspectLevel($currentInsLevel);
|
||||||
|
qmsInspecJobDTO.setInventoryStatus($currentInvStatus);
|
||||||
|
qmsInspecJobDTO.setInspecFreqBo($inspecFreqBo);
|
||||||
|
$hasInsTaskLotNoList.add(qmsInspecJobDTO);
|
||||||
createJob(lotNo, Freq.CHK_SEVERAL_SFC2);
|
createJob(lotNo, Freq.CHK_SEVERAL_SFC2);
|
||||||
|
|
||||||
flag = true;
|
flag = true;
|
||||||
@ -776,7 +899,14 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
|||||||
// prevent out of list range
|
// prevent out of list range
|
||||||
String lotNo = sort.get(index).getLotNo();
|
String lotNo = sort.get(index).getLotNo();
|
||||||
createJob(lotNo, Freq.CHK_INTERVAL_SFC_INSPEC_LEVEL);
|
createJob(lotNo, Freq.CHK_INTERVAL_SFC_INSPEC_LEVEL);
|
||||||
$hasInsTaskLotNoList.add(lotNo);
|
QmsInspecJobDTO qmsInspecJobDTO = new QmsInspecJobDTO();
|
||||||
|
qmsInspecJobDTO.setLotNo(lotNo);
|
||||||
|
qmsInspecJobDTO.setQcSubCategories($currentQcSubCategory);
|
||||||
|
qmsInspecJobDTO.setTriggerPoint($triggerPoint);
|
||||||
|
qmsInspecJobDTO.setInspectLevel($currentInsLevel);
|
||||||
|
qmsInspecJobDTO.setInventoryStatus($currentInvStatus);
|
||||||
|
qmsInspecJobDTO.setInspecFreqBo($inspecFreqBo);
|
||||||
|
$hasInsTaskLotNoList.add(qmsInspecJobDTO);
|
||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -830,7 +960,7 @@ public class AutoCreateJobServiceImpl implements AutoCreateJobService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String createJob(String lotNo, String freq) {
|
private String createJob(String lotNo, String freq) {
|
||||||
return createJob(lotNo, $operation, $resource, $qcPlan, freq, $user, $triggerType);
|
return createJob(lotNo, $operation, $resource, $qcPlan, freq, $user, $triggerPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String createJob(String lotNo, String operation, String resource, String qcPlan, String freq, String user, String triggerPoint) {
|
private String createJob(String lotNo, String operation, String resource, String qcPlan, String freq, String user, String triggerPoint) {
|
||||||
|
|||||||
@ -653,14 +653,22 @@ public class QmsInspecJobServiceImpl extends ServiceImpl<QmsInspecJobMapper, Qms
|
|||||||
String qcSubCategories = inspecJob.getQcSubCategories();
|
String qcSubCategories = inspecJob.getQcSubCategories();
|
||||||
// 获取 触发点
|
// 获取 触发点
|
||||||
String triggerPoint = inspecJob.getTriggerPoint();
|
String triggerPoint = inspecJob.getTriggerPoint();
|
||||||
|
// 根据lotNo 获取工单号
|
||||||
|
String shopOrder = "";
|
||||||
|
String lotBasisBo = LotBasis.genHandle(site, lotNo);
|
||||||
|
String shopOrderBo = qmsInspecJobMapper.selectShopOrderBo(lotBasisBo);
|
||||||
|
shopOrder = HandleBoProcessor.trimHandle(shopOrderBo);
|
||||||
// 非空校验
|
// 非空校验
|
||||||
nonEmptyCheck(lotNo, operation, qcSubCategories, triggerPoint);
|
nonEmptyCheck(lotNo, operation, shopOrder, qcSubCategories, triggerPoint);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 获取用户
|
// 获取用户
|
||||||
String user = StrUtil.isBlank(inspecJob.getUser()) ? SecurityUtils.getUserName() : inspecJob.getUser();
|
String user = StrUtil.isBlank(inspecJob.getUser()) ? SecurityUtils.getUserName() : inspecJob.getUser();
|
||||||
|
|
||||||
// 拼接 主键handle = site + lotNo + operation + qcSubCategories
|
// 拼接 主键handle = site + lotNo + shopOrder + operation + qcSubCategories
|
||||||
String handle = ZProductionLotInspectTaskRelation.genHandle(site, lotNo, operation, qcSubCategories, triggerPoint);
|
String handle = ZProductionLotInspectTaskRelation.genHandle(site, lotNo, operation, shopOrder, qcSubCategories, triggerPoint);
|
||||||
|
|
||||||
// 根据主键查询该数据是否已经存在,如果是,则报错
|
// 根据主键查询该数据是否已经存在,如果是,则报错
|
||||||
ZProductionLotInspectTaskRelation zProductionLotInspectTaskRelation = zProductionLotInspectTaskRelationService.getById(handle);
|
ZProductionLotInspectTaskRelation zProductionLotInspectTaskRelation = zProductionLotInspectTaskRelationService.getById(handle);
|
||||||
@ -685,17 +693,22 @@ public class QmsInspecJobServiceImpl extends ServiceImpl<QmsInspecJobMapper, Qms
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 非空校验
|
// 非空校验
|
||||||
private void nonEmptyCheck(String lotNo , String operation, String qcSubCategories, String triggerPoint) {
|
private void nonEmptyCheck(String lotNo , String operation, String shopOrder, String qcSubCategories, String triggerPoint) {
|
||||||
// 如果 生产批号lotNo 为空,则报错
|
// 如果 生产批号lotNo 为空,则报错
|
||||||
if (StrUtil.isBlank(lotNo)) {
|
if (StrUtil.isBlank(lotNo)) {
|
||||||
throw BusinessException.build("往[生产批与检验任务关系表]插入数据时,生产批号不能为空");
|
throw BusinessException.build("往[生产批与检验任务关系表]插入数据时,生产批号不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果 工序operation 为空,则报错
|
// 如果 工序 operation 为空,则报错
|
||||||
if (StrUtil.isBlank(operation)) {
|
if (StrUtil.isBlank(operation)) {
|
||||||
throw BusinessException.build("往[生产批与检验任务关系表]插入数据时,工序不能为空");
|
throw BusinessException.build("往[生产批与检验任务关系表]插入数据时,工序不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 如果 工单 shopOrder 为空,则报错
|
||||||
|
if (StrUtil.isBlank(shopOrder)) {
|
||||||
|
throw BusinessException.build("往[生产批与检验任务关系表]插入数据时,工单不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
// 如果 检验细类qcSubCategories 为空,则报错
|
// 如果 检验细类qcSubCategories 为空,则报错
|
||||||
if (StrUtil.isBlank(qcSubCategories)) {
|
if (StrUtil.isBlank(qcSubCategories)) {
|
||||||
throw BusinessException.build("往[生产批与检验任务关系表]插入数据时,检验细类不能为空");
|
throw BusinessException.build("往[生产批与检验任务关系表]插入数据时,检验细类不能为空");
|
||||||
|
|||||||
@ -0,0 +1,26 @@
|
|||||||
|
package com.foreverwin.iep.qms.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.foreverwin.iep.qms.entity.ZQmsLotQualityInspectStatusLog;
|
||||||
|
import com.foreverwin.iep.qms.mapper.ZQmsLotQualityInspectStatusLogMapper;
|
||||||
|
import com.foreverwin.iep.qms.service.ZQmsLotQualityInspectStatusLogService;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产批检验任务质检等级与状态日志
|
||||||
|
*
|
||||||
|
* @author leiqiaozhen
|
||||||
|
* @date 2024-12-25 18:40:25
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ZQmsLotQualityInspectStatusLogServiceImpl extends ServiceImpl<ZQmsLotQualityInspectStatusLogMapper, ZQmsLotQualityInspectStatusLog> implements ZQmsLotQualityInspectStatusLogService {
|
||||||
|
private final ZQmsLotQualityInspectStatusLogMapper zQmsLotQualityInspectStatusLogMapper;
|
||||||
|
@Override
|
||||||
|
public List<ZQmsLotQualityInspectStatusLog> getQmsLotQualityInspectStatusLogs(String site, String lotNo) {
|
||||||
|
return zQmsLotQualityInspectStatusLogMapper.getQmsRejudgmentLogs(site,lotNo);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -82,4 +82,6 @@ public interface QmsInspecJobMapper extends MomBaseMapper<QmsInspecJob> {
|
|||||||
IPage<Resource> selectResrcePage(FrontPage page, @Param("site") String site, @Param("searchText") String searchText,
|
IPage<Resource> selectResrcePage(FrontPage page, @Param("site") String site, @Param("searchText") String searchText,
|
||||||
@Param("operation") String operation);
|
@Param("operation") String operation);
|
||||||
IPage<SysRole> getUserGroup(FrontPage page, @Param("site")String site, @Param("searchText") String searchText);
|
IPage<SysRole> getUserGroup(FrontPage page, @Param("site")String site, @Param("searchText") String searchText);
|
||||||
|
|
||||||
|
String selectShopOrderBo(@Param("lotBasisBo")String lotBasisBo);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,20 @@
|
|||||||
|
package com.foreverwin.iep.qms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.foreverwin.iep.qms.entity.ZQmsLotQualityInspectStatusLog;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产批检验任务质检等级与状态日志
|
||||||
|
*
|
||||||
|
* @author leiqiaozhen
|
||||||
|
* @date 2024-12-25 18:40:25
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ZQmsLotQualityInspectStatusLogMapper extends BaseMapper<ZQmsLotQualityInspectStatusLog> {
|
||||||
|
|
||||||
|
List<ZQmsLotQualityInspectStatusLog> getQmsRejudgmentLogs(@Param("site") String site, @Param("lotNo") String lotNo);
|
||||||
|
}
|
||||||
@ -753,4 +753,13 @@
|
|||||||
where r.RESRCE = #{resrce} and r.SITE = #{site} and wn.IS_DEFAULT ='Y' and wn.STATUS ='Y'
|
where r.RESRCE = #{resrce} and r.SITE = #{site} and wn.IS_DEFAULT ='Y' and wn.STATUS ='Y'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectShopOrderBo" resultType="java.lang.String">
|
||||||
|
select
|
||||||
|
lb.SHOP_ORDER_BO
|
||||||
|
from
|
||||||
|
lot_basis lb
|
||||||
|
where
|
||||||
|
lb.HANDLE = #{lotBasisBo}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -0,0 +1,75 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.foreverwin.iep.qms.mapper.ZQmsLotQualityInspectStatusLogMapper">
|
||||||
|
|
||||||
|
<resultMap id="zQmsLotQualityInspectStatusLogMap" type="com.foreverwin.iep.qms.entity.ZQmsLotQualityInspectStatusLog">
|
||||||
|
<id property="sid" column="SID"/>
|
||||||
|
<result property="site" column="SITE"/>
|
||||||
|
<result property="inventoryId" column="INVENTORY_ID"/>
|
||||||
|
<result property="shopOrder" column="SHOP_ORDER"/>
|
||||||
|
<result property="operation" column="OPERATION"/>
|
||||||
|
<result property="resrce" column="RESRCE"/>
|
||||||
|
<result property="originalLevel" column="ORIGINAL_LEVEL"/>
|
||||||
|
<result property="rejudgLevel" column="REJUDG_LEVEL"/>
|
||||||
|
<result property="itemBo" column="ITEM_BO"/>
|
||||||
|
<result property="newItemBo" column="NEW_ITEM_BO"/>
|
||||||
|
<result property="originalLength" column="ORIGINAL_LENGTH"/>
|
||||||
|
<result property="newLength" column="NEW_LENGTH"/>
|
||||||
|
<result property="changeItem" column="CHANGE_ITEM"/>
|
||||||
|
<result property="demotionProcessHistory" column="DEMOTION_PROCESS_HISTORY"/>
|
||||||
|
<result property="degradationReasons" column="DEGRADATION_REASONS"/>
|
||||||
|
<result property="remark" column="REMARK"/>
|
||||||
|
<result property="type" column="TYPE"/>
|
||||||
|
<result property="inspectSubclass" column="INSPECT_SUBCLASS"/>
|
||||||
|
<result property="inspectionTaskNumber" column="INSPECTION_TASK_NUMBER"/>
|
||||||
|
<result property="storageBin" column="STORAGE_BIN"/>
|
||||||
|
<result property="status" column="STATUS"/>
|
||||||
|
<result property="item" column="ITEM"/>
|
||||||
|
<result property="itemDesc" column="ITEM_DESC"/>
|
||||||
|
<result property="reason" column="REASON"/>
|
||||||
|
<result property="dateCreate" column="DATE_CREATE"/>
|
||||||
|
<result property="dateUpdate" column="DATE_UPDATE"/>
|
||||||
|
<result property="creator" column="CREATOR"/>
|
||||||
|
<result property="updater" column="UPDATER"/>
|
||||||
|
</resultMap>
|
||||||
|
<select id="getQmsRejudgmentLogs"
|
||||||
|
resultType="com.foreverwin.iep.qms.entity.ZQmsLotQualityInspectStatusLog">
|
||||||
|
select
|
||||||
|
zqlqisl.SID
|
||||||
|
,zqlqisl.SITE
|
||||||
|
,zqlqisl.INVENTORY_ID
|
||||||
|
,zqlqisl.SHOP_ORDER
|
||||||
|
,zqlqisl.OPERATION
|
||||||
|
,zqlqisl.RESRCE
|
||||||
|
,zqlqisl.ORIGINAL_LEVEL
|
||||||
|
,zqlqisl.REJUDG_LEVEL
|
||||||
|
,zqlqisl.ITEM_BO
|
||||||
|
,zqlqisl.NEW_ITEM_BO
|
||||||
|
,zqlqisl.ORIGINAL_LENGTH
|
||||||
|
,zqlqisl.NEW_LENGTH
|
||||||
|
,zqlqisl.CHANGE_ITEM
|
||||||
|
,zqlqisl.DEMOTION_PROCESS_HISTORY
|
||||||
|
,zqlqisl.DEGRADATION_REASONS
|
||||||
|
,zqlqisl.REMARK
|
||||||
|
,zqlqisl.TYPE
|
||||||
|
,zqlqisl.INSPECT_SUBCLASS
|
||||||
|
,zqlqisl.INSPECTION_TASK_NUMBER
|
||||||
|
,zqlqisl.STORAGE_BIN
|
||||||
|
,zqlqisl.STATUS
|
||||||
|
,zqlqisl.ITEM
|
||||||
|
,zqlqisl.ITEM_DESC
|
||||||
|
,zqlqisl.REASON
|
||||||
|
,zqlqisl.DATE_CREATE
|
||||||
|
,zqlqisl.DATE_UPDATE
|
||||||
|
,zqlqisl.CREATOR
|
||||||
|
,zqlqisl.UPDATER
|
||||||
|
from
|
||||||
|
z_qms_lot_quality_inspect_status_log zqlqisl
|
||||||
|
where
|
||||||
|
zqlqisl.SITE = #{site}
|
||||||
|
and zqlqisl.INVENTORY_ID = #{lotNo}
|
||||||
|
order by zqlqisl.DATE_CREATE desc
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue
Block a user