Commit da324458 authored by gary's avatar gary

1、机构接口

parent 2e39bfb5
......@@ -143,4 +143,19 @@ public class EbsApiController {
return ApiResultDto.fail();
}
@RequestMapping(value = "/updateOrg", method = RequestMethod.POST)
public ApiResultDto updateOrg(@RequestBody List<OrganizationQueryDto> items) {
if (CollectionUtils.isEmpty(items)) {
logger.debug("the updateOrg return items is empty");
return ApiResultDto.success(Collections.emptyList());
}
try {
ebsApiService.queryRemoteServerThenUpdateOrg(items);
return ApiResultDto.success();
} catch (Exception e) {
logger.error("updateOrg error.", e);
}
return ApiResultDto.fail();
}
}
package pwc.taxtech.atms.dto.ebsdto;
import java.io.Serializable;
/**
* @Auther: Gary J Li
* @Date: 04/03/2019 17:14
* @Description:
*/
public class OrganizationQueryDto implements Serializable {
private String taxPayerNumber;
private String code;
private String name;
private String enterpriseAccountCode;
private String legalPersonName;
private String registrationCapital;
private String paidInCapital;
private String legalPersonPhoneNumber;
private String legalPersonLandlineNum;
private String legalPersonEmailAddress;
private String regFinancialOfficerName;
private String regFinancialOfficerPhoneNum;
private String regFinancialOfficerLandlineNum;
private String regFinancialOfficerEmailAddress;
private String currencyCode;
private String registerAddress;
private String parentName;
private int staffSize;
public String getTaxPayerNumber() {
return taxPayerNumber;
}
public void setTaxPayerNumber(String taxPayerNumber) {
this.taxPayerNumber = taxPayerNumber;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEnterpriseAccountCode() {
return enterpriseAccountCode;
}
public void setEnterpriseAccountCode(String enterpriseAccountCode) {
this.enterpriseAccountCode = enterpriseAccountCode;
}
public String getLegalPersonName() {
return legalPersonName;
}
public void setLegalPersonName(String legalPersonName) {
this.legalPersonName = legalPersonName;
}
public String getRegistrationCapital() {
return registrationCapital;
}
public void setRegistrationCapital(String registrationCapital) {
this.registrationCapital = registrationCapital;
}
public String getPaidInCapital() {
return paidInCapital;
}
public void setPaidInCapital(String paidInCapital) {
this.paidInCapital = paidInCapital;
}
public String getLegalPersonPhoneNumber() {
return legalPersonPhoneNumber;
}
public void setLegalPersonPhoneNumber(String legalPersonPhoneNumber) {
this.legalPersonPhoneNumber = legalPersonPhoneNumber;
}
public String getLegalPersonLandlineNum() {
return legalPersonLandlineNum;
}
public void setLegalPersonLandlineNum(String legalPersonLandlineNum) {
this.legalPersonLandlineNum = legalPersonLandlineNum;
}
public String getLegalPersonEmailAddress() {
return legalPersonEmailAddress;
}
public void setLegalPersonEmailAddress(String legalPersonEmailAddress) {
this.legalPersonEmailAddress = legalPersonEmailAddress;
}
public String getRegFinancialOfficerName() {
return regFinancialOfficerName;
}
public void setRegFinancialOfficerName(String regFinancialOfficerName) {
this.regFinancialOfficerName = regFinancialOfficerName;
}
public String getRegFinancialOfficerPhoneNum() {
return regFinancialOfficerPhoneNum;
}
public void setRegFinancialOfficerPhoneNum(String regFinancialOfficerPhoneNum) {
this.regFinancialOfficerPhoneNum = regFinancialOfficerPhoneNum;
}
public String getRegFinancialOfficerLandlineNum() {
return regFinancialOfficerLandlineNum;
}
public void setRegFinancialOfficerLandlineNum(String regFinancialOfficerLandlineNum) {
this.regFinancialOfficerLandlineNum = regFinancialOfficerLandlineNum;
}
public String getRegFinancialOfficerEmailAddress() {
return regFinancialOfficerEmailAddress;
}
public void setRegFinancialOfficerEmailAddress(String regFinancialOfficerEmailAddress) {
this.regFinancialOfficerEmailAddress = regFinancialOfficerEmailAddress;
}
public String getCurrencyCode() {
return currencyCode;
}
public void setCurrencyCode(String currencyCode) {
this.currencyCode = currencyCode;
}
public String getRegisterAddress() {
return registerAddress;
}
public void setRegisterAddress(String registerAddress) {
this.registerAddress = registerAddress;
}
public String getParentName() {
return parentName;
}
public void setParentName(String parentName) {
this.parentName = parentName;
}
public int getStaffSize() {
return staffSize;
}
public void setStaffSize(int staffSize) {
this.staffSize = staffSize;
}
}
......@@ -61,4 +61,11 @@ public interface EbsApiService {
* @param items
*/
void queryRemoteServerThenUpdateOAR(List<OrganizationAccountingRateQueryDto> items);
/**
* ebs 机构信息表同步更新
*
* @param items
*/
void queryRemoteServerThenUpdateOrg(List<OrganizationQueryDto> items);
}
......@@ -7,10 +7,9 @@ import org.nutz.lang.Strings;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.ServiceException;
import pwc.taxtech.atms.common.util.BeanUtil;
import pwc.taxtech.atms.dao.OrganizationAccountingRateMapper;
import pwc.taxtech.atms.dao.OrganizationMapper;
import pwc.taxtech.atms.dao.ProjectMapper;
import pwc.taxtech.atms.dao.*;
import pwc.taxtech.atms.dto.ebsdto.*;
import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.service.EbsApiService;
......@@ -23,6 +22,7 @@ import java.math.RoundingMode;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
@Service
public class EbsApiServiceImpl implements EbsApiService {
......@@ -42,6 +42,14 @@ public class EbsApiServiceImpl implements EbsApiService {
@Resource
private OrganizationMapper organizationMapper;
@Resource
private OrganizationEmployeeMapper organizationEmployeeMapper;
@Resource
private OrganizationExtraMapper organizationExtraMapper;
@Resource
private EnterpriseAccountSetMapper enterpriseAccountSetMapper;
@Resource
private EnterpriseAccountSetOrgMapper enterpriseAccountSetOrgMapper;
@Resource
private ProjectMapper projectMapper;
@Resource
private DistributedIdService distributedIdService;
......@@ -210,6 +218,91 @@ public class EbsApiServiceImpl implements EbsApiService {
logger.debug("end queryRemoteServerThenUpdateOAR 汇率表,took [{}] ms", System.currentTimeMillis() - start);
}
@Override
public void queryRemoteServerThenUpdateOrg(List<OrganizationQueryDto> items) {
long start = System.currentTimeMillis();
logger.debug("start queryRemoteServerThenUpdateOrg 机构表");
//判断数据是否存在
if (items.size() == 0) {
logger.error("empty EBS Organization 机构表 response, skip processing");
return;
}
logger.debug("organization 汇率表:" + JSON.toJSONString(items));
for (OrganizationQueryDto a : items) {
try {
processORG(a);
} catch (Exception e) {
logger.error("break loop as catch:" + e, e);
}
}
logger.debug("end queryRemoteServerThenUpdateOrg 机构表,took [{}] ms", System.currentTimeMillis() - start);
}
private void processORG(OrganizationQueryDto a) {
// 机构信息
OrganizationExample organizationExample = new OrganizationExample();
organizationExample.createCriteria().andTaxPayerNumberEqualTo(a.getTaxPayerNumber());
List<Organization> orgs = organizationMapper.selectByExample(organizationExample);
Organization org = beanUtil.copyProperties(a,new Organization());
OrganizationExample orgExample = new OrganizationExample();
orgExample.createCriteria().andNameEqualTo(a.getParentName());
List<Organization> orgParents = organizationMapper.selectByExample(organizationExample);
String orgId = "";
if(orgParents.size()>0){
org.setParentId(orgParents.get(0).getId());
}
if(orgs.size()<1){
orgId = UUID.randomUUID().toString();
org.setId(orgId);
org.setApiUpdateFlag(true);
organizationMapper.insertSelective(org);
}else{
orgId = orgs.get(0).getId();
org.setId(orgs.get(0).getId());
org.setApiUpdateFlag(true);
org.setUpdateTime(new Date());
organizationMapper.updateByPrimaryKeySelective(org);
}
// 机构其他信息
OrganizationExtraExample organizationExtraExample = new OrganizationExtraExample();
organizationExtraExample.createCriteria().andOrganizationIdEqualTo(org.getId());
List<OrganizationExtra> orgExs = organizationExtraMapper.selectByExample(organizationExtraExample);
OrganizationExtra orgEx = beanUtil.copyProperties(a,new OrganizationExtra());
orgEx.setReportingCurrency(a.getCurrencyCode());
if(orgExs.size()<1){
orgEx.setId(distributedIdService.nextId());
orgEx.setOrganizationId(orgId);
organizationExtraMapper.insertSelective(orgEx);
}else{
orgEx.setId(orgExs.get(0).getId());
orgEx.setOrganizationId(orgId);
orgEx.setUpdateTime(new Date());
organizationExtraMapper.updateByExampleSelective(orgEx,organizationExtraExample);
}
// 账套ID
/*if(StringUtils.isNotEmpty(a.getEnterpriseAccountCode())){
EnterpriseAccountSet eas = new EnterpriseAccountSet();
String easId = UUID.randomUUID().toString();
eas.setIsActive(false);
eas.setId(easId);
eas.setCode(a.getEnterpriseAccountCode());
eas.setCreatorId("66933E7B-DA75-4B2E-B7D6-AB65DCA20D50");
enterpriseAccountSetMapper.insertSelective(eas);
EnterpriseAccountSetOrg easo = new EnterpriseAccountSetOrg();
easo.setId(UUID.randomUUID().toString());
easo.setOrganizationId(orgId);
easo.setEnterpriseAccountSetId(easId);
enterpriseAccountSetOrgMapper.insertSelective(easo);
}*/
// 雇员信息
OrganizationEmployee oe = new OrganizationEmployee();
oe.setId(distributedIdService.nextId());
oe.setOrganizationId(orgId);
oe.setEmployeesNumEnd(a.getStaffSize());
organizationEmployeeMapper.insertSelective(oe);
}
private void processJE(JournalEntryQueryDto item) {
JournalEntryExample journalEntryExample = new JournalEntryExample();
journalEntryExample.createCriteria().andHeaderIdEqualTo(item.getHeaderId()).andLineNumEqualTo(item.getLineNum());
......
package pwc.taxtech.atms.service.impl;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Lists;
import org.junit.Test;
import pwc.taxtech.atms.CommonIT;
import pwc.taxtech.atms.dto.ebsdto.*;
......@@ -93,6 +94,36 @@ public class EbsApiServiceImplTest extends CommonIT {
//ebsApiService.queryRemoteServerThenUpdateJE(items);
}
@Test
public void queryRemoteServerThenUpdateOrg(){
List<OrganizationQueryDto> items = Lists.newArrayList();
for(int i=0;i<2;i++){
OrganizationQueryDto dto = new OrganizationQueryDto();
dto.setTaxPayerNumber("sadsafsdf3232");
dto.setCode("ceshi0009");
dto.setName("测试成功");
dto.setEnterpriseAccountCode("test");
dto.setLegalPersonName("周杰伦");
dto.setRegistrationCapital("100万");
dto.setPaidInCapital("200万");
dto.setLegalPersonPhoneNumber("1239512312");
dto.setLegalPersonLandlineNum("1234678");
dto.setLegalPersonEmailAddress("didi@qq.com");
dto.setRegFinancialOfficerName("周杰伦");
dto.setRegFinancialOfficerPhoneNum("123141231");
dto.setRegFinancialOfficerLandlineNum("123213124");
dto.setRegFinancialOfficerEmailAddress("滴滴大厦");
dto.setCurrencyCode("CNY");
dto.setRegisterAddress("滴滴大厦");
dto.setParentName("滴滴测试");
dto.setStaffSize(12345);
items.add(dto);
}
String res=JSON.toJSONString(items);
System.out.println(res);
// ebsApiService.queryRemoteServerThenUpdateOrg(items);
}
@Test
public void queryRemoteServerThenUpdateTB() {
List<TrialBalanceQueryDto> items=new ArrayList<>();
......
......@@ -111,6 +111,8 @@ public class OrganizationDto {
private String regStatus;
private String enterpriseAccountCode;
private Date logoutTime;
private Boolean oversea;
......@@ -717,6 +719,14 @@ public class OrganizationDto {
this.taxControlDiskList = taxControlDiskList;
}
public String getEnterpriseAccountCode() {
return enterpriseAccountCode;
}
public void setEnterpriseAccountCode(String enterpriseAccountCode) {
this.enterpriseAccountCode = enterpriseAccountCode;
}
@Override
public int hashCode() {
final int prime = 31;
......
......@@ -21,6 +21,8 @@ public class Organization extends BaseEntity implements Serializable {
private String id;
/**
* Database Column Remarks:
* 目前无实际用途
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization.client_code
......@@ -39,6 +41,8 @@ public class Organization extends BaseEntity implements Serializable {
private String name;
/**
* Database Column Remarks:
* 机构代码/机构编码 滴滴项目机构key为这个字段或taxPayerNumber
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization.code
......@@ -300,6 +304,8 @@ public class Organization extends BaseEntity implements Serializable {
private String registrationLocation;
/**
* Database Column Remarks:
* 注册资本
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization.registration_capital
......@@ -476,6 +482,8 @@ public class Organization extends BaseEntity implements Serializable {
*/
private Boolean engageNationalProhibitIndustry;
private String enterpriseAccountCode;
/**
* Database Column Remarks:
* 注销时间。
......@@ -1723,6 +1731,29 @@ public class Organization extends BaseEntity implements Serializable {
this.logoutTime = logoutTime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization.enterprise_account_code
*
* @return the value of organization.enterprise_account_code
*
* @mbg.generated
*/
public String getEnterpriseAccountCode() {
return enterpriseAccountCode;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column organization.enterprise_account_code
*
* @param enterpriseAccountCode the value for organization.enterprise_account_code
*
* @mbg.generated
*/
public void setEnterpriseAccountCode(String enterpriseAccountCode) {
this.enterpriseAccountCode = enterpriseAccountCode == null ? null : enterpriseAccountCode.trim();
}
public Area getArea() {
......@@ -1741,6 +1772,7 @@ public class Organization extends BaseEntity implements Serializable {
this.businessUnit = businessUnit;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization
......@@ -1803,6 +1835,7 @@ public class Organization extends BaseEntity implements Serializable {
sb.append(", nationalEconomicIndustry=").append(nationalEconomicIndustry);
sb.append(", engageNationalProhibitIndustry=").append(engageNationalProhibitIndustry);
sb.append(", logoutTime=").append(logoutTime);
sb.append(", enterpriseAccountCode=").append(enterpriseAccountCode);
sb.append("]");
return sb.toString();
}
......
......@@ -3544,6 +3544,76 @@ public class OrganizationExample {
addCriterion("logout_time not between", value1, value2, "logoutTime");
return (Criteria) this;
}
public Criteria andEnterpriseAccountCodeIsNull() {
addCriterion("enterprise_account_code is null");
return (Criteria) this;
}
public Criteria andEnterpriseAccountCodeIsNotNull() {
addCriterion("enterprise_account_code is not null");
return (Criteria) this;
}
public Criteria andEnterpriseAccountCodeEqualTo(String value) {
addCriterion("enterprise_account_code =", value, "enterpriseAccountCode");
return (Criteria) this;
}
public Criteria andEnterpriseAccountCodeNotEqualTo(String value) {
addCriterion("enterprise_account_code <>", value, "enterpriseAccountCode");
return (Criteria) this;
}
public Criteria andEnterpriseAccountCodeGreaterThan(String value) {
addCriterion("enterprise_account_code >", value, "enterpriseAccountCode");
return (Criteria) this;
}
public Criteria andEnterpriseAccountCodeGreaterThanOrEqualTo(String value) {
addCriterion("enterprise_account_code >=", value, "enterpriseAccountCode");
return (Criteria) this;
}
public Criteria andEnterpriseAccountCodeLessThan(String value) {
addCriterion("enterprise_account_code <", value, "enterpriseAccountCode");
return (Criteria) this;
}
public Criteria andEnterpriseAccountCodeLessThanOrEqualTo(String value) {
addCriterion("enterprise_account_code <=", value, "enterpriseAccountCode");
return (Criteria) this;
}
public Criteria andEnterpriseAccountCodeLike(String value) {
addCriterion("enterprise_account_code like", value, "enterpriseAccountCode");
return (Criteria) this;
}
public Criteria andEnterpriseAccountCodeNotLike(String value) {
addCriterion("enterprise_account_code not like", value, "enterpriseAccountCode");
return (Criteria) this;
}
public Criteria andEnterpriseAccountCodeIn(List<String> values) {
addCriterion("enterprise_account_code in", values, "enterpriseAccountCode");
return (Criteria) this;
}
public Criteria andEnterpriseAccountCodeNotIn(List<String> values) {
addCriterion("enterprise_account_code not in", values, "enterpriseAccountCode");
return (Criteria) this;
}
public Criteria andEnterpriseAccountCodeBetween(String value1, String value2) {
addCriterion("enterprise_account_code between", value1, value2, "enterpriseAccountCode");
return (Criteria) this;
}
public Criteria andEnterpriseAccountCodeNotBetween(String value1, String value2) {
addCriterion("enterprise_account_code not between", value1, value2, "enterpriseAccountCode");
return (Criteria) this;
}
}
/**
......
......@@ -56,6 +56,7 @@
<result column="national_economic_industry" jdbcType="VARCHAR" property="nationalEconomicIndustry" />
<result column="engage_national_prohibit_industry" jdbcType="BIT" property="engageNationalProhibitIndustry" />
<result column="logout_time" jdbcType="TIMESTAMP" property="logoutTime" />
<result column="enterprise_account_code" jdbcType="VARCHAR" property="enterpriseAccountCode" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
......@@ -137,7 +138,7 @@
legal_code, vehicleroutinglocation, business_scope, architecture_type, num_of_branches,
api_update_flag, effec_time_of_general_taxpayers, registration_location_en, paid_in_capital,
general_tax_payer_effective_time, oversea, reg_status, national_economic_industry,
engage_national_prohibit_industry, logout_time
engage_national_prohibit_industry, logout_time, enterprise_account_code
</sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.entity.OrganizationExample" resultMap="BaseResultMap">
<!--
......@@ -208,7 +209,7 @@
registration_location_en, paid_in_capital,
general_tax_payer_effective_time, oversea, reg_status,
national_economic_industry, engage_national_prohibit_industry,
logout_time)
logout_time, enterprise_account_code)
values (#{id,jdbcType=VARCHAR}, #{clientCode,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{code,jdbcType=VARCHAR}, #{parentId,jdbcType=VARCHAR}, #{taxPayerNumber,jdbcType=VARCHAR},
#{regionId,jdbcType=VARCHAR}, #{structureId,jdbcType=VARCHAR}, #{industryId,jdbcType=VARCHAR},
......@@ -227,7 +228,7 @@
#{registrationLocationEn,jdbcType=VARCHAR}, #{paidInCapital,jdbcType=VARCHAR},
#{generalTaxPayerEffectiveTime,jdbcType=TIMESTAMP}, #{oversea,jdbcType=BIT}, #{regStatus,jdbcType=VARCHAR},
#{nationalEconomicIndustry,jdbcType=VARCHAR}, #{engageNationalProhibitIndustry,jdbcType=BIT},
#{logoutTime,jdbcType=TIMESTAMP})
#{logoutTime,jdbcType=TIMESTAMP}, #{enterpriseAccountCode,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.Organization">
<!--
......@@ -386,6 +387,9 @@
<if test="logoutTime != null">
logout_time,
</if>
<if test="enterpriseAccountCode != null">
enterprise_account_code,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
......@@ -538,6 +542,9 @@
<if test="logoutTime != null">
#{logoutTime,jdbcType=TIMESTAMP},
</if>
<if test="enterpriseAccountCode != null">
#{enterpriseAccountCode,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="pwc.taxtech.atms.entity.OrganizationExample" resultType="java.lang.Long">
......@@ -707,6 +714,9 @@
<if test="record.logoutTime != null">
logout_time = #{record.logoutTime,jdbcType=TIMESTAMP},
</if>
<if test="record.enterpriseAccountCode != null">
enterprise_account_code = #{record.enterpriseAccountCode,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
......@@ -767,7 +777,8 @@
reg_status = #{record.regStatus,jdbcType=VARCHAR},
national_economic_industry = #{record.nationalEconomicIndustry,jdbcType=VARCHAR},
engage_national_prohibit_industry = #{record.engageNationalProhibitIndustry,jdbcType=BIT},
logout_time = #{record.logoutTime,jdbcType=TIMESTAMP}
logout_time = #{record.logoutTime,jdbcType=TIMESTAMP},
enterprise_account_code = #{record.enterpriseAccountCode,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
......@@ -791,9 +802,6 @@
<if test="parentId != null">
parent_id = #{parentId,jdbcType=VARCHAR},
</if>
<if test="parentId == null">
parent_id = NULL,
</if>
<if test="taxPayerNumber != null">
tax_payer_number = #{taxPayerNumber,jdbcType=VARCHAR},
</if>
......@@ -929,6 +937,9 @@
<if test="logoutTime != null">
logout_time = #{logoutTime,jdbcType=TIMESTAMP},
</if>
<if test="enterpriseAccountCode != null">
enterprise_account_code = #{enterpriseAccountCode,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
......@@ -986,7 +997,8 @@
reg_status = #{regStatus,jdbcType=VARCHAR},
national_economic_industry = #{nationalEconomicIndustry,jdbcType=VARCHAR},
engage_national_prohibit_industry = #{engageNationalProhibitIndustry,jdbcType=BIT},
logout_time = #{logoutTime,jdbcType=TIMESTAMP}
logout_time = #{logoutTime,jdbcType=TIMESTAMP},
enterprise_account_code = #{enterpriseAccountCode,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.entity.OrganizationExample" resultMap="BaseResultMap">
......
......@@ -186,12 +186,12 @@
"EnterpriseAccountErrorCodeList": "科目代码明细",
"EnterpriseAccountImportDataFormatError": "企业科目导入数据格式有误",
"EnterpriseAccountList": "企业科目列表",
"EnterpriseAccountManage": "账套管理",
"EnterpriseAccountManage": "科目表管理",
"EnterpriseAccountName": "企业科目名称",
"EnterpriseAccountNameEmpty": "企业科目名字为空",
"EnterpriseAccountNameMaxLength": "企业科目名称过长",
"EnterpriseAccountNameRequired": "请输入企业科目名称",
"EnterpriseAccountNameShort": "账套名",
"EnterpriseAccountNameShort": "科目表名",
"EnterpriseAccountParentDisable": "请先启用父节点",
"EnterpriseAccountRepeat": "企业科目代码已经存在",
"EnterpriseAccountSetCode": "账套代码",
......
......@@ -7,10 +7,17 @@ controller('editUserModalController', ['$scope', '$log', '$translate', 'uiGridCo
$scope.isAdd = true;
$scope.editUserModel = {};
$scope.editUserModel.isAdmin = false;
//按滴滴需求设置用户所属机构默认为滴滴集团
$scope.editUserModel.OrganizationID = "BCFA0E77-9F6B-42B3-A486-A003536832CF";
$scope.editUserModel.orgName = "滴滴集团";
resetErrorStatus();
$('.edit-user-modal-wrapper .modal').modal('show');
};
// loadUser
var loadUser = function(userId) {
$scope.isAdd = false;
......@@ -40,11 +47,11 @@ controller('editUserModalController', ['$scope', '$log', '$translate', 'uiGridCo
hasError = true;
}
if (!$scope.editUserModel.OrganizationID) {
/*if (!$scope.editUserModel.OrganizationID) {
$scope.editUserModel.organizationIDError = $translate.instant('SelectOrg');
$('#dropdownMenu1').addClass('error-button');
hasError = true;
}
}*/
// if (!$scope.editUserModel.isAdmin) {
if (!$scope.editUserModel.RoleIDs || $scope.editUserModel.RoleIDs.length === 0) {
......@@ -268,6 +275,7 @@ controller('editUserModalController', ['$scope', '$log', '$translate', 'uiGridCo
//Disable user
$scope.disableUser = disableUser;
})();
}
]);
......@@ -34,9 +34,10 @@
<div class="form-group">
<label class="control-label col-sm-3"><span class="red-color">*</span><span translate="Company"></label>
<div class="col-sm-9">
<org-selector selected-org-name="editUserModel.OrgName" selected-org-id="editUserModel.OrganizationID" component-selected-org="" is-show-all="false" is-require="true"
<input id="orgName" type="text" name="orgName" maxlength="100" class="form-control" style="width: 300px;" ng-model="editUserModel.orgName" required>
<!--<org-selector selected-org-name="editUserModel.OrgName" selected-org-id="editUserModel.OrganizationID" component-selected-org="" is-show-all="false" is-require="true"
style="width: 300px;"></org-selector>
<label class="error-label" style="font-size:12px;" ng-show="editUserModel.organizationIDError">{{editUserModel.organizationIDError}}</label>
<label class="error-label" style="font-size:12px;" ng-show="editUserModel.organizationIDError">{{editUserModel.organizationIDError}}</label>-->
</div>
</div>
<div class="form-group">
......
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