Commit 2a074497 authored by chase's avatar chase

merge 档案管理

parent ddb37e77
package pwc.taxtech.atms.constant;
import java.io.File;
import java.text.DecimalFormat;
import java.util.Locale;
import java.util.UUID;
public final class Constant {
......@@ -50,6 +48,7 @@ public final class Constant {
public static final String IMAGE_FORMART_ = "png";
public static final String EMPTY = "";
public static final String DateTimeFormate = "%d年%d月";
public static final String DateTimeFormate1 = "%d-%d";
public static final String INPUT_RZJG_SUCCESS="1";
public static final String INPUT_RZJG_FAILED="2";
......
......@@ -159,7 +159,7 @@ public class TaxDocumentServiceImpl {
}
//创建人 creator
if (StringUtils.isNotBlank(taxDocumentDto.getCreator())) {
criteria.andCreatorEqualTo(taxDocumentDto.getCreator());
criteria.andCreatorLike("%" + taxDocumentDto.getCreator() + "%");
}
return example;
}
......
......@@ -396,6 +396,7 @@ public class ReportServiceImpl extends BaseService {
Long cellTemplateId = distributedIdService.nextId();
PeriodCellTemplate cellTemplate = new PeriodCellTemplate();
cellTemplate.setPeriod(period);
cellTemplate.setRowName(POIUtil.getCellFormulaString(cell));
cellTemplate.setProjectId(projectId);
cellTemplate.setColumnIndex(c);
cellTemplate.setCreateTime(now);
......@@ -407,9 +408,9 @@ public class ReportServiceImpl extends BaseService {
if (cell.getCellComment() != null) {
cellTemplate.setComment(cell.getCellComment().getString().getString());
}
cellTemplate.setIsReadOnly(cell.getCellStyle().getLocked() ? 1 : 0);
cellTemplate.setIsReadOnly(hasHandDatas.contains(c) ? 0 : 1);
cellTemplateList.add(cellTemplate);
if (hasFormulaDatas.contains(c) && StringUtils.isNotBlank(POIUtil.getCellFormulaString(cell))) {
if (r>0&&hasFormulaDatas.contains(c) && StringUtils.isNotBlank(POIUtil.getCellFormulaString(cell))) {
PeriodCellTemplateConfig periodCellTemplateConfig = new PeriodCellTemplateConfig();
periodCellTemplateConfig.setId(distributedIdService.nextId());
periodCellTemplateConfig.setPeriod(period);
......@@ -429,8 +430,8 @@ public class ReportServiceImpl extends BaseService {
fixedAccountCode(periodCellTemplateConfig);
cellTemplateConfigList.add(periodCellTemplateConfig);
}
if (hasHandDatas.contains(c)) {
addManualConfig(template.getId(), cellTemplateId, cell, now, cellTemplateConfigList);
if (r>0&&hasHandDatas.contains(c)) {
addManualConfig(cellTemplate, cell, now, cellTemplateConfigList);
}
} else {
//查询原来行cell是否有CellTemplate
......@@ -513,14 +514,16 @@ public class ReportServiceImpl extends BaseService {
}
}
private void addManualConfig(Long templateId, Long cellTemplateId, Cell cell, Date now, List<PeriodCellTemplateConfig> list) {
private void addManualConfig(PeriodCellTemplate cellTemplate, Cell cell, Date now, List<PeriodCellTemplateConfig> list) {
PeriodCellTemplateConfig configManual = new PeriodCellTemplateConfig();
configManual.setId(distributedIdService.nextId());
configManual.setCellTemplateId(cellTemplateId);
configManual.setReportTemplateId(templateId);
configManual.setCellTemplateId(cellTemplate.getCellTemplateId());
configManual.setReportTemplateId(cellTemplate.getReportTemplateId());
configManual.setPeriod(cellTemplate.getPeriod());
configManual.setProjectId(cellTemplate.getProjectId());
configManual.setDataSourceType(CellDataSourceType.KeyIn.getCode());
configManual.setFormula(POIUtil.getCellFormulaString(cell));
// config.setFormula(cell.getCellFormula());
// configManual.setFormula(cell.getCellFormula());
configManual.setFormulaDataSource("报表数据"); //todo KV相关
configManual.setUpdateTime(now);
// configManual.setUpdateBy(authUserHelper.getCurrentUserId());
......@@ -714,9 +717,9 @@ public class ReportServiceImpl extends BaseService {
for (RevenueConfig config : dataList) {
Row row = POIUtil.createAndCloneRow(tWorkbook, sheet, 1, sourceRow);
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_2.getIndex()).setCellValue("");
row.getCell(TaxesCalculateReportEnum.Column.Column_4.getIndex()).setCellValue("PC(\"TimeInterval\",\"\"");
row.getCell(TaxesCalculateReportEnum.Column.Column_2.getIndex()).setCellValue(config.getName());
row.getCell(TaxesCalculateReportEnum.Column.Column_3.getIndex()).setCellValue("");
row.getCell(TaxesCalculateReportEnum.Column.Column_4.getIndex()).setCellValue("PC(\"FilterDate1\",2)");
//判断帐载收入明细
if (0 == config.getAccountType()) {//0值
row.getCell(TaxesCalculateReportEnum.Column.Column_5.getIndex()).setCellValue(0.00);
......@@ -732,24 +735,26 @@ public class ReportServiceImpl extends BaseService {
row.getCell(TaxesCalculateReportEnum.Column.Column_6.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\")");
// 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 + ",\"\",\"\")");
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 + ",\"\",\"\")");
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_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("WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"E\")*"
// +"WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"I\")");
if(rowIndex == 3){
row.getCell(TaxesCalculateReportEnum.Column.Column_10.getIndex()).setCellValue("WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"I\")");
}
row.getCell(TaxesCalculateReportEnum.Column.Column_11.getIndex()).setCellValue(RevenueConfEnum.RevenueType.MAPPING.get(config.getRevenueType()));
row.getCell(TaxesCalculateReportEnum.Column.Column_12.getIndex()).setCellValue(RevenueConfEnum.TaxType.MAPPING.get(config.getTaxType()));
row.getCell(TaxesCalculateReportEnum.Column.Column_13.getIndex()).setCellValue(RevenueConfEnum.TaxType.MAPPING.get(config.getTaxType()));
rowIndex++;
}
}
......
......@@ -4,6 +4,7 @@ import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.eval.MissingArgEval;
import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction;
......@@ -31,12 +32,18 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
return null;
}
String code = getStringParam(args[0], ec);
String code = getStringParam(args[0], ec);//科目代码
int year = getIntParam(args[1], ec);
int period = getIntParam(args[2], ec);
int sourceDataType = getIntParam(args[3], ec);//科目代码
String segment5 = getStringParam(args[4], ec);//利润中心代码
String segment6 = getStringParam(args[5], ec);//产品代码
int sourceDataType = getIntParam(args[3], ec);//取值数据源
String segment5 = null;
if(!(args[4] instanceof MissingArgEval)){
segment5 = getStringParam(args[4], ec);//利润中心代码
}
String segment6 = null;
if(!(args[4] instanceof MissingArgEval)){
segment6 = getStringParam(args[5], ec);//产品代码
}
String formulaExpression = "DFFS(\"" + code + "\"," + year + "," + period + "," + sourceDataType + ",\"" + segment5 + "\",\"" + segment6 + "\")";
logger.debug(formulaExpression);
......
......@@ -2,6 +2,7 @@ package pwc.taxtech.atms.vat.service.impl.report.functions;
import com.alibaba.fastjson.JSON;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.WorkbookEvaluator;
import org.apache.poi.ss.formula.eval.*;
......@@ -10,7 +11,6 @@ import org.slf4j.LoggerFactory;
import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import pwc.taxtech.atms.exception.Exceptions;
import pwc.taxtech.atms.vat.entity.*;
import pwc.taxtech.atms.vat.service.impl.FormulaAgent;
......@@ -222,7 +222,26 @@ public class FunctionBase {
if (!dss.isEmpty()) return dss.get(0).getAmount();
} else {
String evalStr = OperandResolver.coerceValueToString(eval);
if(StringUtils.isBlank(evalStr)){
evalStr = "0";
}
LOGGER.debug("[Formula_debug] eval other cell value {}", evalStr);
if(evalStr.endsWith("%")){
evalStr = evalStr.replace("%","");
try {
BigDecimal bigDecimal = new BigDecimal(evalStr);
bigDecimal.divide(new BigDecimal(100));
if (!dss.isEmpty()) {
return bigDecimal.add(dss.get(0).getAmount());
} else {
return bigDecimal;
}
} catch (Exception e) {
if (!dss.isEmpty())
return dss.get(0).getAmount();
e.printStackTrace();
}
}else{
try {
BigDecimal bigDecimal = new BigDecimal(evalStr);
if (!dss.isEmpty()) {
......@@ -235,6 +254,9 @@ public class FunctionBase {
return dss.get(0).getAmount();
e.printStackTrace();
}
}
}
......
......@@ -4,6 +4,7 @@ import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.eval.MissingArgEval;
import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction;
......@@ -31,12 +32,19 @@ public class JFFS extends FunctionBase implements FreeRefFunction {
return null;
}
String code = getStringParam(args[0], ec);
String code = getStringParam(args[0], ec);//科目代码
int year = getIntParam(args[1], ec);
int period = getIntParam(args[2], ec);
int sourceDataType = getIntParam(args[3], ec);//科目代码
String segment5 = getStringParam(args[4], ec);//利润中心代码
String segment6 = getStringParam(args[5], ec);//产品代码
int sourceDataType = getIntParam(args[3], ec);//取值数据源
String segment5 = null;
if(!(args[4] instanceof MissingArgEval)){
segment5 = getStringParam(args[4], ec);//利润中心代码
}
String segment6 = null;
if(!(args[4] instanceof MissingArgEval)){
segment6 = getStringParam(args[5], ec);//产品代码
}
String formulaExpression = "JFFS(\"" + code + "\"," + year + "," + period + "," + sourceDataType + ",\"" + segment5 + "\",\"" + segment6 + "\")";
logger.debug(formulaExpression);
......
......@@ -7,7 +7,6 @@ import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction;
import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.vat.entity.PeriodReport;
import java.util.Calendar;
import java.util.Date;
......@@ -40,6 +39,9 @@ public class PC extends FunctionBase implements FreeRefFunction {
return new StringEval(String.format(Constant.DateTimeFormate, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)));
case "FilterDate":
return new StringEval(String.format(Constant.DateTimeFormate, formulaContext.getYear(), formulaContext.getPeriod()));
case "FilterDate1":
// String month = formulaContext.getPeriod()<10?"0"+formulaContext.getPeriod():formulaContext.getPeriod()+"";
return new StringEval(String.format(Constant.DateTimeFormate1, formulaContext.getYear(), formulaContext.getPeriod()));
case "TimeInterval":
Date beginOfPeriod = new Date(formulaContext.getYear(), formulaContext.getIsYear() ? 1 : formulaContext.getPeriod(), 1);
calendar.setTime(beginOfPeriod);
......
......@@ -59,7 +59,7 @@ public class WPNAME extends FunctionBase implements FreeRefFunction {
MyAsserts.assertNotEmpty(cellTemplateDataList, Exceptions.BB_CELL_TEMP_NULL);
cellTemplateData = cellTemplateDataList.get(0);
int index = ec.getWorkbook().getSheetIndex(bo.getReportCode());
cellValue = getCellValue(index, ec, formulaContext, agent, cellTemplateData.getRowIndex(), "VAT020".equals(bo.getReportCode())?bo.getColumnIndex():(bo.getColumnIndex() - 1),
cellValue = getCellValue(index, ec, formulaContext, agent, cellTemplateData.getRowIndex(), bo.getColumnIndex(),
Long.parseLong(cellTemplateData.getCellTemplateId()));
nullCellDto.extractFromGroup(bo, formulaContext.getPeriod(), formulaContext.getYear(), cellTemplateData);
nullCellDto.setAmount(cellValue);
......
......@@ -93,6 +93,7 @@
"ProjectYearCol": "年份",
"AssignRoleCol": "分配角色",
"SequenceNoCol": "序号",
"SequenceNumber":"序号",
"DocumentID": "档案ID",
"TaxGroup":"税种",
"DocumentAttr": "档案属性",
......
......@@ -82,7 +82,7 @@
columns: [
{
dataField: "id",
caption: $translate.instant('DocumentID'),
caption: $translate.instant('SequenceNumber'),
allowHeaderFiltering: true,
cellTemplate: function (container, options) {
try {
......@@ -241,6 +241,9 @@
};
};
$scope.exportEventTrigger = function(){
$(".dx-datagrid-export-button").click();
};
//弹出框
var openEditPop = function (rowId) {
if (rowId) {
......
......@@ -7,6 +7,11 @@
line-height: 34px;
float: none;
}
div.dx-datagrid-export-button{
display: none;
}
</style>
<div class="menu-header">
<div class="menu-title" translate="DocumentTypeSets"></div>
......@@ -17,13 +22,14 @@
</div>
<div class="content-container">
<div class="row" style="margin-top:15px; text-align:right;padding:1rem;background: #fff">
<button style="width: 150px;" class="btn btn-in-panel-big" ng-click="exportEventTrigger()">
<i class="fa fa-file-excel-o"></i>
{{'ExportTable' | translate}}
</button>
<button style="width: 150px;" class="btn btn-in-panel-big" ng-click="openEditPop()">
<i class="material-icons button-icons">add_circle_outline</i>
{{'addFileType' | translate}}
</button><!----><!--ng-disabled="!hasAddPermission"-->
<!--<button class="btn btn-export">
导出档案类型
</button>-->
</button>
</div>
<div style="padding:0 1rem;background:#fff">
<div class="dx-viewport demo-container">
......@@ -42,14 +48,15 @@
<div class="modal-dialog" style="width:550px;height:200px;" role="document">
<div class="modal-content">
<form class="form-horizontal" name="newDocFileTypeForm" ng-submit="confirmDocFileType()">
<div class="modal-header">
<div class="modal-title"><span translate="createDocFileType"></span></div>
<div class="modal-title"><span translate="CreateDocFileType"></span></div>
</div>
<div class="modal-body">
<!--序号-->
<div class="form-group" hidden>
<label for="SequenceNoCol" class="col-sm-3 control-label" translate="SequenceNoCol"></label>
<label for="SequenceNoCol" class="col-sm-3 control-label" translate="SequenceNumber"></label>
<div class="col-sm-11" style="width:61.67%">
<input class="form-control"
id="SequenceNoCol"
......@@ -93,17 +100,16 @@
<!--<span style="color:red"> * <span translate="Require"></span> </span>-->
<!--</div>-->
</div>
<!--说明-->
<!--描述-->
<div class="form-group">
<label for="Description" class="col-sm-3 control-label">
<span style="color:red"> * </span>
<span translate="DescriptionWithOutColon"></span>
</label>
<div class="col-sm-11" style="width:61.67%">
<input class="form-control" id="Description"
ng-model="editModel.description"
placeholder="请输入..."
required style="width:320px;" maxlength="50" />
style="width:320px;" maxlength="50" />
</div>
</div>
<!--必填字段-->
......@@ -131,7 +137,7 @@
<input class="form-control" id="Remarks"
ng-model="editModel.remarks"
placeholder="请输入..."
required style="width:320px;" maxlength="50" />
style="width:320px;" maxlength="50" />
</div>
</div>
<!--状态-->
......@@ -145,8 +151,8 @@
<label class="col-sm-5 DM-state-label">
<input type="radio" name="editModelState"
value=1
ng-checked="editModel.status == 1"
ng-model="editModel.status" required />
ng-checked="editModel.status == 1 || editModel.status == null || editModel.status == undefined"
ng-model="editModel.status"/>
<span translate="Enable"></span>
</label>
<label class="col-sm-5 DM-state-label">
......
......@@ -111,7 +111,8 @@
title="{{selected}}"
readonly
ng-model="selected">
<button type="button" class="input-arrow-drop-button">
<button type="button" class="input-arrow-drop-button"
ng-click="showMenu()">
</button>
<button type="button" class="input-reset-button"
ng-click="clearInput()"
......
......@@ -92,17 +92,10 @@ taxDocumentManageModule.controller('taxDocumentListController',
dataField: "id",
caption: "",
cellTemplate: function (container, options) {
// var targetString = '<input name="dataGridCheckBox" ng-click="sniffCheckbox()"' +
// 'data-id="'+options.data.id+'" ' +
// 'data-url="'+options.data.filePositionUrl+'" ' +
// 'type="checkbox">';
// var eventTarget = $(targetString);
// $compile(eventTarget)($scope);
// container.append(eventTarget);
var target = $('<input name="dataGridCheckBox" type="checkbox" '+
'data-id="'+options.data.id+'" '+
'data-url="'+options.data.filePositionUrl+'"/>');
target.off('click').on('click',function(){
var target = $('<input name="dataGridCheckBox" type="checkbox" ' +
'data-id="' + options.data.id + '" ' +
'data-url="' + options.data.filePositionUrl + '"/>');
target.off('click').on('click', function () {
$scope.sniffCheckbox();
});
container.append(target);
......@@ -1127,6 +1120,16 @@ taxDocumentManageModule.directive('helpPop', function () {
$("#helpPopDialog").modal("show");
})
};
$scope.sniffHelpPopRadio = function(){
$("input[name='helpPopRadio']").each(function (index,item) {
if(item.checked){
$scope.editFieldModel.fileAttr = item.getAttribute("data-fileAttr");
$scope.editFieldModel.fileType = item.getAttribute("data-fileType");
$scope.syncRequiredFields($scope.editFieldModel);
}
});
};
$scope.help_dataGridUpdate = function (_data) {
$scope.help_cacheData = _data.items;
$scope.help_dataGridOptions = {
......@@ -1151,6 +1154,21 @@ taxDocumentManageModule.directive('helpPop', function () {
columnAutoWidth: true,
allowColumnReordering: true,
columns: [
{
dataField: "",
caption: "",
cellTemplate: function (container, options) {
var target = $('<input name="helpPopRadio" type="radio" ' +
'data-id="helpPop_' + options.data.id + '" ' +
'data-fileAttr="' + options.data.fileAttr + '" ' +
'data-fileType="' + options.data.fileType +
'" />');
container.append(target);
// target.parents("tr").off('click').on('click', function () {
// $scope.sniffHelpPopRadio(options.data.id);
// });
}
},
{
dataField: "fileAttr",
caption: $translate.instant('DocumentAttr'),
......
......@@ -922,10 +922,10 @@
</select>
</div>
<div class="DTL-special-external-btn" title="查看类型列表">
<!--<div class="DTL-special-external-btn" title="查看类型列表">
<a href="javascript:void(0)" ng-click="openHelpPop()"><i
class="fa fake-question-circle" aria-hidden="true"></i></a>
</div>
</div>-->
</div>
<div class="col-sm-6 form-group">
<label class="col-sm-3 control-label">
......@@ -1151,6 +1151,11 @@
<div class="dx-viewport demo-container" id="helpPopContainer">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" translate="Confirm" ng-click="sniffHelpPopRadio()"></button>
<button type="button" class="btn btn-third" data-dismiss="modal" ng-click="cancelDocFileType()"
translate="Cancel"></button>
</div>
</div>
</div>
</div>
......
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