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