Commit e890c39b authored by neo's avatar neo

[dev] add project id form period standard acouunt

parent bc398078
......@@ -26,7 +26,7 @@ public class SpringContextUtil implements ApplicationContextAware {
public static PeriodCellTemplateMapper periodCellTemplateMapper;
public static ProjectServiceTypeMapper projectServiceTypeMapper;
public static PeriodTemplateMapper periodTemplateMapper;
public static VatStandardAccountMapper vatStandardAccountMapper;
public static PeriodStandardAccountMapper periodStandardAccountMapper;
public static ProjectDao projectDao;
public static BalanceMapper balanceMapper;
public static DataSourceMapper dataSourceMapper;
......@@ -66,7 +66,7 @@ public class SpringContextUtil implements ApplicationContextAware {
periodCellTemplateMapper = webApplicationContext.getBean(PeriodCellTemplateMapper.class);
projectServiceTypeMapper = webApplicationContext.getBean(ProjectServiceTypeMapper.class);
periodTemplateMapper = webApplicationContext.getBean(PeriodTemplateMapper.class);
vatStandardAccountMapper = webApplicationContext.getBean(VatStandardAccountMapper.class);
periodStandardAccountMapper = webApplicationContext.getBean(PeriodStandardAccountMapper.class);
projectDao = webApplicationContext.getBean(ProjectDao.class);
balanceMapper = webApplicationContext.getBean(BalanceMapper.class);
dataSourceMapper = webApplicationContext.getBean(DataSourceMapper.class);
......
......@@ -2,7 +2,6 @@ package pwc.taxtech.atms.service.impl;
import com.google.common.base.Predicate;
import com.google.common.collect.Lists;
import org.mybatis.spring.SqlSessionTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -15,7 +14,6 @@ import pwc.taxtech.atms.dao.ProjectClientMapper;
import pwc.taxtech.atms.dao.ProjectMapper;
import pwc.taxtech.atms.dao.ProjectServiceTypeMapper;
import pwc.taxtech.atms.dao.ServiceTypeMapper;
import pwc.taxtech.atms.dao.StandardAccountMapper;
import pwc.taxtech.atms.dao.TemplateGroupMapper;
import pwc.taxtech.atms.dpo.ProjectDisplayDto;
import pwc.taxtech.atms.dto.FieldsMapper;
......@@ -26,9 +24,7 @@ import pwc.taxtech.atms.dto.taxadmin.AddProjectResult;
import pwc.taxtech.atms.dto.taxadmin.ProjectYearParam;
import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.entity.ProjectClientExample.Criteria;
import pwc.taxtech.atms.service.OperationLogService;
import pwc.taxtech.atms.service.ProjectService;
import pwc.taxtech.atms.vat.dao.VatStandardAccountMapper;
import java.util.ArrayList;
import java.util.Calendar;
......@@ -64,17 +60,6 @@ public class ProjectServiceImpl implements ProjectService {
@Autowired
private ProjectServiceTypeMapper projectServiceTypeMapper;
@Autowired
private OperationLogService operationLogService;
@Autowired
private SqlSessionTemplate dynamicSqlSessionTemplate;
@Autowired
private StandardAccountMapper standardAccountMapper;
@Autowired
private VatStandardAccountMapper vatStandardAccountMapper;
@Value("${jdbc_admin_db}")
private String adminDbName;
......
......@@ -20,7 +20,7 @@ public class VatAbstractService {
@Autowired
public VatEnterpriseAccountMapper vatEnterpriseAccountMapper;
@Autowired
public VatStandardAccountMapper vatStandardAccountMapper;
public PeriodStandardAccountMapper periodStandardAccountMapper;
@Autowired
public InputVatInvoiceMapper inputVATInvoiceMapper;
@Autowired
......
......@@ -67,7 +67,8 @@ public class FSJZ extends FunctionBase implements FreeRefFunction {
if (accountType == 0) {
//标准账套
VatStandardAccount vatStandardAccount = SpringContextUtil.vatStandardAccountMapper.selectOneByAccountCode(accountCode);
VatStandardAccount vatStandardAccount = SpringContextUtil.periodStandardAccountMapper.selectOneByAccountCode(accountCode,
formulaContext.getProjectId());
if (vatStandardAccount == null) {
return NumberEval.ZERO;
}
......@@ -132,7 +133,7 @@ public class FSJZ extends FunctionBase implements FreeRefFunction {
}
//todo: sava data
//save datasource
Long dataSourceId = saveDataSource(ec, formulaDataSourceDtoList, FormulaDataSourceDetailType.BSPLFormulaDataSourceDto, val,period,formulaContext.getReportTemplateGroupId());
Long dataSourceId = saveDataSource(ec, formulaDataSourceDtoList, FormulaDataSourceDetailType.BSPLFormulaDataSourceDto, val, period, formulaContext.getReportTemplateGroupId());
//save formulablock
saveFormulaBlock(period, ec, formulaExpression, val, dataSourceId);
......@@ -196,7 +197,7 @@ public class FSJZ extends FunctionBase implements FreeRefFunction {
//todo: sava data
//save datasource
Long dataSourceId = saveDataSource(ec, dsList, FormulaDataSourceDetailType.BSPLFormulaDataSourceDto, val,
period,formulaContext.getReportTemplateGroupId());
period, formulaContext.getReportTemplateGroupId());
//save formulablock
saveFormulaBlock(period, ec, formulaExpression, val, dataSourceId);
return new NumberEval(val.doubleValue());
......
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.TrialBalanceDto;
import pwc.taxtech.atms.vat.entity.PeriodStandardAccount;
import pwc.taxtech.atms.vat.entity.PeriodStandardAccountExample;
import pwc.taxtech.atms.vat.entity.VatStandardAccount;
import java.util.List;
@Mapper
public interface PeriodStandardAccountMapper extends MyVatMapper {
......@@ -105,4 +108,9 @@ public interface PeriodStandardAccountMapper extends MyVatMapper {
* @mbg.generated
*/
int updateByPrimaryKey(PeriodStandardAccount record);
List<TrialBalanceDto> selectProjectStandardAccountLeftJoinBalanceStdManual(@Param("fromMonth") String fromMonth, @Param("toMonth") String toMonth,
@Param("projectId") String projectId);
VatStandardAccount selectOneByAccountCode(@Param("accountCode") String accountCode, @Param("projectId") String projectId);
}
\ No newline at end of file
package pwc.taxtech.atms.vat.dao;
import java.util.List;
import java.util.Map;
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.TrialBalanceDto;
import pwc.taxtech.atms.vat.entity.VatStandardAccount;
import pwc.taxtech.atms.vat.entity.VatStandardAccountExample;
@Mapper
public interface VatStandardAccountMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. StandardAccount
*
* @mbg.generated
*/
long countByExample(VatStandardAccountExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. StandardAccount
*
* @mbg.generated
*/
int deleteByExample(VatStandardAccountExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. StandardAccount
*
* @mbg.generated
*/
int deleteByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. StandardAccount
*
* @mbg.generated
*/
int insert(VatStandardAccount record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. StandardAccount
*
* @mbg.generated
*/
int insertSelective(VatStandardAccount record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. StandardAccount
*
* @mbg.generated
*/
List<VatStandardAccount> selectByExampleWithRowbounds(VatStandardAccountExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. StandardAccount
*
* @mbg.generated
*/
List<VatStandardAccount> selectByExample(VatStandardAccountExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. StandardAccount
*
* @mbg.generated
*/
VatStandardAccount selectByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. StandardAccount
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") VatStandardAccount record, @Param("example") VatStandardAccountExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. StandardAccount
*
* @mbg.generated
*/
int updateByExample(@Param("record") VatStandardAccount record, @Param("example") VatStandardAccountExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. StandardAccount
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(VatStandardAccount record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table TAX_PROJECT. StandardAccount
*
* @mbg.generated
*/
int updateByPrimaryKey(VatStandardAccount record);
List<TrialBalanceDto> selectProjectStandardAccountLeftJoinBalanceStdManual(@Param("fromMonth") String fromMonth, @Param("toMonth") String toMonth);
VatStandardAccount selectOneByAccountCode(@Param("accountCode") String accountCode);
}
\ 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.VatStandardAccountMapper">
<mapper namespace="pwc.taxtech.atms.vat.dao.PeriodStandardAccountMapper">
<resultMap id="TrialBalanceDto" type="pwc.taxtech.atms.dto.vatdto.TrialBalanceDto">
<id column="BalanceId" jdbcType="VARCHAR" property="balanceId"/>
......@@ -52,13 +52,14 @@
A.ACCT_PROP,
A.DIRECTION
FROM
STANDARD_ACCOUNT A
PERIOD_STANDARD_ACCOUNT A
JOIN
BALANCE_STD_MANUAL B
PERIOD_BALANCE_STD_MANUAL B
ON
A.`CODE` = B.ACCT_CODE
WHERE
1=1
AND A.PROJECT_ID= #{projectId,jdbcType=VARCHAR}
<if test="fromMonth!=null">
AND B.PERIOD_ID &gt;= #{fromMonth,jdbcType=VARCHAR}
</if>
......@@ -73,9 +74,11 @@
SELECT
*
FROM
STANDARD_ACCOUNT A
PERIOD_STANDARD_ACCOUNT A
WHERE
A.CODE= #{accountCode,jdbcType=VARCHAR} LIMIT 1
A.CODE= #{accountCode,jdbcType=VARCHAR}
AND A.PROJECT_ID= #{projectId,jdbcType=VARCHAR}
LIMIT 1
</select>
</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