Commit 6044f0ef authored by eddie.woo's avatar eddie.woo

modify

parent a07dcfd0
package pwc.taxtech.atms.controller;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*;
import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.service.impl.ReportAnalysisService;
import javax.annotation.Resource;
import java.util.Collections;
@RestController
@RequestMapping("/api/v1/reportAnalysis")
public class ReportAnalysisController extends BaseController {
@Resource
private ReportAnalysisService reportAnalysisService;
@GetMapping("/burdenRateData/{projectId}")
public ApiResultDto getBurdenRateData(@PathVariable String projectId) {
if (StringUtils.isBlank(projectId)) {
return ApiResultDto.success(Collections.emptyList());
}
try {
return ApiResultDto.success(reportAnalysisService.getBurdenRateData(projectId));
} catch (Exception e) {
logger.error("getBurdenRateData error.", e);
}
return ApiResultDto.fail();
}
@GetMapping("/dispersion/{projectId}")
public ApiResultDto dispersion(@PathVariable String projectId) {
if (StringUtils.isBlank(projectId)) {
return ApiResultDto.success(Collections.emptyList());
}
try {
return ApiResultDto.success(reportAnalysisService.getDispersion(projectId));
} catch (Exception e) {
logger.error("getDispersion error.", e);
}
return ApiResultDto.fail();
}
@GetMapping("/incomeRate/{projectId}")
public ApiResultDto incomeRate(@PathVariable String projectId) {
if (StringUtils.isBlank(projectId)) {
return ApiResultDto.success(Collections.emptyList());
}
try {
return ApiResultDto.success(reportAnalysisService.getIncomeRate(projectId));
} catch (Exception e) {
logger.error("getDispersion error.", e);
}
return ApiResultDto.fail();
}
@GetMapping("/incomeVolatility/{projectId}")
public ApiResultDto incomeVolatility(@PathVariable String projectId) {
if (StringUtils.isBlank(projectId)) {
return ApiResultDto.success(Collections.emptyList());
}
try {
return ApiResultDto.success(reportAnalysisService.getIncomeVolatility(projectId));
} catch (Exception e) {
logger.error("getDispersion error.", e);
}
return ApiResultDto.fail();
}
}
package pwc.taxtech.atms.dao;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.service.impl.BaseService;
import pwc.taxtech.atms.vat.dao.GlBalanceMapper;
import pwc.taxtech.atms.vat.entity.GlBalance;
import pwc.taxtech.atms.vat.entity.GlBalanceExample;
import javax.annotation.Resource;
import java.util.Optional;
@Service
public class GlBalanceDao extends BaseService {
@Resource
private GlBalanceMapper glBalanceMapper;
/**
* 查找科目
*
* @param code code
* @return GlBalance
*/
public Optional<GlBalance> get(String code, String orgId, String period) {
GlBalanceExample example = new GlBalanceExample();
example.createCriteria().andSegment3EqualTo(code).andSegment1EqualTo(orgId).andPeriodNameEqualTo(period);
Optional<GlBalance> optional = glBalanceMapper.selectByExample(example).stream().findFirst();
if (optional.isPresent()) {
return optional;
}
GlBalanceExample example2 = new GlBalanceExample();
example2.createCriteria().andSegment4EqualTo(code).andSegment1EqualTo(orgId).andPeriodNameEqualTo(period);
return glBalanceMapper.selectByExample(example2).stream().findFirst();
}
}
package pwc.taxtech.atms.dto.vatdto;
import java.math.BigDecimal;
import java.util.List;
public class BurdenRateDto {
private List<BigDecimal> vatAmount;
private List<BigDecimal> income;
private List<BigDecimal> rate;
public List<BigDecimal> getVatAmount() {
return this.vatAmount;
}
public void setVatAmount(List<BigDecimal> vatAmount) {
this.vatAmount = vatAmount;
}
public List<BigDecimal> getIncome() {
return this.income;
}
public void setIncome(List<BigDecimal> income) {
this.income = income;
}
public List<BigDecimal> getRate() {
return this.rate;
}
public void setRate(List<BigDecimal> rate) {
this.rate = rate;
}
}
......@@ -204,7 +204,8 @@ public class DataInitTest extends CommonIT {
@Test
public void initOutput() throws Exception {
Workbook workbook = WorkbookFactory.create(new File("C:\\Users\\Eddie Wu\\Desktop\\导入\\进销项/导入模板_销项主表_乐叶_201807.xlsx"));
// todo 导入前检查开票日期,给的文档日期经常不一样
Workbook workbook = WorkbookFactory.create(new File("C:\\Users\\Eddie Wu\\Desktop\\导入\\进销项/导入模板_销项主表_绿能_201809.xlsx"));
Sheet sheet = workbook.getSheetAt(0);
for (int r = 1; r <= sheet.getLastRowNum(); r++) {
try {
......@@ -219,6 +220,7 @@ public class DataInitTest extends CommonIT {
outputInvoice.setFPQQLSH(sheet.getRow(r).getCell(1).getStringCellValue());
outputInvoice.setFPDM(sheet.getRow(r).getCell(2).getStringCellValue());
outputInvoice.setFPHM(sheet.getRow(r).getCell(3).getStringCellValue());
// outputInvoice.setKPRQ(sheet.getRow(r).getCell(4).getStringCellValue() + " 00:00:00");
outputInvoice.setKPRQ(sheet.getRow(r).getCell(4).getStringCellValue());
String s = "000" + sheet.getRow(r).getCell(5).getStringCellValue();
outputInvoice.setFPLXDM(s.substring(s.length() - 3, s.length()));
......@@ -236,6 +238,8 @@ public class DataInitTest extends CommonIT {
// outputInvoice.setHTBH(sheet.getRow(r).getCell(54).getStringCellValue());
OutputInvoiceExample example = new OutputInvoiceExample();
example.createCriteria().andFPDMEqualTo(outputInvoice.getFPDM()).andFPHMEqualTo(outputInvoice.getFPHM());
//有重复数据 先删除
outputInvoiceMapper.deleteByExample(example);
if (outputInvoiceMapper.selectByExample(example).size() > 0) {
outputInvoiceMapper.updateByExampleSelective(outputInvoice, example);
} else {
......
......@@ -5,9 +5,9 @@
$log.debug('VatAnalysisMenuController.ctor()...');
$scope.menus = [
{ name: '.analyzeReport', text: "出口数据对比", icon: 'glyphicon glyphicon-flag', permission: constant.vatPermission.dataAnalysis.modelAnalysisCode, show: true },
{ name: 'analyzeOrganizeDashboard({id:"' + vatSessionService.project.organizationID + '"})', text: "进项税额差异分析", icon: 'glyphicon glyphicon-stats', permission: constant.vatPermission.dataAnalysis.dashboard.dashboardCode, show: true },
{ name: '.vatTaxDifference', text: $translate.instant('BookTaxDifference'), icon: 'glyphicon glyphicon-tree-conifer', show: true }
{ name: '.analyzeReport', text: "指标分析", icon: 'glyphicon glyphicon-stats', permission: constant.vatPermission.dataAnalysis.modelAnalysisCode, show: true },
// { name: 'analyzeOrganizeDashboard({id:"' + vatSessionService.project.organizationID + '"})', text: "进项税额差异分析", icon: 'glyphicon glyphicon-stats', permission: constant.vatPermission.dataAnalysis.dashboard.dashboardCode, show: true },
// { name: '.vatTaxDifference', text: $translate.instant('BookTaxDifference'), icon: 'glyphicon glyphicon-tree-conifer', show: true }
];
vatSessionService.querySummayDashboardModel = {
organizationID: vatSessionService.project.organizationID,
......
<div class="vat-model-analysis ">
<div class="col-lg-12 col-md-12" style="margin-top:20px;">
<div >
<table border="1" width="95%" style="margin: auto">
<thead>
<tr class="th">
<th>遇到一个问题1</th>
<th>遇到一个问题1</th>
</tr>
</thead>
<tbody>
<tr class="tb">
<td>遇到一个问题</td>
<td>遇到一个问题</td>
</tr>
</tbody>
</table>
<div class="row">
<div class="col-lg-5 col-md-5">
<div id="burdenRateDiv" name="p_chart"></div>
</div>
<div class="col-lg-5 col-md-5 col-md-offset-1 col-lg-offset-1">
<div id="discreteAnalysisDiv" name="p_chart"></div>
</div>
</div>
<div class="row">
<div class="col-lg-5 col-md-5">
<div id="incomeRateDiv" name="p_chart"></div>
</div>
<div class="col-lg-5 col-md-5 col-md-offset-1 col-lg-offset-1">
<div id="incomeVolatilityDiv" name="p_chart"></div>
</div>
</div>
</div>
<style>
.th>th{
.th > th {
text-align: center;
}
.tb>td{
.tb > td {
height: 30px;
text-align: center;
}
......
......@@ -12,50 +12,50 @@
$scope.element = $element;
// rangePicker 需要手动释放,否则经过多次操作后,页面中会存在多个 rangePicker 的 div
var rangePicker = null;
var initializePeriodRangePicker = function () {
//初始化期间选择控件
var input = $($scope.element).find(".right-container .menu .period-range input");
var monthList = [
$translate.instant('Month01'),
$translate.instant('Month02'),
$translate.instant('Month03'),
$translate.instant('Month04'),
$translate.instant('Month05'),
$translate.instant('Month06'),
$translate.instant('Month07'),
$translate.instant('Month08'),
$translate.instant('Month09'),
$translate.instant('Month10'),
$translate.instant('Month11'),
$translate.instant('Month12')
];
input = input.rangePicker({
minDate: [1, $scope.projectYear],
maxDate: [12, $scope.projectYear],
setDate: [
[1, $scope.projectYear],
[12, $scope.projectYear]
],
months: monthList,
ConfirmBtnText: $translate.instant('Confirm'),
CancelBtnText: $translate.instant('ButtonCancel')
});
input.on('datePicker.done', function (e, result) {
$scope.periodFrom = result[0][0];
$scope.periodTo = result[1][0];
});
rangePicker = $(input).data("_ranegPicker");
};
// var rangePicker = null;
//
// var initializePeriodRangePicker = function () {
// //初始化期间选择控件
// var input = $($scope.element).find(".right-container .menu .period-range input");
// var monthList = [
// $translate.instant('Month01'),
// $translate.instant('Month02'),
// $translate.instant('Month03'),
// $translate.instant('Month04'),
// $translate.instant('Month05'),
// $translate.instant('Month06'),
// $translate.instant('Month07'),
// $translate.instant('Month08'),
// $translate.instant('Month09'),
// $translate.instant('Month10'),
// $translate.instant('Month11'),
// $translate.instant('Month12')
// ];
// input = input.rangePicker({
// minDate: [1, $scope.projectYear],
// maxDate: [12, $scope.projectYear],
// setDate: [
// [1, $scope.projectYear],
// [12, $scope.projectYear]
// ],
// months: monthList,
// ConfirmBtnText: $translate.instant('Confirm'),
// CancelBtnText: $translate.instant('ButtonCancel')
// });
// input.on('datePicker.done', function (e, result) {
// $scope.periodFrom = result[0][0];
// $scope.periodTo = result[1][0];
// });
//
// rangePicker = $(input).data("_ranegPicker");
// };
(function () {
initializePeriodRangePicker();
// initializePeriodRangePicker();
$scope.$on("$destroy", function () {
rangePicker.destroy();
});
// $scope.$on("$destroy", function () {
// rangePicker.destroy();
// });
})();
}
};
......
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