Commit 948117e7 authored by gary's avatar gary

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

# Conflicts:
#	atms-web/src/main/webapp/app-resources/i18n/zh-CN/app.json
parents 53172121 351c62a3
...@@ -9,10 +9,10 @@ public class ReportFileUploadEnum { ...@@ -9,10 +9,10 @@ public class ReportFileUploadEnum {
* 报表类型 * 报表类型
*/ */
public enum ReportType { public enum ReportType {
NORMAL_DECLARATION("NORMAL_DECLARATION", "增值税纳税申报表"), NORMAL_DECLARATION("增值税纳税申报表", "增值税纳税申报表"),
CORR_DECLARATION("CORR_DECLARATION", "增值税更正申报表"), CORR_DECLARATION("增值税更正申报表", "增值税更正申报表"),
NORMAL_TAX_RECEIPT("NORMAL_TAX_RECEIPT", "增值税纳税税票"), NORMAL_TAX_RECEIPT("增值税纳税税票", "增值税纳税税票"),
CORR_TAX_RECEIPT("CORR_TAX_RECEIPT", "增值税更正税票"); CORR_TAX_RECEIPT("增值税更正税票", "增值税更正税票");
private String code; private String code;
private String name; private String name;
public static final Map<String, String> MAPPING = new HashMap<>(); public static final Map<String, String> MAPPING = new HashMap<>();
......
...@@ -22,6 +22,7 @@ import static javax.servlet.http.HttpServletResponse.SC_NO_CONTENT; ...@@ -22,6 +22,7 @@ import static javax.servlet.http.HttpServletResponse.SC_NO_CONTENT;
import static javax.servlet.http.HttpServletResponse.SC_OK; import static javax.servlet.http.HttpServletResponse.SC_OK;
/** /**
* CIT数据预览功能模块Controller
* @author zhikai.z.wei * @author zhikai.z.wei
*/ */
@RestController @RestController
...@@ -31,12 +32,22 @@ public class CitDataPreviewController extends BaseController { ...@@ -31,12 +32,22 @@ public class CitDataPreviewController extends BaseController {
@Autowired @Autowired
private CitDataPreviewServiceImpl citDataPreviewService; private CitDataPreviewServiceImpl citDataPreviewService;
/**
* 日记账合并版数据的获取
* @param citJournalAdjustDto
* @return
*/
@PostMapping("getJournalMergeData") @PostMapping("getJournalMergeData")
public PageInfo<CitJournalAdjustDto> getJournalMergeData(@RequestBody CitJournalAdjustDto citJournalAdjustDto) { public PageInfo<CitJournalAdjustDto> getJournalMergeData(@RequestBody CitJournalAdjustDto citJournalAdjustDto) {
logger.debug(String.format("CIT日记账合并预览 Condition:%s", JSON.toJSONString(citJournalAdjustDto))); logger.debug(String.format("CIT日记账合并预览 Condition:%s", JSON.toJSONString(citJournalAdjustDto)));
return citDataPreviewService.getJournalMergeData(citJournalAdjustDto); return citDataPreviewService.getJournalMergeData(citJournalAdjustDto);
} }
/**
* 日记账合并版导出
* @param paras
* @param response
*/
@RequestMapping(value = "exportJournalMergeData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "exportJournalMergeData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void exportJournalMergeData(@RequestBody CitJournalAdjustDto paras, HttpServletResponse response) { public void exportJournalMergeData(@RequestBody CitJournalAdjustDto paras, HttpServletResponse response) {
int count = citDataPreviewService.exportJournalMergeData2(paras, response); int count = citDataPreviewService.exportJournalMergeData2(paras, response);
...@@ -48,13 +59,22 @@ public class CitDataPreviewController extends BaseController { ...@@ -48,13 +59,22 @@ public class CitDataPreviewController extends BaseController {
} }
/**
* 试算平衡表生成版的数据获取
* @param citTrialBalanceDto
* @return
*/
@PostMapping("getTbGeneVerData") @PostMapping("getTbGeneVerData")
public PageInfo<CitTrialBalanceDto> getTbGeneVerData(@RequestBody CitTrialBalanceDto citTrialBalanceDto) { public PageInfo<CitTrialBalanceDto> getTbGeneVerData(@RequestBody CitTrialBalanceDto citTrialBalanceDto) {
logger.debug(String.format("CIT日记账合并预览 Condition:%s", JSON.toJSONString(citTrialBalanceDto))); logger.debug(String.format("CIT日记账合并预览 Condition:%s", JSON.toJSONString(citTrialBalanceDto)));
return citDataPreviewService.getTbGeneVerData(citTrialBalanceDto); return citDataPreviewService.getTbGeneVerData(citTrialBalanceDto);
} }
/**
* 试算平衡表生成版的导出
* @param paras
* @param response
*/
@RequestMapping(value = "exportTbGeneVerData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "exportTbGeneVerData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void exportTbGeneVerData(@RequestBody CitTrialBalanceDto paras, HttpServletResponse response) { public void exportTbGeneVerData(@RequestBody CitTrialBalanceDto paras, HttpServletResponse response) {
// response.setContentType("application/vnd.ms-excel;charset=utf-8"); // response.setContentType("application/vnd.ms-excel;charset=utf-8");
...@@ -86,13 +106,23 @@ public class CitDataPreviewController extends BaseController { ...@@ -86,13 +106,23 @@ public class CitDataPreviewController extends BaseController {
} }
} }
/**
* 试算平衡表Mapping版的数据获取
* @param citTrialBalanceDto
* @return
*/
@PostMapping("getTbMappingVerData") @PostMapping("getTbMappingVerData")
public PageInfo<CitTrialBalanceDto> getTbMappingVerData(@RequestBody CitTrialBalanceDto citTrialBalanceDto) { public PageInfo<CitTrialBalanceDto> getTbMappingVerData(@RequestBody CitTrialBalanceDto citTrialBalanceDto) {
logger.debug(String.format("CIT日记账合并预览 Condition:%s", JSON.toJSONString(citTrialBalanceDto))); logger.debug(String.format("CIT算平衡表Mapping版 Condition:%s", JSON.toJSONString(citTrialBalanceDto)));
return citDataPreviewService.getTbMappingVerData(citTrialBalanceDto); return citDataPreviewService.getTbMappingVerData(citTrialBalanceDto);
} }
/**
* 试算平衡表Mapping版的导出
* @param paras
* @param response
*/
@RequestMapping(value = "exportTbMappingVerData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "exportTbMappingVerData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void exportTbMappingVerData(@RequestBody CitTrialBalanceDto paras, HttpServletResponse response) { public void exportTbMappingVerData(@RequestBody CitTrialBalanceDto paras, HttpServletResponse response) {
int count = citDataPreviewService.exportTbMappingVerData2(paras, response); int count = citDataPreviewService.exportTbMappingVerData2(paras, response);
......
...@@ -17,7 +17,7 @@ import java.util.List; ...@@ -17,7 +17,7 @@ import java.util.List;
import static pwc.taxtech.atms.constant.enums.EnumCitImportType.JournalAdjust; import static pwc.taxtech.atms.constant.enums.EnumCitImportType.JournalAdjust;
/** /**
* @Description 资产相关Controller * @Description CIT文件导入Controller
* @Author zhikai.z.wei * @Author zhikai.z.wei
*/ */
@RestController @RestController
...@@ -28,14 +28,22 @@ public class CitImportExcelController { ...@@ -28,14 +28,22 @@ public class CitImportExcelController {
@Autowired @Autowired
private CitImportExcelServiceImpl citImportExcelService; private CitImportExcelServiceImpl citImportExcelService;
/**
* CIT文件导入
* @param file
* @param orgIds
* @param periodDate
* @param importType
* @param importFileType
* @return
*/
@RequestMapping(value = "/citImportExcel", method = RequestMethod.POST) @RequestMapping(value = "/citImportExcel", method = RequestMethod.POST)
public @ResponseBody public @ResponseBody
OperationResultDto citImportExcel(@RequestParam MultipartFile file, @RequestParam(required = false) String orgIds, OperationResultDto citImportExcel(@RequestParam MultipartFile file, @RequestParam(required = false) String orgIds,
@RequestParam String periodDate, @RequestParam String periodDate,
@RequestParam Integer importType, @RequestParam Integer importType,
@RequestParam Integer importFileType){ @RequestParam Integer importFileType){
logger.info("CIT调整版日记账导入"); logger.info("CIT文件导入");
OperationResultDto opeResultDto = new OperationResultDto(); OperationResultDto opeResultDto = new OperationResultDto();
try{ try{
if (file == null || file.getSize() <= 0) { if (file == null || file.getSize() <= 0) {
......
...@@ -4,7 +4,6 @@ import org.slf4j.Logger; ...@@ -4,7 +4,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import pwc.taxtech.atms.constant.CodeErrorConstant;
import pwc.taxtech.atms.constant.enums.EnumErrorCodeMsg; import pwc.taxtech.atms.constant.enums.EnumErrorCodeMsg;
import pwc.taxtech.atms.dto.ApiResultDto; import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.dto.ebsdto.*; import pwc.taxtech.atms.dto.ebsdto.*;
...@@ -216,9 +215,32 @@ public class EbsApiController { ...@@ -216,9 +215,32 @@ public class EbsApiController {
} }
} }
/**
* callback服务
* @param callBackDto
* @return
*/
@RequestMapping(value = "/callback", method = RequestMethod.POST)
public ApiResultDto callback(@RequestBody EbsCallBackDto callBackDto) {
logger.info("EBS callback 调用,taskId :{}",callBackDto.getTaskId());
ApiResultDto apiResultDto = new ApiResultDto();
try{
ebsApiService.changeCallBackStatus(callBackDto);
logger.debug("ebs callback taskId:{},status:{} end ",callBackDto.getTaskId(),callBackDto.getTaskStatus());
setApiResult(apiResultDto,EnumErrorCodeMsg.SUCCESS);
return apiResultDto;
}catch(Exception e){
logger.error("ebs callback error.", e);
setApiResult(apiResultDto,EnumErrorCodeMsg.APIERROR);
return apiResultDto;
}
}
private void setApiResult(ApiResultDto apiResultDto,EnumErrorCodeMsg error) { private void setApiResult(ApiResultDto apiResultDto,EnumErrorCodeMsg error) {
apiResultDto.setCode(error.getCode()); apiResultDto.setCode(error.getCode());
apiResultDto.setMessage(error.getMsg()); apiResultDto.setMessage(error.getMsg());
} }
} }
...@@ -36,6 +36,20 @@ public class OperationLogFileTypeController { ...@@ -36,6 +36,20 @@ public class OperationLogFileTypeController {
return returnData; return returnData;
} }
/**
* 根据 id 数组来查询相关日志
* @return
*/
@RequestMapping("/selectListForLog")
@ResponseBody
public ReturnData selectListForLog(List<String> fileTypeIds){
List<OperationLogFileType> operationLogFileType = operationLogFileTypeService.selectListForLog(fileTypeIds);
ReturnData returnData = new ReturnData();
returnData.setItems(operationLogFileType);
returnData.setTotalCount(operationLogFileType.size());
return returnData;
}
/** /**
* 添加文件档案操作日志 * 添加文件档案操作日志
* @param operationLogFileType * @param operationLogFileType
......
...@@ -32,6 +32,21 @@ public class OperationLogTaxDocController { ...@@ -32,6 +32,21 @@ public class OperationLogTaxDocController {
return returnData; return returnData;
} }
/**
* 根据 id 数组来查询相关日志
* @param taxDocumentIds
* @return
*/
@RequestMapping("/selectListForLog")
@ResponseBody
public ReturnData selectListForLog(List<String> taxDocumentIds){
List<OperationLogTaxDocument> operationLogTaxDocuments = operationLogTaxDocService.selectListForLog(taxDocumentIds);
ReturnData returnData = new ReturnData();
returnData.setItems(operationLogTaxDocuments);
returnData.setTotalCount(operationLogTaxDocuments.size());
return returnData;
}
@RequestMapping("add") @RequestMapping("add")
@ResponseBody @ResponseBody
public boolean addTaxDocuments(OperationLogTaxDocument operationLogTaxDocument){ public boolean addTaxDocuments(OperationLogTaxDocument operationLogTaxDocument){
......
package pwc.taxtech.atms.controller; package pwc.taxtech.atms.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import net.sf.json.JSONNull;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.DateUtil;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -16,8 +25,10 @@ import pwc.taxtech.atms.service.impl.TaxDocumentServiceImpl; ...@@ -16,8 +25,10 @@ import pwc.taxtech.atms.service.impl.TaxDocumentServiceImpl;
import pwc.taxtech.atms.thirdparty.ExcelUtil; import pwc.taxtech.atms.thirdparty.ExcelUtil;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.*;
import java.io.OutputStream; import java.net.HttpURLConnection;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -71,6 +82,7 @@ public class TaxDocumentController { ...@@ -71,6 +82,7 @@ public class TaxDocumentController {
return taxDocumentService.editFilesType(taxDocument); return taxDocumentService.editFilesType(taxDocument);
} }
@RequestMapping("exportExcel") @RequestMapping("exportExcel")
@ResponseBody @ResponseBody
public void exportExcelFile(HttpServletResponse response, @RequestBody TaxDocumentDto taxDocumentDto) { public void exportExcelFile(HttpServletResponse response, @RequestBody TaxDocumentDto taxDocumentDto) {
...@@ -147,4 +159,160 @@ public class TaxDocumentController { ...@@ -147,4 +159,160 @@ public class TaxDocumentController {
} }
/**
* 读取Excel转换成 Json
* @param taxDocumentDto 文件的路径
*/
@PostMapping("/previewExcelToJson")
@ResponseBody
public String previewExcel(@RequestBody TaxDocumentDto taxDocumentDto) {
try {
JSONArray dataArray = new JSONArray();
URL httpurl=new URL(taxDocumentDto.getPath());
InputStream is;
HttpURLConnection httpConn=(HttpURLConnection)httpurl.openConnection();
httpConn.setDoOutput(true);// 使用 URL 连接进行输出
httpConn.setDoInput(true);// 使用 URL 连接进行输入
httpConn.setUseCaches(false);// 忽略缓存
httpConn.setRequestMethod("GET");// 设置URL请求方法
//可设置请求头
httpConn.setRequestProperty("Content-Type", "application/octet-stream");
httpConn.setRequestProperty("Connection", "Keep-Alive");// 维持长连接
httpConn.setRequestProperty("Charset", "UTF-8");
httpConn.connect();
if (httpConn.getResponseCode() >= 400 ) {
is = httpConn.getErrorStream();
}
else{
is = httpConn.getInputStream();
}
InputStream inStream =is;
XSSFWorkbook xssfWorkbook = new XSSFWorkbook(inStream);
// 循环工作表Sheet
for (int numSheet = 0; numSheet < xssfWorkbook.getNumberOfSheets(); numSheet++) {
XSSFSheet xssfSheet = xssfWorkbook.getSheetAt(numSheet);
String sheetName = xssfSheet.getSheetName();
if (xssfSheet == null) {
continue;
}
//当前sheet的json文件
JSONObject sheetJson = new JSONObject();
//当前sheet的array,作为sheetJson 的value值
JSONArray sheetArr = new JSONArray();
//sheet的第一行,获取作为json的key值
JSONArray key = new JSONArray();
int xssfLastRowNum = xssfSheet.getLastRowNum();
// 循环行Row
for (int rowNum = 0; rowNum <= xssfLastRowNum; rowNum++) {
XSSFRow xssfRow = xssfSheet.getRow(rowNum);
if (xssfRow == null) {
continue;
}
// 循环列Cell,在这里组合json文件
int firstCellNum = xssfRow.getFirstCellNum();
int lastCellNum = xssfRow.getLastCellNum();
JSONObject rowJson = new JSONObject();
for (int cellNum = firstCellNum; cellNum < lastCellNum; cellNum++) {
XSSFCell cell = null;
try {
cell = xssfRow.getCell(cellNum);
if (cell == null) {
rowJson.put(key.getString(cellNum), "");
continue;
}
if (rowNum == 0)
key.add(toString(cell));
else {
//若是列号超过了key的大小,则跳过
if (cellNum >= key.size()) continue;
rowJson.put(key.getString(cellNum), toString(cell));
}
} catch (Exception e) {
e.printStackTrace();
}
}
if (rowJson.keySet().size() > 0)
sheetArr.add(rowJson);
}
sheetJson.put(sheetName, shuffleData(sheetArr));
dataArray.add(sheetJson);
}
return dataArray.toString();
} catch (Exception e) {
e.printStackTrace();
return JSONNull.getInstance().toString();
}
}
/**
* 解析json
* @param cell
* @return
*/
private static Object toString(XSSFCell cell) {
switch (cell.getCellTypeEnum()) {
case _NONE:
cell.setCellType(CellType.STRING);
return "";
case NUMERIC:
if (DateUtil.isCellDateFormatted(cell)) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
return sdf.format(cell.getDateCellValue());
}
cell.setCellType(CellType.STRING);
return cell.getStringCellValue();
case STRING:
String val = cell.getStringCellValue();
if ("无".equalsIgnoreCase(val)) return "";
//将其中的map格式和数组格式的字符串,转化为相应的数据类型
if (val.indexOf("{") > -1) {
// JSONObject jsonObject = JSONObject.parseObject(val);
Map<String, Integer> mapJson = JSONObject.parseObject(val,HashMap.class);
return mapJson;
}
if (val.indexOf("[") > -1) {
val = val.substring(1, val.length() - 1);
String[] array = val.split(",");
return array;
}
return val;
case FORMULA:
return cell.getCellFormula();
case BLANK:
return "";
case BOOLEAN:
return cell.getBooleanCellValue() + "";
case ERROR:
return "非法字符";
default:
return "未知字符";
}
}
/**
* 输出数据
*/
private static JSONArray shuffleData(JSONArray sheetArr) {
JSONArray array = new JSONArray();
for (int i = 0; i < sheetArr.size(); i++) {
JSONObject object = sheetArr.getJSONObject(i);
int count = 0;
int length = 0;
for (Object key : object.keySet()) {
Object o = object.get((String) key);
length++;
boolean b = StringUtils.isEmpty(o.toString());
if (b) {
count++;
}
}
if (count != length) {
array.add(object);
}
}
return array;
}
} }
...@@ -26,5 +26,7 @@ public class TableRule { ...@@ -26,5 +26,7 @@ public class TableRule {
map.put("ZXXJLLB", "cash_flow_final"); map.put("ZXXJLLB", "cash_flow_final");
map.put("CITZCFZB", "cit_balance_sheet_prc_adjust"); map.put("CITZCFZB", "cit_balance_sheet_prc_adjust");
map.put("CITLRB", "cit_profit_prc_adjust"); map.put("CITLRB", "cit_profit_prc_adjust");
map.put("CIT_TBAM", "cit_tbam");
} }
} }
...@@ -15,7 +15,7 @@ public class TaxDocumentDto { ...@@ -15,7 +15,7 @@ public class TaxDocumentDto {
private String fileAttr;//档案属性 private String fileAttr;//档案属性
private Integer fileTypeId;//文件类型的id private Long fileTypeId;//文件类型的id
private String fileType;//档案类型 private String fileType;//档案类型
...@@ -23,7 +23,7 @@ public class TaxDocumentDto { ...@@ -23,7 +23,7 @@ public class TaxDocumentDto {
private String businessLine;//业务线 private String businessLine;//业务线
private Integer companyId;//公司代码Id private String companyId;//公司代码Id
private String companyName;//公司名称 private String companyName;//公司名称
...@@ -53,9 +53,7 @@ public class TaxDocumentDto { ...@@ -53,9 +53,7 @@ public class TaxDocumentDto {
private String physicalIndexNumber;//实物索引号 private String physicalIndexNumber;//实物索引号
private Date ownBeginTime;//所属期间_开始 private Integer ownTime;//所属期间
private Date ownEndTime;//所属期间_结束
private Integer auditStatus;//审核状态 private Integer auditStatus;//审核状态
...@@ -63,6 +61,16 @@ public class TaxDocumentDto { ...@@ -63,6 +61,16 @@ public class TaxDocumentDto {
private List<Long> ids = new ArrayList<>();//批量删除id private List<Long> ids = new ArrayList<>();//批量删除id
private String path;//文件上传路径
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public List<Long> getIds() { public List<Long> getIds() {
return ids; return ids;
} }
...@@ -111,22 +119,6 @@ public class TaxDocumentDto { ...@@ -111,22 +119,6 @@ public class TaxDocumentDto {
this.effectiveEndTime = effectiveEndTime; this.effectiveEndTime = effectiveEndTime;
} }
public Date getOwnBeginTime() {
return ownBeginTime;
}
public void setOwnBeginTime(Date ownBeginTime) {
this.ownBeginTime = ownBeginTime;
}
public Date getOwnEndTime() {
return ownEndTime;
}
public void setOwnEndTime(Date ownEndTime) {
this.ownEndTime = ownEndTime;
}
public String getPhysicalIndexNumber() { public String getPhysicalIndexNumber() {
return physicalIndexNumber; return physicalIndexNumber;
} }
...@@ -183,11 +175,11 @@ public class TaxDocumentDto { ...@@ -183,11 +175,11 @@ public class TaxDocumentDto {
this.fileAttr = fileAttr; this.fileAttr = fileAttr;
} }
public Integer getFileTypeId() { public Long getFileTypeId() {
return fileTypeId; return fileTypeId;
} }
public void setFileTypeId(Integer fileTypeId) { public void setFileTypeId(Long fileTypeId) {
this.fileTypeId = fileTypeId; this.fileTypeId = fileTypeId;
} }
...@@ -215,14 +207,22 @@ public class TaxDocumentDto { ...@@ -215,14 +207,22 @@ public class TaxDocumentDto {
this.businessLine = businessLine; this.businessLine = businessLine;
} }
public Integer getCompanyId() { public String getCompanyId() {
return companyId; return companyId;
} }
public void setCompanyId(Integer companyId) { public void setCompanyId(String companyId) {
this.companyId = companyId; this.companyId = companyId;
} }
public Integer getOwnTime() {
return ownTime;
}
public void setOwnTime(Integer ownTime) {
this.ownTime = ownTime;
}
public String getCompanyName() { public String getCompanyName() {
return companyName; return companyName;
} }
......
package pwc.taxtech.atms.dto.ebsdto;
public class EbsCallBackDto {
private Long taskId;
private String taskStatus;
private String taskDesc;
public Long getTaskId() {
return taskId;
}
public void setTaskId(Long taskId) {
this.taskId = taskId;
}
public String getTaskStatus() {
return taskStatus;
}
public void setTaskStatus(String taskStatus) {
this.taskStatus = taskStatus;
}
public String getTaskDesc() {
return taskDesc;
}
public void setTaskDesc(String taskDesc) {
this.taskDesc = taskDesc;
}
}
...@@ -68,4 +68,10 @@ public interface EbsApiService { ...@@ -68,4 +68,10 @@ public interface EbsApiService {
* @param items * @param items
*/ */
void queryRemoteServerThenUpdateOrg(Long id, List<OrganizationQueryDto> items); void queryRemoteServerThenUpdateOrg(Long id, List<OrganizationQueryDto> items);
/**
* ebs最后调用更新状态
* @param ebsCallBackDto
*/
void changeCallBackStatus(EbsCallBackDto ebsCallBackDto);
} }
...@@ -41,6 +41,7 @@ import java.util.List; ...@@ -41,6 +41,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* CIT数据预览功能模块
* @author zhikai.z.wei * @author zhikai.z.wei
* @Date: 02/03/2019 * @Date: 02/03/2019
* @Description: * @Description:
...@@ -76,7 +77,7 @@ public class CitDataPreviewServiceImpl extends BaseService { ...@@ -76,7 +77,7 @@ public class CitDataPreviewServiceImpl extends BaseService {
} }
/** /**
* 日记账导出 * 日记账导出(第一种方式)
* @param citJournalAdjustDto * @param citJournalAdjustDto
* @param os * @param os
* @return * @return
...@@ -101,6 +102,12 @@ public class CitDataPreviewServiceImpl extends BaseService { ...@@ -101,6 +102,12 @@ public class CitDataPreviewServiceImpl extends BaseService {
} }
} }
/**
* 日记账导出(第二种方式)
* @param citJournalAdjustDto
* @param response
* @return
*/
public int exportJournalMergeData2(CitJournalAdjustDto citJournalAdjustDto, HttpServletResponse response){ public int exportJournalMergeData2(CitJournalAdjustDto citJournalAdjustDto, HttpServletResponse response){
CitJournalEntryAdjust citJournalEntryAdjust = beanUtil.copyProperties(citJournalAdjustDto, new CitJournalEntryAdjust()); CitJournalEntryAdjust citJournalEntryAdjust = beanUtil.copyProperties(citJournalAdjustDto, new CitJournalEntryAdjust());
List<CitJournalEntryAdjust> journalMerges = citJournalMapper.getJournalMerge(citJournalEntryAdjust); List<CitJournalEntryAdjust> journalMerges = citJournalMapper.getJournalMerge(citJournalEntryAdjust);
...@@ -117,6 +124,10 @@ public class CitDataPreviewServiceImpl extends BaseService { ...@@ -117,6 +124,10 @@ public class CitDataPreviewServiceImpl extends BaseService {
return 1; return 1;
} }
/**
* 日记账导出(第一种方式)所用到的获取Excel表头
* @return
*/
private Map<String, String> generalJMHeader() { private Map<String, String> generalJMHeader() {
Map<String, String> header = new LinkedHashMap<>(); Map<String, String> header = new LinkedHashMap<>();
header.put("ApprovalStatus","审批状态"); header.put("ApprovalStatus","审批状态");
...@@ -169,7 +180,7 @@ public class CitDataPreviewServiceImpl extends BaseService { ...@@ -169,7 +180,7 @@ public class CitDataPreviewServiceImpl extends BaseService {
} }
/** /**
* 试算平衡表生成版的导出 * 试算平衡表生成版的导出(第一种方式)
* @param citTrialBalanceDto * @param citTrialBalanceDto
* @param os * @param os
* @return * @return
...@@ -220,6 +231,10 @@ public class CitDataPreviewServiceImpl extends BaseService { ...@@ -220,6 +231,10 @@ public class CitDataPreviewServiceImpl extends BaseService {
return 1; return 1;
} }
/**
* 试算平衡表生成版的导出(第一种方式)所用到的生成Excel的表头
* @return
*/
private Map<String, String> generalTbGeneVerHeader() { private Map<String, String> generalTbGeneVerHeader() {
Map<String, String> header = new LinkedHashMap<>(); Map<String, String> header = new LinkedHashMap<>();
header.put("AccountCode","科目代码"); header.put("AccountCode","科目代码");
...@@ -255,7 +270,7 @@ public class CitDataPreviewServiceImpl extends BaseService { ...@@ -255,7 +270,7 @@ public class CitDataPreviewServiceImpl extends BaseService {
} }
/** /**
* 试算平衡表Mapping版的导出 * 试算平衡表Mapping版的导出(第一种方式)
* @param citTrialBalanceDto * @param citTrialBalanceDto
* @param os * @param os
* @return * @return
......
...@@ -64,6 +64,9 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -64,6 +64,9 @@ public class CitImportExcelServiceImpl extends BaseService {
@Resource @Resource
private ProjectMapper projectMapper; private ProjectMapper projectMapper;
@Resource
private CitTbamMapper citTbamMapper;
/** /**
* 根据导入的文件类型进行方法分发 * 根据导入的文件类型进行方法分发
* *
...@@ -284,11 +287,19 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -284,11 +287,19 @@ public class CitImportExcelServiceImpl extends BaseService {
if (EnumTbImportType.CoverImport.getCode().equals(importType)) { if (EnumTbImportType.CoverImport.getCode().equals(importType)) {
//覆盖导入要删除原有的该操作人在当前期间导入的数据,且更改之前导入的日志记录状态 //覆盖导入要删除原有的该操作人在当前期间导入的数据,且更改之前导入的日志记录状态
msg = "覆盖导入成功"; msg = "覆盖导入成功";
CitJournalEntryAdjustExample example = new CitJournalEntryAdjustExample(); CitJournalEntryAdjustExample citJEAExample = new CitJournalEntryAdjustExample();
CitJournalEntryAdjustExample.Criteria criteria = example.createCriteria(); citJEAExample.createCriteria().andCreatedByEqualTo(currentUserName).andPeriodEqualTo(period).andOrganizationIdIn(orgList);
criteria.andCreatedByEqualTo(currentUserName); logger.info("删除符合条件的日记账");
criteria.andPeriodEqualTo(period); citJournalEntryAdjustMapper.deleteByExample(citJEAExample);
citJournalEntryAdjustMapper.deleteByExample(example); //删除自动生成的试算平衡表相关数据
CitTrialBalanceExample citTbExample = new CitTrialBalanceExample();
citTbExample.createCriteria().andPeriodEqualTo(period).andCreateByEqualTo(currentUserName).andOrganizationIdIn(orgList);
int deleteByExample = citTrialBalanceMapper.deleteByExample(citTbExample);
logger.info("删除符合条件的试算平衡表数据");
CitTbamExample citTbamExample = new CitTbamExample();
citTbamExample.createCriteria().andPeriodEqualTo(period).andCreateByEqualTo(currentUserName).andOrganizationIdIn(orgList);
logger.info("删除符合条件的试算平衡表Mapping数据");
citTbamMapper.deleteByExample(citTbamExample);
updateImportLog(EnumCitImportType.JournalAdjust.getCode()); updateImportLog(EnumCitImportType.JournalAdjust.getCode());
} }
int insertBatchNum = citJournalEntryAdjustMapper.insertBatch(journalAdjustList); int insertBatchNum = citJournalEntryAdjustMapper.insertBatch(journalAdjustList);
...@@ -299,7 +310,9 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -299,7 +310,9 @@ public class CitImportExcelServiceImpl extends BaseService {
citDataImportLog.setErrorMsg(msg); citDataImportLog.setErrorMsg(msg);
citDataImportLogList.add(citDataImportLog); citDataImportLogList.add(citDataImportLog);
//导入日志录入到数据库
addDataImportLog(citDataImportLogList); addDataImportLog(citDataImportLogList);
//根据日记账自动生成试算平衡表,即试算平衡表生成版
autoGeneTB(period, orgId, orgList); autoGeneTB(period, orgId, orgList);
saveResult.setResult(true); saveResult.setResult(true);
saveResult.setResultMsg("导入成功"); saveResult.setResultMsg("导入成功");
...@@ -518,7 +531,8 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -518,7 +531,8 @@ public class CitImportExcelServiceImpl extends BaseService {
continue; continue;
} }
DecimalFormat df=new DecimalFormat("0"); DecimalFormat df=new DecimalFormat("0");
citDAMapping.setAcctCode(df.format(cellValue)); // String s = cellValue.toString();
citDAMapping.setAcctCode(cellValue.toString());
cellValue = CitCommonUtil.getValue(rowData.getCell(6)); cellValue = CitCommonUtil.getValue(rowData.getCell(6));
if(cellValue == null){ if(cellValue == null){
...@@ -1203,7 +1217,7 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -1203,7 +1217,7 @@ public class CitImportExcelServiceImpl extends BaseService {
} }
/** /**
* 自动生成试算平衡表 * 自动生成试算平衡表和join出Mapping版的attribute mapping TB
* @param period * @param period
* @param orgList * @param orgList
* @return * @return
...@@ -1215,14 +1229,17 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -1215,14 +1229,17 @@ public class CitImportExcelServiceImpl extends BaseService {
StringBuilder periodSb = new StringBuilder(); StringBuilder periodSb = new StringBuilder();
periodSb.append(period); periodSb.append(period);
periodSb.append("%"); periodSb.append("%");
//第二步,查出cit_journal_entry_adjust该期间的调整日记账,
List<CitJournalEntryAdjust> citJournalEntryAdjustList = citJournalEntryAdjustMapper.sumAmountByCondition(periodSb.toString(), orgList); List<CitJournalEntryAdjust> citJournalEntryAdjustList = citJournalEntryAdjustMapper.sumAmountByCondition(periodSb.toString(), orgList);
//第二步,查出cit_journal_entry_adjust该期间的调整日记账,
List<CitTrialBalance> trialBalanceList = new ArrayList<>(); List<CitTrialBalance> trialBalanceList = new ArrayList<>();
//存放TB与Mapping结合的实体
List<CitTbam> citTbamList = new ArrayList<>();
String currentUserName = authUserHelper.getCurrentAuditor().get(); String currentUserName = authUserHelper.getCurrentAuditor().get();
for (CitJournalEntryAdjust citJournal:citJournalEntryAdjustList) { for (CitJournalEntryAdjust citJournal:citJournalEntryAdjustList) {
CitTrialBalance trialBalance = new CitTrialBalance(); CitTrialBalance trialBalance = new CitTrialBalance();
trialBalance.setId(idService.nextId());
trialBalance.setPeriod(period); trialBalance.setPeriod(period);
trialBalance.setCreateBy(currentUserName); trialBalance.setCreateBy(currentUserName);
trialBalance.setOrganizationId(orgId); trialBalance.setOrganizationId(orgId);
...@@ -1249,10 +1266,33 @@ public class CitImportExcelServiceImpl extends BaseService { ...@@ -1249,10 +1266,33 @@ public class CitImportExcelServiceImpl extends BaseService {
//计算出期末余额,期末余额为期初余额+借方发生额-贷方发生额 //计算出期末余额,期末余额为期初余额+借方发生额-贷方发生额
trialBalance.setEndingBalance(lastYearBegBla.add(citJournal.getAccountedDr()).subtract(citJournal.getAccountedCr())); trialBalance.setEndingBalance(lastYearBegBla.add(citJournal.getAccountedDr()).subtract(citJournal.getAccountedCr()));
//根据科目代码及期间查询出相应底稿&科目Mapping数据并赋值给实体CitTBam
CitDraftAccountMappingExample citDAMappingExample = new CitDraftAccountMappingExample();
citDAMappingExample.createCriteria().andAcctCodeEqualTo(citJournal.getSubjectCode()).andPeriodEqualTo(period);
List<CitDraftAccountMapping> citDraftAccountMappings = citDAMappingMapper.selectByExample(citDAMappingExample);
for (CitDraftAccountMapping daMapping : citDraftAccountMappings) {
CitTbam citTbam = new CitTbam();
//把根据日记账算出的TB数据复制到Mapping的TB
beanUtil.copyProperties(trialBalance,citTbam);
citTbam.setId(idService.nextId());
citTbam.setAttribute(daMapping.getAttribute());
citTbamList.add(citTbam);
}
// citDraftAccountMappings.stream().forEach(daMapping -> {
// citTbam.setId(idService.nextId());
// citTbam.setAttribute(daMapping.getAttribute());
// citTbamList.add(citTbam);
// if("70019900".equals(citTbam.getAccountCode())){
// System.out.println(citTbam.getId());
// }
// });
trialBalance.setId(idService.nextId());
trialBalanceList.add(trialBalance); trialBalanceList.add(trialBalance);
} }
int insertBatch = citTrialBalanceMapper.insertBatch(trialBalanceList); int insertBatch = citTrialBalanceMapper.insertBatch(trialBalanceList);
int insertBatch1 = citTbamMapper.insertBatch(citTbamList);
autoGeneResult.setResult(true); autoGeneResult.setResult(true);
autoGeneResult.setResultMsg("自动生成TB成功"); autoGeneResult.setResultMsg("自动生成TB成功");
return autoGeneResult; return autoGeneResult;
......
...@@ -14,7 +14,6 @@ import pwc.taxtech.atms.entity.OperationLogFileType; ...@@ -14,7 +14,6 @@ import pwc.taxtech.atms.entity.OperationLogFileType;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.UUID;
/** /**
* 查询 * 查询
...@@ -54,10 +53,11 @@ public class FileTypesServiceImpl { ...@@ -54,10 +53,11 @@ public class FileTypesServiceImpl {
fileTypes.setCreateTime(new Date()); fileTypes.setCreateTime(new Date());
fileTypes.setCreator(authUserHelper.getCurrentAuditor().get()); fileTypes.setCreator(authUserHelper.getCurrentAuditor().get());
fileTypes.setCreatorId(authUserHelper.getCurrentUserId()); fileTypes.setCreatorId(authUserHelper.getCurrentUserId());
int num = fileTypesMapper.insert(fileTypes); Long id = fileTypesMapper.insert(fileTypes);
if (num > 0) { if (id > 0) {
OperationLogFileType actionEntity = buildOperationLogFileType(); OperationLogFileType actionEntity = buildOperationLogFileType();
actionEntity.setOperationAction("新增"); actionEntity.setOperationAction("新增");
actionEntity.setId(id.toString());
actionEntity.setUpdateState(fileTypes.toString()); actionEntity.setUpdateState(fileTypes.toString());
boolean result = operationLogFileTypeService.addFileTypesList(actionEntity); boolean result = operationLogFileTypeService.addFileTypesList(actionEntity);
if (result) { if (result) {
...@@ -81,6 +81,7 @@ public class FileTypesServiceImpl { ...@@ -81,6 +81,7 @@ public class FileTypesServiceImpl {
if (num > 0) { if (num > 0) {
OperationLogFileType actionEntity = buildOperationLogFileType(); OperationLogFileType actionEntity = buildOperationLogFileType();
actionEntity.setOperationAction("删除"); actionEntity.setOperationAction("删除");
actionEntity.setId(id.toString());
boolean result = operationLogFileTypeService.addFileTypesList(actionEntity); boolean result = operationLogFileTypeService.addFileTypesList(actionEntity);
if (result) { if (result) {
return true; return true;
...@@ -106,8 +107,8 @@ public class FileTypesServiceImpl { ...@@ -106,8 +107,8 @@ public class FileTypesServiceImpl {
if (num > 0) { if (num > 0) {
OperationLogFileType actionEntity = buildOperationLogFileType(); OperationLogFileType actionEntity = buildOperationLogFileType();
actionEntity.setOperationAction("更新"); actionEntity.setOperationAction("更新");
actionEntity.setId(fileTypes.getId().toString());
//设置更新值 //设置更新值
actionEntity.setOriginalState(fileTypesMapper.selectByPrimaryKey(fileTypes.getId()).toString());
actionEntity.setUpdateState(fileTypes.toString()); actionEntity.setUpdateState(fileTypes.toString());
boolean result = operationLogFileTypeService.addFileTypesList(actionEntity); boolean result = operationLogFileTypeService.addFileTypesList(actionEntity);
if (result) { if (result) {
...@@ -131,7 +132,6 @@ public class FileTypesServiceImpl { ...@@ -131,7 +132,6 @@ public class FileTypesServiceImpl {
*/ */
private OperationLogFileType buildOperationLogFileType() { private OperationLogFileType buildOperationLogFileType() {
OperationLogFileType actionEntity = new OperationLogFileType(); OperationLogFileType actionEntity = new OperationLogFileType();
actionEntity.setId("FileType:"+UUID.randomUUID().toString());
actionEntity.setOperationContent("系统管理"); actionEntity.setOperationContent("系统管理");
actionEntity.setModuleName("档案管理"); actionEntity.setModuleName("档案管理");
actionEntity.setOperationObject("税务档案类型设置"); actionEntity.setOperationObject("税务档案类型设置");
......
...@@ -47,4 +47,11 @@ public class OperationLogFileTypeServiceImpl { ...@@ -47,4 +47,11 @@ public class OperationLogFileTypeServiceImpl {
return false; return false;
} }
} }
public List<OperationLogFileType> selectListForLog(List<String> fileTypeIds) {
OperationLogFileTypeExample example = new OperationLogFileTypeExample();
OperationLogFileTypeExample.Criteria criteria = example.createCriteria();
criteria.andIdIn(fileTypeIds);
return operationLogFileTypeMapper.selectByExample(example);
}
} }
...@@ -47,4 +47,11 @@ public class OperationLogTaxDocServiceImpl { ...@@ -47,4 +47,11 @@ public class OperationLogTaxDocServiceImpl {
return false; return false;
} }
} }
public List<OperationLogTaxDocument> selectListForLog(List<String> taxDocumentIds) {
OperationLogTaxDocumentExample example = new OperationLogTaxDocumentExample();
OperationLogTaxDocumentExample.Criteria criteria = example.createCriteria();
criteria.andIdIn(taxDocumentIds);
return operationLogTaxDocumentMapper.selectByExample(example);
}
} }
...@@ -2,22 +2,25 @@ package pwc.taxtech.atms.service.impl; ...@@ -2,22 +2,25 @@ package pwc.taxtech.atms.service.impl;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.AuthUserHelper; import pwc.taxtech.atms.common.AuthUserHelper;
import pwc.taxtech.atms.common.CommonUtils; import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.message.ErrorMessage; import pwc.taxtech.atms.common.message.ErrorMessage;
import pwc.taxtech.atms.constant.enums.FileUploadEnum; import pwc.taxtech.atms.constant.enums.FileUploadEnum;
import pwc.taxtech.atms.constant.enums.ReportFileUploadEnum; import pwc.taxtech.atms.constant.enums.ReportFileUploadEnum;
import pwc.taxtech.atms.dao.FileTypesMapper;
import pwc.taxtech.atms.dao.OrganizationMapper;
import pwc.taxtech.atms.dao.ProjectMapper; import pwc.taxtech.atms.dao.ProjectMapper;
import pwc.taxtech.atms.dao.UserMapper; import pwc.taxtech.atms.dao.UserMapper;
import pwc.taxtech.atms.dto.didiFileUpload.DidiFileIUploadParam; import pwc.taxtech.atms.dto.didiFileUpload.DidiFileIUploadParam;
import pwc.taxtech.atms.dto.didiFileUpload.DidiFileUploadDetailResult; import pwc.taxtech.atms.dto.didiFileUpload.DidiFileUploadDetailResult;
import pwc.taxtech.atms.dto.reportFileUpload.ReportFileUploadParam; import pwc.taxtech.atms.dto.reportFileUpload.ReportFileUploadParam;
import pwc.taxtech.atms.dto.reportFileUpload.ReportFileUploadResult; import pwc.taxtech.atms.dto.reportFileUpload.ReportFileUploadResult;
import pwc.taxtech.atms.entity.Project; import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.entity.User;
import pwc.taxtech.atms.exception.ServiceException; import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.vat.dao.ReportFileUploadMapper; import pwc.taxtech.atms.vat.dao.ReportFileUploadMapper;
import pwc.taxtech.atms.vat.entity.FileUpload; import pwc.taxtech.atms.vat.entity.FileUpload;
...@@ -43,10 +46,17 @@ public class ReportFileUploadService extends BaseService { ...@@ -43,10 +46,17 @@ public class ReportFileUploadService extends BaseService {
@Resource @Resource
private ProjectMapper projectMapper; private ProjectMapper projectMapper;
@Resource
private OrganizationMapper organizationMapper;
@Resource
private FileTypesMapper fileTypesMapper;
@Autowired @Autowired
DidiFileUploadService didiFileUploadService; DidiFileUploadService didiFileUploadService;
@Autowired
TaxDocumentServiceImpl taxDocumentService;
public List<ReportFileUploadResult> queryData(ReportFileUploadParam param) { public List<ReportFileUploadResult> queryData(ReportFileUploadParam param) {
ReportFileUploadExample example = new ReportFileUploadExample(); ReportFileUploadExample example = new ReportFileUploadExample();
example.createCriteria().andProjectIdEqualTo(param.getProjectId()).andPeriodEqualTo(param.getPeriod()); example.createCriteria().andProjectIdEqualTo(param.getProjectId()).andPeriodEqualTo(param.getPeriod());
...@@ -93,6 +103,7 @@ public class ReportFileUploadService extends BaseService { ...@@ -93,6 +103,7 @@ public class ReportFileUploadService extends BaseService {
return resultList; return resultList;
} }
@Transactional
public void saveData(MultipartFile file, ReportFileUpload data) { public void saveData(MultipartFile file, ReportFileUpload data) {
if (!ReportFileUploadEnum.ReportType.MAPPING.containsKey(data.getReportType())) { if (!ReportFileUploadEnum.ReportType.MAPPING.containsKey(data.getReportType())) {
throw new ServiceException(ErrorMessage.ParamError); throw new ServiceException(ErrorMessage.ParamError);
...@@ -103,15 +114,47 @@ public class ReportFileUploadService extends BaseService { ...@@ -103,15 +114,47 @@ public class ReportFileUploadService extends BaseService {
String uid = authUserHelper.getCurrentUserId(); String uid = authUserHelper.getCurrentUserId();
User user = userMapper.selectByPrimaryKey(uid); User user = userMapper.selectByPrimaryKey(uid);
data.setCreator(user.getUserName()); data.setCreator(user.getUserName());
Project project = projectMapper.selectByPrimaryKey(data.getProjectId());
data.setOrgId(project.getOrganizationId());
ReportFileUploadExample example = new ReportFileUploadExample();
example.createCriteria().andProjectIdEqualTo(data.getProjectId()).andPeriodEqualTo(data.getPeriod()).andReportTypeEqualTo(data.getReportType());
FileUpload fileUpload = didiFileUploadService.uploadFile(file, file.getOriginalFilename(), FileUploadEnum.BizSource.REPORT_UPLOAD.name());
data.setFileUploadId(fileUpload.getUid());
data.setUid(CommonUtils.getUUID()); data.setUid(CommonUtils.getUUID());
data.setCreateTime(new Date()); data.setCreateTime(new Date());
data.setReportFileName(file.getOriginalFilename()); data.setReportFileName(file.getOriginalFilename());
if (StringUtils.isBlank(data.getFileUploadId())) {
FileUpload fileUpload = didiFileUploadService.uploadFile(file, file.getOriginalFilename(), FileUploadEnum.BizSource.REPORT_UPLOAD.name());
data.setFileUploadId(fileUpload.getUid());
}
if (StringUtils.isBlank(data.getProjectId()) && StringUtils.isNotBlank(data.getOrgId()) && data.getPeriod() != null) {
ProjectExample projectExample = new ProjectExample();
String year = String.valueOf(data.getPeriod()).substring(0,4);
projectExample.createCriteria().andOrganizationIdEqualTo(data.getOrgId()).andYearEqualTo(Integer.valueOf(year));
List<Project> projects = projectMapper.selectByExample(projectExample);
if(CollectionUtils.isNotEmpty(projects)){
data.setProjectId(projects.get(0).getId());
}else{
return;
}
}else {
Project project = projectMapper.selectByPrimaryKey(data.getProjectId());
data.setOrgId(project.getOrganizationId());
TaxDocument taxDocument = new TaxDocument();
taxDocument.setCompanyId(project.getOrganizationId());
Organization organization = organizationMapper.selectByPrimaryKey(project.getOrganizationId());
taxDocument.setCompanyName(organization.getName());
taxDocument.setFileUploadId(data.getFileUploadId());
taxDocument.setEnable("T");
taxDocument.setOwnTime(data.getPeriod());
taxDocument.setFileType(data.getReportType());
taxDocument.setFileName(data.getReportFileName());
FileTypesExample example = new FileTypesExample();
example.createCriteria().andFileTypeEqualTo(data.getReportType());
List<FileTypes> dataList = fileTypesMapper.selectByExample(example);
if(CollectionUtils.isNotEmpty(dataList)){
taxDocument.setFileAttr(dataList.get(0).getFileAttr());
taxDocument.setFileTypeId(dataList.get(0).getId());
}
taxDocumentService.addTaxDocumentList(file,taxDocument);
}
ReportFileUploadExample example = new ReportFileUploadExample();
example.createCriteria().andProjectIdEqualTo(data.getProjectId()).andPeriodEqualTo(data.getPeriod()).andReportTypeEqualTo(data.getReportType());
int updateRow = reportFileUploadMapper.updateByExample(data, example); int updateRow = reportFileUploadMapper.updateByExample(data, example);
if (updateRow == 0) { if (updateRow == 0) {
reportFileUploadMapper.insert(data); reportFileUploadMapper.insert(data);
......
...@@ -10,6 +10,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -10,6 +10,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.AuthUserHelper; import pwc.taxtech.atms.common.AuthUserHelper;
import pwc.taxtech.atms.constant.enums.FileUploadEnum; import pwc.taxtech.atms.constant.enums.FileUploadEnum;
import pwc.taxtech.atms.constant.enums.ReportFileUploadEnum;
import pwc.taxtech.atms.dao.TaxDocumentMapper; import pwc.taxtech.atms.dao.TaxDocumentMapper;
import pwc.taxtech.atms.dto.TaxDocumentDto; import pwc.taxtech.atms.dto.TaxDocumentDto;
import pwc.taxtech.atms.dto.didiFileUpload.DidiFileIUploadParam; import pwc.taxtech.atms.dto.didiFileUpload.DidiFileIUploadParam;
...@@ -18,6 +19,7 @@ import pwc.taxtech.atms.entity.OperationLogTaxDocument; ...@@ -18,6 +19,7 @@ import pwc.taxtech.atms.entity.OperationLogTaxDocument;
import pwc.taxtech.atms.entity.TaxDocument; import pwc.taxtech.atms.entity.TaxDocument;
import pwc.taxtech.atms.entity.TaxDocumentExample; import pwc.taxtech.atms.entity.TaxDocumentExample;
import pwc.taxtech.atms.vat.entity.FileUpload; import pwc.taxtech.atms.vat.entity.FileUpload;
import pwc.taxtech.atms.vat.entity.ReportFileUpload;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.*; import java.util.*;
...@@ -39,6 +41,8 @@ public class TaxDocumentServiceImpl { ...@@ -39,6 +41,8 @@ public class TaxDocumentServiceImpl {
@Autowired @Autowired
private OperationLogTaxDocServiceImpl operationLogTaxDocService; private OperationLogTaxDocServiceImpl operationLogTaxDocService;
@Autowired
ReportFileUploadService reportFileUploadService;
@Autowired @Autowired
DidiFileUploadService didiFileUploadService; DidiFileUploadService didiFileUploadService;
...@@ -81,17 +85,21 @@ public class TaxDocumentServiceImpl { ...@@ -81,17 +85,21 @@ public class TaxDocumentServiceImpl {
if (StringUtils.isNotBlank(taxDocumentDto.getFileType())) { if (StringUtils.isNotBlank(taxDocumentDto.getFileType())) {
criteria.andFileTypeEqualTo(taxDocumentDto.getFileType()); criteria.andFileTypeEqualTo(taxDocumentDto.getFileType());
} }
//文件生效日期 fileTime //文件生效起始日期 fileBeginTime
if (null != taxDocumentDto.getFileBeginTime() && null != taxDocumentDto.getFileEndTTime()) { if (null != taxDocumentDto.getFileBeginTime()) {
criteria.andFileTimeBetween(taxDocumentDto.getFileBeginTime(), taxDocumentDto.getFileEndTTime()); criteria.andFileTimeGreaterThanOrEqualTo(taxDocumentDto.getFileBeginTime());
}
//文件生效到期日期 fileEndTTime
if (null != taxDocumentDto.getFileEndTTime()) {
criteria.andFileTimeLessThanOrEqualTo(taxDocumentDto.getFileEndTTime());
} }
//所属时间 ownTime //所属时间 ownTime
if (null != taxDocumentDto.getOwnBeginTime() && null != taxDocumentDto.getOwnEndTime()) { if (null != taxDocumentDto.getOwnTime()) {
criteria.andOwnTimeBetween(taxDocumentDto.getOwnBeginTime(), taxDocumentDto.getOwnEndTime()); criteria.andOwnTimeEqualTo(taxDocumentDto.getOwnTime());
} }
//档案名称 fileName //档案名称 fileName
if (StringUtils.isNotBlank(taxDocumentDto.getFileName())) { if (StringUtils.isNotBlank(taxDocumentDto.getFileName())) {
criteria.andFileNameLike("%"+taxDocumentDto.getFileName()+"%"); criteria.andFileNameLike("%" + taxDocumentDto.getFileName() + "%");
} }
//业务线 businessLine //业务线 businessLine
if (StringUtils.isNotBlank(taxDocumentDto.getBusinessLine())) { if (StringUtils.isNotBlank(taxDocumentDto.getBusinessLine())) {
...@@ -101,9 +109,13 @@ public class TaxDocumentServiceImpl { ...@@ -101,9 +109,13 @@ public class TaxDocumentServiceImpl {
if (StringUtils.isNotBlank(taxDocumentDto.getCompanyName())) { if (StringUtils.isNotBlank(taxDocumentDto.getCompanyName())) {
criteria.andCompanyNameEqualTo(taxDocumentDto.getCompanyName()); criteria.andCompanyNameEqualTo(taxDocumentDto.getCompanyName());
} }
//到期日 effectiveTime //到期起始日 effectiveBeginTime
if (null != taxDocumentDto.getEffectiveBeginTime() && null != taxDocumentDto.getEffectiveEndTime()) { if (null != taxDocumentDto.getEffectiveBeginTime()) {
criteria.andEffectiveTimeBetween(taxDocumentDto.getEffectiveBeginTime(), taxDocumentDto.getEffectiveEndTime()); criteria.andEffectiveTimeGreaterThanOrEqualTo(taxDocumentDto.getEffectiveBeginTime());
}
//到期结束日 effectiveEndTime
if (null != taxDocumentDto.getEffectiveEndTime()) {
criteria.andEffectiveTimeLessThanOrEqualTo(taxDocumentDto.getEffectiveEndTime());
} }
//税种 taxType //税种 taxType
if (StringUtils.isNotBlank(taxDocumentDto.getTaxType())) { if (StringUtils.isNotBlank(taxDocumentDto.getTaxType())) {
...@@ -125,9 +137,13 @@ public class TaxDocumentServiceImpl { ...@@ -125,9 +137,13 @@ public class TaxDocumentServiceImpl {
if (null != taxDocumentDto.getAuditStatus()) { if (null != taxDocumentDto.getAuditStatus()) {
criteria.andAuditStatusEqualTo(taxDocumentDto.getAuditStatus()); criteria.andAuditStatusEqualTo(taxDocumentDto.getAuditStatus());
} }
//上传日期 uploadTime //上传开始日期 uploadBeginTime
if (null != taxDocumentDto.getUploadBeginTime() && null != taxDocumentDto.getUploadEndTime()) { if (null != taxDocumentDto.getUploadBeginTime()) {
criteria.andUploadTimeBetween(taxDocumentDto.getUploadBeginTime(), taxDocumentDto.getUploadEndTime()); criteria.andUploadTimeGreaterThanOrEqualTo(taxDocumentDto.getUploadBeginTime());
}
//上传结束日期 uploadEndTime
if (null != taxDocumentDto.getUploadEndTime()) {
criteria.andUploadTimeLessThanOrEqualTo(taxDocumentDto.getUploadEndTime());
} }
//创建人 creator //创建人 creator
if (StringUtils.isNotBlank(taxDocumentDto.getCreator())) { if (StringUtils.isNotBlank(taxDocumentDto.getCreator())) {
...@@ -140,18 +156,32 @@ public class TaxDocumentServiceImpl { ...@@ -140,18 +156,32 @@ public class TaxDocumentServiceImpl {
public synchronized boolean addTaxDocumentList(MultipartFile file, TaxDocument taxDocument) { public synchronized boolean addTaxDocumentList(MultipartFile file, TaxDocument taxDocument) {
try { try {
//上传文件 //上传文件
FileUpload fileUpload = didiFileUploadService.uploadFile(file,file.getOriginalFilename(), FileUploadEnum.BizSource.RECORD_UPLOAD.name()); if(StringUtils.isBlank(taxDocument.getFileUploadId())){
taxDocument.setFileUploadId(fileUpload.getUid()); FileUpload fileUpload = didiFileUploadService.uploadFile(file,file.getOriginalFilename(), FileUploadEnum.BizSource.RECORD_UPLOAD.name());
taxDocument.setFilePositionUrl(fileUpload.getViewHttpUrl()); taxDocument.setFileUploadId(fileUpload.getUid());
taxDocument.setFilePositionUrl(fileUpload.getViewHttpUrl());
if(ReportFileUploadEnum.ReportType.MAPPING.containsKey(taxDocument.getFileType())){
ReportFileUpload reportFileUpload = new ReportFileUpload();
reportFileUpload.setOrgId(taxDocument.getCompanyId());
reportFileUpload.setSourceType(ReportFileUploadEnum.SuorceType.RECORD.name());
String period = String.valueOf(taxDocument.getOwnTime()).substring(0,6);
reportFileUpload.setPeriod(Integer.valueOf(period));
reportFileUpload.setFileUploadId(fileUpload.getUid());
reportFileUpload.setReportType(taxDocument.getFileType());
reportFileUploadService.saveData(file,reportFileUpload);
}
}
//设置创建人 创建时间信息 设置年份区分 //设置创建人 创建时间信息 设置年份区分
taxDocument.setCreateTime(new Date()); taxDocument.setCreateTime(new Date());
taxDocument.setUpdateTime(new Date());
taxDocument.setCreator(authUserHelper.getCurrentAuditor().get()); taxDocument.setCreator(authUserHelper.getCurrentAuditor().get());
taxDocument.setCreatorId(authUserHelper.getCurrentUserId()); taxDocument.setCreatorId(authUserHelper.getCurrentUserId());
taxDocument.setUploadTime(new Date()); taxDocument.setUploadTime(new Date());
taxDocument.setYearRedundancy(Calendar.getInstance().get(Calendar.YEAR)); taxDocument.setYearRedundancy(Calendar.getInstance().get(Calendar.YEAR));
int num = taxDocumentMapper.insert(taxDocument); Long id = taxDocumentMapper.insert(taxDocument);
if (num > 0) { if (id > 0) {
OperationLogTaxDocument actionEntity = buildOperationLogTaxDocument(); OperationLogTaxDocument actionEntity = buildOperationLogTaxDocument();
actionEntity.setId(id.toString());
actionEntity.setOperationAction("新增"); actionEntity.setOperationAction("新增");
actionEntity.setUpdateState(taxDocument.toString()); actionEntity.setUpdateState(taxDocument.toString());
boolean result = operationLogTaxDocService.addTaxDocumentList(actionEntity); boolean result = operationLogTaxDocService.addTaxDocumentList(actionEntity);
...@@ -177,6 +207,7 @@ public class TaxDocumentServiceImpl { ...@@ -177,6 +207,7 @@ public class TaxDocumentServiceImpl {
if (num > 0) { if (num > 0) {
OperationLogTaxDocument actionEntity = buildOperationLogTaxDocument(); OperationLogTaxDocument actionEntity = buildOperationLogTaxDocument();
actionEntity.setOperationAction("删除"); actionEntity.setOperationAction("删除");
actionEntity.setId(id.toString());
boolean result = operationLogTaxDocService.addTaxDocumentList(actionEntity); boolean result = operationLogTaxDocService.addTaxDocumentList(actionEntity);
if (result) { if (result) {
return true; return true;
...@@ -205,7 +236,20 @@ public class TaxDocumentServiceImpl { ...@@ -205,7 +236,20 @@ public class TaxDocumentServiceImpl {
return false; return false;
} }
for (Long id : ids) { for (Long id : ids) {
taxDocumentMapper.deleteByPrimaryKey(id); int num = taxDocumentMapper.deleteByPrimaryKey(id);
if (num > 0) {
OperationLogTaxDocument actionEntity = buildOperationLogTaxDocument();
actionEntity.setOperationAction("删除");
actionEntity.setId(id.toString());
boolean result = operationLogTaxDocService.addTaxDocumentList(actionEntity);
if (result) {
return true;
} else {
throw new RuntimeException("TaxDocumentServiceImpl batchDeleteTaxDocument log error");
}
} else {
return false;
}
} }
return true; return true;
} catch (Exception e) { } catch (Exception e) {
...@@ -246,7 +290,6 @@ public class TaxDocumentServiceImpl { ...@@ -246,7 +290,6 @@ public class TaxDocumentServiceImpl {
*/ */
private OperationLogTaxDocument buildOperationLogTaxDocument() { private OperationLogTaxDocument buildOperationLogTaxDocument() {
OperationLogTaxDocument actionEntity = new OperationLogTaxDocument(); OperationLogTaxDocument actionEntity = new OperationLogTaxDocument();
actionEntity.setId("TaxDocument:" + UUID.randomUUID().toString());
actionEntity.setOperationContent("主页"); actionEntity.setOperationContent("主页");
actionEntity.setModuleName("档案管理"); actionEntity.setModuleName("档案管理");
actionEntity.setOperationObject("税务档案"); actionEntity.setOperationObject("税务档案");
......
...@@ -361,6 +361,9 @@ public class TemplateGroupServiceImpl extends AbstractService { ...@@ -361,6 +361,9 @@ public class TemplateGroupServiceImpl extends AbstractService {
Row row = temp.getRow(j); Row row = temp.getRow(j);
for(int k = row.getFirstCellNum(); k < row.getLastCellNum(); k++){ for(int k = row.getFirstCellNum(); k < row.getLastCellNum(); k++){
Cell cell = row.getCell(k); Cell cell = row.getCell(k);
if (cell == null) {
continue;//todo cell == null 如何处理
}
cell.setCellType(CellType.STRING); cell.setCellType(CellType.STRING);
if(!cell.getCellStyle().getLocked() && "${KeyIn}".equalsIgnoreCase(cell.getStringCellValue())){ if(!cell.getCellStyle().getLocked() && "${KeyIn}".equalsIgnoreCase(cell.getStringCellValue())){
cell.setCellValue(""); cell.setCellValue("");
......
...@@ -131,7 +131,6 @@ public class FormulaAgent { ...@@ -131,7 +131,6 @@ public class FormulaAgent {
public PeriodCellData getCellData(String templateId, String cellId, int periodId, String projectId) { public PeriodCellData getCellData(String templateId, String cellId, int periodId, String projectId) {
PeriodReport report = getReportByTemplate(templateId, periodId, projectId); PeriodReport report = getReportByTemplate(templateId, periodId, projectId);
MyAsserts.assertNotNull(report, Exceptions.BB_REPORT_NULL); MyAsserts.assertNotNull(report, Exceptions.BB_REPORT_NULL);
PeriodCellData cellData = getCellDataListByTemplate(cellId, report.getId()); PeriodCellData cellData = getCellDataListByTemplate(cellId, report.getId());
MyAsserts.assertNotNull(cellData, Exceptions.BB_CELL_DATA_NULL); MyAsserts.assertNotNull(cellData, Exceptions.BB_CELL_DATA_NULL);
return cellData; return cellData;
...@@ -147,65 +146,100 @@ public class FormulaAgent { ...@@ -147,65 +146,100 @@ public class FormulaAgent {
public static String buildSql(String tableName, String getField, String filter, String filterValue, Integer period, String year, FormulaContext formulaContext) { public static String buildSql(String tableName, String getField, String filter, String filterValue, Integer period, String year, FormulaContext formulaContext) {
String sql = ""; /*
String[] split = filterValue.split(" ");
String para3 = null;
if (split[0].indexOf(">=") != -1) { if (split[0].indexOf(">=") != -1) {
filterValue = "> " + split[1] + "and" + filter + " =" + split[1]; filterValue = " > " + split[1] + " or " + filter + " = " + split[1];
} else if (split[0].indexOf("<=") != -1) {
filterValue = " < " + split[1] + " or " + filter + " = " + split[1];
} else {
filterValue = split[0] + " = " + split[1] + "";
} }
if (split[0].indexOf("<=") != -1) { */
filterValue = "< " + split[1] + "and" + filter + " =" + split[1];
if (tableName.substring(0, 3).equals("cit")) {
try {
return _buildSql(getField, tableName, filter, filterValue, period, formulaContext, year, true);
} catch (Exception e) {
e.printStackTrace();
}
} }
if ("CITZCFZB".equals(tableName) || ("CITLRB".equals(tableName))) { try {
return _buildSql(getField, tableName, filter, filterValue, period, formulaContext, year, false); return _buildSql(getField, tableName, filter, filterValue, period, formulaContext, year, false);
} catch (Exception e) {
e.printStackTrace();
} }
return _buildSql(getField, tableName, filter, filterValue, period, formulaContext, year, true); return null;
} }
public static String _buildSql(String getField, String tableName, String filter, String filterValue, Integer period, FormulaContext formulaContext, String year, boolean bool) {
String sql = "select " + getField + " from " + tableName + " where 1=1 and " + filter + filterValue;
String _p = ""; public static String _buildSql(String getField, String tableName, String filter, String filterValue, Integer period, FormulaContext formulaContext, String year, boolean bool) throws Exception {
if (formulaContext.getPeriod() - period < 10) { String sql = "select sum(" + getField + ") as " + getField + " from " + tableName + " where 1=1 and " + filter + filterValue;
_p = year + "'0" + (formulaContext.getPeriod() - period) + "'"; String _p = insertZero(formulaContext.getPeriod() - Math.abs(period));
} else { String _period = insertZero(formulaContext.getPeriod());
_p = year + (formulaContext.getPeriod() - period); String per = insertZero((formulaContext.getPeriod() - 1));
if (!bool) {
if (period == 0) {
sql += " and tms_period = " + Integer.parseInt(year + _period);
} else if (period == -99) {
sql += " and tms_period between " + Integer.parseInt(year + "01") + " and " + Integer.parseInt(year + per);
} else if (period == 99) {
sql += " and tms_period between " + Integer.parseInt(year + "01") + " and " + Integer.parseInt(year + _period);
} else {
if (period > 0)
throw new Exception("参数不正确");
sql += " and tms_period between " + Integer.parseInt(year + _p) + " and " + Integer.parseInt(year + per);
}
} }
if (period == 0) { if (bool)
sql += " and tms-period = " + formulaContext.getPeriod(); sql += " and period = " + year;
} else if (period == -99) { return sql;
sql += "and tms-period between '" + year + "01' and " + (formulaContext.getPeriod() - 1); }
} else if (period == 99) {
sql += "and tms-period between '" + year + "01' and " + (formulaContext.getPeriod()); public static String insertZero(Integer itr) {
String str = null;
if (itr < 10) {
str = "0" + itr;
} else { } else {
sql += "and tms-period between " + _p + "and " + (formulaContext.getPeriod() - 1); str = "" + itr;
} }
if (bool) { return str;
sql += " and period = '" + year + period + "'";
}
return sql;
} }
@Autowired @Autowired
JdbcTemplate jdbcTemplate; JdbcTemplate jdbcTemplate;
public static void main(String[] args) { public static void main(String[] args) {
System.out.println(buildSql("balance_sheet", "end_bal", "beg_bal", "> 0.00", 201810, "2", null)); FormulaAgent formulaAgent = new FormulaAgent();
; FormulaContext formulaContext = new FormulaContext();
formulaContext.setPeriod(3);
formulaAgent.getTableDataByName("CIT_TBAM", "ending_balance", "attribute", "= '销售费用-财产损耗、盘亏及毁损损失'", 0, "2018", formulaContext);
} }
public Long getTableDataByName(String tableName, String getField, String filter, String filterValue, Integer period, String year, FormulaContext formulaContext) { public BigDecimal getTableDataByName(String tableName, String getField, String filter, String filterValue, Integer period, String year, FormulaContext formulaContext) {
List<Map<String, Object>> stringObjectMap = jdbcTemplate.queryForList(buildSql(TableRule.map.get(tableName), getField, filter, filterValue, period, year, formulaContext)); Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(buildSql(TableRule.map.get(tableName), getField, filter, filterValue, period, year, formulaContext));
Long rev = 0L; /* for (int i = 0, j = stringObjectMap.size(); i < j; i++) {
for (int i = 0, j = stringObjectMap.size(); i < j; i++) {
if (i == 1) { if (i == 1) {
rev = Long.parseLong(String.valueOf(stringObjectMap.get(i).get(StringUtil.underline2Camel(getField)))); if(stringObjectMap.get(i).get(StringUtil.underline2Camel(getField)) == null){
rev = 0.00;
}else{
rev = Long.parseLong(String.valueOf(stringObjectMap.get(i).get(StringUtil.underline2Camel(getField))));
}
} else { } else {
rev = rev + Long.parseLong(String.valueOf(stringObjectMap.get(i).get(StringUtil.underline2Camel(getField)))); if(stringObjectMap.get(i).get(StringUtil.underline2Camel(getField)) == null){
rev= rev+ 0.00;
}else{
rev = rev + Long.parseLong(String.valueOf(stringObjectMap.get(i).get(StringUtil.underline2Camel(getField))));
}
} }
} }
return rev; */
if(stringObjectMap.get(getField) != null ){
return new BigDecimal(stringObjectMap.get(getField).toString());
}
return new BigDecimal(0);
} }
} }
...@@ -512,8 +512,8 @@ public class ReportGeneratorImpl { ...@@ -512,8 +512,8 @@ public class ReportGeneratorImpl {
FreeRefFunction[] functionImpls = {new SGSR(formulaContext), new FSJZ(formulaContext), new ND(formulaContext), FreeRefFunction[] functionImpls = {new SGSR(formulaContext), new FSJZ(formulaContext), new ND(formulaContext),
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 SUM2(formulaContext), new JFFS(formulaContext), new WPSR(formulaContext), new WPNAME(formulaContext), new WPTYPE(formulaContext), new SUM2(formulaContext),
new SUM(formulaContext), new RSUMIF(formulaContext), new TABLESUMIF(formulaContext)}; new RSUMIF(formulaContext), new TABLESUMIF(formulaContext), new SUM(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);
......
...@@ -60,7 +60,7 @@ public class ReportServiceImpl extends BaseService { ...@@ -60,7 +60,7 @@ public class ReportServiceImpl extends BaseService {
private final static Logger logger = LoggerFactory.getLogger(ReportServiceImpl.class); private final static Logger logger = LoggerFactory.getLogger(ReportServiceImpl.class);
private BlockingQueue<PeriodJob> queue = new LinkedBlockingQueue<>(); private BlockingQueue<PeriodJob> queue = new LinkedBlockingQueue<>();
private final static String[] functions = {"SGSR", "FSJZ", "ND", "BB", "XXFP", "GZSD", "PC", "JXFPMX", private final static String[] functions = {"SGSR", "FSJZ", "ND", "BB", "XXFP", "GZSD", "PC", "JXFPMX",
"JXFP", "PSUM", "DFFS", "JFFS", "WPSR","WPNAME","WPTYPE"}; "JXFP", "PSUM", "DFFS", "JFFS", "WPSR","WPNAME","WPTYPE", "SUM2", "RSUMIF", "TABLESUMIF", "SUM"};
@Autowired @Autowired
private ReportGeneratorImpl reportGenerator; private ReportGeneratorImpl reportGenerator;
...@@ -507,12 +507,9 @@ public class ReportServiceImpl extends BaseService { ...@@ -507,12 +507,9 @@ public class ReportServiceImpl extends BaseService {
@Override @Override
public void run() { public void run() {
try { try {
updateConfig(projectId, periodParam, isMergeManualData, templates, genJob);
//进行数据校验 //进行数据校验
DataValidation(periodParam, projectId,genJob ); DataValidation(periodParam, projectId,genJob );
updateConfig(projectId, periodParam, isMergeManualData, templates, genJob);
PeriodResources resources = reportGenerator.getPeriodResources(projectId, periodParam, PeriodResources resources = reportGenerator.getPeriodResources(projectId, periodParam,
templates.stream().map(Template::getId).collect(Collectors.toList())); templates.stream().map(Template::getId).collect(Collectors.toList()));
......
...@@ -5,13 +5,9 @@ import org.apache.poi.ss.formula.eval.EvaluationException; ...@@ -5,13 +5,9 @@ import org.apache.poi.ss.formula.eval.EvaluationException;
import org.apache.poi.ss.formula.eval.NumberEval; import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.ValueEval; import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction; import org.apache.poi.ss.formula.functions.FreeRefFunction;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.TableRule; import pwc.taxtech.atms.dto.TableRule;
import pwc.taxtech.atms.exception.Exceptions; import pwc.taxtech.atms.exception.Exceptions;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import static pwc.taxtech.atms.common.util.FormulaUtil.resolverInteger; import static pwc.taxtech.atms.common.util.FormulaUtil.resolverInteger;
import static pwc.taxtech.atms.common.util.FormulaUtil.resolverString; import static pwc.taxtech.atms.common.util.FormulaUtil.resolverString;
...@@ -32,7 +28,7 @@ public class TABLESUMIF extends FunctionBase implements FreeRefFunction { ...@@ -32,7 +28,7 @@ public class TABLESUMIF extends FunctionBase implements FreeRefFunction {
//进行参数验证 //进行参数验证
public void parameterCheck(ValueEval[] args, OperationEvaluationContext ec) { public void parameterCheck(ValueEval[] args, OperationEvaluationContext ec) {
argsLength = args.length; argsLength = args.length;
if (argsLength != 6) //参数小于当做异常处理, 最后俩参数可以取默认值 if (argsLength != 6) //参数小于6当做异常处理, 最后俩参数可以取默认值
throw Exceptions.parameterError; throw Exceptions.parameterError;
try { try {
tableName = resolverString(args, ec, 0); tableName = resolverString(args, ec, 0);
...@@ -46,7 +42,6 @@ public class TABLESUMIF extends FunctionBase implements FreeRefFunction { ...@@ -46,7 +42,6 @@ public class TABLESUMIF extends FunctionBase implements FreeRefFunction {
} }
Integer argsLength; Integer argsLength;
String getField; String getField;
Integer period; Integer period;
String year; String year;
...@@ -61,12 +56,10 @@ public class TABLESUMIF extends FunctionBase implements FreeRefFunction { ...@@ -61,12 +56,10 @@ public class TABLESUMIF extends FunctionBase implements FreeRefFunction {
String filterValue =resolverString(args, ec, 3); String filterValue =resolverString(args, ec, 3);
period = resolverInteger(args, ec, 4);//会计期间 period = resolverInteger(args, ec, 4);//会计期间
year = resolverString(args, ec, 5);//会计年度 year = resolverString(args, ec, 5);//会计年度
new NumberEval(agent.getTableDataByName(tableName, getField,filter,filterValue, period, year, formulaContext)); return new NumberEval(agent.getTableDataByName(tableName, getField,filter,filterValue, period, year, formulaContext).doubleValue());
} catch (EvaluationException e) { } catch (EvaluationException e) {
e.printStackTrace(); e.printStackTrace();
return new NumberEval(0.00); return new NumberEval(0.00);
} }
return new NumberEval(0.00);
} }
} }
...@@ -62,5 +62,28 @@ ...@@ -62,5 +62,28 @@
<artifactId>fastjson</artifactId> <artifactId>fastjson</artifactId>
<version>1.2.40</version> <version>1.2.40</version>
</dependency> </dependency>
<!--Excel to Json-->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
<!--Excel to Json End-->
</dependencies> </dependencies>
</project> </project>
package pwc.taxtech.atms.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.MyMapper;
import pwc.taxtech.atms.entity.CitTbam;
import pwc.taxtech.atms.entity.CitTbamExample;
@Mapper
public interface CitTbamMapper extends MyMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_tbam
*
* @mbg.generated
*/
long countByExample(CitTbamExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_tbam
*
* @mbg.generated
*/
int deleteByExample(CitTbamExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_tbam
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_tbam
*
* @mbg.generated
*/
int insert(CitTbam record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_tbam
*
* @mbg.generated
*/
int insertSelective(CitTbam record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_tbam
*
* @mbg.generated
*/
List<CitTbam> selectByExampleWithRowbounds(CitTbamExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_tbam
*
* @mbg.generated
*/
List<CitTbam> selectByExample(CitTbamExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_tbam
*
* @mbg.generated
*/
CitTbam selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_tbam
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") CitTbam record, @Param("example") CitTbamExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_tbam
*
* @mbg.generated
*/
int updateByExample(@Param("record") CitTbam record, @Param("example") CitTbamExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_tbam
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(CitTbam record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_tbam
*
* @mbg.generated
*/
int updateByPrimaryKey(CitTbam record);
/**
* 批量插入数据
* @author zhikai.z.wei
* @param citTbamList
* @return
*/
int insertBatch(List<CitTbam> citTbamList);
}
\ No newline at end of file
...@@ -41,7 +41,7 @@ public interface FileTypesMapper extends MyMapper { ...@@ -41,7 +41,7 @@ public interface FileTypesMapper extends MyMapper {
* *
* @mbg.generated * @mbg.generated
*/ */
int insert(FileTypes record); Long insert(FileTypes record);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
......
...@@ -41,7 +41,7 @@ public interface TaxDocumentMapper extends MyMapper { ...@@ -41,7 +41,7 @@ public interface TaxDocumentMapper extends MyMapper {
* *
* @mbg.generated * @mbg.generated
*/ */
int insert(TaxDocument record); Long insert(TaxDocument record);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
......
This diff is collapsed.
...@@ -443,22 +443,16 @@ public class FileTypes implements Serializable { ...@@ -443,22 +443,16 @@ public class FileTypes implements Serializable {
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName()); sb.append("序号=").append(id);
sb.append(" ["); sb.append(", 档案属性=").append(fileAttr);
sb.append("Hash = ").append(hashCode()); sb.append(", 档案类型=").append(fileType);
sb.append(", id=").append(id); sb.append(", 说明=").append(description);
sb.append(", fileAttr=").append(fileAttr); sb.append(", 必填字段=").append(requiredField);
sb.append(", fileTypeId=").append(fileTypeId); sb.append(", 创建人=").append(creator);
sb.append(", fileType=").append(fileType); sb.append(", 创建时间=").append(null==createTime?null:createTime.toLocaleString());
sb.append(", description=").append(description); sb.append(", 更新时间=").append(null==updateTime?null:updateTime.toLocaleString());
sb.append(", creatorId=").append(creatorId); sb.append(", 状态=").append("T".equals(status)?"启用":"未启用");
sb.append(", requiredField=").append(requiredField); sb.append(", 说明=").append(remarks);
sb.append(", creator=").append(creator);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", status=").append(status);
sb.append(", remarks=").append(remarks);
sb.append("]");
return sb.toString(); return sb.toString();
} }
......
...@@ -42,7 +42,7 @@ public class TaxDocument implements Serializable { ...@@ -42,7 +42,7 @@ public class TaxDocument implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
private Integer fileTypeId; private Long fileTypeId;
/** /**
* Database Column Remarks: * Database Column Remarks:
...@@ -86,7 +86,7 @@ public class TaxDocument implements Serializable { ...@@ -86,7 +86,7 @@ public class TaxDocument implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
private Integer companyId; private String companyId;
/** /**
* Database Column Remarks: * Database Column Remarks:
...@@ -141,7 +141,7 @@ public class TaxDocument implements Serializable { ...@@ -141,7 +141,7 @@ public class TaxDocument implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
private Date ownTime; private Integer ownTime;
/** /**
* *
...@@ -344,11 +344,11 @@ public class TaxDocument implements Serializable { ...@@ -344,11 +344,11 @@ public class TaxDocument implements Serializable {
this.auditStatus = auditStatus; this.auditStatus = auditStatus;
} }
public Date getOwnTime() { public Integer getOwnTime() {
return ownTime; return ownTime;
} }
public void setOwnTime(Date ownTime) { public void setOwnTime(Integer ownTime) {
this.ownTime = ownTime; this.ownTime = ownTime;
} }
...@@ -424,7 +424,7 @@ public class TaxDocument implements Serializable { ...@@ -424,7 +424,7 @@ public class TaxDocument implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
public Integer getFileTypeId() { public Long getFileTypeId() {
return fileTypeId; return fileTypeId;
} }
...@@ -436,7 +436,7 @@ public class TaxDocument implements Serializable { ...@@ -436,7 +436,7 @@ public class TaxDocument implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
public void setFileTypeId(Integer fileTypeId) { public void setFileTypeId(Long fileTypeId) {
this.fileTypeId = fileTypeId; this.fileTypeId = fileTypeId;
} }
...@@ -520,7 +520,7 @@ public class TaxDocument implements Serializable { ...@@ -520,7 +520,7 @@ public class TaxDocument implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
public Integer getCompanyId() { public String getCompanyId() {
return companyId; return companyId;
} }
...@@ -532,7 +532,7 @@ public class TaxDocument implements Serializable { ...@@ -532,7 +532,7 @@ public class TaxDocument implements Serializable {
* *
* @mbg.generated * @mbg.generated
*/ */
public void setCompanyId(Integer companyId) { public void setCompanyId(String companyId) {
this.companyId = companyId; this.companyId = companyId;
} }
...@@ -904,34 +904,27 @@ public class TaxDocument implements Serializable { ...@@ -904,34 +904,27 @@ public class TaxDocument implements Serializable {
*/ */
@Override @Override
public String toString() { public String toString() {
return "TaxDocument{" + StringBuilder sb = new StringBuilder();
"id=" + id + sb.append("序号=").append(id);
", fileAttr='" + fileAttr + '\'' + sb.append("档案属性=").append(fileAttr);
", fileTypeId=" + fileTypeId + sb.append("档案类型=").append(fileType);
", fileType='" + fileType + '\'' + sb.append("文件名称=").append(fileName);
", fileName='" + fileName + '\'' + sb.append("业务线=").append(businessLine);
", businessLine='" + businessLine + '\'' + sb.append("公司名称=").append(companyName);
", companyId=" + companyId + sb.append("税种=").append(taxType);
", companyName='" + companyName + '\'' + sb.append("文件生效日期=").append(fileTime==null?null:fileTime.toLocaleString());
", taxType='" + taxType + '\'' + sb.append("到期日=").append(effectiveTime==null?null:effectiveTime.toLocaleString() );
", fileTime=" + fileTime + sb.append("所属期间=").append(ownTime );
", effectiveTime=" + effectiveTime + sb.append("创建人=").append(creator );
", ownTime=" + ownTime + sb.append("创建时间=").append(createTime==null?null:createTime.toLocaleString());
", creatorId='" + creatorId + '\'' + sb.append("更新时间=").append(updateTime==null?null:updateTime.toLocaleString());
", creator='" + creator + '\'' + sb.append("上传时间=").append(uploadTime==null?null:uploadTime.toLocaleString());
", createTime=" + createTime + sb.append("实物存放地点=").append(storageArea );
", updateTime=" + updateTime + sb.append("保管人=").append(keeper );
", uploadTime=" + uploadTime + sb.append("实物索引号=").append(physicalIndexNumber );
", storageArea='" + storageArea + '\'' + sb.append("备注=").append(remark );
", keeperId='" + keeperId + '\'' + sb.append("审批状态=").append(null==auditStatus?null:auditStatus==0?"未审核":auditStatus==1?"审核通过":"审核不通过");
", keeper='" + keeper + '\'' + sb.append("是否可用=").append("T".equals(enable)?"启用":"未启用");
", physicalIndexNumber='" + physicalIndexNumber + '\'' + return sb.toString();
", remark='" + remark + '\'' +
", fileOriginalName='" + fileOriginalName + '\'' +
", filePositionUrl='" + filePositionUrl + '\'' +
", yearRedundancy=" + yearRedundancy +
", auditStatus=" + auditStatus +
", enable='" + enable + '\'' +
'}';
} }
} }
\ No newline at end of file
...@@ -745,6 +745,11 @@ public class TaxDocumentExample { ...@@ -745,6 +745,11 @@ public class TaxDocumentExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOwnTimeEqualTo(Integer value) {
addCriterion("own_time =", value, "ownTime");
return (Criteria) this;
}
public Criteria andAuditStatusEqualTo(Integer value) { public Criteria andAuditStatusEqualTo(Integer value) {
addCriterion("audit_status =", value, "auditStatus"); addCriterion("audit_status =", value, "auditStatus");
return (Criteria) this; return (Criteria) this;
...@@ -860,11 +865,6 @@ public class TaxDocumentExample { ...@@ -860,11 +865,6 @@ public class TaxDocumentExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOwnTimeBetween(Date value1, Date value2) {
addCriterion("own_time between", value1, value2, "ownTime");
return (Criteria) this;
}
public Criteria andFileTimeNotBetween(Date value1, Date value2) { public Criteria andFileTimeNotBetween(Date value1, Date value2) {
addCriterion("file_time not between", value1, value2, "fileTime"); addCriterion("file_time not between", value1, value2, "fileTime");
return (Criteria) this; return (Criteria) this;
......
...@@ -133,7 +133,22 @@ ...@@ -133,7 +133,22 @@
<select id ="selectByCondition" parameterType="pwc.taxtech.atms.entity.CitEAMAssetsDisposal" resultType="pwc.taxtech.atms.entity.CitEAMAssetsDisposal"> <select id ="selectByCondition" parameterType="pwc.taxtech.atms.entity.CitEAMAssetsDisposal" resultType="pwc.taxtech.atms.entity.CitEAMAssetsDisposal">
select select
id, organization_id as organizationId, project_id as projectId, period, source, occur_period as occurPeriod, asset_label_number as assetLabelNumber, id, organization_id as organizationId, project_id as projectId, period, source, occur_period as occurPeriod, asset_label_number as assetLabelNumber,
compensation_sale_amount as compensationSaleAmount, created_by as createBy, updated_by as updateBy, create_time as createTime, update_time as updateTime compensation_sale_amount as compensationSaleAmount, created_by as createBy, updated_by as updateBy, create_time as createTime, update_time as updateTime,
oa_asset_bill_type oaAssetBillType,
oa_asset_number oaAssetNumber,
scrap_reason scrapReason,
asset_number assetNumber,
asset_label_number assetLabelNumber,
compensation_sale_amount compensationSaleAmount,
liable_employee_num liableEmployeeNum,
liable_employee_name liableEmployeeName,
remit_employee_num remitEmployeeNum,
remit_employee_name remitEmployeeName,
remit_time remitTime,
remit_amount remitAmount,
gathering_company_name gatheringCompanyName,
gathering_company_account gatheringCompanyAccount,
remark
from cit_eam_assets_disposal from cit_eam_assets_disposal
WHERE WHERE
<include refid="QueryCondition"/> <include refid="QueryCondition"/>
......
...@@ -209,7 +209,37 @@ ...@@ -209,7 +209,37 @@
advance advance, advance advance,
approved_standard_invoice_amount approvedStandardInvoiceAmount, approved_standard_invoice_amount approvedStandardInvoiceAmount,
created_by createdBy, created_by createdBy,
create_time createTime create_time createTime,
remark,
credit_prepaid_accounts as creditPrepaidAccounts,
debit_advance_gene as debitAdvanceGene,
ledger_id ledgerId,
exchange_rate exchangeRate,
reclassify_amount reclassifyAmount ,
check_one checkOne,
advance_write_off advanceWriteOff,
usable_balance usableBalance,
usable_invoice_amount usableInvoiceAmount,
paid_invoice_amount paidInvoiceAmount,
approved_standard_invoice_amount approvedStandardInvoiceAmount,
unexecuted_service_schedule unexecutedServiceSchedule,
advance advance ,
coupa_total_accept coupaTotalAccept,
executed_service_schedule executedServiceSchedule,
order_amount orderAmount,
currency currency,
standard_money standardMoney,
item item
supplier supplier,
cost_center costCenter,
cost_center_code costCenterCode,
po_subject_code poSubjectCode,
purchase_person purchasePerson,
lading_bill_person ladingBillPerson,
po_row poRow,
po_no poNo,
po_create_time poCreateTime,
from cit_salary_advance from cit_salary_advance
WHERE WHERE
<include refid="QueryCondition"/> <include refid="QueryCondition"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.CitTbamMapper">
<insert id="insertBatch" parameterType="java.util.List">
insert into cit_tbam
(<include refid="Base_Column_List"/>)
values
<foreach collection="list" item="item" index="index" separator=",">
<trim prefix="(" suffix=")" suffixOverrides=",">
<choose>
<when test="item.id != null">#{item.id,jdbcType=BIGINT},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.organizationId != null">#{item.organizationId,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.projectId != null">#{item.projectId,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.date != null">#{item.date,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.source != null">#{item.source,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.period != null">#{item.period,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.accountPeriod != null">#{item.accountPeriod,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.attribute != null">#{item.attribute,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.accountCode != null">#{item.accountCode,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.accountDescription != null">#{item.accountDescription,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.debitAmount != null">#{item.debitAmount,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.creditAmount != null">#{item.creditAmount,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.beginningBalance != null">#{item.beginningBalance,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.endingBalance != null">#{item.endingBalance,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.createBy != null">#{item.createBy,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.createTime != null">#{item.createTime,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.updateTime != null">#{item.updateTime,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
</trim>
</foreach>;
SELECT 1 FROM DUAL;
</insert>
</mapper>
\ No newline at end of file
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
id, file_attr, file_type_id, file_type, description, creator_id, creator, create_time, id, file_attr, file_type_id, file_type, description, creator_id, creator, create_time,
update_time, status, remarks,required_field_json update_time, status, remarks,required_field_json
</sql> </sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.entity.FileTypesExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="pwc.taxtech.atms.entity.FileTypesExample" resultMap="BaseResultMap">
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from file_types from file_types
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
...@@ -139,19 +139,19 @@ ...@@ -139,19 +139,19 @@
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="pwc.taxtech.atms.entity.FileTypes"> <insert id="insert" keyProperty="id" useGeneratedKeys="true">
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
insert into file_types (file_attr, file_type_id, insert into file_types (file_attr, file_type_id,
file_type, description, creator_id, file_type, description, creator_id,
creator, create_time, update_time, creator, create_time, update_time,
status, remarks,required_field_json) status, remarks,required_field_json)
values ( #{fileAttr,jdbcType=VARCHAR}, #{fileTypeId,jdbcType=INTEGER}, values ( #{fileAttr,jdbcType=VARCHAR}, #{fileTypeId,jdbcType=INTEGER},
#{fileType,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{creatorId,jdbcType=VARCHAR}, #{fileType,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{creatorId,jdbcType=VARCHAR},
#{creator,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{creator,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{status,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR},#{requiredFieldJson}) #{status,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR},#{requiredFieldJson})
</insert> </insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.FileTypes"> <insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.FileTypes">
<!-- <!--
...@@ -292,16 +292,16 @@ ...@@ -292,16 +292,16 @@
--> -->
update file_types update file_types
set id = #{record.id,jdbcType=BIGINT}, set id = #{record.id,jdbcType=BIGINT},
file_attr = #{record.fileAttr,jdbcType=VARCHAR}, file_attr = #{record.fileAttr,jdbcType=VARCHAR},
file_type_id = #{record.fileTypeId,jdbcType=INTEGER}, file_type_id = #{record.fileTypeId,jdbcType=INTEGER},
file_type = #{record.fileType,jdbcType=VARCHAR}, file_type = #{record.fileType,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR}, description = #{record.description,jdbcType=VARCHAR},
creator_id = #{record.creatorId,jdbcType=VARCHAR}, creator_id = #{record.creatorId,jdbcType=VARCHAR},
creator = #{record.creator,jdbcType=VARCHAR}, creator = #{record.creator,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},
status = #{record.status,jdbcType=VARCHAR}, status = #{record.status,jdbcType=VARCHAR},
remarks = #{record.remarks,jdbcType=VARCHAR} remarks = #{record.remarks,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>
......
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
id, operation_content, module_name, operation_object, operation_action, original_state, id, operation_content, module_name, operation_object, operation_action, original_state,
update_state, operation_user, ip, comment, create_time update_state, operation_user, ip, comment, create_time
</sql> </sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.entity.OperationLogFileTypeExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="pwc.taxtech.atms.entity.OperationLogFileTypeExample" resultMap="BaseResultMap">
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
<if test="distinct"> <if test="distinct">
distinct distinct
</if> </if>
<include refid="Base_Column_List" /> id, operation_action, original_state, update_state, operation_user, ip, comment, create_time
from operation_log_file_type from operation_log_file_type
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
...@@ -109,14 +109,14 @@ ...@@ -109,14 +109,14 @@
<!--<if test="orderByClause != null"> <!--<if test="orderByClause != null">
order by ${orderByClause} order by ${orderByClause}
</if>--> </if>-->
ORDER BY create_time ORDER BY create_time
</select> </select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from operation_log_file_type from operation_log_file_type
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
...@@ -144,14 +144,14 @@ ...@@ -144,14 +144,14 @@
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
insert into operation_log_file_type (id, operation_content, module_name, insert into operation_log_file_type (id, operation_content, module_name,
operation_object, operation_action, original_state, operation_object, operation_action, original_state,
update_state, operation_user, ip, update_state, operation_user, ip,
comment, create_time) comment, create_time)
values (#{id,jdbcType=VARCHAR}, #{operationContent,jdbcType=VARCHAR}, #{moduleName,jdbcType=VARCHAR}, values (#{id,jdbcType=VARCHAR}, #{operationContent,jdbcType=VARCHAR}, #{moduleName,jdbcType=VARCHAR},
#{operationObject,jdbcType=VARCHAR}, #{operationAction,jdbcType=VARCHAR}, #{originalState,jdbcType=VARCHAR}, #{operationObject,jdbcType=VARCHAR}, #{operationAction,jdbcType=VARCHAR}, #{originalState,jdbcType=VARCHAR},
#{updateState,jdbcType=VARCHAR}, #{operationUser,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR}, #{updateState,jdbcType=VARCHAR}, #{operationUser,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR},
#{comment,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}) #{comment,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
</insert> </insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.OperationLogFileType"> <insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.OperationLogFileType">
<!-- <!--
...@@ -292,16 +292,16 @@ ...@@ -292,16 +292,16 @@
--> -->
update operation_log_file_type update operation_log_file_type
set id = #{record.id,jdbcType=VARCHAR}, set id = #{record.id,jdbcType=VARCHAR},
operation_content = #{record.operationContent,jdbcType=VARCHAR}, operation_content = #{record.operationContent,jdbcType=VARCHAR},
module_name = #{record.moduleName,jdbcType=VARCHAR}, module_name = #{record.moduleName,jdbcType=VARCHAR},
operation_object = #{record.operationObject,jdbcType=VARCHAR}, operation_object = #{record.operationObject,jdbcType=VARCHAR},
operation_action = #{record.operationAction,jdbcType=VARCHAR}, operation_action = #{record.operationAction,jdbcType=VARCHAR},
original_state = #{record.originalState,jdbcType=VARCHAR}, original_state = #{record.originalState,jdbcType=VARCHAR},
update_state = #{record.updateState,jdbcType=VARCHAR}, update_state = #{record.updateState,jdbcType=VARCHAR},
operation_user = #{record.operationUser,jdbcType=VARCHAR}, operation_user = #{record.operationUser,jdbcType=VARCHAR},
ip = #{record.ip,jdbcType=VARCHAR}, ip = #{record.ip,jdbcType=VARCHAR},
comment = #{record.comment,jdbcType=VARCHAR}, comment = #{record.comment,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP} create_time = #{record.createTime,jdbcType=TIMESTAMP}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
...@@ -353,15 +353,15 @@ ...@@ -353,15 +353,15 @@
--> -->
update operation_log_file_type update operation_log_file_type
set operation_content = #{operationContent,jdbcType=VARCHAR}, set operation_content = #{operationContent,jdbcType=VARCHAR},
module_name = #{moduleName,jdbcType=VARCHAR}, module_name = #{moduleName,jdbcType=VARCHAR},
operation_object = #{operationObject,jdbcType=VARCHAR}, operation_object = #{operationObject,jdbcType=VARCHAR},
operation_action = #{operationAction,jdbcType=VARCHAR}, operation_action = #{operationAction,jdbcType=VARCHAR},
original_state = #{originalState,jdbcType=VARCHAR}, original_state = #{originalState,jdbcType=VARCHAR},
update_state = #{updateState,jdbcType=VARCHAR}, update_state = #{updateState,jdbcType=VARCHAR},
operation_user = #{operationUser,jdbcType=VARCHAR}, operation_user = #{operationUser,jdbcType=VARCHAR},
ip = #{ip,jdbcType=VARCHAR}, ip = #{ip,jdbcType=VARCHAR},
comment = #{comment,jdbcType=VARCHAR}, comment = #{comment,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP} create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
<select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.entity.OperationLogFileTypeExample" resultMap="BaseResultMap"> <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.entity.OperationLogFileTypeExample" resultMap="BaseResultMap">
......
...@@ -194,6 +194,6 @@ ...@@ -194,6 +194,6 @@
"SystemTypeCannotDelete": "系统类型不能删除", "SystemTypeCannotDelete": "系统类型不能删除",
"OrganizationUsedTemplateGroup": "有机构在使用,不能删除", "OrganizationUsedTemplateGroup": "有机构在使用,不能删除",
"Industry": "行业:", "Industry": "行业:",
"SearchHintText": "搜索" "SearchHintText": "搜索",
"DescriptionWithOutColon": "Description"
} }
\ No newline at end of file
...@@ -408,6 +408,7 @@ ...@@ -408,6 +408,7 @@
"MappingInvoice": "关联管理", "MappingInvoice": "关联管理",
"MenuAMVAT": "资管增值税申报", "MenuAMVAT": "资管增值税申报",
"MenuCIT": "企业所得税申报", "MenuCIT": "企业所得税申报",
"MenuRecordManage": "档案管理",
"MenuAnalysis": "税务分析", "MenuAnalysis": "税务分析",
"MenuCashFlow": "税务现金流", "MenuCashFlow": "税务现金流",
"MenuDeferredTax": "递延所得税", "MenuDeferredTax": "递延所得税",
......
...@@ -1141,7 +1141,56 @@ ...@@ -1141,7 +1141,56 @@
"assetLabelNumber" : "资产标签号", "assetLabelNumber" : "资产标签号",
"compensationSaleAmount" : "赔偿/变卖金额", "compensationSaleAmount" : "赔偿/变卖金额",
"EAMDisposal" : "EAM资产处理金额", "EAMDisposal" : "EAM资产处理金额",
"MainBodyCode": "主体代码" "MainBodyCode": "主体代码",
"remark" : "摘要",
"creditPrepaidAccounts" : "贷:预付账款",
"debitAdvanceGene" : "借:预提费用-系统生成",
"ledgerId" : "账套",
"exchangeRate" : "汇率",
"reclassifyAmount" : "重分类金额",
"checkOne" : "校验",
"advanceWriteOff" : "预提/(预付)冲销",
"usableBalance" : "可用预付款余额",
"usableInvoiceAmount" : "可用预付款发票金额",
"paidInvoiceAmount" : "已付标准发票总金额",
"approvedStandardInvoiceAmount" : "已批准标准发票金额",
"unexecutedServiceSchedule" : "未执行服务金额",
"advance": "预提",
"coupaTotalAccept": "COUPA接收合计",
"executedServiceSchedule" : "已执行服务进度",
"orderAmount" : "订购金额",
"currency" : "币种",
"standardMoney": "本位币",
"item" : "ITEM",
"supplier" : "供应商",
"costCenter" : "成本中心",
"costCenterCode" : "成本中心CODE",
"poSubjectCode" : "PO主体CODE",
"purchasePerson" : "请购人",
"ladingBillPerson":"提单人",
"poRow":"PO行",
"poNo":"PO号",
"zczzrxx" : "资产责任人信息",
"xkrxx" : "汇款人信息",
"skgsxx" : "收款公司信息",
"occurPeriod": "发生期间",
"oaAssetBillType" : "相关OA资产单单据类型",
"oaAssetNumber" : "相关OA资产单单号",
"scrapReason" : "报废原因",
"assetNumber" : "资产编号",
"assetLabelNumber" : "资产标签号",
"compensationSaleAmount" : "赔偿/变卖金额",
"liableEmployeeNum" : "员工工号",
"liableEmployeeName" : "员工姓名",
"remitEmployeeNum" : "员工工号",
"remitEmployeeName" : "员工姓名",
"remitTime" : "汇款时间",
"remitAmount" : "汇款金额",
"gatheringCompanyName" : "收款公司名称",
"gatheringCompanyAccount":"收款公司账号"
} }
\ No newline at end of file
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
"DefaultTaxTypeAndReport": "默认纳税类型及报表:", "DefaultTaxTypeAndReport": "默认纳税类型及报表:",
"DeleteKeyValueConfiguration": "删除关键数据", "DeleteKeyValueConfiguration": "删除关键数据",
"Description": "描述:", "Description": "描述:",
"DescriptionWithOutColon": "描述",
"DirectionDifferent": "借贷方向不一致", "DirectionDifferent": "借贷方向不一致",
"EnterpriceAccountMapping": "自动对应", "EnterpriceAccountMapping": "自动对应",
"EtsSubjectNameCol": "对应企业科目", "EtsSubjectNameCol": "对应企业科目",
......
...@@ -642,7 +642,9 @@ debugger; ...@@ -642,7 +642,9 @@ debugger;
} }
var getInitTaskStatus = function(){ var getInitTaskStatus = function(){
debugger;
citReportService.getRunningJob(vatSessionService.project.id,0).then(function (result) { citReportService.getRunningJob(vatSessionService.project.id,0).then(function (result) {
debugger;
if(result.data && result.status == 200){ if(result.data && result.status == 200){
updateTasksStatus(result.data); updateTasksStatus(result.data);
if(result.data.jobStatus=='Begin'||result.data.jobStatus=='Running'){ if(result.data.jobStatus=='Begin'||result.data.jobStatus=='Running'){
......
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