|
|
|
|
@ -1787,6 +1787,8 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
|
|
|
|
|
if (StringUtils.isNotBlank(data.getAttr2())){
|
|
|
|
|
count = count + Integer.parseInt(data.getAttr2());
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
map.put(data.getAttr1(), "0");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
map.put("count", Integer.toString(count));
|
|
|
|
|
@ -1800,7 +1802,7 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
|
|
|
|
|
map2.put("defect","抽样数");
|
|
|
|
|
for (QcCheckTaskDefect data : list){
|
|
|
|
|
if ("合计".equals(data.getDefectSubclass())){
|
|
|
|
|
map1.put(data.getAttr1(),data.getAttr2());
|
|
|
|
|
map1.put(data.getAttr1(),StringUtils.isEmpty(data.getAttr2()) ? "0" : data.getAttr2());
|
|
|
|
|
map2.put(data.getAttr1(),data.getAttr3());
|
|
|
|
|
if (StringUtils.isNotBlank(data.getAttr2())){
|
|
|
|
|
count1 = count1 + Integer.parseInt(data.getAttr2());
|
|
|
|
|
@ -2081,6 +2083,7 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
|
|
|
|
|
List<Map<String, String>> dtos = new ArrayList<>();
|
|
|
|
|
//获取不良种类
|
|
|
|
|
List<String> bpDefects = qcStaticTableMapper.getBpDefects(qcStaticTable);
|
|
|
|
|
bpDefects.add("其他");
|
|
|
|
|
List<QcCheckTaskDefect> monthList = qcStaticTableMapper.getBPDefectMothPCMapV2(qcStaticTable);
|
|
|
|
|
qcStaticTable.setYearMonth(null);
|
|
|
|
|
List<QcCheckTaskDefect> totalList = qcStaticTableMapper.getBPDefectMothPCMapV2(qcStaticTable);
|
|
|
|
|
@ -2099,21 +2102,16 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
|
|
|
|
|
for (String defect : bpDefects) {
|
|
|
|
|
for (QcCheckTaskDefect item : list){
|
|
|
|
|
if (defect.equals(item.getDefectSubclass())){
|
|
|
|
|
if (StringUtils.isNotBlank(item.getAttr1())){
|
|
|
|
|
if ("rate".equals(type)){
|
|
|
|
|
result.put("item"+i, item.getAttr1());
|
|
|
|
|
}else {
|
|
|
|
|
if (StringUtils.isNotBlank(item.getAttr2())){
|
|
|
|
|
result.put("item"+i,new BigDecimal(item.getAttr1()).divide(new BigDecimal(item.getAttr2()),2,RoundingMode.HALF_UP).toString());
|
|
|
|
|
}else {
|
|
|
|
|
result.put("item"+i,"100");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(item.getAttr2()) && StringUtils.isNotBlank(item.getAttr3())){
|
|
|
|
|
BigDecimal itemNoOkRate = new BigDecimal(0);
|
|
|
|
|
itemNoOkRate = new BigDecimal(item.getAttr2()).divide(new BigDecimal(item.getAttr3()),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100));
|
|
|
|
|
result.put("item"+i,itemNoOkRate.toString());
|
|
|
|
|
}else {
|
|
|
|
|
result.put("item"+i,"0");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}else {
|
|
|
|
|
result.put("item"+i,"0");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
i++;
|
|
|
|
|
@ -2197,6 +2195,7 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
|
|
|
|
|
|
|
|
|
|
//获取不良种类
|
|
|
|
|
List<String> bpDefects = qcStaticTableMapper.getBpDefects(qcStaticTable);
|
|
|
|
|
bpDefects.add("其他");
|
|
|
|
|
result.put("xData",bpDefects);
|
|
|
|
|
|
|
|
|
|
//当前查询月份的不良率
|
|
|
|
|
@ -2231,7 +2230,14 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
|
|
|
|
|
boolean flag = true;
|
|
|
|
|
for (QcCheckTaskDefect item : monthList){
|
|
|
|
|
if (defect.equals(item.getDefectSubclass())){
|
|
|
|
|
yDataLeft.add(item.getAttr1());
|
|
|
|
|
if (StringUtils.isNotBlank(item.getAttr2()) && StringUtils.isNotBlank(item.getAttr3())){
|
|
|
|
|
//不良率
|
|
|
|
|
BigDecimal itemNoOkRate = new BigDecimal(0);
|
|
|
|
|
itemNoOkRate = new BigDecimal(item.getAttr2()).divide(new BigDecimal(item.getAttr3()),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100));
|
|
|
|
|
yDataLeft.add(itemNoOkRate.toString());
|
|
|
|
|
}else {
|
|
|
|
|
yDataLeft.add("0");
|
|
|
|
|
}
|
|
|
|
|
flag = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
@ -2251,7 +2257,14 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
|
|
|
|
|
boolean flag = true;
|
|
|
|
|
for (QcCheckTaskDefect item : totalList){
|
|
|
|
|
if (defect.equals(item.getDefectSubclass())){
|
|
|
|
|
yDataRight.add(item.getAttr1());
|
|
|
|
|
if (StringUtils.isNotBlank(item.getAttr2()) && StringUtils.isNotBlank(item.getAttr3())){
|
|
|
|
|
//不良率
|
|
|
|
|
BigDecimal itemNoOkRate = new BigDecimal(0);
|
|
|
|
|
itemNoOkRate = new BigDecimal(item.getAttr2()).divide(new BigDecimal(item.getAttr3()),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100));
|
|
|
|
|
yDataRight.add(itemNoOkRate.toString());
|
|
|
|
|
}else {
|
|
|
|
|
yDataRight.add("0");
|
|
|
|
|
}
|
|
|
|
|
flag = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|