Commit 9e1827ab authored by chase's avatar chase

merge档案管理

parent 48adb09f
...@@ -117,7 +117,7 @@ public class POIUtil { ...@@ -117,7 +117,7 @@ public class POIUtil {
return row; return row;
} }
public static Row createAndCloneRow(Workbook wb ,Sheet sheet, Integer destRowIndex,Row fromRow) { public static Row createAndCloneRow(Workbook wb , Sheet sheet, Integer destRowIndex, Row fromRow) {
Row toRow = null; Row toRow = null;
if (sheet.getRow(destRowIndex) != null) { if (sheet.getRow(destRowIndex) != null) {
int lastRowNo = sheet.getLastRowNum(); int lastRowNo = sheet.getLastRowNum();
...@@ -136,10 +136,6 @@ public class POIUtil { ...@@ -136,10 +136,6 @@ public class POIUtil {
boolean copyValueFlag) { boolean copyValueFlag) {
CellStyle newstyle=wb.createCellStyle(); CellStyle newstyle=wb.createCellStyle();
copyCellStyle(wb,srcCell.getCellStyle(), newstyle); copyCellStyle(wb,srcCell.getCellStyle(), newstyle);
if(srcCell.getColumnIndex()==7){
newstyle.setLocked(false);
}
// distCell.setEncoding(srcCell.getEncoding()); // distCell.setEncoding(srcCell.getEncoding());
//样式 //样式
distCell.setCellStyle(newstyle); distCell.setCellStyle(newstyle);
......
...@@ -190,15 +190,15 @@ public class TaxDocumentServiceImpl { ...@@ -190,15 +190,15 @@ public class TaxDocumentServiceImpl {
taxDocument.setCreatorId(authUserHelper.getCurrentUserId()); taxDocument.setCreatorId(authUserHelper.getCurrentUserId());
taxDocument.setUploadTime(new Date()); taxDocument.setUploadTime(new Date());
taxDocument.setYearRedundancy(Calendar.getInstance().get(Calendar.YEAR)); taxDocument.setYearRedundancy(Calendar.getInstance().get(Calendar.YEAR));
Long id = taxDocumentMapper.insert(taxDocument); int num = taxDocumentMapper.insert(taxDocument);
//根据公司Id 设置业务线 //根据公司Id 设置业务线
String businessLine = organizationService.queryBusinessByCompanyId(taxDocument.getCompanyId()); String businessLine = organizationService.queryBusinessByCompanyId(taxDocument.getCompanyId());
if (StringUtils.isNotBlank(businessLine)) { if (StringUtils.isNotBlank(businessLine)) {
taxDocument.setBusinessLine(businessLine); taxDocument.setBusinessLine(businessLine);
} }
if (id > 0) { if (num > 0) {
OperationLogTaxDocument actionEntity = buildOperationLogTaxDocument(); OperationLogTaxDocument actionEntity = buildOperationLogTaxDocument();
actionEntity.setId(id.toString()); actionEntity.setId(taxDocument.getId().toString());
actionEntity.setOperationAction("新增"); actionEntity.setOperationAction("新增");
actionEntity.setUpdateState(taxDocument.toString()); actionEntity.setUpdateState(taxDocument.toString());
boolean result = operationLogTaxDocService.addTaxDocumentList(actionEntity); boolean result = operationLogTaxDocService.addTaxDocumentList(actionEntity);
......
...@@ -366,7 +366,19 @@ public class ReportServiceImpl extends BaseService { ...@@ -366,7 +366,19 @@ public class ReportServiceImpl extends BaseService {
@Transactional @Transactional
public void assemblePeriodTemplate(Template template, Workbook workbook, String projectId, Integer period, Integer addRowIndex) throws ServiceException { public void assemblePeriodTemplate(Template template, Workbook workbook, String projectId, Integer period, Integer addRowIndex) throws ServiceException {
List<Integer> hasHandDatas = Arrays.asList(
TaxesCalculateReportEnum.Column.Column_5.getIndex(),
TaxesCalculateReportEnum.Column.Column_6.getIndex(),
TaxesCalculateReportEnum.Column.Column_7.getIndex(),
TaxesCalculateReportEnum.Column.Column_8.getIndex(),
TaxesCalculateReportEnum.Column.Column_10.getIndex());
List<Integer> hasFormulaDatas = Arrays.asList(
TaxesCalculateReportEnum.Column.Column_4.getIndex(),
TaxesCalculateReportEnum.Column.Column_5.getIndex(),
TaxesCalculateReportEnum.Column.Column_6.getIndex(),
TaxesCalculateReportEnum.Column.Column_7.getIndex(),
TaxesCalculateReportEnum.Column.Column_8.getIndex(),
TaxesCalculateReportEnum.Column.Column_10.getIndex());
try { try {
Date now = new Date(); Date now = new Date();
Sheet sheet = workbook.getSheetAt(0); Sheet sheet = workbook.getSheetAt(0);
...@@ -397,11 +409,7 @@ public class ReportServiceImpl extends BaseService { ...@@ -397,11 +409,7 @@ public class ReportServiceImpl extends BaseService {
} }
cellTemplate.setIsReadOnly(cell.getCellStyle().getLocked() ? 1 : 0); cellTemplate.setIsReadOnly(cell.getCellStyle().getLocked() ? 1 : 0);
cellTemplateList.add(cellTemplate); cellTemplateList.add(cellTemplate);
//todo: 这里没有Config数据只有在上传模板以后,在界面里面可以配置公式 if (hasFormulaDatas.contains(c) && StringUtils.isNotBlank(POIUtil.getCellFormulaString(cell))) {
if (hasKeyIn(cell)) {
cell.setCellValue(StringUtils.EMPTY);
addManualConfig(template.getId(), cellTemplateId, cell, now, cellTemplateConfigList);
} else if (!cell.getCellStyle().getLocked() && StringUtils.isNotBlank(POIUtil.getCellFormulaString(cell))) {
PeriodCellTemplateConfig periodCellTemplateConfig = new PeriodCellTemplateConfig(); PeriodCellTemplateConfig periodCellTemplateConfig = new PeriodCellTemplateConfig();
periodCellTemplateConfig.setId(distributedIdService.nextId()); periodCellTemplateConfig.setId(distributedIdService.nextId());
periodCellTemplateConfig.setPeriod(period); periodCellTemplateConfig.setPeriod(period);
...@@ -420,6 +428,8 @@ public class ReportServiceImpl extends BaseService { ...@@ -420,6 +428,8 @@ public class ReportServiceImpl extends BaseService {
fixedParsedFormula(periodCellTemplateConfig); fixedParsedFormula(periodCellTemplateConfig);
fixedAccountCode(periodCellTemplateConfig); fixedAccountCode(periodCellTemplateConfig);
cellTemplateConfigList.add(periodCellTemplateConfig); cellTemplateConfigList.add(periodCellTemplateConfig);
}
if (hasHandDatas.contains(c)) {
addManualConfig(template.getId(), cellTemplateId, cell, now, cellTemplateConfigList); addManualConfig(template.getId(), cellTemplateId, cell, now, cellTemplateConfigList);
} }
} else { } else {
...@@ -696,8 +706,9 @@ public class ReportServiceImpl extends BaseService { ...@@ -696,8 +706,9 @@ public class ReportServiceImpl extends BaseService {
Sheet sheet = tWorkbook.getSheetAt(0); Sheet sheet = tWorkbook.getSheetAt(0);
RevenueConfigExample example = new RevenueConfigExample(); RevenueConfigExample example = new RevenueConfigExample();
List<RevenueConfig> dataList = revenueConfigMapper.selectByExample(example); List<RevenueConfig> dataList = revenueConfigMapper.selectByExample(example);
List<Integer> unLockStyles = Arrays.asList();
if (CollectionUtils.isNotEmpty(dataList)) { if (CollectionUtils.isNotEmpty(dataList)) {
Project project = projectMapper.selectByPrimaryKey(projectId);
int rowIndex = 1; int rowIndex = 1;
Row sourceRow = sheet.getRow(3); Row sourceRow = sheet.getRow(3);
for (RevenueConfig config : dataList) { for (RevenueConfig config : dataList) {
...@@ -705,11 +716,34 @@ public class ReportServiceImpl extends BaseService { ...@@ -705,11 +716,34 @@ public class ReportServiceImpl extends BaseService {
row.getCell(TaxesCalculateReportEnum.Column.Column_1.getIndex()).setCellValue("1-" + rowIndex); row.getCell(TaxesCalculateReportEnum.Column.Column_1.getIndex()).setCellValue("1-" + rowIndex);
row.getCell(TaxesCalculateReportEnum.Column.Column_3.getIndex()).setCellValue(config.getName()); row.getCell(TaxesCalculateReportEnum.Column.Column_3.getIndex()).setCellValue(config.getName());
row.getCell(TaxesCalculateReportEnum.Column.Column_2.getIndex()).setCellValue(""); row.getCell(TaxesCalculateReportEnum.Column.Column_2.getIndex()).setCellValue("");
row.getCell(TaxesCalculateReportEnum.Column.Column_4.getIndex()).setCellValue("PC(\"TimeInterval\",\"\"");
row.getCell(TaxesCalculateReportEnum.Column.Column_4.getIndex()).setCellValue("PC(\"VAT020\",\"C\",\"增值税进项税\",\"G\")"); //判断帐载收入明细
row.getCell(TaxesCalculateReportEnum.Column.Column_5.getIndex()).setCellValue(""); if (0 == config.getAccountType()) {//0值
row.getCell(TaxesCalculateReportEnum.Column.Column_5.getIndex()).setCellValue(0.00);
} else if (1 == config.getAccountType()) {//科目
row.getCell(TaxesCalculateReportEnum.Column.Column_5.getIndex()).setCellValue("DFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",\"" + config.getTbSegment5() + "\",\"" + config.getTbSegment6() + "\")-"
+"JFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",\"" + config.getTbSegment5() + "\",\"" + config.getTbSegment6() + "\")");
} else if(2 == config.getAccountType()){//手工输入
}else{
row.getCell(TaxesCalculateReportEnum.Column.Column_5.getIndex()).setCellValue("");
}
row.getCell(TaxesCalculateReportEnum.Column.Column_6.getIndex()).setCellValue(""); row.getCell(TaxesCalculateReportEnum.Column.Column_6.getIndex()).setCellValue("");
row.getCell(TaxesCalculateReportEnum.Column.Column_7.getIndex()).setCellValue(""); row.getCell(TaxesCalculateReportEnum.Column.Column_7.getIndex()).setCellValue("");
if (1 == config.getTaxBase()) {//账载
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"E\")");
} else if (2 == config.getTaxBase()) {//开票收入
} else if (3 == config.getTaxBase()) {//手工录入
} else if (4 == config.getTaxBase()) {//借方发生额
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("JFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",\"\",\"\")");
} else if (5 == config.getTaxBase()) {//贷方发生额
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("DFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",\"\",\"\")");
}else{
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("");
}
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("WPNAME(\"VAT020\",\"C\",\"增值税进项税\",\"G\")"); row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("WPNAME(\"VAT020\",\"C\",\"增值税进项税\",\"G\")");
row.getCell(TaxesCalculateReportEnum.Column.Column_9.getIndex()).setCellValue(config.getTaxRate().multiply(new BigDecimal(100)).intValue() + "%"); row.getCell(TaxesCalculateReportEnum.Column.Column_9.getIndex()).setCellValue(config.getTaxRate().multiply(new BigDecimal(100)).intValue() + "%");
row.getCell(TaxesCalculateReportEnum.Column.Column_10.getIndex()).setCellValue(0); row.getCell(TaxesCalculateReportEnum.Column.Column_10.getIndex()).setCellValue(0);
...@@ -1693,7 +1727,7 @@ public class ReportServiceImpl extends BaseService { ...@@ -1693,7 +1727,7 @@ public class ReportServiceImpl extends BaseService {
return operationResultDto; return operationResultDto;
} }
@Autowired @Resource
private PwcReportAttachMapper pwcReportAttachMapper; private PwcReportAttachMapper pwcReportAttachMapper;
public void bindPwcAttach(Long activeCol, Long activeRow, String activeTemplateId, FileDto file) { public void bindPwcAttach(Long activeCol, Long activeRow, String activeTemplateId, FileDto file) {
......
...@@ -41,7 +41,7 @@ public interface TaxDocumentMapper extends MyMapper { ...@@ -41,7 +41,7 @@ public interface TaxDocumentMapper extends MyMapper {
* *
* @mbg.generated * @mbg.generated
*/ */
Long insert(TaxDocument record); int insert(TaxDocument record);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
......
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