Commit 2ad7a194 by lijingjing

修改批样样品编码被修改问题;

修改导出没有显示牌号问题;
修改部分报告没有判级问题;
parent 2d32de78
...@@ -523,7 +523,8 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe ...@@ -523,7 +523,8 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
EntrustSample sample = new EntrustSample(); EntrustSample sample = new EntrustSample();
BeanUtils.copyProperties(sampleModel, sample); BeanUtils.copyProperties(sampleModel, sample);
sample.setCode(sampleCode).setOrderBy(99).setCtime(new Date()).setLtime(new Date()).setUid(account.getUserId()) sample.setCode(sampleCode).setOrderBy(99).setCtime(new Date()).setLtime(new Date()).setUid(account.getUserId())
.setLid(account.getUserId()).setType(2).setId(IdWorker.getId()); .setStatus(EntrustSampleStatusEnum.REPORT_SEND).setProgress(EntrustSampleStatusEnum.REPORT_SEND)
.setFirstCode(sampleCode).setLid(null).setLtime(null).setType(2).setId(IdWorker.getId());
sampleList.add(sample); sampleList.add(sample);
EntrustSampleVO sampleVO = new EntrustSampleVO(); EntrustSampleVO sampleVO = new EntrustSampleVO();
...@@ -862,6 +863,9 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe ...@@ -862,6 +863,9 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
// 若从签收或批准往前驳回,则删除的PDF文件 // 若从签收或批准往前驳回,则删除的PDF文件
if (fromFlowStatus == EntrustFlowEnum.REPORT_ISSUE || fromFlowStatus == EntrustFlowEnum.REPORT_SEND || fromFlowStatus == EntrustFlowEnum.QUALITY_INSPECT) { if (fromFlowStatus == EntrustFlowEnum.REPORT_ISSUE || fromFlowStatus == EntrustFlowEnum.REPORT_SEND || fromFlowStatus == EntrustFlowEnum.QUALITY_INSPECT) {
// 删除生成的批样记录
entrustSampleService.remove(Condition.create().eq("entrust_id",entrust.getId()).eq("type",2));
// 文件删除
executor1.execute(() -> deleteReportPdf(ids)); executor1.execute(() -> deleteReportPdf(ids));
} }
......
...@@ -1223,7 +1223,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI ...@@ -1223,7 +1223,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
// 默认开始行为:5,单元格序号为:-1 // 默认开始行为:5,单元格序号为:-1
int startRow = 5, sampleCodePos = -1, sampleBrandPos = -1; int startRow = 5, sampleCodePos = -1, sampleBrandPos = -1;
flag: flag:
for (int i = 5; i < rowNum; i++) { for (int i = 1; i < rowNum; i++) {
startRow = i; startRow = i;
XSSFRow xssfRow = sheet.getRow(i); XSSFRow xssfRow = sheet.getRow(i);
for (int j = 0; j < xssfRow.getLastCellNum(); j++) { for (int j = 0; j < xssfRow.getLastCellNum(); j++) {
......
...@@ -455,20 +455,23 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe ...@@ -455,20 +455,23 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
// 若为质量判定,判断需要判级 // 若为质量判定,判断需要判级
boolean isRequireJudgeGrading = isRequireJudgeGrading(entrust.getId()); boolean isRequireJudgeGrading = isRequireJudgeGrading(entrust.getId());
for (EntrustSample sample : sampleList) { for (EntrustSample sample : sampleList) {
String firstCode = sample.getFirstCode(), // 排除批样样品编号
secondCode = sample.getSecondCode(), if (2 != sample.getType()) {
thirdCode = sample.getThirdCode(); String firstCode = sample.getFirstCode(),
String sampleCode = firstCode; secondCode = sample.getSecondCode(),
if (2 == whichLevel) { thirdCode = sample.getThirdCode();
sampleCode = StringUtils.isNotBlank(secondCode) ? secondCode : firstCode; String sampleCode = firstCode;
} else if (3 == whichLevel) { if (2 == whichLevel) {
sampleCode = StringUtils.isNotBlank(thirdCode) ? thirdCode : (StringUtils.isNotBlank(secondCode) ? secondCode : firstCode); sampleCode = StringUtils.isNotBlank(secondCode) ? secondCode : firstCode;
} } else if (3 == whichLevel) {
sample.setCode(sampleCode); sampleCode = StringUtils.isNotBlank(thirdCode) ? thirdCode : (StringUtils.isNotBlank(secondCode) ? secondCode : firstCode);
sample.setStatus(sampleStatus).setProgress(sampleStatus); }
// 不需要判级,直接跳入电子档案或者下一节点为质量判定 sample.setCode(sampleCode);
if ((!isRequireJudgeGrading && nextFlowStatus == EntrustFlowEnum.QUALITY_JUDGE) || nextFlowStatus == EntrustFlowEnum.ARCHIVES) { sample.setStatus(sampleStatus).setProgress(sampleStatus);
sample.setJudgeProgress(2).setJudgeStatus(2); // 不需要判级,直接跳入电子档案或者下一节点为质量判定
if ((!isRequireJudgeGrading && nextFlowStatus == EntrustFlowEnum.QUALITY_JUDGE) || nextFlowStatus == EntrustFlowEnum.ARCHIVES) {
sample.setJudgeProgress(2).setJudgeStatus(2);
}
} }
} }
// update(updateSample, Condition.create().eq("entrust_id", entrust.getId())); // update(updateSample, Condition.create().eq("entrust_id", entrust.getId()));
...@@ -1766,7 +1769,7 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe ...@@ -1766,7 +1769,7 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
} else if (2 == level) { } else if (2 == level) {
fromFiled = " COALESCE(second_code,first_code) "; fromFiled = " COALESCE(second_code,first_code) ";
} }
return baseMapper.updateForSet(String.format("code=%s", fromFiled), new EntityWrapper<EntrustSample>().eq("entrust_id", entrustId)) > 0; return baseMapper.updateForSet(String.format("code=%s", fromFiled), new EntityWrapper<EntrustSample>().eq("entrust_id", entrustId).eq("type", 0)) > 0;
} }
@Override @Override
...@@ -1952,6 +1955,25 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe ...@@ -1952,6 +1955,25 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
return page.setRecords(baseMapper.selectSampleIndex(page, sampleIndexVO)); return page.setRecords(baseMapper.selectSampleIndex(page, sampleIndexVO));
} }
private String getCellValue(XSSFRow xssfRow, int cellIndex) {
XSSFCell cell = xssfRow.getCell(cellIndex);
String value = HSSFWorkbookUtil.getJavaValue(cell).toString();
return org.apache.commons.lang3.StringUtils.isBlank(value) ? "" : value.trim();
}
private int getCellIndex(XSSFSheet sheet, String cellName) {
for (int i = 0; i < sheet.getLastRowNum(); i++) {
XSSFRow row = sheet.getRow(i);
for (int j = 0; j < row.getLastCellNum(); j++) {
if (getCellValue(row, j).equals(cellName)) {
return j;
}
}
}
return -1;
}
@Override @Override
public void exportSampleIndex(Long entrustId, Account account, HttpServletResponse response) { public void exportSampleIndex(Long entrustId, Account account, HttpServletResponse response) {
RestAssert.fail(null == entrustId, "请选择要导出的委托"); RestAssert.fail(null == entrustId, "请选择要导出的委托");
...@@ -1997,6 +2019,8 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe ...@@ -1997,6 +2019,8 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
int sampleMergerNum = template.getSampleMergerNum(); int sampleMergerNum = template.getSampleMergerNum();
int templateSampleNum = template.getTemplateSampleNum(); int templateSampleNum = template.getTemplateSampleNum();
// 特殊处理牌号问题
int brandIndex = getCellIndex(sheetOne, "牌号");
if (templateSampleNum >= sampleVOList.size()) { if (templateSampleNum >= sampleVOList.size()) {
Integer beginRow = template.getSampleBeginRow(); Integer beginRow = template.getSampleBeginRow();
...@@ -2020,6 +2044,9 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe ...@@ -2020,6 +2044,9 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
String value = StringHandleUtils.getFieldValue(config.getDataAttribute(), vo); String value = StringHandleUtils.getFieldValue(config.getDataAttribute(), vo);
cell.setCellValue(value); cell.setCellValue(value);
} }
if (brandIndex > -1) {
xssfRow.getCell(brandIndex).setCellValue(vo.getSampleGrading());
}
beginRow += sampleMergerNum; beginRow += sampleMergerNum;
} }
...@@ -2051,6 +2078,9 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe ...@@ -2051,6 +2078,9 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
String value = StringHandleUtils.getFieldValue(config.getDataAttribute(), vo); String value = StringHandleUtils.getFieldValue(config.getDataAttribute(), vo);
cell.setCellValue(value); cell.setCellValue(value);
} }
if (brandIndex > -1) {
xssfRow.getCell(brandIndex).setCellValue(vo.getSampleGrading());
}
beginRow += sampleMergerNum; beginRow += sampleMergerNum;
} }
} }
...@@ -2091,6 +2121,9 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe ...@@ -2091,6 +2121,9 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
cell.setCellValue(StringHandleUtils.getFieldValue(config.getDataAttribute(), vo)); cell.setCellValue(StringHandleUtils.getFieldValue(config.getDataAttribute(), vo));
} }
} }
if (brandIndex > -1) {
xssfRow.getCell(brandIndex).setCellValue(vo.getSampleGrading());
}
beginRow += sampleMergerNum; beginRow += sampleMergerNum;
sn++; sn++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment