|
@ -144,7 +144,17 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl<FunctionCusto |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Result<FunctionCustomizedDetailResultDTO> getFunctionCustomized(CommonFunctionIdFormDTO formDTO) { |
|
|
public Result<FunctionCustomizedDetailResultDTO> getFunctionCustomized(CommonFunctionIdFormDTO formDTO) { |
|
|
|
|
|
//1.查询定制功能详情信息
|
|
|
FunctionCustomizedDetailResultDTO resultDTO = baseDao.getFunctionCustomizedByFunctionId(formDTO); |
|
|
FunctionCustomizedDetailResultDTO resultDTO = baseDao.getFunctionCustomizedByFunctionId(formDTO); |
|
|
|
|
|
|
|
|
|
|
|
//2.查询是否有客户在使用当前定制功能
|
|
|
|
|
|
CustomerFunctionDetailEntity entity = customerFunctionDetailService.selectById(formDTO.getFunctionId()); |
|
|
|
|
|
if (null == entity || null == entity.getFunctionId()) { |
|
|
|
|
|
resultDTO.setIsApply(NumConstant.ZERO); |
|
|
|
|
|
} else { |
|
|
|
|
|
resultDTO.setIsApply(NumConstant.ONE); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return new Result<FunctionCustomizedDetailResultDTO>().ok(resultDTO); |
|
|
return new Result<FunctionCustomizedDetailResultDTO>().ok(resultDTO); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -178,6 +188,8 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl<FunctionCusto |
|
|
List<CustomerFunctionDetailEntity> upCustomizedInfo = new ArrayList<>(); |
|
|
List<CustomerFunctionDetailEntity> upCustomizedInfo = new ArrayList<>(); |
|
|
// 统一提示 不能进行修改的客户id
|
|
|
// 统一提示 不能进行修改的客户id
|
|
|
StringBuilder tipCustomizedInfoUserId = new StringBuilder(); |
|
|
StringBuilder tipCustomizedInfoUserId = new StringBuilder(); |
|
|
|
|
|
// 如果客户全都是使用的自定义模板,则只修改 功能表、定制功能表
|
|
|
|
|
|
int flag = 0; |
|
|
|
|
|
|
|
|
// 如果这个功能,被客户重新定义了,则不会修改
|
|
|
// 如果这个功能,被客户重新定义了,则不会修改
|
|
|
for (int i = 0; i < customizedId.size(); i++){ |
|
|
for (int i = 0; i < customizedId.size(); i++){ |
|
@ -207,10 +219,17 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl<FunctionCusto |
|
|
customer.setId(customizedId.get(i).getId()); |
|
|
customer.setId(customizedId.get(i).getId()); |
|
|
upCustomizedInfo.add(customer); |
|
|
upCustomizedInfo.add(customer); |
|
|
} |
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
// 3.2 用户使用的是自定义的功能,则不予处理
|
|
|
|
|
|
// 但如果所有的客户,都是使用的自定义功能,则修改 功能表、定制功能表
|
|
|
|
|
|
flag = flag + NumConstant.ONE; |
|
|
} |
|
|
} |
|
|
// 3.2 用户使用的是自定义的功能,则不予处理
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
if(flag == customizedId.size()){ |
|
|
|
|
|
// 3.3 没有客户使用该 功能,根据入参参数,修改功能表、定制功能表
|
|
|
|
|
|
this.functionNotUsed(formDTO); |
|
|
|
|
|
} |
|
|
if (upCustomizedInfo != null && upCustomizedInfo.size() > NumConstant.ZERO){ |
|
|
if (upCustomizedInfo != null && upCustomizedInfo.size() > NumConstant.ZERO){ |
|
|
// 5.1 修改 客户定制功能详情表
|
|
|
// 5.1 修改 客户定制功能详情表
|
|
|
customerFunctionDetailService.updateBatchById(upCustomizedInfo); |
|
|
customerFunctionDetailService.updateBatchById(upCustomizedInfo); |
|
@ -263,10 +282,12 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl<FunctionCusto |
|
|
WebviewDomainFormDTO domainFormDTO = new WebviewDomainFormDTO(); |
|
|
WebviewDomainFormDTO domainFormDTO = new WebviewDomainFormDTO(); |
|
|
domainFormDTO.setCustomerId(formDTO.getCustomerId()); |
|
|
domainFormDTO.setCustomerId(formDTO.getCustomerId()); |
|
|
domainFormDTO.setClientType("resi"); |
|
|
domainFormDTO.setClientType("resi"); |
|
|
|
|
|
domainFormDTO.setAction("set"); |
|
|
domainFormDTO.setWebViewDomain(resiDomains); |
|
|
domainFormDTO.setWebViewDomain(resiDomains); |
|
|
String domainData = HttpClientManager.getInstance().sendPostByJSON(domainUrl, JSON.toJSONString(domainFormDTO)).getData(); |
|
|
String domainData = HttpClientManager.getInstance().sendPostByJSON(domainUrl, JSON.toJSONString(domainFormDTO)).getData(); |
|
|
JSONObject domainObject = JSON.parseObject(domainData); |
|
|
JSONObject domainObject = JSON.parseObject(domainData); |
|
|
Result domainResult = ConvertUtils.mapToEntity(domainObject, Result.class); |
|
|
Result domainResult = ConvertUtils.mapToEntity(domainObject, Result.class); |
|
|
|
|
|
domainResult.setCode(domainObject.getInteger("code")); |
|
|
if (!domainResult.success()) { |
|
|
if (!domainResult.success()) { |
|
|
throw new RenException(domainResult.getCode(), domainResult.getInternalMsg()); |
|
|
throw new RenException(domainResult.getCode(), domainResult.getInternalMsg()); |
|
|
} |
|
|
} |
|
@ -277,6 +298,7 @@ public class FunctionCustomizedServiceImpl extends BaseServiceImpl<FunctionCusto |
|
|
WebviewDomainFormDTO domainFormDTO = new WebviewDomainFormDTO(); |
|
|
WebviewDomainFormDTO domainFormDTO = new WebviewDomainFormDTO(); |
|
|
domainFormDTO.setCustomerId(formDTO.getCustomerId()); |
|
|
domainFormDTO.setCustomerId(formDTO.getCustomerId()); |
|
|
domainFormDTO.setClientType("work"); |
|
|
domainFormDTO.setClientType("work"); |
|
|
|
|
|
domainFormDTO.setAction("set"); |
|
|
domainFormDTO.setWebViewDomain(workDomains); |
|
|
domainFormDTO.setWebViewDomain(workDomains); |
|
|
String domainData = HttpClientManager.getInstance().sendPostByJSON(domainUrl, JSON.toJSONString(domainFormDTO)).getData(); |
|
|
String domainData = HttpClientManager.getInstance().sendPostByJSON(domainUrl, JSON.toJSONString(domainFormDTO)).getData(); |
|
|
JSONObject domainObject = JSON.parseObject(domainData); |
|
|
JSONObject domainObject = JSON.parseObject(domainData); |
|
|