Commit 5e2fe986 authored by kevin's avatar kevin

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

parents c81f690f e75c9f24
package pwc.taxtech.atms.common.schedule;
import com.alibaba.fastjson.JSONObject;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.quartz.QuartzJobBean;
import pwc.taxtech.atms.common.util.HttpUtil;
import pwc.taxtech.atms.dao.OrganizationMapper;
import pwc.taxtech.atms.dao.RegionMapper;
import pwc.taxtech.atms.dto.organization.DDSyncOrgInfo;
import pwc.taxtech.atms.dto.organization.OrgSyncData;
import pwc.taxtech.atms.entity.Organization;
import pwc.taxtech.atms.entity.OrganizationExample;
import pwc.taxtech.atms.entity.Region;
import pwc.taxtech.atms.entity.RegionExample;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class OrgSyncJob extends QuartzJobBean {
private static final Logger logger = LoggerFactory.getLogger(OrgSyncJob.class);
@Resource
private OrganizationMapper organizationMapper;
@Resource
private RegionMapper regionMapper;
@Autowired
private OrganizationMapper orgMapper;
@Value("${org_sync_url}")
private String orgSyncUrl;
@Value("${org_sync_token}")
private String token;
@Override
protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
JobDataMap dataMap = jobExecutionContext.getJobDetail().getJobDataMap();
Map<String, String> headers = new HashMap<>();
headers.put("token", token);
headers.put("Content-Type", "application/x-www-form-urlencoded");
try {
// todo 这里要加分页查询的参数
String response = HttpUtil.get(orgSyncUrl, headers);
DDSyncOrgInfo ddSyncOrgInfo = JSONObject.parseObject(response, DDSyncOrgInfo.class);
List<OrgSyncData> orgSyncDatas = ddSyncOrgInfo.getData();
orgSyncDatas.forEach(osd -> {
OrganizationExample example = new OrganizationExample();
example.createCriteria().andNameEqualTo(osd.getNameCN());
Organization o = new Organization();
o.setClientCode(osd.getCode());
o.setCode(osd.getCode());
o.setEnterpriseAccountCode(String.valueOf(osd.getSobId()));
o.setEnterpriseAccountName(osd.getSobName());
o.setCurrencyCode(osd.getCurrencyCode());
o.setLegalEntity(osd.getLegalEntity());
o.setLegalPersonName(osd.getLegalRepresentative());
o.setAddress(osd.getAddress());
o.setCreateTime(osd.getGmtCreate());
o.setUpdateTime(osd.getGmtModified());
o.setPsCode(osd.getPsCode());
RegionExample regionExample = new RegionExample();
regionExample.createCriteria().andShortNameEqualTo(osd.getCompanyLocation());
List<Region> regions = regionMapper.selectByExample(regionExample);
if (regions.size() > 0) {
o.setRegionId(regions.get(0).getId());
}
organizationMapper.updateByExampleSelective(o, example);
});
} catch (Exception e) {
logger.error(String.format("机构信息同步异常:[%s]", e.getMessage()), e);
}
}
}
......@@ -76,12 +76,12 @@ public class HttpUtil {
return postForm(url, params, null, connTimeout, readTimeout);
}
public static String get(String url) throws Exception {
return get(url, charset, null, null);
public static String get(String url, Map<String, String> headers) throws Exception {
return get(url, headers, charset, null, null);
}
public static String get(String url, String charset) throws Exception {
return get(url, charset, connTimeout, readTimeout);
public static String get(String url, Map<String, String> headers, String charset) throws Exception {
return get(url, headers, charset, connTimeout, readTimeout);
}
/**
......@@ -216,7 +216,7 @@ public class HttpUtil {
* @throws SocketTimeoutException 响应超时
* @throws Exception
*/
public static String get(String url, String charset, Integer connTimeout,Integer readTimeout)
public static String get(String url,Map<String,String> headers, String charset, Integer connTimeout,Integer readTimeout)
throws ConnectTimeoutException,SocketTimeoutException, Exception {
HttpClient client = null;
......@@ -231,6 +231,9 @@ public class HttpUtil {
if (readTimeout != null) {
customReqConf.setSocketTimeout(readTimeout);
}
headers.forEach((k,v)->{
get.setHeader(k,v);
});
get.setConfig(customReqConf.build());
HttpResponse res = null;
......
package pwc.taxtech.atms.constant;
import java.io.File;
import java.util.UUID;
public final class CodeErrorConstant {
public static final int SUCCESS = 0;
public static final int APIERROR = -1;
public static final int APIDATAEMPTY = -2;
}
\ No newline at end of file
package pwc.taxtech.atms.constant;
public final class MsgErrorConstant {
public static final int SUCCESS = 0;
public static final int APIERROR = -1;
public static final int APIDATAEMPTY = -2;
}
\ No newline at end of file
package pwc.taxtech.atms.constant.enums;
public enum EnumErrorCodeMsg {
SUCCESS(0, "成功"),
APIERROR(-1, "接口异常"),
APIDATAEMPTY(-2, "接口输入数据为空");
private Integer code;
private String msg;
EnumErrorCodeMsg(Integer code, String msg) {
this.code = code;
this.msg = msg;
}
public Integer getCode() {
return code;
}
public String getMsg() {
return msg;
}
public static EnumErrorCodeMsg fromCode(Integer code){
for(EnumErrorCodeMsg error: EnumErrorCodeMsg.values()){
if(error.getCode().intValue()==code.intValue())return error;
}
// 超出范围值默认返回异常
return EnumErrorCodeMsg.APIERROR;
}
public static String getMsg(Integer code){
for(EnumErrorCodeMsg error: EnumErrorCodeMsg.values()){
if(error.getCode().intValue()==code.intValue())return error.msg;
}
// 超出范围值默认返回异常
return EnumErrorCodeMsg.APIERROR.msg;
}
}
......@@ -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<>();
......
......@@ -33,7 +33,7 @@ public class DataPreviewController extends BaseController {
@PostMapping("getPLDataForDisplay")
public PageInfo<ProfitLossStatementDto> getPLDataForDisplay(@RequestBody ProfitLossStatementParam param) {
logger.debug(String.format("利润表查询 Condition:%s", JSON.toJSONString(param)));
logger.debug(String.format("利润表PRC查询 Condition:%s", JSON.toJSONString(param)));
return dataPreviewSerivceImpl.getPLDataForDisplay(param);
}
......@@ -51,7 +51,7 @@ public class DataPreviewController extends BaseController {
@PostMapping("getBSDataForDisplay")
public PageInfo<BalanceSheetDto> getBSDataForDisplay(@RequestBody BalanceSheetParam param) {
logger.debug(String.format("资产负债表查询 Condition:%s", JSON.toJSONString(param)));
logger.debug(String.format("资产负债表PRC查询 Condition:%s", JSON.toJSONString(param)));
return dataPreviewSerivceImpl.getBSDataForDisplay(param);
}
......
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.*;
......@@ -17,7 +26,10 @@ import pwc.taxtech.atms.thirdparty.ExcelUtil;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -71,6 +83,7 @@ public class TaxDocumentController {
return taxDocumentService.editFilesType(taxDocument);
}
@RequestMapping("exportExcel")
@ResponseBody
public void exportExcelFile(HttpServletResponse response, @RequestBody TaxDocumentDto taxDocumentDto) {
......@@ -147,4 +160,142 @@ public class TaxDocumentController {
}
/**
* 读取Excel转换成 Json
* @param path 文件的路径
*/
@PostMapping("/previewExcelToJson")
@ResponseBody
public String previewExcel(String path) {
try {
JSONArray dataArray = new JSONArray();
XSSFWorkbook xssfWorkbook = new XSSFWorkbook(new FileInputStream(path));
// 循环工作表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 (IOException 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;
}
}
......@@ -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;//审核状态
......@@ -111,22 +109,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;
}
......@@ -215,14 +197,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;
}
......
......@@ -162,6 +162,25 @@ public class BalanceSheetPrcQueryDto {
*/
private BigDecimal begBal;
/**
* Database Column Remarks:
* 同步用于标记不同分页的数据,避免重复删除
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cash_flow.task_id
*
* @mbg.generated
*/
private String taskId;
public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public String getSource() {
return source;
}
......
......@@ -161,6 +161,25 @@ public class BalanceSheetQueryDto {
*/
private BigDecimal begBal;
/**
* Database Column Remarks:
* 同步用于标记不同分页的数据,避免重复删除
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cash_flow.task_id
*
* @mbg.generated
*/
private String taskId;
public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public String getSource() {
return source;
}
......
......@@ -173,6 +173,25 @@ public class CashFlowQueryDto {
*/
private BigDecimal ytdAmt;
/**
* Database Column Remarks:
* 同步用于标记不同分页的数据,避免重复删除
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cash_flow.task_id
*
* @mbg.generated
*/
private String taskId;
public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public Date getDate() {
return date;
}
......
......@@ -716,6 +716,25 @@ public class JournalEntryQueryDto {
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm",timezone = "GMT+8")
private Date lateUpdatedDate;
/**
* Database Column Remarks:
* 同步用于标记不同分页的数据,避免重复删除
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cash_flow.task_id
*
* @mbg.generated
*/
private String taskId;
public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public Date getDate() {
return date;
}
......
......@@ -73,6 +73,19 @@ public class OrganizationAccountingRateQueryDto {
*/
private String invalidDate;
/**
* 同步用于标记不同分页的数据,避免重复删除
*/
private String taskId;
public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public Date getDate() {
return date;
}
......
......@@ -161,6 +161,25 @@ public class ProfitLossStatementPrcQueryDto {
*/
private BigDecimal ytdAmt;
/**
* Database Column Remarks:
* 同步用于标记不同分页的数据,避免重复删除
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cash_flow.task_id
*
* @mbg.generated
*/
private String taskId;
public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public String getSource() {
return source;
}
......
......@@ -161,6 +161,25 @@ public class ProfitLossStatementQueryDto {
*/
private BigDecimal ytdAmt;
/**
* Database Column Remarks:
* 同步用于标记不同分页的数据,避免重复删除
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cash_flow.task_id
*
* @mbg.generated
*/
private String taskId;
public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public String getSource() {
return source;
}
......
......@@ -546,6 +546,25 @@ public class TrialBalanceQueryDto {
*/
private BigDecimal ytdCrBeq;
/**
* Database Column Remarks:
* 同步用于标记不同分页的数据,避免重复删除
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cash_flow.task_id
*
* @mbg.generated
*/
private String taskId;
public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public Date getDate() {
return date;
}
......
package pwc.taxtech.atms.dto.organization;
import java.util.List;
/**
* @Auther: Gary J Li
* @Date: 12/03/2019 11:23
* @Description:
*/
public class DDSyncOrgInfo {
private List<OrgSyncData> data;
private int currentPage;
private int pageSize;
private int totalPage;
private int totalCount;
public void setData(List<OrgSyncData> data) {
this.data = data;
}
public List<OrgSyncData> getData() {
return data;
}
public void setCurrentPage(int currentPage) {
this.currentPage = currentPage;
}
public int getCurrentPage() {
return currentPage;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getPageSize() {
return pageSize;
}
public void setTotalPage(int totalPage) {
this.totalPage = totalPage;
}
public int getTotalPage() {
return totalPage;
}
public void setTotalCount(int totalCount) {
this.totalCount = totalCount;
}
public int getTotalCount() {
return totalCount;
}
}
package pwc.taxtech.atms.dto.organization;
import java.util.Date;
/**
* @Auther: Gary J Li
* @Date: 12/03/2019 11:26
* @Description:
*/
public class OrgSyncData {
private String id;
private String code;
private String commonValueId;
private String nameCN;
private int orgId;
private String orgName;
private int sobId;
private String sobName;
private String currencyCode;
private String legalEntity;
private String legalRepresentative;
private String address;
private String registrationFromDate;
private Date gmtCreate;
private Date gmtModified;
private String psCode;
private String companyLocation;
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setCode(String code) {
this.code = code;
}
public String getCode() {
return code;
}
public void setCommonValueId(String commonValueId) {
this.commonValueId = commonValueId;
}
public String getCommonValueId() {
return commonValueId;
}
public void setNameCN(String nameCN) {
this.nameCN = nameCN;
}
public String getNameCN() {
return nameCN;
}
public void setOrgId(int orgId) {
this.orgId = orgId;
}
public int getOrgId() {
return orgId;
}
public void setOrgName(String orgName) {
this.orgName = orgName;
}
public String getOrgName() {
return orgName;
}
public void setSobId(int sobId) {
this.sobId = sobId;
}
public int getSobId() {
return sobId;
}
public void setSobName(String sobName) {
this.sobName = sobName;
}
public String getSobName() {
return sobName;
}
public void setCurrencyCode(String currencyCode) {
this.currencyCode = currencyCode;
}
public String getCurrencyCode() {
return currencyCode;
}
public void setLegalEntity(String legalEntity) {
this.legalEntity = legalEntity;
}
public String getLegalEntity() {
return legalEntity;
}
public void setLegalRepresentative(String legalRepresentative) {
this.legalRepresentative = legalRepresentative;
}
public String getLegalRepresentative() {
return legalRepresentative;
}
public void setAddress(String address) {
this.address = address;
}
public String getAddress() {
return address;
}
public void setRegistrationFromDate(String registrationFromDate) {
this.registrationFromDate = registrationFromDate;
}
public String getRegistrationFromDate() {
return registrationFromDate;
}
public void setGmtCreate(Date gmtCreate) {
this.gmtCreate = gmtCreate;
}
public Date getGmtCreate() {
return gmtCreate;
}
public void setGmtModified(Date gmtModified) {
this.gmtModified = gmtModified;
}
public Date getGmtModified() {
return gmtModified;
}
public void setPsCode(String psCode) {
this.psCode = psCode;
}
public String getPsCode() {
return psCode;
}
public void setCompanyLocation(String companyLocation) {
this.companyLocation = companyLocation;
}
public String getCompanyLocation() {
return companyLocation;
}
}
......@@ -58,15 +58,13 @@ public class DataImportService extends BaseService {
@Resource
private DataValidateLogMapper dataValidateLogMapper;
@Resource
private ProfitLossStatementMapper profitLossStatementMapper;
private BalanceSheetPrcManualMapper balanceSheetPrcManualMapper;
@Resource
private BalanceSheetManualMapper balanceSheetManualMapper;
private ProfitLossStatementPrcManualMapper profitLossStatementPrcManualMapper;
@Resource
private ProfitLossStatementManualMapper profitLossStatementManualMapper;
private BalanceSheetPrcFinalMapper balanceSheetPrcFinalMapper;
@Resource
private BalanceSheetFinalMapper balanceSheetFinalMapper;
@Resource
private ProfitLossStatementFinalMapper profitLossStatementFinalMapper;
private ProfitLossStatementPrcFinalMapper profitLossStatementPrcFinalMapper;
@Resource
private RedLetterInfoTableMapper redLetterInfoTableMapper;
@Resource
......@@ -328,15 +326,15 @@ public class DataImportService extends BaseService {
// 1、写入最终表
// 2、记录数据导入记录与数据处理校验记录
if (EnumTbImportType.CoverImport.getCode().equals(importType)) {
ProfitLossStatementExample profitLossStatementExample = new ProfitLossStatementExample();
profitLossStatementExample.createCriteria().andOrganizationIdEqualTo(orgId).andPeriodEqualTo(period);
profitLossStatementManualMapper.deleteByExample(profitLossStatementExample);
if (profitLossStatementFinalMapper.countByExample(profitLossStatementExample) > 0) {
profitLossStatementFinalMapper.deleteByExample(profitLossStatementExample);
ProfitLossStatementPrcExample delExample = new ProfitLossStatementPrcExample();
delExample.createCriteria().andOrganizationIdEqualTo(orgId).andPeriodEqualTo(period);
profitLossStatementPrcManualMapper.deleteByExample(delExample);
if (profitLossStatementPrcFinalMapper.countByExample(delExample) > 0) {
profitLossStatementPrcFinalMapper.deleteByExample(delExample);
}
}
profitLossStatementManualMapper.insertBatch(pls);
profitLossStatementFinalMapper.insertBatch(pls);
profitLossStatementPrcManualMapper.insertBatch(pls);
profitLossStatementPrcFinalMapper.insertBatch(pls);
dataImportLog.setRecordSize(pls.size());
dataImportLog.setImportResult(true);
dataImportLogs.add(dataImportLog);
......@@ -492,15 +490,15 @@ public class DataImportService extends BaseService {
// 2、记录数据导入记录与数据处理校验记录
if (EnumTbImportType.CoverImport.getCode().equals(importType)) {
// 根据orgId period删除记录
BalanceSheetExample balanceSheetExample = new BalanceSheetExample();
balanceSheetExample.createCriteria().andOrganizationIdEqualTo(orgId).andPeriodEqualTo(period);
balanceSheetManualMapper.deleteByExample(balanceSheetExample);
if (balanceSheetFinalMapper.countByExample(balanceSheetExample) > 0) {
balanceSheetFinalMapper.deleteByExample(balanceSheetExample);
BalanceSheetPrcExample delExample = new BalanceSheetPrcExample();
delExample.createCriteria().andOrganizationIdEqualTo(orgId).andPeriodEqualTo(period);
balanceSheetPrcManualMapper.deleteByExample(delExample);
if (balanceSheetPrcFinalMapper.countByExample(delExample) > 0) {
balanceSheetPrcFinalMapper.deleteByExample(delExample);
}
}
balanceSheetManualMapper.insertBatch(bls);
balanceSheetFinalMapper.insertBatch(bls);
balanceSheetPrcManualMapper.insertBatch(bls);
balanceSheetPrcFinalMapper.insertBatch(bls);
dataImportLog.setRecordSize(bls.size());
dataImportLog.setImportResult(true);
dataImportLogs.add(dataImportLog);
......
......@@ -40,13 +40,13 @@ public class DataPreviewSerivceImpl extends BaseService {
private TrialBalanceMapper trialBalanceMapper;
@Resource
private ProfitLossStatementMapper profitLossStatementMapper;
private ProfitLossStatementPrcMapper profitLossStatementPrcMapper;
@Resource
private JournalEntryMapper journalEntryMapper;
@Resource
private BalanceSheetMapper balanceSheetMapper;
private BalanceSheetPrcMapper balanceSheetPrcMapper;
@Resource
private CashFlowMapper cashFlowMapper;
......@@ -98,7 +98,7 @@ public class DataPreviewSerivceImpl extends BaseService {
ProfitLossStatementCondition condition = beanUtil.copyProperties(param, new ProfitLossStatementCondition());
Page page = PageHelper.startPage(condition.getPageInfo().getPageIndex(), condition.getPageInfo().getPageSize());
List<ProfitLossStatement> profitLossStatements = profitLossStatementMapper.selectByCondition(condition);
List<ProfitLossStatement> profitLossStatements = profitLossStatementPrcMapper.selectByCondition(condition);
List<ProfitLossStatementDto> profitLossDtos = Lists.newArrayList();
profitLossStatements.forEach(pl -> {
......@@ -196,7 +196,7 @@ public class DataPreviewSerivceImpl extends BaseService {
BalanceSheetCondition condition = beanUtil.copyProperties(param, new BalanceSheetCondition());
Page page = PageHelper.startPage(condition.getPageInfo().getPageIndex(), condition.getPageInfo().getPageSize());
List<BalanceSheet> balanceSheets = balanceSheetMapper.selectByCondition(condition);
List<BalanceSheet> balanceSheets = balanceSheetPrcMapper.selectByCondition(condition);
List<BalanceSheetDto> balanceSheetDtos = Lists.newArrayList();
balanceSheets.forEach(bs -> {
......@@ -343,7 +343,7 @@ public class DataPreviewSerivceImpl extends BaseService {
ProfitLossStatementCondition condition = new ProfitLossStatementCondition();
beanUtil.copyProperties(param, condition);
List<ProfitLossStatement> profitLossStatements = profitLossStatementMapper.selectByCondition(condition);
List<ProfitLossStatement> profitLossStatements = profitLossStatementPrcMapper.selectByCondition(condition);
Map<String, String> header = generalPLHeader();
List<ProfitLossStatementExportDto> cellList = new ArrayList<>();
profitLossStatements.forEach(pl -> {
......@@ -384,8 +384,7 @@ public class DataPreviewSerivceImpl extends BaseService {
try {
BalanceSheetCondition condition = new BalanceSheetCondition();
beanUtil.copyProperties(param, condition);
List<BalanceSheet> balanceSheets = balanceSheetMapper.selectByCondition(condition);
List<BalanceSheet> balanceSheets = balanceSheetPrcMapper.selectByCondition(condition);
Map<String, String> header = generalBSHeader();
List<BalanceSheetExportDto> cellList = new ArrayList<>();
balanceSheets.forEach(bs -> {
......
......@@ -2,6 +2,7 @@ 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.web.multipart.MultipartFile;
......@@ -17,6 +18,8 @@ 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.ProjectExample;
import pwc.taxtech.atms.entity.TaxDocument;
import pwc.taxtech.atms.entity.User;
import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.vat.dao.ReportFileUploadMapper;
......@@ -47,6 +50,8 @@ public class ReportFileUploadService extends BaseService {
@Autowired
DidiFileUploadService didiFileUploadService;
@Autowired
TaxDocumentServiceImpl taxDocumentService;
public List<ReportFileUploadResult> queryData(ReportFileUploadParam param) {
ReportFileUploadExample example = new ReportFileUploadExample();
example.createCriteria().andProjectIdEqualTo(param.getProjectId()).andPeriodEqualTo(param.getPeriod());
......@@ -103,12 +108,31 @@ public class ReportFileUploadService extends BaseService {
String uid = authUserHelper.getCurrentUserId();
User user = userMapper.selectByPrimaryKey(uid);
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());
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();
projectExample.createCriteria().andOrganizationIdEqualTo(data.getOrgId()).andYearEqualTo(data.getPeriod()/100);
List<Project> projects = projectMapper.selectByExample(projectExample);
if(CollectionUtils.isNotEmpty(projects)){
data.setProjectId(projects.get(0).getId());
TaxDocument taxDocument = new TaxDocument();
taxDocument.setCompanyId(projects.get(0).getOrganizationId());
taxDocument.setFileUploadId(data.getFileUploadId());
taxDocument.setEnable("T");
taxDocument.setOwnTime(data.getPeriod());
taxDocument.setFileType(data.getReportType());
taxDocumentService.addTaxDocumentList(file,taxDocument);
}
}else {
Project project = projectMapper.selectByPrimaryKey(data.getProjectId());
data.setOrgId(project.getOrganizationId());
}
data.setUid(CommonUtils.getUUID());
data.setCreateTime(new Date());
data.setReportFileName(file.getOriginalFilename());
......
......@@ -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;
......@@ -86,8 +90,8 @@ public class TaxDocumentServiceImpl {
criteria.andFileTimeBetween(taxDocumentDto.getFileBeginTime(), 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())) {
......@@ -140,9 +144,20 @@ public class TaxDocumentServiceImpl {
public synchronized boolean addTaxDocumentList(MultipartFile file, TaxDocument taxDocument) {
try {
//上传文件
FileUpload fileUpload = didiFileUploadService.uploadFile(file,file.getOriginalFilename(), FileUploadEnum.BizSource.RECORD_UPLOAD.name());
taxDocument.setFileUploadId(fileUpload.getUid());
taxDocument.setFilePositionUrl(fileUpload.getViewHttpUrl());
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());
reportFileUpload.setPeriod(taxDocument.getOwnTime());
reportFileUpload.setFileUploadId(fileUpload.getUid());
reportFileUpload.setReportType(taxDocument.getFileType());
reportFileUploadService.saveData(file,reportFileUpload);
}
}
//设置创建人 创建时间信息 设置年份区分
taxDocument.setCreateTime(new Date());
taxDocument.setCreator(authUserHelper.getCurrentAuditor().get());
......
......@@ -35,11 +35,13 @@
<property name="triggers">
<list>
<ref bean="lgApiJobTrigger"/>
<ref bean="orgSyncJobTrigger"/>
</list>
</property>
<property name="jobDetails">
<list>
<ref bean="lgGlBalanceJob"/>
<ref bean="orgSyncJob"/>
</list>
</property>
<property name="taskExecutor" ref="executor"/>
......@@ -59,5 +61,18 @@
<property name="cronExpression" value="0 0 1 3 * ?"/>
</bean>
<bean name="orgSyncJob" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass" value="pwc.taxtech.atms.common.schedule.OrgSyncJob"/>
<property name="durability" value="true"/>
<property name="requestsRecovery" value="false"/>
<property name="description" value="机构信息同步"/>
</bean>
<!-- 每月1日执行一次-->
<bean id="orgSyncJobTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="orgSyncJob"/>
<property name="cronExpression" value="0 0 0 1 * ?"/>
</bean>
<!-- 分布式事务配置 end -->
</beans>
\ No newline at end of file
......@@ -18,6 +18,7 @@
<intercept-url pattern="/api/v1/cache/getallcache" access="permitAll" />
<intercept-url pattern="/api/v1/user/login" access="permitAll" />
<intercept-url pattern="/api/v1/approval/**" access="permitAll" />
<intercept-url pattern="/ebs/api/v1/dd/**" access="permitAll" />
<intercept-url pattern="/api/**" access="authenticated" />
<intercept-url pattern="/**" access="permitAll" />
<headers>
......
......@@ -53,3 +53,6 @@ get_user_info_url=${get_user_info_url}
app_id=${app_id}
app_key=${app_key}
cookie.maxAgeSeconds=${cookie.maxAgeSeconds}
api_white_list=${api_white_list}
org_sync_url=${org_sync_url}
org_sync_token=${org_sync_token}
\ No newline at end of file
......@@ -51,3 +51,6 @@ get_user_info_url=http://mis-test.diditaxi.com.cn/auth/sso/api/
app_id=2500
app_key=983258e7fd04d7fa0534735f7b1c33f3
cookie.maxAgeSeconds=86400
api_white_list=/ebs/api/v1/dd;
org_sync_url=http://10.96.238.10/erp-main-data-test-v2/api/companies
org_sync_token=174af08f
......@@ -53,4 +53,7 @@ check_ticket=true
get_user_info_url=http://mis.diditaxi.com.cn/auth/sso/api/
app_id=2500
app_key=983258e7fd04d7fa0534735f7b1c33f3
cookie.maxAgeSeconds=18000
\ No newline at end of file
cookie.maxAgeSeconds=18000
api_white_list=/ebs/api/v1/dd;
org_sync_url=http://10.96.238.10/erp-main-data-test-v2/api/companies
org_sync_token=174af08f
\ No newline at end of file
This diff is collapsed.
......@@ -17,6 +17,8 @@ import pwc.taxtech.atms.common.message.LogMessage;
import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.constant.enums.NationalEconomicIndustryEnum;
import pwc.taxtech.atms.dao.*;
import pwc.taxtech.atms.dto.organization.DDSyncOrgInfo;
import pwc.taxtech.atms.dto.organization.OrgSyncData;
import pwc.taxtech.atms.entity.*;
import javax.annotation.Resource;
......@@ -397,12 +399,43 @@ public class DataInitTest extends CommonIT {
@Test
public void syncOrg(){
List<String> taxPayNums= organizationMapper.selectByExample(new OrganizationExample()).stream().map(Organization::getTaxPayerNumber).collect(Collectors.toList());
/**
* 1、taxPayNums http 滴滴oa接口同步机构的信息
* 2、逐条update,记录更新失败或未更新上的taxPayNum
* 3、失败的再次处理
*/
String input = "";
try {
File targetFile = new File("src/main/resources/orgImport/ddOrgJson.json");
input = FileUtils.readFileToString(targetFile, "UTF-8");
} catch (Exception e) {
e.printStackTrace();
}
DDSyncOrgInfo ddSyncOrgInfo = JSONObject.parseObject(input,DDSyncOrgInfo.class);
List<OrgSyncData> orgSyncDatas = ddSyncOrgInfo.getData();
orgSyncDatas.forEach(osd -> {
OrganizationExample example = new OrganizationExample();
example.createCriteria().andNameEqualTo(osd.getNameCN());
Organization o = new Organization();
o.setClientCode(osd.getCode());
o.setCode(osd.getCode());
o.setEnterpriseAccountCode(String.valueOf(osd.getSobId()));
o.setEnterpriseAccountName(osd.getSobName());
o.setCurrencyCode(osd.getCurrencyCode());
o.setLegalEntity(osd.getLegalEntity());
o.setLegalPersonName(osd.getLegalRepresentative());
o.setAddress(osd.getAddress());
o.setCreateTime(osd.getGmtCreate());
o.setUpdateTime(osd.getGmtModified());
o.setPsCode(osd.getPsCode());
RegionExample regionExample = new RegionExample();
regionExample.createCriteria().andShortNameEqualTo(osd.getCompanyLocation());
List<Region> regions = regionMapper.selectByExample(regionExample);
if (regions.size() > 0) {
o.setRegionId(regions.get(0).getId());
}
organizationMapper.updateByExampleSelective(o, example);
});
}
private void setProperty(Object obj, String propertyName, Object value) {
......
......@@ -41,17 +41,49 @@
<property name="rootInterface" value="pwc.taxtech.atms.MyVatMapper" />
</javaClientGenerator>
<!-- <table tableName="trial_balance_final" domainObjectName="TrialBalanceFinal">
<!--
<table tableName="profit_loss_statement_prc" domainObjectName="ProfitLossStatementPrc">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>-->
</table>
<table tableName="profit_loss_statement_prc_manual" domainObjectName="ProfitLossStatementPrcManual">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
<table tableName="profit_loss_statement_prc_final" domainObjectName="ProfitLossStatementPrcFinal">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
<table tableName="balance_sheet_prc" domainObjectName="BalanceSheetPrc">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
<table tableName="balance_sheet_prc_manual" domainObjectName="BalanceSheetPrcManual">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
<table tableName="balance_sheet_prc_final" domainObjectName="BalanceSheetPrcFinal">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
<table tableName="trial_balance_final" domainObjectName="TrialBalanceFinal">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
<table tableName="report_file_upload" domainObjectName="ReportFileUpload">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
<!--<table tableName="certified_invoices_list" domainObjectName="CertifiedInvoicesList">
<table tableName="certified_invoices_list" domainObjectName="CertifiedInvoicesList">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
......
......@@ -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.OrganizationAccountingRate;
import pwc.taxtech.atms.entity.OrganizationAccountingRateExample;
@Mapper
public interface OrganizationAccountingRateMapper extends MyMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
*
* @mbg.generated
*/
long countByExample(OrganizationAccountingRateExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
*
* @mbg.generated
*/
int deleteByExample(OrganizationAccountingRateExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
*
* @mbg.generated
*/
int insert(OrganizationAccountingRate record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
*
* @mbg.generated
*/
int insertSelective(OrganizationAccountingRate record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
*
* @mbg.generated
*/
List<OrganizationAccountingRate> selectByExampleWithRowbounds(OrganizationAccountingRateExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
*
* @mbg.generated
*/
List<OrganizationAccountingRate> selectByExample(OrganizationAccountingRateExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
*
* @mbg.generated
*/
OrganizationAccountingRate selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") OrganizationAccountingRate record, @Param("example") OrganizationAccountingRateExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
*
* @mbg.generated
*/
int updateByExample(@Param("record") OrganizationAccountingRate record, @Param("example") OrganizationAccountingRateExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(OrganizationAccountingRate record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
*
* @mbg.generated
*/
int updateByPrimaryKey(OrganizationAccountingRate record);
package pwc.taxtech.atms.dao;
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.OrganizationAccountingRate;
import pwc.taxtech.atms.entity.OrganizationAccountingRateExample;
import java.util.List;
@Mapper
public interface OrganizationAccountingRateMapper extends MyMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
*
* @mbg.generated
*/
long countByExample(OrganizationAccountingRateExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
*
* @mbg.generated
*/
int deleteByExample(OrganizationAccountingRateExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
*
* @mbg.generated
*/
int insert(OrganizationAccountingRate record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
*
* @mbg.generated
*/
int insertSelective(OrganizationAccountingRate record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
*
* @mbg.generated
*/
List<OrganizationAccountingRate> selectByExampleWithRowbounds(OrganizationAccountingRateExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
*
* @mbg.generated
*/
List<OrganizationAccountingRate> selectByExample(OrganizationAccountingRateExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
*
* @mbg.generated
*/
OrganizationAccountingRate selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") OrganizationAccountingRate record, @Param("example") OrganizationAccountingRateExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
*
* @mbg.generated
*/
int updateByExample(@Param("record") OrganizationAccountingRate record, @Param("example") OrganizationAccountingRateExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(OrganizationAccountingRate record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
*
* @mbg.generated
*/
int updateByPrimaryKey(OrganizationAccountingRate record);
}
\ No newline at end of file
......@@ -482,8 +482,6 @@ public class Organization extends BaseEntity implements Serializable {
*/
private Boolean engageNationalProhibitIndustry;
private String enterpriseAccountCode;
/**
* Database Column Remarks:
* 注销时间。
......@@ -495,6 +493,59 @@ public class Organization extends BaseEntity implements Serializable {
*/
private Date logoutTime;
/**
* Database Column Remarks:
* 账套ID(DD)
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization.enterprise_account_code
*
* @mbg.generated
*/
private String enterpriseAccountCode;
/**
* Database Column Remarks:
* 账套名称(DD)
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization.enterprise_account_name
*
* @mbg.generated
*/
private String enterpriseAccountName;
/**
* Database Column Remarks:
* 本位币币种(DD)
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization.currency_code
*
* @mbg.generated
*/
private String currencyCode;
/**
* Database Column Remarks:
* 法人主体
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization.legal_entity
*
* @mbg.generated
*/
private String legalEntity;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization.ps_code
*
* @mbg.generated
*/
private String psCode;
private Area area;
private BusinessUnit businessUnit;
......@@ -795,30 +846,6 @@ public class Organization extends BaseEntity implements Serializable {
this.pLevel = pLevel;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization.p_level
*
* @return the value of organization.p_level
*
* @mbg.generated
*/
public Integer getPLevel() {
return pLevel;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column organization.p_level
*
* @param pLevel the value for organization.p_level
*
* @mbg.generated
*/
public void setPLevel(Integer pLevel) {
this.pLevel = pLevel;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization.create_time
......@@ -1755,6 +1782,101 @@ public class Organization extends BaseEntity implements Serializable {
this.enterpriseAccountCode = enterpriseAccountCode == null ? null : enterpriseAccountCode.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization.enterprise_account_name
*
* @return the value of organization.enterprise_account_name
*
* @mbg.generated
*/
public String getEnterpriseAccountName() {
return enterpriseAccountName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column organization.enterprise_account_name
*
* @param enterpriseAccountName the value for organization.enterprise_account_name
*
* @mbg.generated
*/
public void setEnterpriseAccountName(String enterpriseAccountName) {
this.enterpriseAccountName = enterpriseAccountName == null ? null : enterpriseAccountName.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization.currency_code
*
* @return the value of organization.currency_code
*
* @mbg.generated
*/
public String getCurrencyCode() {
return currencyCode;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column organization.currency_code
*
* @param currencyCode the value for organization.currency_code
*
* @mbg.generated
*/
public void setCurrencyCode(String currencyCode) {
this.currencyCode = currencyCode == null ? null : currencyCode.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization.legal_entity
*
* @return the value of organization.legal_entity
*
* @mbg.generated
*/
public String getLegalEntity() {
return legalEntity;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column organization.legal_entity
*
* @param legalEntity the value for organization.legal_entity
*
* @mbg.generated
*/
public void setLegalEntity(String legalEntity) {
this.legalEntity = legalEntity == null ? null : legalEntity.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization.ps_code
*
* @return the value of organization.ps_code
*
* @mbg.generated
*/
public String getPsCode() {
return psCode;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column organization.ps_code
*
* @param psCode the value for organization.ps_code
*
* @mbg.generated
*/
public void setPsCode(String psCode) {
this.psCode = psCode == null ? null : psCode.trim();
}
public Area getArea() {
return area;
......@@ -1772,7 +1894,6 @@ public class Organization extends BaseEntity implements Serializable {
this.businessUnit = businessUnit;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization
......@@ -1836,6 +1957,10 @@ public class Organization extends BaseEntity implements Serializable {
sb.append(", engageNationalProhibitIndustry=").append(engageNationalProhibitIndustry);
sb.append(", logoutTime=").append(logoutTime);
sb.append(", enterpriseAccountCode=").append(enterpriseAccountCode);
sb.append(", enterpriseAccountName=").append(enterpriseAccountName);
sb.append(", currencyCode=").append(currencyCode);
sb.append(", legalEntity=").append(legalEntity);
sb.append(", psCode=").append(psCode);
sb.append("]");
return sb.toString();
}
......
......@@ -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 int ownTime;
/**
*
......@@ -344,11 +344,11 @@ public class TaxDocument implements Serializable {
this.auditStatus = auditStatus;
}
public Date getOwnTime() {
public int getOwnTime() {
return ownTime;
}
public void setOwnTime(Date ownTime) {
public void setOwnTime(int ownTime) {
this.ownTime = ownTime;
}
......@@ -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;
}
......
......@@ -865,6 +865,11 @@ public class TaxDocumentExample {
return (Criteria) this;
}
public Criteria andOwnTimeEqualTo(Integer value) {
addCriterion("own_time =", value, "ownTime");
return (Criteria) this;
}
public Criteria andFileTimeNotBetween(Date value1, Date value2) {
addCriterion("file_time not between", value1, value2, "fileTime");
return (Criteria) this;
......
package pwc.taxtech.atms.vat.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.dpo.BalanceSheetCondition;
import pwc.taxtech.atms.vat.entity.BalanceSheet;
import pwc.taxtech.atms.vat.entity.BalanceSheetExample;
@Mapper
public interface BalanceSheetMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet
*
* @mbg.generated
*/
long countByExample(BalanceSheetExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet
*
* @mbg.generated
*/
int deleteByExample(BalanceSheetExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet
*
* @mbg.generated
*/
int insert(BalanceSheet record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet
*
* @mbg.generated
*/
int insertSelective(BalanceSheet record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet
*
* @mbg.generated
*/
List<BalanceSheet> selectByExampleWithRowbounds(BalanceSheetExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet
*
* @mbg.generated
*/
List<BalanceSheet> selectByExample(BalanceSheetExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet
*
* @mbg.generated
*/
BalanceSheet selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") BalanceSheet record, @Param("example") BalanceSheetExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet
*
* @mbg.generated
*/
int updateByExample(@Param("record") BalanceSheet record, @Param("example") BalanceSheetExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(BalanceSheet record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet
*
* @mbg.generated
*/
int updateByPrimaryKey(BalanceSheet record);
List<BalanceSheet> selectByCondition(@Param("bsCondition") BalanceSheetCondition condition);
int insertBatch(List<BalanceSheet> bls);
package pwc.taxtech.atms.vat.dao;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.dpo.BalanceSheetCondition;
import pwc.taxtech.atms.vat.entity.BalanceSheet;
import pwc.taxtech.atms.vat.entity.BalanceSheetExample;
import java.util.List;
@Mapper
public interface BalanceSheetMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet
*
* @mbg.generated
*/
long countByExample(BalanceSheetExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet
*
* @mbg.generated
*/
int deleteByExample(BalanceSheetExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet
*
* @mbg.generated
*/
int insert(BalanceSheet record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet
*
* @mbg.generated
*/
int insertSelective(BalanceSheet record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet
*
* @mbg.generated
*/
List<BalanceSheet> selectByExampleWithRowbounds(BalanceSheetExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet
*
* @mbg.generated
*/
List<BalanceSheet> selectByExample(BalanceSheetExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet
*
* @mbg.generated
*/
BalanceSheet selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") BalanceSheet record, @Param("example") BalanceSheetExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet
*
* @mbg.generated
*/
int updateByExample(@Param("record") BalanceSheet record, @Param("example") BalanceSheetExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(BalanceSheet record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet
*
* @mbg.generated
*/
int updateByPrimaryKey(BalanceSheet record);
List<BalanceSheet> selectByCondition(@Param("bsCondition") BalanceSheetCondition condition);
int insertBatch(List<BalanceSheet> bls);
}
\ No newline at end of file
package pwc.taxtech.atms.vat.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.dpo.BalanceSheetCondition;
import pwc.taxtech.atms.vat.entity.BalanceSheet;
import pwc.taxtech.atms.vat.entity.BalanceSheetPrc;
import pwc.taxtech.atms.vat.entity.BalanceSheetPrcExample;
@Mapper
public interface BalanceSheetPrcFinalMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet_prc_final
*
* @mbg.generated
*/
long countByExample(BalanceSheetPrcExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet_prc_final
*
* @mbg.generated
*/
int deleteByExample(BalanceSheetPrcExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet_prc_final
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet_prc_final
*
* @mbg.generated
*/
int insert(BalanceSheetPrc record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet_prc_final
*
* @mbg.generated
*/
int insertSelective(BalanceSheetPrc record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet_prc_final
*
* @mbg.generated
*/
List<BalanceSheetPrc> selectByExampleWithRowbounds(BalanceSheetPrcExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet_prc_final
*
* @mbg.generated
*/
List<BalanceSheetPrc> selectByExample(BalanceSheetPrcExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet_prc_final
*
* @mbg.generated
*/
BalanceSheetPrc selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet_prc_final
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") BalanceSheetPrc record, @Param("example") BalanceSheetPrcExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet_prc_final
*
* @mbg.generated
*/
int updateByExample(@Param("record") BalanceSheetPrc record, @Param("example") BalanceSheetPrcExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet_prc_final
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(BalanceSheetPrc record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table balance_sheet_prc_final
*
* @mbg.generated
*/
int updateByPrimaryKey(BalanceSheetPrc record);
List<BalanceSheet> selectByCondition(@Param("bsCondition") BalanceSheetCondition condition);
int insertBatch(List<BalanceSheet> bls);
}
\ No newline at end of file
......@@ -12,7 +12,7 @@
<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">
......@@ -175,14 +175,14 @@
year_redundancy,audit_status,physical_index_number,own_time)
values (#{id,jdbcType=BIGINT}, #{fileAttr,jdbcType=VARCHAR}, #{fileTypeId,jdbcType=INTEGER},
#{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},
......@@ -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},
......@@ -427,7 +427,7 @@
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>
......@@ -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},
......@@ -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}
......
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