Commit c0432c43 authored by kevin's avatar kevin

#bug

parent 407ac979
package pwc.taxtech.atms.controller;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.jdbc.core.JdbcTemplate;
......@@ -8,22 +9,20 @@ import org.springframework.web.bind.annotation.*;
import pwc.taxtech.atms.dao.CitJournalEntryAdjustMapper;
import pwc.taxtech.atms.dao.CitTbamMapper;
import pwc.taxtech.atms.dao.OperationLogEntryLogMapper;
import pwc.taxtech.atms.dpo.CitTbamDto;
import pwc.taxtech.atms.dto.CitTbamDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.entity.CitJournalEntryAdjust;
import pwc.taxtech.atms.entity.CitTbam;
import pwc.taxtech.atms.entity.OperationLogEntryLog;
import pwc.taxtech.atms.entity.OperationLogEntryLogExample;
import pwc.taxtech.atms.service.impl.DistributedIdService;
import pwc.taxtech.atms.vat.dao.JournalEntryMapper;
import pwc.taxtech.atms.vat.dao.PeriodFormulaBlockMapper;
import pwc.taxtech.atms.vat.entity.CellComment;
import pwc.taxtech.atms.vat.entity.PeriodCellComment;
import pwc.taxtech.atms.vat.entity.PeriodFormulaBlock;
import pwc.taxtech.atms.vat.service.impl.CellCommentServiceImpl;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@RestController
......@@ -40,6 +39,7 @@ public class CellCommentController {
}
return cellCommentService.getCellComments(cellDataId, projectId);
}
@Autowired
private CitTbamMapper citTbamMapper;
@Autowired
......@@ -49,26 +49,34 @@ public class CellCommentController {
private JdbcTemplate jdbcTemplate;
//通过sql获取展示表格展示数据
@RequestMapping(value = "getCellInformation")
public OperationResultDto getCellInformation(String sql){
@RequestMapping(value = "getCellInformation")
public OperationResultDto getCellInformation(String sql) {
OperationResultDto operationResultDto = new OperationResultDto();
int from = sql.indexOf("from");
sql = sql.substring(from);
operationResultDto.setData(citTbamMapper.selectBySql(sql));
List<CitTbam> citTbams = citTbamMapper.selectBySql(sql);
List<CitTbamDto> citTbamDtos = new ArrayList<>();
for (CitTbam citTbam : citTbams) {
CitTbamDto citTbamDto = new CitTbamDto();
BeanUtils.copyProperties(citTbam, citTbamDto);
citTbamDtos.add(citTbamDto);
}
operationResultDto.setData(citTbamDtos);
operationResultDto.setResultMsg("success");
return operationResultDto;
return operationResultDto;
}
//加载分录表格数据
@RequestMapping("loadEntryListDataList")
public OperationResultDto loadEntryListDataList(String code){
public OperationResultDto loadEntryListDataList(String code) {
OperationResultDto operationResultDto = new OperationResultDto();
CitJournalEntryAdjust citJournalEntryAdjust = new CitJournalEntryAdjust();
citJournalEntryAdjust.setSubjectCode(code);
List<CitJournalEntryAdjust> journalMerge = citJournalEntryAdjustMapper.getJournalMerge(citJournalEntryAdjust);
operationResultDto.setData(journalMerge);
operationResultDto.setResultMsg("success");
return operationResultDto;
return operationResultDto;
}
@Autowired
......@@ -78,21 +86,25 @@ public class CellCommentController {
private OperationLogEntryLogMapper operationLogEntryLogMapper;
@Autowired
private DistributedIdService distributedIdService;
//更新调整后金额
@RequestMapping("updateAdjust")
public OperationResultDto updateAdjust(@RequestBody CitTbam[] citTbams){
@RequestMapping(value = "updateAdjust", method = RequestMethod.POST,
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public OperationResultDto updateAdjust(@RequestBody List<CitTbamDto> citTbams) {
OperationResultDto operationResultDto = new OperationResultDto();
CitTbam citTbam = new CitTbam();
for(CitTbam citTbam1 : citTbams){
citTbam.setId(citTbam1.getId());
citTbamMapper.updateByPrimaryKey(citTbam);
for (CitTbamDto citTbamDto : citTbams) {
BeanUtils.copyProperties(citTbamDto, citTbam);
citTbam.setId(citTbam.getId());
citTbam.setAdjustAccount(citTbam.getAdjustAccount());
citTbamMapper.updateByPrimaryKeySelective(citTbam);
}
operationResultDto.setResultMsg("success");
return operationResultDto;
}
@RequestMapping("selectEntryLog")
public OperationResultDto selectEntryLog(String code){
public OperationResultDto selectEntryLog(String code) {
OperationResultDto operationResultDto = new OperationResultDto();
OperationLogEntryLogExample operationLogEntryLogExample = new OperationLogEntryLogExample();
OperationLogEntryLogExample.Criteria criteria = operationLogEntryLogExample.createCriteria();
......@@ -105,8 +117,8 @@ public class CellCommentController {
* 添加日志
*/
@RequestMapping("addLog")
public OperationResultDto addLog(@RequestBody OperationLogEntryLog[] operationLogEntryLogs ){
for(OperationLogEntryLog operationLogEntryLog : operationLogEntryLogs){
public OperationResultDto addLog(@RequestBody List<OperationLogEntryLog> operationLogEntryLogs) {
for (OperationLogEntryLog operationLogEntryLog : operationLogEntryLogs) {
operationLogEntryLogMapper.insert(operationLogEntryLog);
}
OperationResultDto<Object> objectOperationResultDto = new OperationResultDto<>();
......
package pwc.taxtech.atms.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import pwc.taxtech.atms.common.util.PwCIdSerialize;
import pwc.taxtech.atms.entity.BaseEntity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
*
* This class was generated by MyBatis Generator.
* This class corresponds to the database table cit_tbam
*
* @mbg.generated do_not_delete_during_merge
*/
public class CitTbamDto implements Serializable {
/**
* Database Column Remarks:
* 唯一编号
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cit_tbam.id
*
* @mbg.generated
*/
@JsonSerialize(using = PwCIdSerialize.class)
private Long id;
/**
* Database Column Remarks:
* 机构编号
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cit_tbam.organization_id
*
* @mbg.generated
*/
private String organizationId;
private Long adjustAccount;
public Long getAdjustAccount() {
return adjustAccount;
}
public void setAdjustAccount(Long adjustAccount) {
this.adjustAccount = adjustAccount;
}
/**
* Database Column Remarks:
* 项目ID
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cit_tbam.project_id
*
* @mbg.generated
*/
private String projectId;
/**
* Database Column Remarks:
* 数据日期
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cit_tbam.date
*
* @mbg.generated
*/
private Date date;
/**
* Database Column Remarks:
* 来源
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cit_tbam.source
*
* @mbg.generated
*/
private String source;
/**
* Database Column Remarks:
* 期间 yyyymm(区分卡片年份的期间,系统设计要求必有字段)
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cit_tbam.period
*
* @mbg.generated
*/
private Integer period;
/**
* Database Column Remarks:
* 期间 yyyymm
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cit_tbam.account_period
*
* @mbg.generated
*/
private Integer accountPeriod;
/**
* Database Column Remarks:
* 小类
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cit_tbam.attribute
*
* @mbg.generated
*/
private String attribute;
/**
* Database Column Remarks:
* 科目代码
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cit_tbam.account_code
*
* @mbg.generated
*/
private String accountCode;
/**
* Database Column Remarks:
* 科目说明
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cit_tbam.account_description
*
* @mbg.generated
*/
private String accountDescription;
/**
* Database Column Remarks:
* 借方发生额
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cit_tbam.debit_amount
*
* @mbg.generated
*/
private BigDecimal debitAmount;
/**
* Database Column Remarks:
* 贷方发生额
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cit_tbam.credit_amount
*
* @mbg.generated
*/
private BigDecimal creditAmount;
/**
* Database Column Remarks:
* 期初余额
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cit_tbam.beginning_balance
*
* @mbg.generated
*/
private BigDecimal beginningBalance;
/**
* Database Column Remarks:
* 期末余额
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cit_tbam.ending_balance
*
* @mbg.generated
*/
private BigDecimal endingBalance;
/**
* Database Column Remarks:
* 创建人
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cit_tbam.create_by
*
* @mbg.generated
*/
private String createBy;
/**
* Database Column Remarks:
* 创建时间
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cit_tbam.create_time
*
* @mbg.generated
*/
private Date createTime;
/**
* Database Column Remarks:
* 更新时间
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column cit_tbam.update_time
*
* @mbg.generated
*/
private Date updateTime;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table cit_tbam
*
* @mbg.generated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_tbam.id
*
* @return the value of cit_tbam.id
*
* @mbg.generated
*/
public Long getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cit_tbam.id
*
* @param id the value for cit_tbam.id
*
* @mbg.generated
*/
public void setId(Long id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_tbam.organization_id
*
* @return the value of cit_tbam.organization_id
*
* @mbg.generated
*/
public String getOrganizationId() {
return organizationId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cit_tbam.organization_id
*
* @param organizationId the value for cit_tbam.organization_id
*
* @mbg.generated
*/
public void setOrganizationId(String organizationId) {
this.organizationId = organizationId == null ? null : organizationId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_tbam.project_id
*
* @return the value of cit_tbam.project_id
*
* @mbg.generated
*/
public String getProjectId() {
return projectId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cit_tbam.project_id
*
* @param projectId the value for cit_tbam.project_id
*
* @mbg.generated
*/
public void setProjectId(String projectId) {
this.projectId = projectId == null ? null : projectId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_tbam.date
*
* @return the value of cit_tbam.date
*
* @mbg.generated
*/
public Date getDate() {
return date;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cit_tbam.date
*
* @param date the value for cit_tbam.date
*
* @mbg.generated
*/
public void setDate(Date date) {
this.date = date;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_tbam.source
*
* @return the value of cit_tbam.source
*
* @mbg.generated
*/
public String getSource() {
return source;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cit_tbam.source
*
* @param source the value for cit_tbam.source
*
* @mbg.generated
*/
public void setSource(String source) {
this.source = source == null ? null : source.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_tbam.period
*
* @return the value of cit_tbam.period
*
* @mbg.generated
*/
public Integer getPeriod() {
return period;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cit_tbam.period
*
* @param period the value for cit_tbam.period
*
* @mbg.generated
*/
public void setPeriod(Integer period) {
this.period = period;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_tbam.account_period
*
* @return the value of cit_tbam.account_period
*
* @mbg.generated
*/
public Integer getAccountPeriod() {
return accountPeriod;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cit_tbam.account_period
*
* @param accountPeriod the value for cit_tbam.account_period
*
* @mbg.generated
*/
public void setAccountPeriod(Integer accountPeriod) {
this.accountPeriod = accountPeriod;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_tbam.attribute
*
* @return the value of cit_tbam.attribute
*
* @mbg.generated
*/
public String getAttribute() {
return attribute;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cit_tbam.attribute
*
* @param attribute the value for cit_tbam.attribute
*
* @mbg.generated
*/
public void setAttribute(String attribute) {
this.attribute = attribute == null ? null : attribute.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_tbam.account_code
*
* @return the value of cit_tbam.account_code
*
* @mbg.generated
*/
public String getAccountCode() {
return accountCode;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cit_tbam.account_code
*
* @param accountCode the value for cit_tbam.account_code
*
* @mbg.generated
*/
public void setAccountCode(String accountCode) {
this.accountCode = accountCode == null ? null : accountCode.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_tbam.account_description
*
* @return the value of cit_tbam.account_description
*
* @mbg.generated
*/
public String getAccountDescription() {
return accountDescription;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cit_tbam.account_description
*
* @param accountDescription the value for cit_tbam.account_description
*
* @mbg.generated
*/
public void setAccountDescription(String accountDescription) {
this.accountDescription = accountDescription == null ? null : accountDescription.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_tbam.debit_amount
*
* @return the value of cit_tbam.debit_amount
*
* @mbg.generated
*/
public BigDecimal getDebitAmount() {
return debitAmount;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cit_tbam.debit_amount
*
* @param debitAmount the value for cit_tbam.debit_amount
*
* @mbg.generated
*/
public void setDebitAmount(BigDecimal debitAmount) {
this.debitAmount = debitAmount;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_tbam.credit_amount
*
* @return the value of cit_tbam.credit_amount
*
* @mbg.generated
*/
public BigDecimal getCreditAmount() {
return creditAmount;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cit_tbam.credit_amount
*
* @param creditAmount the value for cit_tbam.credit_amount
*
* @mbg.generated
*/
public void setCreditAmount(BigDecimal creditAmount) {
this.creditAmount = creditAmount;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_tbam.beginning_balance
*
* @return the value of cit_tbam.beginning_balance
*
* @mbg.generated
*/
public BigDecimal getBeginningBalance() {
return beginningBalance;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cit_tbam.beginning_balance
*
* @param beginningBalance the value for cit_tbam.beginning_balance
*
* @mbg.generated
*/
public void setBeginningBalance(BigDecimal beginningBalance) {
this.beginningBalance = beginningBalance;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_tbam.ending_balance
*
* @return the value of cit_tbam.ending_balance
*
* @mbg.generated
*/
public BigDecimal getEndingBalance() {
return endingBalance;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cit_tbam.ending_balance
*
* @param endingBalance the value for cit_tbam.ending_balance
*
* @mbg.generated
*/
public void setEndingBalance(BigDecimal endingBalance) {
this.endingBalance = endingBalance;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_tbam.create_by
*
* @return the value of cit_tbam.create_by
*
* @mbg.generated
*/
public String getCreateBy() {
return createBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cit_tbam.create_by
*
* @param createBy the value for cit_tbam.create_by
*
* @mbg.generated
*/
public void setCreateBy(String createBy) {
this.createBy = createBy == null ? null : createBy.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column cit_tbam.create_time
*
* @return the value of cit_tbam.create_time
*
* @mbg.generated
*/
public Date getCreateTime() {
return createTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cit_tbam.create_time
*
* @param createTime the value for cit_tbam.create_time
*
* @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 cit_tbam.update_time
*
* @return the value of cit_tbam.update_time
*
* @mbg.generated
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column cit_tbam.update_time
*
* @param updateTime the value for cit_tbam.update_time
*
* @mbg.generated
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table cit_tbam
*
* @mbg.generated
*/
@Override
public String toString() {
return "CitTbam{" +
"id=" + id +
", organizationId='" + organizationId + '\'' +
", adjustAccount=" + adjustAccount +
", projectId='" + projectId + '\'' +
", date=" + date +
", source='" + source + '\'' +
", period=" + period +
", accountPeriod=" + accountPeriod +
", attribute='" + attribute + '\'' +
", accountCode='" + accountCode + '\'' +
", accountDescription='" + accountDescription + '\'' +
", debitAmount=" + debitAmount +
", creditAmount=" + creditAmount +
", beginningBalance=" + beginningBalance +
", endingBalance=" + endingBalance +
", createBy='" + createBy + '\'' +
", createTime=" + createTime +
", updateTime=" + updateTime +
'}';
}
}
\ No newline at end of file
......@@ -22,6 +22,7 @@ import pwc.taxtech.atms.vat.entity.*;
import pwc.taxtech.atms.vat.service.impl.report.functions.FormulaContext;
import java.math.BigDecimal;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
......@@ -146,7 +147,7 @@ public class FormulaAgent {
public static String buildSql(String tableName, String getField, String filter, String filterValue, Integer period, String year, FormulaContext formulaContext) {
public static String buildSql(String tableName, String getField, String filter, String filterValue, Integer period, Integer year, FormulaContext formulaContext) {
/*
if (split[0].indexOf(">=") != -1) {
......@@ -174,8 +175,13 @@ public class FormulaAgent {
}
public static String _buildSql(String getField, String tableName, String filter, String filterValue, Integer period, FormulaContext formulaContext, String year, boolean bool, boolean getSql) throws Exception {
public static String _buildSql(String getField, String tableName, String filter, String filterValue, Integer period, FormulaContext formulaContext, Integer year, boolean bool, boolean getSql) throws Exception {
String sql = "";
//统一判断年度
Calendar cal = Calendar.getInstance();
int currentYear = cal.get(Calendar.YEAR);
year = currentYear + year;
if(getSql){
tableName = tableName.toLowerCase();
sql = "select * from " + tableName + " where 1=1 and " + filter + filterValue;
......@@ -183,7 +189,6 @@ public class FormulaAgent {
}else{
sql = "select sum(" + getField + ") as " + getField + " from " + tableName + " where 1=1 and " + filter + filterValue;
}
String _p = insertZero(formulaContext.getPeriod() - Math.abs(period));
String _period = insertZero(formulaContext.getPeriod());
String per = insertZero((formulaContext.getPeriod() - 1));
......@@ -219,15 +224,15 @@ public class FormulaAgent {
@Autowired
JdbcTemplate jdbcTemplate;
/*
public static void main(String[] args) {
FormulaAgent formulaAgent = new FormulaAgent();
FormulaContext formulaContext = new FormulaContext();
formulaContext.setPeriod(3);
formulaAgent.getTableDataByName("CIT_TBAM", "ending_balance", "attribute", "= '销售费用-财产损耗、盘亏及毁损损失'", 0, "2018", formulaContext);
}*/
formulaAgent.getTableDataByName("CIT_TBAM", "ending_balance", "attribute", "= '销售费用-财产损耗、盘亏及毁损损失'", 0, 0, null);
}
public BigDecimal getTableDataByName(String tableName, String getField, String filter, String filterValue, Integer period, String year, FormulaContext formulaContext) {
public BigDecimal getTableDataByName(String tableName, String getField, String filter, String filterValue, Integer period, Integer year, FormulaContext formulaContext) {
Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(buildSql(TableRule.map.get(tableName), getField, filter, filterValue, period, year, formulaContext));
......
......@@ -57,7 +57,7 @@ public class RSUMIF extends FunctionBase implements FreeRefFunction {
Integer argsLength;
String getField;
Integer period;
String year;
Integer year;
@Override
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {
......@@ -75,8 +75,8 @@ public class RSUMIF extends FunctionBase implements FreeRefFunction {
getField = resolverString(args, ec, 1);
filter= resolverString(args, ec, 2);
filterValue= resolverString(args, ec, 3);
period = resolverInteger(args, ec, 4);//会计期间
year = resolverString(args, ec, 5);//会计年度
year = resolverInteger(args, ec, 4);//会计年度
period = Integer.parseInt(resolverString(args, ec, 5));//会计期间
cellValue = agent.getTableDataByName(tableName, getField, filter, filterValue, period, year, formulaContext);
return new NumberEval(cellValue.doubleValue());
} catch (EvaluationException e) {
......
......@@ -5,7 +5,6 @@ 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.dpo.CitTbamDto;
import pwc.taxtech.atms.entity.CitTbam;
import pwc.taxtech.atms.entity.CitTbamExample;
......@@ -115,5 +114,5 @@ public interface CitTbamMapper extends MyMapper {
*/
int insertBatch(List<CitTbam> citTbamList);
List<CitTbamDto> selectBySql(@Param("sql") String sql);
List<CitTbam> selectBySql(@Param("sql") String sql);
}
\ No newline at end of file
package pwc.taxtech.atms.dpo;
import pwc.taxtech.atms.entity.CitTbam;
/**
* @ClassName CitTbamDto
* Description TODO
* @Author pwc kevin
* @Date 3/15/2019 3:46 PM
* Version 1.0
**/
public class CitTbamDto extends CitTbam {
}
......@@ -22,6 +22,7 @@ public class CitTbam extends BaseEntity implements Serializable {
*
* @mbg.generated
*/
private Long id;
/**
......
......@@ -431,6 +431,9 @@
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="adjustAccount != null">
adjust_account = #{adjustAccount,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
......
......@@ -82,7 +82,7 @@
SELECT 1 FROM DUAL;
</insert>
<select id="selectBySql" parameterType="java.lang.String" resultType="pwc.taxtech.atms.dpo.CitTbamDto">
<select id="selectBySql" parameterType="java.lang.String" resultType="pwc.taxtech.atms.entity.CitTbam">
select
id as id,
attribute attribute,
......@@ -91,7 +91,8 @@
debit_amount as debitAmount ,
credit_amount as creditAmount,
beginning_balance as beginningBalance,
IFNULL(adjust_account, ending_balance) as endingBalance
adjust_account as adjustAccount,
ending_balance as endingBalance
<if test="sql != null and sql != '' ">
${sql}
</if>
......
......@@ -611,11 +611,9 @@
else if (_.isNumber(newVal) && !isNaN(newVal)) {
newVal = newVal.toFixed(4);
}
if(x.keyinData){
sheet.setValue(x.rowIndex, x.columnIndex, x.keyinData);
}
var oldVal = x.value;
oldVal = PWC.tryParseStringToNum(oldVal);
if (_.isBoolean(oldVal)) {
......
......@@ -1212,7 +1212,6 @@
// 更新spreadjs计算所需datasource信息
$scope.updateCellByManualChange = function (manualData) {
debugger;
var cellData = _.find($scope.reportData, function (x) {
return x.cellTemplateID == manualData.cellTemplateId
|| x.cellID === manualData.cellId;
......@@ -1326,8 +1325,8 @@
$scope.manualDataSources.push({item1: manualData.cellTemplateId, item2: manualData});
}
// 刷新spreadsheet,获取操作数据源后最新的计算结果,并拿来与当前所有单元格value比较,得到value修改前后的值对比
var updatedCells = $scope.reportApi.refreshReport();
loadCellData(getActualPeriod());
var updatedCells = $scope.reportApi.refreshReport();
};
$scope.updateCellBySourceDetailDelete = function (dataSource, detailId, opType) {
......
......@@ -14,6 +14,7 @@
//关闭数据源弹出框
var hidePanel = function () {
$scope.selectedDataSourceTabIndex = 1;
$scope.tabType = 1;
......@@ -228,14 +229,13 @@
}
$scope.hidePanel();
vatCommonService.setProjectStatus(vatSessionService.project.id, vatSessionService.month, status, null, null);
if ($scope.detail.cellType == enums.formulaDataSourceType.CIT_TBAM) {//
[$scope.detail.entryIndex].adjustBack
if ($scope.detail.cellType == enums.formulaDataSourceType.CIT_TBAM) {
var updateAdjustDto = [];
$scope.detail.dataGridSourceBind.forEach(function (e, index) {
if (e.adjustBack != undefined && e.adjustBack != null) {
updateAdjustDto.push({
id: e.id,
adjustAccount: e.adjustBack
"id": e.id,
"adjustAccount": Number(e.adjustBack)
});
}
});
......@@ -245,9 +245,8 @@
});
}
}).error(function (error) {
if (error) {
if (error)
alert("调整金额数据更新失败");
}
});
}
};
......@@ -641,7 +640,7 @@
};
//弹框表格右下角合计值
var getConclusionVal = function () {
var getConclusionVal = function (type) {
var precition = 2;
//如果数值是份数类型,则精度为0,否则为2
if ($scope.detail.dataType === 5) {
......@@ -710,7 +709,7 @@
}, 0);
$("#dataGridFooterSummary").html($translate.instant('Conclusion')
+ '&nbsp;&nbsp;&nbsp;&nbsp;' + evalVal.formatAmount(precition));
} else if ($scope.selectedTabIndex === enums.formulaDataSourceType.CIT_TBAM) {
} else if ($scope.selectedTabIndex === enums.formulaDataSourceType.CIT_TBAM && type == true) {
calculateSum(null);
}
else { // For 报表数据源 and BSPL数据源
......@@ -1526,7 +1525,7 @@
alignment: 'left'
},
{
dataField: 'adjustBack',
dataField: 'adjustAccount',
caption: $translate.instant('BackAdjustAmount'),
alignment: 'left'
}
......@@ -1540,7 +1539,6 @@
$scope.$watch('relObj.checkRadio', function (n, o) {
if ($scope.detail.entryIndex != undefined) {
$scope.detail.dataGridSourceBind[$scope.detail.entryIndex].adjustBack = n;
$scope.detail.dataGridSourceBind[$scope.detail.entryIndex].isBack = true;
calculateSum(n);
}
});
......@@ -1567,11 +1565,9 @@
} else {
for (var i = 0, j = $scope.detail.dataGridSourceBind.length; i < j; i++) {
s = $scope.detail.dataGridSourceBind[i].adjustAccount;
if (s == null && $scope.detail.dataGridSourceBind[$scope.detail.entryIndex].isBack == undefined) {
evalVal += $scope.detail.dataGridSourceBind[$scope.detail.entryIndex].endingBalance;
} else if (s != null && $scope.detail.dataGridSourceBind[$scope.detail.entryIndex].isBack == undefined) {
evalVal += s;
} else {
if(s == null){
evalVal += $scope.detail.dataGridSourceBind[i].endingBalance;
}else{
evalVal += s;
}
}
......@@ -2295,14 +2291,14 @@
});
$scope.dataGridColumns = getDataGridColumns();
getConclusionVal();
getConclusionVal(false);
}, 500);
});
var getBlowGridData = function (data) {
cellCommentService.getCellInformation(data).success(function (res) {
if (res.resultMsg) {
$scope.detail.dataGridSourceBind = res.data;
calculateSum(null);
getConclusionVal(true);
}
}).error(function (error) {
});
......
......@@ -18,7 +18,7 @@ webservices.factory('cellCommentService', ['$http', 'apiConfig', function ($http
return $http.get('/CellComment/loadEntryListDataList?code=' + code, apiConfig.createVat());
},
updateAdjust : function (data) {
return $http.post('/CellComment/updateAdjust', data, apiConfig.createVat());
return $http.post('/CellComment/updateAdjust', JSON.stringify(data), apiConfig.createVat({contentType: 'application/json;charset=UTF-8'}));
},
selectEntryLog : function (code) {
return $http.get('/CellComment/selectEntryLog?code=' + code, apiConfig.createVat());
......
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