fix:表单新增根据创建人查询
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -19,4 +19,6 @@ public class FormConfigure{
|
||||
public Long tenantId;
|
||||
|
||||
public String createTime;
|
||||
|
||||
public String userId;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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("表单不存在");
|
||||
|
||||
Reference in New Issue
Block a user