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 {
* 报表类型
*/
public enum ReportType {
NORMAL_DECLARATION("NORMAL_DECLARATION", "增值税纳税申报表"),
CORR_DECLARATION("CORR_DECLARATION", "增值税更正申报表"),
NORMAL_TAX_RECEIPT("NORMAL_TAX_RECEIPT", "增值税纳税税票"),
CORR_TAX_RECEIPT("CORR_TAX_RECEIPT", "增值税更正税票");
NORMAL_DECLARATION("增值税纳税申报表", "增值税纳税申报表"),
CORR_DECLARATION("增值税更正申报表", "增值税更正申报表"),
NORMAL_TAX_RECEIPT("增值税纳税税票", "增值税纳税税票"),
CORR_TAX_RECEIPT("增值税更正税票", "增值税更正税票");
private String code;
private String name;
public static final Map<String, String> MAPPING = new HashMap<>();
......
......@@ -22,6 +22,7 @@ import static javax.servlet.http.HttpServletResponse.SC_NO_CONTENT;
import static javax.servlet.http.HttpServletResponse.SC_OK;
/**
* CIT数据预览功能模块Controller
* @author zhikai.z.wei
*/
@RestController
......@@ -31,12 +32,22 @@ public class CitDataPreviewController extends BaseController {
@Autowired
private CitDataPreviewServiceImpl citDataPreviewService;
/**
* 日记账合并版数据的获取
* @param citJournalAdjustDto
* @return
*/
@PostMapping("getJournalMergeData")
public PageInfo<CitJournalAdjustDto> getJournalMergeData(@RequestBody CitJournalAdjustDto citJournalAdjustDto) {
logger.debug(String.format("CIT日记账合并预览 Condition:%s", JSON.toJSONString(citJournalAdjustDto)));
return citDataPreviewService.getJournalMergeData(citJournalAdjustDto);
}
/**
* 日记账合并版导出
* @param paras
* @param response
*/
@RequestMapping(value = "exportJournalMergeData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void exportJournalMergeData(@RequestBody CitJournalAdjustDto paras, HttpServletResponse response) {
int count = citDataPreviewService.exportJournalMergeData2(paras, response);
......@@ -48,13 +59,22 @@ public class CitDataPreviewController extends BaseController {
}
/**
* 试算平衡表生成版的数据获取
* @param citTrialBalanceDto
* @return
*/
@PostMapping("getTbGeneVerData")
public PageInfo<CitTrialBalanceDto> getTbGeneVerData(@RequestBody CitTrialBalanceDto citTrialBalanceDto) {
logger.debug(String.format("CIT日记账合并预览 Condition:%s", JSON.toJSONString(citTrialBalanceDto)));
return citDataPreviewService.getTbGeneVerData(citTrialBalanceDto);
}
/**
* 试算平衡表生成版的导出
* @param paras
* @param response
*/
@RequestMapping(value = "exportTbGeneVerData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void exportTbGeneVerData(@RequestBody CitTrialBalanceDto paras, HttpServletResponse response) {
// response.setContentType("application/vnd.ms-excel;charset=utf-8");
......@@ -86,13 +106,23 @@ public class CitDataPreviewController extends BaseController {
}
}
/**
* 试算平衡表Mapping版的数据获取
* @param citTrialBalanceDto
* @return
*/
@PostMapping("getTbMappingVerData")
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);
}
/**
* 试算平衡表Mapping版的导出
* @param paras
* @param response
*/
@RequestMapping(value = "exportTbMappingVerData", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void exportTbMappingVerData(@RequestBody CitTrialBalanceDto paras, HttpServletResponse response) {
int count = citDataPreviewService.exportTbMappingVerData2(paras, response);
......
......@@ -17,7 +17,7 @@ import java.util.List;
import static pwc.taxtech.atms.constant.enums.EnumCitImportType.JournalAdjust;
/**
* @Description 资产相关Controller
* @Description CIT文件导入Controller
* @Author zhikai.z.wei
*/
@RestController
......@@ -28,14 +28,22 @@ public class CitImportExcelController {
@Autowired
private CitImportExcelServiceImpl citImportExcelService;
/**
* CIT文件导入
* @param file
* @param orgIds
* @param periodDate
* @param importType
* @param importFileType
* @return
*/
@RequestMapping(value = "/citImportExcel", method = RequestMethod.POST)
public @ResponseBody
OperationResultDto citImportExcel(@RequestParam MultipartFile file, @RequestParam(required = false) String orgIds,
@RequestParam String periodDate,
@RequestParam Integer importType,
@RequestParam Integer importFileType){
logger.info("CIT调整版日记账导入");
logger.info("CIT文件导入");
OperationResultDto opeResultDto = new OperationResultDto();
try{
if (file == null || file.getSize() <= 0) {
......
......@@ -4,7 +4,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import pwc.taxtech.atms.constant.CodeErrorConstant;
import pwc.taxtech.atms.constant.enums.EnumErrorCodeMsg;
import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.dto.ebsdto.*;
......@@ -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) {
apiResultDto.setCode(error.getCode());
apiResultDto.setMessage(error.getMsg());
}
}
......@@ -36,6 +36,20 @@ public class OperationLogFileTypeController {
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
......
......@@ -32,6 +32,21 @@ public class OperationLogTaxDocController {
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")
@ResponseBody
public boolean addTaxDocuments(OperationLogTaxDocument operationLogTaxDocument){
......
package pwc.taxtech.atms.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import net.sf.json.JSONNull;
import org.apache.commons.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.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
......@@ -16,8 +25,10 @@ import pwc.taxtech.atms.service.impl.TaxDocumentServiceImpl;
import pwc.taxtech.atms.thirdparty.ExcelUtil;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.OutputStream;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -71,6 +82,7 @@ public class TaxDocumentController {
return taxDocumentService.editFilesType(taxDocument);
}
@RequestMapping("exportExcel")
@ResponseBody
public void exportExcelFile(HttpServletResponse response, @RequestBody TaxDocumentDto taxDocumentDto) {
......@@ -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 {
map.put("ZXXJLLB", "cash_flow_final");
map.put("CITZCFZB", "cit_balance_sheet_prc_adjust");
map.put("CITLRB", "cit_profit_prc_adjust");
map.put("CIT_TBAM", "cit_tbam");
}
}
......@@ -15,7 +15,7 @@ public class TaxDocumentDto {
private String fileAttr;//档案属性
private Integer fileTypeId;//文件类型的id
private Long fileTypeId;//文件类型的id
private String fileType;//档案类型
......@@ -23,7 +23,7 @@ public class TaxDocumentDto {
private String businessLine;//业务线
private Integer companyId;//公司代码Id
private String companyId;//公司代码Id
private String companyName;//公司名称
......@@ -53,9 +53,7 @@ public class TaxDocumentDto {
private String physicalIndexNumber;//实物索引号
private Date ownBeginTime;//所属期间_开始
private Date ownEndTime;//所属期间_结束
private Integer ownTime;//所属期间
private Integer auditStatus;//审核状态
......@@ -63,6 +61,16 @@ public class TaxDocumentDto {
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() {
return ids;
}
......@@ -111,22 +119,6 @@ public class TaxDocumentDto {
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() {
return physicalIndexNumber;
}
......@@ -183,11 +175,11 @@ public class TaxDocumentDto {
this.fileAttr = fileAttr;
}
public Integer getFileTypeId() {
public Long getFileTypeId() {
return fileTypeId;
}
public void setFileTypeId(Integer fileTypeId) {
public void setFileTypeId(Long fileTypeId) {
this.fileTypeId = fileTypeId;
}
......@@ -215,14 +207,22 @@ public class TaxDocumentDto {
this.businessLine = businessLine;
}
public Integer getCompanyId() {
public String getCompanyId() {
return companyId;
}
public void setCompanyId(Integer companyId) {
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public Integer getOwnTime() {
return ownTime;
}
public void setOwnTime(Integer ownTime) {
this.ownTime = ownTime;
}
public String getCompanyName() {
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 {
* @param items
*/
void queryRemoteServerThenUpdateOrg(Long id, List<OrganizationQueryDto> items);
/**
* ebs最后调用更新状态
* @param ebsCallBackDto
*/
void changeCallBackStatus(EbsCallBackDto ebsCallBackDto);
}
......@@ -41,6 +41,7 @@ import java.util.List;
import java.util.Map;
/**
* CIT数据预览功能模块
* @author zhikai.z.wei
* @Date: 02/03/2019
* @Description:
......@@ -76,7 +77,7 @@ public class CitDataPreviewServiceImpl extends BaseService {
}
/**
* 日记账导出
* 日记账导出(第一种方式)
* @param citJournalAdjustDto
* @param os
* @return
......@@ -101,6 +102,12 @@ public class CitDataPreviewServiceImpl extends BaseService {
}
}
/**
* 日记账导出(第二种方式)
* @param citJournalAdjustDto
* @param response
* @return
*/
public int exportJournalMergeData2(CitJournalAdjustDto citJournalAdjustDto, HttpServletResponse response){
CitJournalEntryAdjust citJournalEntryAdjust = beanUtil.copyProperties(citJournalAdjustDto, new CitJournalEntryAdjust());
List<CitJournalEntryAdjust> journalMerges = citJournalMapper.getJournalMerge(citJournalEntryAdjust);
......@@ -117,6 +124,10 @@ public class CitDataPreviewServiceImpl extends BaseService {
return 1;
}
/**
* 日记账导出(第一种方式)所用到的获取Excel表头
* @return
*/
private Map<String, String> generalJMHeader() {
Map<String, String> header = new LinkedHashMap<>();
header.put("ApprovalStatus","审批状态");
......@@ -169,7 +180,7 @@ public class CitDataPreviewServiceImpl extends BaseService {
}
/**
* 试算平衡表生成版的导出
* 试算平衡表生成版的导出(第一种方式)
* @param citTrialBalanceDto
* @param os
* @return
......@@ -220,6 +231,10 @@ public class CitDataPreviewServiceImpl extends BaseService {
return 1;
}
/**
* 试算平衡表生成版的导出(第一种方式)所用到的生成Excel的表头
* @return
*/
private Map<String, String> generalTbGeneVerHeader() {
Map<String, String> header = new LinkedHashMap<>();
header.put("AccountCode","科目代码");
......@@ -255,7 +270,7 @@ public class CitDataPreviewServiceImpl extends BaseService {
}
/**
* 试算平衡表Mapping版的导出
* 试算平衡表Mapping版的导出(第一种方式)
* @param citTrialBalanceDto
* @param os
* @return
......
......@@ -64,6 +64,9 @@ public class CitImportExcelServiceImpl extends BaseService {
@Resource
private ProjectMapper projectMapper;
@Resource
private CitTbamMapper citTbamMapper;
/**
* 根据导入的文件类型进行方法分发
*
......@@ -284,11 +287,19 @@ public class CitImportExcelServiceImpl extends BaseService {
if (EnumTbImportType.CoverImport.getCode().equals(importType)) {
//覆盖导入要删除原有的该操作人在当前期间导入的数据,且更改之前导入的日志记录状态
msg = "覆盖导入成功";
CitJournalEntryAdjustExample example = new CitJournalEntryAdjustExample();
CitJournalEntryAdjustExample.Criteria criteria = example.createCriteria();
criteria.andCreatedByEqualTo(currentUserName);
criteria.andPeriodEqualTo(period);
citJournalEntryAdjustMapper.deleteByExample(example);
CitJournalEntryAdjustExample citJEAExample = new CitJournalEntryAdjustExample();
citJEAExample.createCriteria().andCreatedByEqualTo(currentUserName).andPeriodEqualTo(period).andOrganizationIdIn(orgList);
logger.info("删除符合条件的日记账");
citJournalEntryAdjustMapper.deleteByExample(citJEAExample);
//删除自动生成的试算平衡表相关数据
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());
}
int insertBatchNum = citJournalEntryAdjustMapper.insertBatch(journalAdjustList);
......@@ -299,7 +310,9 @@ public class CitImportExcelServiceImpl extends BaseService {
citDataImportLog.setErrorMsg(msg);
citDataImportLogList.add(citDataImportLog);
//导入日志录入到数据库
addDataImportLog(citDataImportLogList);
//根据日记账自动生成试算平衡表,即试算平衡表生成版
autoGeneTB(period, orgId, orgList);
saveResult.setResult(true);
saveResult.setResultMsg("导入成功");
......@@ -518,7 +531,8 @@ public class CitImportExcelServiceImpl extends BaseService {
continue;
}
DecimalFormat df=new DecimalFormat("0");
citDAMapping.setAcctCode(df.format(cellValue));
// String s = cellValue.toString();
citDAMapping.setAcctCode(cellValue.toString());
cellValue = CitCommonUtil.getValue(rowData.getCell(6));
if(cellValue == null){
......@@ -1203,7 +1217,7 @@ public class CitImportExcelServiceImpl extends BaseService {
}
/**
* 自动生成试算平衡表
* 自动生成试算平衡表和join出Mapping版的attribute mapping TB
* @param period
* @param orgList
* @return
......@@ -1215,14 +1229,17 @@ public class CitImportExcelServiceImpl extends BaseService {
StringBuilder periodSb = new StringBuilder();
periodSb.append(period);
periodSb.append("%");
//第二步,查出cit_journal_entry_adjust该期间的调整日记账,
List<CitJournalEntryAdjust> citJournalEntryAdjustList = citJournalEntryAdjustMapper.sumAmountByCondition(periodSb.toString(), orgList);
//第二步,查出cit_journal_entry_adjust该期间的调整日记账,
List<CitTrialBalance> trialBalanceList = new ArrayList<>();
//存放TB与Mapping结合的实体
List<CitTbam> citTbamList = new ArrayList<>();
String currentUserName = authUserHelper.getCurrentAuditor().get();
for (CitJournalEntryAdjust citJournal:citJournalEntryAdjustList) {
CitTrialBalance trialBalance = new CitTrialBalance();
trialBalance.setId(idService.nextId());
trialBalance.setPeriod(period);
trialBalance.setCreateBy(currentUserName);
trialBalance.setOrganizationId(orgId);
......@@ -1249,10 +1266,33 @@ public class CitImportExcelServiceImpl extends BaseService {
//计算出期末余额,期末余额为期初余额+借方发生额-贷方发生额
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);
}
int insertBatch = citTrialBalanceMapper.insertBatch(trialBalanceList);
int insertBatch1 = citTbamMapper.insertBatch(citTbamList);
autoGeneResult.setResult(true);
autoGeneResult.setResultMsg("自动生成TB成功");
return autoGeneResult;
......
......@@ -14,7 +14,6 @@ import pwc.taxtech.atms.entity.OperationLogFileType;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.UUID;
/**
* 查询
......@@ -54,10 +53,11 @@ public class FileTypesServiceImpl {
fileTypes.setCreateTime(new Date());
fileTypes.setCreator(authUserHelper.getCurrentAuditor().get());
fileTypes.setCreatorId(authUserHelper.getCurrentUserId());
int num = fileTypesMapper.insert(fileTypes);
if (num > 0) {
Long id = fileTypesMapper.insert(fileTypes);
if (id > 0) {
OperationLogFileType actionEntity = buildOperationLogFileType();
actionEntity.setOperationAction("新增");
actionEntity.setId(id.toString());
actionEntity.setUpdateState(fileTypes.toString());
boolean result = operationLogFileTypeService.addFileTypesList(actionEntity);
if (result) {
......@@ -81,6 +81,7 @@ public class FileTypesServiceImpl {
if (num > 0) {
OperationLogFileType actionEntity = buildOperationLogFileType();
actionEntity.setOperationAction("删除");
actionEntity.setId(id.toString());
boolean result = operationLogFileTypeService.addFileTypesList(actionEntity);
if (result) {
return true;
......@@ -106,8 +107,8 @@ public class FileTypesServiceImpl {
if (num > 0) {
OperationLogFileType actionEntity = buildOperationLogFileType();
actionEntity.setOperationAction("更新");
actionEntity.setId(fileTypes.getId().toString());
//设置更新值
actionEntity.setOriginalState(fileTypesMapper.selectByPrimaryKey(fileTypes.getId()).toString());
actionEntity.setUpdateState(fileTypes.toString());
boolean result = operationLogFileTypeService.addFileTypesList(actionEntity);
if (result) {
......@@ -131,7 +132,6 @@ public class FileTypesServiceImpl {
*/
private OperationLogFileType buildOperationLogFileType() {
OperationLogFileType actionEntity = new OperationLogFileType();
actionEntity.setId("FileType:"+UUID.randomUUID().toString());
actionEntity.setOperationContent("系统管理");
actionEntity.setModuleName("档案管理");
actionEntity.setOperationObject("税务档案类型设置");
......
......@@ -47,4 +47,11 @@ public class OperationLogFileTypeServiceImpl {
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 {
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;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.AuthUserHelper;
import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.message.ErrorMessage;
import pwc.taxtech.atms.constant.enums.FileUploadEnum;
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.UserMapper;
import pwc.taxtech.atms.dto.didiFileUpload.DidiFileIUploadParam;
import pwc.taxtech.atms.dto.didiFileUpload.DidiFileUploadDetailResult;
import pwc.taxtech.atms.dto.reportFileUpload.ReportFileUploadParam;
import pwc.taxtech.atms.dto.reportFileUpload.ReportFileUploadResult;
import pwc.taxtech.atms.entity.Project;
import pwc.taxtech.atms.entity.User;
import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.vat.dao.ReportFileUploadMapper;
import pwc.taxtech.atms.vat.entity.FileUpload;
......@@ -43,10 +46,17 @@ public class ReportFileUploadService extends BaseService {
@Resource
private ProjectMapper projectMapper;
@Resource
private OrganizationMapper organizationMapper;
@Resource
private FileTypesMapper fileTypesMapper;
@Autowired
DidiFileUploadService didiFileUploadService;
@Autowired
TaxDocumentServiceImpl taxDocumentService;
public List<ReportFileUploadResult> queryData(ReportFileUploadParam param) {
ReportFileUploadExample example = new ReportFileUploadExample();
example.createCriteria().andProjectIdEqualTo(param.getProjectId()).andPeriodEqualTo(param.getPeriod());
......@@ -93,6 +103,7 @@ public class ReportFileUploadService extends BaseService {
return resultList;
}
@Transactional
public void saveData(MultipartFile file, ReportFileUpload data) {
if (!ReportFileUploadEnum.ReportType.MAPPING.containsKey(data.getReportType())) {
throw new ServiceException(ErrorMessage.ParamError);
......@@ -103,15 +114,47 @@ public class ReportFileUploadService extends BaseService {
String uid = authUserHelper.getCurrentUserId();
User user = userMapper.selectByPrimaryKey(uid);
data.setCreator(user.getUserName());
data.setUid(CommonUtils.getUUID());
data.setCreateTime(new Date());
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());
FileUpload fileUpload = didiFileUploadService.uploadFile(file, file.getOriginalFilename(), FileUploadEnum.BizSource.REPORT_UPLOAD.name());
data.setFileUploadId(fileUpload.getUid());
data.setUid(CommonUtils.getUUID());
data.setCreateTime(new Date());
data.setReportFileName(file.getOriginalFilename());
int updateRow = reportFileUploadMapper.updateByExample(data, example);
if (updateRow == 0) {
reportFileUploadMapper.insert(data);
......
......@@ -10,6 +10,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.AuthUserHelper;
import pwc.taxtech.atms.constant.enums.FileUploadEnum;
import pwc.taxtech.atms.constant.enums.ReportFileUploadEnum;
import pwc.taxtech.atms.dao.TaxDocumentMapper;
import pwc.taxtech.atms.dto.TaxDocumentDto;
import pwc.taxtech.atms.dto.didiFileUpload.DidiFileIUploadParam;
......@@ -18,6 +19,7 @@ import pwc.taxtech.atms.entity.OperationLogTaxDocument;
import pwc.taxtech.atms.entity.TaxDocument;
import pwc.taxtech.atms.entity.TaxDocumentExample;
import pwc.taxtech.atms.vat.entity.FileUpload;
import pwc.taxtech.atms.vat.entity.ReportFileUpload;
import javax.annotation.Resource;
import java.util.*;
......@@ -39,6 +41,8 @@ public class TaxDocumentServiceImpl {
@Autowired
private OperationLogTaxDocServiceImpl operationLogTaxDocService;
@Autowired
ReportFileUploadService reportFileUploadService;
@Autowired
DidiFileUploadService didiFileUploadService;
......@@ -81,17 +85,21 @@ public class TaxDocumentServiceImpl {
if (StringUtils.isNotBlank(taxDocumentDto.getFileType())) {
criteria.andFileTypeEqualTo(taxDocumentDto.getFileType());
}
//文件生效日期 fileTime
if (null != taxDocumentDto.getFileBeginTime() && null != taxDocumentDto.getFileEndTTime()) {
criteria.andFileTimeBetween(taxDocumentDto.getFileBeginTime(), taxDocumentDto.getFileEndTTime());
//文件生效起始日期 fileBeginTime
if (null != taxDocumentDto.getFileBeginTime()) {
criteria.andFileTimeGreaterThanOrEqualTo(taxDocumentDto.getFileBeginTime());
}
//文件生效到期日期 fileEndTTime
if (null != taxDocumentDto.getFileEndTTime()) {
criteria.andFileTimeLessThanOrEqualTo(taxDocumentDto.getFileEndTTime());
}
//所属时间 ownTime
if (null != taxDocumentDto.getOwnBeginTime() && null != taxDocumentDto.getOwnEndTime()) {
criteria.andOwnTimeBetween(taxDocumentDto.getOwnBeginTime(), taxDocumentDto.getOwnEndTime());
if (null != taxDocumentDto.getOwnTime()) {
criteria.andOwnTimeEqualTo(taxDocumentDto.getOwnTime());
}
//档案名称 fileName
if (StringUtils.isNotBlank(taxDocumentDto.getFileName())) {
criteria.andFileNameLike("%"+taxDocumentDto.getFileName()+"%");
criteria.andFileNameLike("%" + taxDocumentDto.getFileName() + "%");
}
//业务线 businessLine
if (StringUtils.isNotBlank(taxDocumentDto.getBusinessLine())) {
......@@ -101,9 +109,13 @@ public class TaxDocumentServiceImpl {
if (StringUtils.isNotBlank(taxDocumentDto.getCompanyName())) {
criteria.andCompanyNameEqualTo(taxDocumentDto.getCompanyName());
}
//到期日 effectiveTime
if (null != taxDocumentDto.getEffectiveBeginTime() && null != taxDocumentDto.getEffectiveEndTime()) {
criteria.andEffectiveTimeBetween(taxDocumentDto.getEffectiveBeginTime(), taxDocumentDto.getEffectiveEndTime());
//到期起始日 effectiveBeginTime
if (null != taxDocumentDto.getEffectiveBeginTime()) {
criteria.andEffectiveTimeGreaterThanOrEqualTo(taxDocumentDto.getEffectiveBeginTime());
}
//到期结束日 effectiveEndTime
if (null != taxDocumentDto.getEffectiveEndTime()) {
criteria.andEffectiveTimeLessThanOrEqualTo(taxDocumentDto.getEffectiveEndTime());
}
//税种 taxType
if (StringUtils.isNotBlank(taxDocumentDto.getTaxType())) {
......@@ -125,9 +137,13 @@ public class TaxDocumentServiceImpl {
if (null != taxDocumentDto.getAuditStatus()) {
criteria.andAuditStatusEqualTo(taxDocumentDto.getAuditStatus());
}
//上传日期 uploadTime
if (null != taxDocumentDto.getUploadBeginTime() && null != taxDocumentDto.getUploadEndTime()) {
criteria.andUploadTimeBetween(taxDocumentDto.getUploadBeginTime(), taxDocumentDto.getUploadEndTime());
//上传开始日期 uploadBeginTime
if (null != taxDocumentDto.getUploadBeginTime()) {
criteria.andUploadTimeGreaterThanOrEqualTo(taxDocumentDto.getUploadBeginTime());
}
//上传结束日期 uploadEndTime
if (null != taxDocumentDto.getUploadEndTime()) {
criteria.andUploadTimeLessThanOrEqualTo(taxDocumentDto.getUploadEndTime());
}
//创建人 creator
if (StringUtils.isNotBlank(taxDocumentDto.getCreator())) {
......@@ -140,18 +156,32 @@ public class TaxDocumentServiceImpl {
public synchronized boolean addTaxDocumentList(MultipartFile file, TaxDocument taxDocument) {
try {
//上传文件
if(StringUtils.isBlank(taxDocument.getFileUploadId())){
FileUpload fileUpload = didiFileUploadService.uploadFile(file,file.getOriginalFilename(), FileUploadEnum.BizSource.RECORD_UPLOAD.name());
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.setUpdateTime(new Date());
taxDocument.setCreator(authUserHelper.getCurrentAuditor().get());
taxDocument.setCreatorId(authUserHelper.getCurrentUserId());
taxDocument.setUploadTime(new Date());
taxDocument.setYearRedundancy(Calendar.getInstance().get(Calendar.YEAR));
int num = taxDocumentMapper.insert(taxDocument);
if (num > 0) {
Long id = taxDocumentMapper.insert(taxDocument);
if (id > 0) {
OperationLogTaxDocument actionEntity = buildOperationLogTaxDocument();
actionEntity.setId(id.toString());
actionEntity.setOperationAction("新增");
actionEntity.setUpdateState(taxDocument.toString());
boolean result = operationLogTaxDocService.addTaxDocumentList(actionEntity);
......@@ -177,6 +207,7 @@ public class TaxDocumentServiceImpl {
if (num > 0) {
OperationLogTaxDocument actionEntity = buildOperationLogTaxDocument();
actionEntity.setOperationAction("删除");
actionEntity.setId(id.toString());
boolean result = operationLogTaxDocService.addTaxDocumentList(actionEntity);
if (result) {
return true;
......@@ -205,7 +236,20 @@ public class TaxDocumentServiceImpl {
return false;
}
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;
} catch (Exception e) {
......@@ -246,7 +290,6 @@ public class TaxDocumentServiceImpl {
*/
private OperationLogTaxDocument buildOperationLogTaxDocument() {
OperationLogTaxDocument actionEntity = new OperationLogTaxDocument();
actionEntity.setId("TaxDocument:" + UUID.randomUUID().toString());
actionEntity.setOperationContent("主页");
actionEntity.setModuleName("档案管理");
actionEntity.setOperationObject("税务档案");
......
......@@ -361,6 +361,9 @@ public class TemplateGroupServiceImpl extends AbstractService {
Row row = temp.getRow(j);
for(int k = row.getFirstCellNum(); k < row.getLastCellNum(); k++){
Cell cell = row.getCell(k);
if (cell == null) {
continue;//todo cell == null 如何处理
}
cell.setCellType(CellType.STRING);
if(!cell.getCellStyle().getLocked() && "${KeyIn}".equalsIgnoreCase(cell.getStringCellValue())){
cell.setCellValue("");
......
......@@ -131,7 +131,6 @@ public class FormulaAgent {
public PeriodCellData getCellData(String templateId, String cellId, int periodId, String projectId) {
PeriodReport report = getReportByTemplate(templateId, periodId, projectId);
MyAsserts.assertNotNull(report, Exceptions.BB_REPORT_NULL);
PeriodCellData cellData = getCellDataListByTemplate(cellId, report.getId());
MyAsserts.assertNotNull(cellData, Exceptions.BB_CELL_DATA_NULL);
return cellData;
......@@ -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) {
String sql = "";
String[] split = filterValue.split(" ");
String para3 = null;
/*
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 (tableName.substring(0, 3).equals("cit")) {
try {
return _buildSql(getField, tableName, filter, filterValue, period, formulaContext, year, true);
} catch (Exception e) {
e.printStackTrace();
}
if (split[0].indexOf("<=") != -1) {
filterValue = "< " + split[1] + "and" + filter + " =" + split[1];
}
if ("CITZCFZB".equals(tableName) || ("CITLRB".equals(tableName))) {
try {
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 = "";
if (formulaContext.getPeriod() - period < 10) {
_p = year + "'0" + (formulaContext.getPeriod() - period) + "'";
} else {
_p = year + (formulaContext.getPeriod() - period);
}
public static String _buildSql(String getField, String tableName, String filter, String filterValue, Integer period, FormulaContext formulaContext, String year, boolean bool) throws Exception {
String sql = "select sum(" + getField + ") as " + getField + " from " + tableName + " where 1=1 and " + filter + filterValue;
String _p = insertZero(formulaContext.getPeriod() - Math.abs(period));
String _period = insertZero(formulaContext.getPeriod());
String per = insertZero((formulaContext.getPeriod() - 1));
if (!bool) {
if (period == 0) {
sql += " and tms-period = " + formulaContext.getPeriod();
sql += " and tms_period = " + Integer.parseInt(year + _period);
} else if (period == -99) {
sql += "and tms-period between '" + year + "01' and " + (formulaContext.getPeriod() - 1);
sql += " and tms_period between " + Integer.parseInt(year + "01") + " and " + Integer.parseInt(year + per);
} else if (period == 99) {
sql += "and tms-period between '" + year + "01' and " + (formulaContext.getPeriod());
sql += " and tms_period between " + Integer.parseInt(year + "01") + " and " + Integer.parseInt(year + _period);
} else {
sql += "and tms-period between " + _p + "and " + (formulaContext.getPeriod() - 1);
if (period > 0)
throw new Exception("参数不正确");
sql += " and tms_period between " + Integer.parseInt(year + _p) + " and " + Integer.parseInt(year + per);
}
if (bool) {
sql += " and period = '" + year + period + "'";
}
if (bool)
sql += " and period = " + year;
return sql;
}
public static String insertZero(Integer itr) {
String str = null;
if (itr < 10) {
str = "0" + itr;
} else {
str = "" + itr;
}
return str;
}
@Autowired
JdbcTemplate jdbcTemplate;
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) {
List<Map<String, Object>> stringObjectMap = jdbcTemplate.queryForList(buildSql(TableRule.map.get(tableName), getField, filter, filterValue, period, year, formulaContext));
Long rev = 0L;
for (int i = 0, j = stringObjectMap.size(); i < j; i++) {
public BigDecimal getTableDataByName(String tableName, String getField, String filter, String filterValue, Integer period, String year, FormulaContext formulaContext) {
Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(buildSql(TableRule.map.get(tableName), getField, filter, filterValue, period, year, formulaContext));
/* for (int i = 0, j = stringObjectMap.size(); i < j; i++) {
if (i == 1) {
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 {
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 {
FreeRefFunction[] functionImpls = {new SGSR(formulaContext), new FSJZ(formulaContext), new ND(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 JFFS(formulaContext), new WPSR(formulaContext),new WPNAME(formulaContext),new WPTYPE(formulaContext), new SUM2(formulaContext),
new SUM(formulaContext), new RSUMIF(formulaContext), new TABLESUMIF(formulaContext)};
new JFFS(formulaContext), new WPSR(formulaContext), new WPNAME(formulaContext), new WPTYPE(formulaContext), new SUM2(formulaContext),
new RSUMIF(formulaContext), new TABLESUMIF(formulaContext), new SUM(formulaContext)};
UDFFinder udfs = new DefaultUDFFinder(functions, functionImpls);
UDFFinder udfToolpack = new AggregatingUDFFinder(udfs);
workbook.addToolPack(udfToolpack);
......
......@@ -60,7 +60,7 @@ public class ReportServiceImpl extends BaseService {
private final static Logger logger = LoggerFactory.getLogger(ReportServiceImpl.class);
private BlockingQueue<PeriodJob> queue = new LinkedBlockingQueue<>();
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
private ReportGeneratorImpl reportGenerator;
......@@ -507,12 +507,9 @@ public class ReportServiceImpl extends BaseService {
@Override
public void run() {
try {
updateConfig(projectId, periodParam, isMergeManualData, templates, genJob);
//进行数据校验
DataValidation(periodParam, projectId,genJob );
updateConfig(projectId, periodParam, isMergeManualData, templates, genJob);
PeriodResources resources = reportGenerator.getPeriodResources(projectId, periodParam,
templates.stream().map(Template::getId).collect(Collectors.toList()));
......
......@@ -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.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.TableRule;
import pwc.taxtech.atms.exception.Exceptions;
import java.util.HashMap;
import java.util.Map;
import static pwc.taxtech.atms.common.util.FormulaUtil.resolverInteger;
import static pwc.taxtech.atms.common.util.FormulaUtil.resolverString;
......@@ -32,7 +28,7 @@ public class TABLESUMIF extends FunctionBase implements FreeRefFunction {
//进行参数验证
public void parameterCheck(ValueEval[] args, OperationEvaluationContext ec) {
argsLength = args.length;
if (argsLength != 6) //参数小于当做异常处理, 最后俩参数可以取默认值
if (argsLength != 6) //参数小于6当做异常处理, 最后俩参数可以取默认值
throw Exceptions.parameterError;
try {
tableName = resolverString(args, ec, 0);
......@@ -46,7 +42,6 @@ public class TABLESUMIF extends FunctionBase implements FreeRefFunction {
}
Integer argsLength;
String getField;
Integer period;
String year;
......@@ -61,12 +56,10 @@ public class TABLESUMIF extends FunctionBase implements FreeRefFunction {
String filterValue =resolverString(args, ec, 3);
period = resolverInteger(args, ec, 4);//会计期间
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) {
e.printStackTrace();
return new NumberEval(0.00);
}
return new NumberEval(0.00);
}
}
......@@ -62,5 +62,28 @@
<artifactId>fastjson</artifactId>
<version>1.2.40</version>
</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>
</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 {
*
* @mbg.generated
*/
int insert(FileTypes record);
Long insert(FileTypes record);
/**
* This method was generated by MyBatis Generator.
......
......@@ -41,7 +41,7 @@ public interface TaxDocumentMapper extends MyMapper {
*
* @mbg.generated
*/
int insert(TaxDocument record);
Long insert(TaxDocument record);
/**
* This method was generated by MyBatis Generator.
......
This diff is collapsed.
......@@ -443,22 +443,16 @@ public class FileTypes implements Serializable {
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", fileAttr=").append(fileAttr);
sb.append(", fileTypeId=").append(fileTypeId);
sb.append(", fileType=").append(fileType);
sb.append(", description=").append(description);
sb.append(", creatorId=").append(creatorId);
sb.append(", requiredField=").append(requiredField);
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("]");
sb.append("序号=").append(id);
sb.append(", 档案属性=").append(fileAttr);
sb.append(", 档案类型=").append(fileType);
sb.append(", 说明=").append(description);
sb.append(", 必填字段=").append(requiredField);
sb.append(", 创建人=").append(creator);
sb.append(", 创建时间=").append(null==createTime?null:createTime.toLocaleString());
sb.append(", 更新时间=").append(null==updateTime?null:updateTime.toLocaleString());
sb.append(", 状态=").append("T".equals(status)?"启用":"未启用");
sb.append(", 说明=").append(remarks);
return sb.toString();
}
......
......@@ -42,7 +42,7 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
private Integer fileTypeId;
private Long fileTypeId;
/**
* Database Column Remarks:
......@@ -86,7 +86,7 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
private Integer companyId;
private String companyId;
/**
* Database Column Remarks:
......@@ -141,7 +141,7 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
private Date ownTime;
private Integer ownTime;
/**
*
......@@ -344,11 +344,11 @@ public class TaxDocument implements Serializable {
this.auditStatus = auditStatus;
}
public Date getOwnTime() {
public Integer getOwnTime() {
return ownTime;
}
public void setOwnTime(Date ownTime) {
public void setOwnTime(Integer ownTime) {
this.ownTime = ownTime;
}
......@@ -424,7 +424,7 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
public Integer getFileTypeId() {
public Long getFileTypeId() {
return fileTypeId;
}
......@@ -436,7 +436,7 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
public void setFileTypeId(Integer fileTypeId) {
public void setFileTypeId(Long fileTypeId) {
this.fileTypeId = fileTypeId;
}
......@@ -520,7 +520,7 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
public Integer getCompanyId() {
public String getCompanyId() {
return companyId;
}
......@@ -532,7 +532,7 @@ public class TaxDocument implements Serializable {
*
* @mbg.generated
*/
public void setCompanyId(Integer companyId) {
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
......@@ -904,34 +904,27 @@ public class TaxDocument implements Serializable {
*/
@Override
public String toString() {
return "TaxDocument{" +
"id=" + id +
", fileAttr='" + fileAttr + '\'' +
", fileTypeId=" + fileTypeId +
", fileType='" + fileType + '\'' +
", fileName='" + fileName + '\'' +
", businessLine='" + businessLine + '\'' +
", companyId=" + companyId +
", companyName='" + companyName + '\'' +
", taxType='" + taxType + '\'' +
", fileTime=" + fileTime +
", effectiveTime=" + effectiveTime +
", ownTime=" + ownTime +
", creatorId='" + creatorId + '\'' +
", creator='" + creator + '\'' +
", createTime=" + createTime +
", updateTime=" + updateTime +
", uploadTime=" + uploadTime +
", storageArea='" + storageArea + '\'' +
", keeperId='" + keeperId + '\'' +
", keeper='" + keeper + '\'' +
", physicalIndexNumber='" + physicalIndexNumber + '\'' +
", remark='" + remark + '\'' +
", fileOriginalName='" + fileOriginalName + '\'' +
", filePositionUrl='" + filePositionUrl + '\'' +
", yearRedundancy=" + yearRedundancy +
", auditStatus=" + auditStatus +
", enable='" + enable + '\'' +
'}';
StringBuilder sb = new StringBuilder();
sb.append("序号=").append(id);
sb.append("档案属性=").append(fileAttr);
sb.append("档案类型=").append(fileType);
sb.append("文件名称=").append(fileName);
sb.append("业务线=").append(businessLine);
sb.append("公司名称=").append(companyName);
sb.append("税种=").append(taxType);
sb.append("文件生效日期=").append(fileTime==null?null:fileTime.toLocaleString());
sb.append("到期日=").append(effectiveTime==null?null:effectiveTime.toLocaleString() );
sb.append("所属期间=").append(ownTime );
sb.append("创建人=").append(creator );
sb.append("创建时间=").append(createTime==null?null:createTime.toLocaleString());
sb.append("更新时间=").append(updateTime==null?null:updateTime.toLocaleString());
sb.append("上传时间=").append(uploadTime==null?null:uploadTime.toLocaleString());
sb.append("实物存放地点=").append(storageArea );
sb.append("保管人=").append(keeper );
sb.append("实物索引号=").append(physicalIndexNumber );
sb.append("备注=").append(remark );
sb.append("审批状态=").append(null==auditStatus?null:auditStatus==0?"未审核":auditStatus==1?"审核通过":"审核不通过");
sb.append("是否可用=").append("T".equals(enable)?"启用":"未启用");
return sb.toString();
}
}
\ No newline at end of file
......@@ -745,6 +745,11 @@ public class TaxDocumentExample {
return (Criteria) this;
}
public Criteria andOwnTimeEqualTo(Integer value) {
addCriterion("own_time =", value, "ownTime");
return (Criteria) this;
}
public Criteria andAuditStatusEqualTo(Integer value) {
addCriterion("audit_status =", value, "auditStatus");
return (Criteria) this;
......@@ -860,11 +865,6 @@ public class TaxDocumentExample {
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) {
addCriterion("file_time not between", value1, value2, "fileTime");
return (Criteria) this;
......
......@@ -133,7 +133,22 @@
<select id ="selectByCondition" parameterType="pwc.taxtech.atms.entity.CitEAMAssetsDisposal" resultType="pwc.taxtech.atms.entity.CitEAMAssetsDisposal">
select
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
WHERE
<include refid="QueryCondition"/>
......
......@@ -209,7 +209,37 @@
advance advance,
approved_standard_invoice_amount approvedStandardInvoiceAmount,
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
WHERE
<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
......@@ -139,7 +139,7 @@
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="pwc.taxtech.atms.entity.FileTypes">
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
......
......@@ -101,7 +101,7 @@
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
id, operation_action, original_state, update_state, operation_user, ip, comment, create_time
from operation_log_file_type
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
......
......@@ -101,7 +101,7 @@
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
id, operation_action, original_state, update_state, operation_user, ip, comment, create_time
from operation_log_tax_document
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
......
......@@ -8,11 +8,11 @@
-->
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="file_attr" jdbcType="VARCHAR" property="fileAttr"/>
<result column="file_type_id" jdbcType="INTEGER" property="fileTypeId"/>
<result column="file_type_id" jdbcType="BIGINT" property="fileTypeId"/>
<result column="file_type" jdbcType="VARCHAR" property="fileType"/>
<result column="file_name" jdbcType="VARCHAR" property="fileName"/>
<result column="business_line" jdbcType="VARCHAR" property="businessLine"/>
<result column="company_id" jdbcType="INTEGER" property="companyId"/>
<result column="company_id" jdbcType="VARCHAR" property="companyId"/>
<result column="company_name" jdbcType="VARCHAR" property="companyName"/>
<result column="tax_type" jdbcType="VARCHAR" property="taxType"/>
<result column="file_time" jdbcType="TIMESTAMP" property="fileTime"/>
......@@ -32,7 +32,7 @@
<result column="year_redundancy" jdbcType="INTEGER" property="yearRedundancy"/>
<result column="audit_status" jdbcType="INTEGER" property="auditStatus"/>
<result column="physical_index_number" jdbcType="VARCHAR" property="physicalIndexNumber"/>
<result column="own_time" jdbcType="TIMESTAMP" property="ownTime"/>
<result column="own_time" jdbcType="INTEGER" property="ownTime"/>
<result column="enable" jdbcType="VARCHAR" property="enable"/>
</resultMap>
<sql id="Example_Where_Clause">
......@@ -160,7 +160,7 @@
<include refid="Example_Where_Clause"/>
</if>
</delete>
<insert id="insert" parameterType="pwc.taxtech.atms.entity.TaxDocument">
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
......@@ -173,16 +173,16 @@
upload_time, storage_area, keeper_id,
keeper, remark, file_original_name, file_upload_id, file_position_url,
year_redundancy,audit_status,physical_index_number,own_time)
values (#{id,jdbcType=BIGINT}, #{fileAttr,jdbcType=VARCHAR}, #{fileTypeId,jdbcType=INTEGER},
values (#{id,jdbcType=BIGINT}, #{fileAttr,jdbcType=VARCHAR}, #{fileTypeId,jdbcType=BIGINT},
#{fileType,jdbcType=VARCHAR}, #{fileName,jdbcType=VARCHAR}, #{businessLine,jdbcType=VARCHAR},
#{companyId,jdbcType=INTEGER}, #{companyName,jdbcType=VARCHAR}, #{taxType,jdbcType=VARCHAR},
#{companyId,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR}, #{taxType,jdbcType=VARCHAR},
#{fileTime,jdbcType=TIMESTAMP}, #{effectiveTime,jdbcType=TIMESTAMP}, #{creatorId,jdbcType=INTEGER},
#{creator,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{uploadTime,jdbcType=TIMESTAMP}, #{storageArea,jdbcType=VARCHAR}, #{keeperId,jdbcType=INTEGER},
#{keeper,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{fileOriginalName,jdbcType=VARCHAR},
#{fileUploadId,jdbcType=VARCHAR}, #{filePositionUrl,jdbcType=VARCHAR},
#{yearRedundancy,jdbcType=INTEGER},#{auditStatus,jdbcType=INTEGER},#{physicalIndexNumber,jdbcType=VARCHAR},
#{ownTime,jdbcType=TIMESTAMP})
#{ownTime,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.TaxDocument">
<!--
......@@ -277,8 +277,8 @@
<if test="businessLine != null">
#{businessLine,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
#{companyId,jdbcType=INTEGER},
<if test="companyId != null and companyId != ''">
#{companyId,jdbcType=VARCHAR},
</if>
<if test="companyName != null">
#{companyName,jdbcType=VARCHAR},
......@@ -351,7 +351,7 @@
file_attr = #{record.fileAttr,jdbcType=VARCHAR},
</if>
<if test="record.fileTypeId != null">
file_type_id = #{record.fileTypeId,jdbcType=INTEGER},
file_type_id = #{record.fileTypeId,jdbcType=BIGINT},
</if>
<if test="record.fileType != null">
file_type = #{record.fileType,jdbcType=VARCHAR},
......@@ -363,7 +363,7 @@
business_line = #{record.businessLine,jdbcType=VARCHAR},
</if>
<if test="record.companyId != null">
company_id = #{record.companyId,jdbcType=INTEGER},
company_id = #{record.companyId,jdbcType=VARCHAR},
</if>
<if test="record.companyName != null">
company_name = #{record.companyName,jdbcType=VARCHAR},
......@@ -423,11 +423,11 @@
update tax_document
set id = #{record.id,jdbcType=BIGINT},
file_attr = #{record.fileAttr,jdbcType=VARCHAR},
file_type_id = #{record.fileTypeId,jdbcType=INTEGER},
file_type_id = #{record.fileTypeId,jdbcType=BIGINT},
file_type = #{record.fileType,jdbcType=VARCHAR},
file_name = #{record.fileName,jdbcType=VARCHAR},
business_line = #{record.businessLine,jdbcType=VARCHAR},
company_id = #{record.companyId,jdbcType=INTEGER},
company_id = #{record.companyId,jdbcType=VARCHAR},
company_name = #{record.companyName,jdbcType=VARCHAR},
tax_type = #{record.taxType,jdbcType=VARCHAR},
file_time = #{record.fileTime,jdbcType=TIMESTAMP},
......@@ -445,7 +445,7 @@
year_redundancy = #{record.yearRedundancy,jdbcType=INTEGER},
audit_status = #{record.auditStatus,jdbcType=INTEGER},
physical_index_number = #{record.physicalIndexNumber,jdbcType=VARCHAR},
own_time = #{record.ownTime,jdbcType=TIMESTAMP}
own_time = #{record.ownTime,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
......@@ -461,7 +461,7 @@
file_attr = #{fileAttr,jdbcType=VARCHAR},
</if>
<if test="fileTypeId != null">
file_type_id = #{fileTypeId,jdbcType=INTEGER},
file_type_id = #{fileTypeId,jdbcType=BIGINT},
</if>
<if test="fileType != null">
file_type = #{fileType,jdbcType=VARCHAR},
......@@ -473,7 +473,7 @@
business_line = #{businessLine,jdbcType=VARCHAR},
</if>
<if test="companyId != null">
company_id = #{companyId,jdbcType=INTEGER},
company_id = #{companyId,jdbcType=VARCHAR},
</if>
<if test="companyName != null">
company_name = #{companyName,jdbcType=VARCHAR},
......@@ -534,7 +534,7 @@
file_attr = #{fileAttr,jdbcType=VARCHAR},
</if>
<if test="null != fileTypeId">
file_type_id = #{fileTypeId,jdbcType=INTEGER},
file_type_id = #{fileTypeId,jdbcType=BIGINT},
</if>
<if test="null != fileType and '' != fileType">
file_type = #{fileType,jdbcType=VARCHAR},
......@@ -545,8 +545,8 @@
<if test="null != businessLine and '' != businessLine">
business_line = #{businessLine,jdbcType=VARCHAR},
</if>
<if test="null != companyId">
company_id = #{companyId,jdbcType=INTEGER},
<if test="null != companyId and '' != companyId">
company_id = #{companyId,jdbcType=VARCHAR},
</if>
<if test="null != companyName and '' != companyName">
company_name = #{companyName,jdbcType=VARCHAR},
......@@ -597,7 +597,7 @@
physical_index_number = #{physicalIndexNumber,jdbcType=VARCHAR},
</if>
<if test="null != ownTime">
own_time = #{ownTime,jdbcType=TIMESTAMP},
own_time = #{ownTime,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
......
......@@ -194,6 +194,6 @@
"SystemTypeCannotDelete": "系统类型不能删除",
"OrganizationUsedTemplateGroup": "有机构在使用,不能删除",
"Industry": "行业:",
"SearchHintText": "搜索"
"SearchHintText": "搜索",
"DescriptionWithOutColon": "Description"
}
\ No newline at end of file
......@@ -408,6 +408,7 @@
"MappingInvoice": "关联管理",
"MenuAMVAT": "资管增值税申报",
"MenuCIT": "企业所得税申报",
"MenuRecordManage": "档案管理",
"MenuAnalysis": "税务分析",
"MenuCashFlow": "税务现金流",
"MenuDeferredTax": "递延所得税",
......
......@@ -1141,7 +1141,56 @@
"assetLabelNumber" : "资产标签号",
"compensationSaleAmount" : "赔偿/变卖金额",
"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 @@
"DefaultTaxTypeAndReport": "默认纳税类型及报表:",
"DeleteKeyValueConfiguration": "删除关键数据",
"Description": "描述:",
"DescriptionWithOutColon": "描述",
"DirectionDifferent": "借贷方向不一致",
"EnterpriceAccountMapping": "自动对应",
"EtsSubjectNameCol": "对应企业科目",
......
......@@ -642,7 +642,9 @@ debugger;
}
var getInitTaskStatus = function(){
debugger;
citReportService.getRunningJob(vatSessionService.project.id,0).then(function (result) {
debugger;
if(result.data && result.status == 200){
updateTasksStatus(result.data);
if(result.data.jobStatus=='Begin'||result.data.jobStatus=='Running'){
......
......@@ -32,7 +32,7 @@
</div>
<div class="nav-element-left">
<a ui-sref="taxDocumentManage">
<span class="nav-icon-color">档案管理</span>
<span class="nav-icon-color">{{'MenuRecordManage' | translate}}</span>
</a>
</div>
<div class="nav-element-left">
......
......@@ -14,6 +14,7 @@ frameworkModule.directive('appUsrOperateLog', ['$log',
thisTitle:"@", //自定义title
thisParams:"=", //自定义参数
thisCaption:"=", //自定义表头字段
thisModuleId:"=", //根据ID来获取指定的日志信息
},
controller: 'appUsrOperateLogController',
link: function ($scope, $element, $attr) {
......
......@@ -10,7 +10,7 @@ function ($q, apiConfig, jqFetch,apiInterceptor) {
return jqFetch.get(apiInterceptor.webApiHostUrl + '/operLogFileTypes/selectList', params);
},
docManageListLog: function (params) {
return jqFetch.get(apiInterceptor.webApiHostUrl + '/operLogTaxDoc/selectList', params);
return jqFetch.get(apiInterceptor.webApiHostUrl + '/operLogTaxDoc/selectListForLog', params);
}
};
}]);
\ No newline at end of file
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