巡检报表3

master
zhaoxiaolin 8 months ago
parent 796bab2176
commit c5da1a61e6

@ -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);

@ -151,6 +151,11 @@ public class QcProCheckServiceImpl implements QcProCheckService {
Map<String,QcCheckTaskDefect> defectMap = qcCheckTaskDefectMapper.getDefectMap(qcCheckTaskDetail);
for (QcCheckTaskDetail qcd : qcCheckTaskDetails) {
if(StringUtils.isNotBlank(qcd.getSampleQuality())){
qcd.setSampleQuality(qcd.getSampleQuality().replaceAll("\\..*", ""));//去掉小数
}
List<BaseFile> files = qmsFileMapper.getBaseFileBatch(qcd.getRecordId());
if (CollectionUtils.isNotEmpty(files)) {
qcd.setFiles(files);
@ -185,7 +190,10 @@ public class QcProCheckServiceImpl implements QcProCheckService {
Map<String,QcCheckTaskDefect> defectMap = qcCheckTaskDefectMapper.getDefectMap(qcCheckTaskDetail);
for (QcCheckTaskDetail qcd : qcCheckTaskDetails) {
qcd.setSampleQuality(qcd.getSampleQuality().replaceAll("\\..*", ""));//去掉小数
if(StringUtils.isNotBlank(qcd.getSampleQuality())){
qcd.setSampleQuality(qcd.getSampleQuality().replaceAll("\\..*", ""));//去掉小数
}
List<BaseFile> files = qmsFileMapper.getBaseFileBatch(qcd.getRecordId());
if (CollectionUtils.isNotEmpty(files)) {

@ -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) {

@ -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
</if>
@ -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
</if>
@ -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
</if>
</select>
<select id="getTableHzNoOkData" resultType="com.op.quality.domain.QcStaticTable">
select sum(t.noOk_quality) noOkQuality,
select * from (
select sum(t.noOk_quality) noOkQuality,
t.dict_label dataType
FROM(
FROM(
select
qct.noOk_quality,qct.sample_quality,
bdd.dict_label
from qc_check_task qct
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'
<if test="ymdms == 'yyyy'">
and CONVERT(varchar(4),qct.create_time, 120) = #{incomeTimeStr}
where qct.check_type = #{checkType} and qct.check_status = '2'
<if test="ymdms == 'yyyy'">and CONVERT(varchar(4),qct.create_time, 120) = #{incomeTimeStr}
</if>
<if test="ymdms == 'mm'">
and CONVERT(varchar(7),qct.create_time, 120) = #{incomeTimeStr}
</if>
<if test="ymdms == 'dd'">
and CONVERT(varchar(10),qct.create_time, 120) = #{incomeTimeStr}
<if test="
ymdms == 'mm'">and CONVERT(varchar(7),qct.create_time, 120) = #{incomeTimeStr}
</if>
and del_flag = '0' and qct.remark_code is not null
) t
group by t.dict_label
<if test="ymdms == 'dd'">
and CONVERT(varchar(10),qct.create_time, 120) = #{incomeTimeStr}
</if>
and del_flag = '0' and qct.remark_code is not null
) t
group by t.dict_label
) t0 order by noOkQuality desc
</select>
</mapper>

Loading…
Cancel
Save