|
|
|
@ -736,7 +736,7 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
|
|
|
|
|
}
|
|
|
|
|
return dtos;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**2025-04-01调整过**/
|
|
|
|
|
@Override
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
public QcStaticTable getDLTableAvgInfo(QcStaticTable qcStaticTable) {
|
|
|
|
@ -769,20 +769,33 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
|
|
|
|
|
for (int n = 0; n < colCode2.size(); n++) {
|
|
|
|
|
String key = colCode1.get(m) + "-" + colCode2.get(n) + "-" + day;
|
|
|
|
|
QcStaticTable avgdto = titleMap.get(key);
|
|
|
|
|
if (avgdto != null) {
|
|
|
|
|
if (avgdto != null && StringUtils.isNotBlank(avgdto.getQuality())) {
|
|
|
|
|
String avgArrayStr = avgdto.getQuality().replace("[", "")
|
|
|
|
|
.replace("]", "")
|
|
|
|
|
.replace("\"", "");
|
|
|
|
|
.replace("\"", "")
|
|
|
|
|
.replaceAll("[\\u4e00-\\u9fa5]+", "")
|
|
|
|
|
.replace("/", "");
|
|
|
|
|
List<String> avgArray = Arrays.asList(avgArrayStr.split(","));
|
|
|
|
|
if(avgArray.size()==0){
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
BigDecimal addVal = new BigDecimal("0.00");
|
|
|
|
|
int s = 0;
|
|
|
|
|
for (String avgVal : avgArray) {
|
|
|
|
|
if(avgVal.matches(".*\\..*\\..*")){
|
|
|
|
|
addVal = addVal.add(new BigDecimal(avgVal.substring(2)));
|
|
|
|
|
s+=1;
|
|
|
|
|
}else{
|
|
|
|
|
addVal = addVal.add(new BigDecimal(avgVal));
|
|
|
|
|
if(StringUtils.isNotBlank(removeBeforeColon(avgVal))){
|
|
|
|
|
addVal = addVal.add(new BigDecimal(removeBeforeColon(avgVal)));
|
|
|
|
|
s+=1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
BigDecimal avg = addVal.divide(new BigDecimal(avgArray.size()), 2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
BigDecimal avg = BigDecimal.ZERO;
|
|
|
|
|
if(s>0){
|
|
|
|
|
avg = addVal.divide(new BigDecimal(s), 2, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
}
|
|
|
|
|
result.put("mcode" + m + "Pcode" + n, avg);
|
|
|
|
|
detailResult.put("mcode" + m + "Pcode" + n + "Detail", avgArrayStr.replace(",", "\n"));
|
|
|
|
|
} else {
|
|
|
|
@ -812,7 +825,13 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
|
|
|
|
|
|
|
|
|
|
return dto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static String removeBeforeColon(String input) {
|
|
|
|
|
int index = input.indexOf(':');
|
|
|
|
|
if (index != -1) {
|
|
|
|
|
return input.substring(index + 1);
|
|
|
|
|
}
|
|
|
|
|
return input;
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
public QcStaticTable getDLTableCPKInfo(QcStaticTable qcStaticTable) {
|
|
|
|
@ -1319,6 +1338,7 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
|
|
|
|
|
.replace("/", "")
|
|
|
|
|
.replace(",,", ",")
|
|
|
|
|
.replace("..", ".")
|
|
|
|
|
.replaceAll("[\\u4e00-\\u9fa5]+", "")
|
|
|
|
|
.replace("\\", "");
|
|
|
|
|
List<String> actArray0 = Arrays.asList(actArrayStr.split(","));
|
|
|
|
|
List<String> actArray = new ArrayList<>();
|
|
|
|
@ -1415,29 +1435,36 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
|
|
|
|
|
dto1 = new HashMap<>();
|
|
|
|
|
dto1.put("materialName",bpMaterial.getMaterialName());
|
|
|
|
|
dto1.put("dataType","抽检数");
|
|
|
|
|
BigDecimal rowSum = BigDecimal.ZERO;
|
|
|
|
|
for(int m=0;m<days.size();m++){
|
|
|
|
|
|
|
|
|
|
QcStaticTable sampMap = sampMaps.get(bpMaterial.getMaterialCode()+days.get(m));
|
|
|
|
|
if(sampMap!=null){
|
|
|
|
|
dto1.put("monthNum"+m,sampMap.getSampleQty().replace(".00",""));
|
|
|
|
|
rowSum = rowSum.add(new BigDecimal(sampMap.getSampleQty()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
dto1.put("rowSum",rowSum.toString().replace(".00",""));
|
|
|
|
|
dtos.add(dto1);
|
|
|
|
|
|
|
|
|
|
dto2 = new HashMap<>();
|
|
|
|
|
dto2.put("materialName",bpMaterial.getMaterialName());
|
|
|
|
|
dto2.put("dataType","不良品数");
|
|
|
|
|
BigDecimal rowSum2 = BigDecimal.ZERO;
|
|
|
|
|
for(int m=0;m<days.size();m++){
|
|
|
|
|
QcStaticTable sampMap = sampMaps.get(bpMaterial.getMaterialCode()+days.get(m));
|
|
|
|
|
if(sampMap!=null){
|
|
|
|
|
dto2.put("monthNum"+m,sampMap.getNoOkQty().replace(".00",""));
|
|
|
|
|
rowSum2 = rowSum2.add(new BigDecimal(sampMap.getNoOkQty()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
dto2.put("rowSum",rowSum2.toString().replace(".00",""));
|
|
|
|
|
dtos.add(dto2);
|
|
|
|
|
|
|
|
|
|
dto3 = new HashMap<>();
|
|
|
|
|
dto3.put("materialName",bpMaterial.getMaterialName());
|
|
|
|
|
dto3.put("dataType","不良率%");
|
|
|
|
|
BigDecimal rowRadio = BigDecimal.ZERO;
|
|
|
|
|
for(int m=0;m<days.size();m++){
|
|
|
|
|
QcStaticTable sampMap = sampMaps.get(bpMaterial.getMaterialCode()+days.get(m));
|
|
|
|
|
if(sampMap!=null){
|
|
|
|
@ -1452,6 +1479,12 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(rowSum.compareTo(BigDecimal.ZERO)!=0){
|
|
|
|
|
rowRadio = rowSum2
|
|
|
|
|
.multiply(new BigDecimal("100"))
|
|
|
|
|
.divide(rowSum,2,BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
}
|
|
|
|
|
dto3.put("rowSum",rowRadio.toString()+"%");
|
|
|
|
|
dtos.add(dto3);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -1470,6 +1503,8 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
|
|
|
|
|
dto6.put("materialName","总合计");
|
|
|
|
|
dto6.put("dataType","不良率%");
|
|
|
|
|
|
|
|
|
|
BigDecimal rowHjSample = BigDecimal.ZERO;
|
|
|
|
|
BigDecimal rowHjNoOk = BigDecimal.ZERO;
|
|
|
|
|
for(int m=0;m<days.size();m++){
|
|
|
|
|
QcStaticTable sampMap = sampHzMaps.get(days.get(m));
|
|
|
|
|
if(sampMap!=null){
|
|
|
|
@ -1484,8 +1519,18 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
|
|
|
|
|
.divide(sampleqty,2,BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
dto6.put("monthNum"+m,nookrate+"%");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rowHjSample = rowHjSample.add(new BigDecimal(sampMap.getSampleQty()));
|
|
|
|
|
rowHjNoOk = rowHjNoOk.add(new BigDecimal(sampMap.getNoOkQty()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
dto4.put("rowSum",rowHjSample.toString());
|
|
|
|
|
dto5.put("rowSum",rowHjNoOk.toString());
|
|
|
|
|
BigDecimal hjnookrate = rowHjNoOk.multiply(new BigDecimal("100"))
|
|
|
|
|
.divide(rowHjSample,2,BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
dto6.put("rowSum",hjnookrate+"%");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dtos.add(dto4);
|
|
|
|
|
dtos.add(dto5);
|
|
|
|
|
dtos.add(dto6);
|
|
|
|
@ -1537,29 +1582,36 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
|
|
|
|
|
dto1 = new HashMap<>();
|
|
|
|
|
dto1.put("materialName",bpMaterial.getMaterialName());
|
|
|
|
|
dto1.put("dataType","抽检次数");
|
|
|
|
|
BigDecimal rowSum = BigDecimal.ZERO;
|
|
|
|
|
for(int m=0;m<days.size();m++){
|
|
|
|
|
|
|
|
|
|
QcStaticTable sampMap = sampMaps.get(bpMaterial.getMaterialCode()+days.get(m));
|
|
|
|
|
if(sampMap!=null){
|
|
|
|
|
dto1.put("monthNum"+m,sampMap.getSampleQty().replace(".00",""));
|
|
|
|
|
rowSum = rowSum.add(new BigDecimal(sampMap.getSampleQty()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
dto1.put("rowSum",rowSum.toString().replace(".00",""));
|
|
|
|
|
dtos.add(dto1);
|
|
|
|
|
|
|
|
|
|
dto2 = new HashMap<>();
|
|
|
|
|
dto2.put("materialName",bpMaterial.getMaterialName());
|
|
|
|
|
dto2.put("dataType","返工次数");
|
|
|
|
|
BigDecimal rowSum2 = BigDecimal.ZERO;
|
|
|
|
|
for(int m=0;m<days.size();m++){
|
|
|
|
|
QcStaticTable sampMap = sampMaps.get(bpMaterial.getMaterialCode()+days.get(m));
|
|
|
|
|
if(sampMap!=null){
|
|
|
|
|
dto2.put("monthNum"+m,sampMap.getNoOkQty().replace(".00",""));
|
|
|
|
|
rowSum2 = rowSum2.add(new BigDecimal(sampMap.getNoOkQty()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
dto2.put("rowSum",rowSum2.toString().replace(".00",""));
|
|
|
|
|
dtos.add(dto2);
|
|
|
|
|
|
|
|
|
|
dto3 = new HashMap<>();
|
|
|
|
|
dto3.put("materialName",bpMaterial.getMaterialName());
|
|
|
|
|
dto3.put("dataType","返工率%");
|
|
|
|
|
BigDecimal rowRadio = BigDecimal.ZERO;
|
|
|
|
|
for(int m=0;m<days.size();m++){
|
|
|
|
|
QcStaticTable sampMap = sampMaps.get(bpMaterial.getMaterialCode()+days.get(m));
|
|
|
|
|
if(sampMap!=null){
|
|
|
|
@ -1574,6 +1626,12 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(rowSum.compareTo(BigDecimal.ZERO)!=0){
|
|
|
|
|
rowRadio = rowSum2
|
|
|
|
|
.multiply(new BigDecimal("100"))
|
|
|
|
|
.divide(rowSum,2,BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
}
|
|
|
|
|
dto3.put("rowSum",rowRadio.toString()+"%");
|
|
|
|
|
dtos.add(dto3);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -1591,7 +1649,8 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
|
|
|
|
|
Map<String,String> dto6 = new HashMap<>();
|
|
|
|
|
dto6.put("materialName","总合计");
|
|
|
|
|
dto6.put("dataType","返工率%");
|
|
|
|
|
|
|
|
|
|
BigDecimal rowHjSample = BigDecimal.ZERO;
|
|
|
|
|
BigDecimal rowHjNoOk = BigDecimal.ZERO;
|
|
|
|
|
for(int m=0;m<days.size();m++){
|
|
|
|
|
QcStaticTable sampMap = sampHzMaps.get(days.get(m));
|
|
|
|
|
if(sampMap!=null){
|
|
|
|
@ -1606,8 +1665,17 @@ public class QcStaticTableServiceImpl implements IQcStaticTableService {
|
|
|
|
|
.divide(sampleqty,2,BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
dto6.put("monthNum"+m,nookrate+"%");
|
|
|
|
|
}
|
|
|
|
|
rowHjSample = rowHjSample.add(new BigDecimal(sampMap.getSampleQty()));
|
|
|
|
|
rowHjNoOk = rowHjNoOk.add(new BigDecimal(sampMap.getNoOkQty()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dto4.put("rowSum",rowHjSample.toString());
|
|
|
|
|
dto5.put("rowSum",rowHjNoOk.toString());
|
|
|
|
|
BigDecimal hjnookrate = rowHjNoOk.multiply(new BigDecimal("100"))
|
|
|
|
|
.divide(rowHjSample,2,BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
dto6.put("rowSum",hjnookrate+"%");
|
|
|
|
|
|
|
|
|
|
dtos.add(dto4);
|
|
|
|
|
dtos.add(dto5);
|
|
|
|
|
dtos.add(dto6);
|
|
|
|
|