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