Commit b7320320 authored by eddie.woo's avatar eddie.woo

merge

parents d8c1c1a1 e8f3ea5a
......@@ -12,3 +12,13 @@ rebel.xml
**/.idea/
atms-api/~
/bin/
/atms-api/src/main/resources/conf/conf_profile_dev_local.properties
/atms-api/pom.xml
atms-web/src/main/webapp/package-lock.json
atms-web/src/main/webapp/package.json
package pwc.taxtech.atms.common;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.util.stream.Collectors;
......@@ -8,7 +9,12 @@ import org.apache.commons.io.IOUtils;
import org.nutz.lang.Lang;
import org.springframework.core.io.ClassPathResource;
import pwc.taxtech.atms.common.message.ErrorMessage;
import pwc.taxtech.atms.dpo.EnterpriseAccountSetOrgDto;
import pwc.taxtech.atms.exception.ServiceException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
public class CommonUtils {
public static final int BATCH_NUM = 500;
......@@ -155,4 +161,34 @@ public class CommonUtils {
}
/**
* 输出文件流 下载
*/
public static void FileOut(HttpServletResponse response, InputStream inputStream, String fileName){
response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition", "attachment;fileName=" + fileName + ".xlsx");
ServletOutputStream out = null;
try {
out = response.getOutputStream();
int b = 0;
byte[] buffer = new byte[512];
while ((b = inputStream.read(buffer)) > 0) {
out.write(buffer, 0, b);
}
inputStream.close();
} catch (IOException e) {
e.printStackTrace();
e.printStackTrace();
throw new ServiceException(ErrorMessage.SystemError);
} finally {
try {
out.close();
out.flush();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
......@@ -109,6 +109,21 @@ public class DateUtils {
return dateString;
}
/**
* 根据yyyyMMdd时间格式字符串,格式化为date类型
*
* @param dateStr
* @return
*/
public static Date stringToDate4yyyyMMdd(String dateStr) {
try {
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
Date date = formatter.parse(dateStr);
return date;
} catch (ParseException e) {
return null;
}
}
/**
* 将短时间格式字符串转换为区间格式 yyyyMM
*
......@@ -157,14 +172,14 @@ public class DateUtils {
* @return
*/
public static Integer strToPeriodYM(String dateStr) {
dateStr = dateStr.replace("-","");
dateStr = dateStr.replace("-","").replace(" ","").replace("年","").replace("月","");
Integer period = Integer.valueOf(dateStr);
return period;
}
/**
* 将yyyymm 字符串转换为区间格式 yyyyMM
* 将yyyymm 字\转换为区间格式 yyyyMM
*
* @param dateStr
* @return
......
......@@ -9,11 +9,16 @@ package pwc.taxtech.atms.common.util;
**/
import com.google.common.collect.Lists;
import org.apache.poi.ss.usermodel.Workbook;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngineConfiguration;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.streaming.SXSSFSheet;
import org.nutz.http.Http;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sun.misc.BASE64Encoder;
import javax.servlet.ServletContext;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
......@@ -69,7 +74,7 @@ public class FileExcelUtil {
* @param path
* @throws IOException
*/
public static ZipOutputStream craeteZipPath(String path) throws IOException {
public static File createZip(String path) throws IOException {
ZipOutputStream zipOutputStream = null;
File file = new File(path + DateUtils.nowDateFormat() + ".zip");
zipOutputStream = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(file)));
......@@ -98,11 +103,10 @@ public class FileExcelUtil {
/*if(zipOutputStream !=null){
zipOutputStream.close();
}*/
return zipOutputStream;
return file;
}
/**
* 设置下载excel的响应头信息
*
......@@ -158,7 +162,7 @@ public class FileExcelUtil {
* @param workbook
* @time 2018年6月25日11:47:07
*/
private void downloadExcel(HttpServletRequest request, HttpServletResponse response, String fileName, Workbook workbook) {
public static void downloadExcel(HttpServletRequest request, HttpServletResponse response, String fileName, Workbook workbook) {
//一个流两个头
//设置下载excel的头信息
FileExcelUtil.setExcelHeadInfo(response, request, fileName);
......@@ -191,19 +195,19 @@ public class FileExcelUtil {
* 生成excel到指定路径
*
* @param wb
* @Param path 文件路径,包括zip文件夹路径
* @throws Exception
* @Param path 文件路径,包括zip文件夹路径
*/
public static List<File> generateExcelToPath(Workbook wb, String path) throws Exception {
String[] pathArr = path.split("\\\\");
String zipDir = pathArr[0];
FileExcelUtil.createFile(zipDir);
public static File generateExcelToPath(Workbook wb, String fileNamet) throws Exception {
File file = new File(fileNamet);
FileOutputStream fos = null;
List<File> listFile = Lists.newArrayList();
try {
fos = new FileOutputStream(path);
fos = new FileOutputStream(file);
wb.write(fos);
listFile.add(new File(path));
return file;
} catch (Exception e) {
e.printStackTrace();
return null;
} finally {
if (fos != null) {
fos.flush();
......@@ -213,7 +217,6 @@ public class FileExcelUtil {
wb.close();
}
}
return listFile;
}
/**
......@@ -223,16 +226,18 @@ public class FileExcelUtil {
* @param response
* @param zipName 下载的zip名
* @param files 要打包的批量文件
* @param zipPath 生成的zip路径
* @param zipDir 存放zip文件的文件夹路径
* @throws Exception
*/
public static synchronized void downloadZip(HttpServletRequest request, HttpServletResponse response, String zipName, List<File> files, String zipPath) throws Exception {
public static synchronized void downloadZip(HttpServletRequest request, HttpServletResponse response, String zipName, List<File> files, String zipDir) throws Exception {
//ZIPPATH = this.getClass().getResource("/").getPath().substring(1) + "zipDir";
FileExcelUtil.createFile(zipDir);// 先生成存放zip文件的文件夹
String zipPath = zipDir + "/" + Math.random() + ".zip";
File srcfile[] = new File[files.size()];
File zip = new File(zipPath);
for (int i = 0; i < files.size(); i++) {
srcfile[i] = files.get(i);
}
//生成.zip文件;
FileInputStream inStream = null;
ServletOutputStream os = null;
try {
......@@ -306,4 +311,72 @@ public class FileExcelUtil {
// 目录此时为空,可以删除
return dir.delete();
}
/**
* 删除列
*
* @param sheet
* @param columnToDelete
* @param cols 制定哪些行不进行列偏移
*/
public static void deleteColumn(Sheet sheet, int columnToDelete, List<Integer> cols) {
for (int rId = 0; rId <= sheet.getLastRowNum(); rId++) {
Row row = sheet.getRow(rId);
for (int cID = columnToDelete; cID <= row.getLastCellNum(); cID++) {
Cell cOld = row.getCell(cID);
if (cOld != null) {
row.removeCell(cOld);
}
Cell cNext = row.getCell(cID + 1);
if (cNext != null) {
Cell cNew = row.createCell(cID, cNext.getCellTypeEnum());
if (cols.contains(cID))
continue;
cloneCell(cNew, cNext);
//Set the column width only on the first row.
//Other wise the second row will overwrite the original column width set previously.
if (rId == 0) {
sheet.setColumnWidth(cID, sheet.getColumnWidth(cID + 1));
}
}
}
}
}
/**
* 右边列左移
*
* @param cNew
* @param cOld
*/
public static void cloneCell(Cell cNew, Cell cOld) {
try {
cNew.setCellComment(cOld.getCellComment());
cNew.setCellStyle(cOld.getCellStyle());
try {
String stringCellValue = cOld.getStringCellValue();
if ("".equals(stringCellValue))
return;
} catch (Exception e) {
//do nothing
}
if (CellType.BOOLEAN == cNew.getCellTypeEnum() || CellType.BOOLEAN == cOld.getCellTypeEnum()) {
cNew.setCellValue(cOld.getBooleanCellValue());
} else if (CellType.NUMERIC == cNew.getCellTypeEnum() || CellType.NUMERIC == cOld.getCellTypeEnum()) {
cNew.setCellValue(cOld.getNumericCellValue());
} else if (CellType.STRING == cNew.getCellTypeEnum() || CellType.STRING == cOld.getCellTypeEnum()) {
cNew.setCellValue(cOld.getStringCellValue());
} else if (CellType.ERROR == cNew.getCellTypeEnum() || CellType.ERROR == cOld.getCellTypeEnum()) {
cNew.setCellValue(cOld.getErrorCellValue());
} else if (CellType.FORMULA == cNew.getCellTypeEnum() || CellType.FORMULA == cOld.getCellTypeEnum()) {
cNew.setCellValue(cOld.getCellFormula());
}
} catch (Exception e) {
e.printStackTrace();
logger.warn("数据转换异常", e.getMessage());
}
}
}
\ No newline at end of file
......@@ -8,6 +8,9 @@ public final class Constant {
public static final String Other = "其他";
public static final int WholeYear = -1;
/* ----------------------------- kevin insert -----------------*/
public static String ebitRate = "1%";
/*-----------------------------------------------------------------*/
public static final int CREATE_DB_SUCCESS = 1;
public static final int CREATE_DB_EXISTS = 0;
public static final int CREATE_DB_FAILED = -1;
......
......@@ -209,7 +209,8 @@ public class AssetListController {
ApiResultDto assetsImport(@RequestParam MultipartFile file,
@RequestParam String filename,
@RequestParam String tempFileName,
@RequestParam String projectId){
@RequestParam String projectId,
@RequestParam Integer importType){
logger.info("CIT资产导入");
ApiResultDto apiResultDto = new ApiResultDto();
try{
......@@ -224,7 +225,7 @@ public class AssetListController {
try {
input = file.getInputStream();
//调用资产导入业务逻辑
OperationResultDto assetsImportResult = assetListService.assetsImport(input, file.getOriginalFilename(), projectId);
OperationResultDto assetsImportResult = assetListService.assetsImport(input, file.getOriginalFilename(), projectId,importType);
//判断是否导入成功,若成功获取资产类别并返回页面
if(assetsImportResult.getResult() != null && !assetsImportResult.getResult()){
apiResultDto.setData(assetListService.getAssetGroupResultData(projectId));
......
......@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.constant.enums.EnumCitImportType;
import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.dto.CitJournalAdjustDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.service.impl.CitImportExcelServiceImpl;
......@@ -128,5 +129,21 @@ public class CitImportExcelController {
return apiResultDto;
}
@RequestMapping(value = "/generateTb", method = RequestMethod.POST)
public OperationResultDto generateTb(@RequestBody CitJournalAdjustDto citJournalAdjustDto){
logger.info("处理日记账并生成TB");
OperationResultDto operationResultDto = new OperationResultDto();
try{
operationResultDto.setResult(true);
citImportExcelService.generateTb(citJournalAdjustDto.getProjectId());
operationResultDto.setResultMsg("Success");
return operationResultDto;
}catch (Exception e){
operationResultDto.setResult(false);
operationResultDto.setResultMsg("Fail");
return operationResultDto;
}
}
}
......@@ -61,7 +61,7 @@ public class FileTypesController {
@ResponseBody
public Map<String,String> query4SelectionBox(){
List<FileTypes> fileTypes = fileTypesService.query4SelectionBox();
Map<String,String> result = fileTypes.stream().collect(Collectors.toMap(FileTypes::getFileType,FileTypes::getFileAttr));
Map<String,String> result = fileTypes.stream().distinct().collect(Collectors.toMap(FileTypes::getFileType,FileTypes::getFileAttr));
return result;
}
......@@ -73,7 +73,7 @@ public class FileTypesController {
@ResponseBody
public Map<String,String> query4SelectionBoxEnable(){
List<FileTypes> fileTypes = fileTypesService.query4SelectionBoxEnable();
Map<String,String> result = fileTypes.stream().collect(Collectors.toMap(FileTypes::getFileType,FileTypes::getFileAttr));
Map<String,String> result = fileTypes.stream().distinct().collect(Collectors.toMap(FileTypes::getFileType,FileTypes::getFileAttr));
return result;
}
......
......@@ -2,10 +2,10 @@ package pwc.taxtech.atms.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import net.sf.json.JSONNull;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.DateUtil;
......@@ -20,20 +20,26 @@ import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.PageResultVo;
import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.constant.enums.FileUploadEnum;
import pwc.taxtech.atms.dpo.OrgSelectDto;
import pwc.taxtech.atms.dto.TaxDocumentDto;
import pwc.taxtech.atms.entity.TaxDocument;
import pwc.taxtech.atms.service.impl.DidiFileUploadService;
import pwc.taxtech.atms.service.impl.OrganizationServiceImpl;
import pwc.taxtech.atms.service.impl.TaxDocumentServiceImpl;
import pwc.taxtech.atms.thirdparty.ExcelUtil;
import pwc.taxtech.atms.vat.entity.FileUpload;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLDecoder;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@Controller
@RequestMapping("/api/v1/taxDoc")
......@@ -44,12 +50,18 @@ public class TaxDocumentController {
@Autowired
private DidiFileUploadService didiFileUploadService;
@Autowired
private OrganizationServiceImpl organizationService;
@PostMapping("selectList")
@ResponseBody
public PageResultVo<TaxDocument> selectTaxDocumentList(@RequestBody TaxDocumentDto taxDocumentDto) {
Page<TaxDocument> page = PageHelper.startPage(taxDocumentDto.getCurrentPage(), taxDocumentDto.getPageSize());
taxDocumentService.selectTaxDocumentList(taxDocumentDto);
PageInfo<TaxDocument> taxDocumentPageInfo = page.toPageInfo();
List<OrgSelectDto> orgList = organizationService.getMyOrgList();
if(CollectionUtils.isEmpty(orgList)){
return new PageResultVo<>();
}
PageHelper.startPage(taxDocumentDto.getCurrentPage(), taxDocumentDto.getPageSize());
PageInfo<TaxDocument> taxDocumentPageInfo = new PageInfo<>(taxDocumentService.selectTaxDocumentList(taxDocumentDto,orgList.stream()
.map(o -> o.getId()).collect(Collectors.toList())));
List<TaxDocument> list = taxDocumentPageInfo.getList();
return PageResultVo.getPageResultVo(taxDocumentPageInfo, list);
}
......@@ -93,6 +105,13 @@ public class TaxDocumentController {
}
return taxDocumentService.editFilesType(taxDocument);
}
@GetMapping("/multipalInitData")
@ResponseBody
public Map<String,Object> multipalInitData(String address){
//地址示例: D://multipaiInitData
return taxDocumentService.multipalInitData(address);
}
@RequestMapping("exportExcel")
@ResponseBody
public void exportExcelFile(HttpServletResponse response, @RequestBody TaxDocumentDto taxDocumentDto) {
......@@ -115,7 +134,14 @@ public class TaxDocumentController {
headers.put("UploadTime", "上传日期");
headers.put("Creator", "创建人");
headers.put("Remark", "档案备注");
List<TaxDocument> TaxDocument = taxDocumentService.selectTaxDocumentList(taxDocumentDto);
List<TaxDocument> TaxDocument =null;
List<OrgSelectDto> orgList = organizationService.getMyOrgList();
if(CollectionUtils.isEmpty(orgList)){
TaxDocument = new ArrayList<>();
}else{
TaxDocument = taxDocumentService.selectTaxDocumentList(taxDocumentDto,orgList.stream()
.map(o -> o.getId()).collect(Collectors.toList()));
}
response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition", "attachment;fileName=" + new String("taxDocument.xlsx".getBytes("GB2312"), "ISO-8859-1"));
OutputStream ouputStream = response.getOutputStream();
......
......@@ -9,10 +9,5 @@ package pwc.taxtech.atms.dto;
**/
public class RequestParameterBaseDto {
public String orgId;
public Integer period;
public String templateId;
public String projectId;
public String reportId;
}
......@@ -10,45 +10,40 @@ import java.io.Serializable;
* Version 1.0
* 请求参数封装
**/
public class RequestParameterDto extends RequestParameterBaseDto implements Serializable {
public class RequestParameterDto implements Serializable {
public class EbitParam extends RequestParameterDto{
private String jsonString;//excel传过来的数据 已经被序列化成字符串了
private Integer specialConsiderations;
private String ebitRate;
private String jsonString;//excel传过来的数据 已经被序列化成字符串了
private String specialConsiderations;
private String ebitRate;
public String getEbitRate() {
return ebitRate;
}
public String orgId;
public Integer period;
public String templateId;
public String projectId;
public String reportId;
public void setEbitRate(String ebitRate) {
this.ebitRate = ebitRate;
}
public Integer getSpecialConsiderations() {
return specialConsiderations;
}
public String getJsonString() {
return jsonString;
}
public void setSpecialConsiderations(Integer specialConsiderations) {
this.specialConsiderations = specialConsiderations;
}
public void setJsonString(String jsonString) {
this.jsonString = jsonString;
}
public String getJsonString() {
return jsonString;
}
public String getSpecialConsiderations() {
return specialConsiderations;
}
public void setJsonString(String jsonString) {
this.jsonString = jsonString;
}
public void setSpecialConsiderations(String specialConsiderations) {
this.specialConsiderations = specialConsiderations;
}
public String getReportId() {
return reportId;
public String getEbitRate() {
return ebitRate;
}
public void setReportId(String reportId) {
this.reportId = reportId;
public void setEbitRate(String ebitRate) {
this.ebitRate = ebitRate;
}
public String getOrgId() {
......@@ -83,15 +78,25 @@ public class RequestParameterDto extends RequestParameterBaseDto implements Se
this.projectId = projectId;
}
public String getReportId() {
return reportId;
}
public void setReportId(String reportId) {
this.reportId = reportId;
}
@Override
public String toString() {
return "RequestParameterDto{" +
"reportId='" + reportId + '\'' +
"jsonString='" + jsonString + '\'' +
", specialConsiderations=" + specialConsiderations +
", ebitRate='" + ebitRate + '\'' +
", orgId='" + orgId + '\'' +
", period=" + period +
", templateId='" + templateId + '\'' +
", projectId='" + projectId + '\'' +
", reportId='" + reportId + '\'' +
'}';
}
}
......@@ -12,9 +12,9 @@ import java.math.BigDecimal;
public class EbitDataDto {
private BigDecimal ebitSubtraction; // 1. EBIT(考虑资产减值损失)
private BigDecimal specialFactors; //考虑特殊因素
private double ebitRate;// ebit比率 默认1%(可更改)
private String ebitRate;// ebit比率 默认1%(可更改)
private BigDecimal transactionAmount; //关联交易金额
private String sixAddTax; //6%增值税
private BigDecimal sixAddTax; //6%增值税
private BigDecimal totalAmountTax;// 价税合计金额
private String specialConsiderations;//特殊因素考虑
public String getSpecialConsiderations() {
......@@ -44,11 +44,11 @@ public class EbitDataDto {
this.specialFactors = specialFactors;
}
public double getEbitRate() {
public String getEbitRate() {
return ebitRate;
}
public void setEbitRate(double ebitRate) {
public void setEbitRate(String ebitRate) {
this.ebitRate = ebitRate;
}
......@@ -60,11 +60,11 @@ public class EbitDataDto {
this.transactionAmount = transactionAmount;
}
public String getSixAddTax() {
public BigDecimal getSixAddTax() {
return sixAddTax;
}
public void setSixAddTax(String sixAddTax) {
public void setSixAddTax(BigDecimal sixAddTax) {
this.sixAddTax = sixAddTax;
}
......
......@@ -548,6 +548,8 @@ public class AnalysisServiceImpl extends BaseService {
if (isSheetEmpty(sheet)) continue;
List<AnalysisInternationalBusinessData> lists = Lists.newArrayList();
for (int j = 1; j <= sheet.getLastRowNum(); j++) {
if(j>2)
break;
AnalysisInternationalBusinessData model = new AnalysisInternationalBusinessData();
model.setId(idService.nextId());
model.setPeriod(selectedPer);
......
......@@ -194,7 +194,7 @@ public class AssetListServiceImpl extends BaseService {
* @param fileName
* @return
*/
public OperationResultDto assetsImport(InputStream inputStream, String fileName, String projectId) throws IOException, InvalidFormatException, ParseException {
public OperationResultDto assetsImport(InputStream inputStream, String fileName, String projectId, Integer importType) throws IOException, InvalidFormatException, ParseException {
logger.debug("导入excel文件开始");
//定义返回变量
OperationResultDto<Object> importResult = new OperationResultDto<>();
......@@ -249,7 +249,9 @@ public class AssetListServiceImpl extends BaseService {
}
//在循环存储新的资产之前先删除原有资产
deleteByExample(projectId);
if(importType == 1){
deleteByExample(projectId);
}
//循环存储新的资产
int insertBatch = assetListMapper.insertBatch(citAssetsLists);
// for (CitAssetsList citAsset : citAssetsLists){
......@@ -288,10 +290,10 @@ public class AssetListServiceImpl extends BaseService {
return null;
}
citAsset.setAssetNumber(value.toString());
citAsset.setSerialNumber(String.valueOf(CitCommonUtil.getValue(rowData.getCell(2))));
citAsset.setSerialNumber(CitCommonUtil.getValue(rowData.getCell(2)).toString());
//获取资产描述
citAsset.setAssetDescription(String.valueOf(CitCommonUtil.getValue(rowData.getCell(5))));
citAsset.setAssetDescription(CitCommonUtil.getValue(rowData.getCell(5)).toString());
//获取资产类别
value = CitCommonUtil.getValue(rowData.getCell(7));
if (value == null) {
......@@ -303,7 +305,9 @@ public class AssetListServiceImpl extends BaseService {
//获取购入日期
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
value = CitCommonUtil.getValue(rowData.getCell(15));
citAsset.setBuyDate(value==null?null:sdf.parse(value.toString()));
if(!"".equals(value)){
citAsset.setBuyDate(sdf.parse(value.toString()));
}
//获取开始折旧日期,DD没有提供,我们要根据购入日期和税法分类做预处理自己转化
// citAsset.setDepreciationDate(sdf.parse(CitCommonUtil.getValue(rowData.getCell(15)).toString()));
......@@ -324,14 +328,26 @@ public class AssetListServiceImpl extends BaseService {
// citAsset.setAdjustmentValue(new BigDecimal(CitCommonUtil.getValue(rowData.getCell(32)).toString()));
//获取报废日期
value = CitCommonUtil.getValue(rowData.getCell(37));
citAsset.setDisposedDate(value==null?null:sdf.parse(value.toString()));
citAsset.setScrapType(String.valueOf(CitCommonUtil.getValue(rowData.getCell(38))));
if(!"".equals(value)){
citAsset.setDisposedDate(sdf.parse(value.toString()));
}
citAsset.setScrapType(CitCommonUtil.getValue(rowData.getCell(38)).toString());
//获取残值额,原为残值率现为残值额,接下来计算需要用到,所以赋给一个对象
BigDecimal residualRate = new BigDecimal(CitCommonUtil.getValue(rowData.getCell(20)).toString());
citAsset.setResidualRate(residualRate);
//获取本年折旧额
citAsset.setYearDepreciationAmount(new BigDecimal(CitCommonUtil.getValue(rowData.getCell(24)).toString()));
value = CitCommonUtil.getValue(rowData.getCell(24));
if("".equals(value)){
citAsset.setYearDepreciationAmount(new BigDecimal("0"));
//获取财务本年折旧额
citAsset.setAccountYearDepreciationAmount(new BigDecimal("0"));
}else{
citAsset.setYearDepreciationAmount(new BigDecimal(value.toString()));
//获取财务本年折旧额
citAsset.setAccountYearDepreciationAmount(new BigDecimal(value.toString()));
}
// 获取本年调整额----列数待定 滴滴无本年调整额
// citAsset.setYearAdjustmentAmount(new BigDecimal(CitCommonUtil.getValue(rowData.getCell(25)).toString()));
......@@ -339,10 +355,13 @@ public class AssetListServiceImpl extends BaseService {
citAsset.setAccountAcquisitionValue(acquisitionValue);
//获取财务每月折旧额----(原值-残值额)/折旧期限
citAsset.setAccountMonthDepreciationAmount(acquisitionValue.subtract(residualRate).divide(new BigDecimal(depreciationPeriod), 2));
//获取财务本年折旧额
citAsset.setAccountYearDepreciationAmount(new BigDecimal(CitCommonUtil.getValue(rowData.getCell(24)).toString()));
//获取财务累计折旧额,接下来计算需要用到,所以赋给一个对象
BigDecimal accountTotalDepreciationAmount = new BigDecimal(CitCommonUtil.getValue(rowData.getCell(25)).toString());
value = CitCommonUtil.getValue(rowData.getCell(25));
if("".equals(value)){
value = "0";
}
BigDecimal accountTotalDepreciationAmount = new BigDecimal(value.toString());
citAsset.setAccountTotalDepreciationAmount(accountTotalDepreciationAmount);
//年终剩余价值,原值-累计折旧
citAsset.setYearEndValue(acquisitionValue.subtract(accountTotalDepreciationAmount));
......
......@@ -11,6 +11,7 @@ import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.constant.CountTypeConstant;
import pwc.taxtech.atms.constant.ExportTemplatePathConstant;
import pwc.taxtech.atms.dao.CitJournalEntryAdjustMapper;
import pwc.taxtech.atms.dao.CitTbamMapper;
import pwc.taxtech.atms.dao.CitTrialBalanceMapper;
import pwc.taxtech.atms.dao.OrganizationMapper;
import pwc.taxtech.atms.dto.CitJournalAdjustDto;
......@@ -53,6 +54,8 @@ public class CitDataPreviewServiceImpl extends BaseService {
private CitJournalEntryAdjustMapper citJournalMapper;
@Resource
private CitTrialBalanceMapper citTbMapper;
@Resource
private CitTbamMapper citTbamMapper;
/**
* 获取日记账合并版
......@@ -62,6 +65,7 @@ public class CitDataPreviewServiceImpl extends BaseService {
public PageInfo<CitJournalAdjustDto> getJournalMergeData(CitJournalAdjustDto citJournalAdjustDto) {
CitJournalEntryAdjust citJournalEntryAdjust = beanUtil.copyProperties(citJournalAdjustDto, new CitJournalEntryAdjust());
Page page = PageHelper.startPage(citJournalAdjustDto.getPageInfo().getPageIndex(), citJournalAdjustDto.getPageInfo().getPageSize());
List<CitJournalEntryAdjust> journalMerges = citJournalMapper.getJournalMerge(citJournalEntryAdjust);
List<CitJournalAdjustDto> journalAdjustDtos = Lists.newArrayList();
journalMerges.forEach(journal -> {
......@@ -166,10 +170,10 @@ public class CitDataPreviewServiceImpl extends BaseService {
CitTrialBalanceExample.Criteria citTbExampleCriteria = citTbExample.createCriteria();
citTbExampleCriteria.andProjectIdEqualTo(citTrialBalanceDto.getProjectId());
if(citTrialBalanceDto.getAccountCode() != null && !"".equals(citTrialBalanceDto.getAccountCode())){
citTbExampleCriteria.andAccountCodeEqualTo(citTrialBalanceDto.getAccountCode());
citTbExampleCriteria.andAccountCodeLike("%"+citTrialBalanceDto.getAccountCode()+"%");
}
if(citTrialBalanceDto.getAccountDescription() != null && !"".equals(citTrialBalanceDto.getAccountDescription())){
citTbExampleCriteria.andAccountDescriptionEqualTo(citTrialBalanceDto.getAccountDescription());
citTbExampleCriteria.andAccountDescriptionLike("%"+citTrialBalanceDto.getAccountDescription()+"%");
}
List<CitTrialBalance> citTbList = citTbMapper.selectByExample(citTbExample);
......@@ -225,10 +229,10 @@ public class CitDataPreviewServiceImpl extends BaseService {
CitTrialBalanceExample.Criteria citTbExampleCriteria = citTbExample.createCriteria();
citTbExampleCriteria.andProjectIdEqualTo(citTrialBalanceDto.getProjectId());
if(citTrialBalanceDto.getAccountCode() != null && !"".equals(citTrialBalanceDto.getAccountCode())){
citTbExampleCriteria.andAccountCodeEqualTo(citTrialBalanceDto.getAccountCode());
citTbExampleCriteria.andAccountCodeLike("%"+citTrialBalanceDto.getAccountCode()+"%");
}
if(citTrialBalanceDto.getAccountDescription() != null && !"".equals(citTrialBalanceDto.getAccountDescription())){
citTbExampleCriteria.andAccountDescriptionEqualTo(citTrialBalanceDto.getAccountDescription());
citTbExampleCriteria.andAccountDescriptionLike("%"+citTrialBalanceDto.getAccountDescription()+"%");
}
List<CitTrialBalance> citTbList = citTbMapper.selectByExample(citTbExample);
if(citTbList.size()==0){
......@@ -236,7 +240,7 @@ public class CitDataPreviewServiceImpl extends BaseService {
}
ExportDto exportDto = new ExportDto();
exportDto.setFileName("试算平衡表生成版");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/citTbGeneVer.xlsx");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/citTrialBalanceGene.xlsx");
exportDto.setResponse(response);
exportDto.setList(citTbList);
exportDto.setRelation(null);
......@@ -268,14 +272,28 @@ public class CitDataPreviewServiceImpl extends BaseService {
*/
public PageInfo<CitTrialBalanceDto> getTbMappingVerData(CitTrialBalanceDto citTrialBalanceDto) {
Page page = PageHelper.startPage(citTrialBalanceDto.getPageInfo().getPageIndex(), citTrialBalanceDto.getPageInfo().getPageSize());
List<CitTrialBalanceDto> citTbList = citTbMapper.getTbMappingData(citTrialBalanceDto);
// List<CitTrialBalanceDto> citTbDtos = Lists.newArrayList();
// citTbList.forEach(tb -> {
// CitTrialBalanceDto citTrialBalanceDtoTemp = new CitTrialBalanceDto();
// beanUtil.copyProperties(tb, citTrialBalanceDtoTemp);
// citTbDtos.add(citTrialBalanceDtoTemp);
// });
CitTbamExample citTbamExample = new CitTbamExample();
CitTbamExample.Criteria criteria = citTbamExample.createCriteria();
criteria.andProjectIdEqualTo(citTrialBalanceDto.getProjectId());
if(citTrialBalanceDto.getAccountCode() != null && !"".equals(citTrialBalanceDto.getAccountCode())){
criteria.andAccountCodeLike("%"+citTrialBalanceDto.getAccountCode()+"%");
}
if(citTrialBalanceDto.getAccountDescription() != null && !"".equals(citTrialBalanceDto.getAccountDescription())){
criteria.andAccountDescriptionLike("%"+citTrialBalanceDto.getAccountDescription()+"%");
}
if(citTrialBalanceDto.getAttribute() != null && !"".equals(citTrialBalanceDto.getAttribute())){
criteria.andAttributeLike("%"+citTrialBalanceDto.getAttribute()+"%");
}
List<CitTrialBalanceDto> citTbList = Lists.newArrayList();
List<CitTbam> citTbams = citTbamMapper.selectByExample(citTbamExample);
for (CitTbam citTbam : citTbams) {
CitTrialBalanceDto citTrialBalanceDtoTemp = new CitTrialBalanceDto();
beanUtil.copyProperties(citTbam, citTrialBalanceDtoTemp);
citTbList.add(citTrialBalanceDtoTemp);
}
// List<CitTrialBalanceDto> citTbList = citTbMapper.getTbMappingData(citTrialBalanceDto);
PageInfo<CitTrialBalanceDto> pageInfo =new PageInfo<>(citTbList);
pageInfo.setTotal(page.getTotal());
pageInfo.setPageNum(citTrialBalanceDto.getPageInfo().getPageIndex());
......@@ -315,13 +333,31 @@ public class CitDataPreviewServiceImpl extends BaseService {
* @return
*/
public int exportTbMappingVerData2(CitTrialBalanceDto citTrialBalanceDto, HttpServletResponse response){
List<CitTrialBalanceDto> citTbList = citTbMapper.getTbMappingData(citTrialBalanceDto);
CitTbamExample citTbamExample = new CitTbamExample();
CitTbamExample.Criteria criteria = citTbamExample.createCriteria();
criteria.andProjectIdEqualTo(citTrialBalanceDto.getProjectId());
if(citTrialBalanceDto.getAccountCode() != null && !"".equals(citTrialBalanceDto.getAccountCode())){
criteria.andAccountCodeLike("%"+citTrialBalanceDto.getAccountCode()+"%");
}
if(citTrialBalanceDto.getAccountDescription() != null && !"".equals(citTrialBalanceDto.getAccountDescription())){
criteria.andAccountDescriptionLike("%"+citTrialBalanceDto.getAccountDescription()+"%");
}
if(citTrialBalanceDto.getAttribute() != null && !"".equals(citTrialBalanceDto.getAttribute())){
criteria.andAttributeLike("%"+citTrialBalanceDto.getAttribute()+"%");
}
List<CitTrialBalanceDto> citTbList = Lists.newArrayList();
List<CitTbam> citTbams = citTbamMapper.selectByExample(citTbamExample);
for (CitTbam citTbam : citTbams) {
CitTrialBalanceDto citTrialBalanceDtoTemp = new CitTrialBalanceDto();
beanUtil.copyProperties(citTbam, citTrialBalanceDtoTemp);
citTbList.add(citTrialBalanceDtoTemp);
}
if(citTbList.size()==0){
return 0;
}
ExportDto exportDto = new ExportDto();
exportDto.setFileName("试算平衡表Mapping版");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/citTbGeneMapping.xlsx");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/citTrialBalanceMapping.xlsx");
exportDto.setResponse(response);
exportDto.setList(citTbList);
exportDto.setRelation(citTbList.get(0));
......@@ -329,4 +365,5 @@ public class CitDataPreviewServiceImpl extends BaseService {
return 1;
}
}
......@@ -1191,6 +1191,7 @@ public class CitReportServiceImpl extends BaseService {
private CitJournalEntryAdjustMapper citJournalEntryAdjustMapper;
public OperationResultDto addCellManualDataSource(ManualDataSourceDto data, String projectId) {
data.setPeriod(0);
OperationResultDto operationResultDto = new OperationResultDto();
try {
if (data.getCellId() == null) {
......@@ -1247,29 +1248,29 @@ public class CitReportServiceImpl extends BaseService {
/*kevin insert */ // TODO: 3/21/2019 需要验证
PeriodCellTemplateConfigExample example = new PeriodCellTemplateConfigExample();
PeriodCellTemplateConfigExample.Criteria criteria = example.createCriteria();
criteria.andCellTemplateIdEqualTo(Long.parseLong(data.getCellTemplateId()));
criteria.andProjectIdEqualTo(data.getProjectId());
PeriodCellTemplateConfig periodCellTemplateConfig = new PeriodCellTemplateConfig();
periodCellTemplateConfig.setParsedFormula(sumValue);
periodCellTemplateConfigMapper.updateByExampleSelective(periodCellTemplateConfig, example);
//更改选中行相关数据
CitJournalEntryAdjust citJournalEntryAdjust = new CitJournalEntryAdjust();
citJournalEntryAdjust.setIsSelect("1");
CitJournalEntryAdjustExample example1 = new CitJournalEntryAdjustExample();
CitJournalEntryAdjustExample.Criteria criteria1 = example1.createCriteria();
criteria1.andProjectIdEqualTo(data.getProjectId());
criteria1.andSubjectCodeEqualTo(data.getAccountCode());
citJournalEntryAdjustMapper.updateByExample(citJournalEntryAdjust, example1);
JournalEntry journalEntry = new JournalEntry();
journalEntry.setIsSelect("1");
JournalEntryExample example2 = new JournalEntryExample();
JournalEntryExample.Criteria criteria2 = example2.createCriteria();
criteria2.andProjectIdEqualTo(data.getProjectId());
criteria2.andSegment3EqualTo(data.getAccountCode());
journalEntryMapper.updateByExample(journalEntry, example2);
// PeriodCellTemplateConfigExample example = new PeriodCellTemplateConfigExample();
// PeriodCellTemplateConfigExample.Criteria criteria = example.createCriteria();
// criteria.andCellTemplateIdEqualTo(Long.parseLong(data.getCellTemplateId()));
// criteria.andProjectIdEqualTo(data.getProjectId());
// PeriodCellTemplateConfig periodCellTemplateConfig = new PeriodCellTemplateConfig();
// periodCellTemplateConfig.setParsedFormula(sumValue);
// periodCellTemplateConfigMapper.updateByExampleSelective(periodCellTemplateConfig, example);
// //更改选中行相关数据
// CitJournalEntryAdjust citJournalEntryAdjust = new CitJournalEntryAdjust();
// citJournalEntryAdjust.setIsSelect("1");
// CitJournalEntryAdjustExample example1 = new CitJournalEntryAdjustExample();
// CitJournalEntryAdjustExample.Criteria criteria1 = example1.createCriteria();
// criteria1.andProjectIdEqualTo(data.getProjectId());
// criteria1.andSubjectCodeEqualTo(data.getAccountCode());
// citJournalEntryAdjustMapper.updateByExample(citJournalEntryAdjust, example1);
//
// JournalEntry journalEntry = new JournalEntry();
// journalEntry.setIsSelect("1");
// JournalEntryExample example2 = new JournalEntryExample();
// JournalEntryExample.Criteria criteria2 = example2.createCriteria();
// criteria2.andProjectIdEqualTo(data.getProjectId());
// criteria2.andSegment3EqualTo(data.getAccountCode());
// journalEntryMapper.updateByExample(journalEntry, example2);
}
List<DataSourceExtendDto> dataSourceExtendDtos = periodDataSourceMapper.getManualDataSource(data.getCellId());
......
......@@ -2,6 +2,7 @@ package pwc.taxtech.atms.service.impl;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -45,6 +46,7 @@ public class FileTypesServiceImpl {
/**
* 查询档案属性和档案类型给前端下拉选择框
*
* @return
*/
public List<FileTypes> query4SelectionBox() {
......@@ -54,6 +56,8 @@ public class FileTypesServiceImpl {
@Transactional
public boolean addFileTypesList(FileTypes fileTypes) {
try {
//检测添加类型是否已存在,存在则返回false先(后期改进为多异常)
checkFileType(fileTypes);
//对必填字段进行转换成json对象
requiredFieldFormatToJson(fileTypes);
//设置当前时间 当前创建人信息
......@@ -77,11 +81,29 @@ public class FileTypesServiceImpl {
return false;
}
} catch (Exception e) {
// log.error("FileTypesServiceImpl addFileTypesList error : " + e.getMessage());
log.error("FileTypesServiceImpl addFileTypesList error : " + e.getMessage());
return false;
}
}
/**
* //检测添加类型是否已存在,存在则返回false先(后期改进为多异常)
*
* @param fileTypes
* @return
*/
private void checkFileType(FileTypes fileTypes) {
FileTypesExample example = new FileTypesExample();
FileTypesExample.Criteria criteria = example.createCriteria();
if (StringUtils.isNotBlank(fileTypes.getFileType())) {
criteria.andFileTypeEqualTo(fileTypes.getFileType());
}
List<FileTypes> results = fileTypesMapper.selectByExample(example);
if (results.size() > 0) {
throw new RuntimeException("filetype已存在: " + fileTypes.getFileType());
}
}
@Transactional
public boolean deleteFileTypes(Long id) {
try {
......@@ -100,7 +122,7 @@ public class FileTypesServiceImpl {
return false;
}
} catch (Exception e) {
// log.error("FileTypesServiceImpl deleteFileTypes error : " + e.getMessage());
log.error("FileTypesServiceImpl deleteFileTypes error : " + e.getMessage());
return false;
}
}
......@@ -108,6 +130,8 @@ public class FileTypesServiceImpl {
@Transactional
public boolean editFilesType(FileTypes fileTypes) {
try {
//检测添加类型是否已存在,存在则返回false先(后期改进为多异常)
checkFileType(fileTypes);
//对必填字段进行转换成json对象
requiredFieldFormatToJson(fileTypes);
fileTypes.setUpdateTime(new Date());
......@@ -128,7 +152,7 @@ public class FileTypesServiceImpl {
return false;
}
} catch (Exception e) {
// log.error("FileTypesServiceImpl editFilesType error : " + e.getMessage());
log.error("FileTypesServiceImpl editFilesType error : " + e.getMessage());
return false;
}
}
......@@ -160,6 +184,7 @@ public class FileTypesServiceImpl {
fileTypes.setRequiredFieldJson(requiredFieldJson);
}
}
public List<FileTypes> query4SelectionBoxEnable() {
return fileTypesMapper.query4SelectionBoxEnable();
}
......
......@@ -347,6 +347,8 @@ public class TemplateGroupServiceImpl extends AbstractService {
List<PeriodDataSource> periodDataSourceList = Lists.newArrayList();
for (int r = sheet.getFirstRowNum(); r <= sheet.getLastRowNum(); r++) {
Row row = sheet.getRow(r);
if(row == null)
continue;
for (int c = row.getFirstCellNum(); c <= row.getLastCellNum(); c++) {
Cell cell = row.getCell(c);
if (cell == null) {
......
......@@ -128,6 +128,11 @@ public class TemplateServiceImpl extends AbstractService {
example.createCriteria().andTemplateIdEqualTo(templateId);
return periodTemplateMapper.selectByExample(example);
}
public List<Template> getTL(Long templateId){
TemplateExample example = new TemplateExample();
example.createCriteria().andIdEqualTo(templateId);
return templateMapper.selectByExample(example);
}
public String getTemplatePath(Long templateId) {
......
......@@ -5,15 +5,11 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.common.util.StringUtil;
import pwc.taxtech.atms.constant.enums.EnumServiceType;
import pwc.taxtech.atms.dao.CitTbamMapper;
import pwc.taxtech.atms.dao.FormulaAdminMapper;
import pwc.taxtech.atms.dao.ProjectMapper;
import pwc.taxtech.atms.dao.ProjectServiceTypeMapper;
import pwc.taxtech.atms.dpo.CellTemplatePerGroupDto;
import pwc.taxtech.atms.dpo.GroupId;
import pwc.taxtech.atms.dto.TableRule;
import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.exception.Exceptions;
......
......@@ -59,7 +59,7 @@ org_sync_token=174af08f
dd_pubkey=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKUfMPRKV6I5num1dDWcxTrgTjXf5LctsVj0CpbwHE83mmjUO5CAlvA0Fwy30ajCX5sLmsyi+Eu/4uNmM6GQF3kCAwEAAQ==
ebs_call_url=http://172.20.3.109:8020/ebs-proxy-test/dts
ebs_call_url=http://172.20.3.109:8010/ebs-proxy-test/dts
#tableau config
tableau_get_ticket=http://47.94.233.173:16010/trusted?username=%s
......
......@@ -10,7 +10,7 @@ mail_jdbc_url=jdbc:sqlserver://192.168.1.102:1434;DatabaseName=MAILMaster
mail_jdbc_user=sa
mail_jdbc_password=atmsunittestSQL
web.url=http://dts.erp.didichuxing.com:10000
web.url=http://dts.erp.didichuxing.com
#web.url=*
jwt.base64Secret=TXppQjFlZFBSbnJzMHc0Tg==
jwt.powerToken=xxxx
......@@ -28,7 +28,7 @@ max_file_length=104857600
distributed_id_datacenter=10
distributed_id_machine=10
api.url=http://dts.erp.didichuxing.com:20000
api.url=http://dts.erp.didichuxing.com
# Longi config
longi_api_basic_user=
......
......@@ -59,7 +59,7 @@ org_sync_token=174af08f
dd_pubkey=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKUfMPRKV6I5num1dDWcxTrgTjXf5LctsVj0CpbwHE83mmjUO5CAlvA0Fwy30ajCX5sLmsyi+Eu/4uNmM6GQF3kCAwEAAQ==
ebs_call_url=http://172.20.201.201:8020/ebs-proxy-test/dts/glMonthlyBal?pageNum=1&pageSize=1000&ledgerId=2021&companyCode=120200&period=2018-11
ebs_call_url=http://172.20.201.201:8020/ebs-proxy-test/dts
#tableau config
tableau_get_ticket=http://47.94.233.173:16010/trusted?username=%s
......
......@@ -40,15 +40,15 @@
<javaClientGenerator type="XMLMAPPER" targetPackage="pwc.taxtech.atms.vat.dao" targetProject="../../src/main/java">
<property name="rootInterface" value="pwc.taxtech.atms.MyVatMapper" />
</javaClientGenerator>
<table tableName="pwc_report_attach" domainObjectName="PwcReportAttach">
<table tableName="profit_loss_statement_ebit" domainObjectName="ProfitLossStatementEbit">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
<table tableName="invoice_record" domainObjectName="InvoiceRecord">
<!--<table tableName="invoice_record" domainObjectName="InvoiceRecord">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
</table>-->
<!--
......
......@@ -133,11 +133,11 @@ public interface OrganizationMapper extends MyMapper {
List<OrgGeneralInfoMiddleDto> selectJoinToOrgGeneralInfo();
@Select("select tb.id,tb.name from organization tb left join user_organization ta on ta.organization_id = tb.id " +
@Select("select tb.id,tb.name,tb.abbreviation from organization tb left join user_organization ta on ta.organization_id = tb.id " +
"where ta.user_id = #{uid}")
List<OrgSelectDto> getMyOrgSelectList(String uid);
@Select("select id, name from organization;")
@Select("select id, name,abbreviation from organization;")
List<OrgSelectDto> getAllOrgSelectList();
@Select("select tb.id,tb.code from organization tb left join user_organization ta on ta.organization_id = tb.id " +
......
......@@ -3,6 +3,15 @@ package pwc.taxtech.atms.dpo;
public class OrgSelectDto {
private String id;
private String name;
private String abbreviation;
public String getAbbreviation() {
return abbreviation;
}
public void setAbbreviation(String abbreviation) {
this.abbreviation = abbreviation;
}
public String getId() {
return this.id;
......
......@@ -787,6 +787,26 @@ public class CitJournalEntryAdjust extends BaseEntity implements Serializable {
*/
private Date updateTime;
private Integer periodStart;
private Integer periodEnd;
public Integer getPeriodStart() {
return periodStart;
}
public void setPeriodStart(Integer periodStart) {
this.periodStart = periodStart;
}
public Integer getPeriodEnd() {
return periodEnd;
}
public void setPeriodEnd(Integer periodEnd) {
this.periodEnd = periodEnd;
}
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table cit_journal_entry_adjust
......
......@@ -50,22 +50,6 @@ public interface EbitSpreadDataMapper extends MyVatMapper {
*/
int insertSelective(EbitSpreadData record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_spread_data
*
* @mbg.generated
*/
List<EbitSpreadData> selectByExampleWithBLOBsWithRowbounds(EbitSpreadDataExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_spread_data
*
* @mbg.generated
*/
List<EbitSpreadData> selectByExampleWithBLOBs(EbitSpreadDataExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_spread_data
......@@ -98,14 +82,6 @@ public interface EbitSpreadDataMapper extends MyVatMapper {
*/
int updateByExampleSelective(@Param("record") EbitSpreadData record, @Param("example") EbitSpreadDataExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_spread_data
*
* @mbg.generated
*/
int updateByExampleWithBLOBs(@Param("record") EbitSpreadData record, @Param("example") EbitSpreadDataExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_spread_data
......@@ -122,14 +98,6 @@ public interface EbitSpreadDataMapper extends MyVatMapper {
*/
int updateByPrimaryKeySelective(EbitSpreadData record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_spread_data
*
* @mbg.generated
*/
int updateByPrimaryKeyWithBLOBs(EbitSpreadData record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_spread_data
......
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.ProfitLossStatementEbit;
import pwc.taxtech.atms.vat.entity.ProfitLossStatementEbitExample;
@Mapper
public interface ProfitLossStatementEbitMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table profit_loss_statement_ebit
*
* @mbg.generated
*/
long countByExample(ProfitLossStatementEbitExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table profit_loss_statement_ebit
*
* @mbg.generated
*/
int deleteByExample(ProfitLossStatementEbitExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table profit_loss_statement_ebit
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table profit_loss_statement_ebit
*
* @mbg.generated
*/
int insert(ProfitLossStatementEbit record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table profit_loss_statement_ebit
*
* @mbg.generated
*/
int insertSelective(ProfitLossStatementEbit record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table profit_loss_statement_ebit
*
* @mbg.generated
*/
List<ProfitLossStatementEbit> selectByExampleWithRowbounds(ProfitLossStatementEbitExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table profit_loss_statement_ebit
*
* @mbg.generated
*/
List<ProfitLossStatementEbit> selectByExample(ProfitLossStatementEbitExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table profit_loss_statement_ebit
*
* @mbg.generated
*/
ProfitLossStatementEbit selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table profit_loss_statement_ebit
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") ProfitLossStatementEbit record, @Param("example") ProfitLossStatementEbitExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table profit_loss_statement_ebit
*
* @mbg.generated
*/
int updateByExample(@Param("record") ProfitLossStatementEbit record, @Param("example") ProfitLossStatementEbitExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table profit_loss_statement_ebit
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(ProfitLossStatementEbit record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table profit_loss_statement_ebit
*
* @mbg.generated
*/
int updateByPrimaryKey(ProfitLossStatementEbit record);
}
\ No newline at end of file
......@@ -21,6 +21,17 @@ public class EbitSpreadData extends BaseEntity implements Serializable {
*/
private Long id;
/**
* Database Column Remarks:
* file下载地址
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column ebit_spread_data.file_key
*
* @mbg.generated
*/
private String fileKey;
/**
*
* This field was generated by MyBatis Generator.
......@@ -112,17 +123,6 @@ public class EbitSpreadData extends BaseEntity implements Serializable {
*/
private String fileName;
/**
* Database Column Remarks:
* spread json字符串(序列化之后)
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column ebit_spread_data.spread_json_string
*
* @mbg.generated
*/
private byte[] spreadJsonString;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table ebit_spread_data
......@@ -155,6 +155,30 @@ public class EbitSpreadData extends BaseEntity implements Serializable {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column ebit_spread_data.file_key
*
* @return the value of ebit_spread_data.file_key
*
* @mbg.generated
*/
public String getFileKey() {
return fileKey;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column ebit_spread_data.file_key
*
* @param fileKey the value for ebit_spread_data.file_key
*
* @mbg.generated
*/
public void setFileKey(String fileKey) {
this.fileKey = fileKey == null ? null : fileKey.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column ebit_spread_data.create_by
......@@ -371,30 +395,6 @@ public class EbitSpreadData extends BaseEntity implements Serializable {
this.fileName = fileName == null ? null : fileName.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column ebit_spread_data.spread_json_string
*
* @return the value of ebit_spread_data.spread_json_string
*
* @mbg.generated
*/
public byte[] getSpreadJsonString() {
return spreadJsonString;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column ebit_spread_data.spread_json_string
*
* @param spreadJsonString the value for ebit_spread_data.spread_json_string
*
* @mbg.generated
*/
public void setSpreadJsonString(byte[] spreadJsonString) {
this.spreadJsonString = spreadJsonString;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ebit_spread_data
......@@ -408,6 +408,7 @@ public class EbitSpreadData extends BaseEntity implements Serializable {
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", fileKey=").append(fileKey);
sb.append(", createBy=").append(createBy);
sb.append(", createTime=").append(createTime);
sb.append(", updateBy=").append(updateBy);
......@@ -417,7 +418,6 @@ public class EbitSpreadData extends BaseEntity implements Serializable {
sb.append(", organizationId=").append(organizationId);
sb.append(", sheetName=").append(sheetName);
sb.append(", fileName=").append(fileName);
sb.append(", spreadJsonString=").append(spreadJsonString);
sb.append("]");
return sb.toString();
}
......
......@@ -255,6 +255,76 @@ public class EbitSpreadDataExample {
return (Criteria) this;
}
public Criteria andFileKeyIsNull() {
addCriterion("file_key is null");
return (Criteria) this;
}
public Criteria andFileKeyIsNotNull() {
addCriterion("file_key is not null");
return (Criteria) this;
}
public Criteria andFileKeyEqualTo(String value) {
addCriterion("file_key =", value, "fileKey");
return (Criteria) this;
}
public Criteria andFileKeyNotEqualTo(String value) {
addCriterion("file_key <>", value, "fileKey");
return (Criteria) this;
}
public Criteria andFileKeyGreaterThan(String value) {
addCriterion("file_key >", value, "fileKey");
return (Criteria) this;
}
public Criteria andFileKeyGreaterThanOrEqualTo(String value) {
addCriterion("file_key >=", value, "fileKey");
return (Criteria) this;
}
public Criteria andFileKeyLessThan(String value) {
addCriterion("file_key <", value, "fileKey");
return (Criteria) this;
}
public Criteria andFileKeyLessThanOrEqualTo(String value) {
addCriterion("file_key <=", value, "fileKey");
return (Criteria) this;
}
public Criteria andFileKeyLike(String value) {
addCriterion("file_key like", value, "fileKey");
return (Criteria) this;
}
public Criteria andFileKeyNotLike(String value) {
addCriterion("file_key not like", value, "fileKey");
return (Criteria) this;
}
public Criteria andFileKeyIn(List<String> values) {
addCriterion("file_key in", values, "fileKey");
return (Criteria) this;
}
public Criteria andFileKeyNotIn(List<String> values) {
addCriterion("file_key not in", values, "fileKey");
return (Criteria) this;
}
public Criteria andFileKeyBetween(String value1, String value2) {
addCriterion("file_key between", value1, value2, "fileKey");
return (Criteria) this;
}
public Criteria andFileKeyNotBetween(String value1, String value2) {
addCriterion("file_key not between", value1, value2, "fileKey");
return (Criteria) this;
}
public Criteria andCreateByIsNull() {
addCriterion("create_by is null");
return (Criteria) this;
......
......@@ -344,41 +344,60 @@
id, organization_id, project_id, period, date, source, ledger_id, ledger_name, currency_code,
status, header_id, line_num, approval_status, posted_status, account_period, accounting_date,
journal_source, category, name, voucher_num, description, org_code, subject_code,
org_name, subject_name, accounted_dr, accounted_cr,
org_name, segment2_name, subject_name, segment4_name, segment5_name, segment6_name, segment7_name, segment8_name,
segment9_name, segment10_name, journal_currency_code, sob_currency_code, accounted_dr, accounted_cr,
entered_dr, entered_cr, cf_item, attribute1, attribute2, attribute3, attribute4, attribute5,
attribute6, attribute7, attribute8, attribute9, attribute10, attribute11, attribute12, attribute13, attribute14, attribute15,
attribute16,
created_by, created_date, late_updated_by,
late_updated_date, create_time, update_time,is_select
from cit_journal_entry_adjust where project_id = #{projectId,jdbcType=VARCHAR}
<if test="orgCode != null">
<if test="orgCode != null and orgCode != ''">
and org_code = #{orgCode,jdbcType=VARCHAR}
</if>
<if test="subjectCode != null">
and subject_code = #{subjectCode,jdbcType=VARCHAR}
<if test="subjectCode != null and subjectCode != ''">
and subject_code LIKE CONCAT('%' ,#{subjectCode},'%')
</if>
<if test="orgName != null">
<if test="orgName != null and orgName != ''">
and org_name = #{orgName,jdbcType=VARCHAR}
</if>
<if test="subjectName != null">
and subject_name = #{subjectName,jdbcType=VARCHAR}
<if test="subjectName != null and subjectName != ''">
and subject_name LIKE CONCAT('%' ,#{subjectName},'%')
</if>
<if test="periodStart!=null">
AND account_period &gt;= #{periodStart,jdbcType=INTEGER}
</if>
<if test="periodEnd!=null">
AND account_period &lt;= #{periodEnd,jdbcType=INTEGER}
</if>
UNION ALL
select
id, organization_id, project_id, tms_period as period ,date,source, ledger_id, ledger_name, currency_code,
status, header_id, line_num, approval_status, posted_status, period as account_period, accounting_date,
journal_source, category, name, voucher_num, description, segment1 as org_code, segment3 as subject_code,
segment1_name as org_name, segment3_name as subject_name, accounted_dr, accounted_cr,
created_by, created_date, late_updated_by, late_updated_date, create_time, update_time, is_select
segment1_name as org_name, segment2_name, segment3_name as subject_name, segment4_name, segment5_name, segment6_name,
segment7_name, segment8_name, segment9_name, segment10_name, journal_currency_code, sob_currency_code,
accounted_dr, accounted_cr, entered_dr, entered_cr, cf_item, attribute1, attribute2, attribute3, attribute4, attribute5,
attribute6, attribute7, attribute8, attribute9, attribute10, attribute11, attribute12, attribute13, attribute14, attribute15,
attribute16, created_by, created_date, late_updated_by, late_updated_date, create_time, update_time, is_select
from journal_entry where project_id = #{projectId,jdbcType=VARCHAR}
<if test="orgCode != null">
<if test="orgCode != null and orgCode != ''">
and segment1 = #{orgCode,jdbcType=VARCHAR}
</if>
<if test="subjectCode != null">
and segment3 = #{subjectCode,jdbcType=VARCHAR}
<if test="subjectCode != null and subjectCode != ''">
and segment3 LIKE CONCAT('%' ,#{subjectCode},'%')
</if>
<if test="orgName != null">
<if test="orgName != null and orgName != ''">
and segment1_name = #{orgName,jdbcType=VARCHAR}
</if>
<if test="subjectName != null">
and segment3_name = #{subjectName,jdbcType=VARCHAR}
<if test="subjectName != null and subjectName != ''">
and segment3_name LIKE CONCAT('%' ,#{segment3_name},'%')
</if>
<if test="periodStart!=null">
AND period &gt;= #{periodStart,jdbcType=INTEGER}
</if>
<if test="periodEnd!=null">
AND period &lt;= #{periodEnd,jdbcType=INTEGER}
</if>
</select>
......
......@@ -139,41 +139,69 @@
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.checkOne != null">#{item.checkOne,jdbcType=VARCHAR},</when>
<when test="item.subjectCode != null">#{item.subjectCode,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.reclassifyAmount != null">#{item.reclassifyAmount,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
<when test="item.subjectDescription != null">#{item.subjectDescription,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.auxiliarySubject != null">#{item.auxiliarySubject,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.auxiliarySubjectDescription != null">#{item.auxiliarySubjectDescription,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.profitCenter != null">#{item.profitCenter,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.exchangeRate != null">#{item.exchangeRate,jdbcType=VARCHAR},</when>
<when test="item.profitCenterDescription != null">#{item.profitCenterDescription,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.ledgerId != null">#{item.ledgerId,jdbcType=VARCHAR},</when>
<when test="item.product != null">#{item.product,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.debitAdvanceGene != null">#{item.debitAdvanceGene,jdbcType=VARCHAR},</when>
<when test="item.productDescription != null">#{item.productDescription,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.creditPrepaidAccounts != null">#{item.creditPrepaidAccounts,jdbcType=VARCHAR},</when>
<when test="item.project != null">#{item.project,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.remark != null">#{item.remark,jdbcType=VARCHAR},</when>
<when test="item.projectDescription != null">#{item.projectDescription,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.company != null">#{item.company,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.companyDescription != null">#{item.companyDescription,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.segment1 != null">#{item.segment1,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.segment1Description != null">#{item.segment1Description,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.segment2 != null">#{item.segment2,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.segment2Description != null">#{item.segment2Description,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.createdBy != null">#{item.createdBy,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
......
......@@ -350,9 +350,7 @@
<select id="getTbMappingData" parameterType="map" resultMap="citTbDtoResultMap">
select
tb.id, tb.organization_id, tb.project_id, tb.date, tb.source, tb.period, tb.account_code, tb.account_description,
tb.account_period, tb.debit_amount, tb.credit_amount, tb.beginning_balance, tb.ending_balance, tb.create_by,
tb.create_time, tb.update_time,dam.attribute as attribute
tb.*,dam.attribute as attribute
from
cit_trial_balance tb
left join
......@@ -360,13 +358,13 @@
on
tb.account_code=dam.acct_code
where tb.project_id = #{projectId,jdbcType=VARCHAR}
<if test="accountCode != null">
<if test="accountCode != null and accountCode != ''">
and tb.account_code = #{accountCode,jdbcType=VARCHAR}
</if>
<if test="accountDescription != null">
<if test="accountDescription != null and accountDescription != ''">
and tb.account_description = #{accountDescription,jdbcType=VARCHAR}
</if>
<if test="attribute != null">
<if test="attribute != null and attribute != ''">
and dam.account_description = #{attribute,jdbcType=VARCHAR}
</if>
......
......@@ -67,7 +67,6 @@
</trim>
</if>
</foreach>
and enable = 'T'
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
......@@ -151,13 +150,16 @@
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="batchDelete">
DELETE FROM tax_document
<update id="batchDelete">
UPDATE tax_document
SET
enable = 'F'
WHERE id IN
<foreach collection="list" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</delete>
AND enable = 'T'
</update>
<delete id="deleteByExample" parameterType="pwc.taxtech.atms.entity.TaxDocumentExample">
<!--
......
VUE_APP_TABLEAU_API=http://dts.erp.didichuxing.com/OrangeHeap/
\ No newline at end of file
VUE_APP_TABLEAU_API=http://dts.erp.didichuxing.com/OrangeHeap/
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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