diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java index 270e290c..00e1bc59 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java @@ -689,7 +689,11 @@ public class QcCheckTaskIncomeServiceImpl 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 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 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 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 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 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 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 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); diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProCheckServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProCheckServiceImpl.java index b44dc61b..152b0b24 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProCheckServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcProCheckServiceImpl.java @@ -151,6 +151,11 @@ public class QcProCheckServiceImpl implements QcProCheckService { Map defectMap = qcCheckTaskDefectMapper.getDefectMap(qcCheckTaskDetail); for (QcCheckTaskDetail qcd : qcCheckTaskDetails) { + + if(StringUtils.isNotBlank(qcd.getSampleQuality())){ + qcd.setSampleQuality(qcd.getSampleQuality().replaceAll("\\..*", ""));//去掉小数 + } + List files = qmsFileMapper.getBaseFileBatch(qcd.getRecordId()); if (CollectionUtils.isNotEmpty(files)) { qcd.setFiles(files); @@ -185,7 +190,10 @@ public class QcProCheckServiceImpl implements QcProCheckService { Map defectMap = qcCheckTaskDefectMapper.getDefectMap(qcCheckTaskDetail); for (QcCheckTaskDetail qcd : qcCheckTaskDetails) { - qcd.setSampleQuality(qcd.getSampleQuality().replaceAll("\\..*", ""));//去掉小数 + if(StringUtils.isNotBlank(qcd.getSampleQuality())){ + qcd.setSampleQuality(qcd.getSampleQuality().replaceAll("\\..*", ""));//去掉小数 + } + List files = qmsFileMapper.getBaseFileBatch(qcd.getRecordId()); if (CollectionUtils.isNotEmpty(files)) { diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java index 7df2496f..e8d746da 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcStaticTableServiceImpl.java @@ -917,7 +917,7 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService { //缺陷不良 for(int i=0;i< noOkTyps.size();i++){ - String noOkTyp = noOkTyps.get(0); + String noOkTyp = noOkTyps.get(i); String noOkTypeKey = col+noOkTyp; QcStaticTable noOk = noOks.get(noOkTypeKey); if(noOk!=null&&noOk.getNoOkQuality()!=null) { diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcStaticTableMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcStaticTableMapper.xml index 7e218b9e..68d971b4 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcStaticTableMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcStaticTableMapper.xml @@ -551,7 +551,7 @@ left join base_dict_data bdd on bdd.dict_type = 'unqualified_remark' and qct.remark_code = dict_value where qct.check_type = #{checkType} and qct.check_status = '2' and CONVERT(varchar(4),qct.create_time, 120) = #{incomeTimeStr} - and del_flag = '0' + and del_flag = '0' and bdd.dict_label is not null ) t group by hourName,dict_label @@ -566,7 +566,7 @@ left join base_dict_data bdd on bdd.dict_type = 'unqualified_remark' and qct.remark_code = dict_value where qct.check_type = #{checkType} and qct.check_status = '2' and CONVERT(varchar(7),qct.create_time, 120) = #{incomeTimeStr} - and del_flag = '0' + and del_flag = '0' and bdd.dict_label is not null ) t group by hourName,dict_label @@ -581,32 +581,33 @@ left join base_dict_data bdd on bdd.dict_type = 'unqualified_remark' and qct.remark_code = dict_value where qct.check_type = #{checkType} and qct.check_status = '2' and CONVERT(varchar(10),qct.create_time, 120) = #{incomeTimeStr} - and del_flag = '0' + and del_flag = '0' and bdd.dict_label is not null ) t group by hourName,dict_label