|
|
|
@ -227,4 +227,172 @@ public class MesInspectionReportServiceImpl implements IMesInspectionReportServi
|
|
|
|
|
return listDTO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
public List selectPointInspectionList(MesInspectionReport mesInspectionReport) {
|
|
|
|
|
//1.报表名
|
|
|
|
|
mesInspectionReport.setReportName("CheckReport");
|
|
|
|
|
List<MesInspectionReport> list = mesInspectionReportMapper.selectSelfMutualInspectionList(mesInspectionReport);
|
|
|
|
|
String param = "finished_production_check";
|
|
|
|
|
//查询点检项目 点检内容
|
|
|
|
|
List<MesInspectionReport> projectList = mesInspectionReportMapper.selectPointInspectionProjectList(param);
|
|
|
|
|
|
|
|
|
|
List<String> teamArray = mesInspectionReportMapper.selectTeamArray(mesInspectionReport);
|
|
|
|
|
List<Object> listDTO = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
for(MesInspectionReport project : projectList){
|
|
|
|
|
Map<String,String> dynamicRow = new LinkedHashMap<>();
|
|
|
|
|
dynamicRow.put("序号",project.getTableLine() + "");
|
|
|
|
|
dynamicRow.put("点检项目",project.getProjectName());
|
|
|
|
|
dynamicRow.put("点检内容",project.getInfoName());
|
|
|
|
|
if(CollectionUtils.isEmpty(teamArray)){
|
|
|
|
|
dynamicRow.put("", "");
|
|
|
|
|
dynamicRow.put(" ", "");
|
|
|
|
|
dynamicRow.put(" ", "");
|
|
|
|
|
dynamicRow.put(" ", "");
|
|
|
|
|
dynamicRow.put(" ", "");
|
|
|
|
|
dynamicRow.put(" ", "");
|
|
|
|
|
}else{
|
|
|
|
|
for(String team : teamArray){
|
|
|
|
|
List<MesInspectionReport> result = list.stream()
|
|
|
|
|
.filter(MesInspectionReport -> MesInspectionReport.getRemark().equals(team)) // 条件1:符合班组
|
|
|
|
|
.filter(MesInspectionReport-> MesInspectionReport.getInfoName().equals(project.getInfoName())) // 条件2:符合当前项目内容
|
|
|
|
|
.collect(Collectors.toList()); // 收集结果
|
|
|
|
|
if(!CollectionUtils.isEmpty(result)){
|
|
|
|
|
if(StringUtils.isNotBlank(result.get(0).getCheckResult())){
|
|
|
|
|
dynamicRow.put(team, result.get(0).getCheckResult());
|
|
|
|
|
}else{
|
|
|
|
|
dynamicRow.put(team, "");
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
dynamicRow.put(team, "");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(teamArray.size() < 6){
|
|
|
|
|
for(int i = 0 ; i < 6-(teamArray.size()) ; i++){
|
|
|
|
|
if(i == 0){
|
|
|
|
|
dynamicRow.put("", "");
|
|
|
|
|
}else if(i == 1){
|
|
|
|
|
dynamicRow.put(" ", "");
|
|
|
|
|
}else if(i == 2){
|
|
|
|
|
dynamicRow.put(" ", "");
|
|
|
|
|
}else if(i == 3){
|
|
|
|
|
dynamicRow.put(" ", "");
|
|
|
|
|
}else if(i == 4){
|
|
|
|
|
dynamicRow.put(" ", "");
|
|
|
|
|
}else if(i == 5){
|
|
|
|
|
dynamicRow.put(" ", "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String s = JSON.toJSONString(dynamicRow);
|
|
|
|
|
JSONObject object = JSONObject.parseObject(s, Feature.OrderedField);
|
|
|
|
|
log.info("点检动态添加属性: = {}",object);
|
|
|
|
|
listDTO.add(object);
|
|
|
|
|
}
|
|
|
|
|
log.info("点检动态添加属性: = {}", JSON.toJSONString(listDTO));
|
|
|
|
|
return listDTO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//点检上半部分数据
|
|
|
|
|
@Override
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
public List selectCheckBoxList(MesInspectionReport mesInspectionReport) {
|
|
|
|
|
List<Object> listDTO = new ArrayList<>();
|
|
|
|
|
//1.报表名
|
|
|
|
|
mesInspectionReport.setReportName("CheckReport");
|
|
|
|
|
List<MesInspectionReport> lists = mesInspectionReportMapper.selectCheckBoxList(mesInspectionReport);
|
|
|
|
|
|
|
|
|
|
Map<String,Map<String,Boolean>> dynamicRow1 = new LinkedHashMap<>();
|
|
|
|
|
Map<String,String> dynamicRow2 = new LinkedHashMap<>();
|
|
|
|
|
String str = "str";
|
|
|
|
|
int i = 0;
|
|
|
|
|
for(MesInspectionReport list :lists){
|
|
|
|
|
Map<String,Boolean> dynamicRow10 = new LinkedHashMap<>();
|
|
|
|
|
if(list.getBz().equals("1")){
|
|
|
|
|
dynamicRow10.put("openLine",Boolean.TRUE);
|
|
|
|
|
dynamicRow10.put("clearLine",Boolean.FALSE);
|
|
|
|
|
dynamicRow1.put(str + i + "",dynamicRow10);
|
|
|
|
|
}else{
|
|
|
|
|
dynamicRow10.put("clearLine",Boolean.TRUE);
|
|
|
|
|
dynamicRow10.put("openLine",Boolean.FALSE);
|
|
|
|
|
dynamicRow1.put(str + i + "",dynamicRow10);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dynamicRow2.put(str + i + "","班组:" + list.getRemark());
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
if(lists == null){
|
|
|
|
|
Map<String,Boolean> dynamicRow10 = new LinkedHashMap<>();
|
|
|
|
|
dynamicRow10.put("openLine",Boolean.FALSE);
|
|
|
|
|
dynamicRow10.put("clearLine",Boolean.FALSE);
|
|
|
|
|
dynamicRow1.put(str + 0 + "", dynamicRow10);
|
|
|
|
|
dynamicRow1.put(str + 1 + "", dynamicRow10);
|
|
|
|
|
dynamicRow1.put(str + 2 + "", dynamicRow10);
|
|
|
|
|
dynamicRow1.put(str + 3 + "", dynamicRow10);
|
|
|
|
|
dynamicRow1.put(str + 4 + "", dynamicRow10);
|
|
|
|
|
dynamicRow1.put(str + 5 + "", dynamicRow10);
|
|
|
|
|
|
|
|
|
|
dynamicRow2.put(str + 0 + "", "班组:");
|
|
|
|
|
dynamicRow2.put(str + 1 + "", "班组:");
|
|
|
|
|
dynamicRow2.put(str + 2 + "", "班组:");
|
|
|
|
|
dynamicRow2.put(str + 3 + "", "班组:");
|
|
|
|
|
dynamicRow2.put(str + 4 + "", "班组:");
|
|
|
|
|
dynamicRow2.put(str + 5 + "", "班组:");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(dynamicRow1.size() < 6){
|
|
|
|
|
for(int j = 0 ; j < 6-(lists.size()) ; j++){
|
|
|
|
|
Map<String,Boolean> dynamicRow10 = new LinkedHashMap<>();
|
|
|
|
|
dynamicRow10.put("openLine",Boolean.FALSE);
|
|
|
|
|
dynamicRow10.put("clearLine",Boolean.FALSE);
|
|
|
|
|
if(j == 0){
|
|
|
|
|
dynamicRow1.put(str + 5 +"", dynamicRow10);
|
|
|
|
|
}else if(j == 1){
|
|
|
|
|
dynamicRow1.put(str + 4 +"", dynamicRow10);
|
|
|
|
|
}else if(j == 2){
|
|
|
|
|
dynamicRow1.put(str + 3 +"", dynamicRow10);
|
|
|
|
|
}else if(j == 3){
|
|
|
|
|
dynamicRow1.put(str + 2 +"", dynamicRow10);
|
|
|
|
|
}else if(j == 4){
|
|
|
|
|
dynamicRow1.put(str + 1 +"", dynamicRow10);
|
|
|
|
|
}else if(j == 5){
|
|
|
|
|
dynamicRow1.put(str + 0 +"", dynamicRow10);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(dynamicRow2.size() < 6){
|
|
|
|
|
for(int j = 0 ; j < 6-(lists.size()) ; j++){
|
|
|
|
|
if(j == 0){
|
|
|
|
|
dynamicRow2.put(str + 5 +"", "班组:");
|
|
|
|
|
}else if(j == 1){
|
|
|
|
|
dynamicRow2.put(str + 4 +"", "班组:");
|
|
|
|
|
}else if(j == 2){
|
|
|
|
|
dynamicRow2.put(str + 3 +"", "班组:");
|
|
|
|
|
}else if(j == 3){
|
|
|
|
|
dynamicRow2.put(str + 2 +"", "班组:");
|
|
|
|
|
}else if(j == 4){
|
|
|
|
|
dynamicRow2.put(str + 1 +"", "班组:");
|
|
|
|
|
}else if(j == 5){
|
|
|
|
|
dynamicRow2.put(str + 0 +"", "班组:");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String s1 = JSON.toJSONString(dynamicRow1);
|
|
|
|
|
String s2 = JSON.toJSONString(dynamicRow2);
|
|
|
|
|
JSONObject object1 = JSONObject.parseObject(s1, Feature.OrderedField);
|
|
|
|
|
JSONObject object2 = JSONObject.parseObject(s2, Feature.OrderedField);
|
|
|
|
|
log.info("点检动态添加属性: = {}",object1);
|
|
|
|
|
log.info("点检动态添加属性: = {}",object2);
|
|
|
|
|
listDTO.add(object1);
|
|
|
|
|
listDTO.add(object2);
|
|
|
|
|
log.info("点检动态添加属性: = {}", JSON.toJSONString(listDTO));
|
|
|
|
|
return listDTO;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|