Commit 6502d902 authored by sherlock's avatar sherlock

Merge branch 'dev_oracle_sherlock' into 'dev_oracle'

Dev oracle sherlock

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