Browse Source

新增customer_org_parameter;修改/gov/org/agency/agencydetail接口,修改添加网格

添加部门接口
dev
yinzuomei 4 years ago
parent
commit
a44cca13c4
  1. 22
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java
  2. 16
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerAgencyEntity.java
  3. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerDepartmentEntity.java
  4. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerAgencyEntity.java
  5. 22
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java
  6. 96
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerOrgParameterDTO.java
  7. 21
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java
  8. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java
  9. 43
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerOrgParameterDao.java
  10. 16
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java
  11. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerDepartmentEntity.java
  12. 66
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerOrgParameterEntity.java
  13. 104
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerOrgParameterService.java
  14. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  15. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  16. 116
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerOrgParameterServiceImpl.java
  17. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java
  18. 14
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerOrgParameterDao.xml

22
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java

@ -114,17 +114,17 @@ public class CustomerAgencyDTO implements Serializable {
private Integer totalUser;
/**
* 省份
* 区域编码字典中的省份名称
*/
private String province;
private String province;
/**
* 城市
* 区域编码字典中的城市名称
*/
private String city;
private String city;
/**
* 区县
* 域编码字典中的名称
*/
private String district;
@ -132,4 +132,14 @@ public class CustomerAgencyDTO implements Serializable {
* 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701
*/
private String parentAreaCode;
/**
* 区域编码字典中的街道名称0409
*/
private String street;
/**
* 区域编码字典中的社区名称0409
*/
private String community;
}

16
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerAgencyEntity.java

@ -80,17 +80,17 @@ public class CustomerAgencyEntity extends BaseEpmetEntity {
private Integer totalUser;
/**
* 省份
* 区域编码字典中的省份名称
*/
private String province;
/**
* 城市
* 区域编码字典中的城市名称
*/
private String city;
/**
* 区县
* 域编码字典中的名称
*/
private String district;
@ -98,4 +98,14 @@ public class CustomerAgencyEntity extends BaseEpmetEntity {
* 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701
*/
private String parentAreaCode;
/**
* 区域编码字典中的街道名称0409
*/
private String street;
/**
* 区域编码字典中的社区名称0409
*/
private String community;
}

4
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerDepartmentEntity.java

@ -60,4 +60,8 @@ public class CustomerDepartmentEntity extends BaseEpmetEntity {
*/
private Integer totalUser;
/**
* 部门所属的行政地区编码:实际就是所属组织的地区编码
*/
private String areaCode;
}

16
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerAgencyEntity.java

@ -80,17 +80,17 @@ public class CustomerAgencyEntity extends BaseEpmetEntity {
private Integer totalUser;
/**
* 省份
* 区域编码字典中的省份名称
*/
private String province;
/**
* 城市
* 区域编码字典中的城市名称
*/
private String city;
/**
* 区县
* 域编码字典中的名称
*/
private String district;
@ -98,4 +98,14 @@ public class CustomerAgencyEntity extends BaseEpmetEntity {
* 当前组织的上级行政地区编码add0204;举例平阴县370124对应的是济南市3701
*/
private String parentAreaCode;
/**
* 区域编码字典中的街道名称0409
*/
private String street;
/**
* 区域编码字典中的社区名称0409
*/
private String community;
}

22
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java

@ -114,17 +114,17 @@ public class CustomerAgencyDTO implements Serializable {
private Integer totalUser;
/**
* 省份
* 区域编码字典中的省份名称
*/
private String province;
private String province;
/**
* 城市
* 区域编码字典中的城市名称
*/
private String city;
private String city;
/**
* 区县
* 域编码字典中的名称
*/
private String district;
@ -132,4 +132,14 @@ public class CustomerAgencyDTO implements Serializable {
* 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701
*/
private String parentAreaCode;
/**
* 区域编码字典中的街道名称0409
*/
private String street;
/**
* 区域编码字典中的社区名称0409
*/
private String community;
}

96
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerOrgParameterDTO.java

@ -0,0 +1,96 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 客户组织相关参数表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-12
*/
@Data
public class CustomerOrgParameterDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 参数键 eg:area_code_switch
*/
private String parameterKey;
/**
* 参数名 eg:是否开启区域编码
*/
private String parameterName;
/**
* 参数值 eg:开启open关闭closed
*/
private String parameterValue;
/**
* 参数说明 eg:open:当前客户新增组织需要选择areaCodeclosed: 无需选择区域编码
*/
private String description;
/**
* 删除标志 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

21
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java

@ -58,17 +58,17 @@ public class AgencysResultDTO implements Serializable {
private String areaCode = "";
/**
* 省份
* 区域编码字典中的省份名称
*/
private String province = "";
/**
* 城市
* 区域编码字典中的城市名称
*/
private String city = "";
/**
* 区县
* 域编码字典中的名称
*/
private String district = "";
@ -76,4 +76,19 @@ public class AgencysResultDTO implements Serializable {
* 本机关的所有上级机关
*/
private List<ParentListResultDTO> parentList;
/**
* 区域编码字典中的街道名称0409
*/
private String street;
/**
* 区域编码字典中的社区名称0409
*/
private String community;
/**
* open: 选择地区编码必填closed: 无需选择地区编码;;0409新增返参
*/
private String areaCodeSwitch;
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java

@ -71,4 +71,13 @@ public interface CustomerAgencyConstant {
* 获取工作人员组织信息失败
*/
String SELECT_STAFF_AGENCY_EXCEPTION = "获取工作人员组织信息失败";
/**
* 参数(area_code_switch)值open: 选择地区编码必填closed:
*/
String AREA_CODE_SWITCH="area_code_switch";
String AREA_CODE_SWITCH_CLOSED="closed";
String AREA_CODE_SWITCH_OPEN="open";
}

43
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerOrgParameterDao.java

@ -0,0 +1,43 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.CustomerOrgParameterEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 客户组织相关参数表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-12
*/
@Mapper
public interface CustomerOrgParameterDao extends BaseDao<CustomerOrgParameterEntity> {
/**
* @return com.epmet.entity.CustomerOrgParameterEntity
* @param customerId
* @param parameterKey
* @author yinzuomei
* @description 根据customerId查询参数(area_code_switch)
* @Date 2021/4/12 14:26
**/
CustomerOrgParameterEntity selectByCustomerId(@Param("customerId") String customerId, @Param("parameterKey") String parameterKey);
}

16
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java

@ -80,17 +80,17 @@ public class CustomerAgencyEntity extends BaseEpmetEntity {
private Integer totalUser;
/**
* 省份
* 区域编码字典中的省份名称
*/
private String province;
/**
* 城市
* 区域编码字典中的城市名称
*/
private String city;
/**
* 区县
* 域编码字典中的名称
*/
private String district;
@ -98,4 +98,14 @@ public class CustomerAgencyEntity extends BaseEpmetEntity {
* 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701
*/
private String parentAreaCode;
/**
* 区域编码字典中的街道名称0409
*/
private String street;
/**
* 区域编码字典中的社区名称0409
*/
private String community;
}

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerDepartmentEntity.java

@ -60,4 +60,8 @@ public class CustomerDepartmentEntity extends BaseEpmetEntity {
*/
private Integer totalUser;
/**
* 部门所属的行政地区编码:实际就是所属组织的地区编码
*/
private String areaCode;
}

66
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerOrgParameterEntity.java

@ -0,0 +1,66 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 客户组织相关参数表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-12
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("customer_org_parameter")
public class CustomerOrgParameterEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 参数键 eg:area_code_switch
*/
private String parameterKey;
/**
* 参数名 eg:是否开启区域编码
*/
private String parameterName;
/**
* 参数值 eg:开启open关闭closed
*/
private String parameterValue;
/**
* 参数说明 eg:open:当前客户新增组织需要选择areaCodeclosed: 无需选择区域编码
*/
private String description;
}

104
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerOrgParameterService.java

@ -0,0 +1,104 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.CustomerOrgParameterDTO;
import com.epmet.entity.CustomerOrgParameterEntity;
import java.util.List;
import java.util.Map;
/**
* 客户组织相关参数表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-12
*/
public interface CustomerOrgParameterService extends BaseService<CustomerOrgParameterEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<CustomerOrgParameterDTO>
* @author generator
* @date 2021-04-12
*/
PageData<CustomerOrgParameterDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<CustomerOrgParameterDTO>
* @author generator
* @date 2021-04-12
*/
List<CustomerOrgParameterDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return CustomerOrgParameterDTO
* @author generator
* @date 2021-04-12
*/
CustomerOrgParameterDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-04-12
*/
void save(CustomerOrgParameterDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-04-12
*/
void update(CustomerOrgParameterDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-04-12
*/
void delete(String[] ids);
/**
* @return java.lang.String
* @param customerId
* @author yinzuomei
* @description 根据customerId查询参数(area_code_switch)值open: 选择地区编码必填closed: 无需选择地区编码;;0409新增返参;没配置,返回closed
* @Date 2021/4/12 14:23
**/
String getAreaCodeSwitch(String customerId);
}

10
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java

@ -37,6 +37,7 @@ import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.redis.CustomerAgencyRedis;
import com.epmet.service.AgencyService;
import com.epmet.service.CustomerAgencyService;
import com.epmet.service.CustomerOrgParameterService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -45,7 +46,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* 机关单位信息
@ -70,6 +74,9 @@ public class AgencyServiceImpl implements AgencyService {
private CustomerGridDao customerGridDao;
@Autowired
private LoginUserUtil loginUserUtil;
@Autowired
private CustomerOrgParameterService customerOrgParameterService;
/**
* @param formDTO
* @return
@ -235,6 +242,7 @@ public class AgencyServiceImpl implements AgencyService {
List<String> listStr = Arrays.asList(entity.getPids().split(":"));
parentList = customerAgencyDao.selectPAgencyById(listStr);
agencysResultDTO.setParentList(parentList);
agencysResultDTO.setAreaCodeSwitch(customerOrgParameterService.getAreaCodeSwitch(entity.getCustomerId()));
return new Result<AgencysResultDTO>().ok(agencysResultDTO);
}

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
@ -244,6 +245,10 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
customerGridEntity.setAreaCode(customerAgencyDTO.getAreaCode());
customerGridEntity.setCustomerId(customerAgencyDTO.getCustomerId());
customerGridEntity.setPid(addGridFormDTO.getAgencyId());
//新增area_code,部门的area_code=所属组织的area_code
customerGridEntity.setAreaCode(null != customerAgencyDTO && StringUtils.isNotBlank(customerAgencyDTO.getAreaCode()) ? customerAgencyDTO.getAreaCode() : StrConstant.EPMETY_STR);
//所有上级机构id,必须包括当前机构id (放在所有上级机构id后)
if(StringUtils.isBlank(customerAgencyDTO.getPids())){
customerGridEntity.setPids(addGridFormDTO.getAgencyId());

116
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerOrgParameterServiceImpl.java

@ -0,0 +1,116 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.CustomerAgencyConstant;
import com.epmet.dao.CustomerOrgParameterDao;
import com.epmet.dto.CustomerOrgParameterDTO;
import com.epmet.entity.CustomerOrgParameterEntity;
import com.epmet.service.CustomerOrgParameterService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 客户组织相关参数表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-04-12
*/
@Service
public class CustomerOrgParameterServiceImpl extends BaseServiceImpl<CustomerOrgParameterDao, CustomerOrgParameterEntity> implements CustomerOrgParameterService {
@Override
public PageData<CustomerOrgParameterDTO> page(Map<String, Object> params) {
IPage<CustomerOrgParameterEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, CustomerOrgParameterDTO.class);
}
@Override
public List<CustomerOrgParameterDTO> list(Map<String, Object> params) {
List<CustomerOrgParameterEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, CustomerOrgParameterDTO.class);
}
private QueryWrapper<CustomerOrgParameterEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<CustomerOrgParameterEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public CustomerOrgParameterDTO get(String id) {
CustomerOrgParameterEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, CustomerOrgParameterDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(CustomerOrgParameterDTO dto) {
CustomerOrgParameterEntity entity = ConvertUtils.sourceToTarget(dto, CustomerOrgParameterEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(CustomerOrgParameterDTO dto) {
CustomerOrgParameterEntity entity = ConvertUtils.sourceToTarget(dto, CustomerOrgParameterEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @param customerId
* @return java.lang.String
* @author yinzuomei
* @description 根据customerId查询参数(area_code_switch)值open: 选择地区编码必填closed: 无需选择地区编码;;0409新增返参;没配置,返回closed
* @Date 2021/4/12 14:23
**/
@Override
public String getAreaCodeSwitch(String customerId) {
CustomerOrgParameterEntity entity = baseDao.selectByCustomerId(customerId, CustomerAgencyConstant.AREA_CODE_SWITCH);
if (null == entity || StringUtils.isBlank(entity.getParameterValue())) {
return CustomerAgencyConstant.AREA_CODE_SWITCH_CLOSED;
}
return entity.getParameterValue();
}
}

3
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java

@ -18,6 +18,7 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
@ -90,6 +91,8 @@ public class DepartmentServiceImpl implements DepartmentService {
//1:查询当前组织机构信息,获取客户Id
CustomerAgencyEntity parentEntity = customerAgencyDao.selectById(formDTO.getAgencyId());
entity.setCustomerId(parentEntity.getCustomerId());
//新增area_code,部门的area_code=所属组织的area_code
entity.setAreaCode(null!=parentEntity&&StringUtils.isNotBlank(parentEntity.getAreaCode())?parentEntity.getAreaCode(): StrConstant.EPMETY_STR);
//2:保存部门信息
if (customerDepartmentDao.insert(entity) < NumConstant.ONE) {
log.error(CustomerDepartmentConstant.SAVE_EXCEPTION);

14
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerOrgParameterDao.xml

@ -0,0 +1,14 @@
<?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="com.epmet.dao.CustomerOrgParameterDao">
<select id="selectByCustomerId" parameterType="map" resultType="com.epmet.entity.CustomerOrgParameterEntity">
select *
from customer_org_parameter p
where p.DEL_FLAG='0'
and p.CUSTOMER_ID=#{customerId}
and p.PARAMETER_KEY=#{parameterKey}
</select>
</mapper>
Loading…
Cancel
Save