Commit 72e50540 authored by chase's avatar chase

merge档案管理

parent a3ba953d
......@@ -705,17 +705,39 @@ public class ReportServiceImpl extends BaseService {
periodTemplateMapper.batchInsert(periodTemplateList);
}
private String transNumber(int num,String result){
if(num==0){
return result;
}
int pre = num/26;// 取商
int res = num%26;// 取余数
if(res!=0){
result =(char)(res+'A'-1)+result;
}else{
result+='Z';
pre = pre -1;
}
return transNumber(pre,result);
}
public Workbook assembleTaxWorkBook(Template template, Workbook tWorkbook, String projectId, Integer period) {
Sheet sheet = tWorkbook.getSheetAt(0);
RevenueConfigExample example = new RevenueConfigExample();
List<RevenueConfig> dataList = revenueConfigMapper.selectByExample(example);
//合计项map
Map<Integer,List<String>> sumMap = new HashMap<>();
sumMap.put(TaxesCalculateReportEnum.Column.Column_5.getIndex(),new ArrayList<>());
sumMap.put(TaxesCalculateReportEnum.Column.Column_6.getIndex(),new ArrayList<>());
sumMap.put(TaxesCalculateReportEnum.Column.Column_7.getIndex(),new ArrayList<>());
sumMap.put(TaxesCalculateReportEnum.Column.Column_8.getIndex(),new ArrayList<>());
sumMap.put(TaxesCalculateReportEnum.Column.Column_10.getIndex(),new ArrayList<>());
if (CollectionUtils.isNotEmpty(dataList)) {
Project project = projectMapper.selectByPrimaryKey(projectId);
int rowIndex = 1;
Row sourceRow = sheet.getRow(3);
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_2.getIndex()).setCellValue(config.getName());
row.getCell(TaxesCalculateReportEnum.Column.Column_3.getIndex()).setCellValue("");
......@@ -724,9 +746,9 @@ public class ReportServiceImpl extends BaseService {
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() + "\")");
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 {
......@@ -735,30 +757,31 @@ 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\")");
//838b9b6513422e029c38575f9b029b1fdd18dadb
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("DFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",\"\",\"\")");
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("");
}
row.getCell(TaxesCalculateReportEnum.Column.Column_9.getIndex()).setCellValue(config.getTaxRate().multiply(new BigDecimal(100)).intValue() + "%");
// 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_10.getIndex()).setCellValue("WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"E\")*"
+"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()));
//组装合计项
sumMap.get(TaxesCalculateReportEnum.Column.Column_5.getIndex()).add(transNumber(TaxesCalculateReportEnum.Column.Column_5.getIndex()+1,"")+rowIndex);
sumMap.get(TaxesCalculateReportEnum.Column.Column_6.getIndex()).add(transNumber(TaxesCalculateReportEnum.Column.Column_6.getIndex()+1,"")+rowIndex);
sumMap.get(TaxesCalculateReportEnum.Column.Column_7.getIndex()).add(transNumber(TaxesCalculateReportEnum.Column.Column_7.getIndex()+1,"")+rowIndex);
sumMap.get(TaxesCalculateReportEnum.Column.Column_8.getIndex()).add(transNumber(TaxesCalculateReportEnum.Column.Column_8.getIndex()+1,"")+rowIndex);
sumMap.get(TaxesCalculateReportEnum.Column.Column_10.getIndex()).add(transNumber(TaxesCalculateReportEnum.Column.Column_10.getIndex()+1,"")+rowIndex);
rowIndex++;
}
}
......
......@@ -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(), bo.getColumnIndex(),
cellValue = getCellValue(index, ec, formulaContext, agent, cellTemplateData.getRowIndex(), bo.getColumnIndex()-1,
Long.parseLong(cellTemplateData.getCellTemplateId()));
nullCellDto.extractFromGroup(bo, formulaContext.getPeriod(), formulaContext.getYear(), cellTemplateData);
nullCellDto.setAmount(cellValue);
......
......@@ -195,7 +195,7 @@
if (options.data.updateTime) {
$('<span '+style+'>').text($filter('date')(options.data.updateTime, 'yyyy-MM-dd')).appendTo(container);
} else {
$('<span>').text().appendTo(container);
$('<span>').text('').appendTo(container);
}
} catch (e) {
$log.error(e);
......@@ -281,6 +281,11 @@
var createDocFileType = function () {
var uploadModel = angular.copy($scope.editModel);
delete uploadModel.id; //新增文档不需要上传ID
// 默认status为1
if(uploadModel.status === undefined
|| uploadModel.status === null) uploadModel.status = 1;
docManageService.addFileType(uploadModel).then(function (data) {
if (data == true) {
SweetAlert.success($translate.instant('SaveSuccess'));
......
......@@ -144,10 +144,9 @@
<div class="form-group">
<label class="col-sm-3 control-label">
<span style="color:red"> * </span>
<span translate="State"></span>
</label>
<div class="col-sm-11" style="width:61.67%">
<div class="col-sm-11" style="width:61.67%" >
<label class="col-sm-5 DM-state-label">
<input type="radio" name="editModelState"
value=1
......@@ -159,7 +158,7 @@
<input type="radio" name="editModelState"
value=0
ng-checked="editModel.status == 0"
ng-model="editModel.status" required />
ng-model="editModel.status"/>
<span translate="Disable"></span>
</label>
......
......@@ -98,7 +98,7 @@ frameworkModule.controller('appUsrOperateLogController',
if (options.data.createTime) {
$('<span>').text($filter('date')(options.data.createTime, 'yyyy-MM-dd hh:mm')).appendTo(container);
} else {
$('<span>').text().appendTo(container);
$('<span>').text('').appendTo(container);
}
} catch (e) {
$log.error(e);
......
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