Commit 79082a95 authored by zhkwei's avatar zhkwei

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

parents aef2ca5c 017a7865
...@@ -148,6 +148,33 @@ public class DateUtils { ...@@ -148,6 +148,33 @@ public class DateUtils {
return strtodate; return strtodate;
} }
/**
* 将短时间格式字符串转换为时间 yyyy/MM/dd
*
* @param strDate
* @return
*/
public static Date strToDate2(String strDate) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd");
ParsePosition pos = new ParsePosition(0);
Date strtodate = formatter.parse(strDate, pos);
return strtodate;
}
/**
* 将yy/MM/dd字符串转换为时间 yyyy/MM/dd
*
* @param strDate
* @return
*/
public static Date strToDate3(String strDate) {
strDate = "20"+strDate;
SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd");
ParsePosition pos = new ParsePosition(0);
Date strtodate = formatter.parse(strDate, pos);
return strtodate;
}
/** /**
* 得到现在时间 * 得到现在时间
* *
......
...@@ -5,7 +5,10 @@ public enum EnumImportType { ...@@ -5,7 +5,10 @@ public enum EnumImportType {
ProfitLoss(1), ProfitLoss(1),
BalanceSheet(2), BalanceSheet(2),
RedLetterInfoTable(3), RedLetterInfoTable(3),
AdjustmentTable(4) AdjustmentTable(4),
CashFlow(5),
CoupaPurchasingReport(6),
InvoiceData(7)
; ;
private Integer code; private Integer code;
......
...@@ -112,6 +112,38 @@ public class DataImportController extends BaseController { ...@@ -112,6 +112,38 @@ public class DataImportController extends BaseController {
} }
} }
@ResponseBody
@RequestMapping(value = "CFExcelFile", method = RequestMethod.POST)
public OperationResultDto importCFExcelFile(@RequestParam MultipartFile file,@RequestParam String periodDate,@RequestParam Integer importType) {
try {
if (null == file) {
return OperationResultDto.error(ErrorMessage.NoFile);
}
return dataImportService.importCFExcelFile(file, periodDate,importType);
} catch (ServiceException e) {
return OperationResultDto.error(e.getMessage());
} catch (Exception e) {
logger.error("importATExcelFile error.", e);
return OperationResultDto.error(ErrorMessage.SystemError);
}
}
@ResponseBody
@RequestMapping(value = "CPRExcelFile", method = RequestMethod.POST)
public OperationResultDto importCPRExcelFile(@RequestParam MultipartFile file,@RequestParam String periodDate,@RequestParam Integer importType) {
try {
if (null == file) {
return OperationResultDto.error(ErrorMessage.NoFile);
}
return dataImportService.importCPRExcelFile(file, periodDate,importType);
} catch (ServiceException e) {
return OperationResultDto.error(e.getMessage());
} catch (Exception e) {
logger.error("importATExcelFile error.", e);
return OperationResultDto.error(ErrorMessage.SystemError);
}
}
@ResponseBody @ResponseBody
@RequestMapping(value = "displayImportLog", method = RequestMethod.GET) @RequestMapping(value = "displayImportLog", method = RequestMethod.GET)
public List<DataImportLogDto> displayImportLog(@RequestParam Integer type) { public List<DataImportLogDto> displayImportLog(@RequestParam Integer type) {
......
...@@ -41,12 +41,28 @@ ...@@ -41,12 +41,28 @@
<property name="rootInterface" value="pwc.taxtech.atms.MyVatMapper" /> <property name="rootInterface" value="pwc.taxtech.atms.MyVatMapper" />
</javaClientGenerator> </javaClientGenerator>
<table tableName="invoice_data" domainObjectName="InvoiceData">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
<columnOverride column="count_type" javaType="java.lang.Integer" jdbcType="TINYINT"/>
</table>
<!--<table tableName="coupa_purchasing_report" domainObjectName="CoupaPurchasingReport">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
<table tableName="cash_flow" domainObjectName="CashFlow">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
<table tableName="red_letter_info_table" domainObjectName="RedLetterInfoTable"> <table tableName="red_letter_info_table" domainObjectName="RedLetterInfoTable">
<property name="useActualColumnNames" value="false"/> <property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/> <property name="ignoreQualifiersAtRuntime" value="true"/>
</table> </table>
<!--<table tableName="adjustment_table" domainObjectName="AdjustmentTable"> <table tableName="adjustment_table" domainObjectName="AdjustmentTable">
<property name="useActualColumnNames" value="false"/> <property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/> <property name="ignoreQualifiersAtRuntime" value="true"/>
</table> </table>
......
package pwc.taxtech.atms.vat.dao; package pwc.taxtech.atms.vat.dao;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper; import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.dpo.CashFlowCondition; import pwc.taxtech.atms.vat.dpo.CashFlowCondition;
import pwc.taxtech.atms.vat.dpo.ProfitLossStatementCondition; import pwc.taxtech.atms.vat.entity.CashFlow;
import pwc.taxtech.atms.vat.entity.CashFlow; import pwc.taxtech.atms.vat.entity.CashFlowExample;
import pwc.taxtech.atms.vat.entity.CashFlowExample;
import pwc.taxtech.atms.vat.entity.ProfitLossStatement; @Mapper
public interface CashFlowMapper extends MyVatMapper {
@Mapper /**
public interface CashFlowMapper extends MyVatMapper { * This method was generated by MyBatis Generator.
/** * This method corresponds to the database table cash_flow
* This method was generated by MyBatis Generator. *
* This method corresponds to the database table cash_flow * @mbg.generated
* */
* @mbg.generated long countByExample(CashFlowExample example);
*/
long countByExample(CashFlowExample example); /**
* This method was generated by MyBatis Generator.
/** * This method corresponds to the database table cash_flow
* This method was generated by MyBatis Generator. *
* This method corresponds to the database table cash_flow * @mbg.generated
* */
* @mbg.generated int deleteByExample(CashFlowExample example);
*/
int deleteByExample(CashFlowExample example); /**
* This method was generated by MyBatis Generator.
/** * This method corresponds to the database table cash_flow
* This method was generated by MyBatis Generator. *
* This method corresponds to the database table cash_flow * @mbg.generated
* */
* @mbg.generated int deleteByPrimaryKey(Long id);
*/
int deleteByPrimaryKey(Long id); /**
* This method was generated by MyBatis Generator.
/** * This method corresponds to the database table cash_flow
* This method was generated by MyBatis Generator. *
* This method corresponds to the database table cash_flow * @mbg.generated
* */
* @mbg.generated int insert(CashFlow record);
*/
int insert(CashFlow record); /**
* This method was generated by MyBatis Generator.
/** * This method corresponds to the database table cash_flow
* This method was generated by MyBatis Generator. *
* This method corresponds to the database table cash_flow * @mbg.generated
* */
* @mbg.generated int insertSelective(CashFlow record);
*/
int insertSelective(CashFlow record); /**
* This method was generated by MyBatis Generator.
/** * This method corresponds to the database table cash_flow
* This method was generated by MyBatis Generator. *
* This method corresponds to the database table cash_flow * @mbg.generated
* */
* @mbg.generated List<CashFlow> selectByExampleWithRowbounds(CashFlowExample example, RowBounds rowBounds);
*/
List<CashFlow> selectByExampleWithRowbounds(CashFlowExample example, RowBounds rowBounds); /**
* This method was generated by MyBatis Generator.
/** * This method corresponds to the database table cash_flow
* This method was generated by MyBatis Generator. *
* This method corresponds to the database table cash_flow * @mbg.generated
* */
* @mbg.generated List<CashFlow> selectByExample(CashFlowExample example);
*/
List<CashFlow> selectByExample(CashFlowExample example); /**
* This method was generated by MyBatis Generator.
/** * This method corresponds to the database table cash_flow
* This method was generated by MyBatis Generator. *
* This method corresponds to the database table cash_flow * @mbg.generated
* */
* @mbg.generated CashFlow selectByPrimaryKey(Long id);
*/
CashFlow selectByPrimaryKey(Long id); /**
* This method was generated by MyBatis Generator.
/** * This method corresponds to the database table cash_flow
* This method was generated by MyBatis Generator. *
* This method corresponds to the database table cash_flow * @mbg.generated
* */
* @mbg.generated int updateByExampleSelective(@Param("record") CashFlow record, @Param("example") CashFlowExample example);
*/
int updateByExampleSelective(@Param("record") CashFlow record, @Param("example") CashFlowExample example); /**
* This method was generated by MyBatis Generator.
/** * This method corresponds to the database table cash_flow
* This method was generated by MyBatis Generator. *
* This method corresponds to the database table cash_flow * @mbg.generated
* */
* @mbg.generated int updateByExample(@Param("record") CashFlow record, @Param("example") CashFlowExample example);
*/
int updateByExample(@Param("record") CashFlow record, @Param("example") CashFlowExample example); /**
* This method was generated by MyBatis Generator.
/** * This method corresponds to the database table cash_flow
* This method was generated by MyBatis Generator. *
* This method corresponds to the database table cash_flow * @mbg.generated
* */
* @mbg.generated int updateByPrimaryKeySelective(CashFlow record);
*/
int updateByPrimaryKeySelective(CashFlow record); /**
* This method was generated by MyBatis Generator.
/** * This method corresponds to the database table cash_flow
* This method was generated by MyBatis Generator. *
* This method corresponds to the database table cash_flow * @mbg.generated
* */
* @mbg.generated int updateByPrimaryKey(CashFlow record);
*/
int updateByPrimaryKey(CashFlow record); List<CashFlow> selectByCondition(@Param("cfCondition") CashFlowCondition condition);
List<CashFlow> selectByCondition(@Param("cfCondition") CashFlowCondition condition); int insertBatch(List<CashFlow> cfs);
} }
\ No newline at end of file
package pwc.taxtech.atms.vat.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.entity.CoupaPurchasingReport;
import pwc.taxtech.atms.vat.entity.CoupaPurchasingReportExample;
@Mapper
public interface CoupaPurchasingReportMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table coupa_purchasing_report
*
* @mbg.generated
*/
long countByExample(CoupaPurchasingReportExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table coupa_purchasing_report
*
* @mbg.generated
*/
int deleteByExample(CoupaPurchasingReportExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table coupa_purchasing_report
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table coupa_purchasing_report
*
* @mbg.generated
*/
int insert(CoupaPurchasingReport record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table coupa_purchasing_report
*
* @mbg.generated
*/
int insertSelective(CoupaPurchasingReport record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table coupa_purchasing_report
*
* @mbg.generated
*/
List<CoupaPurchasingReport> selectByExampleWithRowbounds(CoupaPurchasingReportExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table coupa_purchasing_report
*
* @mbg.generated
*/
List<CoupaPurchasingReport> selectByExample(CoupaPurchasingReportExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table coupa_purchasing_report
*
* @mbg.generated
*/
CoupaPurchasingReport selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table coupa_purchasing_report
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") CoupaPurchasingReport record, @Param("example") CoupaPurchasingReportExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table coupa_purchasing_report
*
* @mbg.generated
*/
int updateByExample(@Param("record") CoupaPurchasingReport record, @Param("example") CoupaPurchasingReportExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table coupa_purchasing_report
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(CoupaPurchasingReport record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table coupa_purchasing_report
*
* @mbg.generated
*/
int updateByPrimaryKey(CoupaPurchasingReport record);
int insertBatch(List<CoupaPurchasingReport> cprs);
}
\ No newline at end of file
package pwc.taxtech.atms.vat.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyVatMapper;
import pwc.taxtech.atms.vat.entity.InvoiceData;
import pwc.taxtech.atms.vat.entity.InvoiceDataExample;
@Mapper
public interface InvoiceDataMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table invoice_data
*
* @mbg.generated
*/
long countByExample(InvoiceDataExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table invoice_data
*
* @mbg.generated
*/
int deleteByExample(InvoiceDataExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table invoice_data
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table invoice_data
*
* @mbg.generated
*/
int insert(InvoiceData record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table invoice_data
*
* @mbg.generated
*/
int insertSelective(InvoiceData record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table invoice_data
*
* @mbg.generated
*/
List<InvoiceData> selectByExampleWithRowbounds(InvoiceDataExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table invoice_data
*
* @mbg.generated
*/
List<InvoiceData> selectByExample(InvoiceDataExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table invoice_data
*
* @mbg.generated
*/
InvoiceData selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table invoice_data
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") InvoiceData record, @Param("example") InvoiceDataExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table invoice_data
*
* @mbg.generated
*/
int updateByExample(@Param("record") InvoiceData record, @Param("example") InvoiceDataExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table invoice_data
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(InvoiceData record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table invoice_data
*
* @mbg.generated
*/
int updateByPrimaryKey(InvoiceData record);
}
\ No newline at end of file
<?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.vat.dao.CoupaPurchasingReportMapper">
<insert id="insertBatch" parameterType="java.util.List">
insert into coupa_purchasing_report
(<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.tmsPeriod != null">#{item.tmsPeriod,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.period != null">#{item.period,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.billNum != null">#{item.billNum,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.companyCode != null">#{item.companyCode,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.billingDate != null">#{item.billingDate,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.invoiceDate != null">#{item.invoiceDate,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.lineNum != null">#{item.lineNum,jdbcType=INTEGER},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.headUpStatus != null">#{item.headUpStatus,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.invoiceDate != null">#{item.invoiceDate,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.invoiceReceiptDate != null">#{item.invoiceReceiptDate,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.payExpiration != null">#{item.payExpiration,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.purchaseOrderNum != null">#{item.purchaseOrderNum,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.purchaseOrderLineNum != null">#{item.purchaseOrderLineNum,jdbcType=VARCHAR},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.description != null">#{item.description,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.supplierNum != null">#{item.supplierNum,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.supplier != null">#{item.supplier,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.totalAmount != null">#{item.totalAmount,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.currency != null">#{item.currency,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.paid != null">#{item.paid,jdbcType=BIT},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.amortization != null">#{item.amortization,jdbcType=BIT},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.prepayments != null">#{item.prepayments,jdbcType=BIT},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.reviewReason != null">#{item.reviewReason,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.commodity != null">#{item.commodity,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.commodityCode != null">#{item.commodityCode,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.founder != null">#{item.founder,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.createDate != null">#{item.createDate,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.currentApprover != null">#{item.currentApprover,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.lastUpdatedDate != null">#{item.lastUpdatedDate,jdbcType=TIMESTAMP},</when>
<otherwise>CURRENT_TIMESTAMP,</otherwise>
</choose>
<choose>
<when test="item.lastUpdatedPerson != null">#{item.lastUpdatedPerson,jdbcType=VARCHAR},</when>
<otherwise>'',</otherwise>
</choose>
<choose>
<when test="item.totalTaxAmount != null">#{item.totalTaxAmount,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.totalTaxAmountHeader != null">#{item.totalTaxAmountHeader,jdbcType=DECIMAL},</when>
<otherwise>0,</otherwise>
</choose>
<choose>
<when test="item.billingNote != null">#{item.billingNote,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
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