|
|
|
@ -16,17 +16,13 @@ import com.op.common.core.web.domain.AjaxResult;
|
|
|
|
|
import com.op.common.security.utils.SecurityUtils;
|
|
|
|
|
import com.op.quality.domain.*;
|
|
|
|
|
import com.op.quality.mapper.*;
|
|
|
|
|
import com.op.quality.service.IQcCheckTaskDefectService;
|
|
|
|
|
import com.op.quality.service.IQcCheckTaskProduceService;
|
|
|
|
|
import com.op.quality.service.IQcCheckTaskUserService;
|
|
|
|
|
import com.op.system.api.RemoteOpenService;
|
|
|
|
|
import com.op.quality.service.*;
|
|
|
|
|
import com.op.system.api.domain.SysUser;
|
|
|
|
|
import com.op.system.api.domain.quality.QcUserMaterialDTO;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import com.op.quality.service.IQcCheckTaskIncomeService;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
import org.springframework.web.context.request.RequestContextHolder;
|
|
|
|
@ -70,8 +66,8 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
|
|
|
|
|
@Autowired
|
|
|
|
|
private IQcCheckTaskUserService qcCheckTaskUserService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private RemoteOpenService remoteOpenService;
|
|
|
|
|
// @Autowired
|
|
|
|
|
// private RemoteOpenService remoteOpenService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private QMSFileMapper qmsFileMapper;
|
|
|
|
@ -85,8 +81,8 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
|
|
|
|
|
@Autowired
|
|
|
|
|
private QcCheckTaskDefectMapper qcCheckTaskDefectMapper;
|
|
|
|
|
|
|
|
|
|
// @Autowired
|
|
|
|
|
// private QcCheckUnqualifiedService qcCheckUnqualifiedService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private IQcCheckUnqualifiedService qcCheckUnqualifiedService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询来料检验
|
|
|
|
@ -447,11 +443,11 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
|
|
|
|
|
qcCheckTaskProduce.setCheckTime(DateUtils.getNowDate());
|
|
|
|
|
qcCheckTaskProduce.setCheckManCode(SecurityUtils.getUsername());
|
|
|
|
|
n = qcCheckTaskProduceMapper.updateQcCheckTaskProduce(qcCheckTaskProduce);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**pro_order_workorder_batch-->qc_status->2**/
|
|
|
|
|
qcCheckTaskIncome.setStatus("2");
|
|
|
|
|
qcCheckUnqualifiedMapper.updateWorkOrderBatchStatus(qcCheckTaskIncome);
|
|
|
|
|
/**pro_order_workorder_batch-->首检qc_status->2**/
|
|
|
|
|
if("checkTypeSC".equals(qcCheckTaskIncome.getCheckType())){
|
|
|
|
|
qcCheckTaskIncome.setStatus("2");
|
|
|
|
|
qcCheckUnqualifiedMapper.updateWorkOrderBatchStatus(qcCheckTaskIncome);
|
|
|
|
|
}
|
|
|
|
|
}else if("product".equals(qcCheckTaskIncome.getTypeCode())){
|
|
|
|
|
QcCheckTaskWarehousing warehousing = new QcCheckTaskWarehousing();
|
|
|
|
|
warehousing.setCheckStatus("2");
|
|
|
|
@ -598,14 +594,22 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
|
|
|
|
|
String checkType = qcCheckTaskIncome.getCheckType();
|
|
|
|
|
qcCheckTaskIncome.setFactoryCode(qcCheckTaskIncome.getFactoryCode().replace("ds_",""));
|
|
|
|
|
//默认合格
|
|
|
|
|
String result = "Y";
|
|
|
|
|
for(QcCheckTaskDetail detail:details){
|
|
|
|
|
if("N".equals(detail.getStatus())){
|
|
|
|
|
result = "N";//不合格
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
String result=null;
|
|
|
|
|
if(StringUtils.isBlank(qcCheckTaskIncome.getCheckResult())){
|
|
|
|
|
result = "Y";
|
|
|
|
|
for(QcCheckTaskDetail detail:details){
|
|
|
|
|
if("N".equals(detail.getStatus())){
|
|
|
|
|
result = "N";//不合格
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
//有最终判定的情况
|
|
|
|
|
result = qcCheckTaskIncome.getCheckResult();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int n = 0;
|
|
|
|
|
QcCheckTaskIncome qcCheckTask = new QcCheckTaskIncome();
|
|
|
|
|
qcCheckTask.setUpdateBy(updateBy);
|
|
|
|
@ -613,6 +617,7 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
|
|
|
|
|
qcCheckTask.setCheckStatus("2");//检测状态0待检测1检测中2检测完成
|
|
|
|
|
qcCheckTask.setUpdateTime(nowTime);
|
|
|
|
|
qcCheckTask.setCheckTime(nowTime);
|
|
|
|
|
qcCheckTask.setRemark(qcCheckTaskIncome.getRemark());
|
|
|
|
|
qcCheckTask.setCheckResult(result);//检验结果Y合格 N不合格
|
|
|
|
|
qcCheckTask.setIncomeBatchNo(qcCheckTaskIncome.getIncomeBatchNo());
|
|
|
|
|
BigDecimal noOkQquality = new BigDecimal("0");
|
|
|
|
@ -690,6 +695,7 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
|
|
|
|
|
if("checkTypeSC".equals(qcCheckTaskIncome.getCheckType())){
|
|
|
|
|
/**pro_order_workorder_batch-->qc_status->2**/
|
|
|
|
|
qcCheckTaskIncome.setStatus("2");
|
|
|
|
|
qcCheckTaskIncome.setCheckResult(result);
|
|
|
|
|
qcCheckUnqualifiedMapper.updateWorkOrderBatchStatus(qcCheckTaskIncome);
|
|
|
|
|
}
|
|
|
|
|
if("checkTypeSC".equals(qcCheckTaskIncome.getCheckType())&&"N".equals(result)){
|
|
|
|
@ -732,8 +738,48 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
|
|
|
|
|
unqualified.setType(checkType);
|
|
|
|
|
n = qcCheckUnqualifiedMapper.insertQcCheckUnqualified(unqualified);
|
|
|
|
|
logger.info("qc_check_unqualified:" + n);
|
|
|
|
|
|
|
|
|
|
//qcCheckUnqualifiedService.updateQcCheckUnqualified(qcCheckUnqualified);
|
|
|
|
|
if("1".equals(qcCheckTaskIncome.getStartOA())){
|
|
|
|
|
|
|
|
|
|
unqualified.setTypeCode(qcCheckTaskIncome.getTypeCode());
|
|
|
|
|
//不合格描述
|
|
|
|
|
unqualified.setRemark(qcCheckTaskIncome.getRemark());
|
|
|
|
|
//厂区(小榄固定值)
|
|
|
|
|
unqualified.setOaFactory("0");
|
|
|
|
|
//来料类别
|
|
|
|
|
unqualified.setMaterialType(qcCheckTaskIncome.getMaterialType());
|
|
|
|
|
//物料来源
|
|
|
|
|
unqualified.setMaterialFrom(qcCheckTaskIncome.getMaterialFrom());
|
|
|
|
|
//物料编号
|
|
|
|
|
unqualified.setMaterialCode(qcCheckTaskIncome.getMaterialCode());
|
|
|
|
|
//物料名称
|
|
|
|
|
unqualified.setMaterialName(qcCheckTaskIncome.getMaterialName());
|
|
|
|
|
//供应商编码
|
|
|
|
|
unqualified.setSupplierCode(qcCheckTaskIncome.getSupplierCode());
|
|
|
|
|
//供应商名称
|
|
|
|
|
unqualified.setSupplierName(qcCheckTaskIncome.getSupplierName());
|
|
|
|
|
//供应商名称
|
|
|
|
|
unqualified.setSupplierName(qcCheckTaskIncome.getSupplierName());
|
|
|
|
|
//生产批号
|
|
|
|
|
unqualified.setIncomeBatchNo(qcCheckTaskIncome.getIncomeBatchNo());
|
|
|
|
|
//来料数量
|
|
|
|
|
unqualified.setQuality(qcCheckTaskIncome.getQuality().toString());
|
|
|
|
|
//来料单位
|
|
|
|
|
unqualified.setUnit(qcCheckTaskIncome.getUnit());
|
|
|
|
|
//检验编号
|
|
|
|
|
unqualified.setCheckNo(qcCheckTaskIncome.getCheckNo());
|
|
|
|
|
//仓储报检人-李爱娟
|
|
|
|
|
unqualified.setCzbjr("284");
|
|
|
|
|
//物料类别
|
|
|
|
|
unqualified.setMaterialType(qcCheckTaskIncome.getMaterialType());
|
|
|
|
|
//物料来源
|
|
|
|
|
unqualified.setMaterialFrom(qcCheckTaskIncome.getMaterialFrom());
|
|
|
|
|
//QC主管-朱继新
|
|
|
|
|
unqualified.setQczg("660");
|
|
|
|
|
//申请人-朱继新
|
|
|
|
|
unqualified.setSqr("660");
|
|
|
|
|
unqualified.setUser("660");
|
|
|
|
|
qcCheckUnqualifiedService.updateQcCheckUnqualified(unqualified);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 1 ;
|
|
|
|
|
}
|
|
|
|
|