Commit f5d391e6 authored by eddie.wu's avatar eddie.wu

Merge branch 'dev_oracle' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_oracle

parents b79c3b7d 6502d902
......@@ -51,7 +51,7 @@ public class OutputInvoiceController {
}
@RequestMapping(value = "getExportOutputInvoiceList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void downloadInvoiceQueryData(@RequestBody QueryOutputDto paras, HttpServletResponse response) {
public void downloadInvoiceQueryData(@RequestBody QueryOutputDto paras, @RequestHeader("from") String projectId, HttpServletResponse response) {
response.setContentType("application/vnd.ms-excel;charset=utf-8");
response.setHeader("Content-Disposition", "attachment;filename="
+ UUID.randomUUID() + ".xls");
......@@ -59,7 +59,7 @@ public class OutputInvoiceController {
OutputStream os = null;
try {
os = response.getOutputStream();
int count = getDownloadFilePath(paras, os);
int count = getDownloadFilePath(paras, projectId, os);
if (count == 0) {
response.setStatus(SC_NO_CONTENT);
......@@ -81,8 +81,8 @@ public class OutputInvoiceController {
return ResponseEntity.ok().body(outputInvoiceService.getOutputInvoiceList(period));
}
private int getDownloadFilePath(QueryOutputDto paras, OutputStream outputStream) {
List<OutputVATInvoiceInfoDto> list = outputInvoiceService.getExportOutputInvoiceList(paras).getData();
private int getDownloadFilePath(QueryOutputDto paras, String projectId, OutputStream outputStream) {
List<OutputVATInvoiceInfoDto> list = outputInvoiceService.getExportOutputInvoiceList(paras, projectId).getData();
if (list.size() == 0) {
return 0;
}
......
......@@ -97,6 +97,7 @@ public class TemplateGroupController {
@RequestMapping(value = "importTemplateGroupExcelFile", method = RequestMethod.POST)
public OperationResultDto importTemplateGroupExcelFile(@RequestParam MultipartFile file,
@RequestParam String filename,
@RequestParam Boolean allowManual,
@RequestParam String tempFileName,
@RequestParam String jsonModel) {
try {
......@@ -107,7 +108,8 @@ public class TemplateGroupController {
if (CollectionUtils.isEmpty(templateGroupDto.getSheetNameList())) {
return OperationResultDto.error(ErrorMessage.NoSelectSheet);
}
templateGroupService.importTemplateGroupExcelFile(file, templateGroupDto);
if(allowManual == null) allowManual = Boolean.FALSE;
templateGroupService.importTemplateGroupExcelFile(file, allowManual, templateGroupDto);
return OperationResultDto.success();
} catch (ServiceException e) {
return OperationResultDto.error(e.getMessage());
......@@ -117,17 +119,20 @@ public class TemplateGroupController {
return OperationResultDto.error(ErrorMessage.SystemError);
}
@ResponseBody
@ApiOperation(value = "导入报表")
@RequestMapping(value = "importTemplateExcelFile", method = RequestMethod.POST)
public OperationResultDto importTemplateExcelFile(@RequestParam MultipartFile file,
@RequestParam Long templateGroupID,
@RequestParam String sheetList,
@RequestParam Boolean allowManual,
@RequestParam String tempFileName,
@RequestParam String reportType,
@RequestParam String filename) {
try {
templateGroupService.importTemplateExcelFile(file, templateGroupID, reportType, sheetList);
if(allowManual == null) allowManual = Boolean.FALSE;
templateGroupService.importTemplateExcelFile(file, allowManual, templateGroupID, reportType, sheetList);
return OperationResultDto.success();
} catch (ServiceException e) {
return OperationResultDto.error(e.getMessage());
......
......@@ -15,6 +15,7 @@ import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.POIUtil;
import pwc.taxtech.atms.common.message.ErrorMessage;
import pwc.taxtech.atms.common.message.TemplateMessage;
import pwc.taxtech.atms.constant.enums.CellDataSourceType;
import pwc.taxtech.atms.constant.enums.TemplateGroupType;
import pwc.taxtech.atms.dao.CellTemplateConfigDao;
import pwc.taxtech.atms.dao.CellTemplateConfigMapper;
......@@ -184,7 +185,7 @@ public class TemplateGroupServiceImpl extends AbstractService {
}
@Transactional
public void importTemplateGroupExcelFile(MultipartFile file, TemplateGroupDto templateGroupDto) throws ServiceException {
public void importTemplateGroupExcelFile(MultipartFile file, boolean allowManual, TemplateGroupDto templateGroupDto) throws ServiceException {
List<String> sheetNameList = templateGroupDto.getSheetNameList();
if (CollectionUtils.isEmpty(sheetNameList)) {
throw new ServiceException(ErrorMessage.NoSelectSheet);
......@@ -269,13 +270,27 @@ public class TemplateGroupServiceImpl extends AbstractService {
config.setId(distributedIdService.nextId());
config.setCellTemplateId(cellTemplate.getId());
config.setReportTemplateId(template.getId());
config.setDataSourceType(1);//todo 枚举
config.setDataSourceType(CellDataSourceType.Formula.getCode());//todo 枚举
config.setFormula(POIUtil.getCellFormulaString(cell));
// config.setFormula(cell.getCellFormula());
config.setFormulaDataSource("报表数据"); //todo KV相关
config.setUpdateTime(now);
config.setUpdateBy(authUserHelper.getCurrentUserId());
cellTemplateConfigList.add(config);
if(allowManual){
CellTemplateConfig configManual = new CellTemplateConfig();
configManual.setId(distributedIdService.nextId());
configManual.setCellTemplateId(cellTemplate.getId());
configManual.setReportTemplateId(template.getId());
configManual.setDataSourceType(CellDataSourceType.KeyIn.getCode());//todo 枚举
configManual.setFormula(POIUtil.getCellFormulaString(cell));
// config.setFormula(cell.getCellFormula());
// configManual.setFormulaDataSource("报表数据"); //todo KV相关
configManual.setUpdateTime(now);
configManual.setUpdateBy(authUserHelper.getCurrentUserId());
cellTemplateConfigList.add(configManual);
}
PeriodDataSource pds = new PeriodDataSource();
pds.setAmount(BigDecimal.ZERO);
pds.setUpdateBy("Admin");
......@@ -310,7 +325,7 @@ public class TemplateGroupServiceImpl extends AbstractService {
}
@Transactional
public void importTemplateExcelFile(MultipartFile file, Long templateGroupId, String reportType, String sheetList) throws ServiceException {
public void importTemplateExcelFile(MultipartFile file, boolean allowManual, Long templateGroupId, String reportType, String sheetList) throws ServiceException {
if (null == file) {
throw new ServiceException(ErrorMessage.NoFile);
}
......@@ -388,6 +403,19 @@ public class TemplateGroupServiceImpl extends AbstractService {
config.setUpdateTime(now);
config.setUpdateBy(authUserHelper.getCurrentUserId());
cellTemplateConfigList.add(config);
if(allowManual){
CellTemplateConfig configManual = new CellTemplateConfig();
configManual.setId(distributedIdService.nextId());
configManual.setCellTemplateId(cellTemplate.getId());
configManual.setReportTemplateId(template.getId());
configManual.setDataSourceType(CellDataSourceType.KeyIn.getCode());//todo 枚举
configManual.setFormula(POIUtil.getCellFormulaString(cell));
// config.setFormula(cell.getCellFormula());
// configManual.setFormulaDataSource("报表数据"); //todo KV相关
configManual.setUpdateTime(now);
configManual.setUpdateBy(authUserHelper.getCurrentUserId());
cellTemplateConfigList.add(configManual);
}
PeriodDataSource pds = new PeriodDataSource();
pds.setAmount(BigDecimal.ZERO);
pds.setUpdateBy("Admin");
......
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import javafx.geometry.Orientation;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.methods.CloseableHttpResponse;
......@@ -100,9 +101,9 @@ public class OutputInvoiceServiceImpl {
return pageInfo;
}
public OperationResultDto<List<OutputVATInvoiceInfoDto>> getExportOutputInvoiceList(QueryOutputDto queryDto) {
public OperationResultDto<List<OutputVATInvoiceInfoDto>> getExportOutputInvoiceList(QueryOutputDto queryDto, String projectId) {
OperationResultDto<List<OutputVATInvoiceInfoDto>> result = new OperationResultDto<>();
List<OutputVATInvoiceInfoDto> finalList = getQueryList(queryDto);
List<OutputVATInvoiceInfoDto> finalList = getQueryList(queryDto, projectId);
finalList = getOutputDetailInfoList(finalList);
result.setData(finalList);
result.setResult(true);
......@@ -256,9 +257,16 @@ public class OutputInvoiceServiceImpl {
// return stream.sorted(Comparator.comparing(OutputVATInvoiceInfoDto::getInvoiceDate)).collect(Collectors.toList());
// }
private List<OutputVATInvoiceInfoDto> getQueryList(QueryOutputDto queryDto) {
private List<OutputVATInvoiceInfoDto> getQueryList(QueryOutputDto queryDto, String projectId) {
List<OutputVATInvoiceInfoDto> rList = outputInvoiceMapper.selectOutputInvoiceInfoLeftJoinItem(queryDto);
rList.stream().forEach(x -> {
Organization organization = organizationMapper.selectByPrimaryKey(projectMapper.selectByPrimaryKey(projectId).getOrganizationId());
if(organization == null){
return Lists.newArrayList();
}
OutputInvoiceExample e = new OutputInvoiceExample();
e.createCriteria().andXFSHEqualTo(organization.getTaxPayerNumber());
List<String> fpqqlshList = outputInvoiceMapper.selectByExample(e).stream().map(OutputInvoice::getFPQQLSH).collect(Collectors.toList());
rList.stream().filter(a -> fpqqlshList.contains(a.getFpqqlsh())).forEach(x -> {
CAL.setTime(x.getInvoiceDate());
x.setPeriodId(CAL.get(Calendar.MONTH) + 1);
});
......
......@@ -71,7 +71,7 @@ controller('editTemplategroupModalController', ['$scope', '$log', '$translate',
Upload.upload({
url: thisConstant.uploadUrl,
data: {
allowManual: $('#allowManual').is(':checked'),
filename: $scope.editModel.file.name,
tempFileName: tempFileName,
},
......@@ -264,6 +264,7 @@ controller('editTemplategroupModalController', ['$scope', '$log', '$translate',
Upload.upload({
url: thisConstant.importTemplateExcelFile,
data: {
allowManual: $('#allowManual').is(':checked'),
jsonModel: json,
filename: $scope.editModel.file.name,
tempFileName: tempFileName
......
......@@ -28,6 +28,10 @@
<div id={{::editModel.sheetSelectDxID}}></div>
</div>
</div>
<div class="form-group">
<label for="telCode" class="col-sm-5 control-label"><input type="radio" id="allowManual"></label>
<label for="telCode" class="col-sm-5 control-label"><span>允许手工录入</span></label>
</div>
</form>
</div>
<div class="modal-footer" style="padding-left: 22px;text-align: left;">
......
......@@ -22,17 +22,73 @@
autoExpandAll:true,
columns: [
{ dataField: 'typeName', caption: $translate.instant('IncomeType') },
{ dataField: 'description', caption: $translate.instant('Description') },
{ dataField: 'amount', caption: $translate.instant('Amount'), format: { type: 'fixedPoint', precision: 2 } }
{ dataField: 'description', caption: "栏次" },
{ dataField: 'amount', caption: "税务系统", format: { type: 'fixedPoint', precision: 2 } }
],
selection: {
mode: "single"
},
onRowPrepared: function (info) {
if (info.rowType != 'header') {
if (info.data.head_ID === "0") {
info.rowElement.addClass('top-category');
}
}
}
},
reasonOptions: {
height: '600px',
bindingOptions: {
dataSource: 'reasonList'
},
keyExpr: "id",
parentIdExpr: "head_ID",
expandedRowKeys: [1],
showBorders: false,
showColumnLines: false,
showRowLines: false,
columnAutoWidth: true,
autoExpandAll: true,
columns: [
{ dataField: 'name', caption: "会计科目" },
{ dataField: 'desc', caption: "明细字段" },
{ dataField: 'amount', caption: $translate.instant('Amount'), format: { type: 'fixedPoint', precision: 2 } },
{ dataField: 'desc', caption: $translate.instant('Description') },
{ dataField: 'name', caption: $translate.instant('DifferenceReason') }
],
onRowPrepared: function (info) {
if (info.rowType != 'header') {
if (info.data.head_ID==="0") {
info.rowElement.addClass('top-category');
}
if (info.data.id === 'total') {
info.rowElement.addClass('table-summary');
}
}
}
}
};
$scope.toggleAllMasterRows = function ($event) {
var expand = "dx-datagrid-group-closed";
var collapse = "dx-datagrid-group-opened";
if ($($event.target).hasClass(expand)) {
$scope.gridInstance.expandAll(-1);
$($event.target).removeClass(expand);
$($event.target).addClass(collapse);
} else {
$scope.gridInstance.collapseAll(-1);
$($event.target).removeClass(collapse);
$($event.target).addClass(expand);
}
};
var initData = function () {
$scope.differenceList = [];
$scope.reasonList = [];
// getService.getDifferenceList();
// getService.getReasonList();
};
......
......@@ -2,33 +2,16 @@
<div class="content">
<div class="col-lg-12 col-md-12" style="margin-top:10px;">
</div>
<div class="col-lg-24 col-md-24 fit-height">
<table border="1" width="95%" style="margin: auto">
<thead>
<tr class="th">
<th>会计科目</th>
<th>明细字段</th>
<th>金额</th>
<th>差异</th>
<th>差异原因</th>
</tr>
</thead>
<tbody >
<tr ng-repeat="x in list">
<td>{{}}</td>
<td>{{}}</td>
<td>{{}}</td>
<td>{{}}</td>
<td>{{}}</td>
</tr>
</tbody>
</table>
<div class="col-lg-12 col-md-12 fit-height">
<div class="col-lg-4 col-md-4">
<div dx-tree-list="grid.differenceOptions" dx-item-alias="item">
</div>
</div>
<style>
.th>th{
width : 15%;
text-align: center;
}
</style>
<div class="col-lg-8 col-md-8">
<div dx-tree-list="grid.reasonOptions" id="reason"></div>
</div>
</div>
</div>
</div>
......@@ -11,6 +11,7 @@
$scope.totalTaxAmount = 0;
var minDate = [1, vatSessionService.project.year];
// var minDate = moment().startOf('month').subtract(0, 'months');
var maxDate = [12, vatSessionService.project.year];
var setDate = [
[vatSessionService.month, vatSessionService.project.year],
......@@ -108,6 +109,7 @@
vatPreviewService.queryInputInvoiceList($scope.queryParams).success(function (data) {
if (data) {
// minDate = data.
var index = 1;
data.list.forEach(function (v) {
v.index = index++;
......
......@@ -8,7 +8,7 @@
data-templateurl="/app/vat/preview/vat-preview-input-invoice/vat-preview-input-invoice-search.html">
<i class="fa fa-filter" aria-hidden="true"></i>
</button>-->
<div></div><div></div>
<span translate="IncomeInvoiceTitle" class="text-bold"></span> &nbsp;&nbsp;|&nbsp;&nbsp;<span class="text-bold" translate="InvoiceQJ"></span>
<input type="text" class="form-control input-width-middle" style="position: relative; top: -33px; left: 160px;" id="input-invoice-period-picker" />
......
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