This commit is contained in:
2025-12-04 10:00:35 +08:00
parent faa9f528c6
commit da90c3c626
6 changed files with 17 additions and 11 deletions

View File

@@ -10,6 +10,6 @@ import org.springframework.web.bind.annotation.RequestBody;
@FeignClient(name = "system",contextId = "systemMessageClient") @FeignClient(name = "system",contextId = "systemMessageClient")
public interface IMessageFeignClient { public interface IMessageFeignClient {
@PostMapping("/systemMsg//sendMessage") @PostMapping("/systemMsg/sendMessage")
SdmResponse sendMessage(@RequestBody SendMsgReq req); SdmResponse sendMessage(@RequestBody SendMsgReq req);
} }

View File

@@ -5,6 +5,7 @@ import com.sdm.common.entity.req.system.UserQueryReq;
import com.sdm.common.entity.resp.system.CIDUserResp; import com.sdm.common.entity.resp.system.CIDUserResp;
import com.sdm.common.feign.inter.system.ISysUserFeignClient; import com.sdm.common.feign.inter.system.ISysUserFeignClient;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -25,17 +26,18 @@ public class UserNameCacheService {
@Cacheable(value = "userNames", key = "#userIds.toString()") @Cacheable(value = "userNames", key = "#userIds.toString()")
public Map<Long, String> batchGetUserNames(Set<Long> userIds) { public Map<Long, String> batchGetUserNames(Set<Long> userIds) {
log.info("【缓存未命中】批量查询用户名,用户数量: {}", userIds.size()); log.info("【缓存未命中】批量查询用户名,用户数量: {}", userIds.size());
Map<Long, String> userMap = new HashMap<>();
// 批量调用用户服务 // 批量调用用户服务
SdmResponse<List<CIDUserResp>> response = sysUserFeignClient.listUserByIds( SdmResponse<List<CIDUserResp>> response = sysUserFeignClient.listUserByIds(
UserQueryReq.builder().userIds(new ArrayList<>(userIds)).build() UserQueryReq.builder().userIds(new ArrayList<>(userIds)).build()
); );
if (CollectionUtils.isNotEmpty(response.getData())) {
Map<Long, String> userMap = response.getData().stream() userMap = response.getData().stream()
.collect(Collectors.toMap( .collect(Collectors.toMap(
CIDUserResp::getUserId, CIDUserResp::getUserId,
CIDUserResp::getNickname CIDUserResp::getNickname
)); ));
}
return userMap; return userMap;
} }

View File

@@ -71,6 +71,9 @@ public class KeyResultReq extends BaseReq {
@Schema(description = "文件") @Schema(description = "文件")
private MultipartFile file; private MultipartFile file;
@Schema(description = "是否仅曲线上传文件")
private boolean onlyFile;
/** /**
* -------------------------------------------------上传交付物使用参数------------------------------------------------ * -------------------------------------------------上传交付物使用参数------------------------------------------------
*/ */

View File

@@ -158,7 +158,7 @@ public class DemandServiceImpl extends BaseService implements IDemandService {
SdmResponse response = dataClientFeignClient.createDir(createDirReq); SdmResponse response = dataClientFeignClient.createDir(createDirReq);
log.info("创建需求时,调用创建文件夹的返回值为:{}", response); log.info("创建需求时,调用创建文件夹的返回值为:{}", response);
return SdmResponse.success(demandId); return SdmResponse.success(req.getUuid());
} }
@Transactional @Transactional

View File

@@ -743,7 +743,7 @@ public class SimulationRunServiceImpl extends ServiceImpl<SimulationRunMapper, S
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public SdmResponse addSimulationKeyResult(KeyResultReq req) { public SdmResponse addSimulationKeyResult(KeyResultReq req) {
if (KeyResultTypeEnum.CURVE.getKeyResultType().equals(req.getKeyResultType())) { if (KeyResultTypeEnum.CURVE.getKeyResultType().equals(req.getKeyResultType()) && req.isOnlyFile()) {
CurveParamDto curveParamDto = getCurveParamsFromUpload(req.getFile(), 2); CurveParamDto curveParamDto = getCurveParamsFromUpload(req.getFile(), 2);
return SdmResponse.success(curveParamDto); return SdmResponse.success(curveParamDto);
} }

View File

@@ -53,7 +53,8 @@
#{it.tag3,typeHandler=com.sdm.project.handler.ListStringTypeHandler},#{it.tag4,typeHandler=com.sdm.project.handler.ListStringTypeHandler}, #{it.tag3,typeHandler=com.sdm.project.handler.ListStringTypeHandler},#{it.tag4,typeHandler=com.sdm.project.handler.ListStringTypeHandler},
#{it.tag5,typeHandler=com.sdm.project.handler.ListStringTypeHandler},#{it.tag6,typeHandler=com.sdm.project.handler.ListStringTypeHandler}, #{it.tag5,typeHandler=com.sdm.project.handler.ListStringTypeHandler},#{it.tag6,typeHandler=com.sdm.project.handler.ListStringTypeHandler},
#{it.tag7,typeHandler=com.sdm.project.handler.ListStringTypeHandler},#{it.tag8,typeHandler=com.sdm.project.handler.ListStringTypeHandler}, #{it.tag7,typeHandler=com.sdm.project.handler.ListStringTypeHandler},#{it.tag8,typeHandler=com.sdm.project.handler.ListStringTypeHandler},
#{it.tag9,typeHandler=com.sdm.project.handler.ListStringTypeHandler},#{it.tag10,typeHandler=com.sdm.project.handler.ListStringTypeHandler}),#{it.imageFileId} #{it.tag9,typeHandler=com.sdm.project.handler.ListStringTypeHandler},#{it.tag10,typeHandler=com.sdm.project.handler.ListStringTypeHandler},
#{it.imageFileId})
</foreach> </foreach>
</insert> </insert>