Commit c54d2839 by lijingjing

新增行未带入公式问题修改;

parent 692e01ea
......@@ -974,4 +974,11 @@ public class EntrustController extends ServiceController {
}
return success(userInfoService.getUserOrgNames(getAccount()).stream().anyMatch(t -> t.contains("化验") && !t.contains("净化化验")));
}
@ApiOperation("确认生成复检委托")
@RequestMapping(value = "/confirm_recheck", method = {RequestMethod.POST, RequestMethod.GET})
public RestResult<Boolean> confirmRecheck(@RequestBody EntrustDTO entrustDTO) {
return success(entrustService.confirmRecheck(entrustDTO,getAccount()));
}
}
......@@ -10,9 +10,7 @@ import org.apache.poi.ss.usermodel.FormulaEvaluator;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
public class SingleSheetMoreItemOperation implements Operation {
......@@ -79,6 +77,8 @@ public class SingleSheetMoreItemOperation implements Operation {
int sampleMergerNum = template.getSampleMergerNum();
int templateSampleNum = template.getTemplateSampleNum();
int insertRow = beginRow + sampleMergerNum * templateSampleNum;
int newRowIndex = insertRow;
XSSFRow hideRow = sheetOne.getRow(beginRow - 1);
XSSFRow zeroRow = sheetOne.getRow(beginRow);
int lastCellNum = zeroRow.getLastCellNum();
......@@ -92,6 +92,12 @@ public class SingleSheetMoreItemOperation implements Operation {
XSSFCellStyle cellStyle = zeroRow.getCell(j).getCellStyle();
XSSFCell xssfCell = row.createCell(j);
xssfCell.setCellStyle(cellStyle);
// 根据标题行处理公式
// 若标题(Si%等等)为空,那么不进行处理,如若不为空,再根据是否存在公式进行处理
String title = hideRow.getCell(j).getStringCellValue();
if (StringUtils.isNotBlank(title)) {
xssfCell.setCellFormula(getCellFormula(title.trim(), newRowIndex + m));
}
}
insertRow++;
......@@ -233,4 +239,15 @@ public class SingleSheetMoreItemOperation implements Operation {
}
}
}
private String getCellFormula(String key, int rowIndex) {
Optional<OriginalTemplateConfig> optional = this.configList.stream().filter(t -> Objects.equals(key, t.getAttributeName())).findAny();
if (optional.isPresent()) {
String formula = optional.get().getFormula();
if (StringUtils.isNotBlank(formula)) {
return OriginalUtil.initFormula(formula, rowIndex);
}
}
return null;
}
}
\ No newline at end of file
......@@ -117,4 +117,6 @@ public interface IEntrustService extends IBaseService<Entrust> {
boolean saveOrUpdateToSubmit(EntrustDTO entrustDTO, Account account);
Page<EntrustVO> getPageReportProduct(Page<EntrustVO> page, EntrustVO entrust);
Boolean confirmRecheck(EntrustDTO entrustDTO, Account account);
}
......@@ -417,6 +417,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
sampleItem.setEntrustSampleId(sample.getId());
sampleItem.setEntrustId(entrust.getId());
saveEntrustSampleItemList.add(sampleItem);
}
}
......@@ -1606,4 +1607,9 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
return page.setRecords(baseMapper.selectVOList(page, entrust));
}
@Override
public Boolean confirmRecheck(EntrustDTO entrustDTO, Account account) {
return null;
}
}
/** created by meazty on 2022/1/10 13:45 **/
/** created by meazty on 2022/1/10 13:45 **/
-- 合同检测项目 --
ALTER TABLE "public"."contract_sample_item"
ADD COLUMN "recheck_id" int8;
COMMENT ON COLUMN "public"."contract_sample_item"."recheck_id" IS '复检检测项目ID';
-- 委托样品 --
ALTER TABLE "public"."entrust_sample"
ADD COLUMN "recheck_code" varchar(64) COLLATE "pg_catalog"."default";
COMMENT ON COLUMN "public"."entrust_sample"."recheck_code" IS '复检样品编号';
ALTER TABLE "public"."entrust_sample_item"
ADD COLUMN "recheck_id" int8,
ADD COLUMN "entrust_id" int8;
COMMENT ON COLUMN "public"."entrust_sample_item"."recheck_id" IS '复检检测项目ID';
COMMENT ON COLUMN "public"."entrust_sample_item"."entrust_id" IS '委托ID';
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