Commit 017b4e17 authored by zhkwei's avatar zhkwei

Merge remote-tracking branch 'origin/dev_mysql' into dev_mysql

# Conflicts:
#	atms-web/src/main/webapp/app/common/utils/constant.js
parents 2c77ebfc 3d9a5639
......@@ -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.controller;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
......@@ -12,6 +13,7 @@ import pwc.taxtech.atms.constant.enums.EnumServiceType;
import pwc.taxtech.atms.dpo.ReportDto;
import pwc.taxtech.atms.dto.FileDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.ReportAttachDto;
import pwc.taxtech.atms.dto.vatdto.*;
import pwc.taxtech.atms.vat.entity.PeriodCellTemplateConfig;
import pwc.taxtech.atms.vat.entity.PeriodJob;
......@@ -165,9 +167,15 @@ public class ReportController {
return operationResultDto;
}
@RequestMapping(value = "loadAttachList", method = RequestMethod.GET)
public List<PwcReportAttach> loadAttachList(Long col, Long row, String templateId){
return reportService.loadAttachList(col, row, templateId);
@RequestMapping("loadAttachList")
public List<PwcReportAttach> loadAttachList(@RequestBody ReportAttachDto reportAttachDto){
System.out.println("sdsdfsd");
return reportService.loadAttachList(reportAttachDto);
}
@RequestMapping("deleteAttach")
public OperationResultDto deleteAttach(Long id){
return reportService.deleteAttach(id);
}
......
......@@ -13,6 +13,7 @@ import pwc.taxtech.atms.service.impl.RevenueConfService;
import pwc.taxtech.atms.vat.entity.RevenueConfig;
import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping(value = "api/v1/revenueConf")
......@@ -26,6 +27,11 @@ public class RevenueConfController extends BaseController {
return new CamelPagingResultDto<>(revenueConfService.queryPage(param));
}
@PostMapping("queryAll")
public List<RevenueConfResult> queryAll(@RequestBody RevenueConfParam param) {
return revenueConfService.queryAll(param);
}
@PostMapping("add")
public ApiResultDto addConf(@RequestBody RevConfAddDto addDto) {
revenueConfService.addConfig(addDto);
......@@ -37,5 +43,4 @@ public class RevenueConfController extends BaseController {
revenueConfService.updateConfig(config);
return ApiResultDto.success();
}
}
package pwc.taxtech.atms.controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pwc.taxtech.atms.dto.input.CamelPagingResultDto;
import pwc.taxtech.atms.dto.revenueDetail.RevenueDetailParam;
import pwc.taxtech.atms.dto.revenueDetail.RevenueDetailResult;
import pwc.taxtech.atms.service.impl.RevenueDetailService;
import javax.annotation.Resource;
@RestController
@RequestMapping(value = "api/v1/revenueDetail")
public class RevenueDetailController extends BaseController {
@Resource
private RevenueDetailService revenueDetailService;
@PostMapping("queryPage")
public CamelPagingResultDto<RevenueDetailResult> queryPage(@RequestBody RevenueDetailParam param) {
return new CamelPagingResultDto<>(revenueDetailService.queryPage(param));
}
}
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;
import pwc.taxtech.atms.dto.revenuconf.RevenueConfParam;
public class ReportAttachDto extends RevenueConfParam {
private Long activeCol;
private Long activeRow;
private String activeTemplateId;
public Long getActiveCol() {
return activeCol;
}
public void setActiveCol(Long activeCol) {
this.activeCol = activeCol;
}
public Long getActiveRow() {
return activeRow;
}
public void setActiveRow(Long activeRow) {
this.activeRow = activeRow;
}
public String getActiveTemplateId() {
return activeTemplateId;
}
public void setActiveTemplateId(String activeTemplateId) {
this.activeTemplateId = activeTemplateId;
}
@Override
public String toString() {
return "ReportAttachDto{" +
"activeCol=" + activeCol +
", activeRow=" + activeRow +
", activeTemplateId='" + activeTemplateId + '\'' +
'}';
}
}
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.dto.revenueDetail;
import pwc.taxtech.atms.dto.input.CamelPagingDto;
import java.io.Serializable;
public class RevenueDetailParam implements Serializable {
private static final long serialVersionUID = 6544829900689477447L;
private CamelPagingDto pageInfo;
private String accountCode;
private String accountName;
private String type;
private String profitCenterCode;
private String profitCenterName;
private Integer taxOn;
private String productCode;
private String productName;
private Integer category;
private String projectId;
private Integer period;
private String queryDate;
public String getQueryDate() {
return queryDate;
}
public void setQueryDate(String queryDate) {
this.queryDate = queryDate;
}
public String getAccountCode() {
return accountCode;
}
public void setAccountCode(String accountCode) {
this.accountCode = accountCode;
}
public String getAccountName() {
return accountName;
}
public void setAccountName(String accountName) {
this.accountName = accountName;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getProfitCenterCode() {
return profitCenterCode;
}
public void setProfitCenterCode(String profitCenterCode) {
this.profitCenterCode = profitCenterCode;
}
public String getProfitCenterName() {
return profitCenterName;
}
public void setProfitCenterName(String profitCenterName) {
this.profitCenterName = profitCenterName;
}
public Integer getTaxOn() {
return taxOn;
}
public void setTaxOn(Integer taxOn) {
this.taxOn = taxOn;
}
public String getProductCode() {
return productCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public Integer getCategory() {
return category;
}
public void setCategory(Integer category) {
this.category = category;
}
public String getProjectId() {
return projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId;
}
public Integer getPeriod() {
return period;
}
public void setPeriod(Integer period) {
this.period = period;
}
public CamelPagingDto getPageInfo() {
return this.pageInfo;
}
public void setPageInfo(CamelPagingDto pageInfo) {
this.pageInfo = pageInfo;
}
}
package pwc.taxtech.atms.dto.revenueDetail;
import java.io.Serializable;
import java.math.BigDecimal;
public class RevenueDetailResult implements Serializable {
private static final long serialVersionUID = 8385521700489579616L;
private String subject;
private String account;
private String profitCenter;
private String product;
private String subjectExplain;
private String accountExplain;
private String profitCenterExplain;
private String productExplain;
private BigDecimal amount;
private String type;
private String category;
private String taxOn;
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public String getAccount() {
return account;
}
public void setAccount(String account) {
this.account = account;
}
public String getProfitCenter() {
return profitCenter;
}
public void setProfitCenter(String profitCenter) {
this.profitCenter = profitCenter;
}
public String getProduct() {
return product;
}
public void setProduct(String product) {
this.product = product;
}
public String getSubjectExplain() {
return subjectExplain;
}
public void setSubjectExplain(String subjectExplain) {
this.subjectExplain = subjectExplain;
}
public String getAccountExplain() {
return accountExplain;
}
public void setAccountExplain(String accountExplain) {
this.accountExplain = accountExplain;
}
public String getProfitCenterExplain() {
return profitCenterExplain;
}
public void setProfitCenterExplain(String profitCenterExplain) {
this.profitCenterExplain = profitCenterExplain;
}
public String getProductExplain() {
return productExplain;
}
public void setProductExplain(String productExplain) {
this.productExplain = productExplain;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getTaxOn() {
return taxOn;
}
public void setTaxOn(String taxOn) {
this.taxOn = taxOn;
}
}
......@@ -22,7 +22,7 @@ public class WrapPeriodJobDto {
public static final String STEP_UPDATE_CONFIG = "UpdateConfig";
public static PeriodJob createReportGenJob(String projectId, Integer period, List<Template> templates) {
public static PeriodJob createReportGenJob(String projectId, Integer period, List<Template> templates,List<String> dataValidateArray) {
MyAsserts.assertNotEmpty(templates, Exceptions.NOT_FOUND_TEMPLATE_EXCEPTION);
PeriodJob job = new PeriodJob();
job.setCreateTime(new Date());
......@@ -33,10 +33,12 @@ public class WrapPeriodJobDto {
job.setCurrentStep(STEP_UPDATE_CONFIG);
setStatus(job,STEP_UPDATE_CONFIG,STATUS_BEGIN);
StringBuilder builder = new StringBuilder(STEP_UPDATE_CONFIG);
dataValidateArray.forEach(m ->{
builder.append(",").append(m);
});
templates.forEach(m -> {
builder.append(",").append(m.getCode());
});
job.setStepsCode(builder.toString());
return job;
}
......
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));
......
......@@ -222,7 +222,7 @@ public class OrganizationServiceImpl extends BaseService{
// find rootOrg
List<Organization> rootOrgs = null;
if (useType == 1) {
rootOrgs = orgList.stream().filter(x -> x.getParentId() == null).collect(Collectors.toList());
rootOrgs = orgList.stream().filter(x -> StringUtils.isEmpty(x.getParentId())).collect(Collectors.toList());
} else {
rootOrgs = orgList.stream()
.filter(x -> x.getParentId() == null && CommonConstants.ACTIVE_STATUS.equals(x.getIsActive()))
......@@ -242,7 +242,7 @@ public class OrganizationServiceImpl extends BaseService{
private OrganizationDto genarateSubOrgs(OrganizationDto parentOrg, List<Organization> orgs,
List<ServiceType> serviceList, Integer useType) {
if (parentOrg.getParentId() != null) {
if (StringUtils.isNotEmpty(parentOrg.getParentId())) {
Organization organization = orgs.stream().filter(x -> x.getId().equals(parentOrg.getParentId()))
.collect(Collectors.toList()).get(0);
parentOrg.setParentName(organization == null ? null : organization.getName());
......@@ -1932,7 +1932,7 @@ public class OrganizationServiceImpl extends BaseService{
}
}
result.setOrganizationServiceTemplateGroupList(query2);
if (result.getParentId() == null) {
if (StringUtils.isEmpty(result.getParentId())) {
result.setParentName("");
} else {
Organization tParent = organizationMapper.selectByExample(null).stream()
......@@ -1948,7 +1948,9 @@ public class OrganizationServiceImpl extends BaseService{
OrganizationExtraDto organizationExtraDto = new OrganizationExtraDto();
OrganizationExtra organizationExtra = organizationExtraMapper.selectByOrgId(orgId).stream().findFirst()
.orElse(null);
beanUtil.copyProperties(organizationExtra,organizationExtraDto);
if(null!=organizationExtra){
beanUtil.copyProperties(organizationExtra,organizationExtraDto);
}
return organizationExtraDto;
}
......@@ -2777,9 +2779,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 +2790,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;
}
/**
......
......@@ -47,6 +47,12 @@ public class RevenueConfService extends BaseService {
return pageInfo;
}
public List<RevenueConfResult> queryAll(RevenueConfParam param) {
RevenueConfigExample example = new RevenueConfigExample();
example.createCriteria().andOrgIdEqualTo(param.getOrgId()).andStartDateLessThanOrEqualTo(param.getStartDate()).andEndDateGreaterThanOrEqualTo(param.getEndDate());
return revenueConfigMapper.selectByExample(example).stream()
.map( o -> beanUtil.copyProperties(o, new RevenueConfResult())).collect(Collectors.toList());
}
/**
* 新增配置
*
......
package pwc.taxtech.atms.service.impl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.dpo.RevenueDetailDto;
import pwc.taxtech.atms.dto.revenueDetail.RevenueDetailParam;
import pwc.taxtech.atms.dto.revenueDetail.RevenueDetailResult;
import pwc.taxtech.atms.vat.dao.TrialBalanceFinalMapper;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class RevenueDetailService extends BaseService {
@Resource
private TrialBalanceFinalMapper trialBalanceFinalMapper;
/**
* @param param
* @return
*/
public PageInfo<RevenueDetailResult> queryPage(RevenueDetailParam param) {
Page page = PageHelper.startPage(param.getPageInfo().getPageIndex(), param.getPageInfo().getPageSize());
List<RevenueDetailDto> dataList = trialBalanceFinalMapper.queryBalanceWithRevenueConfig(param.getAccountCode(), param.getAccountName(), param.getType(), param.getProfitCenterCode(), param.getProfitCenterName(), param.getTaxOn(), param.getProductCode(), param.getProductName(), param.getCategory(), param.getProjectId(), param.getPeriod(), param.getQueryDate());
PageInfo<RevenueDetailResult> pageInfo = new PageInfo<>(dataList.stream()
.map(o -> beanUtil.copyProperties(o, new RevenueDetailResult())).collect(Collectors.toList()));
pageInfo.setTotal(page.getTotal());
return pageInfo;
}
}
package pwc.taxtech.atms.vat.service.impl;
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.FormulaEvaluator;
import org.apache.poi.ss.usermodel.Workbook;
......@@ -23,6 +27,8 @@ import pwc.taxtech.atms.dao.*;
import pwc.taxtech.atms.dpo.ReportDto;
import pwc.taxtech.atms.dto.FileDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.ReportAttachDto;
import pwc.taxtech.atms.dto.revenuconf.RevenueConfResult;
import pwc.taxtech.atms.dto.vatdto.*;
import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.exception.Exceptions;
......@@ -273,12 +279,11 @@ public class ReportServiceImpl extends BaseService {
}
private void updateConfig(String projectId, Integer period, Boolean isMergeManualData, List<Template> templates, PeriodJob job) {
setStatus(job, STATUS_BEGIN);
periodJobMapper.updateByPrimaryKey(job);
List<Long> exceptTemplateIds = templateMapper.getIdsForExceptTemplate();
clearPeriodData(projectId, period, exceptTemplateIds, isMergeManualData);
copyTemplateAndConfigFromAdmin(projectId, templates, period);
setStatus(job, STATUS_END);
periodJobMapper.updateByPrimaryKey(job);
}
private List<Template> getTemplatesByProjectId(String projectId) {
......@@ -489,13 +494,22 @@ public class ReportServiceImpl extends BaseService {
return operationResultDto;
}
List<Template> templates = getTemplatesByProjectId(projectId);
PeriodJob genJob = WrapPeriodJobDto.createReportGenJob(projectId, periodParam, templates);
List<String> dataValidateArray= new ArrayList<String>();
/*dataValidateArray.add("DA001");
dataValidateArray.add("DA002");
dataValidateArray.add("DA003");*/
dataValidateArray.add("DA004");
PeriodJob genJob = WrapPeriodJobDto.createReportGenJob(projectId, periodParam, templates, dataValidateArray);
periodJobMapper.insert(genJob);
new Thread(new Runnable() {
@Override
public void run() {
try {
//进行数据校验
DataValidation(periodParam, projectId,genJob );
updateConfig(projectId, periodParam, isMergeManualData, templates, genJob);
PeriodResources resources = reportGenerator.getPeriodResources(projectId, periodParam,
......@@ -519,6 +533,7 @@ public class ReportServiceImpl extends BaseService {
periodJobMapper.updateByPrimaryKey(genJob);
}
}
}).start();
operationResultDto.setData(new PeriodJobDto().copyFromPeriodJob(genJob));
operationResultDto.setResult(true);
......@@ -528,6 +543,67 @@ public class ReportServiceImpl extends BaseService {
}
return operationResultDto;
}
@Autowired
private TrialBalanceMapper trialBalanceMapper;
@Autowired
private AdjustmentTableMapper adjustmentTableMapper;
@Autowired
private ProfitLossStatementMapper profitLossStatementMapper;
@Autowired
private JournalEntryMapper journalEntryMapper;
/* @Autowired
private CitJour*/
//数据校验
private void DataValidation(Integer periodParam, String projectId, PeriodJob genJob) {
setStatus(genJob,"DA004", STATUS_BEGIN);
//本期余额表
/* TrialBalanceExample trialBalanceExample = new TrialBalanceExample();
TrialBalanceExample.Criteria criteria = trialBalanceExample.createCriteria();
criteria.andProjectIdEqualTo(projectId);
criteria.andPeriodEqualTo(periodParam);
TrialBalance trialBalances = trialBalanceMapper.selectByExample(trialBalanceExample).get(0);
//本期利润表
ProfitLossStatementExample profitLossStatementExample = new ProfitLossStatementExample();
ProfitLossStatementExample.Criteria criteria2 = profitLossStatementExample.createCriteria();
criteria2.andProjectIdEqualTo(projectId);
criteria2.andPeriodEqualTo(periodParam);
ProfitLossStatement profitLossStatements = profitLossStatementMapper.selectByExample(profitLossStatementExample).get(0);*/
//调整表
Map<String, Object> map1 = new HashedMap();
map1.put("projectId", projectId);
map1.put("period", periodParam);
if((periodParam+"").length() == 1){
map1.put("period", "0"+ periodParam);
}else{
map1.put("period", "" + periodParam);
}
List<AdjustmentTable> adjustmentTables = adjustmentTableMapper.selectBeforeAdjustData(map1);
Map<String, Object> map2 = new HashedMap();
map2.put("projectId", projectId);
if((periodParam+"").length() == 1){
map2.put("period", "0"+ periodParam);
}else{
map2.put("period", "" + periodParam);
}
List<JournalEntry> journalEntries = journalEntryMapper.selectNowAdjustData(map2);
for(int i =0; i< adjustmentTables.size(); i++){
for(int j =0; j< journalEntries.size(); j++){
if(journalEntries.get(j).getSegment3().equals(adjustmentTables.get(j).getSegment3()) &&
journalEntries.get(j).getSegment5().equals(adjustmentTables.get(j).getSegment5())&&
journalEntries.get(j).getSegment6().equals(adjustmentTables.get(j).getSegment6()) && journalEntries.get(j).getPeriodJrMinDr() != adjustmentTables.get(j).getPeriodDrMixCr() ){
setStatus(genJob,STATUS_ERROR );
}
}
}
setStatus(genJob, STATUS_END);
periodJobMapper.updateByPrimaryKey(genJob);
}
public List<CellTemplateReferenceDto> getTemplateReferences(int period) {
return new ArrayList<>();
......@@ -1333,17 +1409,37 @@ public class ReportServiceImpl extends BaseService {
pwcReportAttach.setUploadUser(file.getUploadUser());
pwcReportAttach.setFileUrl(file.getFileUrl());
pwcReportAttach.setSize(file.getSize());
pwcReportAttach.setRemarks(file.getRemarks());
pwcReportAttachMapper.insert(pwcReportAttach);
System.out.println("==>>>附件绑定成功");
}
public List<PwcReportAttach> loadAttachList(Long col, Long row, String templateId) {
public List<PwcReportAttach> loadAttachList(ReportAttachDto param) {
PwcReportAttachExample example = new PwcReportAttachExample();
Page page = PageHelper.startPage(param.getPageInfo().getPageIndex(), param.getPageInfo().getPageSize());
PwcReportAttachExample.Criteria criteria = example.createCriteria();
criteria.andColEqualTo(col);
criteria.andRowEqualTo(row);
criteria.andTemplateIdEqualTo(templateId);
criteria.andColEqualTo(param.getActiveCol());
criteria.andRowEqualTo(param.getActiveRow());
criteria.andTemplateIdEqualTo(param.getActiveTemplateId());
example.setOrderByClause("create_time DESC");
/* PageInfo<PwcReportAttach> pageInfo = new PageInfo<PwcReportAttach>();
pageInfo.setTotal(page.getTotal());*/
return pwcReportAttachMapper.selectByExample(example);
}
/**
* 删除附件
* @param id
* @return
*/
public OperationResultDto deleteAttach(Long id) {
PwcReportAttachExample example = new PwcReportAttachExample();
OperationResultDto<Object> objectOperationResultDto = new OperationResultDto<>();
example.createCriteria().andIdEqualTo(id);
int i = pwcReportAttachMapper.deleteByExample(example);
if(i>0){
objectOperationResultDto.setResultMsg("success");
}
return objectOperationResultDto;
}
}
......@@ -10,7 +10,7 @@ mail_jdbc_url=jdbc:sqlserver://192.168.1.102:1434;DatabaseName=MAILMaster
mail_jdbc_user=sa
mail_jdbc_password=atmsunittestSQL
web.url=http://etms.longi-silicon.com:8080
web.url=http://dts.erp.didichuxing.com:8080
#web.url=*
jwt.base64Secret=TXppQjFlZFBSbnJzMHc0Tg==
jwt.powerToken=xxxx
......@@ -28,7 +28,7 @@ max_file_length=104857600
distributed_id_datacenter=1
distributed_id_machine=1
api.url=http://etms.longi-silicon.com:8180
api.url=http://dts.erp.didichuxing.com:8180
# Longi config
longi_api_basic_user=
......
......@@ -15,7 +15,7 @@ mail_jdbc_url=jdbc:sqlserver://192.168.1.102:1434;DatabaseName=MAILMaster
mail_jdbc_user=sa
mail_jdbc_password=atmsunittestSQL
web.url=http://etms.longi-silicon.com:8081
web.url=http://dts.erp.didichuxing.com:8080
#web.url=*
jwt.base64Secret=TXppQjFlZFBSbnJzMHc0Tg==
jwt.powerToken=xxxx
......@@ -33,7 +33,7 @@ max_file_length=104857600
distributed_id_datacenter=10
distributed_id_machine=15
api.url=http://etms.longi-silicon.com:8181
api.url=http://dts.erp.didichuxing.com:8180
# Longi config
longi_api_basic_user=
......
......@@ -10,7 +10,7 @@ mail_jdbc_url=jdbc:sqlserver://192.168.1.102:1434;DatabaseName=MAILMaster
mail_jdbc_user=sa
mail_jdbc_password=atmsunittestSQL
web.url=http://etms.longi-silicon.com:10000
web.url=http://dts.erp.didichuxing.com:10000
#web.url=*
jwt.base64Secret=TXppQjFlZFBSbnJzMHc0Tg==
jwt.powerToken=xxxx
......@@ -28,7 +28,7 @@ max_file_length=104857600
distributed_id_datacenter=10
distributed_id_machine=10
api.url=http://etms.longi-silicon.com:20000
api.url=http://dts.erp.didichuxing.com:20000
# Longi config
longi_api_basic_user=
......
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;
}
}
......@@ -41,15 +41,20 @@
<property name="rootInterface" value="pwc.taxtech.atms.MyVatMapper" />
</javaClientGenerator>
<!-- <table tableName="trial_balance_final" domainObjectName="TrialBalanceFinal">
<table tableName="revenue_type_mapping" domainObjectName="RevenueTypeMapping">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>-->
</table>
<table tableName="pwc_report_attach" domainObjectName="PwcReportAttach">
<!-- <table tableName="trial_balance_final" domainObjectName="TrialBalanceFinal">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
</table>
</table>-->
<!--<table tableName="pwc_report_attach" domainObjectName="PwcReportAttach">-->
<!--<property name="useActualColumnNames" value="false"/>-->
<!--<property name="ignoreQualifiersAtRuntime" value="true"/>-->
<!--</table>-->
<!--<table tableName="certified_invoices_list" domainObjectName="CertifiedInvoicesList">
<property name="useActualColumnNames" value="false"/>
......
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
package pwc.taxtech.atms.dpo;
import java.io.Serializable;
import java.math.BigDecimal;
public class RevenueDetailDto implements Serializable {
private static final long serialVersionUID = 3774022182707357862L;
private String subject;
private String account;
private String profitCenter;
private String product;
private String subjectExplain;
private String accountExplain;
private String profitCenterExplain;
private String productExplain;
private BigDecimal amount;
private String type;
private String category;
private String taxOn;
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public String getAccount() {
return account;
}
public void setAccount(String account) {
this.account = account;
}
public String getProfitCenter() {
return profitCenter;
}
public void setProfitCenter(String profitCenter) {
this.profitCenter = profitCenter;
}
public String getProduct() {
return product;
}
public void setProduct(String product) {
this.product = product;
}
public String getSubjectExplain() {
return subjectExplain;
}
public void setSubjectExplain(String subjectExplain) {
this.subjectExplain = subjectExplain;
}
public String getAccountExplain() {
return accountExplain;
}
public void setAccountExplain(String accountExplain) {
this.accountExplain = accountExplain;
}
public String getProfitCenterExplain() {
return profitCenterExplain;
}
public void setProfitCenterExplain(String profitCenterExplain) {
this.profitCenterExplain = profitCenterExplain;
}
public String getProductExplain() {
return productExplain;
}
public void setProductExplain(String productExplain) {
this.productExplain = productExplain;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getTaxOn() {
return taxOn;
}
public void setTaxOn(String taxOn) {
this.taxOn = taxOn;
}
}
package pwc.taxtech.atms.vat.dao;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
......@@ -108,4 +110,5 @@ public interface AdjustmentTableMapper extends MyVatMapper {
int insertBatch(List<AdjustmentTable> rlits);
List<AdjustmentTable> selectBeforeAdjustData(Map<String,Object> map1);
}
\ No newline at end of file
package pwc.taxtech.atms.vat.dao;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
......@@ -109,4 +111,5 @@ public interface JournalEntryMapper extends MyVatMapper {
List<JournalEntry> selectByCondition(@Param("jeCondition")JournalEntryCondition journalEntryCondition);
List<JournalEntry> selectNowAdjustData(Map<String,Object> map2);
}
\ No newline at end of file
package pwc.taxtech.atms.vat.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.MyVatMapper;
import pwc.taxtech.atms.vat.entity.RevenueTypeMapping;
import pwc.taxtech.atms.vat.entity.RevenueTypeMappingExample;
@Mapper
public interface RevenueTypeMappingMapper extends MyVatMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table revenue_type_mapping
*
* @mbg.generated
*/
long countByExample(RevenueTypeMappingExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table revenue_type_mapping
*
* @mbg.generated
*/
int deleteByExample(RevenueTypeMappingExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table revenue_type_mapping
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table revenue_type_mapping
*
* @mbg.generated
*/
int insert(RevenueTypeMapping record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table revenue_type_mapping
*
* @mbg.generated
*/
int insertSelective(RevenueTypeMapping record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table revenue_type_mapping
*
* @mbg.generated
*/
List<RevenueTypeMapping> selectByExampleWithRowbounds(RevenueTypeMappingExample example, RowBounds rowBounds);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table revenue_type_mapping
*
* @mbg.generated
*/
List<RevenueTypeMapping> selectByExample(RevenueTypeMappingExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table revenue_type_mapping
*
* @mbg.generated
*/
RevenueTypeMapping selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table revenue_type_mapping
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") RevenueTypeMapping record, @Param("example") RevenueTypeMappingExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table revenue_type_mapping
*
* @mbg.generated
*/
int updateByExample(@Param("record") RevenueTypeMapping record, @Param("example") RevenueTypeMappingExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table revenue_type_mapping
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(RevenueTypeMapping record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table revenue_type_mapping
*
* @mbg.generated
*/
int updateByPrimaryKey(RevenueTypeMapping record);
}
\ No newline at end of file
package pwc.taxtech.atms.vat.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.MyVatMapper;
import pwc.taxtech.atms.dpo.RevenueDetailDto;
import pwc.taxtech.atms.vat.entity.TrialBalanceFinal;
import pwc.taxtech.atms.vat.entity.TrialBalanceFinalExample;
import java.util.List;
@Mapper
public interface TrialBalanceFinalMapper extends MyVatMapper {
/**
......@@ -105,4 +107,18 @@ public interface TrialBalanceFinalMapper extends MyVatMapper {
* @mbg.generated
*/
int updateByPrimaryKey(TrialBalanceFinal record);
List<RevenueDetailDto> queryBalanceWithRevenueConfig(
@Param("accountCode") String accountCode,
@Param("accountName") String accountName,
@Param("type") String type,
@Param("profitCenterCode") String profitCenterCode,
@Param("profitCenterName") String profitCenterName,
@Param("taxOn") Integer taxOn,
@Param("productCode") String productCode,
@Param("productName") String productName,
@Param("category") Integer category,
@Param("projectId") String projectId,
@Param("period") Integer period,
@Param("queryDate") String queryDate);
}
\ No newline at end of file
......@@ -35,6 +35,8 @@ public class AdjustmentTable extends BaseEntity implements Serializable {
*/
private String organizationId;
/**
* Database Column Remarks:
* 项目ID
......@@ -288,6 +290,14 @@ public class AdjustmentTable extends BaseEntity implements Serializable {
*/
private BigDecimal periodDrBeq;
/**
* 本位币借方发生额-本位币贷方发生额
*/
private BigDecimal periodDrMixCr;
/**
* Database Column Remarks:
* 本位币本期贷方发生额
......@@ -496,6 +506,14 @@ public class AdjustmentTable extends BaseEntity implements Serializable {
return segment3;
}
public BigDecimal getPeriodDrMixCr() {
return periodDrMixCr;
}
public void setPeriodDrMixCr(BigDecimal periodDrMixCr) {
this.periodDrMixCr = periodDrMixCr;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column adjustment_table.segment3
......
......@@ -221,6 +221,15 @@ public class JournalEntry extends BaseEntity implements Serializable {
* @mbg.generated
*/
private String voucherNum;
private BigDecimal periodJrMinDr;
public BigDecimal getPeriodJrMinDr() {
return periodJrMinDr;
}
public void setPeriodJrMinDr(BigDecimal periodJrMinDr) {
this.periodJrMinDr = periodJrMinDr;
}
/**
* Database Column Remarks:
......
......@@ -666,4 +666,35 @@
order by ${orderByClause}
</if>
</select>
<select id ="selectBeforeAdjustData" parameterType="java.util.Map" resultType="pwc.taxtech.atms.vat.entity.AdjustmentTable">
SELECT
max(CASE #{period}
WHEN 0 THEN
0
ELSE
(
t.period_dr_beq - t.period_cr_beq
) END )
periodDrMixCr,
max(t.period),
max(t.project_id),
t.segment3,
t.segment5,
t.segment6
FROM
adjustment_table t
WHERE
1 = 1
<if test="projectId!= '' and projectId != null">
and t.project_id = #{projectId}
</if>
<if test="period !=null and period != '' ">
AND substring(t.period, -2) = ${period}
</if>
group by t.segment3, t.segment5, t.segment6
</select>
</mapper>
\ No newline at end of file
......@@ -1299,4 +1299,25 @@
order by ${orderByClause}
</if>
</select>
<select id ="selectNowAdjustData" parameterType="java.util.Map" resultType="pwc.taxtech.atms.vat.entity.JournalEntry">
SELECT
max(t.entered_dr - t.entered_cr) as periodJrMinDr,
max(t.period),
max(t.project_id),
t.segment3,
t.segment5,
t.segment6
FROM
journal_entry t
where 1 =1 and t.description like '%调表不调账%'
<if test="projectId != null and projectId != '' ">
and t.project_id = #{projectId}
</if>
<if test="period!= null and period != '' ">
and substring(t.period, -2) = ${period}
</if>
group by t.segment3, t.segment5, t.segment6
</select>
</mapper>
\ No newline at end of file
......@@ -11,19 +11,19 @@
AND segment3= #{jeCondition.segment3,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(jeCondition.segment3Name)">
AND segment3Name= #{jeCondition.segment3Name,jdbcType=VARCHAR}
AND segment3_name= #{jeCondition.segment3Name,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(jeCondition.segment5)">
AND segment5= #{jeCondition.segment5,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(jeCondition.segment5Name)">
AND segment5Name= #{jeCondition.segment5Name,jdbcType=VARCHAR}
AND segment5_name= #{jeCondition.segment5Name,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(jeCondition.segment6)">
AND segment6= #{jeCondition.segment6,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(jeCondition.segment6Name)">
AND segment6Name= #{jeCondition.segment6Name,jdbcType=VARCHAR}
AND segment6_name= #{jeCondition.segment6Name,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(jeCondition.description)">
AND description= #{jeCondition.description,jdbcType=VARCHAR}
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.vat.dao.TrialBalanceFinalMapper">
<select id="queryBalanceWithRevenueConfig" resultType="pwc.taxtech.atms.dpo.RevenueDetailDto">
select detail.*
from (
select tbf.segment1 as subject,
tbf.segment3 as account,
tbf.segment5 profitCenter,
tbf.segment6 product,
tbf.segment1_name subjectExplain,
tbf.segment3_name accountExplain,
tbf.segment5_name profitCenterExplain,
tbf.segment6_name productExplain,
tbf.period_dr amount,
rc.name type,
rc.revenue_type category,
rc.tax_type taxOn,
case
when tbf.segment3 like '4001%' and rc.id is null then 1
when tbf.segment3 like '4002%' and rc.id is null then 1
when tbf.segment3 like '4010%' and rc.id is null then 1
when tbf.segment3 like '8002%' and rc.id is null then 1
<![CDATA[WHEN rc.id IS NOT NULL and (rc.start_date > #{queryDate} or rc.end_date < #{queryDate}) then 1]]>
<![CDATA[WHEN rc.id IS NOT NULL and rc.start_date <= #{queryDate} and rc.end_date >= #{queryDate} THEN 2]]>
else 3 end as isEmpty
from trial_balance_final as tbf
left join
revenue_config as rc
on
rc.org_id = tbf.organization_id
and
rc.tb_segment3 = tbf.segment3
and
rc.tb_segment5 = tbf.segment5
and
rc.tb_segment6 = tbf.segment6
where
tbf.project_id = #{projectId}
and tbf.period = #{period}
<if test="accountCode != null and accountCode != ''">
and tbf.segment3 like concat('%',#{accountCode},'%')
</if>
<if test="accountName != null and accountName != ''">
and tbf.segment3_name like concat('%',#{accountName},'%')
</if>
<if test="profitCenterCode != null and profitCenterCode != ''">
and tbf.segment5 like concat('%',#{profitCenterCode},'%')
</if>
<if test="profitCenterName != null and profitCenterName != ''">
and tbf.segment5_name like concat('%',#{profitCenterName},'%')
</if>
<if test="productCode != null and productCode != ''">
and tbf.segment6 like concat('%',#{productCode},'%')
</if>
<if test="productName != null and productName != ''">
and tbf.segment6_name like concat('%',#{productName},'%')
</if>
<if test="type != null">
and rc.name = #{type}
</if>
<if test="category != null">
and rc.revenue_type = #{category}
</if>
<if test="taxOn != null">
and rc.tax_type = #{taxOn}
</if>
) as detail
where
<![CDATA[detail.isEmpty < 3]]>
order by detail.isEmpty
</select>
</mapper>
\ No newline at end of file
......@@ -11,19 +11,19 @@
AND segment2= #{tbCondition.segment2,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.segment2Name)">
AND segment2Name= #{tbCondition.segment2Name,jdbcType=VARCHAR}
AND segment2_name= #{tbCondition.segment2Name,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.segment3)">
AND segment3= #{tbCondition.segment3,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.segment3Name)">
AND segment3Name= #{tbCondition.segment3Name,jdbcType=VARCHAR}
AND segment3_name= #{tbCondition.segment3Name,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.segment6)">
AND segment6= #{tbCondition.segment6,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.segment6Name)">
AND segment6Name= #{tbCondition.segment6Name,jdbcType=VARCHAR}
AND segment6_name= #{tbCondition.segment6Name,jdbcType=VARCHAR}
</if>
<if test="tbCondition.periodStart!=null">
AND period &gt;= #{tbCondition.periodStart,jdbcType=INTEGER}
......
api.url=http://etms.longi-silicon.com:8180/
api.url=http://dts.erp.didichuxing.com:8180/
cookie.maxAgeSeconds=86400
......
api.url=http://etms.longi-silicon.com:8181/
api.url=http://dts.erp.didichuxing.com:8180/
cookie.maxAgeSeconds=86400
......
api.url=http://etms.longi-silicon.com:20000/
api.url=http://dts.erp.didichuxing.com:20000/
cookie.maxAgeSeconds=86400
......
......@@ -966,6 +966,22 @@ var vatModule = angular.module('app.vat', ['ui.grid', 'ui.grid.selection', 'ui.g
sticky: true
});
$stateProvider.state({
name: 'vat.reductionData.revenueDetail',
url: '/revenueDetail',
views: {
'@vat.reductionData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-revenue-detail></vat-revenue-detail>',
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.reductionData.unbilledInvoice',
url: '/unbilledInvoice',
......
......@@ -1841,8 +1841,6 @@
"extractInvoiceData": "Extract Invoice Data",
"ExtractInvoiceDataTitle": "Extract Invoice Data",
"TBInterCompany": "Inter-Company",
"~MustBeEndOneApp": "I Must be the End One, please!"
"~MustBeEndOneApp": "I Must be the End One, please!",
"dataValidate" : "data Validate"
}
\ No newline at end of file
......@@ -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**************************************************************/
......
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