Browse Source

Merge branch 'dev_isDomainName' into dev_temp

dev_shibei_match
zhangyongzhangyong 4 years ago
parent
commit
3c9650f61b
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java
  2. 57
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/ThirdPlatformDTO.java
  3. 18
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CustomerFormDTO.java
  4. 15
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/PlatformNameFormDTO.java
  5. 29
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/PlatformRegisterFormDTO.java
  6. 27
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/PlatformUnregisterFormDTO.java
  7. 118
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/ThirdPlatformController.java
  8. 26
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ThirdplatformCustomerRegisterDao.java
  9. 47
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ThirdplatformDao.java
  10. 80
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/ThirdPlatformService.java
  11. 65
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ThirdPlatformServiceImpl.java
  12. 42
      epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ThirdplatformCustomerRegisterDao.xml
  13. 67
      epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ThirdplatformDao.xml
  14. 5
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomizedDTO.java
  15. 7
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveFunctionCustomizedFormDTO.java
  16. 7
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomizedFormDTO.java
  17. 4
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerResultDTO.java
  18. 5
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedDetailResultDTO.java
  19. 11
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java
  20. 5
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedEntity.java
  21. 17
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java
  22. 3
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml
  23. 9
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java

@ -84,7 +84,7 @@ public abstract class BaseRequestLogAspect {
return result;
} catch (ValidateException e) {
result = handleValidateException(e);
resultErrorLog(transactionSerial, getExecPeriod(startTime), result, e.getMsg(), ExceptionUtils.getErrorStackTrace(e));
resultWarnLog(transactionSerial, getExecPeriod(startTime), result, e.getMsg(), ExceptionUtils.getErrorStackTrace(e));
} catch (DuplicateKeyException e) {
result = handlerDuplicateKeyException(e);
resultErrorLog(transactionSerial, getExecPeriod(startTime), result, e.getMessage(), ExceptionUtils.getErrorStackTrace(e));

57
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/ThirdPlatformDTO.java

@ -0,0 +1,57 @@
package com.epmet.dto;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @auther: zhangyong
* @date: 2021-04-08 17:27
*/
@Data
public class ThirdPlatformDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 平台名称
*/
@NotBlank(message = "平台名称 不能为空")
private String platformName;
/**
* 平台唯一KEY
*/
@NotBlank(message = "平台唯一KEY 不能为空")
private String platformKey;
/**
* 平台秘钥
*/
@NotBlank(message = "平台秘钥 不能为空")
private String platformSecret;
/**
* apiservice
*/
@NotBlank(message = "apiservice 不能为空")
private String apiService;
/**
* 基础url
*/
@NotBlank(message = "基础url 不能为空")
private String baseUrl;
/**
* icon
*/
@NotBlank(message = "icon 不能为空")
private String icon;
}

18
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CustomerFormDTO.java

@ -0,0 +1,18 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* 客户 共用入参
**/
@Data
public class CustomerFormDTO {
/**
* 客户id
**/
@NotBlank(message = "客户id 不能为空")
private String customerId;
}

15
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/PlatformNameFormDTO.java

@ -0,0 +1,15 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data
public class PlatformNameFormDTO {
/**
* 平台名称用于模糊搜索
**/
@NotBlank(message = "平台名称 不能为空")
private String platformName;
}

29
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/PlatformRegisterFormDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* 第三方平台-新增客户接入的第三方平台
*
* @auther: zhangyong
* @date: 2021-04-08 17:27
*/
@Data
public class PlatformRegisterFormDTO {
/**
* 客户id
*/
@NotBlank(message = "客户id 不能为空")
private String customerId;
/**
* 平台id列表
*/
@NotNull(message = "平台id列表 不能为空")
private List<String> platformIdList;
}

27
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/PlatformUnregisterFormDTO.java

@ -0,0 +1,27 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* 解除客户接入的平台
*
* @auther: zhangyong
* @date: 2021-04-08 17:27
*/
@Data
public class PlatformUnregisterFormDTO {
/**
* 客户id
*/
@NotBlank(message = "客户id 不能为空")
private String customerId;
/**
* 平台ID
*/
@NotBlank(message = "平台ID 不能为空")
private String platformId;
}

118
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/ThirdPlatformController.java

@ -1,11 +1,14 @@
package com.epmet.controller;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.SaveOrUpdateCustSelPlatformFormDTO;
import com.epmet.dto.form.ThirdPlatformFormDTO;
import com.epmet.dto.ThirdPlatformDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.ThirdplatformResultDTO;
import com.epmet.service.ThirdPlatformService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -89,4 +92,115 @@ public class ThirdPlatformController {
thirdPlatformService.saveOrUpdateSelectedPlatformInfo(input.getCustomerId(), input.getActionKey(), input.getPlatforms());
return new Result();
}
/**
* 第三方平台-平台列表模糊查询
*
* @param formsDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.ThirdPlatformDTO>>
* @Author zhangyong
* @Date 17:13 2021-04-08
**/
@PostMapping("list-platforms")
public Result<List<ThirdPlatformDTO>> listPlatforms(@RequestBody PlatformNameFormDTO formsDTO) {
ValidatorUtils.validateEntity(formsDTO);
return new Result<List<ThirdPlatformDTO>>().ok(thirdPlatformService.listPlatforms(formsDTO.getPlatformName()));
}
/**
* 第三方平台-修改平台
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 17:31 2021-04-08
**/
@PostMapping("update-platform")
public Result updatePlatform(@RequestBody ThirdPlatformDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
if (StringUtils.isBlank(formDTO.getId())) {
throw new RenException("主键不能为空");
}
thirdPlatformService.updatePlatform(formDTO);
return new Result();
}
/**
* 第三方平台-新增平台
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.ThirdPlatformDTO>
* @Author zhangyong
* @Date 17:31 2021-04-08
**/
@PostMapping("add-platform")
public Result<ThirdPlatformDTO> addPlatform(@RequestBody ThirdPlatformDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return new Result<ThirdPlatformDTO>().ok(thirdPlatformService.addPlatform(formDTO));
}
/**
* 第三方平台-客户可接入的平台列表
* 该客户还没有注册的平台列表从thirdplatform表中找该客户没注册的不在thirdplatform_customer_register中或者在其中但是del_flag为1的返回
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.ThirdPlatformDTO>>
* @Author zhangyong
* @Date 09:46 2021-04-09
**/
@PostMapping("customer/registrable-platform-list")
public Result<List<ThirdPlatformDTO>> registrablePlatformList(@RequestBody CustomerFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return new Result<List<ThirdPlatformDTO>>().ok(thirdPlatformService.listRegistrablePlatform(formDTO));
}
/**
* 第三方平台-客户已经接入的平台列表
* 在thirdplatform_customer_register中的记录
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.ThirdPlatformDTO>>
* @Author zhangyong
* @Date 09:46 2021-04-09
**/
@PostMapping("customer/registered-platform-list")
public Result<List<ThirdPlatformDTO>> registeredPlatformList(@RequestBody CustomerFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return new Result<List<ThirdPlatformDTO>>().ok(thirdPlatformService.listRegisteredPlatform(formDTO));
}
/**
* 第三方平台-解除客户接入的平台
* 单个解除thirdplatform_customer_register表del_flag状态置为1
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 09:46 2021-04-09
**/
@PostMapping("customer/unregister-platform")
public Result unregisterPlatform(@RequestBody PlatformUnregisterFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
thirdPlatformService.unregisterPlatformCustomer(formDTO);
return new Result();
}
/**
* 第三方平台-新增客户接入的第三方平台
* 新增该客户要接入的第三方平台thirdplatform_customer_register表新增数据customized_xxx默认从thirdplatform表取过来
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:34 2021-04-09
**/
@PostMapping("customer/register-platform")
public Result registerPlatform(@RequestBody PlatformRegisterFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
if (formDTO.getPlatformIdList().size() == NumConstant.ZERO) {
throw new RenException("formDTO.getPlatformIdList().size() == 0;平台id列表不能为空");
}
thirdPlatformService.registerThirdPlatformCustomer(formDTO);
return new Result();
}
}

26
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ThirdplatformCustomerRegisterDao.java

@ -18,7 +18,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.ThirdplatformResultDTO;
import com.epmet.dto.form.PlatformUnregisterFormDTO;
import com.epmet.entity.ThirdplatformCustomerRegisterEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -26,7 +26,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
*
*
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-03-15
@ -35,4 +35,24 @@ import java.util.List;
public interface ThirdplatformCustomerRegisterDao extends BaseDao<ThirdplatformCustomerRegisterEntity> {
ThirdplatformCustomerRegisterEntity getByCustomerIdAndPlatformId(@Param("customerId") String customerId, @Param("platformId") String platformId);
}
/**
* 批量新增
* @param list
* @return int
* @Author zhangyong
* @Date 11:05 2021-04-09
**/
int batchInsertThirdplatformCustomerRegister(@Param("list") List<ThirdplatformCustomerRegisterEntity> list);
/**
* 第三方平台-解除客户接入的平台
* 单个解除.thirdplatform_customer_register表del_flag状态置为1
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 10:15 2021-04-09
**/
void unregisterPlatformCustomer(PlatformUnregisterFormDTO formDTO);
}

47
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ThirdplatformDao.java

@ -18,6 +18,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ThirdPlatformDTO;
import com.epmet.dto.result.ThirdplatformResultDTO;
import com.epmet.entity.ThirdplatformEntity;
import org.apache.ibatis.annotations.Mapper;
@ -26,7 +27,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
*
*
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-03-15
@ -43,4 +44,46 @@ public interface ThirdplatformDao extends BaseDao<ThirdplatformEntity> {
List<ThirdplatformResultDTO> listAvailablePlatformsByCustomerAndAction(@Param("customerId") String customerId, @Param("actionKey") String actionKey);
List<ThirdplatformResultDTO> listSelectableByCustomerAndActionGroup(@Param("customerId") String customerId, @Param("actionKey") String actionKey);
}
/**
* 第三方平台-平台列表模糊查询
*
* @param platformName 平台名称用于模糊搜索
* @return java.util.List<com.epmet.dto.ThirdPlatformDTO>
* @Author zhangyong
* @Date 17:14 2021-04-08
**/
List<ThirdPlatformDTO> selectListPlatforms(@Param("platformName") String platformName);
/**
* 第三方平台-客户可接入的平台列表
* 该客户还没有注册的平台列表从thirdplatform表中找该客户没注册的不在thirdplatform_customer_register中或者在其中但是del_flag为1的返回
*
* @param customerId
* @return java.util.List<com.epmet.dto.ThirdPlatformDTO>
* @Author zhangyong
* @Date 09:47 2021-04-09
**/
List<ThirdPlatformDTO> selectListRegistrablePlatform(@Param("customerId") String customerId);
/**
* 第三方平台-客户已经接入的平台列表
* 在thirdplatform_customer_register中的记录
*
* @param customerId
* @return java.util.List<com.epmet.dto.ThirdPlatformDTO>
* @Author zhangyong
* @Date 09:47 2021-04-09
**/
List<ThirdPlatformDTO> selectListRegisteredPlatform(@Param("customerId") String customerId);
/**
* 查询第三方平台
*
* @param platformIds
* @return java.util.List<com.epmet.dto.ThirdPlatformDTO>
* @Author zhangyong
* @Date 10:51 2021-04-09
**/
List<ThirdPlatformDTO> selectListThirdPlatform(@Param("platformIds") List<String> platformIds);
}

80
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/ThirdPlatformService.java

@ -1,6 +1,10 @@
package com.epmet.service;
import com.epmet.dto.ThirdPlatformDTO;
import com.epmet.dto.form.CustomerFormDTO;
import com.epmet.dto.form.ThirdPlatformFormDTO;
import com.epmet.dto.form.PlatformRegisterFormDTO;
import com.epmet.dto.form.PlatformUnregisterFormDTO;
import com.epmet.dto.result.ThirdplatformResultDTO;
import java.util.List;
@ -22,4 +26,78 @@ public interface ThirdPlatformService {
void updateCustomizePlatformInfo(ThirdPlatformFormDTO input);
void saveOrUpdateSelectedPlatformInfo(String customerId, String actionKey, List<ThirdPlatformFormDTO> platforms);
}
/**
* 第三方平台-平台列表模糊查询
*
* @param platformName 平台名称用于模糊搜索
* @return java.util.List<com.epmet.dto.ThirdPlatformDTO>
* @Author zhangyong
* @Date 17:14 2021-04-08
**/
List<ThirdPlatformDTO> listPlatforms(String platformName);
/**
* 第三方平台-修改平台
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 17:43 2021-04-08
**/
void updatePlatform(ThirdPlatformDTO formDTO);
/**
* 第三方平台-新增平台
*
* @param formDTO
* @return com.epmet.dto.ThirdPlatformDTO
* @Author zhangyong
* @Date 17:43 2021-04-08
**/
ThirdPlatformDTO addPlatform(ThirdPlatformDTO formDTO);
/**
* 第三方平台-客户可接入的平台列表
* 该客户还没有注册的平台列表从thirdplatform表中找该客户没注册的不在thirdplatform_customer_register中或者在其中但是del_flag为1的返回
*
* @param formDTO
* @return java.util.List<com.epmet.dto.ThirdPlatformDTO>
* @Author zhangyong
* @Date 09:47 2021-04-09
**/
List<ThirdPlatformDTO> listRegistrablePlatform(CustomerFormDTO formDTO);
/**
* 第三方平台-客户已经接入的平台列表
* 在thirdplatform_customer_register中的记录
*
* @param formDTO
* @return java.util.List<com.epmet.dto.ThirdPlatformDTO>
* @Author zhangyong
* @Date 09:47 2021-04-09
**/
List<ThirdPlatformDTO> listRegisteredPlatform(CustomerFormDTO formDTO);
/**
* 第三方平台-解除客户接入的平台
* 单个解除.thirdplatform_customer_register表del_flag状态置为1
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 10:15 2021-04-09
**/
void unregisterPlatformCustomer(PlatformUnregisterFormDTO formDTO);
/**
* 第三方平台-新增客户接入的第三方平台
* 新增该客户要接入的第三方平台thirdplatform_customer_register表新增数据customized_xxx默认从thirdplatform表取过来
*
* @param formDTO
* @return void
* @Author zhangyong
* @Date 10:15 2021-04-09
**/
void registerThirdPlatformCustomer(PlatformRegisterFormDTO formDTO);
}

65
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ThirdPlatformServiceImpl.java

@ -2,24 +2,27 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.ThirdplatformCustomerActionDao;
import com.epmet.dao.ThirdplatformCustomerRegisterDao;
import com.epmet.dao.ThirdplatformDao;
import com.epmet.dto.ThirdPlatformDTO;
import com.epmet.dto.form.CustomerFormDTO;
import com.epmet.dto.form.ThirdPlatformFormDTO;
import com.epmet.dto.form.PlatformRegisterFormDTO;
import com.epmet.dto.form.PlatformUnregisterFormDTO;
import com.epmet.dto.result.ThirdplatformResultDTO;
import com.epmet.entity.ThirdplatformActionEntity;
import com.epmet.entity.ThirdplatformCustomerActionEntity;
import com.epmet.entity.ThirdplatformCustomerRegisterEntity;
import com.epmet.entity.ThirdplatformEntity;
import com.epmet.service.ThirdPlatformService;
import jodd.util.CollectionUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.validation.constraints.NotBlank;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class ThirdPlatformServiceImpl implements ThirdPlatformService {
@ -105,4 +108,56 @@ public class ThirdPlatformServiceImpl implements ThirdPlatformService {
entity.setCustomizedPlatformIcon(platformFormDTO.getIcon());
thirdplatformCustomerRegisterDao.update(entity, conditions);
}
@Override
public List<ThirdPlatformDTO> listPlatforms(String platformName) {
return thirdplatformDao.selectListPlatforms(platformName);
}
@Override
public void updatePlatform(ThirdPlatformDTO formDTO) {
ThirdplatformEntity entity = ConvertUtils.sourceToTarget(formDTO, ThirdplatformEntity.class);
thirdplatformDao.updateById(entity);
}
@Override
public ThirdPlatformDTO addPlatform(ThirdPlatformDTO formDTO) {
ThirdplatformEntity entity = ConvertUtils.sourceToTarget(formDTO, ThirdplatformEntity.class);
thirdplatformDao.insert(entity);
formDTO.setId(entity.getId());
return formDTO;
}
@Override
public List<ThirdPlatformDTO> listRegistrablePlatform(CustomerFormDTO formDTO) {
return thirdplatformDao.selectListRegistrablePlatform(formDTO.getCustomerId());
}
@Override
public List<ThirdPlatformDTO> listRegisteredPlatform(CustomerFormDTO formDTO) {
return thirdplatformDao.selectListRegisteredPlatform(formDTO.getCustomerId());
}
@Override
public void unregisterPlatformCustomer(PlatformUnregisterFormDTO formDTO) {
thirdplatformCustomerRegisterDao.unregisterPlatformCustomer(formDTO);
}
@Override
public void registerThirdPlatformCustomer(PlatformRegisterFormDTO formDTO) {
List<ThirdplatformCustomerRegisterEntity> entityList = new ArrayList<>();
List<ThirdPlatformDTO> thirdPlatforms = thirdplatformDao.selectListThirdPlatform(formDTO.getPlatformIdList());
for (ThirdPlatformDTO dto : thirdPlatforms) {
ThirdplatformCustomerRegisterEntity entity = new ThirdplatformCustomerRegisterEntity();
entity.setCustomerId(formDTO.getCustomerId());
entity.setPlatformId(dto.getId());
entity.setCustomizedPlatformName(dto.getPlatformName());
entity.setCustomizedPlatformIcon(dto.getIcon());
entityList.add(entity);
}
if (entityList.size() > NumConstant.ZERO) {
thirdplatformCustomerRegisterDao.batchInsertThirdplatformCustomerRegister(entityList);
}
}
}

42
epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ThirdplatformCustomerRegisterDao.xml

@ -35,4 +35,44 @@
and PLATFORM_ID = #{platformId}
and DEL_FLAG = 0
</select>
</mapper>
<insert id="batchInsertThirdplatformCustomerRegister" parameterType="map">
insert into thirdplatform_customer_register
(
ID,
CUSTOMER_ID,
PLATFORM_ID,
CUSTOMIZED_PLATFORM_NAME,
CUSTOMIZED_PLATFORM_ICON,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
) values
<foreach collection="list" item="item" index="index" separator=",">
(
(SELECT REPLACE(UUID(), '-', '') AS id),
#{item.customerId},
#{item.platformId},
#{item.customizedPlatformName},
#{item.customizedPlatformIcon},
'0',
0,
'APP_USER',
now(),
'APP_USER',
now()
)
</foreach>
</insert>
<update id="unregisterPlatformCustomer">
UPDATE thirdplatform_customer_register
SET DEL_FLAG = '1'
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId} AND PLATFORM_ID = #{platformId}
</update>
</mapper>

67
epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ThirdplatformDao.xml

@ -87,4 +87,69 @@
and ta.ACTION_KEY = #{actionKey}
and tcr.DEL_FLAG = 0
</select>
</mapper>
<select id="selectListPlatforms" resultType="com.epmet.dto.ThirdPlatformDTO">
SELECT
ID,
PLATFORM_NAME,
PLATFORM_KEY,
PLATFORM_SECRET,
ICON,
API_SERVICE,
BASE_URL
FROM `thirdplatform`
WHERE DEL_FLAG = '0'
AND PLATFORM_NAME LIKE concat('%', #{platformName}, '%')
</select>
<select id="selectListRegistrablePlatform" resultType="com.epmet.dto.ThirdPlatformDTO">
SELECT
ID,
PLATFORM_NAME,
PLATFORM_KEY,
PLATFORM_SECRET,
ICON,
API_SERVICE,
BASE_URL
FROM thirdplatform
WHERE DEL_FLAG = '0'
AND ID NOT IN (
SELECT PLATFORM_ID FROM thirdplatform_customer_register WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId}
)
</select>
<select id="selectListRegisteredPlatform" resultType="com.epmet.dto.ThirdPlatformDTO">
SELECT
ID,
PLATFORM_NAME,
PLATFORM_KEY,
PLATFORM_SECRET,
ICON,
API_SERVICE,
BASE_URL
FROM thirdplatform
WHERE DEL_FLAG = '0'
AND ID IN (
SELECT PLATFORM_ID FROM thirdplatform_customer_register WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId}
)
</select>
<select id="selectListThirdPlatform" resultType="com.epmet.dto.ThirdPlatformDTO">
SELECT
ID,
PLATFORM_NAME,
PLATFORM_KEY,
PLATFORM_SECRET,
ICON,
API_SERVICE,
BASE_URL
FROM thirdplatform
WHERE DEL_FLAG = '0'
<if test="platformIds != null and platformIds.size() != 0">
AND ID IN
<foreach collection="platformIds" item="platformId" open="(" close=")" separator=",">
#{platformId}
</foreach>
</if>
</select>
</mapper>

5
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomizedDTO.java

@ -64,4 +64,9 @@ public class CustomizedDTO implements Serializable {
* 来源app(政府端:gov居民端:resi)
*/
private String fromApp;
/**
* 业务域名是否必填标识0 [业务域名]字段 非必填; 1 [业务域名]字段 必填.
*/
private String isDomainName;
}

7
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveFunctionCustomizedFormDTO.java

@ -61,7 +61,6 @@ public class SaveFunctionCustomizedFormDTO implements Serializable {
/**
* 业务域名(https;//... 无端口号)
*/
@NotBlank(message = "业务域名(https;//... 无端口号)不能为空")
private String domainName;
/**
@ -69,4 +68,10 @@ public class SaveFunctionCustomizedFormDTO implements Serializable {
*/
@NotBlank(message = "来源app(工作端:gov、居民端:resi)不能为空")
private String fromApp;
/**
* 业务域名是否必填标识0 [业务域名]字段 非必填; 1 [业务域名]字段 必填.
*/
@NotBlank(message = "业务域名是否必填标识不能为空")
private String isDomainName;
}

7
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomizedFormDTO.java

@ -61,7 +61,6 @@ public class UpdateCustomizedFormDTO implements Serializable {
/**
* 业务域名
*/
@NotBlank(message = "业务域名不能为空")
private String domainName;
/**
@ -69,4 +68,10 @@ public class UpdateCustomizedFormDTO implements Serializable {
*/
@NotBlank(message = "来源app(工作端:gov、居民端:resi)不能为空")
private String fromApp;
/**
* 业务域名是否必填标识0 [业务域名]字段 非必填; 1 [业务域名]字段 必填.
*/
@NotBlank(message = "业务域名是否必填标识不能为空")
private String isDomainName;
}

4
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerResultDTO.java

@ -71,4 +71,8 @@ public class CustomerResultDTO implements Serializable {
*/
private String functionExplain;
/**
* 业务域名是否必填标识0 [业务域名]字段 非必填; 1 [业务域名]字段 必填.
*/
private String isDomainName;
}

5
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedDetailResultDTO.java

@ -63,4 +63,9 @@ public class FunctionCustomizedDetailResultDTO implements Serializable {
* 是否有客户在使用(0: 1:)
*/
private Integer isApply;
/**
* 业务域名是否必填标识0 [业务域名]字段 非必填; 1 [业务域名]字段 必填.
*/
private String isDomainName;
}

11
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java

@ -17,6 +17,8 @@
package com.epmet.controller;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
@ -31,6 +33,7 @@ import com.epmet.dto.result.FunctionCustomizedDetailResultDTO;
import com.epmet.dto.result.FunctionCustomizedListResultDTO;
import com.epmet.excel.FunctionCustomizedExcel;
import com.epmet.service.FunctionCustomizedService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -105,6 +108,9 @@ public class FunctionCustomizedController {
@PostMapping("savefunctioncustomized")
public Result saveFunctionCustomized(@RequestBody SaveFunctionCustomizedFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO);
if (NumConstant.ONE_STR.equals(formDTO.getIsDomainName()) && StringUtils.isBlank(formDTO.getDomainName())) {
throw new RenException("业务域名为空!");
}
functionCustomizedService.saveFunctionCustomized(formDTO);
return new Result();
}
@ -142,7 +148,7 @@ public class FunctionCustomizedController {
/**
* 定制功能修改
* 有客户在使用该功能时则不允许修改上下架状态业务域名和外链地址所属端app,
* 有客户在使用该功能时则不允许修改上下架状态业务域名业务域名是否必填标识(2021-04-12日追加)和外链地址所属端app,
* 只能修改功能名称和大小图标功能说明
* 修改的要判断是否有客户在使用有用的要批量更新已使用客户数据
*
@ -154,6 +160,9 @@ public class FunctionCustomizedController {
@PostMapping("updatecustomized")
public Result updateCustomized(@RequestBody UpdateCustomizedFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO);
if (NumConstant.ONE_STR.equals(formDTO.getIsDomainName()) && StringUtils.isBlank(formDTO.getDomainName())) {
throw new RenException("业务域名为空!");
}
return functionCustomizedService.updateCustomized(formDTO);
}

5
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedEntity.java

@ -73,4 +73,9 @@ public class FunctionCustomizedEntity extends BaseEpmetEntity {
*/
private String fromApp;
/**
* 业务域名是否必填标识0 [业务域名]字段 非必填; 1 [业务域名]字段 必填.
*/
private String isDomainName;
}

17
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java

@ -139,6 +139,7 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl<FunctionCusto
entity.setTargetLink(formDTO.getTargetLink());
entity.setDomainName(formDTO.getDomainName());
entity.setFromApp(formDTO.getFromApp());
entity.setIsDomainName(formDTO.getIsDomainName());
insert(entity);
}
@ -195,29 +196,27 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl<FunctionCusto
for (int i = 0; i < customizedId.size(); i++){
if (null != customizedDTO){
// 3.1 功能信息和客户信息:判断这个功能,用户使用的是默认的,还是自定义的
// StringUtils.isBlank(customizedDTO.getDomainName() 特殊处理,domainName为空的情况
if (customizedDTO.getCustomizedName().equals(customizedId.get(i).getFunctionName())
&& customizedDTO.getIconLargeImg().equals(customizedId.get(i).getIconLargeImg())
&& customizedDTO.getIconSmallImg().equals(customizedId.get(i).getIconSmallImg())
&& customizedDTO.getDomainName().equals(customizedId.get(i).getDomainName())
&& (StringUtils.isBlank(customizedDTO.getDomainName()) || customizedDTO.getDomainName().equals(customizedId.get(i).getDomainName()))
&& customizedDTO.getTargetLink().equals(customizedId.get(i).getTargetLink()) ){
// 这个功能,客户使用的是默认的,则判断本次修改的字段,如果是功能名称和大小图标、功能说明,则批量更新客户数据,负责提示 不能修改
if (!formDTO.getShoppingStatus().equals(customizedDTO.getShoppingStatus())
|| !formDTO.getTargetLink().equals(customizedDTO.getTargetLink())
|| !formDTO.getDomainName().equals(customizedDTO.getDomainName())
|| !formDTO.getFromApp().equals(customizedDTO.getFromApp()) ){
// 4.1 如果修改的内容是其他字段,则返回语句
tipCustomizedInfoUserId.append(customizedId.get(i).getId() + ",");
} else if (!formDTO.getFunctionName().equals(customizedDTO.getCustomizedName())
if (!formDTO.getFunctionName().equals(customizedDTO.getCustomizedName())
|| !formDTO.getFunctionExplain().equals(customizedDTO.getFunctionExplain())
|| !formDTO.getIconLargeImg().equals(customizedDTO.getIconLargeImg())
|| !formDTO.getIconSmallImg().equals(customizedDTO.getIconSmallImg())){
// 4.2 如果修改的内容只是:功能名称和大小图标、功能说明,, 需要批量更新客户数据
// 4.1 如果修改的内容只是:功能名称和大小图标、功能说明,, 需要批量更新客户数据
CustomerFunctionDetailEntity customer = new CustomerFunctionDetailEntity();
customer.setFunctionName(formDTO.getFunctionName());
customer.setIconLargeImg(formDTO.getIconLargeImg());
customer.setIconSmallImg(formDTO.getIconSmallImg());
customer.setId(customizedId.get(i).getId());
upCustomizedInfo.add(customer);
} else {
// 4.2 如果修改的内容是其他字段,则返回提示信息
tipCustomizedInfoUserId.append(customizedId.get(i).getId() + ",");
}
} else {
// 3.2 用户使用的是自定义的功能,则不予处理

3
epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml

@ -63,7 +63,8 @@
fc.from_app AS "fromApp",
fc.icon_large_img AS "defaultLargeImg",
fc.icon_small_img AS "defaultSmallImg",
f.function_explain AS "functionExplain"
f.function_explain AS "functionExplain",
fc.IS_DOMAIN_NAME AS "isDomainName"
FROM
customer_function_detail cfd
INNER JOIN function_customized fc ON cfd.function_id = fc.function_id

9
epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml

@ -14,7 +14,8 @@
cu.ICON_SMALL_IMG iconSmallImg,
cu.TARGET_LINK targetLink,
cu.DOMAIN_NAME domainName,
cu.FROM_APP fromApp
cu.FROM_APP fromApp,
cu.IS_DOMAIN_NAME isDomainName
FROM function_customized cu
LEFT JOIN `function` f ON cu.FUNCTION_ID = f.ID
WHERE cu.DEL_FLAG = '0'
@ -38,7 +39,8 @@
cu.ICON_SMALL_IMG iconSmallImg,
cu.TARGET_LINK targetLink,
cu.DOMAIN_NAME domainName,
cu.FROM_APP fromApp
cu.FROM_APP fromApp,
cu.IS_DOMAIN_NAME isDomainName
FROM `function` f
LEFT JOIN function_customized cu ON f.ID = cu.FUNCTION_ID
WHERE f.DEL_FLAG = '0'
@ -156,6 +158,9 @@
<if test="fromApp != null and fromApp.trim() != ''">
FROM_APP = #{fromApp},
</if>
<if test="isDomainName != null and isDomainName.trim() != ''">
IS_DOMAIN_NAME = #{isDomainName},
</if>
UPDATED_TIME = now()
WHERE
DEL_FLAG = '0'

Loading…
Cancel
Save