Browse Source

完成外部应用-内部客户管理

dev_shibei_match
wxz 5 years ago
parent
commit
bc73413f51
  1. 6
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/enu/CustomerTypeEnum.java
  2. 13
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java
  3. 1
      epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.4__add_extcustomer_source.sql
  4. 1
      epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.4__add_extcustomer_type.sql
  5. 1
      epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml

6
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/enu/CustomerTypeEnum.java

@ -7,9 +7,9 @@ import org.apache.commons.lang3.StringUtils;
*/
public enum CustomerTypeEnum {
INTERNAL("internal", "内部应用"),
EXTERNAL("external", "外部应用"),
UN_KNOW("unknow", "未知应用");
INTERNAL("internal", "内部客户"),
EXTERNAL("external", "外部客户"),
UN_KNOW("unknow", "未知类型");
private String type;
private String name;

13
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java

@ -74,11 +74,22 @@ public class ExternalAppServiceImpl implements ExternalAppService {
EpmetErrorCode.OPER_EXTERNAL_APP_EXISTS.getMsg());
}
if (externalCustomerDao.selectById(customerId) == null) {
if (CustomerTypeEnum.EXTERNAL.getType().equals(customerType) && externalCustomerDao.selectById(customerId) == null) {
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_CUSTOMER_NOT_EXISTS.getCode(),
EpmetErrorCode.OPER_EXTERNAL_CUSTOMER_NOT_EXISTS.getMsg());
}
if (CustomerTypeEnum.INTERNAL.getType().equals(customerType)) {
CustomerDTO form = new CustomerDTO();
form.setId(customerId);
Result<CustomerDTO> customerInfoRst = operCrmOpenFeignClient.getCustomerInfo(form);
if (customerInfoRst.success() && customerInfoRst.getData() == null) {
throw new RenException(EpmetErrorCode.OPER_EXTERNAL_CUSTOMER_NOT_EXISTS.getCode(),
EpmetErrorCode.OPER_EXTERNAL_CUSTOMER_NOT_EXISTS.getMsg());
}
}
// 应用表插入
ExternalAppEntity appEntity = new ExternalAppEntity();
appEntity.setAppName(appName);

1
epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.4__add_extcustomer_source.sql

@ -1 +0,0 @@
alter table external_app add column CUSTOMER_SOURCE varchar(20) not null after CUSTOMER_ID;

1
epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.4__add_extcustomer_type.sql

@ -0,0 +1 @@
alter table external_app add column CUSTOMER_TYPE varchar(20) not null after CUSTOMER_ID;

1
epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml

@ -7,6 +7,7 @@
<result property="id" column="ID"/>
<result property="appName" column="APP_NAME"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="customerType" column="CUSTOMER_TYPE"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>

Loading…
Cancel
Save