Commit 1516dded authored by frank.xa.zhang's avatar frank.xa.zhang

batch upload for template download -- frank

parent 9c6f75c5
package pwc.taxtech.atms.constant.enums;
public enum BoardMeetingRequirementEnum {
Annual("Annual", 1),
SemiQnnual("Semi Qnnual", 2),
Quarter("Quarter", 3),
Monthly("Monthly", 3);
private String name;
private Integer value;
BoardMeetingRequirementEnum(String name, Integer value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public Integer getValue() {
return value;
}
}
package pwc.taxtech.atms.constant.enums;
public enum ClassOfSharesEnum {
A("A", 1),
B("B", 2);
private String name;
private Integer value;
ClassOfSharesEnum(String name, Integer value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public Integer getValue() {
return value;
}
}
package pwc.taxtech.atms.constant.enums;
public enum CommonOrPreferredEnum {
Common("Common", 1),
Preferred("Preferred", 2);
private String name;
private Integer value;
CommonOrPreferredEnum(String name, Integer value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public Integer getValue() {
return value;
}
}
package pwc.taxtech.atms.constant.enums;
public enum EntityLevelEnum {
InvestmentFund("Investment Fund", 1),
InvestmentHolding("Investment Holding", 2),
PortfolioCompany("Portfolio Company", 3);
private String name;
private Integer value;
EntityLevelEnum(String name, Integer value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public Integer getValue() {
return value;
}
}
package pwc.taxtech.atms.constant.enums;
public enum ExecutiveEnum {
Y("Y", 1),
N("N", 2);
private String name;
private Integer value;
ExecutiveEnum(String name, Integer value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public Integer getValue() {
return value;
}
}
package pwc.taxtech.atms.constant.enums;
public enum JurisdictionOfFormationEnum {
HongKong("Hong Kong", 1),
BritishVirginIslands("British Virgin Islands", 2),
CaymanIslands("Cayman Islands", 3);
private String name;
private Integer value;
JurisdictionOfFormationEnum(String name, Integer value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public Integer getValue() {
return value;
}
}
package pwc.taxtech.atms.constant.enums;
public enum LegalFormEnum {
LimitedPartnership("Limited Partnership", 1),
LimitedCompany("Limited Company", 2),
Trustee("Trustee", 2);
private String name;
private Integer value;
LegalFormEnum(String name, Integer value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public Integer getValue() {
return value;
}
}
package pwc.taxtech.atms.constant.enums;
public enum OwnershipFormEnum {
OrdinaryShares("Ordinary Shares", 1),
PreferenceShares("Preference Shares", 2);
private String name;
private Integer value;
OwnershipFormEnum(String name, Integer value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public Integer getValue() {
return value;
}
}
package pwc.taxtech.atms.constant.enums;
public enum RolesEnum {
CEO("CEO", 1),
CFO("CFO", 2),
NA("NA", 3);
private String name;
private Integer value;
RolesEnum(String name, Integer value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public Integer getValue() {
return value;
}
}
package pwc.taxtech.atms.controller; package pwc.taxtech.atms.controller;
import com.alibaba.fastjson.JSONArray;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
...@@ -10,7 +9,6 @@ import pwc.taxtech.atms.exception.ServiceException; ...@@ -10,7 +9,6 @@ import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.service.impl.DataImportService; import pwc.taxtech.atms.service.impl.DataImportService;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
@RestController @RestController
@RequestMapping("/api/v1/DataImport/") @RequestMapping("/api/v1/DataImport/")
...@@ -20,33 +18,26 @@ public class DataImportController extends BaseController { ...@@ -20,33 +18,26 @@ public class DataImportController extends BaseController {
private DataImportService dataImportService; private DataImportService dataImportService;
@ResponseBody @ResponseBody
@RequestMapping(value = "RLITExcelFile", method = RequestMethod.POST) @RequestMapping(value = "OrgExcelFile", method = RequestMethod.POST)
public OperationResultDto importRLITExcelFile(@RequestParam MultipartFile file,@RequestParam String orgIds,@RequestParam String periodDate,@RequestParam Integer importType) { public OperationResultDto importRLITExcelFile(@RequestParam MultipartFile file) {
try { try {
List<String> orgList = (List<String>)JSONArray.parse(orgIds); String valMsg = valParameter(file);
String valMsg = valParameter(file,orgList,periodDate); if (StringUtils.isNotEmpty(valMsg)) {
if(StringUtils.isNotEmpty(valMsg)){
return OperationResultDto.error(valMsg); return OperationResultDto.error(valMsg);
} }
return dataImportService.importRLITExcelFile(file,orgList, periodDate,importType); return dataImportService.importOrgExcelFile(file);
} catch (ServiceException e) { } catch (ServiceException e) {
return OperationResultDto.error(e.getMessage()); return OperationResultDto.error(e.getMessage());
} catch (Exception e) { } catch (Exception e) {
logger.error("importRLITExcelFile error.", e); logger.error("OrgExcelFile error.", e);
return OperationResultDto.error(ErrorMessage.SystemError); return OperationResultDto.error(ErrorMessage.SystemError);
} }
} }
private String valParameter(MultipartFile file,List<String> orgList,String periodDate){ private String valParameter(MultipartFile file) {
if (null == file) { if (null == file) {
return ErrorMessage.NoFile; return ErrorMessage.NoFile;
} }
if(orgList.size()<1){
return ErrorMessage.DidntSelectedCompany;
}
if(StringUtils.isEmpty(periodDate)){
return ErrorMessage.DidntSelectedPeriod;
}
return null; return null;
} }
......
...@@ -19,4 +19,6 @@ public class OrganizationDirectorDto { ...@@ -19,4 +19,6 @@ public class OrganizationDirectorDto {
Integer isExecutive; Integer isExecutive;
Integer otherRoles; Integer otherRoles;
String isDelete; String isDelete;
String internalEntityCode;
String companyName;
} }
...@@ -20,7 +20,7 @@ public class OrganizationHKDto { ...@@ -20,7 +20,7 @@ public class OrganizationHKDto {
private String code; private String code;
private Boolean isActive; private Boolean isActive;
private Long parentId; private Long parentId;
private String legalForm; private Integer legalForm;
private String registerAddress; private String registerAddress;
private Float authorisedCapital; private Float authorisedCapital;
private Float issuedCapital; private Float issuedCapital;
...@@ -30,9 +30,9 @@ public class OrganizationHKDto { ...@@ -30,9 +30,9 @@ public class OrganizationHKDto {
private String boardMeetingRequirement; private String boardMeetingRequirement;
private String businessLicense; private String businessLicense;
private String renewalOfBusinessLicense; private String renewalOfBusinessLicense;
private String entityLevel; private Integer entityLevel;
private String dateOfIncorporation; private String dateOfIncorporation;
private String jurisdictionOfFormation; private Integer jurisdictionOfFormation;
private String financialYearEnd; private String financialYearEnd;
private String annualAuditRequirement; private String annualAuditRequirement;
private String registeredAgent; private String registeredAgent;
......
...@@ -17,4 +17,7 @@ public class OrganizationShareholderDto { ...@@ -17,4 +17,7 @@ public class OrganizationShareholderDto {
Integer commonPreferred; Integer commonPreferred;
Integer classOfShares; Integer classOfShares;
String votingPercentage; String votingPercentage;
String internalEntityCode;
String companyName;
String shareholderName;
} }
...@@ -21,4 +21,13 @@ public interface OrganizationHKTMapper { ...@@ -21,4 +21,13 @@ public interface OrganizationHKTMapper {
OrganizationHKDto toOrganizationHKDto(OrganizationHK organizationHK); OrganizationHKDto toOrganizationHKDto(OrganizationHK organizationHK);
OrgInfoDto toOrgInfoDto(OrganizationHK organizationHK); OrgInfoDto toOrgInfoDto(OrganizationHK organizationHK);
@Mapping(source = "createTime", target = "createTime", dateFormat = "yyyy/MM/dd")
@Mapping(source = "updateTime", target = "updateTime", dateFormat = "yyyy/MM/dd")
@Mapping(source = "dateOfIncorporation", target = "dateOfIncorporation", dateFormat = "yyyy/MM/dd")
@Mapping(source = "paymentOfAnnualGovernmentFee", target = "paymentOfAnnualGovernmentFee", dateFormat = "yyyy/MM/dd")
@Mapping(source = "annualReturnFillings", target = "annualReturnFillings", dateFormat = "yyyy/MM/dd")
@Mapping(source = "renewalOfBusinessLicense", target = "renewalOfBusinessLicense", dateFormat = "yyyy/MM/dd")
@Mapping(source = "annualAuditRequirement", target = "annualAuditRequirement", dateFormat = "yyyy/MM/dd")
OrganizationHK toOrganiztionHK(OrganizationHKDto organizationHKDto);
} }
...@@ -29,7 +29,7 @@ commonModule.controller('uploadOrgModalController', ['$scope', '$log', '$transla ...@@ -29,7 +29,7 @@ commonModule.controller('uploadOrgModalController', ['$scope', '$log', '$transla
importExcelF: null importExcelF: null
}; };
$scope.importRLITExcelFile = apiInterceptor.webApiHostUrl + '/DataImport/RLITExcelFile'; $scope.importOrgExcelFile = apiInterceptor.webApiHostUrl + '/DataImport/OrgExcelFile';
$scope.downloadTemplate = function () { $scope.downloadTemplate = function () {
templateService.downloadTemplate().success(function (data, status, headers) { templateService.downloadTemplate().success(function (data, status, headers) {
var octetStreamMime = 'application/octet-stream'; var octetStreamMime = 'application/octet-stream';
...@@ -81,9 +81,8 @@ commonModule.controller('uploadOrgModalController', ['$scope', '$log', '$transla ...@@ -81,9 +81,8 @@ commonModule.controller('uploadOrgModalController', ['$scope', '$log', '$transla
Upload.upload({ Upload.upload({
url: $scope.importRLITExcelFile, url: $scope.importOrgExcelFile,
data: { data: {
importType: importType
}, },
file: impExl, file: impExl,
headers: { headers: {
......
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