diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java index 64539557..10d6144d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java @@ -64,6 +64,7 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService private final String rowTypeLimit = "limit"; //行类型-检出限 private final String rangeKey = "minLimitValue"; private final String emptyText = "以下为空白"; + private final String emptyTextLastRow = "此行为空白"; /* @@ -152,10 +153,13 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService return CommonResult.success(pageRowList); } } - //以下为空白 + //以下为空白/本行为空白 + String lastRowText = emptyText; + if(rowList.size() + 1 == maxRowCount) + lastRowText = emptyTextLastRow; if(rowList.size() < maxRowCount && !rowList.isEmpty()){ JSONObject t = new JSONObject(); - t.put(colPrefix + "01", emptyText); + t.put(colPrefix + "01", lastRowText); putEmptyData(t, 2,10); rowList.add(t.clone()); } @@ -195,11 +199,14 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService String maxRowCountStr = configJson.getString("maxRowCount"); //最大行数 if(!ObjectUtils.isEmpty(maxRowCountStr)) maxRowCount = Integer.parseInt(maxRowCountStr); int rowLength = rowList.size(); + String lastRowText = emptyText; + if(rowList.size() + 1 == maxRowCount) + lastRowText = emptyTextLastRow; if(rowLength <= maxRowCount){ //以下为空白 if(rowList.size() < maxRowCount){ JSONObject t = new JSONObject(); - t.put(colPrefix + "01", emptyText); + t.put(colPrefix + "01", lastRowText); putEmptyData(t, 2,10); rowList.add(t.clone()); } @@ -257,9 +264,12 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService //在最后一页插入“以下为空” JSONArray pageRow = pageRowList.getJSONArray(pageRowList.size() - 1); + lastRowText = emptyText; + if(pageRow.size() + 1 == maxRowCount) + lastRowText = emptyTextLastRow; if(pageRow.size() < maxRowCount){ JSONObject t = new JSONObject(); - t.put(colPrefix + "01", emptyText); + t.put(colPrefix + "01", lastRowText); putEmptyData(t, 2,10); pageRow.add(t.clone()); } @@ -764,11 +774,14 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService } rowList.add(t); } + String lastRowText = emptyText; + if(rowList.size() + 1 == maxRowCount) + lastRowText = emptyTextLastRow; if(rowList.size() < maxRowCount){ JSONObject t = new JSONObject(); - t.put("sampleNameCode", emptyText); - t.put("sampleName", emptyText); - t.put("sampleCode", emptyText); + t.put("sampleNameCode", lastRowText); + t.put("sampleName", lastRowText); + t.put("sampleCode", lastRowText); rowList.add( t); } while(rowList.size() < maxRowCount){ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainServiceImpl.java index a03fd0c6..80e66c40 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentMainServiceImpl.java @@ -217,10 +217,12 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService, //委托单号 String entrustCode = ""; + String entrustId = ""; if(!ObjectUtils.isEmpty(entrustList)){ for(BusinessSampleEntrustRegistrationDO entrust : entrustList){ entrustCode += entrust.getEntrustNumber() + ","; + entrustId += entrust.getId() + ","; String externalInfomation = entrust.getExternalInfomation(); if(!ObjectUtils.isEmpty(externalInfomation)){ JSONObject externalInfomationJson = JSONObject.parseObject(externalInfomation); @@ -233,7 +235,10 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService, } if(!ObjectUtils.isEmpty(entrustCode)) entrustCode = entrustCode.substring(0, entrustCode.length() - 1); + if(!ObjectUtils.isEmpty(entrustId)) + entrustId = entrustId.substring(0, entrustId.length() - 1); formDataJson.put("entrustCode", entrustCode); + formDataJson.put("entrustId", entrustId); reportDocumentMainDO.setFormData(formDataJson.toJSONString()); reportDocumentMainMapper.updateById(reportDocumentMainDO); @@ -308,19 +313,6 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService, validateReportDocumentMainExists(id); // 更新 ReportDocumentMainDO updateObj = BeanUtils.toBean(updateReqVO, ReportDocumentMainDO.class); - - //处理委托id - String formDataStr = updateReqVO.getFormData(); - if(!ObjectUtils.isEmpty(formDataStr)){ - JSONObject formData = JSONObject.parseObject(formDataStr); - List correlationList = reportDocumentMainCorrelationService.listByMainId(id, ReportDocumentMainCorrelationService.CorrelationType_entrust); - if(!correlationList.isEmpty()){ - Long entrustId = correlationList.get(0).getCorrelationId(); - if(entrustId != null) - formData.put("entrustId", entrustId.toString()); - } - updateObj.setFormData(formData.toJSONString()); - } reportDocumentMainMapper.updateById(updateObj); List reportDocumentDataList = updateReqVO.getReportDocumentDataList(); if(!reportDocumentDataList.isEmpty())