fix:表单新增根据创建人查询

This commit is contained in:
2026-01-27 15:33:38 +08:00
parent 0d74b58490
commit 6802bba8cd
4 changed files with 18 additions and 5 deletions

View File

@@ -145,9 +145,9 @@ public class SimulationSystemConfigController implements ISysConfigFeignClient {
@GetMapping(value = "/getFormConfigure")
@ResponseBody
SdmResponse getFormConfigure(@RequestParam("formName") String formName)
SdmResponse getFormConfigure(@RequestParam("formName") String formName, @RequestParam(required = false) String userId)
{
return service.queryFormConfigure(formName);
return service.queryFormConfigure(formName, Long.valueOf(userId));
}
@PostMapping(value = "/addFormConfigure")

View File

@@ -19,4 +19,6 @@ public class FormConfigure{
public Long tenantId;
public String createTime;
public String userId;
}

View File

@@ -43,7 +43,7 @@ public interface ISimulationSystemConfigService {
SdmResponse deleteFormConfigure(FormConfigure configure);
SdmResponse queryFormConfigure(String formName);
SdmResponse queryFormConfigure(String formName, Long userId);
SdmResponse listFormConfigure(FormConfigureReq req);

View File

@@ -353,6 +353,9 @@ public class SimulationSystemConfigServiceImpl extends BaseService implements IS
LambdaUpdateWrapper<SysFormConfigure> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(SysFormConfigure::getFormName, configure.getFormName());
updateWrapper.eq(SysFormConfigure::getTenantId, ThreadLocalContext.getTenantId());
if (ObjectUtils.isNotEmpty(configure.getUserId())) {
updateWrapper.eq(SysFormConfigure::getCreator, Long.valueOf(configure.getUserId()));
}
if (configure.getFormConfig() != null) {
updateWrapper.set(SysFormConfigure::getFormConfig, configure.getFormConfig());
}
@@ -383,11 +386,19 @@ public class SimulationSystemConfigServiceImpl extends BaseService implements IS
* @param formName
* @return
*/
public SdmResponse queryFormConfigure(String formName)
public SdmResponse queryFormConfigure(String formName, Long creator)
{
SdmResponse response = SdmResponse.success();
long tenantId = ThreadLocalContext.getTenantId();
FormConfigure formConfigure = mapper.queryFormConfigure(formName,tenantId);
// FormConfigure formConfigure = mapper.queryFormConfigure(formName,tenantId);
LambdaQueryWrapper<SysFormConfigure> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SysFormConfigure::getFormName, formName);
queryWrapper.eq(SysFormConfigure::getTenantId, tenantId);
if (ObjectUtils.isNotEmpty(creator)) {
queryWrapper.eq(SysFormConfigure::getCreator, creator);
}
SysFormConfigure formConfigure = formConfigureService.getOne(queryWrapper);
if(formConfigure == null)
{
response = SdmResponse.failed("表单不存在");