From 263512bf9fc22e2f1c2499098a78142cdc882cab Mon Sep 17 00:00:00 2001 From: terrence Date: Mon, 8 Jan 2024 09:54:19 +0800 Subject: [PATCH 1/2] fix add keyword trim when add user --- .../java/com/primihub/biz/service/sys/SysUserService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/primihub-service/biz/src/main/java/com/primihub/biz/service/sys/SysUserService.java b/primihub-service/biz/src/main/java/com/primihub/biz/service/sys/SysUserService.java index 48984755e..faf08d4c4 100644 --- a/primihub-service/biz/src/main/java/com/primihub/biz/service/sys/SysUserService.java +++ b/primihub-service/biz/src/main/java/com/primihub/biz/service/sys/SysUserService.java @@ -170,10 +170,12 @@ public BaseResultEntity saveOrUpdateUser(SaveOrUpdateUserParam saveOrUpdateUserP Long userId=saveOrUpdateUserParam.getUserId(); SysUser sysUser; if(userId==null){ - if(saveOrUpdateUserParam.getUserAccount()==null|| "".equals(saveOrUpdateUserParam.getUserAccount().trim())) { + saveOrUpdateUserParam.setUserAccount(saveOrUpdateUserParam.getUserAccount().trim()); + saveOrUpdateUserParam.setUserName(saveOrUpdateUserParam.getUserName().trim()); + if(saveOrUpdateUserParam.getUserAccount()==null|| saveOrUpdateUserParam.getUserAccount().isEmpty()) { return BaseResultEntity.failure(BaseResultEnum.LACK_OF_PARAM,"userAccount"); } - if(saveOrUpdateUserParam.getUserName()==null|| "".equals(saveOrUpdateUserParam.getUserName().trim())) { + if(saveOrUpdateUserParam.getUserName()==null|| saveOrUpdateUserParam.getUserName().isEmpty()) { return BaseResultEntity.failure(BaseResultEnum.LACK_OF_PARAM,"userName"); } if(saveOrUpdateUserParam.getIsForbid()==null) { From 5d5f71fe6635eb19df6c21b2677f828531d15b47 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 4 Mar 2024 12:56:56 +0800 Subject: [PATCH 2/2] fix model task bug with both data align and fitTran --- .../FitTransformComponentTaskServiceImpl.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/primihub-service/biz/src/main/java/com/primihub/biz/service/data/component/impl/FitTransformComponentTaskServiceImpl.java b/primihub-service/biz/src/main/java/com/primihub/biz/service/data/component/impl/FitTransformComponentTaskServiceImpl.java index 39d3a5989..803437e25 100644 --- a/primihub-service/biz/src/main/java/com/primihub/biz/service/data/component/impl/FitTransformComponentTaskServiceImpl.java +++ b/primihub-service/biz/src/main/java/com/primihub/biz/service/data/component/impl/FitTransformComponentTaskServiceImpl.java @@ -26,6 +26,7 @@ import java.io.File; import java.util.*; +import java.util.function.Function; import java.util.stream.Collectors; @Service("fitTransformComponentTaskServiceImpl") @@ -66,12 +67,20 @@ public BaseResultEntity runTask(DataComponentReq req, ComponentTaskReq taskReq) fitTransformEntityMap.remove(modelDerivationDto.getOriginalResourceId()); } log.info("newids:{}", ids); + log.info("fitTransform-2:{}", JSONObject.toJSONString(fitTransformEntityMap)); } + Map oldResourceIdMap = newest.stream().collect(Collectors.toMap(ModelDerivationDto::getOriginalResourceId, Function.identity())); try { GrpcComponentDto labelDatasetDto = fitTransformEntityMap.get(taskReq.getFreemarkerMap().get(DataConstant.PYTHON_LABEL_DATASET)); + if (labelDatasetDto == null) { + labelDatasetDto = fitTransformEntityMap.get(oldResourceIdMap.get(taskReq.getFreemarkerMap().get(DataConstant.PYTHON_LABEL_DATASET)).getNewResourceId()); + } taskReq.getFreemarkerMap().put("new_"+DataConstant.PYTHON_LABEL_DATASET,labelDatasetDto.getNewDataSetId()); taskReq.getFreemarkerMap().put("new_"+DataConstant.PYTHON_LABEL_DATASET+"_path",labelDatasetDto.getOutputFilePath()); GrpcComponentDto guestDatasetDto = fitTransformEntityMap.get(taskReq.getFreemarkerMap().get(DataConstant.PYTHON_GUEST_DATASET)); + if (guestDatasetDto == null) { + guestDatasetDto = fitTransformEntityMap.get(oldResourceIdMap.get(taskReq.getFreemarkerMap().get(DataConstant.PYTHON_GUEST_DATASET)).getNewResourceId()); + } taskReq.getFreemarkerMap().put("new_"+DataConstant.PYTHON_GUEST_DATASET,guestDatasetDto.getNewDataSetId()); taskReq.getFreemarkerMap().put("new_"+DataConstant.PYTHON_GUEST_DATASET+"_path",guestDatasetDto.getOutputFilePath()); TaskParam taskParam = new TaskParam<>(new TaskComponentParam()); @@ -119,10 +128,9 @@ public BaseResultEntity runTask(DataComponentReq req, ComponentTaskReq taskReq) } } } - HashSet dids = new HashSet(){{ - add(labelDatasetDto.getNewDataSetId()); - add(guestDatasetDto.getNewDataSetId()); - }}; + HashSet dids = new HashSet(); + dids.add(labelDatasetDto.getNewDataSetId()); + dids.add(guestDatasetDto.getNewDataSetId()); while (true){ // 休眠一秒等待数据集同步 BaseResultEntity dataSets = fusionResourceService.getDataSets(dids);