Commit 4e6aea16 authored by eddie.woo's avatar eddie.woo

modify

parent f5d391e6
...@@ -304,7 +304,7 @@ public class EnterpriseAccountManagerController { ...@@ -304,7 +304,7 @@ public class EnterpriseAccountManagerController {
} catch (Exception e) { } catch (Exception e) {
logger.error("mapAccount error.", e); logger.error("mapAccount error.", e);
} }
return OperationResultDto.error("动对应失败"); return OperationResultDto.error("动对应失败");
} }
@ResponseBody @ResponseBody
......
...@@ -5,31 +5,31 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -5,31 +5,31 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List; import java.util.List;
public class StandardAccountDto { public class StandardAccountDto {
public String id; private String id;
public String code; private String code;
public String name; private String name;
public String parentCode; private String parentCode;
public String fullName; private String fullName;
public int number; private int number;
public Boolean expanded; private Boolean expanded;
public Integer acctProp; private Integer acctProp;
public Integer subProp; private Integer subProp;
public Integer acctLevel; private Integer acctLevel;
public int direction; private int direction;
public Boolean isLeaf; private Boolean isLeaf;
public int ruleType; private int ruleType;
public Boolean isActive; private Boolean isActive;
public String englishName; private String englishName;
@JsonProperty("industryID") @JsonProperty("industryID")
public String industryId; private String industryId;
public String title; private String title;
public String etsName; private String etsName;
public String etsCode; private String etsCode;
public List<StandardAccountDto> children; private List<StandardAccountDto> children;
public String treeLevel; private String treeLevel;
/// <summary> /// <summary>
/// 父级科目名称 /// 父级科目名称
...@@ -37,7 +37,7 @@ public class StandardAccountDto { ...@@ -37,7 +37,7 @@ public class StandardAccountDto {
/// <value> /// <value>
/// The name of the parent. /// The name of the parent.
/// </value> /// </value>
public String parentName; private String parentName;
/// <summary> /// <summary>
/// 父级科目全名 /// 父级科目全名
...@@ -45,7 +45,7 @@ public class StandardAccountDto { ...@@ -45,7 +45,7 @@ public class StandardAccountDto {
/// <value> /// <value>
/// The full name of the parent. /// The full name of the parent.
/// </value> /// </value>
public String parentFullName; private String parentFullName;
public String getId() { public String getId() {
return id; return id;
...@@ -135,12 +135,12 @@ public class StandardAccountDto { ...@@ -135,12 +135,12 @@ public class StandardAccountDto {
this.direction = direction; this.direction = direction;
} }
public Boolean getLeaf() { public Boolean getIsLeaf() {
return isLeaf; return this.isLeaf;
} }
public void setLeaf(Boolean leaf) { public void setIsLeaf(Boolean leaf) {
isLeaf = leaf; this.isLeaf = leaf;
} }
public int getRuleType() { public int getRuleType() {
...@@ -151,12 +151,12 @@ public class StandardAccountDto { ...@@ -151,12 +151,12 @@ public class StandardAccountDto {
this.ruleType = ruleType; this.ruleType = ruleType;
} }
public Boolean getActive() { public Boolean getIsActive() {
return isActive; return this.isActive;
} }
public void setActive(Boolean active) { public void setIsActive(Boolean active) {
isActive = active; this.isActive = active;
} }
public String getEnglishName() { public String getEnglishName() {
...@@ -230,4 +230,5 @@ public class StandardAccountDto { ...@@ -230,4 +230,5 @@ public class StandardAccountDto {
public void setParentFullName(String parentFullName) { public void setParentFullName(String parentFullName) {
this.parentFullName = parentFullName; this.parentFullName = parentFullName;
} }
} }
...@@ -726,7 +726,7 @@ public class EnterpriseAccountServiceImpl extends AbstractService { ...@@ -726,7 +726,7 @@ public class EnterpriseAccountServiceImpl extends AbstractService {
}).collect(Collectors.toList()); }).collect(Collectors.toList());
//获取叶子节点标准科目集合 //获取叶子节点标准科目集合
List<StandardAccountDto> stdAccountLeafList = stdAccountDtoList.stream().filter(x -> x.isLeaf).collect(Collectors.toList()); List<StandardAccountDto> stdAccountLeafList = stdAccountDtoList.stream().filter(StandardAccountDto::getIsLeaf).collect(Collectors.toList());
List<AccountMappingManual> allAccountMappingManualList = mappingManualDao.getAll().get(); List<AccountMappingManual> allAccountMappingManualList = mappingManualDao.getAll().get();
accountSet = enterpriseAccountSetMapper.selectByPrimaryKey(accountSetId); accountSet = enterpriseAccountSetMapper.selectByPrimaryKey(accountSetId);
...@@ -1354,7 +1354,7 @@ public class EnterpriseAccountServiceImpl extends AbstractService { ...@@ -1354,7 +1354,7 @@ public class EnterpriseAccountServiceImpl extends AbstractService {
/** /**
* Validates if there is any duplication account code in the list * Validates if there is any duplication account code in the list
* *
* @param list * @param epAccountList
* @return ValidateInfoDto * @return ValidateInfoDto
*/ */
private ValidateInfoDto getRepeatValidate(List<EnterpriseAccountDto> epAccountList) { private ValidateInfoDto getRepeatValidate(List<EnterpriseAccountDto> epAccountList) {
...@@ -1919,8 +1919,8 @@ public class EnterpriseAccountServiceImpl extends AbstractService { ...@@ -1919,8 +1919,8 @@ public class EnterpriseAccountServiceImpl extends AbstractService {
/** /**
* Sets the acct level. * Sets the acct level.
* *
* @param current - The current * @param currentDto - The current
* @param validateList - The validate list * @param validateDtoList - The validate list
*/ */
private void setAcctLevel(EnterpriseAccountDto currentDto, List<EnterpriseAccountDto> validateDtoList) { private void setAcctLevel(EnterpriseAccountDto currentDto, List<EnterpriseAccountDto> validateDtoList) {
...@@ -1952,4 +1952,9 @@ public class EnterpriseAccountServiceImpl extends AbstractService { ...@@ -1952,4 +1952,9 @@ public class EnterpriseAccountServiceImpl extends AbstractService {
} }
} }
public OperationResultDto hasMappedCheck(String[] orgIds, String orgSetId) {
//TODO 检查Mapping关系
return null;
}
} }
...@@ -1878,8 +1878,9 @@ public class OrganizationServiceImpl { ...@@ -1878,8 +1878,9 @@ public class OrganizationServiceImpl {
} }
orgDto.setId(CommonUtils.getUUID()); orgDto.setId(CommonUtils.getUUID());
orgDto.setCreateTime(new Date()); Date now = new Date();
orgDto.setUpdateTime(new Date()); orgDto.setCreateTime(now);
orgDto.setUpdateTime(now);
OrganizationValidateDto vailOrgDto = new OrganizationValidateDto(); OrganizationValidateDto vailOrgDto = new OrganizationValidateDto();
vailOrgDto.setId(orgDto.getId()); vailOrgDto.setId(orgDto.getId());
...@@ -1944,7 +1945,6 @@ public class OrganizationServiceImpl { ...@@ -1944,7 +1945,6 @@ public class OrganizationServiceImpl {
Integer newTaxPayerType = (templateGrp != null && templateGrp.getPayTaxType() != null) Integer newTaxPayerType = (templateGrp != null && templateGrp.getPayTaxType() != null)
? templateGrp.getPayTaxType() - 1 ? templateGrp.getPayTaxType() - 1
: VatTaxPayerTypeEnum.General.value(); : VatTaxPayerTypeEnum.General.value();
Date now = new Date();
TaxPayerReportRule newRule = new TaxPayerReportRule(); TaxPayerReportRule newRule = new TaxPayerReportRule();
newRule.setId(distributedIdService.nextId()); newRule.setId(distributedIdService.nextId());
newRule.setIsDefault(false); newRule.setIsDefault(false);
......
...@@ -9,14 +9,10 @@ import pwc.taxtech.atms.common.CommonUtils; ...@@ -9,14 +9,10 @@ import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.constant.ActiveStatus; import pwc.taxtech.atms.constant.ActiveStatus;
import pwc.taxtech.atms.constant.StandAccountConstant; import pwc.taxtech.atms.constant.StandAccountConstant;
import pwc.taxtech.atms.constant.enums.StdAccountEnum; import pwc.taxtech.atms.constant.enums.StdAccountEnum;
import pwc.taxtech.atms.dao.OrganizationMapper; import pwc.taxtech.atms.dao.*;
import pwc.taxtech.atms.dao.StandardAccountDao;
import pwc.taxtech.atms.dao.StandardAccountMapper;
import pwc.taxtech.atms.dto.stdaccount.StandardAccountDto; import pwc.taxtech.atms.dto.stdaccount.StandardAccountDto;
import pwc.taxtech.atms.dto.stdaccount.StdAccountFancyTreeDto; import pwc.taxtech.atms.dto.stdaccount.StdAccountFancyTreeDto;
import pwc.taxtech.atms.entity.Organization; import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.entity.StandardAccount;
import pwc.taxtech.atms.entity.StandardAccountExample;
import pwc.taxtech.atms.exception.ServiceException; import pwc.taxtech.atms.exception.ServiceException;
import java.util.*; import java.util.*;
...@@ -32,6 +28,10 @@ public class StdAccountServiceImpl extends BaseService { ...@@ -32,6 +28,10 @@ public class StdAccountServiceImpl extends BaseService {
private OrganizationMapper organizationMapper; private OrganizationMapper organizationMapper;
@Autowired @Autowired
private StandardAccountDao standardAccountDao; private StandardAccountDao standardAccountDao;
@Autowired
private AccountMappingMapper accountMappingMapper;
@Autowired
private EnterpriseAccountMapper enterpriseAccountMapper;
public List<StdAccountFancyTreeDto> getStdAccountHierarchy(String orgId) throws ServiceException { public List<StdAccountFancyTreeDto> getStdAccountHierarchy(String orgId) throws ServiceException {
List<StdAccountFancyTreeDto> resultList; List<StdAccountFancyTreeDto> resultList;
...@@ -85,16 +85,35 @@ public class StdAccountServiceImpl extends BaseService { ...@@ -85,16 +85,35 @@ public class StdAccountServiceImpl extends BaseService {
if (organization == null) { if (organization == null) {
return Collections.emptyList(); return Collections.emptyList();
} }
String industryId = organization.getIndustryId(); String industryId = StringUtils.defaultString(organization.getIndustryId(), "0");
AccountMappingExample example = new AccountMappingExample();
example.createCriteria().andOrganizationIdEqualTo(orgId).andEnterpriseAccountSetIdEqualTo(accountSetId).andIndustryIdEqualTo(industryId);
List<AccountMapping> mappingList = accountMappingMapper.selectByExample(example);
List<StandardAccount> stdAccounts = standardAccountDao.getStdAccount(StdAccountEnum.RuleType.TWO, industryId, true, true); if (CollectionUtils.isEmpty(mappingList)) {
return Collections.emptyList();
if (CollectionUtils.isEmpty(stdAccounts)) {
stdAccounts = standardAccountDao.getStdAccount(StdAccountEnum.RuleType.TWO, "0", true, true);
} }
StandardAccountExample stdExample = new StandardAccountExample();
stdExample.createCriteria().andCodeIn(mappingList.stream().map(AccountMapping::getStandardAccountCode).collect(Collectors.toList()));
List<StandardAccount> stdList = standardAccountMapper.selectByExample(stdExample);
return Collections.emptyList(); EnterpriseAccountExample etExample = new EnterpriseAccountExample();
etExample.createCriteria().andEnterpriseAccountSetIdEqualTo(accountSetId).andCodeIn(mappingList.stream()
.map(AccountMapping::getEnterpriseAccountCode).collect(Collectors.toList()));
List<EnterpriseAccount> etList = enterpriseAccountMapper.selectByExample(etExample);
Map<String, AccountMapping> mappingMap = mappingList.stream().collect(Collectors.toMap(AccountMapping::getStandardAccountCode, a -> a, (k1, k2) -> k1));
Map<String, EnterpriseAccount> etMappingMap = etList.stream().collect(Collectors.toMap(EnterpriseAccount::getCode, a -> a, (k1, k2) -> k1));
return stdList.stream().map(o -> {
StandardAccountDto dto = new StandardAccountDto();
beanUtil.copyProperties(o, dto);
String etsCode = mappingMap.get(o.getCode()).getEnterpriseAccountCode();
dto.setEtsCode(etsCode);
dto.setEtsName(etMappingMap.get(etsCode).getName());
return dto;
}).collect(Collectors.toList());
} }
public List<StandardAccountDto> getStdAccountByIndustry(String industryId) { public List<StandardAccountDto> getStdAccountByIndustry(String industryId) {
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<div id="enterprizeAccount" class="tab-pane active"> <div id="enterprizeAccount" class="tab-pane active">
<div class="auto-mapping-div"> <div class="auto-mapping-div">
<!--自动对应--> <!--自动对应-->
<button class="btn btn-primary " ng-disabled="!selectedOrg.isHaveEditPermission" ng-click="autoMap()" translate="EnterpriceAccountMapping"></button> <!--<button class="btn btn-primary " ng-disabled="!selectedOrg.isHaveEditPermission" ng-click="autoMap()" translate="EnterpriceAccountMapping"></button>-->
<!--取消对应--> <!--取消对应-->
<button class="btn btn-secondary " ng-disabled="!selectedOrg.isHaveEditPermission" ng-click="ClearMap()" translate="ClearMapping"></button> <button class="btn btn-secondary " ng-disabled="!selectedOrg.isHaveEditPermission" ng-click="ClearMap()" translate="ClearMapping"></button>
<!--复制对应关系--> <!--复制对应关系-->
......
...@@ -80,9 +80,10 @@ ...@@ -80,9 +80,10 @@
if (flag == 'detail') { if (flag == 'detail') {
if (previousEspID === currentEspID && currentOrgID === previousOrgID) { //修改之后无法查看,直接查接口
return; // if (previousEspID === currentEspID && currentOrgID === previousOrgID) {
} // return;
// }
scope.InitStdSubjectLinkEtsSubject(); scope.InitStdSubjectLinkEtsSubject();
......
...@@ -128,7 +128,7 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', ' ...@@ -128,7 +128,7 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
//} //}
//客户代码是固定死的 //客户代码是固定死的
$scope.editOrgModel.clientCode = $scope.projectClientName; // $scope.editOrgModel.clientCode = $scope.projectClientName;
var editModel = $scope.editOrgModel; var editModel = $scope.editOrgModel;
//判断新增或修改 //判断新增或修改
......
...@@ -44,26 +44,15 @@ ...@@ -44,26 +44,15 @@
</div> </div>
</div> </div>
<!--客户代码-->
<!--地区-->
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label"><span class="must-input">*</span>{{'AdministrativeRegion' | translate}}:</label> <label for="clientCode" class="col-sm-3 control-label"><span class="must-input">*</span>{{'OrganizationClientCode' | translate}}:</label>
<div class="col-sm-9 row"> <div class="col-sm-9" ng-class="{'has-error':orgControlForm.clientCode.$invalid && (orgControlForm.clientCode.$dirty || orgControlForm.$submitted)}">
<div class="col-sm-6" style="padding-left: 0px;" ng-class="{'has-error':orgControlForm.selectProvince.$invalid && (orgControlForm.selectProvince.$dirty || orgControlForm.$submitted)}"> <input class="form-control" name="clientCode" id="clientCode" ng-model="editOrgModel.clientCode" placeholder="{{resources.OrganizationClientCode}}" maxlength="50" required>
<select class="form-control" name="selectProvince" style="width: 120px; " ng-change="populateCities()" ng-model="selectProvince" ng-options="x.regionName for x in ProvinceList" required> <p ng-show="orgControlForm.clientCode.$error.required && (orgControlForm.clientCode.$dirty || orgControlForm.$submitted)" class="has-error label">{{resources.OrganizationMsgClientCodeRequired}}</p>
<option value="">{{pleaseSelect}}</option>
</select>
<p ng-show="orgControlForm.selectProvince.$error.required && (orgControlForm.selectProvince.$dirty || orgControlForm.$submitted)" class="has-error label" style="margin-left: -16px">{{resources.OrganizationMsgProvinceRequired}}</p>
</div>
<div class="col-sm-6" style="padding-left: 2px;" ng-class="{'has-error':orgControlForm.selectCity.$invalid && (orgControlForm.selectCity.$dirty || orgControlForm.$submitted)}">
<select class="form-control" name="selectCity" id="selectCity" style="width: 120px; " ng-model="selectRegionID" required>
<option value="">{{pleaseSelect}}</option>
<option ng-repeat="x in CityList" value="{{x.regionID}}" title="{{x.regionName}}">{{x.regionName | limitString:10}}</option>
</select>
<p ng-show="orgControlForm.selectCity.$error.required && (orgControlForm.selectCity.$dirty || orgControlForm.$submitted)" class="has-error label" style="margin-left: 30px">{{resources.OrganizationMsgCityRequired}}</p>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="quarter-div rightUp"> <div class="quarter-div rightUp">
...@@ -78,14 +67,7 @@ ...@@ -78,14 +67,7 @@
<p ng-show="orgControlForm.code.$error.codeUnique" class="has-error label">{{resources.OrganizationMsgCodeUnique}}</p> <p ng-show="orgControlForm.code.$error.codeUnique" class="has-error label">{{resources.OrganizationMsgCodeUnique}}</p>
</div> </div>
</div> </div>
<!--客户代码-->
<!--<div class="form-group">
<label for="clientCode" class="col-sm-3 control-label"><span class="must-input">*</span>{{'OrganizationClientCode' | translate}}:</label>
<div class="col-sm-9" ng-class="{'has-error':orgControlForm.clientCode.$invalid && (orgControlForm.clientCode.$dirty || orgControlForm.$submitted)}">
<input class="form-control" name="clientCode" ng-disabled="true" id="clientCode" ng-model="editOrgModel.clientCode" placeholder="{{resources.OrganizationClientCode}}" maxlength="50" required>
<p ng-show="orgControlForm.clientCode.$error.required && (orgControlForm.clientCode.$dirty || orgControlForm.$submitted)" class="has-error label">{{resources.OrganizationMsgClientCodeRequired}}</p>
</div>
</div>-->
<!--纳税人识别号--> <!--纳税人识别号-->
<div class="form-group"> <div class="form-group">
<label for="taxPayerNumber" class="col-sm-3 control-label">{{'TaxpayerIdentificationNumber' | translate}}:</label> <label for="taxPayerNumber" class="col-sm-3 control-label">{{'TaxpayerIdentificationNumber' | translate}}:</label>
...@@ -147,7 +129,25 @@ ...@@ -147,7 +129,25 @@
</div> </div>
</div> </div>
<div class="quarter-div rightDown"> <div class="quarter-div rightDown">
<!--地区-->
<div class="form-group">
<label class="col-sm-3 control-label"><span class="must-input">*</span>{{'AdministrativeRegion' | translate}}:</label>
<div class="col-sm-9 row">
<div class="col-sm-6" style="padding-left: 0px;" ng-class="{'has-error':orgControlForm.selectProvince.$invalid && (orgControlForm.selectProvince.$dirty || orgControlForm.$submitted)}">
<select class="form-control" name="selectProvince" style="width: 120px; " ng-change="populateCities()" ng-model="selectProvince" ng-options="x.regionName for x in ProvinceList" required>
<option value="">{{pleaseSelect}}</option>
</select>
<p ng-show="orgControlForm.selectProvince.$error.required && (orgControlForm.selectProvince.$dirty || orgControlForm.$submitted)" class="has-error label" style="margin-left: -16px">{{resources.OrganizationMsgProvinceRequired}}</p>
</div>
<div class="col-sm-6" style="padding-left: 2px;" ng-class="{'has-error':orgControlForm.selectCity.$invalid && (orgControlForm.selectCity.$dirty || orgControlForm.$submitted)}">
<select class="form-control" name="selectCity" id="selectCity" style="width: 120px; " ng-model="selectRegionID" required>
<option value="">{{pleaseSelect}}</option>
<option ng-repeat="x in CityList" value="{{x.regionID}}" title="{{x.regionName}}">{{x.regionName | limitString:10}}</option>
</select>
<p ng-show="orgControlForm.selectCity.$error.required && (orgControlForm.selectCity.$dirty || orgControlForm.$submitted)" class="has-error label" style="margin-left: 30px">{{resources.OrganizationMsgCityRequired}}</p>
</div>
</div>
</div>
<!--层级--> <!--层级-->
<div class="form-group"> <div class="form-group">
<label for="selectLevelType" class="col-sm-3 control-label"><span class="must-input">*</span>{{'OrganizationLevelType' | translate}}:</label> <label for="selectLevelType" class="col-sm-3 control-label"><span class="must-input">*</span>{{'OrganizationLevelType' | translate}}:</label>
......
...@@ -21,7 +21,7 @@ webservices.factory('stdAccountService', ['$http', 'apiConfig', function ($http, ...@@ -21,7 +21,7 @@ webservices.factory('stdAccountService', ['$http', 'apiConfig', function ($http,
return $http.get('/stdAccount/getsingle?id=' + id, apiConfig.create()); return $http.get('/stdAccount/getsingle?id=' + id, apiConfig.create());
}, },
getStdAccountLinkEtsAccount: function (orgID, accountSetID) { getStdAccountLinkEtsAccount: function (orgID, accountSetID) {
return $http.get('/stdAccount/getStdAccountLinkEtsAccount?orgID=' + orgID + '&accountSetID=' + accountSetID, apiConfig.create()); return $http.get('/stdAccount/getStdAccountLinkEtsAccount?orgId=' + orgID + '&accountSetId=' + accountSetID, apiConfig.create());
}, },
getStdAccountByOrgID: function (orgID) { getStdAccountByOrgID: function (orgID) {
return $http.get('/stdAccount/getStdAccountByOrgID?orgID=' + orgID , apiConfig.create()); return $http.get('/stdAccount/getStdAccountByOrgID?orgID=' + orgID , apiConfig.create());
......
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