Commit f7a8d289 authored by gary's avatar gary

1、导入记录添加分页

2、fixbug
3、机构信息初始化
parent b50a3f69
......@@ -52,7 +52,8 @@ public enum OperationModule {
OrganizationTaxRule(40),
Equity(41),
OrganizationEmployee(42),
OrganizationTaxpayerQualification(43);
OrganizationTaxpayerQualification(43),
InitEquity(44);
private int value;
......
......@@ -20,6 +20,7 @@ public class LogMessage {
public static final String UpdateOrganizationEquity = "UpdateOrganizationEquity";
public static final String DeleteOrganizationEquity = "DeleteOrganizationEquity";
public static final String InitOrganizationEquity = "InitOrganizationEquity";
public static final String ChangeOrganizationEquity = "ChangeOrganizationEquity";
public static final String CancelChangeUpdateOrganizationEquity = "CancelChangeUpdateOrganizationEquity";
......
......@@ -10,7 +10,9 @@ public enum EnumImportType {
CoupaPurchasingReport(6),
InvoiceData(7),
CertifiedInvoicesList(8),
InvoiceRecord(9)
InvoiceRecord(9),
ExtractFinancialData(10),
ExtractInvoiceData(11)
;
private Integer code;
......
package pwc.taxtech.atms.constant.enums;
import java.util.HashMap;
import java.util.Map;
/**
* @Auther: Gary J Li
* @Date: 26/02/2019 13:50
* @Description:
*/
public enum NationalEconomicIndustryEnum {
A("农、林、牧、渔业"),
B("采矿业"),
C("制造业"),
D("电力、热力、燃气及水生产和供应业"),
E("建筑业"),
F("批发和零售业"),
G("交通运输、仓储和邮政业"),
H("住宿和餐饮业"),
I("信息传输、软件和信息技术服务业"),
J("金融业"),
K("房地产业"),
L("租赁和商务服务业"),
M("科学研究和技术服务业"),
N("水利、环境和公共设施管理业"),
O("居民服务、修理和其他服务业"),
P("教育"),
Q("卫生和社会工作"),
R("文化、体育和娱乐业"),
S("公共管理、社会保障和社会组织"),
T("国际组织") ;
private String name;
public static final Map<String, String> Map = new HashMap<>();
static {
for (NationalEconomicIndustryEnum kv : NationalEconomicIndustryEnum.values()) {
Map.put(kv.getName(), kv.name());
}
}
NationalEconomicIndustryEnum(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
......@@ -6,10 +6,9 @@ import com.google.common.collect.Lists;
import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.message.ErrorMessage;
import pwc.taxtech.atms.dpo.PagingDto;
import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.dto.DataImportLogDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.PagingResultDto;
import pwc.taxtech.atms.dto.*;
import pwc.taxtech.atms.dto.dataimport.DataImportParam;
import pwc.taxtech.atms.dto.input.CamelPagingResultDto;
import pwc.taxtech.atms.dto.vatdto.TrialBalanceDto;
import pwc.taxtech.atms.dto.vatdto.TrialBalanceParam;
import pwc.taxtech.atms.exception.ServiceException;
......@@ -198,14 +197,34 @@ public class DataImportController extends BaseController {
}
@ResponseBody
@RequestMapping(value = "displayImportLog", method = RequestMethod.GET)
public List<DataImportLogDto> displayImportLog(@RequestParam Integer type) {
List<DataImportLogDto> dataImportLogDtos = Lists.newArrayList();
@RequestMapping(value = "displayImportLog", method = RequestMethod.POST)
public CamelPagingResultDto<DataImportLogDto> displayImportLog(@RequestBody DataImportParam param) {
return new CamelPagingResultDto<>(dataImportService.displayImportLog(param));
}
@ResponseBody
@RequestMapping(value = "callExtractFinancialData", method = RequestMethod.POST)
public OperationResultDto callExtractFinancialData(@RequestBody DataExtractParam dataExtractParam) {
try {
dataImportLogDtos = dataImportService.displayImportLog(type);
return dataImportService.callExtractFinancialData(dataExtractParam);
} catch (ServiceException e) {
return OperationResultDto.error(e.getMessage());
} catch (Exception e) {
logger.error("displayImportLog error.", e);
logger.error("callExtractFinancialData error.", e);
return OperationResultDto.error(ErrorMessage.SystemError);
}
}
@ResponseBody
@RequestMapping(value = "callExtractInvoiceData", method = RequestMethod.POST)
public OperationResultDto callExtractInvoiceData(@RequestBody DataExtractParam dataExtractParam) {
try {
return dataImportService.callExtractInvoiceData(dataExtractParam);
} catch (ServiceException e) {
return OperationResultDto.error(e.getMessage());
} catch (Exception e) {
logger.error("callExtractInvoiceData error.", e);
return OperationResultDto.error(ErrorMessage.SystemError);
}
return dataImportLogDtos;
}
}
......@@ -6,10 +6,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import pwc.taxtech.atms.dpo.OrgBasicDto;
import pwc.taxtech.atms.dpo.OrgInfoDto;
import pwc.taxtech.atms.dpo.OrgSimpleDto;
import pwc.taxtech.atms.dpo.OrganizationDto;
import pwc.taxtech.atms.dpo.*;
import pwc.taxtech.atms.dto.*;
import pwc.taxtech.atms.dto.organization.OrganizationExtraDto;
import pwc.taxtech.atms.dto.dimension.DimensionOrgDtoDashboard;
......@@ -93,9 +90,10 @@ public class OrganizationController {
return organizationService.getOrgInfo();
}
// 这是这个重复的方法
@RequestMapping(value = "getOrgListByUserId", method = RequestMethod.GET)
public @ResponseBody
List<OrgSimpleDto> getOrgSimpleList() {
List<OrgSelectDto> getOrgSimpleList() {
logger.info("GET /api/v1/org/getOrgListByUserId");
return organizationService.getOrgSimpleList();
}
......
package pwc.taxtech.atms.dto;
import java.util.List;
public class DataExtractParam {
private String period;
private List<String> orgIds;
private List<Integer> dataTypes;
public String getPeriod() {
return period;
}
public void setPeriod(String period) {
this.period = period;
}
public List<String> getOrgIds() {
return orgIds;
}
public void setOrgIds(List<String> orgIds) {
this.orgIds = orgIds;
}
public List<Integer> getDataTypes() {
return dataTypes;
}
public void setDataTypes(List<Integer> dataTypes) {
this.dataTypes = dataTypes;
}
}
package pwc.taxtech.atms.dto.dataimport;
import pwc.taxtech.atms.dto.input.CamelPagingDto;
import pwc.taxtech.atms.vat.entity.RevenueConfig;
public class DataImportParam {
private CamelPagingDto pageInfo;
private Integer type;
public CamelPagingDto getPageInfo() {
return this.pageInfo;
}
public void setPageInfo(CamelPagingDto pageInfo) {
this.pageInfo = pageInfo;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
}
package pwc.taxtech.atms.service.impl;
import java.util.Date;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
......@@ -17,8 +20,11 @@ import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.constant.enums.EnumImportType;
import pwc.taxtech.atms.constant.enums.EnumTbImportType;
import pwc.taxtech.atms.dao.*;
import pwc.taxtech.atms.dpo.OrgSelectDto;
import pwc.taxtech.atms.dto.DataExtractParam;
import pwc.taxtech.atms.dto.DataImportLogDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.dataimport.DataImportParam;
import pwc.taxtech.atms.dto.vatdto.TrialBalanceDto;
import pwc.taxtech.atms.dto.vatdto.TrialBalanceParam;
import pwc.taxtech.atms.entity.*;
......@@ -78,6 +84,8 @@ public class DataImportService extends BaseService {
private CertifiedInvoicesListMapper certifiedInvoicesListMapper;
@Resource
private InvoiceRecordMapper invoiceRecordMapper;
@Autowired
private OrganizationServiceImpl organizationService;
/**
* TB表查询
......@@ -1543,21 +1551,38 @@ public class DataImportService extends BaseService {
return res;
}
public List<DataImportLogDto> displayImportLog(Integer type) {
List<DataImportLogDto> dataImportLogDtos = Lists.newArrayList();
DataImportLogExample dataImportLogExample = new DataImportLogExample();
if(EnumImportType.Undefined.getCode().equals(type)){
dataImportLogExample.setOrderByClause("update_time desc");
}else{
dataImportLogExample.createCriteria().andTypeEqualTo(type).andDisplayEqualTo(true);
dataImportLogExample.setOrderByClause("update_time desc");
/**
* 25/02/2019 18:52
*
* [type]
* @author Gary J Li
* @return
*
*/
public PageInfo<DataImportLogDto> displayImportLog(DataImportParam param) {
DataImportLogExample example = new DataImportLogExample();
DataImportLogExample.Criteria criteria =example.createCriteria();
Page page = PageHelper.startPage(param.getPageInfo().getPageIndex(), param.getPageInfo().getPageSize());
List<String> orgIds = organizationService.getMyOrgList().stream().map(OrgSelectDto::getId).collect(Collectors.toList());
// 这里会导致任何人都可以看到未映射到主体的数据
orgIds.add("");
if(!EnumImportType.Undefined.getCode().equals(param.getType())){
criteria.andTypeEqualTo(param.getType()).andDisplayEqualTo(true);
criteria.andOrganizationIdIn(orgIds);
}
dataImportLogMapper.selectByExample(dataImportLogExample).forEach( dil ->{
DataImportLogDto dataImportLogDto = new DataImportLogDto();
beanUtil.copyProperties(dil,dataImportLogDto);
dataImportLogDtos.add(dataImportLogDto);
});
return dataImportLogDtos;
example.setOrderByClause("update_time desc");
PageInfo<DataImportLogDto> pageInfo = new PageInfo<>(dataImportLogMapper.selectByExample(example).stream()
.map(o -> beanUtil.copyProperties(o, new DataImportLogDto())).collect(Collectors.toList()));
pageInfo.setTotal(page.getTotal());
return pageInfo;
}
private boolean isSheetEmpty(Sheet sheet) {
......@@ -1568,4 +1593,37 @@ public class DataImportService extends BaseService {
}
return false;
}
public OperationResultDto callExtractFinancialData(DataExtractParam dataExtractParam) {
// todo 调用滴滴的http财务数据抽取调用接口 List<String> codes, Integer period, List<Integer> dataTypes
OrganizationExample example = new OrganizationExample();
example.createCriteria().andIdIn(dataExtractParam.getOrgIds());
List<String> codes = organizationMapper.selectByExample(example).stream().map(Organization::getCode).collect(Collectors.toList());
Integer tmsPeriod = DateUtils.strToPeriod(dataExtractParam.getPeriod());
// data_import_log 日志记录为 EnumImportType.ExtractFinancialData
return OperationResultDto.success();
}
/**
* 25/02/2019 18:26
*
* [orgIds, period, dataTypes]
* @author Gary J Li
* @return
* remark:1、这里重复写了,因为可能调用场景不同?
*/
public OperationResultDto callExtractInvoiceData(DataExtractParam dataExtractParam) {
// todo 调用滴滴的http发票数据抽取调用接口 List<String> codes, Integer period, List<Integer> dataTypes
OrganizationExample example = new OrganizationExample();
example.createCriteria().andIdIn(dataExtractParam.getOrgIds());
List<String> codes = organizationMapper.selectByExample(example).stream().map(Organization::getCode).collect(Collectors.toList());
Integer tmsPeriod = DateUtils.strToPeriod(dataExtractParam.getPeriod());
// data_import_log 日志记录为 EnumImportType.ExtractInvoiceData
return OperationResultDto.success();
}
}
package pwc.taxtech.atms.service.impl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import pwc.taxtech.atms.common.OperateLogType;
import pwc.taxtech.atms.common.OperationAction;
import pwc.taxtech.atms.common.OperationModule;
......@@ -217,7 +215,7 @@ public class EquityServiceImpl extends BaseService{
} else {
opLog.setAction(OperationAction.ChangeEquity.value());
}
opLog.setOperationContent(LogMessage.IsActive);
opLog.setOperationContent(LogMessage.ChangeOrganizationEquity);
opLog.setOperationObject(orgName);
opLog.setOriginalState(oldId == null ? "" : String.valueOf(oldId));
opLog.setUpdateState(String.valueOf(newId));
......
......@@ -2777,9 +2777,9 @@ public class OrganizationServiceImpl extends BaseService{
* @author Gary J Li
* @return
*/
public List<OrgSimpleDto> getOrgSimpleList() {
public List<OrgSelectDto> getOrgSimpleList() {
String userId = authUserHelper.getCurrentUserId();
List<OrgSimpleDto> orgSimpleDtos = Lists.newArrayList();
List<OrgSelectDto> orgSelectDtos = Lists.newArrayList();
UserOrganizationExample userOrganizationExample = new UserOrganizationExample();
userOrganizationExample.createCriteria().andUserIdEqualTo(userId);
List<UserOrganization> userOrganizations = userOrganizationMapper.selectByExample(userOrganizationExample);
......@@ -2788,10 +2788,10 @@ public class OrganizationServiceImpl extends BaseService{
organizationExample.createCriteria().andIdIn(orgIds);
List<Organization> organizations = organizationMapper.selectByExample(organizationExample);
organizations.forEach(o -> {
OrgSimpleDto orgSimpleDto = beanUtil.copyProperties(o,new OrgSimpleDto());
orgSimpleDtos.add(orgSimpleDto);
OrgSelectDto orgSelectDto = beanUtil.copyProperties(o,new OrgSelectDto());
orgSelectDtos.add(orgSelectDto);
});
return orgSimpleDtos;
return orgSelectDtos;
}
/**
......
package pwc.taxtech.atms;
import java.util.HashMap;
import java.util.Map;
/**
* @Auther: Gary J Li
* @Date: 26/02/2019 13:50
* @Description:
*/
public enum OrgKV {
orgId("organizationId", "机构代码"),
registrationCapital("registrationCapital", "注册资本"),
paidInCapital("paidInCapital", "实缴资本"),
regStatus("regStatus", "经营状态"),
foundationDate("foundationDate", "成立日期"),
legalCode("legalCode", "统一社会信用代码"),
taxPayerNumber("taxPayerNumber", "纳税人识别号"),
// dontKnow("clientCode", "注册号"),
// dontKnow1("?", "组织机构代码"),
registrationType("registrationType", "公司类型"),
nationalEconomicIndustry("nationalEconomicIndustry", "所属行业"),//所属国民经济行业
// area("area", "所属地区"),
englishName("englishName", "英文名"),
employeesNumEnd("employeesNumEnd", "参保人数"),
registerAddress("registerAddress", "企业地址"),
businessScope("businessScope", "经营范围"),
eNum("eNum", "序号"),
investorName("investorName", "股东(发起人)"),
investmentRadio("investmentRadio", "持股比例"),//投资比例
investmentAmount("investmentAmount", "认缴出资额"),//投资金额
investmentAmount1("investmentAmount", "认缴出资额(万元)"),//投资金额
investmentAmount2("investmentAmount", "认缴出资额(万美元)"),//投资金额
// registrationCapital("registrationCapital", "认缴出资日期"),
payableCapitalContributionAmount("payableCapitalContributionAmount", "实缴出资额(万元)"),//实缴出资金额
// registrationCapital("registrationCapital", "实缴出资日期"),
createTime("createTime", "变更日期"),
comment("comment", "变更项目"),
originalState("originalState", "变更前"),
updateState("updateState", "变更后");
private String attribute;
private String name;
public static final Map<String, String> Map = new HashMap<>();
static {
for (OrgKV kv : OrgKV.values()) {
Map.put(kv.getName(), kv.getAttribute());
}
}
OrgKV(String attribute, String name) {
this.attribute = attribute;
this.name = name;
}
public String getAttribute() {
return attribute;
}
public String getName() {
return name;
}
}
package pwc.taxtech.atms.dto;
import java.util.List;
import java.util.Map;
/**
* @Auther: Gary J Li
* @Date: 26/02/2019 12:45
* @Description:
*/
public class OrgDto {
private List<Map> orgs;
public List<Map> getOrgs() {
return orgs;
}
public void setOrgs(List<Map> orgs) {
this.orgs = orgs;
}
}
package pwc.taxtech.atms.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyMapper;
import pwc.taxtech.atms.entity.OperationLogEquity;
import pwc.taxtech.atms.entity.OperationLogEquityExample;
@Mapper
public interface OperationLogEquityMapper extends MyMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_equity
*
* @mbg.generated
*/
long countByExample(OperationLogEquityExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_equity
*
* @mbg.generated
*/
int deleteByExample(OperationLogEquityExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_equity
*
* @mbg.generated
*/
int deleteByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_equity
*
* @mbg.generated
*/
int insert(OperationLogEquity record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_equity
*
* @mbg.generated
*/
int insertSelective(OperationLogEquity record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_equity
*
* @mbg.generated
*/
List<OperationLogEquity> selectByExampleWithRowbounds(OperationLogEquityExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_equity
*
* @mbg.generated
*/
List<OperationLogEquity> selectByExample(OperationLogEquityExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_equity
*
* @mbg.generated
*/
OperationLogEquity selectByPrimaryKey(String id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_equity
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") OperationLogEquity record, @Param("example") OperationLogEquityExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_equity
*
* @mbg.generated
*/
int updateByExample(@Param("record") OperationLogEquity record, @Param("example") OperationLogEquityExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_equity
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(OperationLogEquity record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operation_log_equity
*
* @mbg.generated
*/
int updateByPrimaryKey(OperationLogEquity record);
}
\ No newline at end of file
......@@ -91,104 +91,9 @@
style="margin-top: 30px;">
</div>
</div>
</div>
<div class="error-info-wrapper" id="error-info-wrapper" ng-show="showErrorTable">
<div ui-grid="gridOptionsErrorMsg" style="width:100%;" ng-style="getErrorGridHeight()"></div>
</div>
<div>
<div ng-show="showErrorTable" id="content-resizer"
resizer="horizontal"
resizer-height="6"
bottom-min="0"
bottom-max="400"
resizer-top="#balance-ouput-grid-wrapper"
resizer-bottom="#error-info-wrapper">
<div id="topIcon" ng-click="toggleErrorTab()">
<img src="../../../../app-resources/images/collapse.png" />
</div>
</div>
</div>
</div>
<!--期间验证明细-->
<div class="period-validation-modal">
<div class="modal fade" id="periodValidationModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width: 75%; height: 200px;" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="modal-title">
{{'ErrorDetails' | translate}}
</div>
</div>
<div class="modal-body">
<div style="border: 1px solid #959595; text-align: center;" id="gridPeriodValidation" dx-data-grid="gridPeriodOptions"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" translate="Confirm" data-dismiss="modal"></button>
</div>
</div>
</div>
</div>
</div>
<!--重复验证明细-->
<div class="duplicate-validation-modal">
<div class="modal fade" id="duplicatedValidationModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width: 75%; height: 200px;" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="modal-title">
{{'ErrorDetails' | translate}}
</div>
</div>
<div class="modal-body">
<div style="border: 1px solid #959595; text-align: center; " id="gridDuplicatedValidation" dx-data-grid="gridDuplicatedOptions"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" translate="BtnDelete" ng-click="deleteDupData()" ng-disabled="!hasEditPermission"></button>
<button type="button" class="btn btn-customer" translate="ButtonCancel" data-dismiss="modal"></button>
</div>
</div>
</div>
</div>
</div>
<!--错误验证信息-->
<div class="error-list-modal">
<div class="modal fade" id="errorListModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width: 720px; height: 200px;" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="modal-title">
{{'ImportErrorPopUpTitle' | translate}}
</div>
</div>
<div class="modal-body">
{{'ImportErrorPopUpErrorDetail' | translate}}:
<br />
<table>
<thead>
<tr>
<th width="10%" style="text-align:center;">{{'ImportErrorPopUpNoCol' | translate}}</th>
<th width="20%">{{'ImportErrorPopUpErrorTypeCol' | translate}}</th>
<th width="10%" style="text-align:center;">{{'ImportErrorPopUpErrorCountCol' | translate}}</th>
<th width="6%">{{'ImportErrorPopUpErrorDescCol' | translate}}</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="error in errorMsgMap track by $index">
<td width="10%" style="text-align:center;">{{$index + 1}}</td>
<td width="20%">{{error.errorType}}</td>
<td width="10%" style="text-align:center;">{{error.errorCount}}</td>
<td width="60%" ng-bind-html="error.errorContent"></td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" translate="Confirm" data-dismiss="modal"></button>
</div>
</div>
<div class="page-footer">
<ack-pagination page-options="pagingOptions"
refresh-table="refreshConfigGrid()"></ack-pagination>
</div>
</div>
</div>
......@@ -211,10 +116,8 @@
<div class="modal-footer">
<button type="button" class="btn btn-primary" ng-click="deleteTbData()">{{'Confirm' | translate}}</button>
</div>
</script>
<vat-operate-log period="period" module-type="moduleid" is-show="isShowLog"></vat-operate-log>
</div>
......
......@@ -760,22 +760,6 @@
});
};
//显示图标
var errorLevelToString = function (errorLevel) {
if (errorLevel === 0) {
return '/app-resources/images/vat/error.png';
}
if (errorLevel === 1) {
return '/app-resources/images/vat/warning.png';
}
if (errorLevel === 2) {
return '/app-resources/images/vat/tips.png';
}
else {
return '/app-resources/images/vat/tips.png';
}
}
//刷新操作
var refreshTbData = function () {
logDto.ID = PWC.newGuid();
......@@ -825,27 +809,11 @@
}
};
var getErrorGridHeight = function () {
if ($scope.isLoadComplete) {
var y = $("#error-info-wrapper").height();
// Enough space
if (y > constant.UIGrid.gapHeight) {
y = y - constant.UIGrid.gapHeight;
return { height: y + "px" };
} else {
return { height: '0px' };
}
}
return {};
};
var loadImportPLStatusInfoDatagrid = function () {
var loadImportBSStatusInfoDatagrid = function () {
$scope.importPLStatusGridOptions = {
bindingOptions: {
dataSource: 'ImportPLStatusGridSource'
dataSource: 'ImportBSStatusGridSource'
},
showBorders: true,
columns: [{
......@@ -896,7 +864,7 @@
}
],
onContentReady: function (e) {
$scope.accountingRateListInstance = e.component;
$scope.pLStatusInstance = e.component;
var totalCount = e.component.totalCount();
if (totalCount > 0) {
$scope.totalCount = totalCount;
......@@ -931,85 +899,26 @@
getImportBSStatus();
};
var getImportBSStatus = function () {
vatImportService.displayImportLog(constant.importFileType.balanceSheet).success(function (data) {
if (data) {
$scope.ImportPLStatusGridSource = data;
for (var i = 1; i <= $scope.AccountingRateGridSource.length; i++) {
$scope.AccountingRateGridSource[i - 1].index = i;
}
}
});
};
var initImportPLStatusFromDB = function () {
//刷新页面
$scope.refreshConfigGrid = function () {
getImportBSStatus();
};
//获取验证信息
var GetValidationList = function () {
vatImportService.getServiceValidationList($scope.validationType, $scope.period, $scope.serviceTypeId, $scope.projectID).success(function (data) {
if (data.length > 0) {
var index = 1;
data.forEach(function (v) {
v.index = index++;
});
$scope.errorList = data;
$scope.gridOptionsErrorMsg.data = data;
showErrTab();
$scope.toggleErrorTab();
$scope.showErrorTable = true;
}
else {
$scope.errorList = [];
$scope.gridOptionsErrorMsg.data = [];
$scope.showErrorTable = false;
$scope.ImportErrorTab = false;
$scope.ImportErrorTag = false;
var getImportBSStatus = function () {
vatImportService.displayImportLog($scope.pagingOptions,constant.importFileType.balanceSheet).success(function (data) {
if (data && data.list) {
$scope.ImportBSStatusGridSource = data.list;
$scope.pagingOptions.totalItems = data.pageInfo.totalCount;
}else {
SweetAlert.error($translate.instant('SystemError'));
}
}).error(function () {
SweetAlert.error($translate.instant('PleaseContactAdministrator'));
});
}
//显示验证信息
var toggleErrorTab = function () {
$scope.ImportErrorTag = !$scope.ImportErrorTag;
// topIcon and content-resize gapBottom 15px
if (!$scope.ImportErrorTag) {
setErrorWrapCssDefault();
} else {
if (parseInt($('#content-resizer').css('bottom')) < 100) {
$('#content-resizer').css('bottom', '150px');
$('#topIcon').css({ bottom: '-381px' });
$('.error-info-wrapper').css('height', '150px');
}
}
};
var setErrorWrapCssDefault = function () {
$('#content-resizer').css('bottom', '0px');
$('#topIcon').css({ bottom: '-501px' });
$('.error-info-wrapper').css('height', '0px');
};
var showErrTab = function() {
$scope.ImportErrorTab = true;
$scope.ImportErrorTag = true;
$scope.errorMsg = $translate.instant('ImportErrorMsg').formatObj({ "NumberOfError": $scope.errorList.length });
var initImportPLStatusFromDB = function () {
getImportBSStatus();
};
//加载文档后操作
var initImportFile = function (fileName) {
var arr = fileName.name.split('.');
......@@ -1233,26 +1142,24 @@
ele1.datepicker("setDate", $scope.selectedDate);
};
//开始
(function initialize() {
$log.debug('ImportTBController.ctor()...');
checkUserOrganizationPermissionList();
var initParam = function () {
$scope.doUploadBS = doUploadBS;
$scope.downloadTemplate = downloadTemplate;
$scope.refreshTbData = refreshTbData;
$scope.initPagingControl = initPagingControl;
$scope.setButtonWrapStyle = setButtonWrapStyle;
$scope.errorLevelToString = errorLevelToString;
$scope.getGridHeight = getGridHeight;
$scope.getErrorGridHeight = getErrorGridHeight;
$scope.toggleErrorTab = toggleErrorTab;
$scope.showOperateLogPop = showOperateLogPop;
$scope.setGridStyle = setGridStyle;
};
//开始
(function initialize() {
$log.debug('ImportTBController.ctor()...');
checkUserOrganizationPermissionList();
getUserPermission();
loadImportPLStatusInfoDatagrid();
initParam();
loadImportBSStatusInfoDatagrid();
initDatePicker();
$scope.$watch('importExcelFile', function (newValue, oldValue) {
......
......@@ -68,104 +68,9 @@
style="margin-top: 30px;">
</div>
</div>
</div>
<div class="error-info-wrapper" id="error-info-wrapper" ng-show="showErrorTable">
<div ui-grid="gridOptionsErrorMsg" style="width:100%;" ng-style="getErrorGridHeight()"></div>
</div>
<div>
<div ng-show="showErrorTable" id="content-resizer"
resizer="horizontal"
resizer-height="6"
bottom-min="0"
bottom-max="400"
resizer-top="#balance-ouput-grid-wrapper"
resizer-bottom="#error-info-wrapper">
<div id="topIcon" ng-click="toggleErrorTab()">
<img src="../../../../app-resources/images/collapse.png" />
</div>
</div>
</div>
</div>
<!--期间验证明细-->
<div class="period-validation-modal">
<div class="modal fade" id="periodValidationModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width: 75%; height: 200px;" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="modal-title">
{{'ErrorDetails' | translate}}
</div>
</div>
<div class="modal-body">
<div style="border: 1px solid #959595; text-align: center;" id="gridPeriodValidation" dx-data-grid="gridPeriodOptions"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" translate="Confirm" data-dismiss="modal"></button>
</div>
</div>
</div>
</div>
</div>
<!--重复验证明细-->
<div class="duplicate-validation-modal">
<div class="modal fade" id="duplicatedValidationModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width: 75%; height: 200px;" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="modal-title">
{{'ErrorDetails' | translate}}
</div>
</div>
<div class="modal-body">
<div style="border: 1px solid #959595; text-align: center; " id="gridDuplicatedValidation" dx-data-grid="gridDuplicatedOptions"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" translate="BtnDelete" ng-click="deleteDupData()" ng-disabled="!hasEditPermission"></button>
<button type="button" class="btn btn-customer" translate="ButtonCancel" data-dismiss="modal"></button>
</div>
</div>
</div>
</div>
</div>
<!--错误验证信息-->
<div class="error-list-modal">
<div class="modal fade" id="errorListModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width: 720px; height: 200px;" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="modal-title">
{{'ImportErrorPopUpTitle' | translate}}
</div>
</div>
<div class="modal-body">
{{'ImportErrorPopUpErrorDetail' | translate}}:
<br />
<table>
<thead>
<tr>
<th width="10%" style="text-align:center;">{{'ImportErrorPopUpNoCol' | translate}}</th>
<th width="20%">{{'ImportErrorPopUpErrorTypeCol' | translate}}</th>
<th width="10%" style="text-align:center;">{{'ImportErrorPopUpErrorCountCol' | translate}}</th>
<th width="6%">{{'ImportErrorPopUpErrorDescCol' | translate}}</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="error in errorMsgMap track by $index">
<td width="10%" style="text-align:center;">{{$index + 1}}</td>
<td width="20%">{{error.errorType}}</td>
<td width="10%" style="text-align:center;">{{error.errorCount}}</td>
<td width="60%" ng-bind-html="error.errorContent"></td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" translate="Confirm" data-dismiss="modal"></button>
</div>
</div>
<div class="page-footer">
<ack-pagination page-options="pagingOptions"
refresh-table="refreshConfigGrid()"></ack-pagination>
</div>
</div>
</div>
......@@ -184,11 +89,9 @@
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" ng-click="deleteTbData()">{{'Confirm' | translate}}</button>
</div>
</script>
<vat-operate-log period="period" module-type="moduleid" is-show="isShowLog"></vat-operate-log>
......
......@@ -68,104 +68,9 @@
style="margin-top: 30px;">
</div>
</div>
</div>
<div class="error-info-wrapper" id="error-info-wrapper" ng-show="showErrorTable">
<div ui-grid="gridOptionsErrorMsg" style="width:100%;" ng-style="getErrorGridHeight()"></div>
</div>
<div>
<div ng-show="showErrorTable" id="content-resizer"
resizer="horizontal"
resizer-height="6"
bottom-min="0"
bottom-max="400"
resizer-top="#balance-ouput-grid-wrapper"
resizer-bottom="#error-info-wrapper">
<div id="topIcon" ng-click="toggleErrorTab()">
<img src="../../../../app-resources/images/collapse.png" />
</div>
</div>
</div>
</div>
<!--期间验证明细-->
<div class="period-validation-modal">
<div class="modal fade" id="periodValidationModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width: 75%; height: 200px;" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="modal-title">
{{'ErrorDetails' | translate}}
</div>
</div>
<div class="modal-body">
<div style="border: 1px solid #959595; text-align: center;" id="gridPeriodValidation" dx-data-grid="gridPeriodOptions"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" translate="Confirm" data-dismiss="modal"></button>
</div>
</div>
</div>
</div>
</div>
<!--重复验证明细-->
<div class="duplicate-validation-modal">
<div class="modal fade" id="duplicatedValidationModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width: 75%; height: 200px;" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="modal-title">
{{'ErrorDetails' | translate}}
</div>
</div>
<div class="modal-body">
<div style="border: 1px solid #959595; text-align: center; " id="gridDuplicatedValidation" dx-data-grid="gridDuplicatedOptions"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" translate="BtnDelete" ng-click="deleteDupData()" ng-disabled="!hasEditPermission"></button>
<button type="button" class="btn btn-customer" translate="ButtonCancel" data-dismiss="modal"></button>
</div>
</div>
</div>
</div>
</div>
<!--错误验证信息-->
<div class="error-list-modal">
<div class="modal fade" id="errorListModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width: 720px; height: 200px;" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="modal-title">
{{'ImportErrorPopUpTitle' | translate}}
</div>
</div>
<div class="modal-body">
{{'ImportErrorPopUpErrorDetail' | translate}}:
<br />
<table>
<thead>
<tr>
<th width="10%" style="text-align:center;">{{'ImportErrorPopUpNoCol' | translate}}</th>
<th width="20%">{{'ImportErrorPopUpErrorTypeCol' | translate}}</th>
<th width="10%" style="text-align:center;">{{'ImportErrorPopUpErrorCountCol' | translate}}</th>
<th width="6%">{{'ImportErrorPopUpErrorDescCol' | translate}}</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="error in errorMsgMap track by $index">
<td width="10%" style="text-align:center;">{{$index + 1}}</td>
<td width="20%">{{error.errorType}}</td>
<td width="10%" style="text-align:center;">{{error.errorCount}}</td>
<td width="60%" ng-bind-html="error.errorContent"></td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" translate="Confirm" data-dismiss="modal"></button>
</div>
</div>
<div class="page-footer">
<ack-pagination page-options="pagingOptions"
refresh-table="refreshConfigGrid()"></ack-pagination>
</div>
</div>
</div>
......
......@@ -151,7 +151,8 @@ constant.OperateLogType = {
}
constant.page = {
pageSize: 10
pageSize: 10,
logPageSize : 20
}
constant.page.pageSizeArrary = [10, 20, 50, 100, 5];
......@@ -1421,18 +1422,20 @@ constant.importFileType = {
coupaPurchasingReport: 6,
invoiceData: 7,
certifiedInvoicesList: 8,
invoiceRecord: 9
invoiceRecord: 9,
ExtractFinancialData: 10,
ExtractInvoiceData: 11
};
constant.fileTypeList = [
{code:0,type:"月度科目余额表"},
{code:1,type:"日记账"},
{code:2,type:"资产负债表PRC"},
{code:2,type:"利润表PRC"},
{code:2,type:"资产负债表"},
{code:2,type:"利润表"},
{code:2,type:"直接法现金流量表"},
{code:2,type:"所有者权益变动表和汇率表"}
{code:3,type:"利润表PRC"},
{code:4,type:"资产负债表"},
{code:5,type:"利润表"},
{code:6,type:"直接法现金流量表"},
{code:7,type:"所有者权益变动表和汇率表"}
];
constant.maxButtonTitleLength = 20;
......
......@@ -400,8 +400,8 @@
/***************************************批量数据导入服务(真) start**************************************************************/
displayImportLog: function (type) {
return $http.get('/DataImport/displayImportLog?type=' + type, apiConfig.create());
displayImportLog: function (pageInfo, type) {
return $http.post('/DataImport/displayImportLog', {pageInfo: pageInfo, type: type}, apiConfig.create());
}
/***************************************批量数据导入服务(真) end**************************************************************/
......
......@@ -111,6 +111,15 @@ webservices.factory('dataImportService', ['$http', 'apiConfig', function ($http,
/***************************************cit services end**************************************************************/
/***************************************call ApiServices start**************************************************************/
callExtractFinancialData: function (orgIds, period,dataTypes) {
return $http.post('/DataImport/callExtractFinancialData',{ orgIds: orgIds, period: period,dataTypes:dataTypes }, apiConfig.create());
},
callExtractInvoiceData: function (orgIds, period,dataTypes) {
return $http.post('/DataImport/callExtractInvoiceData', { orgIds: orgIds, period: period,dataTypes:dataTypes }, apiConfig.create());
}
/***************************************call ApiServices end**************************************************************/
};
}]);
\ 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