Commit 698f9c26 authored by frank.xa.zhang's avatar frank.xa.zhang

add period_cell_comment replace cell_comment

parent 00112873
......@@ -27,6 +27,7 @@ public class SpringContextUtil implements ApplicationContextAware {
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;
......@@ -67,6 +68,7 @@ public class SpringContextUtil implements ApplicationContextAware {
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);
......
......@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.vat.entity.CellComment;
import pwc.taxtech.atms.vat.entity.PeriodCellComment;
import pwc.taxtech.atms.vat.service.impl.CellCommentServiceImpl;
import java.util.List;
......@@ -20,7 +21,7 @@ public class CellCommentController {
CellCommentServiceImpl cellCommentService;
@RequestMapping(value = "List", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto<List<CellComment>> getCellComments(@RequestParam("cellDataId") Optional<Long> cellDataId) {
public OperationResultDto<List<PeriodCellComment>> getCellComments(@RequestParam("cellDataId") Optional<Long> cellDataId) {
return cellCommentService.getCellComments(cellDataId);
}
}
......@@ -2,15 +2,14 @@ package pwc.taxtech.atms.vat.service.impl;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.vat.entity.CellComment;
import pwc.taxtech.atms.vat.entity.CellCommentExample;
import pwc.taxtech.atms.vat.entity.*;
import java.util.List;
import java.util.Optional;
@Service
public class CellCommentServiceImpl extends VatAbstractService {
public OperationResultDto<List<CellComment>> getCellComments(Optional<Long> cellDataId) {
public OperationResultDto<List<PeriodCellComment>> getCellComments(Optional<Long> cellDataId) {
OperationResultDto resultDto = new OperationResultDto();
try {
if (!cellDataId.isPresent() || cellDataId.get() == 0L) {
......@@ -19,9 +18,9 @@ public class CellCommentServiceImpl extends VatAbstractService {
return resultDto;
}
CellCommentExample example = new CellCommentExample();
PeriodCellCommentExample example = new PeriodCellCommentExample();
example.createCriteria().andCellDataIdEqualTo(cellDataId.get());
List<CellComment> cellComments = cellCommentMapper.selectByExample(example);
List<PeriodCellComment> cellComments = periodCellCommentMapper.selectByExample(example);
resultDto.setResult(true);
resultDto.setData(cellComments);
} catch (Exception ex) {
......
......@@ -78,7 +78,7 @@ public class VatAbstractService {
@Autowired
public ModifiedReportCellMapper modifiedReportCellMapper;
@Autowired
public CellCommentMapper cellCommentMapper;
public PeriodCellCommentMapper periodCellCommentMapper;
@Autowired
public KeyValueConfigMapper keyValueConfigMapper;
@Autowired
......
......@@ -68,6 +68,7 @@ public class FSJZ extends FunctionBase implements FreeRefFunction {
if (accountType == 0) {
//标准账套
VatStandardAccount vatStandardAccount = SpringContextUtil.vatStandardAccountMapper.selectOneByAccountCode(accountCode);
//VatStandardAccount vatStandardAccount = SpringContextUtil.periodStandardAccountMapper.selectOneByAccountCode(accountCode);
if (vatStandardAccount == null) {
return NumberEval.ZERO;
}
......
......@@ -5,8 +5,10 @@ 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;
@Mapper
public interface PeriodStandardAccountMapper extends MyVatMapper {
......@@ -105,4 +107,8 @@ public interface PeriodStandardAccountMapper extends MyVatMapper {
* @mbg.generated
*/
int updateByPrimaryKey(PeriodStandardAccount 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.PeriodStandardAccountMapper">
<resultMap id="TrialBalanceDto" type="pwc.taxtech.atms.vat.dpo.TrialBalanceDto">
<id column="BalanceId" jdbcType="VARCHAR" property="balanceId"/>
<result column="PERIOD_ID" jdbcType="INTEGER" property="periodId"/>
<result column="ACCT_CODE" jdbcType="VARCHAR" property="acctCode"/>
<result column="CUSTOMER_CODE" jdbcType="VARCHAR" property="customerCode"/>
<result column="BEG_DEBIT_BAL" jdbcType="DECIMAL" property="begDebitBal"/>
<result column="BEG_BAL" jdbcType="DECIMAL" property="begBal"/>
<result column="END_BAL" jdbcType="DECIMAL" property="endBal"/>
<result column="END_DEBIT_BAL" jdbcType="DECIMAL" property="endDebitBal"/>
<result column="END_CREDIT_BAL" jdbcType="DECIMAL" property="endCreditBal"/>
<result column="DEBIT_BAL" jdbcType="DECIMAL" property="debitBal"/>
<result column="CREDIT_BAL" jdbcType="DECIMAL" property="creditBal"/>
<result column="MONTH_ID" jdbcType="INTEGER" property="monthId"/>
<result column="YEAR_DEBIT_BAL" jdbcType="DECIMAL" property="yearDebitBal"/>
<result column="PARENT_CODE" jdbcType="VARCHAR" property="parentCode"/>
<result column="ACCOUNT_NAME" jdbcType="VARCHAR" property="accountName"/>
<result column="IS_DUPLICATE" jdbcType="SMALLINT" property="isDuplicate"/>
<result column="ACCT_PROP" jdbcType="INTEGER" property="acctProp"/>
<result column="DIRECTION" jdbcType="INTEGER" property="direction"/>
</resultMap>
<select id="selectProjectStandardAccountLeftJoinBalanceStdManual" resultMap="TrialBalanceDto">
SELECT DISTINCT
B.PERIOD_ID,
B.ACCT_CODE,
'' AS CUSTOMER_CODE,
B.BEG_DEBIT_BAL,
B.BEG_CREDIT_BAL,
B.BEG_BAL,
B.END_BAL,
B.END_DEBIT_BAL,
B.END_CREDIT_BAL,
B.DEBIT_BAL,
B.CREDIT_BAL,
B.PERIOD_ID AS MONTH_ID,
B.YEAR_DEBIT_BAL,
B.YEAR_CREDIT_BAL,
IF (
ISNULL (
A.PARENT_CODE
)
|| A.PARENT_CODE = '',
'0',
A.PARENT_CODE
)
AS PARENT_CODE,
A.`_NAME_` AS ACCOUNT_NAME,
A.ACCT_PROP,
A.DIRECTION
FROM
STANDARD_ACCOUNT A
JOIN
BALANCE_STD_MANUAL B
ON
A.`CODE` = B.ACCT_CODE
WHERE
1=1
<if test="fromMonth!=null">
AND B.PERIOD_ID &gt;= #{fromMonth,jdbcType=VARCHAR}
</if>
<if test="toMonth!=null">
AND B.PERIOD_ID &lt;= #{toMonth,jdbcType=VARCHAR}
</if>
ORDER BY
B.PERIOD_ID
</select>
<select id="selectOneByAccountCode" parameterType="java.lang.String" resultMap="BaseResultMap">
SELECT
*
FROM
STANDARD_ACCOUNT A
WHERE
A.CODE= #{accountCode,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