Commit 5c2055a4 authored by eddie.woo's avatar eddie.woo

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

parents c290952a 1b463230
...@@ -210,7 +210,8 @@ public class POIUtil { ...@@ -210,7 +210,8 @@ public class POIUtil {
public static void copyCell(Workbook wb,Cell srcCell, Cell distCell, public static void copyCell(Workbook wb,Cell srcCell, Cell distCell,
boolean copyValueFlag) { boolean copyValueFlag) {
CellStyle newstyle=wb.createCellStyle(); CellStyle newstyle=wb.createCellStyle();
copyCellStyle(wb,srcCell.getCellStyle(), newstyle); newstyle.cloneStyleFrom(srcCell.getCellStyle());
// copyCellStyle(wb,srcCell.getCellStyle(), newstyle);
// distCell.setEncoding(srcCell.getEncoding()); // distCell.setEncoding(srcCell.getEncoding());
//样式 //样式
distCell.setCellStyle(newstyle); distCell.setCellStyle(newstyle);
......
...@@ -754,6 +754,13 @@ public class DateUtils { ...@@ -754,6 +754,13 @@ public class DateUtils {
return getPeriodEndFormat(year, period, Constant.DateFormat.DEFAULT); return getPeriodEndFormat(year, period, Constant.DateFormat.DEFAULT);
} }
//获取当前 格式化成stirng的日期 yyyy-MM-dd
public static String nowDateFormat() {
Date date = new Date();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
return simpleDateFormat.format(date);
}
// /*************************************************************************** // /***************************************************************************
// * //nd=1表示返回的值中包含年度 //yf=1表示返回的值中包含月份 //rq=1表示返回的值中包含日期 //format表示返回的格式 1 // * //nd=1表示返回的值中包含年度 //yf=1表示返回的值中包含月份 //rq=1表示返回的值中包含日期 //format表示返回的格式 1
// * 以年月日中文返回 2 以横线-返回 // 3 以斜线/返回 4 以缩写不带其它符号形式返回 // 5 以点号.返回 // * 以年月日中文返回 2 以横线-返回 // 3 以斜线/返回 4 以缩写不带其它符号形式返回 // 5 以点号.返回
......
package pwc.taxtech.atms.common.util;
/**
* @ClassName FileExcelUtil
* Description TODO
* @Author pwc kevin
* @Date 3/31/2019 12:35 PM
* Version 1.0
**/
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sun.misc.BASE64Encoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
@SuppressWarnings("restriction")
public class FileExcelUtil {
private static final Logger logger = LoggerFactory.getLogger(FileExcelUtil.class);
/**
* 编译下载的文件名
* @param filename
* @param agent
* @return
* @throws IOException
*/
public static String encodeDownloadFilename(String filename, String agent)throws IOException {
if (agent.contains("Firefox")) { // 火狐浏览器
filename = "=?UTF-8?B?"
+ new BASE64Encoder().encode(filename.getBytes("utf-8"))
+ "?=";
filename = filename.replaceAll("\r\n", "");
} else { // IE及其他浏览器
filename = URLEncoder.encode(filename, "utf-8");
filename = filename.replace("+"," ");
}
return filename;
}
/**
* 创建文件夹;
* @param path
*/
public static void createFile(String path) {
File file = new File(path);
//判断文件是否存在;
if (!file.exists()) {
//创建文件;
file.mkdirs();
}
}
/**
* 生成.zip文件;
* @param path
* @throws IOException
*/
public static ZipOutputStream craeteZipPath(String path) throws IOException{
ZipOutputStream zipOutputStream = null;
File file = new File(path+DateUtils.nowDateFormat()+".zip");
zipOutputStream = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(file)));
File[] files = new File(path).listFiles();
FileInputStream fileInputStream = null;
byte[] buf = new byte[1024];
int len = 0;
if(files!=null && files.length > 0){
for(File excelFile:files){
String fileName = excelFile.getName();
fileInputStream = new FileInputStream(excelFile);
//放入压缩zip包中;
zipOutputStream.putNextEntry(new ZipEntry(path + "/"+fileName));
//读取文件;
while((len=fileInputStream.read(buf)) >0){
zipOutputStream.write(buf, 0, len);
}
//关闭;
zipOutputStream.closeEntry();
if(fileInputStream != null){
fileInputStream.close();
}
}
}
/*if(zipOutputStream !=null){
zipOutputStream.close();
}*/
return zipOutputStream;
}
/**
* //压缩文件
* @param srcfile 要压缩的文件数组
* @param zipfile 生成的zip文件对象
*/
public static void ZipFiles(java.io.File[] srcfile, File zipfile) throws Exception {
byte[] buf = new byte[1024];
FileOutputStream fos = new FileOutputStream(zipfile);
ZipOutputStream out = new ZipOutputStream(fos);
for (int i = 0; i < srcfile.length; i++) {
FileInputStream in = new FileInputStream(srcfile[i]);
out.putNextEntry(new ZipEntry(srcfile[i].getName()));
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
out.closeEntry();
in.close();
}
out.close();
fos.flush();
fos.close();
}
/**
* 删除文件夹及文件夹下所有文件
* @param dir
* @return
*/
public static boolean deleteDir(File dir) {
if (dir == null || !dir.exists()){
return true;
}
if (dir.isDirectory()) {
String[] children = dir.list();
//递归删除目录中的子目录下
for (int i=0; i<children.length; i++) {
boolean success = deleteDir(new File(dir, children[i]));
if (!success) {
return false;
}
}
}
// 目录此时为空,可以删除
return dir.delete();
}
/**
* 生成html
* @param msg
* @return
*/
public static String getErrorHtml(String msg) {
StringBuffer sb = new StringBuffer();
sb.append("<html>");
sb.append("<head>");
sb.append("<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>");
sb.append("</head>");
sb.append("<body>");
sb.append("<div id='errorInfo'> ");
sb.append("</div>");
sb.append("<script>alert('"+msg+"')</script>");
sb.append("</body>");
sb.append("</html>");
return sb.toString();
}
/**
* 设置下载excel的响应头信息
* @param response
* @param request
* @param fileName
* @throws IOException
*/
public static void setExcelHeadInfo(HttpServletResponse response, HttpServletRequest request, String fileName) {
try {
// 获取客户端浏览器的类型
String agent = request.getHeader("User-Agent");
// 对文件名重新编码
String encodingFileName = FileExcelUtil.encodeDownloadFilename(fileName, agent);
// 告诉客户端允许断点续传多线程连接下载
response.setHeader("Accept-Ranges", "bytes");
//文件后缀
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
response.setHeader("Content-Disposition", "attachment; filename=" + encodingFileName);
} catch (IOException e) {
logger.error(Thread.currentThread().getStackTrace()[1].getMethodName() +"发生的异常是: ",e);
throw new RuntimeException(e);
}
}
/**
* 设置下载zip的响应头信息
* @param response
* @param fileName 文件名
* @param request
* @throws IOException
*/
public static void setZipDownLoadHeadInfo(HttpServletResponse response, HttpServletRequest request, String fileName) throws IOException {
// 获取客户端浏览器的类型
String agent = request.getHeader("User-Agent");
response.setContentType("application/octet-stream ");
// 表示不能用浏览器直接打开
response.setHeader("Connection", "close");
// 告诉客户端允许断点续传多线程连接下载
response.setHeader("Accept-Ranges", "bytes");
// 对文件名重新编码
String encodingFileName = FileExcelUtil.encodeDownloadFilename(fileName, agent);
response.setHeader("Content-Disposition", "attachment; filename=" + encodingFileName);
}
}
\ No newline at end of file
package pwc.taxtech.atms.common.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHeaders;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.entity.mime.content.ByteArrayBody;
import org.apache.http.entity.mime.content.StringBody;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.config.FileServiceConfig;
import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.exception.ServiceException;
import java.io.IOException;
import java.net.URLEncoder;
import java.security.MessageDigest;
/**
* author kevin
* ver 1.0
*/
@Configuration
public class FileUploadUtil implements ApplicationContextAware {
protected static final Logger logger = LoggerFactory.getLogger(FileUploadUtil.class);
// Spring应用上下文环境
private static ApplicationContext applicationContext;
private static FileServiceConfig config;
private static final String HTTP_SUCCESS_CODE = "200";
protected static char hexDigits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
public static String getUploadUrl() {
config = (FileServiceConfig) applicationContext.getBean("fileServiceConfig");
return config.getUploadUrl();
}
public static String downLoadUrl() {
config = (FileServiceConfig) applicationContext.getBean("fileServiceConfig");
return config.getDownloadUrl();
}
/**
* 上传模板
*
* @param file MultipartFile
* @return Boolean
*/
public static String upload(MultipartFile file, String fileName) throws ServiceException {
if (StringUtils.isBlank(file.getOriginalFilename()) || null == file) {
throw new IllegalArgumentException("上传参数为空");
}
if (fileName == null) {
fileName = file.getOriginalFilename();
}
CloseableHttpClient httpClient = null;
String requestKey = CommonUtils.getUUID();
String requestUrl = getUploadUrl() + "/" + requestKey;
try {
/*String serverPath = serverPath();
httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(serverPath);
httpPost.addHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON.getMimeType());*/
httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(requestUrl);
String md5Str = getFileMD5String(file);
ByteArrayBody byteBody = new ByteArrayBody(file.getBytes(), ContentType.MULTIPART_FORM_DATA, StringUtils.isBlank(fileName) ? URLEncoder.encode(file.getOriginalFilename(), "UTF-8") : URLEncoder.encode(fileName, "UTF-8"));
StringBody md5 = new StringBody(md5Str, ContentType.create("text/plain"));
HttpEntity httpEntity = MultipartEntityBuilder.create().addPart("filecontent", byteBody).addPart("md5", md5).build();
httpPost.setEntity(httpEntity);
HttpResponse httpResponse = httpClient.execute(httpPost);
JSONObject resultDto = JSON.parseObject(IOUtils.toString(httpResponse.getEntity().getContent(), "UTF-8"));
if (HTTP_SUCCESS_CODE.equals(resultDto.getString("status_code")))
return requestKey;
return null;
} catch (Exception e) {
e.printStackTrace();
logger.error("uploadTemplate error.", e);
return null;
} finally {
if (null != httpClient) {
try {
httpClient.close();
} catch (IOException e) {
logger.error("close httpClient error.", e);
}
}
}
}
public static boolean downLoad(String download_url) {
CloseableHttpClient httpClient = HttpClients.createDefault();
HttpGet httpGet = new HttpGet(downLoadUrl() + "/" + download_url);
HttpResponse httpResponse = null;
try {
httpResponse = httpClient.execute(httpGet);
JSONObject resultDto = JSON.parseObject(IOUtils.toString(httpResponse.getEntity().getContent(), "UTF-8"));
if (resultDto.getString("status_code").equals(HTTP_SUCCESS_CODE))
return true;
} catch (IOException e) {
e.printStackTrace();
return false;
}
return false;
}
/**
* 实现ApplicationContextAware接口的回调方法。设置上下文环境
*
* @param applicationContext
*/
public void setApplicationContext(ApplicationContext applicationContext) {
this.applicationContext = applicationContext;
}
/**
* @return ApplicationContext
*/
public static ApplicationContext getApplicationContext() {
return applicationContext;
}
public static String getFileMD5String(MultipartFile file) throws Exception {
MessageDigest messagedigest = MessageDigest.getInstance("MD5");
messagedigest.update(file.getBytes());
byte bytes[] = messagedigest.digest();
return bufferToHex(bytes, 0, bytes.length);
}
private static String bufferToHex(byte bytes[], int m, int n) {
StringBuffer stringbuffer = new StringBuffer(2 * n);
int k = m + n;
for (int l = m; l < k; l++) {
appendHexPair(bytes[l], stringbuffer);
}
return stringbuffer.toString();
}
private static void appendHexPair(byte bt, StringBuffer stringbuffer) {
char c0 = hexDigits[(bt & 0xf0) >> 4];
char c1 = hexDigits[bt & 0xf];
stringbuffer.append(c0);
stringbuffer.append(c1);
}
}
...@@ -62,7 +62,7 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -62,7 +62,7 @@ public class SpringContextUtil implements ApplicationContextAware {
public static RevenueTypeMappingMapper revenueTypeMappingMapper; public static RevenueTypeMappingMapper revenueTypeMappingMapper;
public static InvoiceRecordMapper invoiceRecordMapper; public static InvoiceRecordMapper invoiceRecordMapper;
public static CertifiedInvoicesListMapper certifiedInvoicesListMapper; public static CertifiedInvoicesListMapper certifiedInvoicesListMapper;
public static TrialBalanceMappingMapper trialBalanceMappingMapper;
public static CashFlowMapper cashFlowMapper; public static CashFlowMapper cashFlowMapper;
...@@ -147,6 +147,7 @@ public class SpringContextUtil implements ApplicationContextAware { ...@@ -147,6 +147,7 @@ public class SpringContextUtil implements ApplicationContextAware {
revenueTypeMappingMapper = webApplicationContext.getBean(RevenueTypeMappingMapper.class); revenueTypeMappingMapper = webApplicationContext.getBean(RevenueTypeMappingMapper.class);
invoiceRecordMapper = webApplicationContext.getBean(InvoiceRecordMapper.class); invoiceRecordMapper = webApplicationContext.getBean(InvoiceRecordMapper.class);
certifiedInvoicesListMapper = webApplicationContext.getBean(CertifiedInvoicesListMapper.class); certifiedInvoicesListMapper = webApplicationContext.getBean(CertifiedInvoicesListMapper.class);
trialBalanceMappingMapper = webApplicationContext.getBean(TrialBalanceMappingMapper.class);
/* map.put("balance_sheet", balanceMapper); /* map.put("balance_sheet", balanceMapper);
map.put("profit_loss_statement",profitLossStatementMapper); map.put("profit_loss_statement",profitLossStatementMapper);
map.put("cash_flow", cashFlowMapper); map.put("cash_flow", cashFlowMapper);
......
...@@ -8,7 +8,6 @@ import org.springframework.http.ResponseEntity; ...@@ -8,7 +8,6 @@ import org.springframework.http.ResponseEntity;
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.message.ErrorMessage; import pwc.taxtech.atms.common.message.ErrorMessage;
import pwc.taxtech.atms.common.util.FileUploadUtil;
import pwc.taxtech.atms.constant.enums.EnumServiceType; import pwc.taxtech.atms.constant.enums.EnumServiceType;
import pwc.taxtech.atms.dao.OrganizationMapper; import pwc.taxtech.atms.dao.OrganizationMapper;
import pwc.taxtech.atms.dao.ProjectMapper; import pwc.taxtech.atms.dao.ProjectMapper;
...@@ -20,6 +19,7 @@ import pwc.taxtech.atms.entity.OrganizationExample; ...@@ -20,6 +19,7 @@ import pwc.taxtech.atms.entity.OrganizationExample;
import pwc.taxtech.atms.entity.Project; import pwc.taxtech.atms.entity.Project;
import pwc.taxtech.atms.entity.ProjectExample; import pwc.taxtech.atms.entity.ProjectExample;
import pwc.taxtech.atms.service.impl.BaseService; import pwc.taxtech.atms.service.impl.BaseService;
import pwc.taxtech.atms.service.impl.DidiFileUploadService;
import pwc.taxtech.atms.service.impl.ReportUploadService; import pwc.taxtech.atms.service.impl.ReportUploadService;
import pwc.taxtech.atms.vat.dao.PwcReportAttachMapper; import pwc.taxtech.atms.vat.dao.PwcReportAttachMapper;
import pwc.taxtech.atms.vat.entity.*; import pwc.taxtech.atms.vat.entity.*;
...@@ -29,6 +29,7 @@ import javax.annotation.Resource; ...@@ -29,6 +29,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.net.URISyntaxException;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
...@@ -251,13 +252,18 @@ public class ReportController { ...@@ -251,13 +252,18 @@ public class ReportController {
} }
@Autowired
private DidiFileUploadService didiFileUploadService;
@RequestMapping(value = "doUpload", method = RequestMethod.POST) @RequestMapping(value = "doUpload", method = RequestMethod.POST)
public OperationResultDto doUploadAttach(@RequestParam("fileName") String fileName, MultipartFile file, String remarks, @RequestParam("activeCol") Long activeCol, @RequestParam("activeRow") Long activeRow, @RequestParam("activeTemplateId") String activeTemplateId) { public OperationResultDto doUploadAttach(@RequestParam("fileName") String fileName, MultipartFile file, String remarks, @RequestParam("activeCol") Long activeCol, @RequestParam("activeRow") Long activeRow, @RequestParam("activeTemplateId") String activeTemplateId) {
System.out.println(activeCol + "----" + activeRow + "-----" + activeTemplateId); FileUpload fileUpload = null;
OperationResultDto operationResultDto = reportService.doUploadAttach(file, remarks); try{
if (!"error".equals(operationResultDto.getResultMsg())) {//上传成功绑定 fileUpload = didiFileUploadService.uploadFile(file, file.getOriginalFilename(), "附件上传");
reportService.bindPwcAttach(activeCol, activeRow, activeTemplateId, (FileDto) operationResultDto.getData()); }catch(Exception e){
e.printStackTrace();
} }
operationResultDto.success();
reportService.bindPwcAttach(activeCol, activeRow, activeTemplateId, fileUpload, remarks);
return operationResultDto; return operationResultDto;
} }
...@@ -274,20 +280,19 @@ public class ReportController { ...@@ -274,20 +280,19 @@ public class ReportController {
@Resource @Resource
private PwcReportAttachMapper pwcReportAttachMapper; private PwcReportAttachMapper pwcReportAttachMapper;
@RequestMapping("") /* @RequestMapping("downLoadAttach")
public OperationResultDto downLoadAttach(Long id) { public OperationResultDto downLoadAttach(Long id) {
OperationResultDto operationResultDto = new OperationResultDto(); OperationResultDto operationResultDto = new OperationResultDto();
PwcReportAttachExample example = new PwcReportAttachExample(); PwcReportAttachExample example = new PwcReportAttachExample();
PwcReportAttachExample.Criteria criteria = example.createCriteria(); PwcReportAttachExample.Criteria criteria = example.createCriteria();
criteria.andIdEqualTo(id); criteria.andIdEqualTo(id);
if (FileUploadUtil.downLoad(pwcReportAttachMapper.selectByExample(example).get(0).getFileUrl()) == true) { if (didiFileUploadService.queryPage(pwcReportAttachMapper.selectByExample(example).get(0).getFileUrl()) == true) {
return operationResultDto.success(); return operationResultDto.success();
} }
;
operationResultDto.setResultMsg("附件导出失败"); operationResultDto.setResultMsg("附件导出失败");
return operationResultDto; return operationResultDto;
} }
*/
@Resource @Resource
private OrganizationMapper organizationMapper; private OrganizationMapper organizationMapper;
...@@ -342,6 +347,12 @@ public class ReportController { ...@@ -342,6 +347,12 @@ public class ReportController {
@RequestMapping("manyExport") @RequestMapping("manyExport")
public OperationResultDto manyExport(@RequestBody RequestParameterDto requestParameterDto) { public OperationResultDto manyExport(@RequestBody RequestParameterDto requestParameterDto) {
OperationResultDto operationResultDto = new OperationResultDto(); OperationResultDto operationResultDto = new OperationResultDto();
String zipName = "利润表";
try {
reportService.manyExport(requestParameterDto, zipName);
} catch (URISyntaxException e) {
e.printStackTrace();
}
operationResultDto.setResult(null); operationResultDto.setResult(null);
return operationResultDto; return operationResultDto;
} }
......
...@@ -75,7 +75,7 @@ public class DidiFileUploadService extends BaseService { ...@@ -75,7 +75,7 @@ public class DidiFileUploadService extends BaseService {
private static final String PROXY_PORT = "11007"; private static final String PROXY_PORT = "11007";
public FileUpload getFileUpload(String uid){ public FileUpload getFileUpload(String uid) {
return fileUploadMapper.selectByPrimaryKey(uid); return fileUploadMapper.selectByPrimaryKey(uid);
} }
...@@ -127,8 +127,7 @@ public class DidiFileUploadService extends BaseService { ...@@ -127,8 +127,7 @@ public class DidiFileUploadService extends BaseService {
throw new ServiceException("uploadFile error."); throw new ServiceException("uploadFile error.");
} }
public FileUpload uploadFile(byte[] bytes, String fileName, String bizSource) throws ServiceException public FileUpload uploadFile(byte[] bytes, String fileName, String bizSource) throws ServiceException {
{
CloseableHttpClient httpClient = null; CloseableHttpClient httpClient = null;
String requestKey = CommonUtils.getUUID(); String requestKey = CommonUtils.getUUID();
String requestUrl = upload_post_url + "/" + requestKey; String requestUrl = upload_post_url + "/" + requestKey;
...@@ -173,6 +172,7 @@ public class DidiFileUploadService extends BaseService { ...@@ -173,6 +172,7 @@ public class DidiFileUploadService extends BaseService {
} }
throw new ServiceException("uploadFile error."); throw new ServiceException("uploadFile error.");
} }
public static String getFileMD5String(MultipartFile file) throws Exception { public static String getFileMD5String(MultipartFile file) throws Exception {
MessageDigest messagedigest = MessageDigest.getInstance("MD5"); MessageDigest messagedigest = MessageDigest.getInstance("MD5");
messagedigest.update(file.getBytes()); messagedigest.update(file.getBytes());
...@@ -197,7 +197,6 @@ public class DidiFileUploadService extends BaseService { ...@@ -197,7 +197,6 @@ public class DidiFileUploadService extends BaseService {
} }
public PageInfo<DidiFileUploadDetailResult> queryPage(DidiFileIUploadParam param) { public PageInfo<DidiFileUploadDetailResult> queryPage(DidiFileIUploadParam param) {
Page page = null; Page page = null;
if (param.getPageInfo() != null && param.getPageInfo().getPageSize() != null && param.getPageInfo().getPageIndex() != null) { if (param.getPageInfo() != null && param.getPageInfo().getPageSize() != null && param.getPageInfo().getPageIndex() != null) {
......
...@@ -596,7 +596,7 @@ public class ReportGeneratorImpl { ...@@ -596,7 +596,7 @@ public class ReportGeneratorImpl {
new BB(formulaContext), new XXFP(formulaContext), new GZSD(formulaContext), new PC(formulaContext) new BB(formulaContext), new XXFP(formulaContext), new GZSD(formulaContext), new PC(formulaContext)
, new JXFPMX(formulaContext), new JXFP(formulaContext), new PSUM(formulaContext), new DFFS(formulaContext), , new JXFPMX(formulaContext), new JXFP(formulaContext), new PSUM(formulaContext), new DFFS(formulaContext),
new JFFS(formulaContext), new WPSR(formulaContext), new WPNAME(formulaContext), new WPTYPE(formulaContext), new JFFS(formulaContext), new WPSR(formulaContext), new WPNAME(formulaContext), new WPTYPE(formulaContext),
new SUM2(formulaContext), new RSUMIF(formulaContext), new SUM(formulaContext),new KPSR(formulaContext)}; new SUM2(formulaContext), new RSUMIF(formulaContext), new SUM(formulaContext),new KPSR(formulaContext),new TBM(formulaContext)};
UDFFinder udfs = new DefaultUDFFinder(functions, functionImpls); UDFFinder udfs = new DefaultUDFFinder(functions, functionImpls);
UDFFinder udfToolpack = new AggregatingUDFFinder(udfs); UDFFinder udfToolpack = new AggregatingUDFFinder(udfs);
workbook.addToolPack(udfToolpack); workbook.addToolPack(udfToolpack);
......
package pwc.taxtech.atms.vat.service.impl.report.functions;
import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils;
import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction;
import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto;
import pwc.taxtech.atms.entity.Organization;
import pwc.taxtech.atms.vat.entity.*;
import java.math.BigDecimal;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
/**
* 根据报表项目与科目映射取出科目代码,再通过入参进行TB表数据计算
*/
public class TBM extends FunctionBase implements FreeRefFunction {
public TBM(FormulaContext formulaContext) {
super(formulaContext);
}
@Override
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {
if (args.length < 4) {
return null;
}
int evenType = getIntParam(args[0], ec);//事件类型,1:利润映射,2:资产映射
String mappingName = getStringParam(args[1], ec);//映射名称
int calculateType = getIntParam(args[2], ec);//计算类型,当取利润时候,1:贷方-借方,2:借方-贷方。当取资产时,1:正数,2:负数
int sourceDataType = getIntParam(args[3], ec);//取值数据源
String formulaExpression = "TBM(" + evenType + ",\""+mappingName+ "\","+calculateType+","+sourceDataType+ ")";
List<ReportCellDataSourceDto> dataSource = Lists.newArrayList();
List<String> segment3List = getSegment3List(evenType,mappingName);
if(CollectionUtils.isEmpty(segment3List)){
return NumberEval.ZERO;
}
double result = 0.00;
if (sourceDataType == 1) {
result = countForTrialBalance(evenType,calculateType,segment3List,dataSource,formulaContext.getPeriod(),formulaContext.getYear(),formulaContext.getOrganizationId());
} else if (sourceDataType == 2) {
result = countForAdjBalance(evenType,calculateType,segment3List,dataSource,formulaContext.getPeriod(),formulaContext.getYear(),formulaContext.getOrganizationId());
} else if (sourceDataType == 3) {
result = countForTrialFinalBalance(evenType,calculateType,segment3List,dataSource,formulaContext.getPeriod(),formulaContext.getYear(),formulaContext.getOrganizationId());
} else {
return NumberEval.ZERO;
}
Long dataSoureId = saveDataSource(ec, Collections.singletonList(dataSource),
FormulaDataSourceDetailType.FormulaDataSourceDto,
new BigDecimal(result), formulaContext.getPeriod(), formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId());
saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, new BigDecimal(result), dataSoureId, formulaContext.getProjectId());
return new NumberEval(result);
}
public List<String> getSegment3List(int eventType,String mappingName){
TrialBalanceMappingExample example = new TrialBalanceMappingExample();
if(eventType == 1){
example.createCriteria().andPlTypeEqualTo(mappingName);
}else if(eventType == 2){
example.createCriteria().andBsTypeEqualTo(mappingName);
}
List<TrialBalanceMapping> dataList = SpringContextUtil.trialBalanceMappingMapper.selectByExample(example);
return dataList.stream()
.map(o -> o.getSegment3()).collect(Collectors.toList());
}
private int pardePeriod(int period, int year) {
return Integer.parseInt("" + year + (period > 9 ? period : ("0" + period)));
}
private double countForTrialBalance(int eventType,int calculateType,List<String> segment3List, List<ReportCellDataSourceDto> contain, int period, int year, String orgId) {
Organization organization = SpringContextUtil.organizationMapper.selectByPrimaryKey(orgId);
TrialBalanceExample glBalanceExample = new TrialBalanceExample();
TrialBalanceExample.Criteria c1 = glBalanceExample.createCriteria().andSegment3In(segment3List)
.andPeriodEqualTo(pardePeriod(period, year));
if (organization != null) {
c1.andOrganizationIdEqualTo(organization.getId());
}
List<TrialBalance> list = SpringContextUtil.trialBalanceMapper.selectByExample(glBalanceExample);
if (CollectionUtils.isEmpty(list)) {
return 0.0;
}
BigDecimal amount = new BigDecimal(0);
for (TrialBalance balance : list) {
ReportCellDataSourceDto dto = new ReportCellDataSourceDto();
if(eventType == 1 ){
if(calculateType == 1){
dto.setAmount(balance.getPeriodCrBeq().subtract(balance.getPeriodDrBeq()));
}else if(calculateType == 2){
dto.setAmount(balance.getPeriodDrBeq().subtract(balance.getPeriodCrBeq()));
}
}else if(eventType == 2){
if(calculateType == 1){
dto.setAmount(balance.getEndBalBeq());
}else if(calculateType == 2){
dto.setAmount(balance.getEndBalBeq().multiply(new BigDecimal(-1)));
}
}
amount = amount.add(dto.getAmount());
dto.setPeriod(period);
dto.setIsOnlyManualInput(Boolean.FALSE);
dto.setName(Constant.DataSourceName.ReportDataSource);
dto.setType(FormulaDataSourceType.TrialBalanceSource.getCode());
contain.add(dto);
}
return amount.doubleValue();
}
private double countForAdjBalance(int eventType,int calculateType,List<String> segment3List, List<ReportCellDataSourceDto> contain, int period, int year, String orgId) {
Organization organization = SpringContextUtil.organizationMapper.selectByPrimaryKey(orgId);
AdjustmentTableExample glBalanceExample = new AdjustmentTableExample();
AdjustmentTableExample.Criteria c1 = glBalanceExample.createCriteria().andSegment3In(segment3List)
.andPeriodEqualTo(pardePeriod(period, year));
if (organization != null) {
c1.andOrganizationIdEqualTo(organization.getId());
}
List<AdjustmentTable> list = SpringContextUtil.adjustmentTableMapper.selectByExample(glBalanceExample);
if (CollectionUtils.isEmpty(list)) {
return 0.0;
}
BigDecimal amount = new BigDecimal(0);
for (AdjustmentTable balance : list) {
ReportCellDataSourceDto dto = new ReportCellDataSourceDto();
if(eventType == 1 ){
if(calculateType == 1){
dto.setAmount(balance.getPeriodCrBeq().subtract(balance.getPeriodDrBeq()));
}else if(calculateType == 2){
dto.setAmount(balance.getPeriodDrBeq().subtract(balance.getPeriodCrBeq()));
}
}else if(eventType == 2){
if(calculateType == 1){
dto.setAmount(balance.getEndBalBeq());
}else if(calculateType == 2){
dto.setAmount(balance.getEndBalBeq().multiply(new BigDecimal(-1)));
}
}
amount.add(dto.getAmount());
dto.setPeriod(period);
dto.setIsOnlyManualInput(Boolean.FALSE);
dto.setName(Constant.DataSourceName.ReportDataSource);
dto.setType(FormulaDataSourceType.TrialBalanceSource.getCode());
contain.add(dto);
}
return amount.doubleValue();
}
private double countForTrialFinalBalance(int eventType,int calculateType,List<String> segment3List, List<ReportCellDataSourceDto> contain, int period, int year, String orgId) {
Organization organization = SpringContextUtil.organizationMapper.selectByPrimaryKey(orgId);
TrialBalanceFinalExample glBalanceExample = new TrialBalanceFinalExample();
TrialBalanceFinalExample.Criteria c1 = glBalanceExample.createCriteria().andSegment3In(segment3List)
.andPeriodEqualTo(pardePeriod(period, year));
if (organization != null) {
c1.andOrganizationIdEqualTo(organization.getId());
}
List<TrialBalanceFinal> list = SpringContextUtil.trialBalanceFinalMapper.selectByExample(glBalanceExample);
if (CollectionUtils.isEmpty(list)) {
return 0.0;
}
BigDecimal amount = new BigDecimal(0);
for (TrialBalanceFinal balance : list) {
ReportCellDataSourceDto dto = new ReportCellDataSourceDto();
if(eventType == 1 ){
if(calculateType == 1){
dto.setAmount(balance.getPeriodCrBeq().subtract(balance.getPeriodDrBeq()));
}else if(calculateType == 2){
dto.setAmount(balance.getPeriodDrBeq().subtract(balance.getPeriodCrBeq()));
}
}else if(eventType == 2){
if(calculateType == 1){
dto.setAmount(balance.getEndBalBeq());
}else if(calculateType == 2){
dto.setAmount(balance.getEndBalBeq().multiply(new BigDecimal(-1)));
}
}
amount.add(dto.getAmount());
dto.setPeriod(period);
dto.setIsOnlyManualInput(Boolean.FALSE);
dto.setName(Constant.DataSourceName.ReportDataSource);
dto.setType(FormulaDataSourceType.TrialBalanceSource.getCode());
contain.add(dto);
}
return amount.doubleValue();
}
}
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<javaClientGenerator type="XMLMAPPER" targetPackage="pwc.taxtech.atms.vat.dao" targetProject="../../src/main/java"> <javaClientGenerator type="XMLMAPPER" targetPackage="pwc.taxtech.atms.vat.dao" targetProject="../../src/main/java">
<property name="rootInterface" value="pwc.taxtech.atms.MyVatMapper" /> <property name="rootInterface" value="pwc.taxtech.atms.MyVatMapper" />
</javaClientGenerator> </javaClientGenerator>
<table tableName="ebit_spread_data" domainObjectName="EbitSpreadData"> <table tableName="pwc_report_attach" domainObjectName="PwcReportAttach">
<property name="useActualColumnNames" value="false"/> <property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/> <property name="ignoreQualifiersAtRuntime" value="true"/>
</table> </table>
...@@ -548,11 +548,11 @@ ...@@ -548,11 +548,11 @@
<property name="useActualColumnNames" value="false"/> <property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/> <property name="ignoreQualifiersAtRuntime" value="true"/>
</table>--> </table>-->
<!--
<table tableName="period_cell_data" domainObjectName="PeriodCellData"> <table tableName="period_cell_data" domainObjectName="PeriodCellData">
<property name="useActualColumnNames" value="false"/> <property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/> <property name="ignoreQualifiersAtRuntime" value="true"/>
</table> </table>-->
<!--<table tableName="period_cell_data_source" domainObjectName="PeriodCellDataSource"> <!--<table tableName="period_cell_data_source" domainObjectName="PeriodCellDataSource">
<property name="useActualColumnNames" value="false"/> <property name="useActualColumnNames" value="false"/>
......
...@@ -3,6 +3,7 @@ package pwc.taxtech.atms.vat.dao; ...@@ -3,6 +3,7 @@ package pwc.taxtech.atms.vat.dao;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper; import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.entity.EbitCellData; import pwc.taxtech.atms.vat.entity.EbitCellData;
...@@ -109,4 +110,8 @@ public interface EbitCellDataMapper extends MyVatMapper { ...@@ -109,4 +110,8 @@ public interface EbitCellDataMapper extends MyVatMapper {
int insertBatch(List<EbitCellData> pls); int insertBatch(List<EbitCellData> pls);
@Select({
"SELECT DISTINCT t.organization_id as organizationId FROM ebit_cell_data t WHERE 1=1 AND t.`period` = #{period}"
})
List<EbitCellData> selectOrgType(@Param("period") Integer period);
} }
\ No newline at end of file
package pwc.taxtech.atms.vat.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.entity.TrialBalanceMapping;
import pwc.taxtech.atms.vat.entity.TrialBalanceMappingExample;
@Mapper
public interface TrialBalanceMappingMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table trial_balance_mapping
*
* @mbg.generated
*/
long countByExample(TrialBalanceMappingExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table trial_balance_mapping
*
* @mbg.generated
*/
int deleteByExample(TrialBalanceMappingExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table trial_balance_mapping
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table trial_balance_mapping
*
* @mbg.generated
*/
int insert(TrialBalanceMapping record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table trial_balance_mapping
*
* @mbg.generated
*/
int insertSelective(TrialBalanceMapping record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table trial_balance_mapping
*
* @mbg.generated
*/
List<TrialBalanceMapping> selectByExampleWithRowbounds(TrialBalanceMappingExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table trial_balance_mapping
*
* @mbg.generated
*/
List<TrialBalanceMapping> selectByExample(TrialBalanceMappingExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table trial_balance_mapping
*
* @mbg.generated
*/
TrialBalanceMapping selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table trial_balance_mapping
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") TrialBalanceMapping record, @Param("example") TrialBalanceMappingExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table trial_balance_mapping
*
* @mbg.generated
*/
int updateByExample(@Param("record") TrialBalanceMapping record, @Param("example") TrialBalanceMappingExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table trial_balance_mapping
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(TrialBalanceMapping record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table trial_balance_mapping
*
* @mbg.generated
*/
int updateByPrimaryKey(TrialBalanceMapping record);
}
\ No newline at end of file
...@@ -126,6 +126,17 @@ public class PwcReportAttach extends BaseEntity implements Serializable { ...@@ -126,6 +126,17 @@ public class PwcReportAttach extends BaseEntity implements Serializable {
*/ */
private Date updateTime; private Date updateTime;
/**
* Database Column Remarks:
* 文件上传id,绑定文件库(file_upload)
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column pwc_report_attach.file_upload_id
*
* @mbg.generated
*/
private String fileUploadId;
/** /**
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database table pwc_report_attach * This field corresponds to the database table pwc_report_attach
...@@ -422,6 +433,30 @@ public class PwcReportAttach extends BaseEntity implements Serializable { ...@@ -422,6 +433,30 @@ public class PwcReportAttach extends BaseEntity implements Serializable {
this.updateTime = updateTime; this.updateTime = updateTime;
} }
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column pwc_report_attach.file_upload_id
*
* @return the value of pwc_report_attach.file_upload_id
*
* @mbg.generated
*/
public String getFileUploadId() {
return fileUploadId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column pwc_report_attach.file_upload_id
*
* @param fileUploadId the value for pwc_report_attach.file_upload_id
*
* @mbg.generated
*/
public void setFileUploadId(String fileUploadId) {
this.fileUploadId = fileUploadId == null ? null : fileUploadId.trim();
}
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table pwc_report_attach * This method corresponds to the database table pwc_report_attach
...@@ -446,6 +481,7 @@ public class PwcReportAttach extends BaseEntity implements Serializable { ...@@ -446,6 +481,7 @@ public class PwcReportAttach extends BaseEntity implements Serializable {
sb.append(", remarks=").append(remarks); sb.append(", remarks=").append(remarks);
sb.append(", createTime=").append(createTime); sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime); sb.append(", updateTime=").append(updateTime);
sb.append(", fileUploadId=").append(fileUploadId);
sb.append("]"); sb.append("]");
return sb.toString(); return sb.toString();
} }
......
...@@ -984,6 +984,76 @@ public class PwcReportAttachExample { ...@@ -984,6 +984,76 @@ public class PwcReportAttachExample {
addCriterion("update_time not between", value1, value2, "updateTime"); addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andFileUploadIdIsNull() {
addCriterion("file_upload_id is null");
return (Criteria) this;
}
public Criteria andFileUploadIdIsNotNull() {
addCriterion("file_upload_id is not null");
return (Criteria) this;
}
public Criteria andFileUploadIdEqualTo(String value) {
addCriterion("file_upload_id =", value, "fileUploadId");
return (Criteria) this;
}
public Criteria andFileUploadIdNotEqualTo(String value) {
addCriterion("file_upload_id <>", value, "fileUploadId");
return (Criteria) this;
}
public Criteria andFileUploadIdGreaterThan(String value) {
addCriterion("file_upload_id >", value, "fileUploadId");
return (Criteria) this;
}
public Criteria andFileUploadIdGreaterThanOrEqualTo(String value) {
addCriterion("file_upload_id >=", value, "fileUploadId");
return (Criteria) this;
}
public Criteria andFileUploadIdLessThan(String value) {
addCriterion("file_upload_id <", value, "fileUploadId");
return (Criteria) this;
}
public Criteria andFileUploadIdLessThanOrEqualTo(String value) {
addCriterion("file_upload_id <=", value, "fileUploadId");
return (Criteria) this;
}
public Criteria andFileUploadIdLike(String value) {
addCriterion("file_upload_id like", value, "fileUploadId");
return (Criteria) this;
}
public Criteria andFileUploadIdNotLike(String value) {
addCriterion("file_upload_id not like", value, "fileUploadId");
return (Criteria) this;
}
public Criteria andFileUploadIdIn(List<String> values) {
addCriterion("file_upload_id in", values, "fileUploadId");
return (Criteria) this;
}
public Criteria andFileUploadIdNotIn(List<String> values) {
addCriterion("file_upload_id not in", values, "fileUploadId");
return (Criteria) this;
}
public Criteria andFileUploadIdBetween(String value1, String value2) {
addCriterion("file_upload_id between", value1, value2, "fileUploadId");
return (Criteria) this;
}
public Criteria andFileUploadIdNotBetween(String value1, String value2) {
addCriterion("file_upload_id not between", value1, value2, "fileUploadId");
return (Criteria) this;
}
} }
/** /**
......
package pwc.taxtech.atms.vat.entity;
import java.io.Serializable;
import pwc.taxtech.atms.entity.BaseEntity;
/**
*
* This class was generated by MyBatis Generator.
* This class corresponds to the database table trial_balance_mapping
*
* @mbg.generated do_not_delete_during_merge
*/
public class TrialBalanceMapping extends BaseEntity implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column trial_balance_mapping.id
*
* @mbg.generated
*/
private Long id;
/**
* Database Column Remarks:
* 科目代码
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column trial_balance_mapping.segment3
*
* @mbg.generated
*/
private String segment3;
/**
* Database Column Remarks:
* 科目名称
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column trial_balance_mapping.segment3_name
*
* @mbg.generated
*/
private String segment3Name;
/**
* Database Column Remarks:
* 资产负债表类型
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column trial_balance_mapping.bs_type
*
* @mbg.generated
*/
private String bsType;
/**
* Database Column Remarks:
* 利润表类型映射
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column trial_balance_mapping.pl_type
*
* @mbg.generated
*/
private String plType;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table trial_balance_mapping
*
* @mbg.generated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column trial_balance_mapping.id
*
* @return the value of trial_balance_mapping.id
*
* @mbg.generated
*/
public Long getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column trial_balance_mapping.id
*
* @param id the value for trial_balance_mapping.id
*
* @mbg.generated
*/
public void setId(Long id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column trial_balance_mapping.segment3
*
* @return the value of trial_balance_mapping.segment3
*
* @mbg.generated
*/
public String getSegment3() {
return segment3;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column trial_balance_mapping.segment3
*
* @param segment3 the value for trial_balance_mapping.segment3
*
* @mbg.generated
*/
public void setSegment3(String segment3) {
this.segment3 = segment3 == null ? null : segment3.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column trial_balance_mapping.segment3_name
*
* @return the value of trial_balance_mapping.segment3_name
*
* @mbg.generated
*/
public String getSegment3Name() {
return segment3Name;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column trial_balance_mapping.segment3_name
*
* @param segment3Name the value for trial_balance_mapping.segment3_name
*
* @mbg.generated
*/
public void setSegment3Name(String segment3Name) {
this.segment3Name = segment3Name == null ? null : segment3Name.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column trial_balance_mapping.bs_type
*
* @return the value of trial_balance_mapping.bs_type
*
* @mbg.generated
*/
public String getBsType() {
return bsType;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column trial_balance_mapping.bs_type
*
* @param bsType the value for trial_balance_mapping.bs_type
*
* @mbg.generated
*/
public void setBsType(String bsType) {
this.bsType = bsType == null ? null : bsType.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column trial_balance_mapping.pl_type
*
* @return the value of trial_balance_mapping.pl_type
*
* @mbg.generated
*/
public String getPlType() {
return plType;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column trial_balance_mapping.pl_type
*
* @param plType the value for trial_balance_mapping.pl_type
*
* @mbg.generated
*/
public void setPlType(String plType) {
this.plType = plType == null ? null : plType.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table trial_balance_mapping
*
* @mbg.generated
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", segment3=").append(segment3);
sb.append(", segment3Name=").append(segment3Name);
sb.append(", bsType=").append(bsType);
sb.append(", plType=").append(plType);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<result column="remarks" jdbcType="VARCHAR" property="remarks" /> <result column="remarks" jdbcType="VARCHAR" property="remarks" />
<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="file_upload_id" jdbcType="VARCHAR" property="fileUploadId" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<!-- <!--
...@@ -91,7 +92,7 @@ ...@@ -91,7 +92,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
id, template_id, col, `row`, del_flag, file_name, file_url, upload_user, `size`, id, template_id, col, `row`, del_flag, file_name, file_url, upload_user, `size`,
remarks, create_time, update_time remarks, create_time, update_time, file_upload_id
</sql> </sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.PwcReportAttachExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.PwcReportAttachExample" resultMap="BaseResultMap">
<!-- <!--
...@@ -147,13 +148,13 @@ ...@@ -147,13 +148,13 @@
insert into pwc_report_attach (id, template_id, col, insert into pwc_report_attach (id, template_id, col,
`row`, del_flag, file_name, `row`, del_flag, file_name,
file_url, upload_user, `size`, file_url, upload_user, `size`,
remarks, create_time, update_time remarks, create_time, update_time,
) file_upload_id)
values (#{id,jdbcType=BIGINT}, #{templateId,jdbcType=VARCHAR}, #{col,jdbcType=BIGINT}, values (#{id,jdbcType=BIGINT}, #{templateId,jdbcType=VARCHAR}, #{col,jdbcType=BIGINT},
#{row,jdbcType=BIGINT}, #{delFlag,jdbcType=VARCHAR}, #{fileName,jdbcType=VARCHAR}, #{row,jdbcType=BIGINT}, #{delFlag,jdbcType=VARCHAR}, #{fileName,jdbcType=VARCHAR},
#{fileUrl,jdbcType=VARCHAR}, #{uploadUser,jdbcType=VARCHAR}, #{size,jdbcType=VARCHAR}, #{fileUrl,jdbcType=VARCHAR}, #{uploadUser,jdbcType=VARCHAR}, #{size,jdbcType=VARCHAR},
#{remarks,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP} #{remarks,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
) #{fileUploadId,jdbcType=VARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.vat.entity.PwcReportAttach"> <insert id="insertSelective" parameterType="pwc.taxtech.atms.vat.entity.PwcReportAttach">
<!-- <!--
...@@ -198,6 +199,9 @@ ...@@ -198,6 +199,9 @@
<if test="updateTime != null"> <if test="updateTime != null">
update_time, update_time,
</if> </if>
<if test="fileUploadId != null">
file_upload_id,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
...@@ -236,6 +240,9 @@ ...@@ -236,6 +240,9 @@
<if test="updateTime != null"> <if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="fileUploadId != null">
#{fileUploadId,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="pwc.taxtech.atms.vat.entity.PwcReportAttachExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="pwc.taxtech.atms.vat.entity.PwcReportAttachExample" resultType="java.lang.Long">
...@@ -291,6 +298,9 @@ ...@@ -291,6 +298,9 @@
<if test="record.updateTime != null"> <if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="record.fileUploadId != null">
file_upload_id = #{record.fileUploadId,jdbcType=VARCHAR},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
...@@ -313,7 +323,8 @@ ...@@ -313,7 +323,8 @@
`size` = #{record.size,jdbcType=VARCHAR}, `size` = #{record.size,jdbcType=VARCHAR},
remarks = #{record.remarks,jdbcType=VARCHAR}, remarks = #{record.remarks,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP} update_time = #{record.updateTime,jdbcType=TIMESTAMP},
file_upload_id = #{record.fileUploadId,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
...@@ -358,6 +369,9 @@ ...@@ -358,6 +369,9 @@
<if test="updateTime != null"> <if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="fileUploadId != null">
file_upload_id = #{fileUploadId,jdbcType=VARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
...@@ -377,7 +391,8 @@ ...@@ -377,7 +391,8 @@
`size` = #{size,jdbcType=VARCHAR}, `size` = #{size,jdbcType=VARCHAR},
remarks = #{remarks,jdbcType=VARCHAR}, remarks = #{remarks,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP} update_time = #{updateTime,jdbcType=TIMESTAMP},
file_upload_id = #{fileUploadId,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.vat.entity.PwcReportAttachExample" resultMap="BaseResultMap"> <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.vat.entity.PwcReportAttachExample" resultMap="BaseResultMap">
......
...@@ -809,7 +809,7 @@ ...@@ -809,7 +809,7 @@
.sub-title-span { .sub-title-span {
line-height: 1.42857143; line-height: 1.42857143;
font-family: 'Microsoft YaHei'; font-family: 'Microsoft YaHei';
font-weight: 409; font-weight: 409px;
font-style: normal; font-style: normal;
font-size: 13px; font-size: 13px;
color: #434343; color: #434343;
...@@ -1136,3 +1136,22 @@ ...@@ -1136,3 +1136,22 @@
} }
} }
} }
.col-sm-8{
width: 52.666667%;
text-align: left!important;
}
.col-sm-4{
width: 45.333333%;
text-align: left!important;
}
.swxx {
.col-sm-4{
width: 25.333333%;
text-align: left!important;
}
.col-sm-2{
width: 23.666667%;
}
margin-top: 20px;
}
...@@ -3068,7 +3068,7 @@ ...@@ -3068,7 +3068,7 @@
templateId : $scope.templateId templateId : $scope.templateId
} }
$timeout(function () { /* $timeout(function () {
$('#busy-indicator-container').show(); $('#busy-indicator-container').show();
var mainSpread = new GC.Spread.Sheets.Workbook(document.getElementById("report"), {sheetCount: 1}); var mainSpread = new GC.Spread.Sheets.Workbook(document.getElementById("report"), {sheetCount: 1});
mainSpread.isPaintSuspended(true); mainSpread.isPaintSuspended(true);
...@@ -3087,7 +3087,6 @@ ...@@ -3087,7 +3087,6 @@
} }
var excelIo = new GC.Spread.Excel.IO(); var excelIo = new GC.Spread.Excel.IO();
// here is excel IO API
excelIo.save(mainSpread.toJSON(), function (blob) { excelIo.save(mainSpread.toJSON(), function (blob) {
if ('export' == $scope.evenType) { if ('export' == $scope.evenType) {
saveAs(blob, vatSessionService.project.name + '-' + vatSessionService.month + '-纳税申报.xlsx'); saveAs(blob, vatSessionService.project.name + '-' + vatSessionService.month + '-纳税申报.xlsx');
...@@ -3099,7 +3098,7 @@ ...@@ -3099,7 +3098,7 @@
$('.export-container').html(''); $('.export-container').html('');
$('#export').html(''); $('#export').html('');
$log.debug(mainSpread); $log.debug(mainSpread);
}, 500); }, 500);*/
vatReportService.manyExport(JSON.stringify(param)).success(function(res){ vatReportService.manyExport(JSON.stringify(param)).success(function(res){
}).error(function(error){ }).error(function(error){
......
...@@ -2487,7 +2487,7 @@ ...@@ -2487,7 +2487,7 @@
{ {
caption: '文件名', dataField: "fileName", cellTemplate: function (container, options) { caption: '文件名', dataField: "fileName", cellTemplate: function (container, options) {
try { try {
$('<a href="javascript:;" onClick = "downLoadAttach('+options.data.id+')" target="_blank" style="cursor: pointer">"' + options.data.fileName + '"</a>&nbsp;&nbsp;') $('<a href="'+options.data.fileUrl+'" target="_blank" style="cursor: pointer">"' + options.data.fileName + '"</a>&nbsp;&nbsp;')
.appendTo(container); .appendTo(container);
} }
catch (e) { catch (e) {
......
...@@ -45,13 +45,18 @@ ...@@ -45,13 +45,18 @@
</div> </div>
</div> </div>
</div> </div>
<div class="form-group" ng-show="!editModel.addExists"> <div class="form-group radio-wrapper" ng-show="!editModel.addExists">
<div class="col-sm-9 normal-label checkbox"> <label for="telCode" class="col-sm-4 normal-label">
<label> <input type="radio" id="allowManual"><span>允许手工录入</span>
<input type="checkbox" ng-model="editModel.defaultInput" ng-true-value="1" ng-false-value="0"> {{'AllowKeyInByDefault' | translate}} </label>
</label>
</div>
</div> </div>
<!--<div class="form-group" ng-show="!editModel.addExists">-->
<!--<div class="col-sm-9 normal-label checkbox">-->
<!--<label>-->
<!--<input type="checkbox" ng-model="editModel.defaultInput" ng-true-value="1" ng-false-value="0"> {{'AllowKeyInByDefault' | translate}}-->
<!--</label>-->
<!--</div>-->
<!--</div>-->
</form> </form>
</div> </div>
<div class="modal-footer" style="padding-left: 22px;text-align: left;"> <div class="modal-footer" style="padding-left: 22px;text-align: left;">
......
...@@ -703,16 +703,16 @@ ...@@ -703,16 +703,16 @@
if ($scope.detail.dataGridSource && $scope.detail.dataGridSource.length > 0) { if ($scope.detail.dataGridSource && $scope.detail.dataGridSource.length > 0) {
//判断是否是动态生成sheet //判断是否是动态生成sheet
if(new Number($scope.detail.cellTemplateId)<0){ // if(new Number($scope.detail.cellTemplateId)<0){
$("#dataGridFooterSummary").html(""); // $("#dataGridFooterSummary").html("");
}else{ // }else{
evalVal = _.reduce($scope.detail.dataGridSource, function (memo, x) { // evalVal = _.reduce($scope.detail.dataGridSource, function (memo, x) {
return memo + x.cellValue; // return memo + x.cellValue;
}, 0); // }, 0);
$("#dataGridFooterSummary").html($translate.instant('Conclusion') + // $("#dataGridFooterSummary").html($translate.instant('Conclusion') +
'&nbsp;&nbsp;&nbsp;&nbsp;' + evalVal.formatAmount(precition)); // '&nbsp;&nbsp;&nbsp;&nbsp;' + evalVal.formatAmount(precition));
} // }
$("#dataGridFooterSummary").html("");
} }
...@@ -2322,7 +2322,7 @@ ...@@ -2322,7 +2322,7 @@
{ {
caption: '文件名', dataField: "fileName", cellTemplate: function (container, options) { caption: '文件名', dataField: "fileName", cellTemplate: function (container, options) {
try { try {
$('<a href="' + options.data.fileUrl + '" target="_blank" style="cursor: pointer">"' + options.data.fileName + '"</a>&nbsp;&nbsp;') $('<a href="'+options.data.fileUrl +'" target="_blank" style="cursor: pointer">"' + options.data.fileName + '"</a>&nbsp;&nbsp;')
.appendTo(container); .appendTo(container);
} }
catch (e) { catch (e) {
...@@ -2337,7 +2337,7 @@ ...@@ -2337,7 +2337,7 @@
{ {
caption: '操作', cellTemplate: function (container, options) { caption: '操作', cellTemplate: function (container, options) {
try { try {
$('<button type="button" class="btn btn-in-grid" onclick = "deleteAttach(' + options.data.id + ')"><i class="material-icons middle" style="vertical-align: text-bottom">delete</i>删除</button>&nbsp;&nbsp;') $('<button type="button" class="btn btn-in-grid" style="margin-top: -11px;" onclick = "deleteAttach(' + options.data.id + ')"><i class="material-icons middle" style="vertical-align: text-bottom">delete</i>删除</button>&nbsp;&nbsp;')
.appendTo(container); .appendTo(container);
} }
catch (e) { catch (e) {
...@@ -2361,6 +2361,17 @@ ...@@ -2361,6 +2361,17 @@
dataSource: '_gridData' dataSource: '_gridData'
} }
}; };
window.downLoadAttach = function(id){
vatReportService.downLoadAttach(id).success(function (res) {
if(res.result){
//导出成功
}else{
SweetAlert.error(res.resultMsg);
}
}).error();
}
window.deleteAttach = function (id, data) { window.deleteAttach = function (id, data) {
swal({ swal({
title: "warning!", title: "warning!",
......
...@@ -244,9 +244,8 @@ ...@@ -244,9 +244,8 @@
}, },
downLoadAttach : function(id){ downLoadAttach : function(id){
return $http.get('/Report/downLoadAttach?id=' + id); return $http.get('/Report/downLoadAttach?id=' + id, apiConfig.createVat());
} }
}; };
}]); }]);
\ No newline at end of file
...@@ -121,6 +121,7 @@ frameworkModule.controller('AppNavController', ['$rootScope', '$scope', '$log', ...@@ -121,6 +121,7 @@ frameworkModule.controller('AppNavController', ['$rootScope', '$scope', '$log',
list.push(constant.analysisPermisson.code); list.push(constant.analysisPermisson.code);
list.push(constant.menuRecordManagePermission.code); list.push(constant.menuRecordManagePermission.code);
list.push(constant.menuListApprovalPermission.code); list.push(constant.menuListApprovalPermission.code);
list.push(constant.batchImportPermisson.batchImportPermissonCode);
$scope.$root.checkUserPermissionList(list).success(function (data) { $scope.$root.checkUserPermissionList(list).success(function (data) {
$scope.adminSettingShow = data[constant.adminPermission.WebAdmin]; $scope.adminSettingShow = data[constant.adminPermission.WebAdmin];
...@@ -130,6 +131,8 @@ frameworkModule.controller('AppNavController', ['$rootScope', '$scope', '$log', ...@@ -130,6 +131,8 @@ frameworkModule.controller('AppNavController', ['$rootScope', '$scope', '$log',
$scope.analysisShow = data[constant.analysisPermisson.code]; $scope.analysisShow = data[constant.analysisPermisson.code];
$scope.menuRecordManageShow = data[constant.menuRecordManagePermission.code]; $scope.menuRecordManageShow = data[constant.menuRecordManagePermission.code];
$scope.menuListApprovalShow = data[constant.menuListApprovalPermission.code]; $scope.menuListApprovalShow = data[constant.menuListApprovalPermission.code];
$scope.batchImportShow = data[constant.batchImportPermisson.batchImportPermissonCode];
}); });
}; };
......
...@@ -78,12 +78,12 @@ ...@@ -78,12 +78,12 @@
<!--</i>--> <!--</i>-->
<!--</a>--> <!--</a>-->
<!--</div>--> <!--</div>-->
<!--齿轮 进入管理入口--> <div class="nav-element-right" ng-show="batchImportShow">
<div class="nav-element-right">
<a ui-sref="overviewDataImp"> <a ui-sref="overviewDataImp">
<i class="fa fa-circle-o-notch nav-icon-color"></i> <i class="fa fa-circle-o-notch nav-icon-color"></i>
</a> </a>
</div> </div>
<!--齿轮 进入管理入口-->
<div class="nav-element-right" ng-show="adminSettingShow"> <div class="nav-element-right" ng-show="adminSettingShow">
<a title="{{'settings'|translate}}" href="/admin" target="_blank"> <a title="{{'settings'|translate}}" href="/admin" target="_blank">
<i class="fa fa-cog nav-icon-color"></i> <i class="fa fa-cog nav-icon-color"></i>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
} }
} }
@media (max-width: 992px) { @media (max-width: 1400px) {
& { & {
min-width: 100%; min-width: 100%;
padding-left: 0; padding-left: 0;
...@@ -45,10 +45,18 @@ ...@@ -45,10 +45,18 @@
.link-sm-show { .link-sm-show {
display: inline-block; display: inline-block;
} }
p { p {
color: #333; color: #333;
} };
} }
} }
} }
@media screen and (max-width: 1400px) {
.user-menu{
position:absolute!important;
top: 55px!important;
left: -50px!important;
}
}
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