Commit 838b9b65 authored by kevin's avatar kevin

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

parents 6b1094d2 08ba7683
......@@ -94,6 +94,24 @@ public class AnalysisController extends BaseController {
}
}
@ResponseBody
@RequestMapping(value = "InternationalExcelFile", method = RequestMethod.POST)
public OperationResultDto importDomesitcExcelFile(@RequestParam MultipartFile file, @RequestParam String period,
@RequestParam Integer type,@RequestParam String companyName,@RequestParam String country) {
try {
String valMsg = valParameter(file,period,type);
if(StringUtils.isNotEmpty(valMsg)){
return OperationResultDto.error(valMsg);
}
return analysisServiceImpl.importInterNationalExcelFile(file,period, type,companyName,country);
} catch (ServiceException e) {
return OperationResultDto.error(e.getMessage());
} catch (Exception e) {
logger.error("importDomesitcExcelFile error.", e);
return OperationResultDto.error(ErrorMessage.SystemError);
}
}
private String valParameter(MultipartFile file,String periodDate,Integer type){
if (null == file) {
return ErrorMessage.NoFile;
......
......@@ -7,6 +7,8 @@ public class ErrorMessageCN {
public static final String InconsistentPeriod = "单表中期间不一致";
public static final String DoNotSelectPeriod = "未选择期间";
public static final String DoNotSelectCompany = "非选定主体";
public static final String DoNotExistProject = "项目未开启";
public static final String DoNotInputPeriod = "缺少期间字段";
public static final String StrctureRepeat = "层级重复!";
public static final String BusinssUnitRepeat = "事业部重复!";
public static final String BusinssUnitUpdateFailed = "未对事业部名称或状态进行修改!";
......
......@@ -109,7 +109,6 @@ public class DateUtils {
return dateString;
}
/**
* 将短时间格式字符串转换为区间格式 yyyyMM
*
......@@ -117,12 +116,13 @@ public class DateUtils {
* @return
*/
public static Integer dateToPeriod(java.util.Date dateDate) {
if(dateDate==null){
return null;
}
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMM");
Integer period = Integer.valueOf(formatter.format(dateDate));
return period;
return Integer.valueOf(formatter.format(dateDate));
}
/**
* 将yyyy-mm yyyy - mm等字符串转换为区间格式 yyyyMM
*
......@@ -217,6 +217,19 @@ public class DateUtils {
return strtodate;
}
/**
* 将短时间格式字符串转换为时间 yyyy-MM
*
* @param strDate
* @return
*/
public static Date strToDate5(String strDate) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM");
ParsePosition pos = new ParsePosition(0);
Date strtodate = formatter.parse(strDate, pos);
return strtodate;
}
/**
* 得到现在时间
*
......
......@@ -201,11 +201,20 @@ public class AnalysisServiceImpl extends BaseService {
case 4:
importAnalysisDriverNumExcelFile(file,periodDate);
break;
default:
break;
}
return OperationResultDto.success();
}
public OperationResultDto importInterNationalExcelFile(MultipartFile file, String periodDate, Integer type,
String companyName,String country) {
switch (type){
case 100:
importAnalysisInterBuDataExcelFile(file,periodDate);
importAnalysisInterBuDataExcelFile(file,periodDate,companyName,country);
break;
case 101:
importAnalysisInterTaxDataExcelFile(file,periodDate);
importAnalysisInterTaxDataExcelFile(file,periodDate,companyName,country);
break;
default:
break;
......@@ -221,12 +230,7 @@ public class AnalysisServiceImpl extends BaseService {
throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod);
}
// 文件上的期间
String filePeriod = file.getOriginalFilename().split("_")[1];
Integer filePer = DateUtils.strToPeriod2(filePeriod);
Integer selectedPer = DateUtils.strToPeriod(periodDate);
if (!filePer.equals(selectedPer)) {
throw new ServiceException(ErrorMessageCN.ExistDataPeriodsError);
}
for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
Sheet sheet = workbook.getSheetAt(i);
if (isSheetEmpty(sheet)) continue;
......@@ -275,13 +279,7 @@ public class AnalysisServiceImpl extends BaseService {
if (StringUtils.isBlank(periodDate) || "null".equals(periodDate)) {
throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod);
}
// 文件上的期间
String filePeriod = file.getOriginalFilename().split("_")[1];
Integer filePer = DateUtils.strToPeriod2(filePeriod);
Integer selectedPer = DateUtils.strToPeriod(periodDate);
if (!filePer.equals(selectedPer)) {
throw new ServiceException(ErrorMessageCN.ExistDataPeriodsError);
}
for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
Sheet sheet = workbook.getSheetAt(i);
if (isSheetEmpty(sheet)) continue;
......@@ -330,13 +328,7 @@ public class AnalysisServiceImpl extends BaseService {
if (StringUtils.isBlank(periodDate) || "null".equals(periodDate)) {
throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod);
}
// 文件上的期间
String filePeriod = file.getOriginalFilename().split("_")[1];
Integer filePer = DateUtils.strToPeriod2(filePeriod);
Integer selectedPer = DateUtils.strToPeriod(periodDate);
if(!filePer.equals(selectedPer)){
throw new ServiceException(ErrorMessageCN.ExistDataPeriodsError);
}
for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
Sheet sheet = workbook.getSheetAt(i);
if (isSheetEmpty(sheet)) continue;
......@@ -381,13 +373,7 @@ public class AnalysisServiceImpl extends BaseService {
if (StringUtils.isBlank(periodDate) || "null".equals(periodDate)) {
throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod);
}
// 文件上的期间
String filePeriod = file.getOriginalFilename().split("_")[1];
Integer filePer = DateUtils.strToPeriod2(filePeriod);
Integer selectedPer = DateUtils.strToPeriod(periodDate);
if(!filePer.equals(selectedPer)){
throw new ServiceException(ErrorMessageCN.ExistDataPeriodsError);
}
for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
Sheet sheet = workbook.getSheetAt(i);
if (isSheetEmpty(sheet)) continue;
......@@ -432,13 +418,7 @@ public class AnalysisServiceImpl extends BaseService {
if (StringUtils.isBlank(periodDate) || "null".equals(periodDate)) {
throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod);
}
// 文件上的期间
String filePeriod = file.getOriginalFilename().split("_")[1];
Integer filePer = DateUtils.strToPeriod2(filePeriod);
Integer selectedPer = DateUtils.strToPeriod(periodDate);
if(!filePer.equals(selectedPer)){
throw new ServiceException(ErrorMessageCN.ExistDataPeriodsError);
}
for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
Sheet sheet = workbook.getSheetAt(i);
if (isSheetEmpty(sheet)) continue;
......@@ -475,7 +455,8 @@ public class AnalysisServiceImpl extends BaseService {
}
}
private void importAnalysisInterTaxDataExcelFile(MultipartFile file, String periodDate) {
private void importAnalysisInterTaxDataExcelFile(MultipartFile file, String periodDate,
String companyName,String country) {
try{
InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream);
......@@ -483,14 +464,7 @@ public class AnalysisServiceImpl extends BaseService {
throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod);
}
// 文件上的期间
String fileCountry = file.getOriginalFilename().split("_")[1];
String fileCompany = file.getOriginalFilename().split("_")[2];
String filePeriod = file.getOriginalFilename().split("_")[3];
Integer filePer = DateUtils.strToPeriod2(filePeriod);
Integer selectedPer = DateUtils.strToPeriod(periodDate);
if(!filePer.equals(selectedPer)){
throw new ServiceException(ErrorMessageCN.ExistDataPeriodsError);
}
for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
Sheet sheet = workbook.getSheetAt(i);
if (isSheetEmpty(sheet)) continue;
......@@ -503,8 +477,8 @@ public class AnalysisServiceImpl extends BaseService {
AnalysisInternationalTaxData model = new AnalysisInternationalTaxData();
model.setId(idService.nextId());
model.setPeriod(selectedPer);
model.setCompanyName(fileCompany);
model.setCountry(fileCountry);
model.setCompanyName(companyName);
model.setCountry(country);
model.setTaxCategory(getCellStringValue(sheet.getRow(j).getCell(0)));
model.setTaxType(getCellStringValue(sheet.getRow(j).getCell(1)));
model.setTaxAmount(getCellBigDecimalValue(sheet.getRow(j).getCell(2)));
......@@ -526,7 +500,8 @@ public class AnalysisServiceImpl extends BaseService {
}
}
private void importAnalysisInterBuDataExcelFile(MultipartFile file, String periodDate) {
private void importAnalysisInterBuDataExcelFile(MultipartFile file, String periodDate,
String companyName,String country) {
try{
InputStream inputStream = file.getInputStream();
Workbook workbook = WorkbookFactory.create(inputStream);
......@@ -534,14 +509,7 @@ public class AnalysisServiceImpl extends BaseService {
throw new ServiceException(ErrorMessageCN.DoNotSelectPeriod);
}
// 文件上的期间
String fileCountry = file.getOriginalFilename().split("_")[1];
String fileCompany = file.getOriginalFilename().split("_")[2];
String filePeriod = file.getOriginalFilename().split("_")[3];
Integer filePer = DateUtils.strToPeriod2(filePeriod);
Integer selectedPer = DateUtils.strToPeriod(periodDate);
if(!filePer.equals(selectedPer)){
throw new ServiceException(ErrorMessageCN.ExistDataPeriodsError);
}
for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
Sheet sheet = workbook.getSheetAt(i);
if (isSheetEmpty(sheet)) continue;
......@@ -550,8 +518,8 @@ public class AnalysisServiceImpl extends BaseService {
AnalysisInternationalBusinessData model = new AnalysisInternationalBusinessData();
model.setId(idService.nextId());
model.setPeriod(selectedPer);
model.setCompanyName(fileCompany);
model.setCountry(fileCountry);
model.setCompanyName(companyName);
model.setCountry(country);
Cell cell1 = sheet.getRow(j).getCell(0);
if (null == cell1 || StringUtils.isEmpty(getCellStringValue(cell1))) {
continue;
......
......@@ -47,7 +47,7 @@ file_upload_query_url=http://47.94.233.173:11006/resource/erp_tax_system
#ϵַget_user_info_url=http://mis.diditaxi.com.cn/auth/sso/api/
check_ticket=false
get_user_info_url=http://mis-test.diditaxi.com.cn/auth/sso/api/
get_user_info_url=http://mis.diditaxi.com.cn/auth/sso/api/
app_id=2500
app_key=983258e7fd04d7fa0534735f7b1c33f3
cookie.maxAgeSeconds=86400
......
......@@ -45,7 +45,7 @@ file_upload_query_url=http://47.94.233.173:11006/resource/erp_tax_system
#ϵַget_user_info_url=http://mis.diditaxi.com.cn/auth/sso/api/
check_ticket=false
get_user_info_url=http://mis-test.diditaxi.com.cn/auth/sso/api/
get_user_info_url=http://mis.diditaxi.com.cn/auth/sso/api/
app_id=2500
app_key=983258e7fd04d7fa0534735f7b1c33f3
cookie.maxAgeSeconds=86400
......
......@@ -406,7 +406,7 @@ public class DataInitTest extends CommonIT {
*/
String input = "";
try {
File targetFile = new File("src/main/resources/orgImport/ddOrgJson2.json");
File targetFile = new File("src/main/resources/orgImport/ddOrgJson3.json");
// File targetFile = new File("src/main/resources/orgImport/failedJson.json");
input = FileUtils.readFileToString(targetFile, "UTF-8");
} catch (Exception e) {
......
......@@ -857,6 +857,30 @@ public class Organization extends BaseEntity implements Serializable {
this.pLevel = pLevel;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization.p_level
*
* @return the value of organization.p_level
*
* @mbg.generated
*/
public Integer getPLevel() {
return pLevel;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column organization.p_level
*
* @param pLevel the value for organization.p_level
*
* @mbg.generated
*/
public void setPLevel(Integer pLevel) {
this.pLevel = pLevel;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization.create_time
......
......@@ -208,7 +208,7 @@ public class AccountController {
response.addCookie(ddTicketCookie);
response.addCookie(ddJumptoCookie);
// todo 这里写死为DD的登出地址了
response.sendRedirect("http://mis.diditaxi.com.cn/auth/ldap/logout?app_id=2500");
response.sendRedirect("http://mis.diditaxi.com.cn/auth/ldap/logout?app_id=2500&jumpto=http://dts.erp.didichuxing.com:9001/sso/accept");
} catch (Exception e) {
logger.error("登出失败", e);
}
......
......@@ -93,26 +93,44 @@ public class IndexController {
return "redirect:Account/LogOn";
}
@RequestMapping(value = {"/sso/callback"}, method = RequestMethod.GET)
public String ddSSOCallback(@RequestParam(value = "jumpto") String jumpto,
@RequestMapping(value = {"/sso/callback"})
public void ddSSOCallback(@RequestParam(value = "jumpto") String jumpto,
@RequestParam(value = "code") String code,
HttpServletResponse response) throws IOException, ServletException {
try{
String ticketStr = getTicket(code);
response.sendRedirect(jumpto+"?code="+code+"&ticketStr="+ticketStr);
}catch (Exception e){
logger.error("ddSSOCallback error",e);
}
}
/**
* 18/03/2019 20:46
* 跨站cookie的问题,所以做了一次跳转
* [code, ticketStr, request, response]
* @author Gary J Li
* @return
*/
@RequestMapping(value = {"/sso/accept"})
public String accept(@RequestParam(value = "code") String code,
@RequestParam(value = "ticketStr") String ticketStr,HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
StringBuffer url = request.getRequestURL();
String tempContextUrl = url.delete(url.length() - request.getRequestURI().length(), url.length()).append("/").toString();
try{
Cookie codeCookie = new Cookie("ddCode",URLEncoder.encode(code, "UTF-8"));
codeCookie.setPath("/");
codeCookie.setMaxAge(18000);
Cookie ddTicket = new Cookie("ddTicket",URLEncoder.encode(ticketStr, "UTF-8"));
ddTicket.setPath("/");
Cookie jumptoCookie = new Cookie("ddJumpto",URLEncoder.encode(jumpto, "UTF-8"));
jumptoCookie.setPath("/");
ddTicket.setMaxAge(18000);
response.addCookie(codeCookie);
response.addCookie(jumptoCookie);
response.addCookie(ddTicket);
}catch (Exception e){
}catch (Exception e){
logger.error("ddSSOCallback error",e);
}
return "redirect:/Account/LogOn";
return "redirect:"+tempContextUrl+"Account/LogOn";
}
@RequestMapping(value = {"/admin", "/admin.html"}, method = RequestMethod.GET)
......
......@@ -9,7 +9,7 @@ log.level=DEBUG
#didi-config
check_ticket=false
get_user_info_url=http://mis-test.diditaxi.com.cn/auth/sso/api/
get_user_info_url=http://mis.diditaxi.com.cn/auth/sso/api/
app_id=2500
app_key=983258e7fd04d7fa0534735f7b1c33f3
cookie.maxAgeSeconds=86400
\ No newline at end of file
......@@ -10,6 +10,6 @@ jwt.refreshSecond=600
log.level=DEBUG
#didi-config
check_ticket=false
get_user_info_url=http://mis-test.diditaxi.com.cn/auth/sso/api/
get_user_info_url=http://mis.diditaxi.com.cn/auth/sso/api/
app_id=2500
app_key=983258e7fd04d7fa0534735f7b1c33f3
......@@ -373,11 +373,11 @@
"InvestmentAmount": "投资金额",
"InvestmentCurrency": "投资金额币种",
"InvestmentRadio": "投资比例",
"PayableShareholderName": "实缴股东名称",
"PayableShareholderIdNum": "实缴股东证件编号",
"PayableCapitalContributionAmount": "实缴出资金额",
"PayableCapitalContributionCurrency": "实缴出资币种",
"PayableContributionProportion": "实缴出资比例",
"PayableShareholderName": "实缴投资方信息",
"PayableShareholderIdNum": "证件编号",
"PayableCapitalContributionAmount": "实缴投资方金额",
"PayableCapitalContributionCurrency": "实缴投资方币种",
"PayableContributionProportion": "实缴投资方出资比例",
"TotalInvestment": "出资总额",
"HoldingInstitution": "控股机构",
"TaxRegistrationInformation": "税务登记信息",
......
......@@ -2979,9 +2979,11 @@
orgTotal: data.length,
amountTotal: amountTotal,
proportionTotal: proportionTotal
}
};
if($scope.EquitySumInfo.proportionTotal!==100){
$scope.isNotHundred=true;
}else{
$scope.isNotHundred=false;
}
} else {
SweetAlert.warning($translate.instant('NoEquityInfo'));
......
......@@ -30,11 +30,11 @@
$scope.showTotalSecondRow = false;
$scope.importExcelFileUrlList = {
taxData : apiInterceptor.webApiHostUrl + '/Analysis/DomesitcExcelFile',
returnTax : apiInterceptor.webApiHostUrl + '/Analysis/DomesitcExcelFile',
gmvSubsidy : apiInterceptor.webApiHostUrl + '/Analysis/DomesitcExcelFile',
employeeNum : apiInterceptor.webApiHostUrl + '/Analysis/DomesitcExcelFile',
driverNum : apiInterceptor.webApiHostUrl + '/Analysis/DomesitcExcelFile'
taxData : apiInterceptor.webApiHostUrl + '/Analysis/InternationalExcelFile',
returnTax : apiInterceptor.webApiHostUrl + '/Analysis/InternationalExcelFile',
gmvSubsidy : apiInterceptor.webApiHostUrl + '/Analysis/InternationalExcelFile',
employeeNum : apiInterceptor.webApiHostUrl + '/Analysis/InternationalExcelFile',
driverNum : apiInterceptor.webApiHostUrl + '/Analysis/InternationalExcelFile'
};
$scope.maxTitleLength = constant.maxButtonTitleLength;
......@@ -205,6 +205,8 @@
Upload.upload({
url: url,
data: {
companyName :$scope.selectCompany,
country : $scope.selectCountry,
period: period,
type: $scope.importType
},
......
......@@ -33,6 +33,7 @@ controller('editEquityChangeModalController', ['$scope', '$log', '$translate', '
// 保存股权
$scope.saveEquity = function () {
$scope.equityControlForm.$setSubmitted();
var rows = $scope.equityListInstance.getVisibleRows();
var updateEquity = [];
for (var i = 0; i < rows.length; i++) {
......
......@@ -113,8 +113,8 @@ 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());
callExtractFinancialData: function (param) {
return $http.post('/DataImport/callExtractFinancialData',param, apiConfig.create());
},
callExtractInvoiceData: function (orgIds, period,dataTypes) {
return $http.post('/DataImport/callExtractInvoiceData', { orgIds: orgIds, period: period,dataTypes:dataTypes }, apiConfig.create());
......
......@@ -107,7 +107,13 @@
//导入事件
var callFinancialApi = function () {
var periodStr = $scope.UploadPeriodTime;
dataImportService.callExtractFinancialData($scope.checkedCompanyCodeList,periodStr,$scope.checkedFileCodeList).success(function (data) {
var param = {
orgIds: $scope.checkedCompanyCodeList,
period: periodStr,
dataTypes: $scope.checkedFileCodeList
};
dataImportService.callExtractFinancialData(param).success(function (data) {
if (data) {
getFinancialDataStatus();
}
......
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