fix:报告formData增加委托id;报告页最后一个空行显示为“次行为空白”
This commit is contained in:
@@ -64,6 +64,7 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
|||||||
private final String rowTypeLimit = "limit"; //行类型-检出限
|
private final String rowTypeLimit = "limit"; //行类型-检出限
|
||||||
private final String rangeKey = "minLimitValue";
|
private final String rangeKey = "minLimitValue";
|
||||||
private final String emptyText = "以下为空白";
|
private final String emptyText = "以下为空白";
|
||||||
|
private final String emptyTextLastRow = "此行为空白";
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -152,10 +153,13 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
|||||||
return CommonResult.success(pageRowList);
|
return CommonResult.success(pageRowList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//以下为空白
|
//以下为空白/本行为空白
|
||||||
|
String lastRowText = emptyText;
|
||||||
|
if(rowList.size() + 1 == maxRowCount)
|
||||||
|
lastRowText = emptyTextLastRow;
|
||||||
if(rowList.size() < maxRowCount && !rowList.isEmpty()){
|
if(rowList.size() < maxRowCount && !rowList.isEmpty()){
|
||||||
JSONObject t = new JSONObject();
|
JSONObject t = new JSONObject();
|
||||||
t.put(colPrefix + "01", emptyText);
|
t.put(colPrefix + "01", lastRowText);
|
||||||
putEmptyData(t, 2,10);
|
putEmptyData(t, 2,10);
|
||||||
rowList.add(t.clone());
|
rowList.add(t.clone());
|
||||||
}
|
}
|
||||||
@@ -195,11 +199,14 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
|||||||
String maxRowCountStr = configJson.getString("maxRowCount"); //最大行数
|
String maxRowCountStr = configJson.getString("maxRowCount"); //最大行数
|
||||||
if(!ObjectUtils.isEmpty(maxRowCountStr)) maxRowCount = Integer.parseInt(maxRowCountStr);
|
if(!ObjectUtils.isEmpty(maxRowCountStr)) maxRowCount = Integer.parseInt(maxRowCountStr);
|
||||||
int rowLength = rowList.size();
|
int rowLength = rowList.size();
|
||||||
|
String lastRowText = emptyText;
|
||||||
|
if(rowList.size() + 1 == maxRowCount)
|
||||||
|
lastRowText = emptyTextLastRow;
|
||||||
if(rowLength <= maxRowCount){
|
if(rowLength <= maxRowCount){
|
||||||
//以下为空白
|
//以下为空白
|
||||||
if(rowList.size() < maxRowCount){
|
if(rowList.size() < maxRowCount){
|
||||||
JSONObject t = new JSONObject();
|
JSONObject t = new JSONObject();
|
||||||
t.put(colPrefix + "01", emptyText);
|
t.put(colPrefix + "01", lastRowText);
|
||||||
putEmptyData(t, 2,10);
|
putEmptyData(t, 2,10);
|
||||||
rowList.add(t.clone());
|
rowList.add(t.clone());
|
||||||
}
|
}
|
||||||
@@ -257,9 +264,12 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
|||||||
|
|
||||||
//在最后一页插入“以下为空”
|
//在最后一页插入“以下为空”
|
||||||
JSONArray pageRow = pageRowList.getJSONArray(pageRowList.size() - 1);
|
JSONArray pageRow = pageRowList.getJSONArray(pageRowList.size() - 1);
|
||||||
|
lastRowText = emptyText;
|
||||||
|
if(pageRow.size() + 1 == maxRowCount)
|
||||||
|
lastRowText = emptyTextLastRow;
|
||||||
if(pageRow.size() < maxRowCount){
|
if(pageRow.size() < maxRowCount){
|
||||||
JSONObject t = new JSONObject();
|
JSONObject t = new JSONObject();
|
||||||
t.put(colPrefix + "01", emptyText);
|
t.put(colPrefix + "01", lastRowText);
|
||||||
putEmptyData(t, 2,10);
|
putEmptyData(t, 2,10);
|
||||||
pageRow.add(t.clone());
|
pageRow.add(t.clone());
|
||||||
}
|
}
|
||||||
@@ -764,11 +774,14 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
|||||||
}
|
}
|
||||||
rowList.add(t);
|
rowList.add(t);
|
||||||
}
|
}
|
||||||
|
String lastRowText = emptyText;
|
||||||
|
if(rowList.size() + 1 == maxRowCount)
|
||||||
|
lastRowText = emptyTextLastRow;
|
||||||
if(rowList.size() < maxRowCount){
|
if(rowList.size() < maxRowCount){
|
||||||
JSONObject t = new JSONObject();
|
JSONObject t = new JSONObject();
|
||||||
t.put("sampleNameCode", emptyText);
|
t.put("sampleNameCode", lastRowText);
|
||||||
t.put("sampleName", emptyText);
|
t.put("sampleName", lastRowText);
|
||||||
t.put("sampleCode", emptyText);
|
t.put("sampleCode", lastRowText);
|
||||||
rowList.add( t);
|
rowList.add( t);
|
||||||
}
|
}
|
||||||
while(rowList.size() < maxRowCount){
|
while(rowList.size() < maxRowCount){
|
||||||
|
|||||||
@@ -217,10 +217,12 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService,
|
|||||||
|
|
||||||
//委托单号
|
//委托单号
|
||||||
String entrustCode = "";
|
String entrustCode = "";
|
||||||
|
String entrustId = "";
|
||||||
|
|
||||||
if(!ObjectUtils.isEmpty(entrustList)){
|
if(!ObjectUtils.isEmpty(entrustList)){
|
||||||
for(BusinessSampleEntrustRegistrationDO entrust : entrustList){
|
for(BusinessSampleEntrustRegistrationDO entrust : entrustList){
|
||||||
entrustCode += entrust.getEntrustNumber() + ",";
|
entrustCode += entrust.getEntrustNumber() + ",";
|
||||||
|
entrustId += entrust.getId() + ",";
|
||||||
String externalInfomation = entrust.getExternalInfomation();
|
String externalInfomation = entrust.getExternalInfomation();
|
||||||
if(!ObjectUtils.isEmpty(externalInfomation)){
|
if(!ObjectUtils.isEmpty(externalInfomation)){
|
||||||
JSONObject externalInfomationJson = JSONObject.parseObject(externalInfomation);
|
JSONObject externalInfomationJson = JSONObject.parseObject(externalInfomation);
|
||||||
@@ -233,7 +235,10 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService,
|
|||||||
}
|
}
|
||||||
if(!ObjectUtils.isEmpty(entrustCode))
|
if(!ObjectUtils.isEmpty(entrustCode))
|
||||||
entrustCode = entrustCode.substring(0, entrustCode.length() - 1);
|
entrustCode = entrustCode.substring(0, entrustCode.length() - 1);
|
||||||
|
if(!ObjectUtils.isEmpty(entrustId))
|
||||||
|
entrustId = entrustId.substring(0, entrustId.length() - 1);
|
||||||
formDataJson.put("entrustCode", entrustCode);
|
formDataJson.put("entrustCode", entrustCode);
|
||||||
|
formDataJson.put("entrustId", entrustId);
|
||||||
|
|
||||||
reportDocumentMainDO.setFormData(formDataJson.toJSONString());
|
reportDocumentMainDO.setFormData(formDataJson.toJSONString());
|
||||||
reportDocumentMainMapper.updateById(reportDocumentMainDO);
|
reportDocumentMainMapper.updateById(reportDocumentMainDO);
|
||||||
@@ -308,19 +313,6 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService,
|
|||||||
validateReportDocumentMainExists(id);
|
validateReportDocumentMainExists(id);
|
||||||
// 更新
|
// 更新
|
||||||
ReportDocumentMainDO updateObj = BeanUtils.toBean(updateReqVO, ReportDocumentMainDO.class);
|
ReportDocumentMainDO updateObj = BeanUtils.toBean(updateReqVO, ReportDocumentMainDO.class);
|
||||||
|
|
||||||
//处理委托id
|
|
||||||
String formDataStr = updateReqVO.getFormData();
|
|
||||||
if(!ObjectUtils.isEmpty(formDataStr)){
|
|
||||||
JSONObject formData = JSONObject.parseObject(formDataStr);
|
|
||||||
List<ReportDocumentMainCorrelationDO> 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);
|
reportDocumentMainMapper.updateById(updateObj);
|
||||||
List<ReportDocumentDataSaveReqVO> reportDocumentDataList = updateReqVO.getReportDocumentDataList();
|
List<ReportDocumentDataSaveReqVO> reportDocumentDataList = updateReqVO.getReportDocumentDataList();
|
||||||
if(!reportDocumentDataList.isEmpty())
|
if(!reportDocumentDataList.isEmpty())
|
||||||
|
|||||||
Reference in New Issue
Block a user