Commit b3207384 authored by frank.xa.zhang's avatar frank.xa.zhang

add code for zc, need debug later

parent f9227c49
......@@ -445,5 +445,11 @@
<table tableName="organization_service_template_group" domainObjectName="OrganizationServiceTemplateGroup">
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
<table tableName="AssetDetailGroup" domainObjectName="AssetDetailGroup">
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
<table tableName="AssetGroup" domainObjectName="AssetGroup">
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
</context>
</generatorConfiguration>
\ No newline at end of file
rem see http://www.mybatis.org/generator/running/runningFromCmdLine.html
cd /d %~dp0
call java -classpath .;./* org.mybatis.generator.api.ShellRunner -configfile generatorConfig.xml -overwrite -verbose
call java -classpath .;./* org.mybatis.generator.api.ShellRunner -configfile generatorConfig.xml -overwrite -verbose -tables AssetGroup
echo @@@@@@@@@@@ DONE @@@@@@@@@@@
pause
......@@ -383,5 +383,12 @@
<table tableName="modified_report_cell" domainObjectName="ModifiedReportCell">
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
<table tableName="AssetsList" domainObjectName="AssetsList">
<property name="ignoreQualifiersAtRuntime" value="true"/>
<columnOverride column="IsRetain" javaType="java.lang.Boolean"/>
</table>
<table tableName="AssetGroupResult" domainObjectName="AssetGroupResult">
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
</context>
</generatorConfiguration>
\ No newline at end of file
rem see http://www.mybatis.org/generator/running/runningFromCmdLine.html
cd /d %~dp0
call java -classpath .;./* org.mybatis.generator.api.ShellRunner -configfile vatGeneratorConfig.xml -overwrite -verbose -tables StandardAccount
call java -classpath .;./* org.mybatis.generator.api.ShellRunner -configfile vatGeneratorConfig.xml -overwrite -verbose -tables AssetsList
echo @@@@@@@@@@@ DONE @@@@@@@@@@@
pause
......@@ -40,6 +40,7 @@ public class SpringContextUtil implements ApplicationContextAware {
public static PeriodTaxRuleSettingMapper periodTaxRuleSettingMapper;
public static InputVatInvoiceDao inputVatInvoiceDao;
public static InputVATInvoiceMapper inputVATInvoiceMapper;
public static AssetsListMapper assetsListMapper;
/**
* 获取bean
......@@ -77,5 +78,6 @@ public class SpringContextUtil implements ApplicationContextAware {
periodTaxRuleSettingMapper = webApplicationContext.getBean(PeriodTaxRuleSettingMapper.class);
inputVatInvoiceDao = webApplicationContext.getBean(InputVatInvoiceDao.class);
inputVATInvoiceMapper = webApplicationContext.getBean(InputVATInvoiceMapper.class);
assetsListMapper = webApplicationContext.getBean(AssetsListMapper.class);
}
}
......@@ -6,7 +6,8 @@ public enum FormulaDataSourceDetailType {
FormulaDataSourceDto(2, pwc.taxtech.atms.dto.vatdto.FormulaDataSourceDto.class),
InputInvoiceDataSourceDto(3, pwc.taxtech.atms.dto.vatdto.InputInvoiceDataSourceDto.class),
InputInvoiceDetailDataSourceDto(4, pwc.taxtech.atms.dto.vatdto.InputInvoiceDetailDataSourceDto.class),
OutputInvoiceDataSourceDto(5, pwc.taxtech.atms.dto.vatdto.OutputInvoiceDataSourceDto.class);
OutputInvoiceDataSourceDto(5, pwc.taxtech.atms.dto.vatdto.OutputInvoiceDataSourceDto.class),
AssetDetailDataSourceDto(5, pwc.taxtech.atms.dto.vatdto.AssetDetailDataSourceDto.class);
private Integer code;
......
......@@ -56,7 +56,8 @@ public enum FormulaDataSourceType {
TrialBalanceSource(11),
//QMYESource(12),
ModelSource(13),
TrialBalance(20);
TrialBalance(20),
AssetListSource(21);
// FSESource(14),
private Integer code;
......
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.entitiy.AssetDetailGroup;
import pwc.taxtech.atms.entitiy.AssetDetailGroupExample;
@Mapper
public interface AssetDetailGroupMapper extends MyMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetDetailGroup
*
* @mbg.generated
*/
long countByExample(AssetDetailGroupExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetDetailGroup
*
* @mbg.generated
*/
int deleteByExample(AssetDetailGroupExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetDetailGroup
*
* @mbg.generated
*/
int deleteByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetDetailGroup
*
* @mbg.generated
*/
int insert(AssetDetailGroup record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetDetailGroup
*
* @mbg.generated
*/
int insertSelective(AssetDetailGroup record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetDetailGroup
*
* @mbg.generated
*/
List<AssetDetailGroup> selectByExampleWithBLOBsWithRowbounds(AssetDetailGroupExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetDetailGroup
*
* @mbg.generated
*/
List<AssetDetailGroup> selectByExampleWithBLOBs(AssetDetailGroupExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetDetailGroup
*
* @mbg.generated
*/
List<AssetDetailGroup> selectByExampleWithRowbounds(AssetDetailGroupExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetDetailGroup
*
* @mbg.generated
*/
List<AssetDetailGroup> selectByExample(AssetDetailGroupExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetDetailGroup
*
* @mbg.generated
*/
AssetDetailGroup selectByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetDetailGroup
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") AssetDetailGroup record, @Param("example") AssetDetailGroupExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetDetailGroup
*
* @mbg.generated
*/
int updateByExampleWithBLOBs(@Param("record") AssetDetailGroup record, @Param("example") AssetDetailGroupExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetDetailGroup
*
* @mbg.generated
*/
int updateByExample(@Param("record") AssetDetailGroup record, @Param("example") AssetDetailGroupExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetDetailGroup
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(AssetDetailGroup record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetDetailGroup
*
* @mbg.generated
*/
int updateByPrimaryKeyWithBLOBs(AssetDetailGroup record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetDetailGroup
*
* @mbg.generated
*/
int updateByPrimaryKey(AssetDetailGroup record);
}
\ No newline at end of file
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.entitiy.AssetGroup;
import pwc.taxtech.atms.entitiy.AssetGroupExample;
@Mapper
public interface AssetGroupMapper extends MyMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroup
*
* @mbg.generated
*/
long countByExample(AssetGroupExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroup
*
* @mbg.generated
*/
int deleteByExample(AssetGroupExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroup
*
* @mbg.generated
*/
int deleteByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroup
*
* @mbg.generated
*/
int insert(AssetGroup record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroup
*
* @mbg.generated
*/
int insertSelective(AssetGroup record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroup
*
* @mbg.generated
*/
List<AssetGroup> selectByExampleWithRowbounds(AssetGroupExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroup
*
* @mbg.generated
*/
List<AssetGroup> selectByExample(AssetGroupExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroup
*
* @mbg.generated
*/
AssetGroup selectByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroup
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") AssetGroup record, @Param("example") AssetGroupExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroup
*
* @mbg.generated
*/
int updateByExample(@Param("record") AssetGroup record, @Param("example") AssetGroupExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroup
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(AssetGroup record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroup
*
* @mbg.generated
*/
int updateByPrimaryKey(AssetGroup record);
}
\ No newline at end of file
package pwc.taxtech.atms.dto.vatdto;
import lombok.Getter;
import lombok.Setter;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import java.math.BigDecimal;
import java.util.Date;
@Setter
@Getter
public class AssetDetailDataSourceDto extends FormulaDataSourceDto {
public AssetDetailDataSourceDto() {
super();
this.setType(FormulaDataSourceType.AssetListSource.getCode());
}
public String assetNumber;
public String assetGroupName;
public String assetDetailGroupID;
public String assetDescription;
public Date buyDate;
public Date depreciationDate;
public Integer depreciationPeriod;
public BigDecimal acquisitionValue;
public BigDecimal adjustmentValue;
public Date disposedDate;
public BigDecimal residualRate;
public BigDecimal yearDepreciationAmount;
public BigDecimal yearAdjustmentAmount;
public BigDecimal yearEndValue;
public Integer status;
public BigDecimal accountAcquisitionValue;
public BigDecimal accountMonthDepreciationAmount;
public BigDecimal accountYearDepreciationAmount;
public BigDecimal accountTotalepreciationAmount;
public Integer taxDepreciationPeriod;
public Integer taxToLastYearDepreciationPeriod;
public Integer taxToCurrentYearDepreciationPeriod;
public Integer taxYearDepreciationPeriod;
public BigDecimal taxMonthDepreciationAmount;
public BigDecimal taxToCurrentYearDepreciationAmount;
public BigDecimal taxCurrentYearDepreciationAmount;
public BigDecimal totalDifferenceAmount;
public BigDecimal yearDifferenceAmount;
public Integer assetType;
public Boolean isRetain;
public String assetDetailGroupName;
//判断是取哪一列的值
public int dataType;
public Integer detailGroupType;
}
package pwc.taxtech.atms.entitiy;
import java.io.Serializable;
import java.util.Date;
/**
*
* This class was generated by MyBatis Generator.
* This class corresponds to the database table AssetDetailGroup
*
* @mbg.generated do_not_delete_during_merge
*/
public class AssetDetailGroup implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column AssetDetailGroup.ID
*
* @mbg.generated
*/
private String id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column AssetDetailGroup.AssetGroupID
*
* @mbg.generated
*/
private String assetgroupid;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column AssetDetailGroup.DetailGroupName
*
* @mbg.generated
*/
private String detailgroupname;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column AssetDetailGroup.AssetGroupType
*
* @mbg.generated
*/
private Integer assetgrouptype;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column AssetDetailGroup.GroupYear
*
* @mbg.generated
*/
private Integer groupyear;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column AssetDetailGroup.CreateTime
*
* @mbg.generated
*/
private Date createtime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column AssetDetailGroup.UpdateTime
*
* @mbg.generated
*/
private Date updatetime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column AssetDetailGroup.DetailGroupType
*
* @mbg.generated
*/
private Integer detailgrouptype;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column AssetDetailGroup.KeyValues
*
* @mbg.generated
*/
private String keyvalues;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table AssetDetailGroup
*
* @mbg.generated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column AssetDetailGroup.ID
*
* @return the value of AssetDetailGroup.ID
*
* @mbg.generated
*/
public String getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column AssetDetailGroup.ID
*
* @param id the value for AssetDetailGroup.ID
*
* @mbg.generated
*/
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column AssetDetailGroup.AssetGroupID
*
* @return the value of AssetDetailGroup.AssetGroupID
*
* @mbg.generated
*/
public String getAssetgroupid() {
return assetgroupid;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column AssetDetailGroup.AssetGroupID
*
* @param assetgroupid the value for AssetDetailGroup.AssetGroupID
*
* @mbg.generated
*/
public void setAssetgroupid(String assetgroupid) {
this.assetgroupid = assetgroupid == null ? null : assetgroupid.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column AssetDetailGroup.DetailGroupName
*
* @return the value of AssetDetailGroup.DetailGroupName
*
* @mbg.generated
*/
public String getDetailgroupname() {
return detailgroupname;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column AssetDetailGroup.DetailGroupName
*
* @param detailgroupname the value for AssetDetailGroup.DetailGroupName
*
* @mbg.generated
*/
public void setDetailgroupname(String detailgroupname) {
this.detailgroupname = detailgroupname == null ? null : detailgroupname.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column AssetDetailGroup.AssetGroupType
*
* @return the value of AssetDetailGroup.AssetGroupType
*
* @mbg.generated
*/
public Integer getAssetgrouptype() {
return assetgrouptype;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column AssetDetailGroup.AssetGroupType
*
* @param assetgrouptype the value for AssetDetailGroup.AssetGroupType
*
* @mbg.generated
*/
public void setAssetgrouptype(Integer assetgrouptype) {
this.assetgrouptype = assetgrouptype;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column AssetDetailGroup.GroupYear
*
* @return the value of AssetDetailGroup.GroupYear
*
* @mbg.generated
*/
public Integer getGroupyear() {
return groupyear;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column AssetDetailGroup.GroupYear
*
* @param groupyear the value for AssetDetailGroup.GroupYear
*
* @mbg.generated
*/
public void setGroupyear(Integer groupyear) {
this.groupyear = groupyear;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column AssetDetailGroup.CreateTime
*
* @return the value of AssetDetailGroup.CreateTime
*
* @mbg.generated
*/
public Date getCreatetime() {
return createtime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column AssetDetailGroup.CreateTime
*
* @param createtime the value for AssetDetailGroup.CreateTime
*
* @mbg.generated
*/
public void setCreatetime(Date createtime) {
this.createtime = createtime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column AssetDetailGroup.UpdateTime
*
* @return the value of AssetDetailGroup.UpdateTime
*
* @mbg.generated
*/
public Date getUpdatetime() {
return updatetime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column AssetDetailGroup.UpdateTime
*
* @param updatetime the value for AssetDetailGroup.UpdateTime
*
* @mbg.generated
*/
public void setUpdatetime(Date updatetime) {
this.updatetime = updatetime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column AssetDetailGroup.DetailGroupType
*
* @return the value of AssetDetailGroup.DetailGroupType
*
* @mbg.generated
*/
public Integer getDetailgrouptype() {
return detailgrouptype;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column AssetDetailGroup.DetailGroupType
*
* @param detailgrouptype the value for AssetDetailGroup.DetailGroupType
*
* @mbg.generated
*/
public void setDetailgrouptype(Integer detailgrouptype) {
this.detailgrouptype = detailgrouptype;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column AssetDetailGroup.KeyValues
*
* @return the value of AssetDetailGroup.KeyValues
*
* @mbg.generated
*/
public String getKeyvalues() {
return keyvalues;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column AssetDetailGroup.KeyValues
*
* @param keyvalues the value for AssetDetailGroup.KeyValues
*
* @mbg.generated
*/
public void setKeyvalues(String keyvalues) {
this.keyvalues = keyvalues == null ? null : keyvalues.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetDetailGroup
*
* @mbg.generated
*/
@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(", assetgroupid=").append(assetgroupid);
sb.append(", detailgroupname=").append(detailgroupname);
sb.append(", assetgrouptype=").append(assetgrouptype);
sb.append(", groupyear=").append(groupyear);
sb.append(", createtime=").append(createtime);
sb.append(", updatetime=").append(updatetime);
sb.append(", detailgrouptype=").append(detailgrouptype);
sb.append(", keyvalues=").append(keyvalues);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
package pwc.taxtech.atms.entitiy;
import java.io.Serializable;
import java.util.Date;
/**
*
* This class was generated by MyBatis Generator.
* This class corresponds to the database table AssetGroup
*
* @mbg.generated do_not_delete_during_merge
*/
public class AssetGroup implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column AssetGroup.ID
*
* @mbg.generated
*/
private String id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column AssetGroup.AssetGroupName
*
* @mbg.generated
*/
private String assetgroupname;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column AssetGroup.CreateTime
*
* @mbg.generated
*/
private Date createtime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column AssetGroup.UpdateTime
*
* @mbg.generated
*/
private Date updatetime;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table AssetGroup
*
* @mbg.generated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column AssetGroup.ID
*
* @return the value of AssetGroup.ID
*
* @mbg.generated
*/
public String getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column AssetGroup.ID
*
* @param id the value for AssetGroup.ID
*
* @mbg.generated
*/
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column AssetGroup.AssetGroupName
*
* @return the value of AssetGroup.AssetGroupName
*
* @mbg.generated
*/
public String getAssetgroupname() {
return assetgroupname;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column AssetGroup.AssetGroupName
*
* @param assetgroupname the value for AssetGroup.AssetGroupName
*
* @mbg.generated
*/
public void setAssetgroupname(String assetgroupname) {
this.assetgroupname = assetgroupname == null ? null : assetgroupname.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column AssetGroup.CreateTime
*
* @return the value of AssetGroup.CreateTime
*
* @mbg.generated
*/
public Date getCreatetime() {
return createtime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column AssetGroup.CreateTime
*
* @param createtime the value for AssetGroup.CreateTime
*
* @mbg.generated
*/
public void setCreatetime(Date createtime) {
this.createtime = createtime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column AssetGroup.UpdateTime
*
* @return the value of AssetGroup.UpdateTime
*
* @mbg.generated
*/
public Date getUpdatetime() {
return updatetime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column AssetGroup.UpdateTime
*
* @param updatetime the value for AssetGroup.UpdateTime
*
* @mbg.generated
*/
public void setUpdatetime(Date updatetime) {
this.updatetime = updatetime;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroup
*
* @mbg.generated
*/
@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(", assetgroupname=").append(assetgroupname);
sb.append(", createtime=").append(createtime);
sb.append(", updatetime=").append(updatetime);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
package pwc.taxtech.atms.vat.dao;
import lombok.Getter;
import lombok.Setter;
import pwc.taxtech.atms.entitiy.AssetDetailGroup;
import pwc.taxtech.atms.vat.entity.AssetsList;
@Getter
@Setter
public class AssetDetailResultDto {
String id;
AssetsList assetsList;
AssetDetailGroup assetDetailGroup;
}
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.AssetGroupResult;
import pwc.taxtech.atms.vat.entity.AssetGroupResultExample;
@Mapper
public interface AssetGroupResultMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroupResult
*
* @mbg.generated
*/
long countByExample(AssetGroupResultExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroupResult
*
* @mbg.generated
*/
int deleteByExample(AssetGroupResultExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroupResult
*
* @mbg.generated
*/
int deleteByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroupResult
*
* @mbg.generated
*/
int insert(AssetGroupResult record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroupResult
*
* @mbg.generated
*/
int insertSelective(AssetGroupResult record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroupResult
*
* @mbg.generated
*/
List<AssetGroupResult> selectByExampleWithRowbounds(AssetGroupResultExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroupResult
*
* @mbg.generated
*/
List<AssetGroupResult> selectByExample(AssetGroupResultExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroupResult
*
* @mbg.generated
*/
AssetGroupResult selectByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroupResult
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") AssetGroupResult record, @Param("example") AssetGroupResultExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroupResult
*
* @mbg.generated
*/
int updateByExample(@Param("record") AssetGroupResult record, @Param("example") AssetGroupResultExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroupResult
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(AssetGroupResult record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroupResult
*
* @mbg.generated
*/
int updateByPrimaryKey(AssetGroupResult record);
}
\ 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.AssetsList;
import pwc.taxtech.atms.vat.entity.AssetsListExample;
@Mapper
public interface AssetsListMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetsList
*
* @mbg.generated
*/
long countByExample(AssetsListExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetsList
*
* @mbg.generated
*/
int deleteByExample(AssetsListExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetsList
*
* @mbg.generated
*/
int deleteByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetsList
*
* @mbg.generated
*/
int insert(AssetsList record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetsList
*
* @mbg.generated
*/
int insertSelective(AssetsList record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetsList
*
* @mbg.generated
*/
List<AssetsList> selectByExampleWithBLOBsWithRowbounds(AssetsListExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetsList
*
* @mbg.generated
*/
List<AssetsList> selectByExampleWithBLOBs(AssetsListExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetsList
*
* @mbg.generated
*/
List<AssetsList> selectByExampleWithRowbounds(AssetsListExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetsList
*
* @mbg.generated
*/
List<AssetsList> selectByExample(AssetsListExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetsList
*
* @mbg.generated
*/
AssetsList selectByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetsList
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") AssetsList record, @Param("example") AssetsListExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetsList
*
* @mbg.generated
*/
int updateByExampleWithBLOBs(@Param("record") AssetsList record, @Param("example") AssetsListExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetsList
*
* @mbg.generated
*/
int updateByExample(@Param("record") AssetsList record, @Param("example") AssetsListExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetsList
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(AssetsList record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetsList
*
* @mbg.generated
*/
int updateByPrimaryKeyWithBLOBs(AssetsList record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetsList
*
* @mbg.generated
*/
int updateByPrimaryKey(AssetsList record);
List<AssetDetailResultDto> getAssetDetialResult(@Param("dbName") String dbName,@Param("assetType") Integer assetType,
@Param("assetDetailType") Integer assetDetailType);
}
\ No newline at end of file
package pwc.taxtech.atms.vat.entity;
import java.io.Serializable;
import java.util.Date;
/**
*
* This class was generated by MyBatis Generator.
* This class corresponds to the database table AssetGroupResult
*
* @mbg.generated do_not_delete_during_merge
*/
public class AssetGroupResult implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column AssetGroupResult.ID
*
* @mbg.generated
*/
private String id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column AssetGroupResult.AssetName
*
* @mbg.generated
*/
private String assetname;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column AssetGroupResult.AssetGroupID
*
* @mbg.generated
*/
private String assetgroupid;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column AssetGroupResult.AssetDetailGroupID
*
* @mbg.generated
*/
private String assetdetailgroupid;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column AssetGroupResult.TaxDepreciationPeriod
*
* @mbg.generated
*/
private Integer taxdepreciationperiod;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column AssetGroupResult.CreateTime
*
* @mbg.generated
*/
private Date createtime;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column AssetGroupResult.UpdateTime
*
* @mbg.generated
*/
private Date updatetime;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table AssetGroupResult
*
* @mbg.generated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column AssetGroupResult.ID
*
* @return the value of AssetGroupResult.ID
*
* @mbg.generated
*/
public String getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column AssetGroupResult.ID
*
* @param id the value for AssetGroupResult.ID
*
* @mbg.generated
*/
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column AssetGroupResult.AssetName
*
* @return the value of AssetGroupResult.AssetName
*
* @mbg.generated
*/
public String getAssetname() {
return assetname;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column AssetGroupResult.AssetName
*
* @param assetname the value for AssetGroupResult.AssetName
*
* @mbg.generated
*/
public void setAssetname(String assetname) {
this.assetname = assetname == null ? null : assetname.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column AssetGroupResult.AssetGroupID
*
* @return the value of AssetGroupResult.AssetGroupID
*
* @mbg.generated
*/
public String getAssetgroupid() {
return assetgroupid;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column AssetGroupResult.AssetGroupID
*
* @param assetgroupid the value for AssetGroupResult.AssetGroupID
*
* @mbg.generated
*/
public void setAssetgroupid(String assetgroupid) {
this.assetgroupid = assetgroupid == null ? null : assetgroupid.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column AssetGroupResult.AssetDetailGroupID
*
* @return the value of AssetGroupResult.AssetDetailGroupID
*
* @mbg.generated
*/
public String getAssetdetailgroupid() {
return assetdetailgroupid;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column AssetGroupResult.AssetDetailGroupID
*
* @param assetdetailgroupid the value for AssetGroupResult.AssetDetailGroupID
*
* @mbg.generated
*/
public void setAssetdetailgroupid(String assetdetailgroupid) {
this.assetdetailgroupid = assetdetailgroupid == null ? null : assetdetailgroupid.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column AssetGroupResult.TaxDepreciationPeriod
*
* @return the value of AssetGroupResult.TaxDepreciationPeriod
*
* @mbg.generated
*/
public Integer getTaxdepreciationperiod() {
return taxdepreciationperiod;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column AssetGroupResult.TaxDepreciationPeriod
*
* @param taxdepreciationperiod the value for AssetGroupResult.TaxDepreciationPeriod
*
* @mbg.generated
*/
public void setTaxdepreciationperiod(Integer taxdepreciationperiod) {
this.taxdepreciationperiod = taxdepreciationperiod;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column AssetGroupResult.CreateTime
*
* @return the value of AssetGroupResult.CreateTime
*
* @mbg.generated
*/
public Date getCreatetime() {
return createtime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column AssetGroupResult.CreateTime
*
* @param createtime the value for AssetGroupResult.CreateTime
*
* @mbg.generated
*/
public void setCreatetime(Date createtime) {
this.createtime = createtime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column AssetGroupResult.UpdateTime
*
* @return the value of AssetGroupResult.UpdateTime
*
* @mbg.generated
*/
public Date getUpdatetime() {
return updatetime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column AssetGroupResult.UpdateTime
*
* @param updatetime the value for AssetGroupResult.UpdateTime
*
* @mbg.generated
*/
public void setUpdatetime(Date updatetime) {
this.updatetime = updatetime;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table AssetGroupResult
*
* @mbg.generated
*/
@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(", assetname=").append(assetname);
sb.append(", assetgroupid=").append(assetgroupid);
sb.append(", assetdetailgroupid=").append(assetdetailgroupid);
sb.append(", taxdepreciationperiod=").append(taxdepreciationperiod);
sb.append(", createtime=").append(createtime);
sb.append(", updatetime=").append(updatetime);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
......@@ -35,7 +35,7 @@ public class JXFPMX extends FunctionBase implements FreeRefFunction {
@Override
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {
if (args.length < 4) {
return null;
return NumberEval.ZERO;
}
String taxRate = getStringParam(args[0], ec);
......
package pwc.taxtech.atms.vat.service.impl.report.functions;
import org.apache.poi.ss.formula.OperationEvaluationContext;
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.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.constant.enums.EnumOperationType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.KeyValueConfigResultType;
import pwc.taxtech.atms.dto.vatdto.AssetDetailDataSourceDto;
import pwc.taxtech.atms.vat.dao.AssetDetailResultDto;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
/// <summary>
/// 名称:资产
/// 功能:从已经分类的资产数据中获取对应的数据
/// </summary>
/// <param name="assetType">资产类别:1,固定资产;2,长期待摊;3,无形资产</param>
/// <param name="assetDetailType">资产二级分类:见数据库AssetDetailGroup表DetailGroupType字段</param>
/// <param name="dataType">
/// 取值列:1,原值(财务);2,本年折旧额(财务);3,累计折旧额(财务);4,每月折旧额(财务);5,本年年终剩余价值(财务)
/// 6,每月折旧额(税务);7,截止本年累计折旧额(税务);8,本年折旧额(税务);9,累计差异(税务),10,本年差异(税务)
/// </param>
/// <param name="year">年份:0,当年;-1,上一年;1,下一年(以此类推到10)</param>
/// <returns></returns>
public class ZC extends FunctionBase implements FreeRefFunction {
public ZC(FormulaContext formulaContext) {
super(formulaContext);
}
@Override
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {
if (args.length < 4) {
return NumberEval.ZERO;
}
int assetType = getIntParam(args[0], ec);
int assetDetailType = getIntParam(args[1], ec);
int dataType = getIntParam(args[2], ec);
int year = getIntParam(args[3], ec);
String formulaExpression = "ZC(" + assetType + "," + assetDetailType + ","
+ dataType + "," + year + ")";
logger.debug(formulaExpression);
int curYear = formulaContext.getYear() + year;
String dbName =
SpringContextUtil.projectDao.getDbNameWithYearAndOrgID(formulaContext.getOrganizationID(), curYear);
List<AssetDetailResultDto> assetDetailResultDtos =
SpringContextUtil.assetsListMapper.getAssetDetialResult(dbName, assetType, assetDetailType);
List<AssetDetailDataSourceDto> dataSource = new ArrayList<>();
for (AssetDetailResultDto x : assetDetailResultDtos) {
AssetDetailDataSourceDto assetDetailDataSourceDto = new AssetDetailDataSourceDto();
assetDetailDataSourceDto.setResultType(KeyValueConfigResultType.Accounting.getCode());
assetDetailDataSourceDto.setAssetNumber(x.getAssetsList().getAssetgroupname());
assetDetailDataSourceDto.setAssetGroupName(x.getAssetDetailGroup().getDetailgroupname());
assetDetailDataSourceDto.setAccountAcquisitionValue(FormulaHelper.roundValue(x.getAssetsList().getAccountacquisitionvalue(), KeyValueConfigResultType.Accounting, null, formulaContext));
assetDetailDataSourceDto.setAccountMonthDepreciationAmount(FormulaHelper.roundValue(x.getAssetsList().getAccountmonthdepreciationamount(), KeyValueConfigResultType.Accounting, null, formulaContext));
assetDetailDataSourceDto.setAccountYearDepreciationAmount(FormulaHelper.roundValue(x.getAssetsList().getAccountyeardepreciationamount(), KeyValueConfigResultType.Accounting, null, formulaContext));
assetDetailDataSourceDto.setAccountTotalepreciationAmount(FormulaHelper.roundValue(x.getAssetsList().getAccounttotalepreciationamount(), KeyValueConfigResultType.Accounting, null, formulaContext));
assetDetailDataSourceDto.setYearEndValue(FormulaHelper.roundValue(x.getAssetsList().getYearendvalue(), KeyValueConfigResultType.Accounting, null, formulaContext));
assetDetailDataSourceDto.setTaxMonthDepreciationAmount(FormulaHelper.roundValue(x.getAssetsList().getTaxmonthdepreciationamount(), KeyValueConfigResultType.Accounting, null, formulaContext));
assetDetailDataSourceDto.setTaxToCurrentYearDepreciationAmount(FormulaHelper.roundValue(x.getAssetsList().getTaxtocurrentyeardepreciationamount(), KeyValueConfigResultType.Accounting, null, formulaContext));
assetDetailDataSourceDto.setTaxCurrentYearDepreciationAmount(FormulaHelper.roundValue(x.getAssetsList().getTaxcurrentyeardepreciationamount(), KeyValueConfigResultType.Accounting, null, formulaContext));
assetDetailDataSourceDto.setTotalDifferenceAmount(FormulaHelper.roundValue(x.getAssetsList().getTotaldifferenceamount(), KeyValueConfigResultType.Accounting, null, formulaContext));
assetDetailDataSourceDto.setYearDifferenceAmount(FormulaHelper.roundValue(x.getAssetsList().getYeardifferenceamount(), KeyValueConfigResultType.Accounting, null, formulaContext));
assetDetailDataSourceDto.setDepreciationPeriod(x.getAssetsList().getDepreciationperiod());
assetDetailDataSourceDto.setTaxDepreciationPeriod(x.getAssetsList().getTaxdepreciationperiod());
assetDetailDataSourceDto.setIsRetain(x.getAssetsList().getIsretain());
assetDetailDataSourceDto.setDataType(dataType);
assetDetailDataSourceDto.setName(Constant.DataSourceName.AssetListDataSource);
assetDetailDataSourceDto.setOperationType(EnumOperationType.Single.getCode());
dataSource.add(assetDetailDataSourceDto);
}
dataSource = dataSource.stream()
.sorted(Comparator.comparing(AssetDetailDataSourceDto::getAssetGroupName)
.thenComparing(AssetDetailDataSourceDto::getAssetDetailGroupName))
.collect(Collectors.toList());
BigDecimal totalData = new BigDecimal("0");
switch (dataType) {
case 1:
totalData = new BigDecimal(dataSource.stream().mapToDouble(a -> a.getAccountAcquisitionValue().doubleValue()).sum());
break;
case 2:
totalData = new BigDecimal(dataSource.stream().mapToDouble(a -> a.getAccountYearDepreciationAmount().doubleValue()).sum());
break;
case 3:
totalData = new BigDecimal(dataSource.stream().mapToDouble(a -> a.getAccountTotalepreciationAmount().doubleValue()).sum());
break;
case 4:
totalData = new BigDecimal(dataSource.stream().mapToDouble(a -> a.getAccountMonthDepreciationAmount().doubleValue()).sum());
break;
case 5:
totalData = new BigDecimal(dataSource.stream().mapToDouble(a -> a.getYearEndValue().doubleValue()).sum());
break;
case 6:
totalData = new BigDecimal(dataSource.stream().mapToDouble(a -> a.getTaxMonthDepreciationAmount().doubleValue()).sum());
break;
case 7:
totalData = new BigDecimal(dataSource.stream().mapToDouble(a -> a.getTaxToCurrentYearDepreciationAmount().doubleValue()).sum());
break;
case 8:
totalData = new BigDecimal(dataSource.stream().mapToDouble(a -> a.getTaxCurrentYearDepreciationAmount().doubleValue()).sum());
break;
case 9:
dataSource = dataSource.stream().filter(a -> a.getIsRetain() != null && a.getIsRetain()).collect(Collectors.toList());
totalData = new BigDecimal(dataSource.stream().mapToDouble(a -> a.getTotalDifferenceAmount().doubleValue()).sum());
break;
case 10:
dataSource = dataSource.stream().filter(a -> a.getIsRetain() != null && a.getIsRetain()).collect(Collectors.toList());
totalData = new BigDecimal(dataSource.stream().mapToDouble(a -> a.getYearDifferenceAmount().doubleValue()).sum());
break;
default:
break;
}
Long dataSourceId = saveDataSource(ec, Collections.singletonList(dataSource), FormulaDataSourceDetailType.AssetDetailDataSourceDto, totalData);
saveFormulaBlock(0, ec, formulaExpression, totalData, dataSourceId);
return new NumberEval(totalData.doubleValue());
}
}
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