Commit 121566c6 authored by sherlock's avatar sherlock

Merge branch 'dev_oracle' into 'dev_oracle_sherlock'

# Conflicts:
#   atms-api/src/main/java/pwc/taxtech/atms/service/impl/TemplateGroupServiceImpl.java
parents ff8cdc20 5b4cc79a
...@@ -381,6 +381,38 @@ ...@@ -381,6 +381,38 @@
<scope>system</scope> <scope>system</scope>
<systemPath>${basedir}/lib/soap-client-1.0.jar</systemPath> <systemPath>${basedir}/lib/soap-client-1.0.jar</systemPath>
</dependency> </dependency>
<!--CXF-->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-core</artifactId>
<version>3.2.6</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-wsdl</artifactId>
<version>3.2.6</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-bindings-soap</artifactId>
<version>3.2.6</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-databinding-jaxb</artifactId>
<version>3.2.6</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>3.2.6</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>3.2.6</version>
</dependency>
<!--CXF END-->
</dependencies> </dependencies>
<profiles> <profiles>
......
...@@ -105,4 +105,12 @@ public final class Constant { ...@@ -105,4 +105,12 @@ public final class Constant {
public static class ReplaceKeyword { public static class ReplaceKeyword {
public static final String KEY_IN = "${KeyIn}"; //手工数据源 public static final String KEY_IN = "${KeyIn}"; //手工数据源
} }
/**
* SimpleDateFormat
*/
public static class DateFormat {
public static final String DEFAULT = "yyyy-MM-dd";
public static final String YEAR_MONTH = "yyyy-MM";
}
} }
\ No newline at end of file
...@@ -48,4 +48,31 @@ public class StdAccountEnum { ...@@ -48,4 +48,31 @@ public class StdAccountEnum {
} }
} }
} }
public enum Direction {
Debit(1, "借方"),
Credit(-1, "贷方");
private Integer code;
private String name;
public static final Map<Integer, String> MAPPING = new HashMap<>();
Direction(Integer code, String name) {
this.code = code;
this.name = name;
}
public Integer getCode() {
return code;
}
public String getName() {
return name;
}
static {
for (Direction direction : Direction.values()) {
MAPPING.put(direction.getCode(), direction.getName());
}
}
}
} }
...@@ -50,12 +50,21 @@ public class AtmsExceptionHandler extends ResponseEntityExceptionHandler { ...@@ -50,12 +50,21 @@ public class AtmsExceptionHandler extends ResponseEntityExceptionHandler {
} }
@ExceptionHandler(value = Throwable.class) @ExceptionHandler(value = Throwable.class)
public ApiResultDto handle(HttpServletResponse response) { public void handle(Throwable throwable, HttpServletResponse response) {
return ApiResultDto.fail("error."); throwable.printStackTrace();
//noinspection Duplicates
try {
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json; charset=UTF-8");
response.getWriter().write(JSON.toJSONString(ApiResultDto.fail(throwable.getMessage())));
} catch (IOException e) {
logger.error("customHandle error.", e);
}
} }
@ExceptionHandler(value = ServiceException.class) @ExceptionHandler(value = ServiceException.class)
public void customHandle(pwc.taxtech.atms.common.ServiceException exception, HttpServletResponse response) { public void customHandle(pwc.taxtech.atms.common.ServiceException exception, HttpServletResponse response) {
//noinspection Duplicates
try { try {
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
response.setContentType("application/json; charset=UTF-8"); response.setContentType("application/json; charset=UTF-8");
......
package pwc.taxtech.atms.controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pwc.taxtech.atms.dpo.PagingDto;
import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.dto.PagingResultDto;
import pwc.taxtech.atms.dto.vatdto.TrialBalanceDto;
import pwc.taxtech.atms.dto.vatdto.TrialBalanceParam;
import pwc.taxtech.atms.service.impl.DataImportService;
import pwc.taxtech.atms.service.impl.LgGlBalanceService;
import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping("/api/v1/DataImport/")
public class DataImportController extends BaseController {
@Resource
private DataImportService dataImportService;
@Resource
private LgGlBalanceService lgGlBalanceService;
@PostMapping("GetBalanceDataForDisplay")
public PagingResultDto<TrialBalanceDto> getBalanceDataForDisplay(@RequestBody TrialBalanceParam param) {
PagingResultDto<TrialBalanceDto> resultDto = new PagingResultDto<>();
List<TrialBalanceDto> list = dataImportService.getBalanceDataForDisplay(param);
PagingDto pagingDto = new PagingDto();
// pagingDto.setPageIndex(1);
// pagingDto.setPageSize(100);
// pagingDto.setTotalCount(list);
resultDto.setPageInfo(pagingDto);
resultDto.setList(list);
resultDto.setCalculateData(dataImportService.calculateData(list));
return resultDto;
}
@PostMapping("queryGlBalance")
public ApiResultDto queryGlBalance(@RequestBody TrialBalanceParam param) {
ApiResultDto resultDto = new ApiResultDto();
lgGlBalanceService.queryGlBalance(param.getOrgId(), param.getFromPeriod(), param.getToPeriod());
return resultDto;
}
}
...@@ -90,6 +90,14 @@ public class AccountMappingDao { ...@@ -90,6 +90,14 @@ public class AccountMappingDao {
return mapper.selectByExample(example); return mapper.selectByExample(example);
} }
public List<AccountMapping> getAccountMapping(String epAccountSetId, String orgId) {
AccountMappingExample example = new AccountMappingExample();
AccountMappingExample.Criteria criteria = example.createCriteria();
criteria.andEnterpriseAccountSetIdEqualTo(epAccountSetId);
criteria.andOrganizationIdEqualTo(orgId);
return mapper.selectByExample(example);
}
public void delMapping(String epAccountCode, String epAccountSetId, String orgId, String industryId) { public void delMapping(String epAccountCode, String epAccountSetId, String orgId, String industryId) {
AccountMappingExample example = new AccountMappingExample(); AccountMappingExample example = new AccountMappingExample();
AccountMappingExample.Criteria criteria = example.createCriteria(); AccountMappingExample.Criteria criteria = example.createCriteria();
......
...@@ -5,7 +5,9 @@ import org.springframework.stereotype.Service; ...@@ -5,7 +5,9 @@ import org.springframework.stereotype.Service;
import pwc.taxtech.atms.entity.EnterpriseAccountSetOrg; import pwc.taxtech.atms.entity.EnterpriseAccountSetOrg;
import pwc.taxtech.atms.entity.EnterpriseAccountSetOrgExample; import pwc.taxtech.atms.entity.EnterpriseAccountSetOrgExample;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Optional;
@Service @Service
public class EnterpriseAccountSetOrgDao { public class EnterpriseAccountSetOrgDao {
...@@ -19,4 +21,18 @@ public class EnterpriseAccountSetOrgDao { ...@@ -19,4 +21,18 @@ public class EnterpriseAccountSetOrgDao {
criteria.andEnterpriseAccountSetIdEqualTo(accountSetId); criteria.andEnterpriseAccountSetIdEqualTo(accountSetId);
return mapper.selectByExample(example); return mapper.selectByExample(example);
} }
/**
* 查询当前有效配置
*
* @param orgId orgId
* @return Optional<EnterpriseAccountSetOrg>
*/
public Optional<EnterpriseAccountSetOrg> getByOrganization(String orgId) {
Date now = new Date();
EnterpriseAccountSetOrgExample example = new EnterpriseAccountSetOrgExample();
example.createCriteria().andOrganizationIdEqualTo(orgId).andEffectiveDateLessThanOrEqualTo(now)
.andExpiredDateGreaterThan(now);
return mapper.selectByExample(example).stream().findFirst();
}
} }
...@@ -2,6 +2,7 @@ package pwc.taxtech.atms.dto.vatdto; ...@@ -2,6 +2,7 @@ package pwc.taxtech.atms.dto.vatdto;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
public class TrialBalanceDto { public class TrialBalanceDto {
private String balanceId; private String balanceId;
...@@ -34,9 +35,10 @@ public class TrialBalanceDto { ...@@ -34,9 +35,10 @@ public class TrialBalanceDto {
private boolean isDuplicate; private boolean isDuplicate;
private Integer acctProp; private Integer acctProp;
private int direction; private int direction;
private List<TrialBalanceDto> children;
public String getBalanceId() { public String getBalanceId() {
return balanceId; return this.balanceId;
} }
public void setBalanceId(String balanceId) { public void setBalanceId(String balanceId) {
...@@ -44,7 +46,7 @@ public class TrialBalanceDto { ...@@ -44,7 +46,7 @@ public class TrialBalanceDto {
} }
public Integer getPeriodId() { public Integer getPeriodId() {
return periodId; return this.periodId;
} }
public void setPeriodId(Integer periodId) { public void setPeriodId(Integer periodId) {
...@@ -52,11 +54,7 @@ public class TrialBalanceDto { ...@@ -52,11 +54,7 @@ public class TrialBalanceDto {
} }
public String getAcctCode() { public String getAcctCode() {
return acctCode; return this.acctCode;
}
public int getAccotCodeLength() {
return acctCode.length();
} }
public void setAcctCode(String acctCode) { public void setAcctCode(String acctCode) {
...@@ -64,7 +62,7 @@ public class TrialBalanceDto { ...@@ -64,7 +62,7 @@ public class TrialBalanceDto {
} }
public String getCustomerCode() { public String getCustomerCode() {
return customerCode; return this.customerCode;
} }
public void setCustomerCode(String customerCode) { public void setCustomerCode(String customerCode) {
...@@ -73,7 +71,7 @@ public class TrialBalanceDto { ...@@ -73,7 +71,7 @@ public class TrialBalanceDto {
@Nullable @Nullable
public BigDecimal getBegDebitBal() { public BigDecimal getBegDebitBal() {
return begDebitBal; return this.begDebitBal;
} }
public void setBegDebitBal(@Nullable BigDecimal begDebitBal) { public void setBegDebitBal(@Nullable BigDecimal begDebitBal) {
...@@ -82,7 +80,7 @@ public class TrialBalanceDto { ...@@ -82,7 +80,7 @@ public class TrialBalanceDto {
@Nullable @Nullable
public BigDecimal getBegCreditBal() { public BigDecimal getBegCreditBal() {
return begCreditBal; return this.begCreditBal;
} }
public void setBegCreditBal(@Nullable BigDecimal begCreditBal) { public void setBegCreditBal(@Nullable BigDecimal begCreditBal) {
...@@ -91,7 +89,7 @@ public class TrialBalanceDto { ...@@ -91,7 +89,7 @@ public class TrialBalanceDto {
@Nullable @Nullable
public BigDecimal getBegBal() { public BigDecimal getBegBal() {
return begBal; return this.begBal;
} }
public void setBegBal(@Nullable BigDecimal begBal) { public void setBegBal(@Nullable BigDecimal begBal) {
...@@ -100,7 +98,7 @@ public class TrialBalanceDto { ...@@ -100,7 +98,7 @@ public class TrialBalanceDto {
@Nullable @Nullable
public BigDecimal getEndBal() { public BigDecimal getEndBal() {
return endBal; return this.endBal;
} }
public void setEndBal(@Nullable BigDecimal endBal) { public void setEndBal(@Nullable BigDecimal endBal) {
...@@ -109,7 +107,7 @@ public class TrialBalanceDto { ...@@ -109,7 +107,7 @@ public class TrialBalanceDto {
@Nullable @Nullable
public BigDecimal getEndDebitBal() { public BigDecimal getEndDebitBal() {
return endDebitBal; return this.endDebitBal;
} }
public void setEndDebitBal(@Nullable BigDecimal endDebitBal) { public void setEndDebitBal(@Nullable BigDecimal endDebitBal) {
...@@ -118,7 +116,7 @@ public class TrialBalanceDto { ...@@ -118,7 +116,7 @@ public class TrialBalanceDto {
@Nullable @Nullable
public BigDecimal getEndCreditBal() { public BigDecimal getEndCreditBal() {
return endCreditBal; return this.endCreditBal;
} }
public void setEndCreditBal(@Nullable BigDecimal endCreditBal) { public void setEndCreditBal(@Nullable BigDecimal endCreditBal) {
...@@ -127,7 +125,7 @@ public class TrialBalanceDto { ...@@ -127,7 +125,7 @@ public class TrialBalanceDto {
@Nullable @Nullable
public BigDecimal getDebitBal() { public BigDecimal getDebitBal() {
return debitBal; return this.debitBal;
} }
public void setDebitBal(@Nullable BigDecimal debitBal) { public void setDebitBal(@Nullable BigDecimal debitBal) {
...@@ -136,7 +134,7 @@ public class TrialBalanceDto { ...@@ -136,7 +134,7 @@ public class TrialBalanceDto {
@Nullable @Nullable
public BigDecimal getCreditBal() { public BigDecimal getCreditBal() {
return creditBal; return this.creditBal;
} }
public void setCreditBal(@Nullable BigDecimal creditBal) { public void setCreditBal(@Nullable BigDecimal creditBal) {
...@@ -144,16 +142,25 @@ public class TrialBalanceDto { ...@@ -144,16 +142,25 @@ public class TrialBalanceDto {
} }
public Integer getMonthId() { public Integer getMonthId() {
return monthId; return this.monthId;
} }
public void setMonthId(Integer monthId) { public void setMonthId(Integer monthId) {
this.monthId = monthId; this.monthId = monthId;
} }
@Nullable
public BigDecimal getYearDebitBal() {
return this.yearDebitBal;
}
public void setYearDebitBal(@Nullable BigDecimal yearDebitBal) {
this.yearDebitBal = yearDebitBal;
}
@Nullable @Nullable
public BigDecimal getYearCreditBal() { public BigDecimal getYearCreditBal() {
return yearCreditBal; return this.yearCreditBal;
} }
public void setYearCreditBal(@Nullable BigDecimal yearCreditBal) { public void setYearCreditBal(@Nullable BigDecimal yearCreditBal) {
...@@ -161,7 +168,7 @@ public class TrialBalanceDto { ...@@ -161,7 +168,7 @@ public class TrialBalanceDto {
} }
public String getParentCode() { public String getParentCode() {
return parentCode; return this.parentCode;
} }
public void setParentCode(String parentCode) { public void setParentCode(String parentCode) {
...@@ -169,23 +176,23 @@ public class TrialBalanceDto { ...@@ -169,23 +176,23 @@ public class TrialBalanceDto {
} }
public String getAccountName() { public String getAccountName() {
return accountName; return this.accountName;
} }
public void setAccountName(String accountName) { public void setAccountName(String accountName) {
this.accountName = accountName; this.accountName = accountName;
} }
public boolean isDuplicate() { public boolean getIsDuplicate() {
return isDuplicate; return this.isDuplicate;
} }
public void setDuplicate(boolean duplicate) { public void setIsDuplicate(boolean duplicate) {
isDuplicate = duplicate; this.isDuplicate = duplicate;
} }
public Integer getAcctProp() { public Integer getAcctProp() {
return acctProp; return this.acctProp;
} }
public void setAcctProp(Integer acctProp) { public void setAcctProp(Integer acctProp) {
...@@ -193,19 +200,18 @@ public class TrialBalanceDto { ...@@ -193,19 +200,18 @@ public class TrialBalanceDto {
} }
public int getDirection() { public int getDirection() {
return direction; return this.direction;
} }
public void setDirection(int direction) { public void setDirection(int direction) {
this.direction = direction; this.direction = direction;
} }
@Nullable public List<TrialBalanceDto> getChildren() {
public BigDecimal getYearDebitBal() { return this.children;
return yearDebitBal;
} }
public void setYearDebitBal(@Nullable BigDecimal yearDebitBal) { public void setChildren(List<TrialBalanceDto> children) {
this.yearDebitBal = yearDebitBal; this.children = children;
} }
} }
package pwc.taxtech.atms.dto.vatdto;
public class TrialBalanceParam {
private String category;
private String criteria;
private String orgId;
private Integer fromPeriod;
private Integer toPeriod;
public String getCategory() {
return this.category;
}
public void setCategory(String category) {
this.category = category;
}
public String getCriteria() {
return this.criteria;
}
public void setCriteria(String criteria) {
this.criteria = criteria;
}
public Integer getFromPeriod() {
return this.fromPeriod;
}
public void setFromPeriod(Integer fromPeriod) {
this.fromPeriod = fromPeriod;
}
public Integer getToPeriod() {
return this.toPeriod;
}
public void setToPeriod(Integer toPeriod) {
this.toPeriod = toPeriod;
}
public String getOrgId() {
return this.orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
}
package pwc.taxtech.atms.service.impl;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.config.SystemConfig;
import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.constant.enums.StdAccountEnum;
import pwc.taxtech.atms.dao.*;
import pwc.taxtech.atms.dto.vatdto.TrialBalanceDto;
import pwc.taxtech.atms.dto.vatdto.TrialBalanceParam;
import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.vat.dao.GlBalanceMapper;
import pwc.taxtech.atms.vat.entity.GlBalance;
import pwc.taxtech.atms.vat.entity.GlBalanceExample;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class DataImportService extends BaseService {
@Resource
private GlBalanceMapper glBalanceMapper;
@Resource
private OrganizationMapper organizationMapper;
@Resource
private StandardAccountMapper standardAccountMapper;
@Resource
private SystemConfig systemConfig;
@Resource
private EnterpriseAccountSetOrgDao enterpriseAccountSetOrgDao;
@Resource
private AccountMappingDao accountMappingDao;
/**
* TB表查询
*
* @param param TrialBalanceParam
* @return List<TrialBalanceDto>
*/
public List<TrialBalanceDto> getBalanceDataForDisplay(TrialBalanceParam param) {
if (!ObjectUtils.allNotNull(param, param.getFromPeriod(), param.getToPeriod()) || StringUtils.isBlank(param.getOrgId())) {
return Collections.emptyList();
}
Organization organization = organizationMapper.selectByPrimaryKey(param.getOrgId());
if (null == organization) {
return Collections.emptyList();
}
Optional<EnterpriseAccountSetOrg> accountSetOrg = enterpriseAccountSetOrgDao.getByOrganization(organization.getId());
if (!accountSetOrg.isPresent()) {
return Collections.emptyList();
}
// mapping
List<AccountMapping> mappingList = accountMappingDao.getAccountMapping(accountSetOrg.get().getEnterpriseAccountSetId(),
organization.getId());
List<String> etCodeList = mappingList.stream().map(AccountMapping::getEnterpriseAccountCode).distinct().collect(Collectors.toList());
Map<String, List<AccountMapping>> mappingMap = mappingList.stream().collect(Collectors.groupingBy(AccountMapping::getStandardAccountCode));
//standard account
StandardAccountExample stdExample = new StandardAccountExample();
stdExample.createCriteria().andIsLeafEqualTo(Boolean.TRUE);
List<StandardAccount> stdAccountList = standardAccountMapper.selectByExample(stdExample);
Calendar calendar = Calendar.getInstance();
SimpleDateFormat dateFormat = new SimpleDateFormat(Constant.DateFormat.YEAR_MONTH);
Map<String, TrialBalanceDto> resultStdMap = new HashMap<>();
for (int i = param.getFromPeriod(); i <= param.getToPeriod(); i++) {
calendar.set(Calendar.MONTH, i - 1);
GlBalanceExample example = new GlBalanceExample();
//科目段
example.createCriteria().andSegment1EqualTo(organization.getClientCode())
.andPeriodNameEqualTo(dateFormat.format(calendar.getTime())).andSegment3In(etCodeList);
List<GlBalance> sg3List = glBalanceMapper.selectByExample(example);
GlBalanceExample example2 = new GlBalanceExample();
//明细段
example2.createCriteria().andSegment1EqualTo(organization.getClientCode())
.andPeriodNameEqualTo(dateFormat.format(calendar.getTime())).andSegment4In(etCodeList);
List<GlBalance> sg4List = glBalanceMapper.selectByExample(example2);
for (StandardAccount standardAccount : stdAccountList) {
if (!resultStdMap.containsKey(standardAccount.getCode())) {
resultStdMap.put(standardAccount.getCode(), new TrialBalanceDto());
}
// if (!mappingMap.containsKey(standardAccount.getCode())) {
// continue;
// }
TrialBalanceDto dto = resultStdMap.get(standardAccount.getCode());
dto.setChildren(Collections.emptyList());
dto.setAcctCode(standardAccount.getCode());
dto.setAccountName(standardAccount.getName());
List<AccountMapping> tmp = mappingMap.get(standardAccount.getCode());
if (CollectionUtils.isEmpty(tmp)) {
continue;
}
tmp.forEach(o -> {
if (StdAccountEnum.Direction.Credit.getCode().equals(standardAccount.getDirection())) {
dto.setCreditBal(add(dto.getCreditBal(), getGlBalance(o.getEnterpriseAccountCode(), sg3List, sg4List).getPtdCr()));
dto.setBegCreditBal(add(dto.getBegCreditBal(), getGlBalance(o.getEnterpriseAccountCode(), sg3List, sg4List).getBeginCrBalance()));
dto.setEndCreditBal(add(dto.getEndCreditBal(), getGlBalance(o.getEnterpriseAccountCode(), sg3List, sg4List).getEndCrBalance()));
dto.setYearCreditBal(add(dto.getYearCreditBal(), getGlBalance(o.getEnterpriseAccountCode(), sg3List, sg4List).getYtdCr()));
} else {
dto.setDebitBal(add(dto.getDebitBal(), getGlBalance(o.getEnterpriseAccountCode(), sg3List, sg4List).getPtdDr()));
dto.setBegDebitBal(add(dto.getBegDebitBal(), getGlBalance(o.getEnterpriseAccountCode(), sg3List, sg4List).getBeginDrBalance()));
dto.setEndDebitBal(add(dto.getEndDebitBal(), getGlBalance(o.getEnterpriseAccountCode(), sg3List, sg4List).getEndDrBalance()));
dto.setYearDebitBal(add(dto.getYearDebitBal(), getGlBalance(o.getEnterpriseAccountCode(), sg3List, sg4List).getYtdDr()));
}
});
}
}
return new ArrayList<>(resultStdMap.values()).stream().sorted(Comparator.comparing(TrialBalanceDto::getAcctCode))
.collect(Collectors.toList());
}
private BigDecimal add(BigDecimal v1, BigDecimal v2) {
v1 = null == v1 ? BigDecimal.ZERO : v1;
v2 = null == v2 ? BigDecimal.ZERO : v2;
return v1.add(v2);
}
private GlBalance getGlBalance(String code, List<GlBalance> seg3, List<GlBalance> seg4) {
for (GlBalance balance : seg3) {
if (StringUtils.equals(code, balance.getAttr3())) {
return balance;
}
}
for (GlBalance balance : seg4) {
if (StringUtils.equals(code, balance.getAttr3())) {
return balance;
}
}
return new GlBalance();
}
/**
* 计算总和
*
* @param list List<TrialBalanceDto>
* @return TrialBalanceDto
*/
public TrialBalanceDto calculateData(List<TrialBalanceDto> list) {
TrialBalanceDto dto = new TrialBalanceDto();
list.forEach(o -> {
dto.setCreditBal(add(dto.getCreditBal(), o.getCreditBal()));
dto.setBegCreditBal(add(dto.getBegCreditBal(), o.getBegCreditBal()));
dto.setEndCreditBal(add(dto.getEndCreditBal(), o.getEndCreditBal()));
dto.setYearCreditBal(add(dto.getYearCreditBal(), o.getYearCreditBal()));
dto.setDebitBal(add(dto.getDebitBal(), o.getDebitBal()));
dto.setBegDebitBal(add(dto.getBegDebitBal(), o.getBegDebitBal()));
dto.setEndDebitBal(add(dto.getEndDebitBal(), o.getEndDebitBal()));
dto.setYearDebitBal(add(dto.getYearDebitBal(), o.getYearDebitBal()));
});
return dto;
}
}
...@@ -10,14 +10,18 @@ import org.apache.commons.lang3.StringUtils; ...@@ -10,14 +10,18 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.ServiceException; import pwc.taxtech.atms.common.ServiceException;
import pwc.taxtech.atms.common.config.SystemConfig; import pwc.taxtech.atms.common.config.SystemConfig;
import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.dao.EnterpriseAccountMapper; import pwc.taxtech.atms.dao.EnterpriseAccountMapper;
import pwc.taxtech.atms.dao.EnterpriseAccountSetOrgMapper; import pwc.taxtech.atms.dao.EnterpriseAccountSetOrgMapper;
import pwc.taxtech.atms.dao.OrganizationMapper;
import pwc.taxtech.atms.entity.*; import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.vat.dao.GlBalanceMapper; import pwc.taxtech.atms.vat.dao.GlBalanceMapper;
import pwc.taxtech.atms.vat.entity.GlBalance; import pwc.taxtech.atms.vat.entity.GlBalance;
import pwc.taxtech.atms.vat.entity.GlBalanceExample; import pwc.taxtech.atms.vat.entity.GlBalanceExample;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -31,6 +35,8 @@ public class LgGlBalanceService extends BaseService { ...@@ -31,6 +35,8 @@ public class LgGlBalanceService extends BaseService {
private EnterpriseAccountSetOrgMapper setOrgMapper; private EnterpriseAccountSetOrgMapper setOrgMapper;
@Resource @Resource
private GlBalanceMapper glBalanceMapper; private GlBalanceMapper glBalanceMapper;
@Resource
private OrganizationMapper organizationMapper;
/** /**
* 科目余额数据同步 * 科目余额数据同步
...@@ -82,4 +88,34 @@ public class LgGlBalanceService extends BaseService { ...@@ -82,4 +88,34 @@ public class LgGlBalanceService extends BaseService {
} }
} }
/**
* 科目余额数据同步
*
* @param orgId String
* @param period YYYY-MM
* @throws ServiceException ex
*/
public void queryGlBalance(String orgId, String period) throws ServiceException {
Organization org = organizationMapper.selectByPrimaryKey(orgId);
if (null == org) {
return;
}
queryGlBalance(org, period);
}
/**
* @param orgId String
* @param fromPeriod Integer
* @param toPeriod Integer
* @throws ServiceException ex
*/
public void queryGlBalance(String orgId, Integer fromPeriod, Integer toPeriod) throws ServiceException {
Calendar calendar = Calendar.getInstance();
for (int i = fromPeriod; i <= toPeriod; i++) {
calendar.set(Calendar.MONTH, i - 1);
SimpleDateFormat dateFormat = new SimpleDateFormat(Constant.DateFormat.YEAR_MONTH);
queryGlBalance(orgId, dateFormat.format(calendar.getTime()));
}
}
} }
...@@ -534,7 +534,10 @@ public class TemplateGroupServiceImpl extends AbstractService { ...@@ -534,7 +534,10 @@ public class TemplateGroupServiceImpl extends AbstractService {
if (null == cell) { if (null == cell) {
return false; return false;
} }
cell.setCellType(CellType.STRING); CellType cellType = cell.getCellTypeEnum();
if (!CellType.STRING.equals(cellType)) {
return false;
}
String v = cell.getStringCellValue(); String v = cell.getStringCellValue();
if (StringUtils.isBlank(v)) { if (StringUtils.isBlank(v)) {
return false; return false;
......
jdbc_url=jdbc:oracle:thin:@10.158.230.144:11521:XE jdbc_url=jdbc:oracle:thin:@10.158.230.144:11521:XE
jdbc_user=TAX_ADMIN jdbc_user=tax_admin_longi
jdbc_password=taxadmin2018 jdbc_password=tax_admin_longi
#jdbc_password=111111 #jdbc_password=111111
jdbc_admin_db=tax_admin jdbc_admin_db=tax_admin_longi
#jdbc_url=jdbc:oracle:thin:@10.158.230.144:11521:XE #jdbc_url=jdbc:oracle:thin:@10.158.230.144:11521:XE
#jdbc_user=tax_admin_longi #jdbc_user=tax_admin_longi
......
jdbc_url=jdbc:sqlserver://192.168.1.102:1434;DatabaseName=QATaxAdmin8 jdbc_url=jdbc:oracle:thin:@10.0.1.49:1521:TaxTEST
jdbc_user=sa jdbc_user=tax_admin
jdbc_password=atmsunittestSQL jdbc_password=taxadmin2018
jdbc_admin_db=QATaxAdmin8 #jdbc_password=111111
jdbc_admin_db=tax_admin
jdbc_url_demo=jdbc:mysql://10.157.107.89:3306/demo_db_name?useUnicode=true&amp;characterEncoding=utf-8&amp;zeroDateTimeBehavior=convertToNull&amp;allowMultiQueries=true jdbc2_url=jdbc:oracle:thin:@10.0.1.49:1521:TaxTEST
jdbc2_user=pwc_invoice
jdbc2_password=pwc_invoice
jdbc2_admin_db=pwc_invoice
jdbc_url_demo=jdbc:mysql://10.158.230.144:3306/demo_db_name?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false
mail_jdbc_url=jdbc:sqlserver://192.168.1.102:1434;DatabaseName=MAILMaster mail_jdbc_url=jdbc:sqlserver://192.168.1.102:1434;DatabaseName=MAILMaster
mail_jdbc_user=sa mail_jdbc_user=sa
mail_jdbc_password=atmsunittestSQL mail_jdbc_password=atmsunittestSQL
web.url=http://192.168.1.102:10000 web.url=http://etms.longi-silicon.com:8081
#web.url=*
jwt.base64Secret=TXppQjFlZFBSbnJzMHc0Tg== jwt.base64Secret=TXppQjFlZFBSbnJzMHc0Tg==
jwt.powerToken= jwt.powerToken=xxxx
jwt.expireSecond=1800 jwt.expireSecond=180000
jwt.refreshSecond=900 jwt.refreshSecond=600
#File Server Config #File Server Config
file.server.url=http://10.158.230.144:1886 file.server.url=http://etms.longi-silicon.com:9111
file.server.upload=/api/v1/upload file.server.upload=/api/v1/upload
#upload #upload
max_file_length=104857600 max_file_length=104857600
#Distributed ID Generate #Distributed ID Generate
distributed_id_datacenter=1 distributed_id_datacenter=10
distributed_id_machine=1 distributed_id_machine=10
\ No newline at end of file
api.url=http://etms.longi-silicon.com:8181
# Longi config
longi_api_basic_user=
longi_api_basic_pwd=
longi_api_gl_balance=http://soatest01.longi.com:8011/ETMSSB/Erp/GLBalance/ProxyServices/ErpQueryGLBalanceSoapProxy?wsdl
...@@ -2,16 +2,34 @@ package pwc.taxtech.atms.common; ...@@ -2,16 +2,34 @@ package pwc.taxtech.atms.common;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.*;
import org.junit.Test; import org.junit.Test;
import pwc.taxtech.atms.CommonIT; import pwc.taxtech.atms.CommonIT;
import pwc.taxtech.atms.entity.StandardAccount; import pwc.taxtech.atms.entity.StandardAccount;
import pwc.taxtech.atms.invoice.InputInvoiceDetailMapper;
import pwc.taxtech.atms.invoice.InputInvoiceMapper;
import pwc.taxtech.atms.invoice.OutputInvoiceDetailMapper;
import pwc.taxtech.atms.invoice.OutputInvoiceMapper;
import pwc.taxtech.atms.vat.entity.*;
import javax.annotation.Resource;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.List; import java.util.List;
import java.util.Optional;
public class DataInitTest extends CommonIT { public class DataInitTest extends CommonIT {
@Resource
private InputInvoiceMapper inputInvoiceMapper;
@Resource
private InputInvoiceDetailMapper inputInvoiceDetailMapper;
@Resource
private OutputInvoiceMapper outputInvoiceMapper;
@Resource
private OutputInvoiceDetailMapper outputInvoiceDetailMapper;
@Test @Test
public void initStandardAccount() { public void initStandardAccount() {
...@@ -73,7 +91,154 @@ public class DataInitTest extends CommonIT { ...@@ -73,7 +91,154 @@ public class DataInitTest extends CommonIT {
} }
} }
@Test
public void initInput() throws Exception {
Workbook workbook = WorkbookFactory.create(new File("C:\\Users\\Eddie Wu\\Desktop\\导入/导入模板_进项主表_绿能_201809.xls"));
Sheet sheet = workbook.getSheetAt(0);
for (int r = 1; r <= sheet.getLastRowNum(); r++) {
try {
for (int c = 0; c <= sheet.getRow(r).getLastCellNum(); c++) {
Cell cell = sheet.getRow(r).getCell(c);
if (null != cell) {
cell.setCellType(CellType.STRING);
}
}
InputInvoice invoice = new InputInvoice();
invoice.setID(CommonUtils.getUUID());
invoice.setFPDM(sheet.getRow(r).getCell(1).getStringCellValue());
invoice.setFPHM(sheet.getRow(r).getCell(2).getStringCellValue());
invoice.setKPRQ(sheet.getRow(r).getCell(3).getStringCellValue());
invoice.setGFSH(sheet.getRow(r).getCell(4).getStringCellValue());
invoice.setGFMC(sheet.getRow(r).getCell(5).getStringCellValue());
invoice.setXFSH(sheet.getRow(r).getCell(8).getStringCellValue());
invoice.setXFMC(sheet.getRow(r).getCell(9).getStringCellValue());
invoice.setFPLX(sheet.getRow(r).getCell(13).getStringCellValue());
invoice.setHJJE(sheet.getRow(r).getCell(16).getStringCellValue());
invoice.setHJSE(sheet.getRow(r).getCell(17).getStringCellValue());
invoice.setJSHJ(sheet.getRow(r).getCell(18).getStringCellValue());
invoice.setFPZT(sheet.getRow(r).getCell(27).getStringCellValue());
invoice.setCYZT(sheet.getRow(r).getCell(28).getStringCellValue());
invoice.setRZZT(sheet.getRow(r).getCell(29).getStringCellValue());
invoice.setRZSQ(sheet.getRow(r).getCell(30).getStringCellValue());
invoice.setRZSJ(sheet.getRow(r).getCell(31).getStringCellValue());
invoice.setRZJG(sheet.getRow(r).getCell(32).getStringCellValue());
invoice.setCJSJ(sheet.getRow(r).getCell(34).getStringCellValue());
invoice.setLRRQ(sheet.getRow(r).getCell(38).getStringCellValue());
inputInvoiceMapper.insertSelective(invoice);
} catch (Exception e) {
e.printStackTrace();
}
}
System.out.println("end");
}
@Test
public void initInputDetail() throws Exception {
Workbook workbook = WorkbookFactory.create(new File("C:\\Users\\Eddie Wu\\Desktop\\导入/导入模板_进项明细_绿能_201809.xls"));
Sheet sheet = workbook.getSheetAt(0);
for (int r = 1; r <= sheet.getLastRowNum(); r++) {
try {
for (int c = 0; c <= sheet.getRow(r).getLastCellNum(); c++) {
Cell cell = sheet.getRow(r).getCell(c);
if (null != cell) {
cell.setCellType(CellType.STRING);
}
}
InputInvoiceDetail detail = new InputInvoiceDetail();
detail.setID(CommonUtils.getUUID());
detail.setFPDM(sheet.getRow(r).getCell(1).getStringCellValue());
detail.setFPHM(sheet.getRow(r).getCell(2).getStringCellValue());
detail.setSPMC(sheet.getRow(r).getCell(3).getStringCellValue());
detail.setDW(sheet.getRow(r).getCell(5).getStringCellValue());
detail.setDJ(sheet.getRow(r).getCell(6).getStringCellValue());
detail.setSPSL(sheet.getRow(r).getCell(7).getStringCellValue());
detail.setJE(sheet.getRow(r).getCell(8).getStringCellValue());
detail.setSLV(String.valueOf(Math.round(Double.valueOf(sheet.getRow(r).getCell(9).getStringCellValue()))));
detail.setSE(sheet.getRow(r).getCell(10).getStringCellValue());
// InputInvoiceExample example = new InputInvoiceExample();
// example.createCriteria().andFPDMEqualTo(detail.getFPDM()).andFPHMEqualTo(detail.getFPHM());
// Optional<InputInvoice> invoiceOptional = inputInvoiceMapper.selectByExample(example).stream().findFirst();
// if (!invoiceOptional.isPresent()) {
// continue;
// }
// detail.setFPID();
inputInvoiceDetailMapper.insertSelective(detail);
} catch (Exception e) {
e.printStackTrace();
}
}
System.out.println("end");
}
@Test
public void initOutput() throws Exception {
Workbook workbook = WorkbookFactory.create(new File("C:\\Users\\Eddie Wu\\Desktop\\导入/导入模板_销项主表_绿能_201809(1).xlsx"));
Sheet sheet = workbook.getSheetAt(0);
for (int r = 1; r <= sheet.getLastRowNum(); r++) {
try {
for (int c = 0; c <= sheet.getRow(r).getLastCellNum(); c++) {
Cell cell = sheet.getRow(r).getCell(c);
if (null != cell) {
cell.setCellType(CellType.STRING);
}
}
OutputInvoice outputInvoice = new OutputInvoice();
outputInvoice.setID(CommonUtils.getUUID());
outputInvoice.setFPQQLSH(CommonUtils.getUUID());
outputInvoice.setFPDM(sheet.getRow(r).getCell(2).getStringCellValue());
outputInvoice.setFPHM(sheet.getRow(r).getCell(3).getStringCellValue());
outputInvoice.setKPRQ(sheet.getRow(r).getCell(4).getStringCellValue());
String s = "000" + sheet.getRow(r).getCell(5).getStringCellValue();
outputInvoice.setFPLXDM(s.substring(s.length() - 3, s.length()));
outputInvoice.setGFMC(sheet.getRow(r).getCell(9).getStringCellValue());
outputInvoice.setGFSH(sheet.getRow(r).getCell(10).getStringCellValue());
outputInvoice.setXFSH(sheet.getRow(r).getCell(13).getStringCellValue());
outputInvoice.setXFMC(sheet.getRow(r).getCell(14).getStringCellValue());
outputInvoice.setFPLX(sheet.getRow(r).getCell(23).getStringCellValue());
outputInvoice.setKPZT(sheet.getRow(r).getCell(24).getStringCellValue());
outputInvoice.setFPZT(sheet.getRow(r).getCell(25).getStringCellValue());
outputInvoice.setHJJE(sheet.getRow(r).getCell(33).getStringCellValue());
outputInvoice.setHJSE(sheet.getRow(r).getCell(34).getStringCellValue());
outputInvoice.setJSHJ(sheet.getRow(r).getCell(35).getStringCellValue());
outputInvoice.setSLV(sheet.getRow(r).getCell(42).getStringCellValue());
outputInvoice.setHTBH(sheet.getRow(r).getCell(54).getStringCellValue());
outputInvoiceMapper.insertSelective(outputInvoice);
} catch (Exception e) {
e.printStackTrace();
}
}
System.out.println("end");
}
public static void main(String[] args) { public static void main(String[] args) {
System.out.println(CommonUtils.getUUID()); System.out.println(CommonUtils.getUUID());
try {
Workbook workbook = WorkbookFactory.create(new File("C:\\Users\\Eddie Wu\\Desktop\\导入/导入模板_销项主表_绿能_201809(1).xlsx"));
Sheet sheet = workbook.getSheetAt(0);
for (int r = 1; r <= sheet.getLastRowNum(); r++) {
for (int c = 0; c <= sheet.getRow(r).getLastCellNum(); c++) {
Cell cell = sheet.getRow(r).getCell(c);
if (null != cell) {
cell.setCellType(CellType.STRING);
}
}
OutputInvoiceDetail detail = new OutputInvoiceDetail();
detail.setID(CommonUtils.getUUID());
detail.setSPMC(sheet.getRow(r).getCell(2).getStringCellValue());
detail.setDW(sheet.getRow(r).getCell(4).getStringCellValue());
detail.setDJ(sheet.getRow(r).getCell(5).getStringCellValue());
detail.setSL(sheet.getRow(r).getCell(6).getStringCellValue());
detail.setJE(sheet.getRow(r).getCell(7).getStringCellValue());
detail.setSLV(sheet.getRow(r).getCell(8).getStringCellValue());
detail.setSE(sheet.getRow(r).getCell(9).getStringCellValue());
detail.setMXXH(NumberUtils.createBigDecimal(sheet.getRow(r).getCell(10).getStringCellValue()));
}
sheet.getFirstRowNum();
} catch (IOException e) {
e.printStackTrace();
} catch (InvalidFormatException e) {
e.printStackTrace();
}
} }
} }
api.url=http://192.168.1.102:8180/atms-api api.url=http://etms.longi-silicon.com:8181/
cookie.maxAgeSeconds=86400 cookie.maxAgeSeconds=86400
commonModule.controller('previewTrialBalanceController', ['$scope', '$log', '$translate', '$timeout', 'apiInterceptor', 'Upload', 'dataImportService', 'SweetAlert', '$q', 'uiGridConstants', 'projectService', 'uiGridGroupingConstants', 'vatImportService', 'i18nService', 'browserService', '$interval', 'region', 'citSessionService', 'enums', commonModule.controller('previewTrialBalanceController', ['$scope', '$log', '$translate', '$timeout', 'apiInterceptor', 'Upload', 'dataImportService', 'SweetAlert', '$q', 'uiGridConstants', 'projectService', 'uiGridGroupingConstants', 'vatImportService', 'i18nService', 'browserService', '$interval', 'region', 'citSessionService', 'enums', 'vatSessionService',
function ($scope, $log, $translate, $timeout, apiInterceptor, Upload, dataImportService, SweetAlert, $q, uiGridConstants, projectService, uiGridGroupingConstants, vatImportService, i18nService, browserService, $interval, region, citSessionService, enums) { function ($scope, $log, $translate, $timeout, apiInterceptor, Upload, dataImportService, SweetAlert, $q, uiGridConstants, projectService, uiGridGroupingConstants, vatImportService, i18nService, browserService, $interval, region, citSessionService, enums, vatSessionService) {
'use strict'; 'use strict';
$scope.serviceType = $scope.project.serviceTypeID; $scope.serviceType = $scope.project.serviceTypeID;
...@@ -124,12 +124,19 @@ ...@@ -124,12 +124,19 @@
$scope.isToPrint = true; $scope.isToPrint = true;
$scope.getDataFromDatabase($scope.currentCategory.selected.id, $scope.filterData.periodFrom, $scope.filterData.periodTo, $scope.filterDataCriteria, true); $scope.getDataFromDatabase($scope.currentCategory.selected.id, $scope.filterData.periodFrom, $scope.filterData.periodTo, $scope.filterDataCriteria, true);
} };
$scope.queryGlBalance = function () {
vatImportService.queryGlBalance($scope.filterData.periodFrom, $scope.filterData.periodTo, vatSessionService.project.organizationID)
.success(function (res) {
});
};
// function to get data from Backend // function to get data from Backend
$scope.getDataFromDatabase = function (category, from, to, criteria, isExportOnly) { $scope.getDataFromDatabase = function (category, from, to, criteria, isExportOnly) {
vatImportService.getBalanceDataForDisplay(category, from, to, criteria).success(function (trialBalance) { vatImportService.getBalanceDataForDisplay(category, from, to, criteria, vatSessionService.project.organizationID).success(function (trialBalance) {
var treeData = JSON.parse(trialBalance); var treeData = trialBalance;
writeoutNode(treeData.list, 0, newTree); writeoutNode(treeData.list, 0, newTree);
//check to see if user switch to STD subject: //check to see if user switch to STD subject:
...@@ -172,9 +179,9 @@ ...@@ -172,9 +179,9 @@
newTree = []; newTree = [];
if (treeData && treeData.SubTotals) { if (treeData && treeData.calculateData) {
treeData.SubTotals.TitleName = $translate.instant('Total'); treeData.calculateData.TitleName = $translate.instant('Total');
$scope.subtotals = treeData.SubTotals; $scope.subtotals = treeData.calculateData;
} }
$('.filter-button').popover("hide"); $('.filter-button').popover("hide");
...@@ -272,64 +279,64 @@ ...@@ -272,64 +279,64 @@
columnDefs: [ columnDefs: [
{ {
field: 'accountCode', name: $translate.instant('AccountCode'), headerCellClass: 'dataColumn1', field: 'acctCode', name: $translate.instant('AccountCode'), headerCellClass: 'dataColumn1',
cellTemplate: cellTemplate:
'<div ng-if="row.entity.$$treeLevel==0" class=""><span>{{row.entity.accountCode}}<span></div>' + '<div ng-if="row.entity.$$treeLevel==0" class=""><span>{{row.entity.acctCode}}<span></div>' +
'<div ng-if="row.entity.$$treeLevel==1" class="text-align-left-padding"><span>&nbsp;&nbsp;{{row.entity.accountCode}}<span></div>' + '<div ng-if="row.entity.$$treeLevel==1" class="text-align-left-padding"><span>&nbsp;&nbsp;{{row.entity.acctCode}}<span></div>' +
'<div ng-if="row.entity.$$treeLevel==2" class="text-align-left-padding"><span>&nbsp;&nbsp;&nbsp;&nbsp;{{row.entity.accountCode}}<span></div>' + '<div ng-if="row.entity.$$treeLevel==2" class="text-align-left-padding"><span>&nbsp;&nbsp;&nbsp;&nbsp;{{row.entity.acctCode}}<span></div>' +
'<div ng-if="row.entity.$$treeLevel==3" class="text-align-left-padding"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{row.entity.accountCode}}<span></div>' + '<div ng-if="row.entity.$$treeLevel==3" class="text-align-left-padding"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{row.entity.acctCode}}<span></div>' +
'<div ng-if="row.entity.$$treeLevel==4" class="text-align-left-padding"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{row.entity.accountCode}}<span></div>' '<div ng-if="row.entity.$$treeLevel==4" class="text-align-left-padding"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{row.entity.acctCode}}<span></div>'
}, },
{ {
field: 'accountName', width: 200, name: $translate.instant('AccountName'), headerCellClass: 'dataColumn2', field: 'accountName', width: 200, name: $translate.instant('AccountName'), headerCellClass: 'dataColumn2',
cellTemplate: '<div class=""><span>{{row.entity.accountName}}<span></div>' cellTemplate: '<div class=""><span>{{row.entity.accountName}}<span></div>'
, footerCellTemplate: '<div class=" alignRight margin-right5 margin-top5" >{{grid.appScope.subtotals.TitleName}}: </div>' , footerCellTemplate: '<div class=" alignRight margin-right5 margin-top5" >合计: </div>'
}, },
{ {
field: 'debitOpeningBalance', name: $translate.instant('Debitor'), headerCellClass: 'alignCenter dataColumn3', field: 'begDebitBal', name: $translate.instant('Debitor'), headerCellClass: 'alignCenter dataColumn3',
cellTemplate: '<div class="alignRight margin-right5"><span>{{row.entity.debitOpeningBalance}}</span></div>' cellTemplate: '<div class="alignRight margin-right5"><span>{{row.entity.begDebitBal || "0.00"}}</span></div>'
, footerCellTemplate: '<div class=" alignRight margin-right5 margin-top5" >{{grid.appScope.subtotals.BegDebitBal}}</div>' , footerCellTemplate: '<div class=" alignRight margin-right5 margin-top5" >{{grid.appScope.subtotals.begDebitBal || "0.00"}}</div>'
}, },
{ {
field: 'creditOpeningBalance', name: $translate.instant('Creditor'), headerCellClass: 'alignCenter dataColumn4', field: 'begCreditBal', name: $translate.instant('Creditor'), headerCellClass: 'alignCenter dataColumn4',
cellTemplate: '<div class=" alignRight margin-right5"><span>{{row.entity.creditOpeningBalance}}</span></div>' cellTemplate: '<div class=" alignRight margin-right5"><span>{{row.entity.begCreditBal || "0.00"}}</span></div>'
, footerCellTemplate: '<div class=" alignRight margin-right5 margin-top5" >{{grid.appScope.subtotals.BegCreditBal}}</div>' , footerCellTemplate: '<div class=" alignRight margin-right5 margin-top5" >{{grid.appScope.subtotals.begCreditBal || "0.00"}}</div>'
}, },
{ {
field: 'accumulatedDebitAmount', name: $translate.instant('Debitor') + ' ', headerCellClass: 'alignCenter dataColumn5', field: 'debitBal', name: $translate.instant('Debitor') + ' ', headerCellClass: 'alignCenter dataColumn5',
cellTemplate: '<div class=" alignRight margin-right5"><span>{{row.entity.accumulatedDebitAmount}}</span></div>' cellTemplate: '<div class=" alignRight margin-right5"><span>{{row.entity.debitBal || "0.00"}}</span></div>'
, footerCellTemplate: '<div class=" alignRight margin-right5 margin-top5" >{{grid.appScope.subtotals.DebitBal}}</div>' , footerCellTemplate: '<div class=" alignRight margin-right5 margin-top5" >{{grid.appScope.subtotals.debitBal || "0.00"}}</div>'
}, },
{ {
field: 'accumulatedCreditAmount', name: $translate.instant('Creditor') + ' ', headerCellClass: 'alignCenter dataColumn6', field: 'creditBal', name: $translate.instant('Creditor') + ' ', headerCellClass: 'alignCenter dataColumn6',
cellTemplate: '<div class=" alignRight margin-right5"><span>{{row.entity.accumulatedCreditAmount}}</span></div>' cellTemplate: '<div class=" alignRight margin-right5"><span>{{row.entity.creditBal || "0.00"}}</span></div>'
, footerCellTemplate: '<div class=" alignRight margin-right5 margin-top5" >{{grid.appScope.subtotals.CreditBal}}</div>' , footerCellTemplate: '<div class=" alignRight margin-right5 margin-top5" >{{grid.appScope.subtotals.creditBal || "0.00"}}</div>'
}, },
{ {
field: 'debitClosingBalance', name: $translate.instant('Debitor') + ' ', headerCellClass: 'alignCenter dataColumn7', field: 'endDebitBal', name: $translate.instant('Debitor') + ' ', headerCellClass: 'alignCenter dataColumn7',
cellTemplate: '<div class=" alignRight margin-right5"><span>{{row.entity.debitClosingBalance}}</span></div>' cellTemplate: '<div class=" alignRight margin-right5"><span>{{row.entity.endDebitBal || "0.00"}}</span></div>'
, footerCellTemplate: '<div class="alignRight margin-right5 margin-top5" >{{grid.appScope.subtotals.EndDebitBal}}</div>' , footerCellTemplate: '<div class="alignRight margin-right5 margin-top5" >{{grid.appScope.subtotals.endDebitBal || "0.00"}}</div>'
}, },
{ {
field: 'creditClosingBalance', name: $translate.instant('Creditor') + ' ', headerCellClass: 'alignCenter dataColumn8', field: 'endCreditBal', name: $translate.instant('Creditor') + ' ', headerCellClass: 'alignCenter dataColumn8',
cellTemplate: '<div class=" alignRight margin-right5"><span>{{row.entity.creditClosingBalance}}</span></div>' cellTemplate: '<div class=" alignRight margin-right5"><span>{{row.entity.endCreditBal || "0.00"}}</span></div>'
, footerCellTemplate: '<div class="alignRight margin-right5 margin-top5" >{{grid.appScope.subtotals.EndCreditBal}}</div>' , footerCellTemplate: '<div class="alignRight margin-right5 margin-top5" >{{grid.appScope.subtotals.endCreditBal || "0.00"}}</div>'
} }
] ]
}; };
......
...@@ -3,39 +3,40 @@ ...@@ -3,39 +3,40 @@
<div class="leftFilter"> <div class="leftFilter">
<div class="form-inline" style="height:35px;"> <div class="form-inline" style="height:35px;">
<div class="pull-left" style="display:inline-block"> <div class="pull-left" style="display:inline-block">
<button id="filterButton" class="filter-button margin-left20" <!--<button id="filterButton" class="filter-button margin-left20"-->
atms-popover ng-mouseenter="prepareSummary()" ng-click="showPopover()" <!--atms-popover ng-mouseenter="prepareSummary()" ng-click="showPopover()"-->
popover-container="body" popover-auto-hide="true" data-overwrite="true" <!--popover-container="body" popover-auto-hide="true" data-overwrite="true"-->
use-optimized-placement-algorithm="true" <!--use-optimized-placement-algorithm="true"-->
data-placement="bottom" <!--data-placement="bottom"-->
data-templateurl="/app/common/controls/preview-trial-balance/preview-trial-balance-search.html"> <!--data-templateurl="/app/common/controls/preview-trial-balance/preview-trial-balance-search.html">-->
<i class="fa fa-filter" aria-hidden="true"></i> <!--<i class="fa fa-filter" aria-hidden="true"></i>-->
</button> <!--</button>-->
<div class="marginBottom" style="display:inline-block"> <div class="marginBottom" style="display:inline-block">
<span class="text-bold margin-left20" translate="TrialBalanceTitle"></span> | <!--<span class="text-bold margin-left20" translate="TrialBalanceTitle"></span> |-->
<span class="text-bold margin-left20" translate="JournalQJ"></span>: <span class="text-bold margin-left20" translate="JournalQJ"></span>:
<input type="text" class="form-control input-width-middle" id="input-invoice-period-picker" ng-disabled="{{isReadOnly}}" /> <input type="text" class="form-control input-width-middle" id="input-invoice-period-picker" ng-disabled="{{isReadOnly}}" />
</div> </div>
<span class="text-bold margin-left20" translate="Display"></span>: <!--<span class="text-bold margin-left20" translate="Display"></span>:-->
<div class="ui-select-no-border"> <!--<div class="ui-select-no-border">-->
<ui-select ng-model="currentCategory.selected" on-select="doCategoryChange()" search-enabled="false" style="width:120px;"> <!--<ui-select ng-model="currentCategory.selected" on-select="doCategoryChange()" search-enabled="false" style="width:120px;">-->
<ui-select-match>{{$select.selected.name}}</ui-select-match> <!--<ui-select-match>{{$select.selected.name}}</ui-select-match>-->
<ui-select-choices repeat="cat in categoryList | propsFilter: {name: $select.search}"> <!--<ui-select-choices repeat="cat in categoryList | propsFilter: {name: $select.search}">-->
<div title="{{cat.name}}" ng-bind-html="cat.name"></div> <!--<div title="{{cat.name}}" ng-bind-html="cat.name"></div>-->
</ui-select-choices> <!--</ui-select-choices>-->
</ui-select> <!--</ui-select>-->
</div> <!--</div>-->
<div class="ui-select-no-border margin-left20"> <!--<div class="ui-select-no-border margin-left20">-->
<input type="checkbox" id="ckbHideAllZeroRecords" ng-click="hideAllZeroRecords()"> <!--<input type="checkbox" id="ckbHideAllZeroRecords" ng-click="hideAllZeroRecords()">-->
</div> <!--</div>-->
<span class="text-bold" translate="HideAllZeroRecords"></span> <!--<span class="text-bold" translate="HideAllZeroRecords"></span>-->
</div> </div>
<!--导出--> <!--导出-->
<div class="pull-right margin-right30"> <div class="pull-right margin-right30">
<!--<button id="btnDataFilter" class="hidden" ng-click="doDataFilter('')">Open Filter</button> <!--<button id="btnDataFilter" class="hidden" ng-click="doDataFilter('')">Open Filter</button>
<button id="btnResetDataFilter" class="hidden" ng-click="doDataFilterReset()">Reset Filter</button>--> <button id="btnResetDataFilter" class="hidden" ng-click="doDataFilterReset()">Reset Filter</button>-->
<span class="cursorPointer margin-right10" ng-click="doExport('GL','xlsx')"><i class="fa fa-file-excel-o" aria-hidden="true"></i> <span translate="ExportBtn"></span></span> <span class="cursorPointer margin-right10" ng-click="doExport('GL','xlsx')"><i class="fa fa-file-excel-o" aria-hidden="true"></i> <span translate="ExportBtn"></span></span>
<span class="cursorPointer margin-right10" ng-click="queryGlBalance()"><i class="fa fa-file-excel-o" aria-hidden="true"></i> <span>数据同步</span></span>
</div> </div>
</div> </div>
......
...@@ -238,16 +238,25 @@ ...@@ -238,16 +238,25 @@
/****************************************************************************************************/ /****************************************************************************************************/
/* Tony's Beatup services */ /* Tony's Beatup services */
getBalanceDataForDisplay: function (category, fromPeriod, toPeriod, criteria) { getBalanceDataForDisplay: function (category, fromPeriod, toPeriod, criteria, orgId) {
return $http.post('/DataImport/GetBalanceDataForDisplay', { return $http.post('/DataImport/GetBalanceDataForDisplay', {
category: category, category: category,
fromPeriod: fromPeriod, fromPeriod: fromPeriod,
toPeriod: toPeriod, toPeriod: toPeriod,
criteria: criteria criteria: criteria,
orgId: orgId
}, apiConfig.createVat()); }, apiConfig.createVat());
// return $http.get('/DataImport/GetBalanceDataForDisplay?category=' + category + '&fromPeriod=' + fromPeriod + '&toPeriod=' + toPeriod + '&criteria=' + criteria, apiConfig.createVat()); // return $http.get('/DataImport/GetBalanceDataForDisplay?category=' + category + '&fromPeriod=' + fromPeriod + '&toPeriod=' + toPeriod + '&criteria=' + criteria, apiConfig.createVat());
}, },
queryGlBalance: function (fromPeriod, toPeriod, orgId) {
return $http.post('/DataImport/queryGlBalance', {
fromPeriod: fromPeriod,
toPeriod: toPeriod,
orgId: orgId
}, apiConfig.createVat());
},
updateACustomPrice: function (customId, invoiceAmount) { updateACustomPrice: function (customId, invoiceAmount) {
return $http.get('/CustomsInvoice/UpdateACustomPrice?customId=' + customId + '&invoiceAmount=' + invoiceAmount, apiConfig.createVat()); return $http.get('/CustomsInvoice/UpdateACustomPrice?customId=' + customId + '&invoiceAmount=' + invoiceAmount, apiConfig.createVat());
}, },
......
...@@ -623,7 +623,7 @@ ...@@ -623,7 +623,7 @@
$state.go('vat.generateReport.reportView', { $state.go('vat.generateReport.reportView', {
id: approvalInfo.reportIds.split(",")[0], id: approvalInfo.reportIds.split(",")[0],
templateid: template.id, templateid: approvalInfo.templateIds.split(",")[0],
name: template.name, name: template.name,
templatecode: template.code templatecode: template.code
}); });
......
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