修改:bug1228 动态表格非系统页面的操作均为用户自定义操作
This commit is contained in:
@@ -147,9 +147,10 @@ public class SimulationSystemConfigController implements ISysConfigFeignClient {
|
||||
|
||||
@GetMapping(value = "/getFormConfigure")
|
||||
@ResponseBody
|
||||
SdmResponse getFormConfigure(@RequestParam("formName") String formName)
|
||||
SdmResponse getFormConfigure(@RequestParam("formName") String formName,@RequestParam("sourceType ") String sourceType )
|
||||
// fromType 默认 不传就是个人,传sys 就是系统过来的
|
||||
{
|
||||
return service.queryFormConfigure(formName);
|
||||
return service.queryFormConfigure(formName,sourceType);
|
||||
}
|
||||
|
||||
@PostMapping(value = "/addFormConfigure")
|
||||
|
||||
@@ -22,4 +22,7 @@ public class FormConfigure{
|
||||
|
||||
public String userId;
|
||||
|
||||
// 来源:系统页面传 sys,默认其他页面不传
|
||||
public String sourceType = "";
|
||||
|
||||
}
|
||||
|
||||
@@ -15,4 +15,8 @@ public class FormConfigureReq extends BaseReq {
|
||||
public Long creator;
|
||||
|
||||
public String createTime;
|
||||
|
||||
// 来源:系统页面传 sys,默认其他页面不传
|
||||
public String sourceType = "";
|
||||
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public interface ISimulationSystemConfigService {
|
||||
|
||||
SdmResponse deleteFormConfigure(FormConfigure configure);
|
||||
|
||||
SdmResponse queryFormConfigure(String formName);
|
||||
SdmResponse queryFormConfigure(String formName, String sourceType);
|
||||
|
||||
SdmResponse listFormConfigure(FormConfigureReq req);
|
||||
|
||||
|
||||
@@ -341,10 +341,10 @@ public class SimulationSystemConfigServiceImpl extends BaseService implements IS
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public SdmResponse addSystemFormConfigure(FormConfigure configure) {
|
||||
// 管理员才能新增
|
||||
if(isNormalRole()){
|
||||
throw new RuntimeException("不支持普通用户新增,请联系系统管理员新增");
|
||||
}
|
||||
// 管理员才能新增 --废弃
|
||||
// if(isNormalRole()){
|
||||
// throw new RuntimeException("不支持普通用户新增,请联系系统管理员新增");
|
||||
// }
|
||||
// 普通角色可以修改自定义字段
|
||||
SdmResponse response = SdmResponse.success();
|
||||
Long tenantId = ThreadLocalContext.getTenantId();
|
||||
@@ -416,10 +416,10 @@ public class SimulationSystemConfigServiceImpl extends BaseService implements IS
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public SdmResponse updateSystemFormConfigure(FormConfigure configure) {
|
||||
boolean normalRole = isNormalRole();
|
||||
// boolean normalRole = isNormalRole();
|
||||
// 普通用户修改
|
||||
if (normalRole) {
|
||||
|
||||
// if (normalRole) {
|
||||
if (!Objects.equals("sys",configure.sourceType)) {
|
||||
// 调用抽取后的普通用户修改方法
|
||||
return handleNormalUserUpdate(configure);
|
||||
}
|
||||
@@ -452,10 +452,10 @@ public class SimulationSystemConfigServiceImpl extends BaseService implements IS
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public SdmResponse deleteFormConfigure(FormConfigure configure) {
|
||||
// 管理员才能删除
|
||||
if(isNormalRole()){
|
||||
throw new RuntimeException("不支持普通用户删除,请联系系统管理员删除");
|
||||
}
|
||||
// 管理员才能删除 --废弃
|
||||
// if(isNormalRole()){
|
||||
// throw new RuntimeException("不支持普通用户删除,请联系系统管理员删除");
|
||||
// }
|
||||
if(!formConfigureService.removeById(configure.id)) {
|
||||
return SdmResponse.failed("删除表单配置失败");
|
||||
}
|
||||
@@ -477,7 +477,7 @@ public class SimulationSystemConfigServiceImpl extends BaseService implements IS
|
||||
* @param formName
|
||||
* @return
|
||||
*/
|
||||
public SdmResponse queryFormConfigure(String formName)
|
||||
public SdmResponse queryFormConfigure(String formName, String sourceType)
|
||||
{
|
||||
SdmResponse response = SdmResponse.success();
|
||||
long tenantId = ThreadLocalContext.getTenantId();
|
||||
@@ -486,8 +486,9 @@ public class SimulationSystemConfigServiceImpl extends BaseService implements IS
|
||||
{
|
||||
response = SdmResponse.failed("表单不存在");
|
||||
}
|
||||
// 普通用户展示替换自定义
|
||||
if (isNormalRole()) {
|
||||
// 普通用户展示替换自定义 -- 废弃
|
||||
// if (isNormalRole()) {
|
||||
if (!Objects.equals("sys",sourceType)) {
|
||||
// 调用抽取后的方法处理用户自定义配置替换
|
||||
replaceWithSingleUserCustomConfig(formConfigure);
|
||||
}
|
||||
@@ -510,8 +511,10 @@ public class SimulationSystemConfigServiceImpl extends BaseService implements IS
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return SdmResponse.success();
|
||||
}
|
||||
// 普通用户展示替换自定义
|
||||
if (isNormalRole()) {
|
||||
// 普通用户展示替换自定义--废弃
|
||||
// if (isNormalRole()) {
|
||||
// 非系统页面查看,替换自定义数据查询
|
||||
if (!Objects.equals("sys",req.sourceType)) {
|
||||
// 调用抽取后的方法处理用户自定义配置替换
|
||||
replaceWithUserCustomConfig(list);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user