Commit f0f58b8d authored by zhkwei's avatar zhkwei

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

parents 6cd4617b 60e4a4d3
......@@ -12,3 +12,13 @@ rebel.xml
**/.idea/
atms-api/~
/bin/
/atms-api/src/main/resources/conf/conf_profile_dev_local.properties
/atms-api/pom.xml
atms-web/src/main/webapp/package-lock.json
atms-web/src/main/webapp/package.json
......@@ -477,6 +477,7 @@
<env>uat</env>
</properties>
</profile>
</profiles>
<build>
......
package pwc.taxtech.atms.common;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.util.stream.Collectors;
......@@ -8,7 +9,12 @@ import org.apache.commons.io.IOUtils;
import org.nutz.lang.Lang;
import org.springframework.core.io.ClassPathResource;
import pwc.taxtech.atms.common.message.ErrorMessage;
import pwc.taxtech.atms.dpo.EnterpriseAccountSetOrgDto;
import pwc.taxtech.atms.exception.ServiceException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
public class CommonUtils {
public static final int BATCH_NUM = 500;
......@@ -155,4 +161,34 @@ public class CommonUtils {
}
/**
* 输出文件流 下载
*/
public static void FileOut(HttpServletResponse response, InputStream inputStream, String fileName){
response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition", "attachment;fileName=" + fileName + ".xlsx");
ServletOutputStream out = null;
try {
out = response.getOutputStream();
int b = 0;
byte[] buffer = new byte[512];
while ((b = inputStream.read(buffer)) > 0) {
out.write(buffer, 0, b);
}
inputStream.close();
} catch (IOException e) {
e.printStackTrace();
e.printStackTrace();
throw new ServiceException(ErrorMessage.SystemError);
} finally {
try {
out.close();
out.flush();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
......@@ -9,11 +9,16 @@ package pwc.taxtech.atms.common.util;
**/
import com.google.common.collect.Lists;
import org.apache.poi.ss.usermodel.Workbook;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngineConfiguration;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.streaming.SXSSFSheet;
import org.nutz.http.Http;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sun.misc.BASE64Encoder;
import javax.servlet.ServletContext;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
......@@ -69,7 +74,7 @@ public class FileExcelUtil {
* @param path
* @throws IOException
*/
public static File craeteZipPath(String path) throws IOException {
public static File createZip(String path) throws IOException {
ZipOutputStream zipOutputStream = null;
File file = new File(path + DateUtils.nowDateFormat() + ".zip");
zipOutputStream = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(file)));
......@@ -102,7 +107,6 @@ public class FileExcelUtil {
}
/**
* 设置下载excel的响应头信息
*
......@@ -158,7 +162,7 @@ public class FileExcelUtil {
* @param workbook
* @time 2018年6月25日11:47:07
*/
private void downloadExcel(HttpServletRequest request, HttpServletResponse response, String fileName, Workbook workbook) {
public static void downloadExcel(HttpServletRequest request, HttpServletResponse response, String fileName, Workbook workbook) {
//一个流两个头
//设置下载excel的头信息
FileExcelUtil.setExcelHeadInfo(response, request, fileName);
......@@ -191,23 +195,20 @@ public class FileExcelUtil {
* 生成excel到指定路径
*
* @param wb
* @Param path 文件路径,包括zip文件夹路径
* @throws Exception
* @Param path 文件路径,包括zip文件夹路径
*/
public static File generateExcelToPath(Workbook wb, String path) throws Exception {
/* String[] pathArr = path.split("\\\\");
String zipDir = pathArr[0];
FileExcelUtil.createFile(zipDir);*/
File file = new File(path);
public static File generateExcelToPath(Workbook wb, String fileNamet) throws Exception {
File file = new File(fileNamet);
FileOutputStream fos = null;
try {
fos = new FileOutputStream(file);
wb.write(fos);
return file;
}catch (Exception e ){
} catch (Exception e) {
e.printStackTrace();
return null;
}finally {
} finally {
if (fos != null) {
fos.flush();
fos.close();
......@@ -225,18 +226,18 @@ public class FileExcelUtil {
* @param response
* @param zipName 下载的zip名
* @param files 要打包的批量文件
* @param zipPath 生成的zip路径
* @param zipDir 存放zip文件的文件夹路径
* @throws Exception
*/
public static synchronized void downloadZip(HttpServletRequest request, HttpServletResponse response, String zipName, List<File> files, String zipPath) throws Exception {
public static synchronized void downloadZip(HttpServletRequest request, HttpServletResponse response, String zipName, List<File> files, String zipDir) throws Exception {
//ZIPPATH = this.getClass().getResource("/").getPath().substring(1) + "zipDir";
FileExcelUtil.createFile(zipDir);// 先生成存放zip文件的文件夹
String zipPath = zipDir + "/" + Math.random() + ".zip";
File srcfile[] = new File[files.size()];
File zip = new File(zipPath);
for (int i = 0; i < files.size(); i++) {
srcfile[i] = files.get(i);
}
//生成.zip文件;
//File zip = craeteZipPath(zipPath);
FileInputStream inStream = null;
ServletOutputStream os = null;
try {
......@@ -310,4 +311,65 @@ public class FileExcelUtil {
// 目录此时为空,可以删除
return dir.delete();
}
/**
* 删除列
* @param sheet
* @param columnToDelete
* @param cols 制定哪些行不进行列偏移
*/
public static void deleteColumn(Sheet sheet, int columnToDelete, List<Integer> cols) {
for (int rId = 0; rId <= sheet.getLastRowNum(); rId++) {
Row row = sheet.getRow(rId);
for (int cID = columnToDelete; cID <= row.getLastCellNum(); cID++) {
Cell cOld = row.getCell(cID);
if (cOld != null) {
row.removeCell(cOld);
}
Cell cNext = row.getCell(cID + 1);
if (cNext != null) {
Cell cNew = row.createCell(cID, cNext.getCellTypeEnum());
if(cols.contains(cID))
continue;
cloneCell(cNew, cNext);
//Set the column width only on the first row.
//Other wise the second row will overwrite the original column width set previously.
if (rId == 0) {
sheet.setColumnWidth(cID, sheet.getColumnWidth(cID + 1));
}
}
}
}
}
/**
* 右边列左移
* @param cNew
* @param cOld
*/
public static void cloneCell(Cell cNew, Cell cOld) {
try{
cNew.setCellComment(cOld.getCellComment());
cNew.setCellStyle(cOld.getCellStyle());
String stringCellValue = cOld.getStringCellValue();
if("".equals(stringCellValue))
return;
if (CellType.BOOLEAN == cNew.getCellTypeEnum()) {
cNew.setCellValue(cOld.getBooleanCellValue());
} else if (CellType.NUMERIC == cNew.getCellTypeEnum()) {
cNew.setCellValue(cOld.getNumericCellValue());
} else if (CellType.STRING == cNew.getCellTypeEnum()) {
cNew.setCellValue(cOld.getStringCellValue());
} else if (CellType.ERROR == cNew.getCellTypeEnum()) {
cNew.setCellValue(cOld.getErrorCellValue());
} else if (CellType.FORMULA == cNew.getCellTypeEnum()) {
cNew.setCellValue(cOld.getCellFormula());
}
}catch (Exception e){
logger.warn("数据转换异常", e.getMessage());
}
}
}
\ No newline at end of file
......@@ -61,7 +61,7 @@ public class FileTypesController {
@ResponseBody
public Map<String,String> query4SelectionBox(){
List<FileTypes> fileTypes = fileTypesService.query4SelectionBox();
Map<String,String> result = fileTypes.stream().collect(Collectors.toMap(FileTypes::getFileType,FileTypes::getFileAttr));
Map<String,String> result = fileTypes.stream().distinct().collect(Collectors.toMap(FileTypes::getFileType,FileTypes::getFileAttr));
return result;
}
......@@ -73,7 +73,7 @@ public class FileTypesController {
@ResponseBody
public Map<String,String> query4SelectionBoxEnable(){
List<FileTypes> fileTypes = fileTypesService.query4SelectionBoxEnable();
Map<String,String> result = fileTypes.stream().collect(Collectors.toMap(FileTypes::getFileType,FileTypes::getFileAttr));
Map<String,String> result = fileTypes.stream().distinct().collect(Collectors.toMap(FileTypes::getFileType,FileTypes::getFileAttr));
return result;
}
......
......@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.message.ErrorMessage;
import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.constant.enums.EnumAnalysisImportType;
......@@ -359,15 +360,9 @@ public class TemplateController extends BaseController {
}
}
}
List<PeriodTemplate> templates = Lists.newArrayList();
if (projectId == null || "".equals(projectId)) {
templates = templateService.getTemplates(templateId);
} else {
templates = templateService.getPeriodTemplates(templateId, period, projectId);
}
List<Template> templates = templateService.getTL(templateId);
MyAsserts.assertNotEmpty(templates, new NotFoundException());
PeriodTemplate template = templates.get(0);
Template template = templates.get(0);
String templatePath = template.getPath();
MyAsserts.assertNotEmpty(templatePath, new NotFoundException());
filePath = this.getClass().getResource("").toURI().getPath();
......@@ -519,35 +514,18 @@ public class TemplateController extends BaseController {
@RequestMapping(value = "file/downloadAnalysisTemplate", method = RequestMethod.GET)
public void analysisFileDownload(@RequestParam Integer fileType, HttpServletResponse response) {
//获取网站部署路径(通过ServletContext对象),用于确定下载文件位置,从而实现下载
String fileName = "";
fileName = EnumAnalysisImportType.getNameByCode(fileType);
String fileName = EnumAnalysisImportType.getNameByCode(fileType);
if (StringUtils.isEmpty(fileName)) {
throw new ServiceException(ErrorMessage.SystemError);
}
response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition", "attachment;fileName=" + fileName + ".xlsx");
ServletOutputStream out;
try {
InputStream inputStream = this.getClass().getResourceAsStream("/document/AnalysisImport/" + fileName + ".xlsx");
out = response.getOutputStream();
int b = 0;
byte[] buffer = new byte[512];
while (b != -1) {
b = inputStream.read(buffer);
out.write(buffer, 0, b);
}
inputStream.close();
out.close();
out.flush();
} catch (Exception e) {
logger.error(String.format("下载分析导入模板异常:%s", e.getMessage()));
throw new ServiceException(ErrorMessage.SystemError);
}
CommonUtils.FileOut(response, inputStream, fileName);
}
@ResponseBody
@RequestMapping(value = "upload", method = RequestMethod.POST)
public OperationResultDto upload(@RequestParam MultipartFile file, @RequestParam String projectId, @RequestParam Integer period) {
public OperationResultDto upload(@RequestParam MultipartFile file, @RequestParam String
projectId, @RequestParam Integer period) {
try {
ReportUpload data = new ReportUpload();
data.setProjectId(projectId);
......
......@@ -13,7 +13,7 @@ import java.io.Serializable;
public class RequestParameterDto implements Serializable {
private String jsonString;//excel传过来的数据 已经被序列化成字符串了
private Integer specialConsiderations;
private String specialConsiderations;
private String ebitRate;
public String orgId;
......@@ -30,11 +30,11 @@ public class RequestParameterDto implements Serializable {
this.jsonString = jsonString;
}
public Integer getSpecialConsiderations() {
public String getSpecialConsiderations() {
return specialConsiderations;
}
public void setSpecialConsiderations(Integer specialConsiderations) {
public void setSpecialConsiderations(String specialConsiderations) {
this.specialConsiderations = specialConsiderations;
}
......
......@@ -548,6 +548,8 @@ public class AnalysisServiceImpl extends BaseService {
if (isSheetEmpty(sheet)) continue;
List<AnalysisInternationalBusinessData> lists = Lists.newArrayList();
for (int j = 1; j <= sheet.getLastRowNum(); j++) {
if(j>2)
break;
AnalysisInternationalBusinessData model = new AnalysisInternationalBusinessData();
model.setId(idService.nextId());
model.setPeriod(selectedPer);
......
......@@ -2,6 +2,7 @@ package pwc.taxtech.atms.service.impl;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -45,6 +46,7 @@ public class FileTypesServiceImpl {
/**
* 查询档案属性和档案类型给前端下拉选择框
*
* @return
*/
public List<FileTypes> query4SelectionBox() {
......@@ -54,6 +56,8 @@ public class FileTypesServiceImpl {
@Transactional
public boolean addFileTypesList(FileTypes fileTypes) {
try {
//检测添加类型是否已存在,存在则返回false先(后期改进为多异常)
checkFileType(fileTypes);
//对必填字段进行转换成json对象
requiredFieldFormatToJson(fileTypes);
//设置当前时间 当前创建人信息
......@@ -77,11 +81,29 @@ public class FileTypesServiceImpl {
return false;
}
} catch (Exception e) {
// log.error("FileTypesServiceImpl addFileTypesList error : " + e.getMessage());
log.error("FileTypesServiceImpl addFileTypesList error : " + e.getMessage());
return false;
}
}
/**
* //检测添加类型是否已存在,存在则返回false先(后期改进为多异常)
*
* @param fileTypes
* @return
*/
private void checkFileType(FileTypes fileTypes) {
FileTypesExample example = new FileTypesExample();
FileTypesExample.Criteria criteria = example.createCriteria();
if (StringUtils.isNotBlank(fileTypes.getFileType())) {
criteria.andFileTypeEqualTo(fileTypes.getFileType());
}
List<FileTypes> results = fileTypesMapper.selectByExample(example);
if (results.size() > 0) {
throw new RuntimeException("filetype已存在: " + fileTypes.getFileType());
}
}
@Transactional
public boolean deleteFileTypes(Long id) {
try {
......@@ -100,7 +122,7 @@ public class FileTypesServiceImpl {
return false;
}
} catch (Exception e) {
// log.error("FileTypesServiceImpl deleteFileTypes error : " + e.getMessage());
log.error("FileTypesServiceImpl deleteFileTypes error : " + e.getMessage());
return false;
}
}
......@@ -108,6 +130,8 @@ public class FileTypesServiceImpl {
@Transactional
public boolean editFilesType(FileTypes fileTypes) {
try {
//检测添加类型是否已存在,存在则返回false先(后期改进为多异常)
checkFileType(fileTypes);
//对必填字段进行转换成json对象
requiredFieldFormatToJson(fileTypes);
fileTypes.setUpdateTime(new Date());
......@@ -128,7 +152,7 @@ public class FileTypesServiceImpl {
return false;
}
} catch (Exception e) {
// log.error("FileTypesServiceImpl editFilesType error : " + e.getMessage());
log.error("FileTypesServiceImpl editFilesType error : " + e.getMessage());
return false;
}
}
......@@ -160,6 +184,7 @@ public class FileTypesServiceImpl {
fileTypes.setRequiredFieldJson(requiredFieldJson);
}
}
public List<FileTypes> query4SelectionBoxEnable() {
return fileTypesMapper.query4SelectionBoxEnable();
}
......
......@@ -128,6 +128,11 @@ public class TemplateServiceImpl extends AbstractService {
example.createCriteria().andTemplateIdEqualTo(templateId);
return periodTemplateMapper.selectByExample(example);
}
public List<Template> getTL(Long templateId){
TemplateExample example = new TemplateExample();
example.createCriteria().andIdEqualTo(templateId);
return templateMapper.selectByExample(example);
}
public String getTemplatePath(Long templateId) {
......
jdbc_url=jdbc:mysql://10.88.128.65:8806/fintax_stage?useUnicode=true&amp;characterEncoding=utf-8&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true&amp;useSSL=false
jdbc_user=fintax_user_stage
jdbc_password=Fintaxuser@123Stage
jdbc_url=jdbc:mysql://172.20.2.218:3300/fintax_test_2?useUnicode=true&amp;characterEncoding=utf-8&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true&amp;useSSL=false
jdbc_user=fintax_user_test2
jdbc_password=Fintaxuser@123Test2
#jdbc_password=111111
jdbc_admin_db=taxadmin2018
......@@ -15,7 +16,7 @@ mail_jdbc_url=jdbc:sqlserver://192.168.1.102:1434;DatabaseName=MAILMaster
mail_jdbc_user=sa
mail_jdbc_password=atmsunittestSQL
web.url=http://dts.erp.didichuxing.com
web.url=http://dts-test.erp.didichuxing.com
#web.url=*
jwt.base64Secret=TXppQjFlZFBSbnJzMHc0Tg==
jwt.powerToken=xxxx
......@@ -33,7 +34,7 @@ max_file_length=104857600
distributed_id_datacenter=10
distributed_id_machine=16
api.url=http://dts.erp.didichuxing.com
api.url=http://dts-test.erp.didichuxing.com
# Longi config
longi_api_basic_user=
......@@ -59,7 +60,7 @@ org_sync_token=174af08f
dd_pubkey=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKUfMPRKV6I5num1dDWcxTrgTjXf5LctsVj0CpbwHE83mmjUO5CAlvA0Fwy30ajCX5sLmsyi+Eu/4uNmM6GQF3kCAwEAAQ==
ebs_call_url=http://172.20.201.201:8020/ebs-proxy-test/dts/glMonthlyBal?pageNum=1&pageSize=1000&ledgerId=2021&companyCode=120200&period=2018-11
ebs_call_url=http://172.20.201.201:8020/ebs-proxy-test/dts
#tableau config
tableau_get_ticket=http://47.94.233.173:16010/trusted?username=%s
......
This diff is collapsed.
......@@ -81,6 +81,7 @@ grunt.initConfig({
},
contentCss: {
src: ["Content/bootstrap.css",
"Content/bootstrap-select.min.css",
"Content/bootstrap-switch/bootstrap3/bootstrap-switch.css",
"Content/dx.common.css",
"Content/dx.light.css",
......@@ -209,6 +210,7 @@ grunt.initConfig({
"Scripts/bootstrap-multiselect.js",
"Scripts/bootstrap-datepicker/bootstrap-datepicker.js",
"Scripts/locales/bootstrap-datepicker.zh-CN.min.js",
"Scripts/bootstrap-select.min.js",
"Scripts/respond.js"],
dest: '<%= pkg.bundleTemp %>/bootstrap.js'
},
......
This diff is collapsed.
......@@ -892,7 +892,7 @@
"Form":"表格",
"DomesticDataImport":"国内数据",
"InternationalDataImport":"国际税数据",
"TBEBITForm":"TB EBIT 表格",
"TBEBITForm":"TP EBIT 表格",
"ClickEnsureTip": "请点击确定按钮!",
"MenuUnreturnedTax": "未返还税金分析",
"MenuTaxComparison": "未返还/返还后税金比较",
......
......@@ -49,8 +49,6 @@
$scope.selectCountry = '';
$scope.internationalDataList = constant.internationalDataList;
$scope.countryList = constant.countryCNList;
var date = new Date();
var year = date.getFullYear();
var month = date.getMonth() + 1;
......@@ -133,30 +131,10 @@
constant.anlTemplateNameList.forEach(function (m) {
if (m.code === $scope.importType) {
fileName = m.name;
PWC.downloadCallBack(data, status, headers, fileName)
}
});
var octetStreamMime = 'application/octet-stream';
var contentType = headers('content-type') || octetStreamMime;
if (window.navigator.msSaveBlob) {
var blob = new Blob([data], {
type: contentType
});
navigator.msSaveBlob(blob, fileName);
} else {
var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;
if (urlCreator) {
var a = document.createElement('a');
var blob = new Blob([data], {
type: contentType
});
var url = urlCreator.createObjectURL(blob);
a.href = url;
a.target = '_blank';
a.download = fileName + ".xlsx";
document.body.appendChild(a);
a.click();
}
}
}).error(function () {
SweetAlert.error($translate.instant('PleaseContactAdministrator'));
});
......@@ -195,12 +173,12 @@
}
if (!$scope.selectCountry || '' === $scope.selectCountry) {
SweetAlert.warning($translate.instant('PleaseSelectFileFirst'));
SweetAlert.warning($translate.instant('PleaseSelectCountryFirst'));
return;
}
if (!$scope.selectCompany || '' === $scope.selectCompany) {
SweetAlert.warning($translate.instant('PleaseSelectFileFirst'));
SweetAlert.warning($translate.instant('PleaseSelectCompanyFirst'));
return;
}
......@@ -563,21 +541,13 @@
$scope.setGridStyle = setGridStyle;
};
var initCompanyList = function () {
orgService.getOrgListByUserId().success(function (data) {
if (data) {
$scope.companyList = data;
}
});
};
$scope.selectCompanyEvent = function (i) {
$scope.selectCompany = i.name;
refreshGrid();
};
$scope.selectCountryEvent = function (country) {
$scope.selectCountry = country;
$scope.selectCountryEvent = function () {
////$scope.selectCountry = country;
refreshGrid();
};
......@@ -651,31 +621,40 @@
};
/*------------------------------kevin insert ----------------------------------------------------------------*/
//机构下拉设置
$scope.selectOrgOptions = {
displayExpr: 'name',
valueExpr: 'id',
bindingOptions: {
value: 'relation._orgId',
dataSource: 'companyList'
},
height: '30px',
placeholder: $translate.instant('PleaseSelected'),
showClearButton: true,
searchEnabled: true,
noDataText: $translate.instant('RevenueNoOrgData'),
showSelectionControls: false,
onInitialized : function(e){
},
onItemClick: function (e) {
loadCellData($scope.relation.period, e.itemData.id,function(){
$scope.relation.orgId = e.itemData.id;
$scope.relation.orgName = e.itemData.name;
var initCompanyList = function () {
orgService.getOrgListByUserId().success(function (data) {
var joinText = "";
if (data) {
if (data) {
for (var a = 0; a < data.length; a++) {
joinText += "<option value =" + data[a].id + " style ='text-align: left;' >" + data[a].name + "</option>";
}
$('#orgList').html(joinText);
$('#orgList').selectpicker('refresh');
}
}
});
};
$('#orgList').on('changed.bs.select', function (e, clickedIndex, isSelected, value) {
$scope.selectCompany = e.currentTarget[clickedIndex].value;
});
$('#contryList').on('changed.bs.select', function (e, clickedIndex, isSelected, value) {
$scope.selectCountry = e.currentTarget[clickedIndex].value;
});
var initContryList = function(){
var joinText = "";
if(constant.countryCNList){
for(var i =0; i< constant.countryCNList.length; i++){
joinText += "<option value =" + constant.countryCNList[i]+ " style ='text-align: left;' >" + constant.countryCNList[i] + "</option>";
}
$('#contryList').html(joinText);
$('#contryList').selectpicker('refresh');
}
};
$('#orgList').on('shown.bs.select', function(){
$(this).find('.dropdown-menu').width("200px");
});
/*------------------------------------------------------------------------------------------------------------*/
//开始
......@@ -686,6 +665,7 @@
getUserPermission();
initDatePicker();
initCompanyList();
initContryList();
$scope.$watch('importExcelFile', function (newValue, oldValue) {
if (newValue !== null && newValue !== oldValue) {
......
......@@ -10,9 +10,10 @@
<!--导航栏-->
<div id="tab_total">
<form class="form-inline" id="navigationForm" name="navigationForm">
<div class="form-group" ng-style="setButtonWrapStyle()">
<div class="form-group" ng-style="setButtonWrapStyle()" style="width:100%;">
<div class="import-wrapper" style="margin-left: 17px;">
<div class="row">
<div class="row" style="margin-top: 10px;">
<div class="col-sm-6" style="padding-left: 0px!important;">
<span class="text-bold" translate="SelectedImportType"></span>:
<div class="dropdown" style="margin-left:10px">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu2"
......@@ -34,7 +35,8 @@
readonly="readonly" ng-model="UploadPeriodTime"/>
<i class="fa fa-calendar imp-subheader red-color" style="width:20px;"></i>
</div>
</div>
<div class="col-sm-5 rightNav" style="width:46%;padding-left: 0px; left: 20%;">
<button type="button"
ngf-select="" type="file" ng-model="importExcelFile" ngf-drag-over-class="'dragover'" accept=".xls,.xlsx" ngf-multiple="false"
ngf-allow-dir="false" class="btn btn-vat-third" >
......@@ -56,9 +58,11 @@
translate="ExportBtn"
ng-click="doExport()"></button>
</div>
</div>
<div class="row" style="margin-top: 10px;">
<span class="text-bold" translate="Country"></span>:
<div class="dropdown" style="margin-left:10px">
<span class="text-bold" translate="Country">:</span>
<!-- <div class="dropdown" style="margin-left:10px">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu3"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 150px;margin-left: 28px;">
{{selectCountry ? ((selectCountry)|translate):('PleaseSelect' | translate)}}
......@@ -71,9 +75,35 @@
</div>
</li>
</ul>
</div>
<span class="text-bold" translate="Company"></span>:
<div class="dropdown" style="margin-left:38px">
</div>-->
<!-- <div dx-tag-box="selectOrgOptionsContry" style="width: 287px;display: inline-block"></div>-->
<select class="selectpicker show-tick dropup" multiple data-live-search="true"
data-max-options="1"
data-size="10"
data-style="btn-primary" id ="contryList"
data-header="国家列表"
data-content = "true"
data-none-selected-text = "选择国家"
data-dropdown-align-right ="false"
data-icon-base = "tickIcon"
data-none-results-text ="没有匹配的国家">
</select>
<span class="text-bold" translate="Company">:</span>
<!--<div dx-tag-box="selectOrgOptionsComany" style="width: 287px;display: inline-block"></div>-->
<select class="selectpicker show-tick dropup" multiple data-live-search="true"
data-width="auto" data-max-options="1"
data-size="10"
data-style="btn-primary" id ="orgList"
data-header="公司列表"
data-content = "true"
data-icon-base = "tickIcon"
data-none-selected-text = "选择公司"
data-dropdown-align-right =false
data-none-results-text ="没有匹配的公司">
</select>
<!-- <div class="dropdown" style="margin-left:38px">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu4"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width: 320px;">
{{selectCompany ? ((selectCompany)|translate):('PleaseSelect' | translate)}}
......@@ -86,7 +116,7 @@
</div>
</li>
</ul>
</div>
</div>-->
</div>
</div>
</div>
......
......@@ -109,7 +109,7 @@
.import-wrapper {
span {
margin-left: 10px;
/* margin-left: 10px;*/
color: #333;
font-family: "Microsoft YaHei";
font-style: normal;
......@@ -147,10 +147,10 @@
}
input {
width: 50px;
width:100%;
outline: none;
border-radius: 3px;
border: 1px solid #3c3a36;
/* border: 1px solid #3c3a36;*/
padding: 2px;
text-align: center;
}
......@@ -335,3 +335,9 @@
white-space: nowrap;
}
}
@media screen and (max-width: 1400px) {
.rightNav{
left: 8%!important;
width: 40% !important;
}
}
......@@ -6,7 +6,7 @@
return {
restrict: 'E',
template: '<div class="report" style="height: 100%;"></div>',
template: '<div class="report" style="height: 100%;width: 100%;"></div>',
replace: true,
scope: {
templateId: '=',
......@@ -74,15 +74,15 @@
}
};*/
scope.$watchGroup(['relation.period', 'relation.orgId', 'relation.data'], function (newValue, oldValue) {
/* scope.$watchGroup(['relation.period', 'relation.orgId', 'relation.data'], function (newValue, oldValue) {
if (scope.relation.orgId != null && scope.relation.period != null) {
/* setTimeout(function () {
/!* setTimeout(function () {
if ((scope.relation.broadcast && scope.relation.broadcast == true) || scope.spread != undefined) {
loadSheet(scope.templateId, false)
} else {
loadSheet(scope.templateId, true);
}
}, 200);*/
}, 200);*!/
loadSheet(scope.templateId);
}
});
......@@ -91,11 +91,11 @@
// loadSheet(scope.templateId, false)
loadSheet(scope.templateId)
}
});
});*/
var loadSheet = function (templateId) {
var loadSheet = function (templateId ) {
//var prokjectId = vatSessionService.project.id;
//var period = vatSessionService.month;
/* if (!init) {
......@@ -106,6 +106,8 @@
if(scope.relation.orgId == undefined){
scope.relation.orgId = null;
}
if(templateId == undefined )
return;
return templateService.getPeriodTemplateJsonByOrg(templateId, scope.relation.period, scope.relation.orgId).then(function (reportSpread) {
var spreadCtrl = getSpreadControl();
if (spreadCtrl) {
......@@ -140,6 +142,15 @@
});
}*/
var setColWidth = function(sheet){
for(var i = 0; i < sheet.getColumnCount(); i++){
if(i ==0){
sheet.setColumnWidth(0, 360)
continue
}
sheet.setColumnWidth(i, 180);
}
}
var initSpreadExcel = function (reportSpread) {
var spread = getSpreadControl();
......@@ -182,11 +193,13 @@
sheet.clearSelection();
}
scope.spread = spread;
setColWidth(sheet);
if(sheet.getRowCount() <= 38)
addEbitRow(sheet)
if (scope.templateId && scope.reportSource) {
setData(true);
setData();
}
sheet.setRowResizable(0,false,GC.Spread.Sheets.SheetArea.viewport);
spread.resumePaint();
return $q.when(spread);
};
......@@ -194,7 +207,7 @@
var addEbitRow = function (sheet) {
if (sheet == undefined || sheet == null)
sheet = scope.spread.getActiveSheet();
sheet.setColumnWidth(0, 400)
//添加单元格
if (sheet.getRowCount() > 43)
return;
......@@ -225,6 +238,9 @@
///解锁指定单元格
sheet.getCell(38, 2).locked(false);//特殊因素
sheet.getCell(40, 2).locked(false);//ebit比率
//
sheet.setFormatter( 38, 2,"0.00");
sheet.setFormatter( 40, 2,"0.00");
};
// 每个单元格大致由以下部分构成:_SumAll(_Inter(...)+_Manual(...)+C1)
......@@ -298,12 +314,22 @@
// 根据已有信息通过spreadJS计算各单元格的值
var setData = function (init) {
var setData = function (upload) {
var sheet = scope.spread.sheets[0];
/* if (!init && scope.relation.broadcast == true) {
scope.relation.loadEbitCell(sheet);
return;
}*/
if(upload){ //上传上来的文件也要动态添加行
addEbitRow(sheet);
scope.relation.loadEbitCell(sheet);
lockCell(scope.spread);
setColWidth(sheet);
scope.spread.resumePaint();
return
}else{
scope.relation.loadEbitCell(sheet);
}
if (angular.isArray(scope.reportSource)) {
//spreadJsTipService.initialize(sheet);
......@@ -313,7 +339,6 @@
}*/
scope.spread.suspendPaint();
scope.relation.loadEbitCell(sheet);
/* if (scope.reportSource.length == 0 && scope.relation.emptyData && scope.relation.emptyData == true) {
_init(scope.templateId, true);///如果没有数据,需要重新加载
lockCell(scope.spread);
......@@ -321,7 +346,6 @@
}
*/
scope.reportSource.forEach(function (data) {
scope.relation.emptyData == true;
//fix bug11737 导出需要显示千分位
// 避免直接使用data.value = parseFloat(data.value)导致非数字型value无法显示
data.value = PWC.tryParseStringToNum(data.value);
......@@ -349,6 +373,9 @@
}
};
scope.relation.setData = setData;//绑定单元格数据设置
scope.relation.loadSheet = loadSheet;//绑定单元格加载
(function initialize() {
loadSheet(scope.templateId);
})();
......
<div class="vat-report-view">
<div class="vat-report-view" style="overflow-y: scroll">
<!--Report SpreadJS-->
<div class="row" style=" height: 53px; background: #ccc;">
<div class="col-sm-7" style=" margin-top: 10px;">
<div class="row" style=" height: 53px; background: #f5f5f5;">
<div class="col-sm-7 navLeft " style=" margin-top: 10px;">
<div class="col-sm-8">
<span class="text-bold" translate="SelectedOrganization" style=" top: -7px; display: inline!important; position: relative; ">:</span>
<span class="text-bold" translate="SelectedOrganization"></span><span>:</span>
<!-- <div id="dx-select-industry" class="tab-content-select industry " style=" display: inline-block;"
dx-select-box="dataSourceIndustryList" dx-item-alias="itemObj">
<div data-options="dxTemplate: { name: 'orgList' }" class="dx-item-content dx-list-item-content"
......@@ -11,18 +11,29 @@
{{itemObj.code}}-{{itemObj.name}}
</div>
</div>-->
<div dx-tag-box="selectOrgOptions" style="width: 287px;display: inline-block"></div>
</div>
<div class="col-sm-4" class="dateClass">
<span class="text-bold" translate="InvoiceQJ">:</span>
<!-- <div dx-tag-box="selectOrgOptions" style="width: 287px;display: inline-block"></div>-->
<!--data-max-options 可以选择几个值-->
<select class="selectpicker show-tick dropup" multiple data-live-search="true"
data-width="50%" data-max-options="1"
data-size="10"
data-style="btn-primary" id ="orgList"
data-header="机构列表"
data-content = "true"
data-none-selected-text = "选择机构"
data-dropdown-align-right = "auto"
data-none-results-text ="没有匹配的机构">
</select>
</div>
<div class="col-sm-4 col-sm-pull-3 datePull" >
<span class="text-bold" translate="InvoiceQJ"></span>:
<div style=" display: inline-block;">
<input type="text" id="ebitDatepacker" class="datepicker" style="width:120px;height: 34px;"
readonly="readonly"/>
<i class="fa fa-calendar vat-subheader red-color" style="width:20px;"></i>
<i class="fa fa-calendar vat-subheader red-color" style="width:20px;position: relative;left: -23px;"></i>
</div>
</div>
</div>
<div class="col-sm-5" class="bar-export navRight" style=" margin-top: 20px;width: 30%;; float: right;">
<div class="col-sm-5 bar-export navRight" style=" margin-top: 20px;width: 30%; float: right;">
<span ngf-select="" ngf-change="upload($files)" accept=".xls,.xlsx" ngf-multiple="false"
ngf-allow-dir="false" class="" ><i class="fa fa-file">&nbsp;{{'uploadProfileTable' | translate}}</i></span>
<span ng-click="saveAndRefresh()"><i class="fa fa-refresh"></i>&nbsp;{{'saveAndRefresh' | translate}}</span>
......
......@@ -112,7 +112,20 @@
@media screen and (max-width:1400px) {
.navRight{
width: 40%!important;
width: 33%!important;
}
.navLeft{
width: 60%!important;
}
.datePull{
right: 8.33333333%!important;
}
}
@media screen and (min-width:1400px) {
.navRight{
right: -7%!important;
}
}
\ No newline at end of file
......@@ -7,7 +7,6 @@
, vatSessionService, enums, vatOperationLogService
, projectService, vatCommonService,orgService,templateService) {
'use strict';
var comment = vatSessionService.project.name + " " + vatSessionService.project.year + "年" + vatSessionService.month + "月";
$scope.period = $scope.periodId;
$scope.moduleid = enums.vatModuleEnum.Import_TrialBalance;
......
......@@ -149,10 +149,10 @@
}
input {
width: 50px;
width: 100%;
outline: none;
border-radius: 3px;
border: 1px solid #3c3a36;
/* border: 1px solid #3c3a36;*/
padding: 2px;
text-align: center;
}
......
......@@ -1160,5 +1160,30 @@
};
/------------------------------------------------kevin insert -----------------------------------/
PWC.downloadCallBack = function(data,status, headers, fileName){
var octetStreamMime = 'application/octet-stream';
var contentType = headers('content-type') || octetStreamMime;
if (window.navigator.msSaveBlob) {
var blob = new Blob([data], {
type: contentType
});
navigator.msSaveBlob(blob, fileName);
} else {
var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;
if (urlCreator) {
var a = document.createElement('a');
var blob = new Blob([data], {
type: contentType
});
var url = urlCreator.createObjectURL(blob);
a.href = url;
a.target = '_blank';
a.download = fileName + ".xlsx";
document.body.appendChild(a);
a.click();
}
}
}
/*-----------------------------------------------------------------------------------------*/
})(window)
\ No newline at end of file
webservices.factory('vatReportService', ['$q', '$log', '$http', '$translate', 'apiConfig', 'enums', 'SweetAlert', 'vatOperationLogService',
'vatSessionService','FileSaver',
'vatSessionService', 'FileSaver',
function ($q, $log, $http, $translate, apiConfig, enums, SweetAlert, vatOperationLogService, vatSessionService, FileSaver) {
'use strict';
$log.debug('vatReportService.ctor()...');
......@@ -64,18 +64,25 @@
var param = {
reportId: reportId,
period: period,
orgId : orgId
orgId: orgId
}
param = JSON.stringify(param);
return $http.post('/Report/reportEbitData',param, apiConfig.createVat({ contentType:"application/json"}));
} ,
manyExport : function(param){
return $http.post('/Report/manyExport', param, apiConfig.createVat({responseType: 'arraybuffer'})).then(function (response) {
return $http.post('/Report/reportEbitData', param, apiConfig.createVat({contentType: "application/json"}));
},
manyExport: function (param) {
var toParam = JSON.stringify(param);
return $http.post('/Report/manyExport', toParam, apiConfig.createVat({responseType: 'arraybuffer'})).then(function (response) {
if(response.status == 204){
SweetAlert.error("当前期间没有可导出的数据");
return
}
var a = document.createElement('a');
var blob = new Blob([response.data], {'type':"application/octet-stream" });
var data = new Blob([response.data], {type: response.headers('Content-Type')});
//FileSaver.saveAs(data, '利润表.zip');
a.href = URL.createObjectURL(blob);
a.download = "利润表.zip";
a.href = URL.createObjectURL(data);
a.download = param.period + "-汇总利润表.xlsx";
a.click();
});
}
......@@ -83,11 +90,11 @@
saveAndRefresh: function (orgId, period, specialConsiderations, ebitRate) {
var paramObj = {
orgId: orgId,
period : period,
specialConsiderations : specialConsiderations,
ebitRate : ebitRate
period: period,
specialConsiderations: specialConsiderations,
ebitRate: ebitRate
};
return $http.post('/Report/saveAndRefresh', paramObj , apiConfig.createVat());
return $http.post('/Report/saveAndRefresh', paramObj, apiConfig.createVat());
},
calculateKeyValue: function (projectId, period) {
return $http.post('/Report/calculateKeyValue/' + projectId + '/' + period, {}, apiConfig.createVat({ignoreLoadingBar: true}));
......@@ -234,8 +241,12 @@
if (!_.isNumber(period)) {
period = 0;
}
return $http.get('/Report/getReportByTemplateEbit/' + templateId + '/' + period + '/' + orgId, apiConfig.createVat());
var param = {
templateId: templateId,
period: period,
orgId: orgId
}
return $http.post("/Report/getReportByTemplateEbit", JSON.stringify(param), apiConfig.createVat());
},
getDataSourceDetailList: function (dataSourceId) {
return $http.get('/Report/getDataSourceDetailList/' + dataSourceId, apiConfig.createVat());
......@@ -256,7 +267,7 @@
saveEbitModule: function () {
},
downLoadAttach : function(id){
downLoadAttach: function (id) {
return $http.get('/Report/downLoadAttach?id=' + id, apiConfig.createVat());
}
};
......
......@@ -275,6 +275,20 @@ taxDocumentManageModule.controller('taxDocumentListController',
},
],
onCellClick: function (e) {
//单元格点击— e.columnIndex=0 排除复选框列
if(e.columnIndex>0 && e.data){
$("input[name='dataGridCheckBox']").each(function (index, item) {
if((item.dataset) && (item.dataset.id==e.data.id)){
if(item.checked){
item.checked=false;
}else{
item.checked=true;
}
}
});
}
}
};
$scope.getTableHeight=function(){
var row_height=$("table").find("tr").height();
......@@ -952,7 +966,12 @@ taxDocumentManageModule.directive('multiFileUploader', function () {
if($scope.multiUploadErrorItems.length
|| $scope.uploadResultSuccessList.length)
$("#uploadResultPop").modal("show");
$scope.FileItem.isSuccess=true;//文件上传成功标识
//是否都上传成功
if($scope.multiUploadErrorItems.length>0){
$scope.FileItem.isSuccess=false;
}else{
$scope.FileItem.isSuccess=true;
}
$('#busy-indicator-container').hide();
$scope.loadMainData();
......
This diff is collapsed.
......@@ -7,7 +7,7 @@
"private": true,
"scripts": {},
"dependencies": {
"grunt": "1.0.1",
"grunt": "^1.0.4",
"grunt-cli": "1.2.0"
},
"devDependencies": {
......@@ -15,7 +15,7 @@
"grunt-contrib-concat": "1.0.1",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-cssmin": "^3.0.0",
"grunt-contrib-less": "1.4.1",
"grunt-contrib-less": "^2.0.0",
"grunt-contrib-uglify": "^4.0.0",
"grunt-contrib-watch": "^1.1.0"
}
......
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