Commit be76c9ea authored by gary's avatar gary

Merge remote-tracking branch 'origin/dev_mysql' into dev_mysql

parents 6ff6b040 fd6d1a79
......@@ -35,6 +35,8 @@ public class EbsApiServiceImpl implements EbsApiService {
@Resource
private CashFlowMapper cashFlowMapper;
@Resource
private CashFlowFinalMapper cashFlowFinalMapper;
@Resource
private BalanceSheetMapper balanceSheetMapper;
@Resource
private BalanceSheetPrcMapper balanceSheetPrcMapper;
......@@ -301,7 +303,14 @@ public class EbsApiServiceImpl implements EbsApiService {
result.setCreateTime(new Date());
result.setCreateBy(getCurrentOperatorName(id));
cashFlowMapper.insertSelective(result);
logger.debug("start to insert cashFlowFinal ");
// 1、写入最终表
CashFlowExample cashFlowExample = new CashFlowExample();
cashFlowExample.createCriteria().andEntityCodeEqualTo(item.getEntityCode()).andPeriodEqualTo(result.getPeriod()).andTaskIdNotEqualTo(item.getTaskId());
if (cashFlowFinalMapper.countByExample(cashFlowExample) > 0) {
cashFlowFinalMapper.deleteByExample(cashFlowExample);
}
cashFlowFinalMapper.insertSelective(result);
}
private void processBS(Long id,BalanceSheetQueryDto item) {
......@@ -325,7 +334,7 @@ public class EbsApiServiceImpl implements EbsApiService {
logger.debug("start to insert balanceSheetFinal ");
// 1、写入最终表
BalanceSheetExample balanceSheetExample = new BalanceSheetExample();
balanceSheetExample.createCriteria().andOrganizationIdEqualTo(result.getOrganizationId()).andPeriodEqualTo(result.getPeriod()).andTaskIdNotEqualTo(item.getTaskId());
balanceSheetExample.createCriteria().andEntityCodeEqualTo(item.getEntityCode()).andPeriodEqualTo(result.getPeriod()).andTaskIdNotEqualTo(item.getTaskId());
if (balanceSheetFinalMapper.countByExample(balanceSheetExample) > 0) {
balanceSheetFinalMapper.deleteByExample(balanceSheetExample);
}
......@@ -354,7 +363,7 @@ public class EbsApiServiceImpl implements EbsApiService {
// 1、写入最终表
logger.debug("start to insert BalanceSheetPrcFinal ");
BalanceSheetPrcExample balanceSheetPrcExample = new BalanceSheetPrcExample();
balanceSheetPrcExample.createCriteria().andOrganizationIdEqualTo(result.getOrganizationId()).andPeriodEqualTo(result.getPeriod()).andTaskIdNotEqualTo(item.getTaskId());
balanceSheetPrcExample.createCriteria().andEntityCodeEqualTo(item.getEntityCode()).andPeriodEqualTo(result.getPeriod()).andTaskIdNotEqualTo(item.getTaskId());
if (balanceSheetPrcFinalMapper.countByExample(balanceSheetPrcExample) > 0) {
balanceSheetPrcFinalMapper.deleteByExample(balanceSheetPrcExample);
}
......@@ -382,7 +391,7 @@ public class EbsApiServiceImpl implements EbsApiService {
logger.debug("start to insert profitLossStatementFinal ");
// 1、写入最终表
ProfitLossStatementExample profitLossStatementExample = new ProfitLossStatementExample();
profitLossStatementExample.createCriteria().andOrganizationIdEqualTo(result.getOrganizationId()).andPeriodEqualTo(result.getPeriod()).andTaskIdNotEqualTo(item.getTaskId());
profitLossStatementExample.createCriteria().andEntityCodeEqualTo(item.getEntityCode()).andPeriodEqualTo(result.getPeriod()).andTaskIdNotEqualTo(item.getTaskId());
if (profitLossStatementFinalMapper.countByExample(profitLossStatementExample) > 0) {
profitLossStatementFinalMapper.deleteByExample(profitLossStatementExample);
}
......@@ -410,7 +419,7 @@ public class EbsApiServiceImpl implements EbsApiService {
logger.debug("start to insert profitLossStatementPrcFinal ");
// 1、写入最终表
ProfitLossStatementPrcExample profitLossStatementPrcExample = new ProfitLossStatementPrcExample();
profitLossStatementPrcExample.createCriteria().andOrganizationIdEqualTo(result.getOrganizationId()).andPeriodEqualTo(result.getPeriod()).andTaskIdNotEqualTo(item.getTaskId());
profitLossStatementPrcExample.createCriteria().andEntityCodeEqualTo(item.getEntityCode()).andPeriodEqualTo(result.getPeriod()).andTaskIdNotEqualTo(item.getTaskId());
if (profitLossStatementPrcFinalMapper.countByExample(profitLossStatementPrcExample) > 0) {
profitLossStatementPrcFinalMapper.deleteByExample(profitLossStatementPrcExample);
}
......
......@@ -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