Commit 1c6536fe authored by chase's avatar chase

Merge branch 'dev_mysql' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_mysql

parents 3fcc0e38 4b47db19
......@@ -477,7 +477,6 @@
<env>uat</env>
</properties>
</profile>
</profiles>
<build>
......
......@@ -37,9 +37,12 @@ public class AnalysisJob extends QuartzJobBean {
protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
Integer period = DateUtils.getPeriodNow();
OrganizationExample e = new OrganizationExample();
e.createCriteria().andIsActiveEqualTo(true);
//e.createCriteria().andIsActiveEqualTo(true);
List<Organization> orgs = organizationMapper.selectByExample(e);
logger.info(String.format("开始分析%s机构数据",period));
analysisJobService.analysisMaster(orgs,period, EnumTbImportType.CoverImport.getCode());
logger.info(String.format("开始分析%s预期返还税数据",period));
analysisJobService.analysisExpectedTax(orgs,period, EnumTbImportType.CoverImport.getCode());
......@@ -49,15 +52,16 @@ public class AnalysisJob extends QuartzJobBean {
logger.info(String.format("开始分析%s档案管理数据",period));
analysisJobService.analysisFileManagement(orgs,period, EnumTbImportType.CoverImport.getCode());
logger.info(String.format("开始分析%s机构数据",period));
analysisJobService.analysisMaster(orgs,period, EnumTbImportType.CoverImport.getCode());
logger.info(String.format("开始分析%s申报表数据",period));
analysisJobService.analysisSales(orgs,period, EnumTbImportType.CoverImport.getCode());
logger.info(String.format("开始分析%s返还后税数据",period));
analysisJobService.analysisTaxReturnEnd(orgs,period, EnumTbImportType.CoverImport.getCode());
logger.info(String.format("开始分析%税种税金计算数据",period));
analysisJobService.analysisTax(orgs,period, EnumTbImportType.CoverImport.getCode());
}
}
......@@ -11,6 +11,7 @@ package pwc.taxtech.atms.common.util;
import com.google.common.collect.Lists;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngineConfiguration;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.streaming.SXSSFSheet;
import org.nutz.http.Http;
......@@ -23,6 +24,7 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.util.List;
import java.util.zip.ZipEntry;
......@@ -315,11 +317,12 @@ public class FileExcelUtil {
/**
* 删除列
*
* @param sheet
* @param columnToDelete
* @param cols 制定哪些行不进行列偏移
* @param cols 制定哪些行不进行列偏移
*/
public static void deleteColumn(Sheet sheet, int columnToDelete, List<Integer> cols) {
public static void deleteColumn(Sheet sheet, int columnToDelete, List<Integer> cols) {
for (int rId = 0; rId <= sheet.getLastRowNum(); rId++) {
Row row = sheet.getRow(rId);
for (int cID = columnToDelete; cID <= row.getLastCellNum(); cID++) {
......@@ -330,7 +333,7 @@ public class FileExcelUtil {
Cell cNext = row.getCell(cID + 1);
if (cNext != null) {
Cell cNew = row.createCell(cID, cNext.getCellTypeEnum());
if(cols.contains(cID))
if (cols.contains(cID))
continue;
cloneCell(cNew, cNext);
//Set the column width only on the first row.
......@@ -346,30 +349,82 @@ public class FileExcelUtil {
/**
* 右边列左移
*
* @param cNew
* @param cOld
*/
public static void cloneCell(Cell cNew, Cell cOld) {
try{
cNew.setCellComment(cOld.getCellComment());
cNew.setCellStyle(cOld.getCellStyle());
String stringCellValue = cOld.getStringCellValue();
if("".equals(stringCellValue))
return;
if (CellType.BOOLEAN == cNew.getCellTypeEnum()) {
cNew.setCellValue(cOld.getBooleanCellValue());
} else if (CellType.NUMERIC == cNew.getCellTypeEnum()) {
cNew.setCellValue(cOld.getNumericCellValue());
} else if (CellType.STRING == cNew.getCellTypeEnum()) {
cNew.setCellValue(cOld.getStringCellValue());
} else if (CellType.ERROR == cNew.getCellTypeEnum()) {
cNew.setCellValue(cOld.getErrorCellValue());
} else if (CellType.FORMULA == cNew.getCellTypeEnum()) {
cNew.setCellValue(cOld.getCellFormula());
}
}catch (Exception e){
logger.warn("数据转换异常", e.getMessage());
}
public static void cloneCell(Cell cNew, Cell cOld) {
try {
cNew.setCellComment(cOld.getCellComment());
cNew.setCellStyle(cOld.getCellStyle());
try {
String stringCellValue = cOld.getStringCellValue();
if ("".equals(stringCellValue))
return;
} catch (Exception e) {
//do nothing
}
if (CellType.BOOLEAN == cNew.getCellTypeEnum() || CellType.BOOLEAN == cOld.getCellTypeEnum()) {
cNew.setCellValue(cOld.getBooleanCellValue());
} else if (CellType.NUMERIC == cNew.getCellTypeEnum() || CellType.NUMERIC == cOld.getCellTypeEnum()) {
cNew.setCellValue(cOld.getNumericCellValue());
} else if (CellType.STRING == cNew.getCellTypeEnum() || CellType.STRING == cOld.getCellTypeEnum()) {
cNew.setCellValue(cOld.getStringCellValue());
} else if (CellType.ERROR == cNew.getCellTypeEnum() || CellType.ERROR == cOld.getCellTypeEnum()) {
cNew.setCellValue(cOld.getErrorCellValue());
} else if (CellType.FORMULA == cNew.getCellTypeEnum() || CellType.FORMULA == cOld.getCellTypeEnum()) {
cNew.setCellValue(cOld.getCellFormula());
}
} catch (Exception e) {
e.printStackTrace();
logger.warn("数据转换异常", e.getMessage());
}
}
/**
*
* @param cell 获取值的单元格
* @param zero 是否将空 或者null转换成 zero
* @return
*/
public static Object getCellValue(Cell cell, Boolean zero) {
String cellValue = null;
switch (cell.getCellType()) {
case Cell.CELL_TYPE_STRING://字符串类型
cellValue = cell.getStringCellValue();
if (cellValue.trim().equals("") || cellValue.trim().length() <= 0)
cellValue = "";
break;
case Cell.CELL_TYPE_NUMERIC: //数值类型
cellValue = String.valueOf(cell.getNumericCellValue());
break;
case Cell.CELL_TYPE_FORMULA: //公式
cell.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
cellValue = String.valueOf(cell.getNumericCellValue());
break;
case Cell.CELL_TYPE_BLANK:
cellValue = "";
break;
case Cell.CELL_TYPE_BOOLEAN:
break;
case Cell.CELL_TYPE_ERROR:
break;
default:
break;
}
if("".equals(cellValue) && zero)
return BigDecimal.ZERO;
if(zero){
try{
return new BigDecimal(cellValue);
}catch (Exception e){
logger.warn("获取Cell,在值转换成数字的地方出错");
return BigDecimal.ZERO;
}
}
return cellValue;
}
}
\ No newline at end of file
......@@ -209,7 +209,8 @@ public class AssetListController {
ApiResultDto assetsImport(@RequestParam MultipartFile file,
@RequestParam String filename,
@RequestParam String tempFileName,
@RequestParam String projectId){
@RequestParam String projectId,
@RequestParam Integer importType){
logger.info("CIT资产导入");
ApiResultDto apiResultDto = new ApiResultDto();
try{
......@@ -224,7 +225,7 @@ public class AssetListController {
try {
input = file.getInputStream();
//调用资产导入业务逻辑
OperationResultDto assetsImportResult = assetListService.assetsImport(input, file.getOriginalFilename(), projectId);
OperationResultDto assetsImportResult = assetListService.assetsImport(input, file.getOriginalFilename(), projectId,importType);
//判断是否导入成功,若成功获取资产类别并返回页面
if(assetsImportResult.getResult() != null && !assetsImportResult.getResult()){
apiResultDto.setData(assetListService.getAssetGroupResultData(projectId));
......
......@@ -285,7 +285,7 @@ public class AnalysisServiceImpl extends BaseService {
AnalysisTax model = new AnalysisTax();
model.setId(idService.nextId());
model.setOrganizationId(org.getId());
model.setSeqNo(org.getCode()+""+period);
model.setSeqNo(getSeqNoByPeriod(org.getId(), period));
model.setPeriod(period);
model.setCompanyName(org.getName());
model.setTaxGroup(getCellStringValue(sheet.getRow(0).getCell(k)));
......@@ -293,6 +293,16 @@ public class AnalysisServiceImpl extends BaseService {
return model;
}
public String getSeqNoByPeriod(String orgId, Integer period){
AnalysisMasterExample analysisMasterExample = new AnalysisMasterExample();
analysisMasterExample.createCriteria().andPeriodEqualTo(period).andOrganizationIdEqualTo(orgId);
List<AnalysisMaster> analysisMasters = analysisMasterMapper.selectByExample(analysisMasterExample);
if(analysisMasters.size() != 0)
return analysisMasters.get(0).getSeqNo();
return null;
}
private void importAnalysisReturnTaxExcelFile(MultipartFile file, String periodDate) {
try{
InputStream inputStream = file.getInputStream();
......@@ -346,7 +356,7 @@ public class AnalysisServiceImpl extends BaseService {
AnalysisActualTaxReturn model = new AnalysisActualTaxReturn();
model.setId(idService.nextId());
model.setOrganizationId(org.getId());
model.setSeqNo(org.getCode()+""+period);
model.setSeqNo(getSeqNoByPeriod(org.getId(), period));
model.setPeriod(period);
model.setCompanyName(org.getName());
model.setTaxReturnGroup(getCellStringValue(sheet.getRow(0).getCell(k)));
......@@ -381,6 +391,10 @@ public class AnalysisServiceImpl extends BaseService {
model.setInternAmount(getCellBigDecimalValue(sheet.getRow(j).getCell(2)));
model.setVendorAmount(getCellBigDecimalValue(sheet.getRow(j).getCell(3)));
model.setTotalAmount(getCellBigDecimalValue(sheet.getRow(j).getCell(4)));
//通过公司名称查询orgId
OrganizationExample example = new OrganizationExample();
example.createCriteria().andNameEqualTo(getCellStringValue(sheet.getRow(j).getCell(0)));
model.setSeqNo(getSeqNoByPeriod(organizationMapper.selectByExample(example).get(0).getId(), Integer.parseInt(periodDate)));
lists.add(model);
}
AnalysisEmployeeNumExample example = new AnalysisEmployeeNumExample();
......@@ -487,7 +501,6 @@ public class AnalysisServiceImpl extends BaseService {
throw new ServiceException(e);
}
}
private void importAnalysisInterTaxDataExcelFile(MultipartFile file, String periodDate,
String companyName,String country) {
try{
......
......@@ -194,7 +194,7 @@ public class AssetListServiceImpl extends BaseService {
* @param fileName
* @return
*/
public OperationResultDto assetsImport(InputStream inputStream, String fileName, String projectId) throws IOException, InvalidFormatException, ParseException {
public OperationResultDto assetsImport(InputStream inputStream, String fileName, String projectId, Integer importType) throws IOException, InvalidFormatException, ParseException {
logger.debug("导入excel文件开始");
//定义返回变量
OperationResultDto<Object> importResult = new OperationResultDto<>();
......@@ -249,7 +249,9 @@ public class AssetListServiceImpl extends BaseService {
}
//在循环存储新的资产之前先删除原有资产
deleteByExample(projectId);
if(importType == 1){
deleteByExample(projectId);
}
//循环存储新的资产
int insertBatch = assetListMapper.insertBatch(citAssetsLists);
// for (CitAssetsList citAsset : citAssetsLists){
......
......@@ -11,6 +11,7 @@ import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.constant.CountTypeConstant;
import pwc.taxtech.atms.constant.ExportTemplatePathConstant;
import pwc.taxtech.atms.dao.CitJournalEntryAdjustMapper;
import pwc.taxtech.atms.dao.CitTbamMapper;
import pwc.taxtech.atms.dao.CitTrialBalanceMapper;
import pwc.taxtech.atms.dao.OrganizationMapper;
import pwc.taxtech.atms.dto.CitJournalAdjustDto;
......@@ -53,6 +54,8 @@ public class CitDataPreviewServiceImpl extends BaseService {
private CitJournalEntryAdjustMapper citJournalMapper;
@Resource
private CitTrialBalanceMapper citTbMapper;
@Resource
private CitTbamMapper citTbamMapper;
/**
* 获取日记账合并版
......@@ -167,10 +170,10 @@ public class CitDataPreviewServiceImpl extends BaseService {
CitTrialBalanceExample.Criteria citTbExampleCriteria = citTbExample.createCriteria();
citTbExampleCriteria.andProjectIdEqualTo(citTrialBalanceDto.getProjectId());
if(citTrialBalanceDto.getAccountCode() != null && !"".equals(citTrialBalanceDto.getAccountCode())){
citTbExampleCriteria.andAccountCodeEqualTo(citTrialBalanceDto.getAccountCode());
citTbExampleCriteria.andAccountCodeLike("%"+citTrialBalanceDto.getAccountCode()+"%");
}
if(citTrialBalanceDto.getAccountDescription() != null && !"".equals(citTrialBalanceDto.getAccountDescription())){
citTbExampleCriteria.andAccountDescriptionEqualTo(citTrialBalanceDto.getAccountDescription());
citTbExampleCriteria.andAccountDescriptionLike("%"+citTrialBalanceDto.getAccountDescription()+"%");
}
List<CitTrialBalance> citTbList = citTbMapper.selectByExample(citTbExample);
......@@ -226,10 +229,10 @@ public class CitDataPreviewServiceImpl extends BaseService {
CitTrialBalanceExample.Criteria citTbExampleCriteria = citTbExample.createCriteria();
citTbExampleCriteria.andProjectIdEqualTo(citTrialBalanceDto.getProjectId());
if(citTrialBalanceDto.getAccountCode() != null && !"".equals(citTrialBalanceDto.getAccountCode())){
citTbExampleCriteria.andAccountCodeEqualTo(citTrialBalanceDto.getAccountCode());
citTbExampleCriteria.andAccountCodeLike("%"+citTrialBalanceDto.getAccountCode()+"%");
}
if(citTrialBalanceDto.getAccountDescription() != null && !"".equals(citTrialBalanceDto.getAccountDescription())){
citTbExampleCriteria.andAccountDescriptionEqualTo(citTrialBalanceDto.getAccountDescription());
citTbExampleCriteria.andAccountDescriptionLike("%"+citTrialBalanceDto.getAccountDescription()+"%");
}
List<CitTrialBalance> citTbList = citTbMapper.selectByExample(citTbExample);
if(citTbList.size()==0){
......@@ -237,7 +240,7 @@ public class CitDataPreviewServiceImpl extends BaseService {
}
ExportDto exportDto = new ExportDto();
exportDto.setFileName("试算平衡表生成版");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/citTbGeneVer.xlsx");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/citTrialBalanceGene.xlsx");
exportDto.setResponse(response);
exportDto.setList(citTbList);
exportDto.setRelation(null);
......@@ -269,14 +272,28 @@ public class CitDataPreviewServiceImpl extends BaseService {
*/
public PageInfo<CitTrialBalanceDto> getTbMappingVerData(CitTrialBalanceDto citTrialBalanceDto) {
Page page = PageHelper.startPage(citTrialBalanceDto.getPageInfo().getPageIndex(), citTrialBalanceDto.getPageInfo().getPageSize());
List<CitTrialBalanceDto> citTbList = citTbMapper.getTbMappingData(citTrialBalanceDto);
// List<CitTrialBalanceDto> citTbDtos = Lists.newArrayList();
// citTbList.forEach(tb -> {
// CitTrialBalanceDto citTrialBalanceDtoTemp = new CitTrialBalanceDto();
// beanUtil.copyProperties(tb, citTrialBalanceDtoTemp);
// citTbDtos.add(citTrialBalanceDtoTemp);
// });
CitTbamExample citTbamExample = new CitTbamExample();
CitTbamExample.Criteria criteria = citTbamExample.createCriteria();
criteria.andProjectIdEqualTo(citTrialBalanceDto.getProjectId());
if(citTrialBalanceDto.getAccountCode() != null && !"".equals(citTrialBalanceDto.getAccountCode())){
criteria.andAccountCodeLike("%"+citTrialBalanceDto.getAccountCode()+"%");
}
if(citTrialBalanceDto.getAccountDescription() != null && !"".equals(citTrialBalanceDto.getAccountDescription())){
criteria.andAccountDescriptionLike("%"+citTrialBalanceDto.getAccountDescription()+"%");
}
if(citTrialBalanceDto.getAttribute() != null && !"".equals(citTrialBalanceDto.getAttribute())){
criteria.andAttributeLike("%"+citTrialBalanceDto.getAttribute()+"%");
}
List<CitTrialBalanceDto> citTbList = Lists.newArrayList();
List<CitTbam> citTbams = citTbamMapper.selectByExample(citTbamExample);
for (CitTbam citTbam : citTbams) {
CitTrialBalanceDto citTrialBalanceDtoTemp = new CitTrialBalanceDto();
beanUtil.copyProperties(citTbam, citTrialBalanceDtoTemp);
citTbList.add(citTrialBalanceDtoTemp);
}
// List<CitTrialBalanceDto> citTbList = citTbMapper.getTbMappingData(citTrialBalanceDto);
PageInfo<CitTrialBalanceDto> pageInfo =new PageInfo<>(citTbList);
pageInfo.setTotal(page.getTotal());
pageInfo.setPageNum(citTrialBalanceDto.getPageInfo().getPageIndex());
......@@ -316,13 +333,31 @@ public class CitDataPreviewServiceImpl extends BaseService {
* @return
*/
public int exportTbMappingVerData2(CitTrialBalanceDto citTrialBalanceDto, HttpServletResponse response){
List<CitTrialBalanceDto> citTbList = citTbMapper.getTbMappingData(citTrialBalanceDto);
CitTbamExample citTbamExample = new CitTbamExample();
CitTbamExample.Criteria criteria = citTbamExample.createCriteria();
criteria.andProjectIdEqualTo(citTrialBalanceDto.getProjectId());
if(citTrialBalanceDto.getAccountCode() != null && !"".equals(citTrialBalanceDto.getAccountCode())){
criteria.andAccountCodeLike("%"+citTrialBalanceDto.getAccountCode()+"%");
}
if(citTrialBalanceDto.getAccountDescription() != null && !"".equals(citTrialBalanceDto.getAccountDescription())){
criteria.andAccountDescriptionLike("%"+citTrialBalanceDto.getAccountDescription()+"%");
}
if(citTrialBalanceDto.getAttribute() != null && !"".equals(citTrialBalanceDto.getAttribute())){
criteria.andAttributeLike("%"+citTrialBalanceDto.getAttribute()+"%");
}
List<CitTrialBalanceDto> citTbList = Lists.newArrayList();
List<CitTbam> citTbams = citTbamMapper.selectByExample(citTbamExample);
for (CitTbam citTbam : citTbams) {
CitTrialBalanceDto citTrialBalanceDtoTemp = new CitTrialBalanceDto();
beanUtil.copyProperties(citTbam, citTrialBalanceDtoTemp);
citTbList.add(citTrialBalanceDtoTemp);
}
if(citTbList.size()==0){
return 0;
}
ExportDto exportDto = new ExportDto();
exportDto.setFileName("试算平衡表Mapping版");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/citTbGeneMapping.xlsx");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/citTrialBalanceMapping.xlsx");
exportDto.setResponse(response);
exportDto.setList(citTbList);
exportDto.setRelation(citTbList.get(0));
......@@ -330,4 +365,5 @@ public class CitDataPreviewServiceImpl extends BaseService {
return 1;
}
}
......@@ -347,6 +347,8 @@ public class TemplateGroupServiceImpl extends AbstractService {
List<PeriodDataSource> periodDataSourceList = Lists.newArrayList();
for (int r = sheet.getFirstRowNum(); r <= sheet.getLastRowNum(); r++) {
Row row = sheet.getRow(r);
if(row == null)
continue;
for (int c = row.getFirstCellNum(); c <= row.getLastCellNum(); c++) {
Cell cell = row.getCell(c);
if (cell == null) {
......
......@@ -2409,7 +2409,6 @@ public class ReportServiceImpl extends BaseService {
List<EbitSpreadData> ebitSpreadData = ebitSpreadDataMapper.selectByExample(example);
Workbook workbook1 = null;
Sheet sheetAt = null;
if (ebitSpreadData.size() == 0)
throw new Exception("没有可导出的数据");
for (int i = 0; i < ebitSpreadData.size(); i++) {
......@@ -2422,15 +2421,12 @@ public class ReportServiceImpl extends BaseService {
}
InputStream inputStream = httpFileService.getUserTemplate(path);
if (i == 0) {
workbook1 = new XSSFWorkbook(inputStream);
workbook1 = WorkbookFactory.create(inputStream);
sheetAt = workbook1.getSheetAt(0);
List<Integer> cols = Lists.newArrayList();
FileExcelUtil.deleteColumn(sheetAt, 1, cols);
sheetAt.setColumnWidth(1, 22 * 256);
sheetAt.setColumnWidth(2, 22 * 256);
} else {
Workbook workbook2 = new XSSFWorkbook(inputStream);
Workbook workbook2 = WorkbookFactory.create(inputStream);
Sheet sheetAt1 = workbook2.getSheetAt(0);
for (int m = 0; m < sheetAt1.getLastRowNum(); m++) {
switch (m) {
......@@ -2443,7 +2439,7 @@ public class ReportServiceImpl extends BaseService {
default:
if (i == 0)
break;
sheetAt.getRow(m).getCell(i + 1).setCellValue(getCellStringValue(sheetAt1.getRow(m).getCell(i + 1)));
sheetAt.getRow(m).getCell(i + 1).setCellValue(getCellStringValue(sheetAt1.getRow(m).getCell(2)));
}
}
}
......@@ -2454,7 +2450,7 @@ public class ReportServiceImpl extends BaseService {
//将workbook转成流
/* ByteArrayOutputStream bos = new ByteArrayOutputStream();
workbook.write(bos);
byte[] barray = bos.toByteArray();6
byte[] barray = bos.toByteArray();
InputStream is = new ByteArrayInputStream(barray);*/
// FileOutputStream fileOut = new FileOutputStream(path);
}
......@@ -2469,8 +2465,8 @@ public class ReportServiceImpl extends BaseService {
for (int m = 0; m < 3; m++) {
FileExcelUtil.cloneCell(sheetAt.getRow(m).getCell(2), sheetAt.getRow(m).getCell(1));
sheetAt.getRow(m).getCell(3).setCellValue("");
sheetAt.getRow(m).getCell(1).setCellValue("");
}
style1.setFillBackgroundColor(IndexedColors.YELLOW.getIndex());
sheetAt.getRow(2).getCell(2).setCellStyle(style1);
......@@ -2517,12 +2513,12 @@ public class ReportServiceImpl extends BaseService {
@Autowired
private JdbcTemplate jdbcTemplate;
//获取利润表模板Id
//获取利润表模板Id 利润表固定模板VAT10086
public String getlxbId() throws Exception {
try {
String sql = "select * from template t where t.name = '利润表'";
String sql = "select * from template t where t.name = 'VAT10086' order by t.create_time desc ";
Map<String, Object> stringObjectMap = new HashMap<>();
stringObjectMap = jdbcTemplate.queryForList("select * from template t where t.name = '利润表' ").get(0);
stringObjectMap = jdbcTemplate.queryForList(sql).get(0);
return stringObjectMap.get("id").toString();
} catch (Exception e) {
e.printStackTrace();
......@@ -2530,7 +2526,7 @@ public class ReportServiceImpl extends BaseService {
}
}
/* private String getCellStringValue(Cell cell) {
/* private String getCellStringValue(Cell cell) {
if (cell.getCellTypeEnum().equals(CellType.STRING)) {
return cell.getStringCellValue();
} else if (cell.getCellTypeEnum().equals(CellType.NUMERIC)) {
......
......@@ -59,7 +59,7 @@ org_sync_token=174af08f
dd_pubkey=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKUfMPRKV6I5num1dDWcxTrgTjXf5LctsVj0CpbwHE83mmjUO5CAlvA0Fwy30ajCX5sLmsyi+Eu/4uNmM6GQF3kCAwEAAQ==
ebs_call_url=http://172.20.3.109:8020/ebs-proxy-test/dts
ebs_call_url=http://172.20.3.109:8010/ebs-proxy-test/dts
#tableau config
tableau_get_ticket=http://47.94.233.173:16010/trusted?username=%s
......
......@@ -28,7 +28,7 @@ public class AnalysisTest extends CommonIT {
public void analysisExpectedTax(){
Integer period = DateUtils.getPeriodNow();
OrganizationExample e = new OrganizationExample();
e.createCriteria().andIsActiveEqualTo(true);
//e.createCriteria().andIsActiveEqualTo(true);
List<Organization> orgs = organizationMapper.selectByExample(e);
logger.info(String.format("开始分析%s预期返还税数据",period));
analysisJobService.analysisExpectedTax(orgs,period, EnumTbImportType.CoverImport.getCode());
......@@ -39,7 +39,7 @@ public class AnalysisTest extends CommonIT {
public void analysisFee(){
Integer period = DateUtils.getPeriodNow();
OrganizationExample e = new OrganizationExample();
e.createCriteria().andIsActiveEqualTo(true);
//e.createCriteria().andIsActiveEqualTo(true);
List<Organization> orgs = organizationMapper.selectByExample(e);
logger.info(String.format("开始分析%s费用数据",period));
analysisJobService.analysisFee(orgs,period, EnumTbImportType.CoverImport.getCode());
......@@ -49,7 +49,7 @@ public class AnalysisTest extends CommonIT {
public void analysisFileManagement(){
Integer period = DateUtils.getPeriodNow();
OrganizationExample e = new OrganizationExample();
e.createCriteria().andIsActiveEqualTo(true);
// e.createCriteria().andIsActiveEqualTo(true);
List<Organization> orgs = organizationMapper.selectByExample(e);
logger.info(String.format("开始分析%s文档管理数据",period));
......@@ -60,7 +60,7 @@ public class AnalysisTest extends CommonIT {
public void analysisMaster(){
Integer period = DateUtils.getPeriodNow();
OrganizationExample e = new OrganizationExample();
e.createCriteria().andIsActiveEqualTo(true);
//e.createCriteria().andIsActiveEqualTo(true);
List<Organization> orgs = organizationMapper.selectByExample(e);
logger.info(String.format("开始分析%s机构数据",period));
analysisJobService.analysisMaster(orgs,period, EnumTbImportType.CoverImport.getCode());
......@@ -70,7 +70,7 @@ public class AnalysisTest extends CommonIT {
public void analysisSales(){
Integer period = DateUtils.getPeriodNow();
OrganizationExample e = new OrganizationExample();
e.createCriteria().andIsActiveEqualTo(true);
//e.createCriteria().andIsActiveEqualTo(true);
List<Organization> orgs = organizationMapper.selectByExample(e);
logger.info(String.format("开始分析%s申报表数据",period));
analysisJobService.analysisSales(orgs,period, EnumTbImportType.CoverImport.getCode());
......@@ -80,9 +80,19 @@ public class AnalysisTest extends CommonIT {
public void analysisTaxReturnEnd(){
Integer period = DateUtils.getPeriodNow();
OrganizationExample e = new OrganizationExample();
e.createCriteria().andIsActiveEqualTo(true);
//e.createCriteria().andIsActiveEqualTo(true);
List<Organization> orgs = organizationMapper.selectByExample(e);
logger.info(String.format("开始分析%s返还后税数据",period));
analysisJobService.analysisTaxReturnEnd(orgs,period, EnumTbImportType.CoverImport.getCode());
}
@Test
public void analysisTax(){
Integer period = DateUtils.getPeriodNow();
OrganizationExample e = new OrganizationExample();
//e.createCriteria().andIsActiveEqualTo(true);
List<Organization> orgs = organizationMapper.selectByExample(e);
logger.info(String.format("开始分析%s返还后税数据",period));
analysisJobService.analysisTax(orgs,period, EnumTbImportType.CoverImport.getCode());
}
}
......@@ -356,20 +356,20 @@
and org_code = #{orgCode,jdbcType=VARCHAR}
</if>
<if test="subjectCode != null and subjectCode != ''">
and subject_code = #{subjectCode,jdbcType=VARCHAR}
and subject_code LIKE CONCAT('%' ,#{subjectCode},'%')
</if>
<if test="orgName != null and orgName != ''">
and org_name = #{orgName,jdbcType=VARCHAR}
</if>
<if test="subjectName != null and subjectName != ''">
and subject_name = #{subjectName,jdbcType=VARCHAR}
</if>
<if test="periodStart!=null">
AND account_period &gt;= #{periodStart,jdbcType=INTEGER}
</if>
<if test="periodEnd!=null">
AND account_period &lt;= #{periodEnd,jdbcType=INTEGER}
and subject_name LIKE CONCAT('%' ,#{subjectName},'%')
</if>
<!--<if test="periodStart!=null">-->
<!--AND account_period &gt;= #{periodStart,jdbcType=INTEGER}-->
<!--</if>-->
<!--<if test="periodEnd!=null">-->
<!--AND account_period &lt;= #{periodEnd,jdbcType=INTEGER}-->
<!--</if>-->
UNION ALL
select
id, organization_id, project_id, tms_period as period ,date,source, ledger_id, ledger_name, currency_code,
......@@ -385,13 +385,13 @@
and segment1 = #{orgCode,jdbcType=VARCHAR}
</if>
<if test="subjectCode != null and subjectCode != ''">
and segment3 = #{subjectCode,jdbcType=VARCHAR}
and segment3 LIKE CONCAT('%' ,#{subjectCode},'%')
</if>
<if test="orgName != null and orgName != ''">
and segment1_name = #{orgName,jdbcType=VARCHAR}
</if>
<if test="subjectName != null and subjectName != ''">
and segment3_name = #{subjectName,jdbcType=VARCHAR}
and segment3_name LIKE CONCAT('%' ,#{segment3_name},'%')
</if>
<if test="periodStart!=null">
AND period &gt;= #{periodStart,jdbcType=INTEGER}
......
......@@ -350,9 +350,7 @@
<select id="getTbMappingData" parameterType="map" resultMap="citTbDtoResultMap">
select
tb.id, tb.organization_id, tb.project_id, tb.date, tb.source, tb.period, tb.account_code, tb.account_description,
tb.account_period, tb.debit_amount, tb.credit_amount, tb.beginning_balance, tb.ending_balance, tb.create_by,
tb.create_time, tb.update_time,dam.attribute as attribute
tb.*,dam.attribute as attribute
from
cit_trial_balance tb
left join
......
VUE_APP_TABLEAU_API=http://dts.erp.didichuxing.com:10000/OrangeHeap/
\ No newline at end of file
VUE_APP_TABLEAU_API=http://dts.erp.didichuxing.com/OrangeHeap/
\ No newline at end of file
VUE_APP_TABLEAU_API=http://dts.erp.didichuxing.com:10000/OrangeHeap/
\ No newline at end of file
VUE_APP_TABLEAU_API=http://dts.erp.didichuxing.com/OrangeHeap/
\ No newline at end of file
......@@ -151,6 +151,26 @@
sheet.setColumnWidth(i, 180);
}
}
//创建自定义格式
function CustomPerFormat() {
}
CustomPerFormat.prototype = new GC.Spread.Formatter.FormatterBase();
CustomPerFormat.prototype.format = function (obj, formattedData) {
return perFormat(obj, formattedData);
}
function perFormat(value, formattedData){
value = value.toString();
if(0 <= value <= 100){
if( value.indexOf("%") != -1){
value += "%";
}
}else{
formattedData.conditionalForeColor = "red";
}
return value;
}
var initSpreadExcel = function (reportSpread) {
var spread = getSpreadControl();
......@@ -240,7 +260,9 @@
sheet.getCell(40, 2).locked(false);//ebit比率
//
sheet.setFormatter( 38, 2,"0.00");
sheet.setFormatter( 40, 2,"0.00");
sheet.setFormatter( 40, 2,"0.00%");
//sheet.setFormatter(40, 2, new CustomPerFormat());
//sheet.getCell(40, 2).formatter(new CustomPerFormat());
};
// 每个单元格大致由以下部分构成:_SumAll(_Inter(...)+_Manual(...)+C1)
......
......@@ -2943,7 +2943,7 @@
spreadTODb();
}
var spreadTODb = function () {
var spreadTODb = function (front) {
if ($scope.relation.period == undefined || $scope.relation.period == null) {
SweetAlert.error("请选择机构");
return;
......@@ -2970,7 +2970,9 @@
success: function (data) {
//alert("上传成功!");
if (data.result) {
SweetAlert.success("成功")
if(!front){
SweetAlert.success("操作成功")
}
} else {
SweetAlert.error(data.resultMsg);
}
......@@ -3087,7 +3089,7 @@
$scope.relation.addEbitRow(sheet);
calculateEbitAndInsert(sheet, true);
$scope.relation.lockCell($scope.spread);
spreadTODb();
spreadTODb(true);
}, function (e) {
alert(e.errorMessage);
if (e.errorCode === 2/*noPassword*/ || e.errorCode === 3 /*invalidPassword*/) {
......@@ -3102,35 +3104,43 @@
return this.replace(new RegExp(s1, "gm"), s2);
}
var nullToZero = function(value){
var calculateEbitAndInsert = function (sheet, insert) {
var yysr = Number(sheet.getValue(11, 2).toString().replaceAll(",", ""));//营业收入
var yycb = Number(sheet.getValue(12, 2).toString().replaceAll(",", ""));//营业成本
var yysjfj = Number(sheet.getValue(13, 2).toString().replaceAll(",", ""));//营业税金附加
var xsfy = Number(sheet.getValue(14, 2).toString().replaceAll(",", ""));//销售费用
var glfy = Number(sheet.getValue(15, 2).toString().replaceAll(",", ""));//管理费用
var yffy = Number(sheet.getValue(16, 2).toString().replaceAll(",", ""));//研发费用
var zcjzss = Number(sheet.getValue(18, 2).toString().replaceAll(",", ""));//资产减值损失
var ts = (sheet.getValue(38, 2) == "" || sheet.getValue(38, 2) == null) == true ? 0 : sheet.getValue(40, 2);
var rate = (sheet.getValue(40, 2) == "" || sheet.getValue(40, 2) == null) == true ? "1%" : sheet.getValue(40, 2);
return value !=null ? Number(value.toString().replaceAll("," , "")) : 0;
}
var calculateEbitAndInsert = function (sheet, insert) {
var yysr = nullToZero(sheet.getValue(11, 2));//营业成本
var yycb = nullToZero(sheet.getValue(12, 2));//营业成本
var yysjfj = nullToZero (sheet.getValue(13, 2) );//营业税金附加
var xsfy = nullToZero(sheet.getValue(14, 2));//销售费用
var glfy = nullToZero(sheet.getValue(15, 2));//管理费用
var yffy = nullToZero(sheet.getValue(16, 2));//研发费用
var zcjzss = nullToZero(sheet.getValue(18, 2));//资产减值损失
var ts = nullToZero(sheet.getValue(38, 2));
var rate = 1;
if(sheet.getValue(40, 2) != null){
if(sheet.getValue(40, 2).toString().indexOf("%") != -1){
rate = Number(sheet.getValue(40, 2).toString().replaceAll("%", "")) ;
}else{
rate = sheet.getValue(40, 2) * 100
}
}else{
rate = 1;
}
$scope._ebitResult.klzcjsz = Number((yysr - yycb - yysjfj - xsfy - glfy - yffy - zcjzss).toFixed(4));
$scope._ebitResult.tsyskl = Number((Number(ts)).toFixed(4));
$scope._ebitResult.kltsys = ($scope._ebitResult.klzcjsz + $scope._ebitResult.tsyskl).toFixed(4);
$scope._ebitResult.kltsys = Number(($scope._ebitResult.klzcjsz + $scope._ebitResult.tsyskl).toFixed(4));
$scope._ebitResult.rate = rate;
if($scope._ebitResult.rate.indexOf("%") != -1){
$scope._ebitResult.gljyye = Number((Number($scope._ebitResult.rate.replaceAll("%", "")) * $scope._ebitResult.kltsys).toFixed(4));
}else{
$scope._ebitResult.gljyye = Number(($scope._ebitResult.rate * $scope._ebitResult.kltsys).toFixed(4));
}
$scope._ebitResult.gljyye = Number(((rate/ 100) * $scope._ebitResult.kltsys).toFixed(4));
$scope._ebitResult.sixAddtax = Number((0.06 * $scope._ebitResult.gljyye).toFixed(4));
$scope._ebitResult.tsklys = Number(($scope._ebitResult.gljyye * 0.106).toFixed(4));
if (insert) {
sheet.setValue(37, 2, $scope._ebitResult.klzcjsz);
sheet.setValue(38, 2, $scope._ebitResult.tsklys);
sheet.setValue(38, 2, $scope._ebitResult.tsyskl);
sheet.setValue(39, 2, $scope._ebitResult.kltsys);
sheet.setValue(40, 2, $scope._ebitResult.rate);
sheet.setValue(40, 2, $scope._ebitResult.rate + "%");
sheet.setValue(41, 2, $scope._ebitResult.gljyye);
sheet.setValue(42, 2, $scope._ebitResult.sixAddtax);
sheet.setValue(43, 2, $scope._ebitResult.klzcjsz);
......
......@@ -8,8 +8,8 @@
<span style="width: auto" ng-click="switchTab($event,4)">{{'InvisibleAssets' | translate}}</span>
<!--税会差异的选择-->
<!--<div class="option" style="display: inline-block">-->
<!--<span>{{'TaxAccountDifference' | translate}}</span>-->
<!--<div id="taxAccountDifferenceButton" dx-select-box="taxAccountDifferenceOptions"></div>-->
<!--<span>{{'TaxAccountDifference' | translate}}</span>-->
<!--<div id="taxAccountDifferenceButton" dx-select-box="taxAccountDifferenceOptions"></div>-->
<!--</div>-->
</div>
</div>
......@@ -24,18 +24,22 @@
<form class="form-inline">
<div class="form-group">
<div class="col-sm-5">
<div class="col-sm-4">
<input class="form-control" type="text" name="fileName"
value="{{file ? file.name : '' | limitString :25}}" readonly placeholder="" required>
</div>
<div class="col-sm-4">
<div class="col-sm-3">
<button type="button" type="file" ngf-select ng-model="file" accept=".xls,.xlsx"
class="btn btn-secondary browse">{{'SelectFile' | translate}}
</button>
</div>
<div class="col-sm-3">
<button class="btn btn-vat-primary" style="height: 34px" translate="ImportBtn"
ng-click="importDataNew()"></button>
<button class="btn btn-vat-primary" style="height: 34px" translate="ConverImportBtn"
ng-click="importDataNew(1)"></button>
</div>
<div class="col-sm-2">
<button class="btn btn-vat-primary" style="height: 34px" translate="AddImportBtn"
ng-click="importDataNew(0)"></button>
</div>
</div>
......@@ -146,9 +150,47 @@
</div>
</div>
<div class="page-footer">
<ack-pagination page-options="pagingOptions"
refresh-table="refreshAssetResultListGrid()"></ack-pagination>
<div class="ack-page">
<div class="ack-footer">
<div class="page-size">
<!--共有-->
<span>{{'TotalPage'| translate}}<span class="total-number">{{pagingOptions.totalItems}}</span>{{'RecordCount' | translate}}</span>
<!--每页显示-->
<span class="padding-span" ng-show="!hideSelector">{{'RowForPage'| translate}}</span>
<select class="padding-span page-box" ng-model="pagingOptions.pageSizeString"
ng-change="pagingService.pageSizeSelectionChanged()" ng-show="!hideSelector">
<option ng-repeat="option in pagingOptions.pagingSelection" value="{{option.id}}">
{{option.value}}
</option>
</select>
<!--条记录-->
<span class="padding-span" ng-show="!hideSelector">{{'RecordCount' | translate}}</span>
<!--跳至-->
<span class="padding-span" ng-show="!hideSelector">{{'JumpTo' | translate}} <span
class="padding-span"><input class="page-box " type="number"
ng-change="pagingService.pageIndexChanging()"
ng-model="pagingOptions.pageIndex"/></span>&nbsp;{{'Page' | translate}}</span>
<!--当前页-->
<span class="padding-span" ng-show="!hideSelector">{{'CurrentPage' | translate}} <span
class="normal-number">{{pagingOptions.pageIndex}}</span>/<span class="normal-number">{{pagingOptions.totalPages}}</span></span>
</div>
<ul uib-pagination total-items="pagingOptions.totalItems" items-per-page="pagingOptions.pageSize"
ng-model="pagingOptions.pageIndex" num-pages="pagingOptions.totalPages"
max-size="pagingOptions.maxSize" class="pagination-sm"
boundary-link-numbers="true" ng-change="pagingService.pageIndexChanging()" rotate="true"
boundary-links="true" first-text="{{pagingOptions.firstPage}}"
previous-text="{{pagingOptions.previousPage}}" last-text="{{pagingOptions.lastPage}}"
next-text="{{pagingOptions.nextPage}}"></ul>
</div>
</div>
</div>
<!--<div class="page-footer">-->
<!--<ack-pagination page-options="pagingOptions"-->
<!--refresh-table="refreshAssetResultListGrid()"></ack-pagination>-->
<!--</div>-->
</div>
<!--本年与上年数据差异界面-->
......
......@@ -585,5 +585,63 @@
bottom: -10px;
}
.ack-page {
display: inline-block;
select {
border-radius: 3px;
}
.ack-footer {
display: inline-block;
float: right;
padding-right: 15px;
.page-size {
display: inline-block;
padding-right: 10px;
height: 100%;
float: left;
/* margin: 20px 0px; */
padding-top: 5px;
padding-left: 0;
margin: 20px 0;
border-radius: 4px;
clear: both;
color: #777777;
background-color: #ffffff;
border-color: #dddddd;
padding: 5px 10px;
font-size: 12px;
line-height: 1;
.total-number {
/*font-weight: bold;*/
padding: 0px 2px;
color: #dc6900;
}
.page-box {
width: 60px;
text-align: center;
}
.padding-span {
padding: 0px 2px;
}
.normal-number {
padding: 0px 2px;
color: #dc6900;
}
}
.page-uib {
float: right;
padding-right: 15px;
}
}
}
......@@ -49,15 +49,12 @@
};
//从数据库中load数据
var loadJournalEntryDataFromDB = function (pageIndex) {
initJournalEntryPagination();
$scope.curJournalEntryPage = pageIndex;
var loadJournalEntryDataFromDB = function () {
//初始化查询信息
$scope.queryParams.pageInfo = {
totalCount: $scope.queryJournalEntryResult.pageInfo.totalCount,
pageIndex: pageIndex,
pageSize: $scope.queryJournalEntryResult.pageInfo.pageSize,
totalCount: $scope.pagingOptions.totalItems,
pageIndex: $scope.pagingOptions.pageIndex,
pageSize: $scope.pagingOptions.pageSize,
totalPage: 0
};
$scope.getDataFromDatabase($scope.queryParams);
......@@ -72,79 +69,10 @@
v.index = index++;
});
$scope.gridOptions.data = data.list;
$scope.queryJournalEntryResult.pageInfo = data;
computeJournalEntryPage();
// $scope.ledgerName = data.list[0].ledgerName;
// $scope.currencyCode = data.list[0].currencyCode;
// $scope.status = data.list[0].status;
// $scope.importDate = $filter('date')(data.list[0].date, "yyyy-MM-dd hh:mm:ss");
}
});
};
//点击任意一页加载数据事件
var loadIncomeInvoiceDataByPage = function (pageIndex) {
loadJournalEntryDataFromDB(pageIndex);
};
//计算页数,创建分页栏
var computeJournalEntryPage = function () {
if ($scope.queryJournalEntryResult.pageInfo && $scope.queryJournalEntryResult.pageInfo.total > 0) {
var totalPage = parseInt($scope.queryJournalEntryResult.pageInfo.total / $scope.queryJournalEntryResult.pageInfo.pageSize);
totalPage = $scope.queryJournalEntryResult.pageInfo.totalCount % $scope.queryJournalEntryResult.pageInfo.pageSize == 0 ? totalPage : totalPage + 1;
//计算本页记录数
if ($scope.queryJournalEntryResult.pageInfo.pageNum === totalPage) {
$scope.curPageItemCount = $scope.queryJournalEntryResult.pageInfo.total % $scope.queryJournalEntryResult.pageInfo.pageSize;
$scope.pagingOptions.totalItems = data.total;
}
else {
$scope.curPageItemCount = $scope.queryJournalEntryResult.pageInfo.pageSize;
}
$scope.queryJournalEntryResult.pageInfo.totalPage = totalPage;
var createPage = $("#totalInvoicePage").createPage({
pageCount: totalPage,
current: $scope.curJournalEntryPage,
backFn: function (p) {
//单击回调方法,p是当前页码
loadIncomeInvoiceDataByPage(p);
}
});
$('#totalInvoicePage').css('display', 'inline-block');
} else {
//如果查询结果为0,则直接设置本页记录数为0
$scope.curPageItemCount = 0;
var createPage = $("#totalInvoicePage").createPage({
pageCount: 0,
current: $scope.curJournalEntryPage,
backFn: function (p) {
//单击回调方法,p是当前页码
loadIncomeInvoiceDataByPage(p);
}
});
$('#totalInvoicePage').css('display', 'inline-block');
}
};
//初始化分页信息
var initJournalEntryPagination = function () {
$scope.queryJournalEntryResult = {
list: [],
pageInfo: {
totalCount: -1,
pageIndex: 1,
pageSize: constant.pagesize,
totalPage: 0,
}
}
$scope.curJournalEntryPage = 1;
});
};
//将选择了的查询条件显示在grid上方
......@@ -153,38 +81,7 @@
$scope.queryParams.periodEnd = $scope.queryParams.periodStart;
}
//设置需要去掉的查询条件的值为空
if (!PWC.isNullOrEmpty(removeData)) {
var removeItem = removeData.split("|");
removeItem.forEach(function (v) {
$scope.queryParams[v] = null;
// if ($scope.queryParams.subjectCode === null) {
// $scope.queryParams.subjectCode = '';
// }
// if ($scope.queryParams.subjectName === null) {
// $scope.queryParams.subjectName = '';
// }
// if ($scope.queryParams.orgCode === null) {
// $scope.queryParams.orgCode = '';
// }
// if ($scope.queryParams.orgName === null) {
// $scope.queryParams.orgName = '';
// }
// if ($scope.queryParams.documentDate === null) {
// $scope.queryParams.documentDate = '';
// }
});
}
loadJournalEntryDataFromDB(1);
// if ($scope.criteriaList.length > 6) {
// $scope.criteriaListFirstRow = $scope.criteriaList.slice(0, 6);
// $scope.criteriaListSecondRow = $scope.criteriaList.slice(6, $scope.criteriaList.length);
// }
// else {
// $scope.criteriaListFirstRow = $scope.criteriaList.slice(0, $scope.criteriaList.length);
// }
loadJournalEntryDataFromDB();
$('.filter-button').popover("hide");
};
......@@ -203,7 +100,7 @@
};
$scope.queryParams.periodStart = vatSessionService.year * 100 + 1;
$scope.queryParams.periodEnd = vatSessionService.year * 100 + 12;
loadJournalEntryDataFromDB(1);
loadJournalEntryDataFromDB();
$('.filter-button').popover("hide");
};
......@@ -274,10 +171,21 @@
SweetAlert.error($translate.instant('PleaseContactAdministrator'));
});
};
$scope.refreshGrid = function () {
$log.debug("refreshGrid");
loadJournalEntryDataFromDB();
};
(function initialize() {
$log.debug('VatPreviewInputInvoiceController.ctor()...');
//分页的设置
$scope.pagingOptions = {
pageIndex: 1, //当前页码
totalItems: 0, //总数据
pageSize: 50 //每页多少条数据
};
$('#input-invoice-period-picker').focus(function () {
$('.filter-button').popover("hide");
});
......@@ -300,7 +208,7 @@
$scope.queryParams.periodStart = startMonth;
$scope.queryParams.periodEnd = endMonth;
loadJournalEntryDataFromDB(1);
loadJournalEntryDataFromDB();
});
......@@ -370,7 +278,6 @@
$scope.handleJournal = handleJournal;
initPeriods();
initJournalEntryPagination();
//初始化查询条件-期间范围
$scope.queryParams.periodStart = vatSessionService.year * 100 + 1;
$scope.queryParams.periodEnd = vatSessionService.year * 100 + 12;
......@@ -380,7 +287,7 @@
// }else{
// $('.periodInput')[0].style.left = "250px";
// }
loadJournalEntryDataFromDB(1);
loadJournalEntryDataFromDB();
})();
}
]);
......
......@@ -44,11 +44,11 @@
<div class="inputInvoiceGrid" ui-grid="gridOptions">
<div class="watermark" ng-show="!gridOptions.data.length"><span translate="NoDataAvailable"></span></div>
</div>
<div class="pagination-container">
<span>本页{{curPageItemCount}}条记录,共{{queryJournalEntryResult.pageInfo.total}}条记录</span>
<div id="totalInvoicePage" class="common-pagination" style="display:none;">
</div>
</div>
</div>
<div class="page-footer">
<ack-pagination page-options="pagingOptions"
refresh-table="refreshGrid()"></ack-pagination>
</div>
</div>
......@@ -130,7 +130,6 @@
/*Filter Criteria tags:*/
/*******************************************/
.main-area {
height: 100%;
margin: 0 20px;
.watermark {
......
......@@ -46,15 +46,12 @@
};
//从数据库中load数据
var loadJournalEntryDataFromDB = function (pageIndex) {
initJournalEntryPagination();
$scope.curJournalEntryPage = pageIndex;
var loadJournalEntryDataFromDB = function () {
//初始化查询信息
$scope.queryParams.pageInfo = {
totalCount: $scope.queryJournalEntryResult.pageInfo.totalCount,
pageIndex: pageIndex,
pageSize: $scope.queryJournalEntryResult.pageInfo.pageSize,
totalCount: $scope.pagingOptions.totalItems,
pageIndex: $scope.pagingOptions.pageIndex,
pageSize: $scope.pagingOptions.pageSize,
totalPage: 0
};
$scope.getDataFromDatabase($scope.queryParams);
......@@ -62,6 +59,7 @@
$scope.getDataFromDatabase = function (queryParams){
citPreviewService.getTbGeneVerData(queryParams).success(function (data) {
debugger;
if (data) {
// minDate = data.
var index = 1;
......@@ -69,110 +67,15 @@
v.index = index++;
});
$scope.gridOptions.data = data.list;
$scope.queryJournalEntryResult.pageInfo = data;
computeJournalEntryPage();
// $scope.ledgerName = data.list[0].ledgerName;
// $scope.currencyCode = data.list[0].currencyCode;
// $scope.status = data.list[0].status;
// $scope.importDate = $filter('date')(data.list[0].date, "yyyy-MM-dd hh:mm:ss");
}
});
};
//点击任意一页加载数据事件
var loadIncomeInvoiceDataByPage = function (pageIndex) {
loadJournalEntryDataFromDB(pageIndex);
};
//计算页数,创建分页栏
var computeJournalEntryPage = function () {
if ($scope.queryJournalEntryResult.pageInfo && $scope.queryJournalEntryResult.pageInfo.total > 0) {
var totalPage = parseInt($scope.queryJournalEntryResult.pageInfo.total / $scope.queryJournalEntryResult.pageInfo.pageSize);
totalPage = $scope.queryJournalEntryResult.pageInfo.totalCount % $scope.queryJournalEntryResult.pageInfo.pageSize == 0 ? totalPage : totalPage + 1;
//计算本页记录数
if ($scope.queryJournalEntryResult.pageInfo.pageNum === totalPage) {
$scope.curPageItemCount = $scope.queryJournalEntryResult.pageInfo.total % $scope.queryJournalEntryResult.pageInfo.pageSize;
}
else {
$scope.curPageItemCount = $scope.queryJournalEntryResult.pageInfo.pageSize;
}
$scope.queryJournalEntryResult.pageInfo.totalPage = totalPage;
var createPage = $("#totalInvoicePage").createPage({
pageCount: totalPage,
current: $scope.curJournalEntryPage,
backFn: function (p) {
//单击回调方法,p是当前页码
loadIncomeInvoiceDataByPage(p);
}
});
$('#totalInvoicePage').css('display', 'inline-block');
} else {
//如果查询结果为0,则直接设置本页记录数为0
$scope.curPageItemCount = 0;
var createPage = $("#totalInvoicePage").createPage({
pageCount: 0,
current: $scope.curJournalEntryPage,
backFn: function (p) {
//单击回调方法,p是当前页码
loadIncomeInvoiceDataByPage(p);
}
});
$('#totalInvoicePage').css('display', 'inline-block');
}
};
//初始化分页信息
var initJournalEntryPagination = function () {
$scope.queryJournalEntryResult = {
list: [],
pageInfo: {
totalCount: -1,
pageIndex: 1,
pageSize: constant.pagesize,
totalPage: 0,
$scope.pagingOptions.totalItems = data.total;
}
}
$scope.curJournalEntryPage = 1;
});
};
//将选择了的查询条件显示在grid上方
var doDataFilter = function (removeData) {
// if ($scope.queryParams.periodStart > $scope.queryParams.periodEnd) {
// $scope.queryParams.periodEnd = $scope.queryParams.periodStart;
// }
// 设置需要去掉的查询条件的值为空
if (!PWC.isNullOrEmpty(removeData)) {
var removeItem = removeData.split("|");
removeItem.forEach(function (v) {
$scope.queryParams[v] = null;
// if ($scope.queryParams.accountCode === null) {
// $scope.queryParams.accountCode = '';
// }
// if ($scope.queryParams.accountDescription === null) {
// $scope.queryParams.accountDescription = '';
// }
});
}
loadJournalEntryDataFromDB(1);
if ($scope.criteriaList.length > 6) {
$scope.criteriaListFirstRow = $scope.criteriaList.slice(0, 6);
$scope.criteriaListSecondRow = $scope.criteriaList.slice(6, $scope.criteriaList.length);
}
else {
$scope.criteriaListFirstRow = $scope.criteriaList.slice(0, $scope.criteriaList.length);
}
loadJournalEntryDataFromDB();
$('.filter-button').popover("hide");
};
......@@ -184,19 +87,11 @@
periodEnd: '',
accountCode:'',
accountDescription:'',
// segment3: null,
// segment3Name: null,
// segment5: null,
// segment5Name: null,
// segment6: null,
// segment6Name: null,
// description: null,
// containsAdjustmentRecord: null
projectId: vatSessionService.project.id
};
$scope.queryParams.periodStart = $scope.startMonth;
$scope.queryParams.periodEnd = $scope.endMonth;
loadJournalEntryDataFromDB(1);
loadJournalEntryDataFromDB();
$('.filter-button').popover("hide");
};
......@@ -250,10 +145,21 @@
SweetAlert.error($translate.instant('PleaseContactAdministrator'));
});
};
$scope.refreshGrid = function () {
$log.debug("refreshGrid");
loadJournalEntryDataFromDB();
};
(function initialize() {
$log.debug('citPreviewTbGeneVerController.ctor()...');
//分页的设置
$scope.pagingOptions = {
pageIndex: 1, //当前页码
totalItems: 0, //总数据
pageSize: 50 //每页多少条数据
};
$('#input-invoice-period-picker').focus(function () {
$('.filter-button').popover("hide");
});
......@@ -276,7 +182,7 @@
$scope.queryParams.periodStart = startMonth;
$scope.queryParams.periodEnd = endMonth;
loadJournalEntryDataFromDB(1);
loadJournalEntryDataFromDB();
});
......@@ -306,7 +212,7 @@
$scope.downloadJE = downloadJE;
initPeriods();
initJournalEntryPagination();
// initJournalEntryPagination();
//初始化查询条件-期间范围
$scope.queryParams.periodStart = vatSessionService.year * 100 + vatSessionService.month;
$scope.queryParams.periodEnd = vatSessionService.year * 100 + vatSessionService.month;
......@@ -316,7 +222,7 @@
}else{
$('.periodInput')[0].style.left = "150px";
}
loadJournalEntryDataFromDB(1);
loadJournalEntryDataFromDB();
})();
}
]);
......
......@@ -10,15 +10,17 @@
</button>
<span translate="TrialBalanceGeneVer" class="text-bold"></span> &nbsp;&nbsp;|&nbsp;&nbsp;
<span class="text-bold" translate="InvoiceQJ" style="display: none"></span>
<input type="text" class="form-control input-width-middle periodInput" style="position: relative; top: -30px; left: 180px;display: none;" id="input-invoice-period-picker" />
<span ng-click="downloadJE()" style="position: relative; left: 85%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span>
<input type="text" class="form-control input-width-middle periodInput"
style="position: relative; top: -30px; left: 180px;display: none;" id="input-invoice-period-picker"/>
<span ng-click="downloadJE()" style="position: relative; left: 80%;"><i class="fa fa-file-excel-o"
aria-hidden="true"></i>{{'ExportBtn' | translate}}</span>
</div>
<!--<div style="margin-bottom: 8px;margin-left: 30px">-->
<!--{{'EnterpriseAccountSetName' | translate}}<span class="numAmount">{{ledgerName}}</span>&nbsp;&nbsp;&nbsp;-->
<!--{{'EnterpriseAccountSetCurrency' | translate}}<span class="numAmount">{{currencyCode}}</span>&nbsp;&nbsp;&nbsp;-->
<!--{{'IsCloseAccount' | translate}}<span class="numAmount">{{status}}</span>-->
<!--{{'ImportTime' | translate}}<span class="numAmount">{{importDate| date:'yyyy-MM-dd hh:mm:ss'}}</span>-->
<!--{{'EnterpriseAccountSetName' | translate}}<span class="numAmount">{{ledgerName}}</span>&nbsp;&nbsp;&nbsp;-->
<!--{{'EnterpriseAccountSetCurrency' | translate}}<span class="numAmount">{{currencyCode}}</span>&nbsp;&nbsp;&nbsp;-->
<!--{{'IsCloseAccount' | translate}}<span class="numAmount">{{status}}</span>-->
<!--{{'ImportTime' | translate}}<span class="numAmount">{{importDate| date:'yyyy-MM-dd hh:mm:ss'}}</span>-->
<!--</div>-->
<div id="filterCriteriaDiv" style="max-width:98%;margin-bottom:2px;" ng-show="criteriaList.length>0">
......@@ -27,15 +29,18 @@
<span title="{{criteria.fullName}}">
{{criteria.name}}
</span>
<a><i class="remove glyphicon glyphicon-remove-sign glyphicon-white" ng-click="doDataFilter(criteria.propertyName)"></i></a>
<a><i class="remove glyphicon glyphicon-remove-sign glyphicon-white"
ng-click="doDataFilter(criteria.propertyName)"></i></a>
</span>
<span ng-if="criteriaList.length>6"><br /></span>
<span ng-if="criteriaList.length>6"><br/></span>
<span ng-if="criteriaList.length>6" style="margin-left: 81px; margin-top: 19px; display: inline-block;"></span>
<span ng-if="criteriaList.length>6" class="tag label label-default" ng-repeat="criteria in criteriaListSecondRow">
<span ng-if="criteriaList.length>6" class="tag label label-default"
ng-repeat="criteria in criteriaListSecondRow">
<span title="{{criteria.fullName}}">
{{criteria.name}}
</span>
<a><i class="remove glyphicon glyphicon-remove-sign glyphicon-white" ng-click="doDataFilter(criteria.propertyName)"></i></a>
<a><i class="remove glyphicon glyphicon-remove-sign glyphicon-white"
ng-click="doDataFilter(criteria.propertyName)"></i></a>
</span>
</div>
......@@ -43,11 +48,10 @@
<div class="inputInvoiceGrid" ui-grid="gridOptions">
<div class="watermark" ng-show="!gridOptions.data.length"><span translate="NoDataAvailable"></span></div>
</div>
<div class="pagination-container">
<span>本页{{curPageItemCount}}条记录,共{{queryJournalEntryResult.pageInfo.total}}条记录</span>
<div id="totalInvoicePage" class="common-pagination" style="display:none;">
</div>
</div>
</div>
<div class="page-footer">
<ack-pagination page-options="pagingOptions"
refresh-table="refreshGrid()"></ack-pagination>
</div>
</div>
......@@ -79,7 +79,6 @@
/*Filter Criteria tags:*/
/*******************************************/
.main-area {
height: 100%;
margin: 0 20px;
.watermark {
......
......@@ -50,15 +50,12 @@
};
//从数据库中load数据
var loadJournalEntryDataFromDB = function (pageIndex) {
initJournalEntryPagination();
$scope.curJournalEntryPage = pageIndex;
var loadJournalEntryDataFromDB = function () {
//初始化查询信息
$scope.queryParams.pageInfo = {
totalCount: $scope.queryJournalEntryResult.pageInfo.totalCount,
pageIndex: pageIndex,
pageSize: $scope.queryJournalEntryResult.pageInfo.pageSize,
totalCount: $scope.pagingOptions.totalItems,
pageIndex: $scope.pagingOptions.pageIndex,
pageSize: $scope.pagingOptions.pageSize,
totalPage: 0
};
$scope.getDataFromDatabase($scope.queryParams);
......@@ -73,135 +70,32 @@
v.index = index++;
});
$scope.gridOptions.data = data.list;
$scope.queryJournalEntryResult.pageInfo = data;
computeJournalEntryPage();
// $scope.ledgerName = data.list[0].ledgerName;
// $scope.currencyCode = data.list[0].currencyCode;
// $scope.status = data.list[0].status;
// $scope.importDate = $filter('date')(data.list[0].date, "yyyy-MM-dd hh:mm:ss");
}
});
};
//点击任意一页加载数据事件
var loadIncomeInvoiceDataByPage = function (pageIndex) {
loadJournalEntryDataFromDB(pageIndex);
};
//计算页数,创建分页栏
var computeJournalEntryPage = function () {
if ($scope.queryJournalEntryResult.pageInfo && $scope.queryJournalEntryResult.pageInfo.total > 0) {
var totalPage = parseInt($scope.queryJournalEntryResult.pageInfo.total / $scope.queryJournalEntryResult.pageInfo.pageSize);
totalPage = $scope.queryJournalEntryResult.pageInfo.totalCount % $scope.queryJournalEntryResult.pageInfo.pageSize == 0 ? totalPage : totalPage + 1;
//计算本页记录数
if ($scope.queryJournalEntryResult.pageInfo.pageNum === totalPage) {
$scope.curPageItemCount = $scope.queryJournalEntryResult.pageInfo.total % $scope.queryJournalEntryResult.pageInfo.pageSize;
}
else {
$scope.curPageItemCount = $scope.queryJournalEntryResult.pageInfo.pageSize;
}
$scope.queryJournalEntryResult.pageInfo.totalPage = totalPage;
var createPage = $("#totalInvoicePage").createPage({
pageCount: totalPage,
current: $scope.curJournalEntryPage,
backFn: function (p) {
//单击回调方法,p是当前页码
loadIncomeInvoiceDataByPage(p);
}
});
$('#totalInvoicePage').css('display', 'inline-block');
} else {
//如果查询结果为0,则直接设置本页记录数为0
$scope.curPageItemCount = 0;
var createPage = $("#totalInvoicePage").createPage({
pageCount: 0,
current: $scope.curJournalEntryPage,
backFn: function (p) {
//单击回调方法,p是当前页码
loadIncomeInvoiceDataByPage(p);
}
});
$('#totalInvoicePage').css('display', 'inline-block');
}
};
//初始化分页信息
var initJournalEntryPagination = function () {
$scope.queryJournalEntryResult = {
list: [],
pageInfo: {
totalCount: -1,
pageIndex: 1,
pageSize: constant.pagesize,
totalPage: 0,
$scope.pagingOptions.totalItems = data.total;
}
}
$scope.curJournalEntryPage = 1;
});
};
//将选择了的查询条件显示在grid上方
var doDataFilter = function (removeData) {
// if ($scope.queryParams.periodStart > $scope.queryParams.periodEnd) {
// $scope.queryParams.periodEnd = $scope.queryParams.periodStart;
// }
// 设置需要去掉的查询条件的值为空
if (!PWC.isNullOrEmpty(removeData)) {
var removeItem = removeData.split("|");
removeItem.forEach(function (v) {
$scope.queryParams[v] = null;
// if ($scope.queryParams.accountCode === null) {
// $scope.queryParams.accountCode = '';
// }
// if ($scope.queryParams.accountDescription === null) {
// $scope.queryParams.accountDescription = '';
// }
// if ($scope.queryParams.attribute === null) {
// $scope.queryParams.attribute = '';
// }
});
}
loadJournalEntryDataFromDB(1);
if ($scope.criteriaList.length > 6) {
$scope.criteriaListFirstRow = $scope.criteriaList.slice(0, 6);
$scope.criteriaListSecondRow = $scope.criteriaList.slice(6, $scope.criteriaList.length);
}
else {
$scope.criteriaListFirstRow = $scope.criteriaList.slice(0, $scope.criteriaList.length);
}
loadJournalEntryDataFromDB();
$('.filter-button').popover("hide");
};
//去掉所有的查询条件,重新load数据
var doDataFilterReset = function () {
$scope.queryParams = {
pageInfo: {},
periodStart: '',
periodEnd: '',
// segment3: null,
// segment3Name: null,
// segment5: null,
// segment5Name: null,
// segment6: null,
// segment6Name: null,
// description: null,
// containsAdjustmentRecord: null
pageInfo : {},
periodStart : '',
periodEnd : '',
accountCode : '',
accountDescription : '',
attribute : '',
projectId: vatSessionService.project.id
};
$scope.queryParams.periodStart = $scope.startMonth;
$scope.queryParams.periodEnd = $scope.endMonth;
loadJournalEntryDataFromDB(1);
loadJournalEntryDataFromDB();
$('.filter-button').popover("hide");
};
......@@ -256,9 +150,21 @@
});
};
$scope.refreshGrid = function () {
$log.debug("refreshGrid");
loadJournalEntryDataFromDB();
};
(function initialize() {
$log.debug('citPreviewTbGeneVerController.ctor()...');
//分页的设置
$scope.pagingOptions = {
pageIndex: 1, //当前页码
totalItems: 0, //总数据
pageSize: 50 //每页多少条数据
};
$('#input-invoice-period-picker').focus(function () {
$('.filter-button').popover("hide");
});
......@@ -281,7 +187,7 @@
$scope.queryParams.periodStart = startMonth;
$scope.queryParams.periodEnd = endMonth;
loadJournalEntryDataFromDB(1);
loadJournalEntryDataFromDB();
});
......@@ -312,7 +218,6 @@
$scope.downloadJE = downloadJE;
initPeriods();
initJournalEntryPagination();
//初始化查询条件-期间范围
$scope.queryParams.periodStart = vatSessionService.year * 100 + vatSessionService.month;
$scope.queryParams.periodEnd = vatSessionService.year * 100 + vatSessionService.month;
......@@ -322,7 +227,7 @@
}else{
$('.periodInput')[0].style.left = "150px";
}
loadJournalEntryDataFromDB(1);
loadJournalEntryDataFromDB();
})();
}
]);
......
......@@ -43,11 +43,11 @@
<div class="inputInvoiceGrid" ui-grid="gridOptions">
<div class="watermark" ng-show="!gridOptions.data.length"><span translate="NoDataAvailable"></span></div>
</div>
<div class="pagination-container">
<span>本页{{curPageItemCount}}条记录,共{{queryJournalEntryResult.pageInfo.total}}条记录</span>
<div id="totalInvoicePage" class="common-pagination" style="display:none;">
</div>
</div>
</div>
<div class="page-footer">
<ack-pagination page-options="pagingOptions"
refresh-table="refreshGrid()"></ack-pagination>
</div>
</div>
......@@ -79,7 +79,6 @@
/*Filter Criteria tags:*/
/*******************************************/
.main-area {
height: 100%;
margin: 0 20px;
.watermark {
......
......@@ -658,7 +658,7 @@
// 更新数据源后,通过调用该方法计算所有当前sheet单元格,并通过比较原数据列表与spreadJS计算的新值列表,获取保存时需要修改库中Value的单元格信息列表
var updateCells = function () {
loadSheet(scope.templateId, true);
return cells;
// return cells;
};
(function initialize() {
......
......@@ -916,7 +916,7 @@
$scope.openExportPop = function (evenType) {
$scope.evenType = evenType;
var grp = _.find($scope.$parent.$parent.groups, function (g) {
return g.name == 'TaxReturnType';
return g.name == 'TaxReturnType' || g.name == 'WorkingPaperType';
});
if (!grp || !grp.children) {
......
......@@ -1436,9 +1436,13 @@ constant.EquityCurrency = [
constant.GroupTypeList = [
{code: 0, type: "增值税"},
{code: 1, type: "印花税"},
{code: 2, type: "企业所得税"},
{code: 3, type: "国际税"}
{code: 1, type: "企业所得税"},
{code: 2, type: "印花税"},
{code: 3, type: "城建税"},
{code: 4, type: "教育费附加"},
{code: 5, type: "地方教育费附加"},
{code: 6, type: "个人所得税"},
{code: 7, type: "国际税"}
];
constant.InvoiceTypeList = [
......
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=favicon.ico><title>didi2</title><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Material+Icons"><link href=js/about.17654e8a.js rel=prefetch><link href=css/app.cf16809e.css rel=preload as=style><link href=css/chunk-vendors.2f35f377.css rel=preload as=style><link href=js/app.b7d8d35c.js rel=preload as=script><link href=js/chunk-vendors.39b13767.js rel=preload as=script><link href=css/chunk-vendors.2f35f377.css rel=stylesheet><link href=css/app.cf16809e.css rel=stylesheet></head><body><noscript><strong>We're sorry but didi2 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.39b13767.js></script><script src=js/app.b7d8d35c.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=favicon.ico><title>didi2</title><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"><link rel=stylesheet href="https://fonts.googleapis.com/css?family=Material+Icons"><link href=js/about.17654e8a.js rel=prefetch><link href=css/app.cf16809e.css rel=preload as=style><link href=css/chunk-vendors.2f35f377.css rel=preload as=style><link href=js/app.224d7e8d.js rel=preload as=script><link href=js/chunk-vendors.39b13767.js rel=preload as=script><link href=css/chunk-vendors.2f35f377.css rel=stylesheet><link href=css/app.cf16809e.css rel=stylesheet></head><body><noscript><strong>We're sorry but didi2 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.39b13767.js></script><script src=js/app.224d7e8d.js></script></body></html>
\ 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