qc_check_task_defect数据添加逻辑修改

master
zhaoxiaolin 10 months ago
parent f28c8d5bb4
commit 3486c00461

@ -240,7 +240,7 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
if (!CollectionUtils.isEmpty(defectList)) { if (!CollectionUtils.isEmpty(defectList)) {
for (QcCheckTaskDefect defect : defectList) { for (QcCheckTaskDefect defect : defectList) {
defect.setBelongTo(beLongId); defect.setBelongTo(beLongId);
qcCheckTaskDefectService.insertQcCheckTaskDefect(defect); //qcCheckTaskDefectService.insertQcCheckTaskDefect(defect);
noOkQuality = noOkQuality.add(defect.getNoOkQuality()==null?new BigDecimal("0"):defect.getNoOkQuality()); noOkQuality = noOkQuality.add(defect.getNoOkQuality()==null?new BigDecimal("0"):defect.getNoOkQuality());
} }
} }

@ -183,7 +183,7 @@ public class QcCheckTaskInventoryServiceImpl implements IQcCheckTaskInventorySer
if (!CollectionUtils.isEmpty(defectList)) { if (!CollectionUtils.isEmpty(defectList)) {
for (QcCheckTaskDefect defect : defectList) { for (QcCheckTaskDefect defect : defectList) {
defect.setBelongTo(beLongId); defect.setBelongTo(beLongId);
qcCheckTaskDefectService.insertQcCheckTaskDefect(defect); //qcCheckTaskDefectService.insertQcCheckTaskDefect(defect);
noOkQuality = noOkQuality.add(defect.getNoOkQuality() == null ? new BigDecimal("0") : defect.getNoOkQuality()); noOkQuality = noOkQuality.add(defect.getNoOkQuality() == null ? new BigDecimal("0") : defect.getNoOkQuality());
} }
} }

@ -181,7 +181,7 @@ public class QcCheckTaskMarketServiceImpl implements IQcCheckTaskMarketService {
if (!CollectionUtils.isEmpty(defectList)) { if (!CollectionUtils.isEmpty(defectList)) {
for (QcCheckTaskDefect defect : defectList) { for (QcCheckTaskDefect defect : defectList) {
defect.setBelongTo(beLongId); defect.setBelongTo(beLongId);
qcCheckTaskDefectService.insertQcCheckTaskDefect(defect); //qcCheckTaskDefectService.insertQcCheckTaskDefect(defect);
noOkQuality = noOkQuality.add(defect.getNoOkQuality() == null ? new BigDecimal("0") : defect.getNoOkQuality()); noOkQuality = noOkQuality.add(defect.getNoOkQuality() == null ? new BigDecimal("0") : defect.getNoOkQuality());
} }
} }

@ -226,7 +226,7 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService
if (!CollectionUtils.isEmpty(defectList)) { if (!CollectionUtils.isEmpty(defectList)) {
for (QcCheckTaskDefect defect : defectList) { for (QcCheckTaskDefect defect : defectList) {
defect.setBelongTo(beLongId); defect.setBelongTo(beLongId);
qcCheckTaskDefectService.insertQcCheckTaskDefect(defect); //qcCheckTaskDefectService.insertQcCheckTaskDefect(defect);
noOkQuality = noOkQuality.add(defect.getNoOkQuality()==null?new BigDecimal("0"):defect.getNoOkQuality()); noOkQuality = noOkQuality.add(defect.getNoOkQuality()==null?new BigDecimal("0"):defect.getNoOkQuality());
} }
} }

@ -205,7 +205,7 @@ public class QcCheckTaskWarehousingServiceImpl implements IQcCheckTaskWarehousin
if (!CollectionUtils.isEmpty(defectList)) { if (!CollectionUtils.isEmpty(defectList)) {
for (QcCheckTaskDefect defect : defectList) { for (QcCheckTaskDefect defect : defectList) {
defect.setBelongTo(beLongId); defect.setBelongTo(beLongId);
qcCheckTaskDefectService.insertQcCheckTaskDefect(defect); //qcCheckTaskDefectService.insertQcCheckTaskDefect(defect);
noOkQuality = noOkQuality.add(defect.getNoOkQuality()==null?new BigDecimal("0"):defect.getNoOkQuality()); noOkQuality = noOkQuality.add(defect.getNoOkQuality()==null?new BigDecimal("0"):defect.getNoOkQuality());
} }
} }

@ -132,7 +132,7 @@
</select> </select>
<select id="getDefectMap" resultType="com.op.quality.domain.QcCheckTaskDefect"> <select id="getDefectMap" resultType="com.op.quality.domain.QcCheckTaskDefect">
SELECT SELECT
belong_to, belong_to belongTo,
belong_to_detail belongToDetail, belong_to_detail belongToDetail,
STUFF( STUFF(
(SELECT ',' + defect_code (SELECT ',' + defect_code
@ -140,22 +140,23 @@
WHERE belong_to_detail = qctd.belong_to_detail and belong_to = qctd.belong_to WHERE belong_to_detail = qctd.belong_to_detail and belong_to = qctd.belong_to
FOR xml path('') FOR xml path('')
),1,1,'' ),1,1,''
) defectCodes, ) defectCodes,
STUFF( STUFF(
(SELECT ',' + defect_subclass+':' + CAST(noOk_quality AS VARCHAR(15)) (SELECT ',' + defect_subclass+':' + CAST(noOk_quality AS VARCHAR(15))
FROM qc_check_task_defect FROM qc_check_task_defect
WHERE belong_to_detail = qctd.belong_to_detail and belong_to = qctd.belong_to WHERE belong_to_detail = qctd.belong_to_detail and belong_to = qctd.belong_to
FOR xml path('') FOR xml path('')
),1,1,'' ),1,1,''
) defectNames, ) defectNames,
STUFF( STUFF(
(SELECT ',' + CAST(noOk_quality AS VARCHAR(15)) (SELECT ',' + CAST(noOk_quality AS VARCHAR(15))
FROM qc_check_task_defect FROM qc_check_task_defect
WHERE belong_to_detail = qctd.belong_to_detail and belong_to = qctd.belong_to WHERE belong_to_detail = qctd.belong_to_detail and belong_to = qctd.belong_to
FOR xml path('') FOR xml path('')
),1,1,'' ),1,1,''
) defectQualitys ) defectQualitys
FROM qc_check_task_defect qctd where qctd.del_flag = '0' and belong_to= #{belongTo} FROM qc_check_task_defect qctd where qctd.del_flag = '0' and belong_to= #{belongTo}
and belong_to_detail is not null
GROUP by qctd.belong_to,qctd.belong_to_detail GROUP by qctd.belong_to,qctd.belong_to_detail
</select> </select>

Loading…
Cancel
Save