Commit 39e207e3 authored by fangxinjiang's avatar fangxinjiang

测试服务-多副本场景

parent 7bff3d7d
package com.yifu.cloud.plus.v1.yifu.archives.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* @Author fxj
* @Date 2022/11/23
* @Description
* @Version 1.0
*/
@Data
public class TSettleDomainUpServerTeamVo implements Serializable {
/**
* 项目编码
*/
@Schema(description = "项目编码")
private String departNo;
/**
* EKP的服务团队 : 存
*/
@Schema(description = "EKP的服务团队", name = "serviceTeam")
private String serviceTeam;
}
......@@ -378,4 +378,23 @@ public class TSettleDomainController {
List<TSettleDomainUpdVo> list= JSONObject.parseArray(jsonStr, TSettleDomainUpdVo.class);
return tSettleDomainService.updateProjectStopStatus(list);
}
/**
* 修改项目表--EKP调用接口
* @author fxj
* @param jsonStr
* @return R
*/
@Operation(summary = "更新项目服务团队--EKP调用接口", description = "更新项目服务团队--EKP调用接口")
@SysLog("更新项目服务团队--EKP调用接口")
@PostMapping("/updateProjectServerTeam")
public R<Boolean> updateProjectServerTeam(@RequestBody String jsonStr) {
try {
jsonStr = URLDecoder.decode(jsonStr, CommonConstants.UTF8).replace("=", "");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
List<TSettleDomainUpServerTeamVo> list= JSONObject.parseArray(jsonStr, TSettleDomainUpServerTeamVo.class);
return tSettleDomainService.updateProjectServerTeam(list);
}
}
......@@ -122,4 +122,6 @@ public interface TSettleDomainService extends IService<TSettleDomain> {
List<TCustomerInfo> getTCustomerInfoForB(List<String> customerList);
R<IPage<CustomerOwnerSelectVo>> getCustomerOwnerPage(Page<CustomerOwnerSelectVo> page, String customerName, String userId);
R<Boolean> updateProjectServerTeam(List<TSettleDomainUpServerTeamVo> list);
}
......@@ -182,7 +182,6 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
return R.failed("获取区域数据失败!");
}
Map<String,String> areaMap = areaListR.getData().getLabelIdMap();
R<SysUserListVo> res;
String errorStr;
TSettleDomain domain;
for (TSettleDomainEkpVo vo:list) {
......@@ -206,14 +205,7 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
domain.setId(tSettleDomainInfo.getId());
}
// 处理服务团队数据权限 2022-09-19 fxj
if (Common.isNotNull(domain.getServiceTeam())){
res = upmsDaprUtils.getUserIdsByUserNames(domain.getServiceTeam());
if (Common.isNotNull(res) && Common.isNotNull(res.getData()) && Common.isNotNull(res.getData().getUserList())){
// 先清理缓存
this.removeSettleCache(null,res.getData().getUserIds());
saveForEkp(res.getData().getUserList(), domain);
}
}
initServerTeamPermission(domain);
domain.setDeleteFlag(CommonConstants.ZERO_STRING);
if (Common.isNotNull(tSettleDomainInfo)) {
baseMapper.updateById(domain);
......@@ -472,4 +464,30 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
String userId) {
return R.ok(baseMapper.getCustomerOwnerPage(page,customerName,userId));
}
/**
* @Author fxj
* @Description 更新服务团队人员权限
* @Date 11:23 2023/2/3
**/
@Override
public R<Boolean> updateProjectServerTeam(List<TSettleDomainUpServerTeamVo> list) {
TSettleDomain domain;
for (TSettleDomainUpServerTeamVo vo:list) {
domain = new TSettleDomain();
BeanUtil.copyProperties(vo,domain);
initServerTeamPermission(domain);
}
return R.ok(Boolean.TRUE,CommonConstants.RESULT_DATA_SUCESS);
}
private void initServerTeamPermission(TSettleDomain domain) {
if (Common.isNotNull(domain.getServiceTeam())){
R<SysUserListVo> res = upmsDaprUtils.getUserIdsByUserNames(domain.getServiceTeam());
if (Common.isNotNull(res) && Common.isNotNull(res.getData()) && Common.isNotNull(res.getData().getUserList())){
// 先清理缓存
this.removeSettleCache(null, res.getData().getUserIds());
saveForEkp(res.getData().getUserList(), domain);
}
}
}
}
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