Commit 1874cb8f authored by Memorydoc's avatar Memorydoc

#

parent 9e466900
...@@ -59,7 +59,7 @@ public class AnalysisJob extends QuartzJobBean { ...@@ -59,7 +59,7 @@ public class AnalysisJob extends QuartzJobBean {
logger.info(String.format("开始分析%s返还后税数据",period)); logger.info(String.format("开始分析%s返还后税数据",period));
analysisJobService.analysisTaxReturnEnd(orgs,period, EnumTbImportType.CoverImport.getCode()); analysisJobService.analysisTaxReturnEnd(orgs,period, EnumTbImportType.CoverImport.getCode());
logger.info(String.format("开始分析%税种税金计算数据",period)); logger.info(String.format("开始分析%s税种税金计算数据",period));
analysisJobService.analysisTax(orgs,period, EnumTbImportType.CoverImport.getCode()); analysisJobService.analysisTax(orgs,period, EnumTbImportType.CoverImport.getCode());
} }
......
package pwc.taxtech.atms.common.util;
import com.google.common.collect.Lists;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.*;
/**
* author kevin
*/
public class DataBaseTableUtil {
private static String url;
private static String username;
private static String password;
private final static String driver = "com.mysql.jdbc.Driver";
static {
InputStream in = null;
in = DataBaseTableUtil.class.getClassLoader().getResourceAsStream("conf/conf.properties");
Properties p = new Properties();
try {
p.load(in);
} catch (IOException e) {
e.printStackTrace();
}
url = p.getProperty("jdbc_url");
username = p.getProperty("jdbc_user");
password = p.getProperty("jdbc_password");
}
/**
* 读取mysql某数据库下表的注释信息
*
* @author xxx
*/
public static Connection getMySQLConnection() throws Exception {
Class.forName(driver);
Connection conn = DriverManager.getConnection(url, username, password);
return conn;
}
/**
* 获取当前数据库下的所有表名称
* @return
* @throws Exception
*/
public static List getAllTableName() throws Exception {
List tables = new ArrayList();
Connection conn = getMySQLConnection();
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SHOW TABLES ");
while (rs.next()) {
String tableName = rs.getString(1);
tables.add(tableName);
}
rs.close();
stmt.close();
conn.close();
return tables;
}
/**
* 获得某表的建表语句
*
* @param tableName
* @return
* @throws Exception
*/
public static Map getCommentByTableName(List tableName) throws Exception {
Map map = new HashMap();
Connection conn = getMySQLConnection();
Statement stmt = conn.createStatement();
for (int i = 0; i < tableName.size(); i++) {
String table = (String) tableName.get(i);
ResultSet rs = stmt.executeQuery("SHOW CREATE TABLE " + table);
if (rs != null && rs.next()) {
String createDDL = rs.getString(2);
String comment = parse(createDDL);
map.put(table, comment);
}
rs.close();
}
stmt.close();
conn.close();
return map;
}
/**
* 获得某表中所有字段的注释
*
* @param tableName
* @return
* @throws Exception
*/
public static void getColumnCommentByTableName(List tableName) throws Exception {
Map map = new HashMap();
Connection conn = getMySQLConnection();
Statement stmt = conn.createStatement();
for (int i = 0; i < tableName.size(); i++) {
String table = (String) tableName.get(i);
ResultSet rs = stmt.executeQuery("show full columns from " + table);
System.out.println("【" + table + "】");
// if (rs != null && rs.next()) {
//map.put(rs.getString("Field"), rs.getString("Comment"));
while (rs.next()) {
// System.out.println("字段名称:" + rs.getString("Field") + "\t"+ "字段注释:" + rs.getString("Comment") );
System.out.println(rs.getString("Field") + "\t:\t" + rs.getString("Comment"));
}
// }
rs.close();
}
stmt.close();
conn.close();
// return map;
}
/**
* 返回注释信息
*
* @param all
* @return
*/
public static String parse(String all) {
String comment = null;
int index = all.indexOf("COMMENT='");
if (index < 0) {
return "";
}
comment = all.substring(index + 9);
comment = comment.substring(0, comment.length() - 1);
return comment;
}
public void main(String[] args) throws Exception {
List tables = getAllTableName();
Map tablesComment = getCommentByTableName(tables);
Set names = tablesComment.keySet();
Iterator iter = names.iterator();
while (iter.hasNext()) {
String name = (String) iter.next();
System.out.println("Table Name: " + name + ", Comment: " + tablesComment.get(name));
}
getColumnCommentByTableName(tables);
}
public static List<String> getTableComment(String tableName) {
List<String> commentComments = Lists.newArrayList();
Connection conn = null;
try {
conn = getMySQLConnection();
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("show full columns from " + tableName);
while (rs.next()) {
commentComments.add(rs.getString("Comment"));
}
} catch (Exception e) {
e.printStackTrace();
}
return commentComments;
}
}
...@@ -124,6 +124,7 @@ public class DateUtils { ...@@ -124,6 +124,7 @@ public class DateUtils {
return null; return null;
} }
} }
/** /**
* 将短时间格式字符串转换为区间格式 yyyyMM * 将短时间格式字符串转换为区间格式 yyyyMM
* *
...@@ -131,7 +132,7 @@ public class DateUtils { ...@@ -131,7 +132,7 @@ public class DateUtils {
* @return * @return
*/ */
public static Integer dateToPeriod(java.util.Date dateDate) { public static Integer dateToPeriod(java.util.Date dateDate) {
if(dateDate==null){ if (dateDate == null) {
return null; return null;
} }
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMM"); SimpleDateFormat formatter = new SimpleDateFormat("yyyyMM");
...@@ -145,34 +146,38 @@ public class DateUtils { ...@@ -145,34 +146,38 @@ public class DateUtils {
* @return * @return
*/ */
public static Integer strToPeriod(String dateStr) { public static Integer strToPeriod(String dateStr) {
dateStr = dateStr.replace(" ",""); dateStr = dateStr.replace(" ", "");
Integer period = null; Integer period = null;
if(dateStr.length()<7){ if (dateStr.length() < 7) {
period = Integer.valueOf(dateStr.substring(0, 4) +"0"+ dateStr.substring(5, 6)); period = Integer.valueOf(dateStr.substring(0, 4) + "0" + dateStr.substring(5, 6));
}else{ } else {
period = Integer.valueOf(dateStr.substring(0, 4) + dateStr.substring(5, 7)); period = Integer.valueOf(dateStr.substring(0, 4) + dateStr.substring(5, 7));
} }
return period; return period;
} }
/** /**
* 将yyyy- 等字符串转换为区间格式 yyyy * 将yyyy- 等字符串转换为区间格式 yyyy
*
* @param dateStr * @param dateStr
* @return * @return
*/ */
public static Integer strToPeriodY(String dateStr) { public static Integer strToPeriodY(String dateStr) {
dateStr = dateStr.replace(" ",""); dateStr = dateStr.replace(" ", "");
Integer period = Integer.valueOf(dateStr.substring(0, 4)); Integer period = Integer.valueOf(dateStr.substring(0, 4));
return period; return period;
} }
/** /**
* 将yyyy- 等字符串转换为区间格式 yyyyMM * 将yyyy- 等字符串转换为区间格式 yyyyMM
*
* @param dateStr * @param dateStr
* @return * @return
*/ */
public static Integer strToPeriodYM(String dateStr) { public static Integer strToPeriodYM(String dateStr) {
dateStr = dateStr.replace("-","").replace(" ","").replace("年","").replace("月",""); dateStr = dateStr.replace("-", "").replace(" ", "").replace("年", "").replace("月", "");
Integer period = Integer.valueOf(dateStr); Integer period = Integer.valueOf(dateStr);
return period; return period;
} }
...@@ -185,7 +190,7 @@ public class DateUtils { ...@@ -185,7 +190,7 @@ public class DateUtils {
* @return * @return
*/ */
public static Integer strToPeriod2(String dateStr) { public static Integer strToPeriod2(String dateStr) {
dateStr = dateStr.replace(" ",""); dateStr = dateStr.replace(" ", "");
Integer period = Integer.valueOf(dateStr); Integer period = Integer.valueOf(dateStr);
return period; return period;
} }
...@@ -223,7 +228,7 @@ public class DateUtils { ...@@ -223,7 +228,7 @@ public class DateUtils {
* @return * @return
*/ */
public static Date strToDate3(String strDate) { public static Date strToDate3(String strDate) {
strDate = "20"+strDate; strDate = "20" + strDate;
SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd");
ParsePosition pos = new ParsePosition(0); ParsePosition pos = new ParsePosition(0);
Date strtodate = formatter.parse(strDate, pos); Date strtodate = formatter.parse(strDate, pos);
...@@ -315,7 +320,7 @@ public class DateUtils { ...@@ -315,7 +320,7 @@ public class DateUtils {
return hour; return hour;
} }
public static Date getZero(){ public static Date getZero() {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date()); calendar.setTime(new Date());
calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.HOUR_OF_DAY, 0);
...@@ -324,10 +329,10 @@ public class DateUtils { ...@@ -324,10 +329,10 @@ public class DateUtils {
return calendar.getTime(); return calendar.getTime();
} }
public static Date getThreeDayZero(){ public static Date getThreeDayZero() {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date()); calendar.setTime(new Date());
calendar.set(Calendar.DAY_OF_MONTH,-3); calendar.set(Calendar.DAY_OF_MONTH, -3);
calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.SECOND, 0);
...@@ -649,17 +654,16 @@ public class DateUtils { ...@@ -649,17 +654,16 @@ public class DateUtils {
return newday; return newday;
} }
public static Integer getNowMonth(){ public static Integer getNowMonth() {
Calendar cale = Calendar.getInstance(); Calendar cale = Calendar.getInstance();
return cale.get(Calendar.MONTH) + 1; return cale.get(Calendar.MONTH) + 1;
} }
public static Integer getNowYear(){ public static Integer getNowYear() {
Calendar cale = Calendar.getInstance(); Calendar cale = Calendar.getInstance();
return cale.get(Calendar.YEAR); return cale.get(Calendar.YEAR);
} }
/** /**
* 取得数据库主键 生成格式为yyyymmddhhmmss+k位随机数 * 取得数据库主键 生成格式为yyyymmddhhmmss+k位随机数
* *
...@@ -713,14 +717,15 @@ public class DateUtils { ...@@ -713,14 +717,15 @@ public class DateUtils {
/** /**
* 获得该月第一天 * 获得该月第一天
*
* @param year * @param year
* @param month * @param month
* @return * @return
*/ */
public static String getFirstDayOfMonth(int year,int month){ public static String getFirstDayOfMonth(int year, int month) {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.set(Calendar.YEAR,year); cal.set(Calendar.YEAR, year);
cal.set(Calendar.MONTH, month-1); cal.set(Calendar.MONTH, month - 1);
int firstDay = cal.getActualMinimum(Calendar.DAY_OF_MONTH); int firstDay = cal.getActualMinimum(Calendar.DAY_OF_MONTH);
cal.set(Calendar.DAY_OF_MONTH, firstDay); cal.set(Calendar.DAY_OF_MONTH, firstDay);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
...@@ -729,20 +734,62 @@ public class DateUtils { ...@@ -729,20 +734,62 @@ public class DateUtils {
/** /**
* 获得该月最后一天 * 获得该月最后一天
*
* @param year * @param year
* @param month * @param month
* @return * @return
*/ */
public static String getLastDayOfMonth(int year,int month){ public static String getLastDayOfMonth(int year, int month) {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.set(Calendar.YEAR,year); cal.set(Calendar.YEAR, year);
cal.set(Calendar.MONTH, month-1); cal.set(Calendar.MONTH, month - 1);
int lastDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH); int lastDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
cal.set(Calendar.DAY_OF_MONTH, lastDay); cal.set(Calendar.DAY_OF_MONTH, lastDay);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
return sdf.format(cal.getTime()); return sdf.format(cal.getTime());
} }
//获取档期那月 前N月的值 N的格式 : 201904
public static Integer getBeforeMonthN(Integer period, Integer N) {
Integer nowYear = period / 100;
Integer nowMonth = period % 100;
if (nowMonth - N < 0) {
nowYear--;
nowMonth = nowMonth - N + 12;
} else {
nowMonth -= N;
}
return Integer.parseInt(String.valueOf(nowYear) + String.valueOf(nowMonth));
}
public static Date convertIntertToDate(Integer period){
SimpleDateFormat format = new SimpleDateFormat("yyyyMM");
try {
return format.parse(String.valueOf(period));
} catch (ParseException e) {
e.printStackTrace();
System.out.println("日期转换失败");
}
return null;
}
public static Date convertStringToDate(String period){
SimpleDateFormat format = new SimpleDateFormat("yyyyMM");
try {
return format.parse(period);
} catch (ParseException e) {
e.printStackTrace();
System.out.println("日期转换失败");
}
return null;
}
public static String getPeriodBegin(int year, int period) { public static String getPeriodBegin(int year, int period) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
...@@ -784,7 +831,7 @@ public class DateUtils { ...@@ -784,7 +831,7 @@ public class DateUtils {
public static String nowDateFormat() { public static String nowDateFormat() {
Date date = new Date(); Date date = new Date();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
return simpleDateFormat.format(date); return simpleDateFormat.format(date);
} }
// /*************************************************************************** // /***************************************************************************
......
...@@ -325,6 +325,8 @@ public class FileExcelUtil { ...@@ -325,6 +325,8 @@ public class FileExcelUtil {
public static void deleteColumn(Sheet sheet, int columnToDelete, List<Integer> cols) { public static void deleteColumn(Sheet sheet, int columnToDelete, List<Integer> cols) {
for (int rId = 0; rId <= sheet.getLastRowNum(); rId++) { for (int rId = 0; rId <= sheet.getLastRowNum(); rId++) {
Row row = sheet.getRow(rId); Row row = sheet.getRow(rId);
if(row == null)
continue;
for (int cID = columnToDelete; cID <= row.getLastCellNum(); cID++) { for (int cID = columnToDelete; cID <= row.getLastCellNum(); cID++) {
Cell cOld = row.getCell(cID); Cell cOld = row.getCell(cID);
if (cOld != null) { if (cOld != null) {
...@@ -355,6 +357,8 @@ public class FileExcelUtil { ...@@ -355,6 +357,8 @@ public class FileExcelUtil {
*/ */
public static void cloneCell(Cell cNew, Cell cOld) { public static void cloneCell(Cell cNew, Cell cOld) {
try { try {
if(cOld == null || cNew == null)
return;;
cNew.setCellComment(cOld.getCellComment()); cNew.setCellComment(cOld.getCellComment());
cNew.setCellStyle(cOld.getCellStyle()); cNew.setCellStyle(cOld.getCellStyle());
try { try {
...@@ -362,7 +366,7 @@ public class FileExcelUtil { ...@@ -362,7 +366,7 @@ public class FileExcelUtil {
if ("".equals(stringCellValue)) if ("".equals(stringCellValue))
return; return;
} catch (Exception e) { } catch (Exception e) {
//do nothing //do nothing
} }
if (CellType.BOOLEAN == cNew.getCellTypeEnum() || CellType.BOOLEAN == cOld.getCellTypeEnum()) { if (CellType.BOOLEAN == cNew.getCellTypeEnum() || CellType.BOOLEAN == cOld.getCellTypeEnum()) {
cNew.setCellValue(cOld.getBooleanCellValue()); cNew.setCellValue(cOld.getBooleanCellValue());
...@@ -382,7 +386,6 @@ public class FileExcelUtil { ...@@ -382,7 +386,6 @@ public class FileExcelUtil {
} }
/** /**
*
* @param cell 获取值的单元格 * @param cell 获取值的单元格
* @param zero 是否将空 或者null转换成 zero * @param zero 是否将空 或者null转换成 zero
* @return * @return
...@@ -412,19 +415,18 @@ public class FileExcelUtil { ...@@ -412,19 +415,18 @@ public class FileExcelUtil {
default: default:
break; break;
} }
if("".equals(cellValue) && zero) if ("".equals(cellValue) && zero)
return BigDecimal.ZERO; return BigDecimal.ZERO;
if(zero){ if (zero) {
try{ try {
return new BigDecimal(cellValue); return new BigDecimal(cellValue);
}catch (Exception e){ } catch (Exception e) {
logger.warn("获取Cell,在值转换成数字的地方出错"); logger.warn("获取Cell,在值转换成数字的地方出错");
return BigDecimal.ZERO; return BigDecimal.ZERO;
} }
} }
return cellValue; return cellValue;
} }
} }
\ No newline at end of file
package pwc.taxtech.atms.common.util;
import java.util.ArrayList;
import java.util.List;
/**
* author kevin
* version 1.0
*/
public class LetterExcelUtil {
public static int excelToNum(String col) { // "AAA"
if (col == null)
return -1;
char[] chrs = col.toUpperCase().toCharArray(); // 转为大写字母组成的 char数组
int length = chrs.length;
int ret = -1;
for (int i = 0; i < length; i++) {
ret += (chrs[i] - 'A' + 1) * Math.pow(26, length - i - 1); // 当做26进制来算 AAA=111 26^2+26^1+26^0
}
return ret;// 702; 从0开始的下标
}
/**
* 数字下标转列
*
* @param index
* @return
*/
public static String NumToExcel(int index) {
int shang = 0;
int yu = 0;
List<Integer> list = new ArrayList<Integer>(); //10进制转26进制 倒序
while (true) {
shang = index / 26;
yu = index % 26;
index = shang;
list.add(yu);
if (shang == 0)
break;
}
StringBuilder sb = new StringBuilder();
for (int j = list.size() - 1; j >= 0; j--) {
sb.append((char) (list.get(j) + 'A' - (j > 1 ? 1 : j))); //倒序拼接 序号转字符 非末位 序号减去 1
}
return sb.toString();
}
}
\ No newline at end of file
package pwc.taxtech.atms.common.util;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.apache.poi.xssf.usermodel.XSSFColor;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
/**
* author kevin
* version 1.0
*/
public class POIStyleUtil {
public static void setCellAlign(XSSFWorkbook xssfWorkbook, Cell cell) {
CellStyle cellStyle = xssfWorkbook.createCellStyle();
cellStyle.setAlignment(HorizontalAlignment.CENTER);// 设置居中
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
cell.setCellStyle(cellStyle);
}
///new XSSFColor(java.awt.Color.YELLOW)
public static void setCellBackgroundColor(XSSFWorkbook xssfWorkbook, Cell cell, XSSFColor xssfColor ,FillPatternType fillPatternType) {
if(fillPatternType == null)
fillPatternType = FillPatternType.SOLID_FOREGROUND;
XSSFCellStyle cellStyle = xssfWorkbook.createCellStyle();
cellStyle.setFillPattern(fillPatternType);
cellStyle.setFillForegroundColor(xssfColor);
cell.setCellStyle(cellStyle);
}
public static void setCellBackgroundColor(XSSFWorkbook xssfWorkbook, Cell cell, XSSFColor xssfColor){
setCellBackgroundColor(xssfWorkbook, cell, xssfColor, null);
}
}
...@@ -126,4 +126,23 @@ public class AnalysisController extends BaseController { ...@@ -126,4 +126,23 @@ public class AnalysisController extends BaseController {
} }
return null; return null;
} }
@RequestMapping("analysisDataInit")
public OperationResultDto analysisDataInit(Integer type){
logger.info("开始分析模块数据初始化");
OperationResultDto operationResultDto = analysisServiceImpl.analysisDataInit( type);
logger.info("分析模块数据初始化完毕");
return operationResultDto;
}
@RequestMapping("handleAnalysisData")
public OperationResultDto handleAnalysisData(Integer type){
logger.info("开始分析模块手动加载数据");
OperationResultDto operationResultDto = analysisServiceImpl.handleAnalysisData( type);
logger.info("分析模块手动加载数据完毕");
return operationResultDto;
}
} }
...@@ -173,7 +173,7 @@ public class ReportController { ...@@ -173,7 +173,7 @@ public class ReportController {
resultDto.setResult(false); resultDto.setResult(false);
return resultDto; return resultDto;
}*/ }*/
operationResultDto = reportService.getCellData(requestParameterDto.getReportId(), requestParameterDto.getOrgId(), requestParameterDto.getPeriod()); operationResultDto = reportService.getCellData( requestParameterDto.getOrgId(), requestParameterDto.getPeriod());
return operationResultDto; return operationResultDto;
} }
...@@ -377,7 +377,6 @@ public class ReportController { ...@@ -377,7 +377,6 @@ public class ReportController {
e.printStackTrace(); e.printStackTrace();
operationResultDto.error(e.getMessage()); operationResultDto.error(e.getMessage());
return new ResponseEntity(HttpStatus.NO_CONTENT); return new ResponseEntity(HttpStatus.NO_CONTENT);
} }
return new ResponseEntity(HttpStatus.OK); return new ResponseEntity(HttpStatus.OK);
} }
......
...@@ -301,30 +301,22 @@ public class TemplateController extends BaseController { ...@@ -301,30 +301,22 @@ public class TemplateController extends BaseController {
File templateFile; File templateFile;
InputStream inputStream = null; InputStream inputStream = null;
OperationResultDto operationResultDto = new OperationResultDto(); OperationResultDto operationResultDto = new OperationResultDto();
EbitSpreadDataExample ebitSpreadData = new EbitSpreadDataExample(); /* EbitSpreadDataExample ebitSpreadData = new EbitSpreadDataExample();
ebitSpreadData.createCriteria().andPeriodEqualTo(period).andOrganizationIdEqualTo(orgId); ebitSpreadData.createCriteria().andPeriodEqualTo(period).andOrganizationIdEqualTo(orgId);
List<EbitSpreadData> ebitSpreadData1 = ebitSpreadDataMapper.selectByExample(ebitSpreadData); List<EbitSpreadData> ebitSpreadData1 = ebitSpreadDataMapper.selectByExample(ebitSpreadData);*/
OutputStream out = null; OutputStream out = null;
//客户端保存的文件名 //客户端保存的文件名
String customFileName = "template_" + DateTime.now().toString("yyyyMMddHHmmss") + ".xlsx"; String customFileName = "template_" + DateTime.now().toString("yyyyMMddHHmmss") + ".xlsx";
response.setHeader("Content-Disposition", String.format("inline; filename=\"" + customFileName + "\"")); response.setHeader("Content-Disposition", String.format("inline; filename=\"" + customFileName + "\""));
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
// int len = 0;
// byte[] buffer = new byte[1024];
// out = response.getOutputStream();
// while ((len = inputStream.read(buffer)) > 0) {
// out.write(buffer, 0, len);
// }
try { try {
out = response.getOutputStream(); out = response.getOutputStream();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
if (ebitSpreadData1.size() != 0) { /*if (ebitSpreadData1.size() != 0) {
DidiFileIUploadParam didiFileIUploadParam = new DidiFileIUploadParam(); DidiFileIUploadParam didiFileIUploadParam = new DidiFileIUploadParam();
didiFileIUploadParam.setUuids(Arrays.asList(ebitSpreadData1.get(0).getFileKey())); didiFileIUploadParam.setUuids(Arrays.asList(ebitSpreadData1.get(0).getFileKey()));
PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(didiFileIUploadParam); PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(didiFileIUploadParam);
String path = null; String path = null;
if (CollectionUtils.isNotEmpty(uploadDetail.getList())) { if (CollectionUtils.isNotEmpty(uploadDetail.getList())) {
...@@ -359,7 +351,7 @@ public class TemplateController extends BaseController { ...@@ -359,7 +351,7 @@ public class TemplateController extends BaseController {
inputStream = null; inputStream = null;
} }
} }
} }*/
List<Template> templates = templateService.getTL(templateId); List<Template> templates = templateService.getTL(templateId);
MyAsserts.assertNotEmpty(templates, new NotFoundException()); MyAsserts.assertNotEmpty(templates, new NotFoundException());
Template template = templates.get(0); Template template = templates.get(0);
...@@ -368,7 +360,6 @@ public class TemplateController extends BaseController { ...@@ -368,7 +360,6 @@ public class TemplateController extends BaseController {
filePath = this.getClass().getResource("").toURI().getPath(); filePath = this.getClass().getResource("").toURI().getPath();
String tempPath = filePath.substring(0, filePath.indexOf("classes") + "\\classes".length()); String tempPath = filePath.substring(0, filePath.indexOf("classes") + "\\classes".length());
templateFile = new File(tempPath + templatePath); templateFile = new File(tempPath + templatePath);
try { try {
//如果是系统报表就取本地文件夹,如果不是就取FTP //如果是系统报表就取本地文件夹,如果不是就取FTP
if (template.getIsSystemType()) { if (template.getIsSystemType()) {
......
...@@ -1255,7 +1255,7 @@ public class DataImportService extends BaseService { ...@@ -1255,7 +1255,7 @@ public class DataImportService extends BaseService {
* @return * @return
*/ */
public OperationResultDto importCILExcelFile(MultipartFile file,List<String> orgIds, String periodDate, Integer importType) throws ServiceException { public OperationResultDto importCILExcelFile(MultipartFile file,List<String> orgIds, String periodDate, Integer importType) throws ServiceException {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
try { try {
InputStream inputStream = file.getInputStream(); InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream); Workbook workbook = WorkbookFactory.create(inputStream);
...@@ -1348,8 +1348,12 @@ public class DataImportService extends BaseService { ...@@ -1348,8 +1348,12 @@ public class DataImportService extends BaseService {
cil.setInvoiceNum(getCellStringValue(cell3)); cil.setInvoiceNum(getCellStringValue(cell3));
Cell cell4 = row.getCell(3); Cell cell4 = row.getCell(3);
cil.setBillingDate(DateUtils.strToDate4(getCellStringValue(cell4))); try{
String BillingDate = format.format(cell4.getDateCellValue());
cil.setBillingDate(DateUtils.strToDate4(BillingDate));
}catch (Exception e){
cil.setBillingDate(DateUtils.strToDate4(getCellStringValue(cell4)));
}
Cell cell5 = row.getCell(4); Cell cell5 = row.getCell(4);
cil.setSalesTaxNum(getCellStringValue(cell5)); cil.setSalesTaxNum(getCellStringValue(cell5));
...@@ -1366,7 +1370,10 @@ public class DataImportService extends BaseService { ...@@ -1366,7 +1370,10 @@ public class DataImportService extends BaseService {
cil.setVerificationMethod(getCellStringValue(cell9)); cil.setVerificationMethod(getCellStringValue(cell9));
Cell cell10 = row.getCell(9); Cell cell10 = row.getCell(9);
cil.setCertifiedDate(DateUtils.strToDate4(getCellStringValue(cell10))); Date dateCellValue = cell10.getDateCellValue();
String format1 = format.format(dateCellValue);
cil.setCertifiedDate(DateUtils.strToDate4(format1));
Cell cell11 = row.getCell(10); Cell cell11 = row.getCell(10);
cil.setInvoiceType(getCellStringValue(cell11)); cil.setInvoiceType(getCellStringValue(cell11));
......
...@@ -126,7 +126,8 @@ public class EbsApiServiceImpl implements EbsApiService { ...@@ -126,7 +126,8 @@ public class EbsApiServiceImpl implements EbsApiService {
} }
@Override @Override
public void queryRemoteServerThenUpdateCF(Long id ,List<CashFlowQueryDto> items) { public void
queryRemoteServerThenUpdateCF(Long id ,List<CashFlowQueryDto> items) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
logger.debug("start queryRemoteServerThenUpdateCF 现金流量表"); logger.debug("start queryRemoteServerThenUpdateCF 现金流量表");
//判断数据是否存在 //判断数据是否存在
...@@ -260,11 +261,12 @@ public class EbsApiServiceImpl implements EbsApiService { ...@@ -260,11 +261,12 @@ public class EbsApiServiceImpl implements EbsApiService {
//唯一则更新否则插入 //唯一则更新否则插入
JournalEntry journalEntry = new JournalEntry(); JournalEntry journalEntry = new JournalEntry();
if (journalEntryList.size() == 1) { if (journalEntryList.size() == 1) {
logger.debug("exist and update journalEntry headerId:{},lineNum:{},taskId:{}", item.getHeaderId(), item.getLineNum(),item.getTaskId()); //todo 待验证
/*logger.debug("exist and update journalEntry headerId:{},lineNum:{},taskId:{}", item.getHeaderId(), item.getLineNum(),item.getTaskId());
journalEntry = journalEntryList.get(0); journalEntry = journalEntryList.get(0);
populateFieldsJE(item, journalEntry); populateFieldsJE(item, journalEntry);
journalEntry.setId(journalEntryList.get(0).getId()); journalEntry.setId(journalEntryList.get(0).getId());
journalEntryMapper.updateByPrimaryKeySelective(journalEntry); journalEntryMapper.updateByPrimaryKeySelective(journalEntry);*/
} else { } else {
logger.debug("miss and insert journalEntry headerId:{},lineNum:{},taskId:{}", item.getHeaderId(), item.getLineNum(),item.getTaskId()); logger.debug("miss and insert journalEntry headerId:{},lineNum:{},taskId:{}", item.getHeaderId(), item.getLineNum(),item.getTaskId());
populateFieldsJE(item, journalEntry); populateFieldsJE(item, journalEntry);
...@@ -870,9 +872,10 @@ public class EbsApiServiceImpl implements EbsApiService { ...@@ -870,9 +872,10 @@ public class EbsApiServiceImpl implements EbsApiService {
} }
private void updateDataImportLog(Long id, int size) { private void updateDataImportLog(Long id, int size) {
DataImportLog dataImportLogTemp = dataImportLogMapper.selectByPrimaryKey(id);
DataImportLog dataImportLog = new DataImportLog(); DataImportLog dataImportLog = new DataImportLog();
dataImportLog.setId(id); dataImportLog.setId(id);
dataImportLog.setRecordSize(size); dataImportLog.setRecordSize((dataImportLogTemp==null?0:dataImportLogTemp.getRecordSize())+size);
dataImportLog.setImportResult(true); dataImportLog.setImportResult(true);
dataImportLog.setUpdateTime(new Date()); dataImportLog.setUpdateTime(new Date());
int res = dataImportLogMapper.updateByPrimaryKeySelective(dataImportLog); int res = dataImportLogMapper.updateByPrimaryKeySelective(dataImportLog);
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<property name="rootInterface" value="pwc.taxtech.atms.MyAnalysisMapper" /> <property name="rootInterface" value="pwc.taxtech.atms.MyAnalysisMapper" />
</javaClientGenerator> </javaClientGenerator>
<table tableName="analysis_international_business_data" domainObjectName="AnalysisInternationalBusinessData"> <table tableName="analysis_employee_num" domainObjectName="AnalysisEmployeeNum">
<property name="useActualColumnNames" value="false"/> <property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/> <property name="ignoreQualifiersAtRuntime" value="true"/>
</table> </table>
......
...@@ -105,4 +105,6 @@ public interface AnalysisSalesMapper extends MyAnalysisMapper { ...@@ -105,4 +105,6 @@ public interface AnalysisSalesMapper extends MyAnalysisMapper {
* @mbg.generated * @mbg.generated
*/ */
int updateByPrimaryKey(AnalysisSales record); int updateByPrimaryKey(AnalysisSales record);
int insertBatch(List<AnalysisSales> salesList);
} }
\ No newline at end of file
...@@ -105,4 +105,6 @@ public interface AnalysisTaxMapper extends MyAnalysisMapper { ...@@ -105,4 +105,6 @@ public interface AnalysisTaxMapper extends MyAnalysisMapper {
* @mbg.generated * @mbg.generated
*/ */
int updateByPrimaryKey(AnalysisTax record); int updateByPrimaryKey(AnalysisTax record);
int insertBatch(List<AnalysisTax> taxList);
} }
\ No newline at end of file
...@@ -222,6 +222,16 @@ public class AnalysisSales extends BaseEntity implements Serializable { ...@@ -222,6 +222,16 @@ public class AnalysisSales extends BaseEntity implements Serializable {
*/ */
private BigDecimal segment17; private BigDecimal segment17;
public BigDecimal getSegment18() {
return segment18;
}
public void setSegment18(BigDecimal segment18) {
this.segment18 = segment18;
}
private BigDecimal segment18;
/** /**
* Database Column Remarks: * Database Column Remarks:
* 创建时间 * 创建时间
...@@ -863,35 +873,32 @@ public class AnalysisSales extends BaseEntity implements Serializable { ...@@ -863,35 +873,32 @@ public class AnalysisSales extends BaseEntity implements Serializable {
*/ */
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); return "AnalysisSales{" +
sb.append(getClass().getSimpleName()); "id=" + id +
sb.append(" ["); ", seqNo='" + seqNo + '\'' +
sb.append("Hash = ").append(hashCode()); ", segment1=" + segment1 +
sb.append(", id=").append(id); ", segment2=" + segment2 +
sb.append(", seqNo=").append(seqNo); ", segment3=" + segment3 +
sb.append(", segment1=").append(segment1); ", segment4=" + segment4 +
sb.append(", segment2=").append(segment2); ", segment5=" + segment5 +
sb.append(", segment3=").append(segment3); ", segment6=" + segment6 +
sb.append(", segment4=").append(segment4); ", segment7=" + segment7 +
sb.append(", segment5=").append(segment5); ", segment8=" + segment8 +
sb.append(", segment6=").append(segment6); ", segment9=" + segment9 +
sb.append(", segment7=").append(segment7); ", segment10=" + segment10 +
sb.append(", segment8=").append(segment8); ", segment11=" + segment11 +
sb.append(", segment9=").append(segment9); ", segment12=" + segment12 +
sb.append(", segment10=").append(segment10); ", segment13=" + segment13 +
sb.append(", segment11=").append(segment11); ", segment14=" + segment14 +
sb.append(", segment12=").append(segment12); ", segment15=" + segment15 +
sb.append(", segment13=").append(segment13); ", segment16=" + segment16 +
sb.append(", segment14=").append(segment14); ", segment17=" + segment17 +
sb.append(", segment15=").append(segment15); ", segment18=" + segment18 +
sb.append(", segment16=").append(segment16); ", createTime=" + createTime +
sb.append(", segment17=").append(segment17); ", updateTime=" + updateTime +
sb.append(", createTime=").append(createTime); ", organizationId='" + organizationId + '\'' +
sb.append(", updateTime=").append(updateTime); ", companyName='" + companyName + '\'' +
sb.append(", organizationId=").append(organizationId); ", period=" + period +
sb.append(", companyName=").append(companyName); '}';
sb.append(", period=").append(period);
sb.append("]");
return sb.toString();
} }
} }
\ No newline at end of file
...@@ -10,13 +10,21 @@ public class ProjectAnaylsisDto { ...@@ -10,13 +10,21 @@ public class ProjectAnaylsisDto {
private String reportId; private String reportId;
private String projectId; private String projectId;
private Integer period;
private String orgId; private String orgId;
private String templateName; private String templateName;
private String serviceTypeId; private String serviceTypeId;
public Integer getPeriod() {
return period;
}
public void setPeriod(Integer period) {
this.period = period;
}
public String getReportId() { public String getReportId() {
return reportId; return reportId;
} }
......
...@@ -6,8 +6,7 @@ ...@@ -6,8 +6,7 @@
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="seq_no" jdbcType="VARCHAR" property="seqNo" />
<result column="segment_1" jdbcType="DECIMAL" property="segment1" /> <result column="segment_1" jdbcType="DECIMAL" property="segment1" />
<result column="segment_2" jdbcType="DECIMAL" property="segment2" /> <result column="segment_2" jdbcType="DECIMAL" property="segment2" />
<result column="segment_3" jdbcType="DECIMAL" property="segment3" /> <result column="segment_3" jdbcType="DECIMAL" property="segment3" />
...@@ -25,6 +24,7 @@ ...@@ -25,6 +24,7 @@
<result column="segment_15" jdbcType="DECIMAL" property="segment15" /> <result column="segment_15" jdbcType="DECIMAL" property="segment15" />
<result column="segment_16" jdbcType="DECIMAL" property="segment16" /> <result column="segment_16" jdbcType="DECIMAL" property="segment16" />
<result column="segment_17" jdbcType="DECIMAL" property="segment17" /> <result column="segment_17" jdbcType="DECIMAL" property="segment17" />
<result column="segment_18" jdbcType="DECIMAL" property="segment18"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="organization_id" jdbcType="VARCHAR" property="organizationId" /> <result column="organization_id" jdbcType="VARCHAR" property="organizationId" />
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
--> -->
id, seq_no, segment_1, segment_2, segment_3, segment_4, segment_5, segment_6, segment_7, id, seq_no, segment_1, segment_2, segment_3, segment_4, segment_5, segment_6, segment_7,
segment_8, segment_9, segment_10, segment_11, segment_12, segment_13, segment_14, segment_8, segment_9, segment_10, segment_11, segment_12, segment_13, segment_14,
segment_15, segment_16, segment_17, create_time, update_time, organization_id, company_name, segment_15, segment_16, segment_17, segment_18, create_time, update_time, organization_id, company_name,
period period
</sql> </sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.analysis.entity.AnalysisSalesExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="pwc.taxtech.atms.analysis.entity.AnalysisSalesExample" resultMap="BaseResultMap">
...@@ -173,7 +173,7 @@ ...@@ -173,7 +173,7 @@
#{segment8,jdbcType=DECIMAL}, #{segment9,jdbcType=DECIMAL}, #{segment10,jdbcType=DECIMAL}, #{segment8,jdbcType=DECIMAL}, #{segment9,jdbcType=DECIMAL}, #{segment10,jdbcType=DECIMAL},
#{segment11,jdbcType=DECIMAL}, #{segment12,jdbcType=DECIMAL}, #{segment13,jdbcType=DECIMAL}, #{segment11,jdbcType=DECIMAL}, #{segment12,jdbcType=DECIMAL}, #{segment13,jdbcType=DECIMAL},
#{segment14,jdbcType=DECIMAL}, #{segment15,jdbcType=DECIMAL}, #{segment16,jdbcType=DECIMAL}, #{segment14,jdbcType=DECIMAL}, #{segment15,jdbcType=DECIMAL}, #{segment16,jdbcType=DECIMAL},
#{segment17,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{segment17,jdbcType=DECIMAL},#{segment17,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{organizationId,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR}, #{period,jdbcType=INTEGER} #{organizationId,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR}, #{period,jdbcType=INTEGER}
) )
</insert> </insert>
......
...@@ -351,4 +351,52 @@ ...@@ -351,4 +351,52 @@
order by ${orderByClause} order by ${orderByClause}
</if> </if>
</select> </select>
<insert id="insertBatch" parameterType="java.util.List">
insert into analysis_tax
(<include refid="Base_Column_List"/>)
values
<foreach collection="list" item="item" index="index" separator=",">
<trim prefix="(" suffix=")" suffixOverrides=",">
<choose>
<when test="item.id != null">#{item.id,jdbcType=BIGINT},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.organizationId != null">#{item.organizationId,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.companyName != null">#{item.companyName,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.period != null">#{item.period,jdbcType=INTEGER} ,</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.seqNo != null">#{item.seqNo,jdbcType=VARCHAR},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.taxGroup != null">#{item.taxGroup,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.taxAmount != null">#{item.taxAmount,jdbcType=DECIMAL},</when>
<otherwise>0.000,</otherwise>
</choose>
<choose>
<when test="item.createTime != null">#{item.createTime,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.updateTime != null">#{item.updateTime,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
</trim>
</foreach>;
SELECT 1 FROM DUAL;
</insert>
</mapper> </mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.analysis.dao.AnalysisSalesMapper">
<insert id="insertBatch" parameterType="java.util.List">
insert into analysis_sales
(<include refid="Base_Column_List"/>)
values
<foreach collection="list" item="item" index="index" separator=",">
<trim prefix="(" suffix=")" suffixOverrides=",">
<choose>
<when test="item.id != null">#{item.id,jdbcType=BIGINT},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.seqNo != null">#{item.seqNo,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.segment1 != null">#{item.segment1,jdbcType=DECIMAL},</when>
<otherwise>0.0000,</otherwise>
</choose>
<choose>
<when test="item.segment2 != null">#{item.segment2,jdbcType=DECIMAL},</when>
<otherwise>0.0000,</otherwise>
</choose>
<choose>
<when test="item.segment3 != null">#{item.segment3,jdbcType=DECIMAL},</when>
<otherwise>0.0000,</otherwise>
</choose>
<choose>
<when test="item.segment4 != null">#{item.segment4,jdbcType=DECIMAL},</when>
<otherwise>0.0000,</otherwise>
</choose>
<choose>
<when test="item.segment5 != null">#{item.segment5,jdbcType=DECIMAL},</when>
<otherwise>0.0000,</otherwise>
</choose>
<choose>
<when test="item.segment6 != null">#{item.segment6,jdbcType=DECIMAL},</when>
<otherwise>0.0000,</otherwise>
</choose>
<choose>
<when test="item.segment7 != null">#{item.segment7,jdbcType=DECIMAL},</when>
<otherwise>0.0000,</otherwise>
</choose>
<choose>
<when test="item.segment8 != null">#{item.segment8,jdbcType=DECIMAL},</when>
<otherwise>0.0000,</otherwise>
</choose>
<choose>
<when test="item.segment9 != null">#{item.segment9,jdbcType=DECIMAL},</when>
<otherwise>0.0000,</otherwise>
</choose>
<choose>
<when test="item.segment10 != null">#{item.segment10,jdbcType=DECIMAL},</when>
<otherwise>0.0000,</otherwise>
</choose>
<choose>
<when test="item.segment11 != null">#{item.segmen11,jdbcType=DECIMAL},</when>
<otherwise>0.0000,</otherwise>
</choose>
<choose>
<when test="item.segment12 != null">#{item.segment12,jdbcType=DECIMAL},</when>
<otherwise>0.0000,</otherwise>
</choose> <choose>
<when test="item.segment13 != null">#{item.segment13,jdbcType=DECIMAL},</when>
<otherwise>0.0000,</otherwise>
</choose>
<choose>
<when test="item.segment14 != null">#{item.segment14,jdbcType=DECIMAL},</when>
<otherwise>0.0000,</otherwise>
</choose>
<choose>
<when test="item.segment15 != null">#{item.segment15,jdbcType=DECIMAL},</when>
<otherwise>0.0000,</otherwise>
</choose>
<choose>
<when test="item.segment16 != null">#{item.segment16,jdbcType=DECIMAL},</when>
<otherwise>0.0000,</otherwise>
</choose>
<choose>
<when test="item.segment17 != null">#{item.segment17,jdbcType=DECIMAL},</when>
<otherwise>0.0000,</otherwise>
</choose>
<choose>
<when test="item.segment18 != null">#{item.segment18,jdbcType=DECIMAL},</when>
<otherwise>0.0000,</otherwise>
</choose>
<choose>
<when test="item.createTime != null">#{item.createTime,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.updateTime != null">#{item.updateTime,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.organizationId != null">#{item.organizationId,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.companyName != null">#{item.companyName,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.period != null">#{item.period,jdbcType=INTEGER} ,</when>
<otherwise>0,</otherwise>
</choose>
</trim>
</foreach>;
SELECT 1 FROM DUAL;
</insert>
</mapper>
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
<mapper namespace="pwc.taxtech.atms.dao.ProjectMapper"> <mapper namespace="pwc.taxtech.atms.dao.ProjectMapper">
<select id="getTemlateWithServiceType" resultType="pwc.taxtech.atms.dpo.ProjectAnaylsisDto"> <select id="getTemlateWithServiceType" resultType="pwc.taxtech.atms.dpo.ProjectAnaylsisDto">
select pp.id as reportId,p.id as projectId,p.organization_id as orgId,pst.service_type_id,t.name as templateName select pp.id as reportId,p.id as projectId,p.organization_id as orgId,pst.service_type_id,t.name as templateName,
pp.period as period
from period_report pp from period_report pp
left join project p on left join project p on
pp.project_id = p.id pp.project_id = p.id
...@@ -38,4 +39,7 @@ ...@@ -38,4 +39,7 @@
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -1322,9 +1322,7 @@ ...@@ -1322,9 +1322,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
select select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from journal_entry from journal_entry
<if test="_parameter != null"> <if test="_parameter != null">
......
...@@ -2287,7 +2287,7 @@ ...@@ -2287,7 +2287,7 @@
"Country": "国家", "Country": "国家",
"Company": "公司", "Company": "公司",
"CompanySimpleName": "公司简称", "CompanySimpleName": "公司简称",
"SaveAnalysisData" : "是否保留原始数据?",
"DriverType": "司机类型", "DriverType": "司机类型",
"FileExportSuccess": "文件下载成功!", "FileExportSuccess": "文件下载成功!",
"FileExportFailed": "文件下载失败!", "FileExportFailed": "文件下载失败!",
......
...@@ -648,8 +648,8 @@ ...@@ -648,8 +648,8 @@
case 101: case 101:
$scope.showInternationalTaxDataGrid = true; $scope.showInternationalTaxDataGrid = true;
loadInternationalTaxDataGrid(); loadInternationalTaxDataGrid();
/* $scope.selectCountry = ''; /* $scope.selectCountry = '';
$scope.selectCompany = '';*/ $scope.selectCompany = '';*/
break; break;
default: default:
break; break;
...@@ -678,19 +678,89 @@ ...@@ -678,19 +678,89 @@
$scope.selectCountry = e.currentTarget[clickedIndex].value; $scope.selectCountry = e.currentTarget[clickedIndex].value;
}); });
var initContryList = function(){ var initContryList = function () {
var joinText = ""; var joinText = "";
if(constant.countryCNList){ if (constant.countryCNList) {
for(var i =0; i< constant.countryCNList.length; i++){ for (var i = 0; i < constant.countryCNList.length; i++) {
joinText += "<option value =" + constant.countryCNList[i]+ " style ='text-align: left;' >" + constant.countryCNList[i] + "</option>"; joinText += "<option value =" + constant.countryCNList[i] + " style ='text-align: left;' >" + constant.countryCNList[i] + "</option>";
} }
$('#contryList').html(joinText); $('#contryList').html(joinText);
$('#contryList').selectpicker('refresh'); $('#contryList').selectpicker('refresh');
} }
}; };
$('#orgList').on('shown.bs.select', function(){ $('#orgList').on('shown.bs.select', function () {
$(this).find('.dropdown-menu').width("200px"); $(this).find('.dropdown-menu').width("200px");
}); });
$scope.analysisInitData = function () {
SweetAlert.swal({
title: $translate.instant('WarningTitle'),
text: $translate.instant('SaveAnalysisData'),
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: $translate.instant('ConfirmYes'),
cancelButtonText: $translate.instant('No'),
closeOnConfirm: true,
showCloseButton : true
}, function (isConfirm) {
var type = 1;//默认保留原始数据
if (isConfirm) {
type = 1;
vatImportService.analysisInitData(type).success(function (res) {
if (res.resultMsg) {
SweetAlert.success("分析数据初始化成功!" + '消耗' + Number(res.resultMsg / 1000) + "秒");
}
}).error(function (error) {
SweetAlert.error(error);
});
} else if (isConfirm == false) {
type = 0;
vatImportService.analysisInitData(type).success(function (res) {
if (res.resultMsg) {
SweetAlert.success("分析数据初始化成功!" + '消耗' + Number(res.resultMsg / 1000) + "秒");
}
}).error(function (error) {
SweetAlert.error(error);
});
}
});
};
$scope.handleAnalysisData = function () {
SweetAlert.swal({
title: $translate.instant('WarningTitle'),
text: $translate.instant('SaveAnalysisData'),
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: $translate.instant('ConfirmYes'),
cancelButtonText: $translate.instant('No'),
closeOnConfirm: true,
showCloseButton : true
}, function (isConfirm) {
var type = 1;//默认保留原始数据
if (isConfirm) {
type = 1;
vatImportService.handleAnalysisData(type).success(function (res) {
if (res.resultMsg) {
SweetAlert.success("手动加载分析模块数据成功!" + '消耗' + Number(res.resultMsg) + "秒");
}
}).error(function (error) {
SweetAlert.error(error);
});
} else if (isConfirm == false) {
type = 0;
vatImportService.handleAnalysisData(type).success(function (res) {
if (res.resultMsg) {
SweetAlert.success("手动加载分析模块数据成功!" + '消耗' + Number(res.resultMsg) + "秒");
}
}).error(function (error) {
SweetAlert.error(error);
});
}
});
};
/*------------------------------------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------------------------------------*/
//开始 //开始
......
...@@ -121,7 +121,15 @@ ...@@ -121,7 +121,15 @@
</div> </div>
</div> </div>
</form> </form>
<div class="row">
<button type="button"
class="btn btn-vat-primary col-sm-2" style="margin-left: 20px!important; margin-top: 10px!important;display: none;"
ng-click="analysisInitData()">数据初始化</button>
<div class=""></div>
<button type="button"
class="btn btn-vat-primary col-sm-2" style="margin-left: 20px!important; margin-top: 10px!important; display: none;"
ng-click="handleAnalysisData()">(手动)加载按分析模块数据</button>
</div>
<div class="dt-init-wrapper"> <div class="dt-init-wrapper">
<div class="dx-viewport grid-container"> <div class="dx-viewport grid-container">
<div id="internationalBUDataGridContainer" dx-data-grid="internationalBUDataGridOptions" <div id="internationalBUDataGridContainer" dx-data-grid="internationalBUDataGridOptions"
......
...@@ -1104,7 +1104,7 @@ ...@@ -1104,7 +1104,7 @@
$scope.relation.loadSheet($scope.templateId); $scope.relation.loadSheet($scope.templateId);
return; return;
} }
vatReportService.getReportEbitData($scope.reportId, $scope.relation.orgId, period != undefined ? period : ($scope.relation.period == undefined ? period : $scope.relation.period)).success(function (reportData) { vatReportService.getReportEbitData( $scope.relation.orgId, period != undefined ? period : ($scope.relation.period == undefined ? period : $scope.relation.period)).success(function (reportData) {
if (reportData && reportData.data) { if (reportData && reportData.data) {
_.each(reportData.data.cellData, function (x) { _.each(reportData.data.cellData, function (x) {
x.value = x.cellValue; x.value = x.cellValue;
...@@ -1112,13 +1112,9 @@ ...@@ -1112,13 +1112,9 @@
}); });
$scope.relation.data = reportData.data.ebitData; $scope.relation.data = reportData.data.ebitData;
$scope.reportData = reportData.data.cellData; $scope.reportData = reportData.data.cellData;
$scope.formulaBlocks = reportData.data.formulaBlocks;
$scope.manualDataSources = reportData.data.manualDataSources;
$scope.relation.loadSheet($scope.templateId); $scope.relation.loadSheet($scope.templateId);
} else { } else {
$scope.reportData = []; $scope.reportData = [];
$scope.formulaBlocks = [];
$scope.manualDataSources = [];
$scope.relation.data = []; $scope.relation.data = [];
$scope.relation.loadSheet($scope.templateId); $scope.relation.loadSheet($scope.templateId);
} }
...@@ -1129,7 +1125,7 @@ ...@@ -1129,7 +1125,7 @@
//period = Number(period); //period = Number(period);
if ($scope.templateId !== undefined) { if ($scope.templateId !== undefined) {
//todo: according to templateId and period get reportId //todo: according to templateId and period get reportId
period = Number(period);//转成Number类型 /*period = Number(period);//转成Number类型
vatReportService.getReportByTemplateIdEbit($scope.templateId, period, orgId).success(function (report) { vatReportService.getReportByTemplateIdEbit($scope.templateId, period, orgId).success(function (report) {
if (report.data) { if (report.data) {
$scope.reportId = report.data.id; $scope.reportId = report.data.id;
...@@ -1139,7 +1135,8 @@ ...@@ -1139,7 +1135,8 @@
$scope.manualDataSources = []; $scope.manualDataSources = [];
} }
getReportData(period); getReportData(period);
}); });*/
getReportData(period);
} }
}; };
$scope.periodChange = function (data) { $scope.periodChange = function (data) {
...@@ -3090,10 +3087,9 @@ ...@@ -3090,10 +3087,9 @@
$scope.relation.addEbitRow(sheet); $scope.relation.addEbitRow(sheet);
calculateEbitAndInsert(sheet, true); calculateEbitAndInsert(sheet, true);
$scope.relation.lockCell($scope.spread); $scope.relation.lockCell($scope.spread);
$('#busy-indicator-container').hide();
//关闭弹出层 //关闭弹出层
spreadTODb(true); $('#busy-indicator-container').hide();
spreadTODb();
}, function (e) { }, function (e) {
alert(e.errorMessage); alert(e.errorMessage);
if (e.errorCode === 2/*noPassword*/ || e.errorCode === 3 /*invalidPassword*/) { if (e.errorCode === 2/*noPassword*/ || e.errorCode === 3 /*invalidPassword*/) {
...@@ -3148,6 +3144,7 @@ ...@@ -3148,6 +3144,7 @@
sheet.setValue(42, 2, $scope._ebitResult.sixAddtax); sheet.setValue(42, 2, $scope._ebitResult.sixAddtax);
sheet.setValue(43, 2, $scope._ebitResult.klzcjsz); sheet.setValue(43, 2, $scope._ebitResult.klzcjsz);
} }
} }
$scope.singleExport = function () { $scope.singleExport = function () {
...@@ -3174,6 +3171,7 @@ ...@@ -3174,6 +3171,7 @@
var param = { var param = {
period: $scope.relation.period, period: $scope.relation.period,
templateId: $scope.templateId templateId: $scope.templateId
} }
/* $timeout(function () { /* $timeout(function () {
......
...@@ -60,9 +60,8 @@ ...@@ -60,9 +60,8 @@
getReportData: function (reportId) { getReportData: function (reportId) {
return $http.get('/Report/reportData/' + reportId, apiConfig.createVat()); return $http.get('/Report/reportData/' + reportId, apiConfig.createVat());
}, },
getReportEbitData: function (reportId, orgId, period) { getReportEbitData: function (orgId, period) {
var param = { var param = {
reportId: reportId,
period: period, period: period,
orgId: orgId orgId: orgId
} }
......
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