|
|
|
@ -689,7 +689,11 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
|
|
|
|
|
qcCheckTask.setNoOkQuality(noOkQquality);//累计不合格数
|
|
|
|
|
qcCheckTask.setCheckManCode(qcCheckTaskIncome.getUpdateBy());
|
|
|
|
|
qcCheckTask.setCheckManName(qcCheckTaskIncome.getUpdateByName());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
qcCheckTask.setSampleQuality(qcCheckTaskIncome.getSampleQuality());
|
|
|
|
|
|
|
|
|
|
qcCheckTask.setReason(qcCheckTaskIncome.getReason());
|
|
|
|
|
qcCheckTask.setBz(qcCheckTaskIncome.getAttr3());//备注
|
|
|
|
|
|
|
|
|
@ -721,12 +725,45 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
|
|
|
|
|
qcCheckTask.setSccj(qcCheckTaskIncome.getSccj());// 所属车间
|
|
|
|
|
qcCheckTask.setSqr(qcCheckTaskIncome.getSqr());// 申请人Id
|
|
|
|
|
|
|
|
|
|
BigDecimal sampleQuality = new BigDecimal("0");
|
|
|
|
|
for(QcCheckTaskDetail detail:details){
|
|
|
|
|
detail.setUpdateTime(nowTime);
|
|
|
|
|
sampleQuality = sampleQuality.add(new BigDecimal(detail.getSampleQuality()==null?"0":detail.getSampleQuality()));
|
|
|
|
|
//上传附件
|
|
|
|
|
if (StringUtils.isNotEmpty(detail.getFileListStr())) {
|
|
|
|
|
String[] ids = detail.getFileListStr().split(",");
|
|
|
|
|
List<BaseFileData> files = new ArrayList<>();
|
|
|
|
|
BaseFileData file = null;
|
|
|
|
|
for (String id : ids) {
|
|
|
|
|
file = new BaseFileData();
|
|
|
|
|
file.setFileId(IdUtils.fastSimpleUUID());
|
|
|
|
|
file.setFileName(id.split("&fileName=")[1]);
|
|
|
|
|
file.setFileAddress(id);
|
|
|
|
|
file.setSourceId(detail.getRecordId());
|
|
|
|
|
file.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
|
file.setCreateTime(nowTime);
|
|
|
|
|
files.add(file);
|
|
|
|
|
}
|
|
|
|
|
/**base_file**/
|
|
|
|
|
n = qmsFileMapper.insertBaseFileBatch(files);
|
|
|
|
|
System.out.println("base_file:"+n);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**qc_check_task_cg**/
|
|
|
|
|
List<QcCheckTaskIncome> valiData = qcCheckTaskIncomeMapper.selectQcCheckTaskCgByRecordId(belongId);
|
|
|
|
|
// 判断表中是否存在此条数据
|
|
|
|
|
if (valiData != null && valiData.size() > 0) {
|
|
|
|
|
n = qcCheckTaskIncomeMapper.updateQcCheckTaskCg(qcCheckTask);//updateQcCheckTaskCG
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
|
|
if(qcCheckTaskIncome.getSampleQuality().equals(BigDecimal.ZERO)){
|
|
|
|
|
qcCheckTask.setSampleQuality(sampleQuality);
|
|
|
|
|
}else{
|
|
|
|
|
qcCheckTask.setSampleQuality(qcCheckTaskIncome.getSampleQuality());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
qcCheckTask.setCheckNo(qcCheckTaskIncome.getCheckNo());
|
|
|
|
|
qcCheckTask.setOrderNo(qcCheckTaskIncome.getOrderNo());
|
|
|
|
|
qcCheckTask.setMaterialCode(qcCheckTaskIncome.getMaterialCode());
|
|
|
|
@ -747,29 +784,7 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
|
|
|
|
|
}
|
|
|
|
|
logger.info("qc_check_task:"+n);
|
|
|
|
|
/**更新qc_check_task_detail**/
|
|
|
|
|
for(QcCheckTaskDetail detail:details){
|
|
|
|
|
detail.setUpdateTime(nowTime);
|
|
|
|
|
//上传附件
|
|
|
|
|
if (StringUtils.isNotEmpty(detail.getFileListStr())) {
|
|
|
|
|
String[] ids = detail.getFileListStr().split(",");
|
|
|
|
|
List<BaseFileData> files = new ArrayList<>();
|
|
|
|
|
BaseFileData file = null;
|
|
|
|
|
for (String id : ids) {
|
|
|
|
|
file = new BaseFileData();
|
|
|
|
|
file.setFileId(IdUtils.fastSimpleUUID());
|
|
|
|
|
file.setFileName(id.split("&fileName=")[1]);
|
|
|
|
|
file.setFileAddress(id);
|
|
|
|
|
file.setSourceId(detail.getRecordId());
|
|
|
|
|
file.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
|
file.setCreateTime(nowTime);
|
|
|
|
|
files.add(file);
|
|
|
|
|
}
|
|
|
|
|
/**base_file**/
|
|
|
|
|
n = qmsFileMapper.insertBaseFileBatch(files);
|
|
|
|
|
System.out.println("base_file:"+n);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
n= qcCheckTaskIncomeMapper.updateQcCheckTaskDetails(details);
|
|
|
|
|
logger.info("更新qc_check_task_detail:"+n);
|
|
|
|
|
|
|
|
|
@ -862,7 +877,7 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
|
|
|
|
|
BigDecimal sampleQuality = new BigDecimal("0");
|
|
|
|
|
for(QcCheckTaskDetail detail:details){
|
|
|
|
|
detail.setUpdateTime(nowTime);
|
|
|
|
|
sampleQuality = noOkQquality.add(new BigDecimal(detail.getSampleQuality()==null?"0":detail.getSampleQuality()));
|
|
|
|
|
sampleQuality = sampleQuality.add(new BigDecimal(detail.getSampleQuality()==null?"0":detail.getSampleQuality()));
|
|
|
|
|
//上传附件
|
|
|
|
|
if (StringUtils.isNotEmpty(detail.getFileListStr())) {
|
|
|
|
|
String[] ids = detail.getFileListStr().split(",");
|
|
|
|
@ -884,9 +899,11 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// if(qcCheckTask.getSampleQuality().equals(BigDecimal.ZERO)){
|
|
|
|
|
// qcCheckTask.setSampleQuality(sampleQuality);
|
|
|
|
|
// }
|
|
|
|
|
if(qcCheckTaskIncome.getSampleQuality().equals(BigDecimal.ZERO)){
|
|
|
|
|
qcCheckTask.setSampleQuality(sampleQuality);
|
|
|
|
|
}else{
|
|
|
|
|
qcCheckTask.setSampleQuality(qcCheckTaskIncome.getSampleQuality());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**qc_check_task**/
|
|
|
|
|
n = qcCheckTaskIncomeMapper.updateQcCheckTask(qcCheckTask);
|
|
|
|
|