测试问题修改
This commit is contained in:
parent
65d4798738
commit
91cab24d40
@ -81,12 +81,8 @@ public class PermissionController {
|
||||
//获取角色权限
|
||||
@GetMapping("/selectPersByRole")
|
||||
Response selectPersByRole(@RequestParam String roleID){
|
||||
try {
|
||||
List<MenuParamView> views = modelRoleService.selectPersByRole(roleID);
|
||||
return Response.ok().data(views);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -112,17 +108,14 @@ public class PermissionController {
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
//修改单个角色信息(基础信息)
|
||||
// 修改单个角色信息(基础信息)
|
||||
@PostMapping("/updateRole")
|
||||
public Response updateRole(@RequestBody ModelRolesPojo modelRolesPojo,@RequestParam String userID){
|
||||
try {
|
||||
modelRoleService.updateRole(modelRolesPojo,userID);
|
||||
return Response.ok();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//菜单查询
|
||||
@GetMapping("/selectMenus")
|
||||
Response selectMenus(){
|
||||
|
||||
@ -33,10 +33,14 @@ public class EngineParamDetailRequest {
|
||||
* 子系统
|
||||
*/
|
||||
private String subsystemName;
|
||||
/**
|
||||
* 子系统+参数类型类型路径
|
||||
*/
|
||||
private List<String> subsystemTypes;
|
||||
/**
|
||||
* 子系统多选
|
||||
*/
|
||||
private List<String> subsystemNames;
|
||||
// private List<String> subsystemNames;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@ -44,7 +48,7 @@ public class EngineParamDetailRequest {
|
||||
/**
|
||||
* 类型多选
|
||||
*/
|
||||
private List<String> parameterTypes;
|
||||
// private List<String> parameterTypes;
|
||||
/**
|
||||
* 大版本(审核通过后变更的)
|
||||
*/
|
||||
|
||||
@ -4,7 +4,7 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RolePerJoinRequest {
|
||||
//角色ID 菜单ID 参数ID
|
||||
//角色ID 菜单name 参数ID
|
||||
private String roleId;
|
||||
private String menuName;
|
||||
private String parameterId;
|
||||
|
||||
@ -86,7 +86,8 @@ public class EngineModelListener implements ReadListener<DataEntryEngineModelExc
|
||||
List<DataEntryEngineModelPojo> modelPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||
.eq("product_number", data.getProductNumber())
|
||||
.eq("model_name", data.getModelName())
|
||||
.eq("brand", data.getBrand()).doQuery(DataEntryEngineModelPojo.class);
|
||||
// .eq("brand", data.getBrand())
|
||||
.doQuery(DataEntryEngineModelPojo.class);
|
||||
if (ObjectUtils.isNotEmpty(modelPojos)) {
|
||||
throw new ExcelImportException(
|
||||
String.format("请检查该型号是否已经存在,%s页第%d行", sheetName, rowIndex)
|
||||
|
||||
@ -15,8 +15,8 @@ public class ModelMenuDictionaryPojo {
|
||||
|
||||
@RowID(sequence = "yfsjglpt_model_menu_dictionary_s", type = RowIDType.UUID)
|
||||
private String id ;
|
||||
/** 上级名称,; */
|
||||
private String parentName ;
|
||||
/** 上级ID,; */
|
||||
private String parentId;
|
||||
/** 菜单名称,; */
|
||||
private String menuName ;
|
||||
/** 菜单代码,; */
|
||||
@ -34,9 +34,4 @@ public class ModelMenuDictionaryPojo {
|
||||
/** 最后更新时间,; */
|
||||
private Date lastUpdateDate ;
|
||||
|
||||
public ModelMenuDictionaryPojo(String id, String parentName, String menuName) {
|
||||
this.id = id;
|
||||
this.parentName = parentName;
|
||||
this.menuName = menuName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,8 @@ package com.xdap.self_development.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class ActivitiRecordDTO {
|
||||
|
||||
@ -23,4 +25,8 @@ public class ActivitiRecordDTO {
|
||||
* 节点顺序
|
||||
*/
|
||||
private Integer nodeOrder;
|
||||
/**
|
||||
* 操作时间
|
||||
*/
|
||||
private Date operateTime;
|
||||
}
|
||||
|
||||
@ -500,6 +500,7 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
||||
activitiRecordDTO.setApproverPersons(approverPerson);
|
||||
activitiRecordDTO.setCommon(paramApprovalRecordPojo.getApprovalComment());
|
||||
activitiRecordDTO.setNodeOrder(paramApprovalRecordPojo.getNodeOrder());
|
||||
activitiRecordDTO.setOperateTime(paramApprovalRecordPojo.getOperateTime());
|
||||
activitiRecordDTOS.add(activitiRecordDTO);
|
||||
}
|
||||
//找到下一级审批人
|
||||
|
||||
@ -253,6 +253,16 @@ public class DataEntryEngineModelServiceImpl implements DataEntryEngineModelServ
|
||||
DataEntryEngineModelPojo modelPojo = new DataEntryEngineModelPojo();
|
||||
BeanUtils.copyProperties(request, modelPojo, "status");
|
||||
List<ResponsiblePerson> personPojos = responsiblePerService.selectByDepName(request.getDepartment());
|
||||
List<DataEntryEngineModelPojo> modelPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||
.eq("product_number", request.getProductNumber())
|
||||
.eq("model_name", request.getModelName())
|
||||
// .eq("brand", data.getBrand())
|
||||
.doQuery(DataEntryEngineModelPojo.class);
|
||||
if (ObjectUtils.isNotEmpty(modelPojos)) {
|
||||
throw new ExcelImportException(
|
||||
String.format("请检查该型号是否已经存在")
|
||||
);
|
||||
}
|
||||
// 去掉责任人 if (ObjectUtils.isEmpty(personPojos)) {
|
||||
// throw new ExcelImportException(
|
||||
// String.format("请检查该部门是否有责任人,部门:%s", request.getDepartment())
|
||||
|
||||
@ -171,10 +171,9 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
||||
public Map<String, List<EngineParamDetailDTO>> selectValueByMoreParam(EngineParamDetailRequest engineParamDetailRequest) {
|
||||
|
||||
String engineModelID = engineParamDetailRequest.getEngineModelID();
|
||||
List<String> subsystemNames = engineParamDetailRequest.getSubsystemNames();
|
||||
List<String> parameterTypes = engineParamDetailRequest.getParameterTypes();
|
||||
|
||||
if (ObjectUtils.isEmpty(engineModelID) || ObjectUtils.isEmpty(subsystemNames) || ObjectUtils.isEmpty(parameterTypes)) {
|
||||
List<String> subsystemTypes = engineParamDetailRequest.getSubsystemTypes();
|
||||
if (ObjectUtils.isEmpty(engineModelID) || ObjectUtils.isEmpty(subsystemTypes) ) {
|
||||
throw new RuntimeException("传入参数为空,请检查");
|
||||
}
|
||||
List<EngineParamDetailPojo> detailPojos = new ArrayList<>();
|
||||
@ -189,79 +188,51 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
||||
if (ObjectUtils.isNotEmpty(versionStatus)) {
|
||||
code = ParamValueVersionEnum.getByDesc(versionStatus).getCode();
|
||||
}
|
||||
//若传入填写人则查询填写人需要填写的参数
|
||||
if (ObjectUtils.isNotEmpty(filledById)) {
|
||||
detailPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||
.eq("filled_by", filledById)
|
||||
.eq("engine_model_id", engineModelID)
|
||||
.eq("version_status", code)
|
||||
.in("subsystem_name", subsystemNames)
|
||||
.in("parameter_type", parameterTypes)
|
||||
.doQuery(EngineParamDetailPojo.class);
|
||||
|
||||
if (ObjectUtils.isNotEmpty(engineParamDetailRequest.getMajorVersion()) && engineParamDetailRequest.getMajorVersion() != 0) {
|
||||
detailPojos = detailPojos.stream()
|
||||
.filter(x -> engineParamDetailRequest.getMajorVersion()
|
||||
.equals(x.getMajorVersion())).collect(Collectors.toList());
|
||||
} else {
|
||||
EngineParamDetailPojo engineParamDetailPojo = detailPojos.stream().max(Comparator.comparingInt(x -> x.getMajorVersion())).get();
|
||||
detailPojos = detailPojos.stream()
|
||||
.filter(x -> engineParamDetailPojo.getMajorVersion()
|
||||
.equals(x.getMajorVersion())).collect(Collectors.toList());
|
||||
for (String subsystemType : subsystemTypes) {
|
||||
if (subsystemType.split("-").length != 2) {
|
||||
throw new RuntimeException("查询条件异常,需子系统-类型");
|
||||
}
|
||||
|
||||
} else if (ObjectUtils.isNotEmpty(resId)) {
|
||||
//若传入责任人则查询责任人需要分发的参数
|
||||
detailPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||
.eq("engine_model_id", engineModelID)
|
||||
.eq("responsible_person_id", resId)
|
||||
.eq("version_status", code)
|
||||
.in("subsystem_name", subsystemNames)
|
||||
.in("parameter_type", parameterTypes)
|
||||
.doQuery(EngineParamDetailPojo.class);
|
||||
//若传入版本则查询该版本否则查询最新版本
|
||||
if (ObjectUtils.isNotEmpty(engineParamDetailRequest.getMajorVersion()) && engineParamDetailRequest.getMajorVersion() != 0) {
|
||||
detailPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||
String subsystem = subsystemType.split("-")[0];
|
||||
String type = subsystemType.split("-")[1];
|
||||
//若传入填写人则查询填写人需要填写的参数
|
||||
if (ObjectUtils.isNotEmpty(filledById)) {
|
||||
detailPojos.addAll(sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||
.eq("filled_by", filledById)
|
||||
.eq("engine_model_id", engineModelID)
|
||||
.eq("major_version", engineParamDetailRequest.getMajorVersion())
|
||||
.in("subsystem_name", subsystemNames)
|
||||
.in("parameter_type", parameterTypes)
|
||||
.doQuery(EngineParamDetailPojo.class);
|
||||
detailPojos = detailPojos.stream()
|
||||
.filter(x -> engineParamDetailRequest.getMajorVersion()
|
||||
.equals(x.getMajorVersion())).collect(Collectors.toList());
|
||||
} else {
|
||||
detailPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||
.eq("version_status", code)
|
||||
.eq("subsystem_name", subsystem)
|
||||
.eq("parameter_type", type)
|
||||
.doQuery(EngineParamDetailPojo.class));
|
||||
} else if (ObjectUtils.isNotEmpty(resId)) {
|
||||
//若传入责任人则查询责任人需要分发的参数
|
||||
detailPojos.addAll(sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||
.eq("engine_model_id", engineModelID)
|
||||
.in("subsystem_name", subsystemNames)
|
||||
.in("parameter_type", parameterTypes)
|
||||
.doQuery(EngineParamDetailPojo.class);
|
||||
EngineParamDetailPojo engineParamDetailPojo = detailPojos.stream().max(Comparator.comparingInt(x -> x.getMajorVersion())).get();
|
||||
detailPojos = detailPojos.stream()
|
||||
.filter(x -> engineParamDetailPojo.getMajorVersion()
|
||||
.equals(x.getMajorVersion())).collect(Collectors.toList());
|
||||
.eq("responsible_person_id", resId)
|
||||
.eq("version_status", code)
|
||||
.eq("subsystem_name", subsystem)
|
||||
.eq("parameter_type", type)
|
||||
.doQuery(EngineParamDetailPojo.class));
|
||||
} else {
|
||||
detailPojos.addAll(sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||
.eq("engine_model_id", engineModelID)
|
||||
.eq("version_status", code)
|
||||
.eq("subsystem_name", subsystem)
|
||||
.eq("parameter_type", type)
|
||||
.doQuery(EngineParamDetailPojo.class));
|
||||
}
|
||||
|
||||
} else {
|
||||
//否则就查询这个机型下所有最新版本参数
|
||||
detailPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||
.eq("engine_model_id", engineModelID)
|
||||
.eq("version_status", code)
|
||||
.in("subsystem_name", subsystemNames)
|
||||
.in("parameter_type", parameterTypes)
|
||||
.doQuery(EngineParamDetailPojo.class);
|
||||
//若传入版本则查询该版本否则查询最新版本
|
||||
if (ObjectUtils.isNotEmpty(engineParamDetailRequest.getMajorVersion()) && engineParamDetailRequest.getMajorVersion() != 0) {
|
||||
detailPojos = detailPojos.stream()
|
||||
.filter(x -> engineParamDetailRequest.getMajorVersion()
|
||||
.equals(x.getMajorVersion())).collect(Collectors.toList());
|
||||
} else {
|
||||
EngineParamDetailPojo engineParamDetailPojo = detailPojos.stream().max(Comparator.comparingInt(x -> x.getMajorVersion())).get();
|
||||
detailPojos = detailPojos.stream()
|
||||
.filter(x -> engineParamDetailPojo.getMajorVersion()
|
||||
.equals(x.getMajorVersion())).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(engineParamDetailRequest.getMajorVersion()) && engineParamDetailRequest.getMajorVersion() != 0) {
|
||||
detailPojos = detailPojos.stream()
|
||||
.filter(x -> engineParamDetailRequest.getMajorVersion()
|
||||
.equals(x.getMajorVersion())).collect(Collectors.toList());
|
||||
} else {
|
||||
EngineParamDetailPojo engineParamDetailPojo = detailPojos.stream().max(Comparator.comparingInt(x -> x.getMajorVersion())).get();
|
||||
detailPojos = detailPojos.stream()
|
||||
.filter(x -> engineParamDetailPojo.getMajorVersion()
|
||||
.equals(x.getMajorVersion())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
//pojo转换dto填写人Id转换为名称
|
||||
log.info("找到数据{}条", detailPojos.size());
|
||||
for (EngineParamDetailPojo detailPojo : detailPojos) {
|
||||
@ -583,7 +554,7 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
||||
List<XdapUsers> xdapUsersPojos = new ArrayList<>();
|
||||
List<ResponsiblePerson> personPojos = responsiblePerService.selectBysubSystemDept(subSystem, dept);
|
||||
if (ObjectUtils.isEmpty(personPojos)) {
|
||||
throw new RuntimeException("该子系统和部门没有查找到相关人子系统:"+subSystem+",部门:"+dept);
|
||||
throw new RuntimeException("该子系统和部门没有查找到相关人子系统:" + subSystem + ",部门:" + dept);
|
||||
}
|
||||
try {
|
||||
List<ResponsiblePerson> collected = personPojos.stream().filter(x -> x.getPersonLevel() == type).collect(Collectors.toList());
|
||||
|
||||
@ -44,15 +44,15 @@ public class ModelMenuPermissionServiceImpl implements ModelMenuPermissionServic
|
||||
}
|
||||
|
||||
for (ModelMenuDictionaryPojo pojo : permissionPojos) {
|
||||
String parentName = pojo.getParentName();
|
||||
String parentId = pojo.getParentId();
|
||||
MenuListView currentNode = nodeMap.get(pojo.getId());
|
||||
|
||||
if (ObjectUtils.isEmpty(parentName) || !nodeMap.containsKey(parentName)) {
|
||||
if (ObjectUtils.isEmpty(parentId) || !nodeMap.containsKey(parentId)) {
|
||||
// 根节点
|
||||
views.add(currentNode);
|
||||
} else {
|
||||
// 子节点,添加到父节点
|
||||
MenuListView parentNode = nodeMap.get(parentName);
|
||||
MenuListView parentNode = nodeMap.get(parentId);
|
||||
if (parentNode.getListViews() == null) {
|
||||
parentNode.setListViews(new ArrayList<>());
|
||||
}
|
||||
|
||||
@ -114,6 +114,7 @@ public class ModelRoleServiceImpl implements ModelRoleService {
|
||||
pojo.setPerId(id);
|
||||
pojo.setCreationDate(new Date());
|
||||
pojo.setCreatedBy(request.getUserId());
|
||||
pojo.setIsEnable(1);
|
||||
businessDatabase.getBusinessDatabase()
|
||||
.doInsert(pojo);
|
||||
}
|
||||
@ -124,7 +125,11 @@ public class ModelRoleServiceImpl implements ModelRoleService {
|
||||
modelRolesPojo.setLastUpdatedBy(userID);
|
||||
modelRolesPojo.setLastUpdateDate(new Date());
|
||||
businessDatabase.getBusinessDatabase()
|
||||
.doUpdate(modelRolesPojo);
|
||||
.update("role_name",modelRolesPojo.getRoleName())
|
||||
.update("role_code",modelRolesPojo.getRoleCode())
|
||||
.update("role_description",modelRolesPojo.getRoleDescription())
|
||||
.rowid("id",modelRolesPojo.getId())
|
||||
.doUpdate(ModelRolesPojo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -152,6 +157,7 @@ public class ModelRoleServiceImpl implements ModelRoleService {
|
||||
ArrayList<MenuParamView> menuParamViews = new ArrayList<>();
|
||||
List<ModelRolePermissionPojo> role = businessDatabase.getBusinessDatabase()
|
||||
.eq("role_id", roleID)
|
||||
.eq("is_enable", 1)
|
||||
.doQuery(ModelRolePermissionPojo.class);
|
||||
List<String> perids = role.stream().map(x -> x.getPerId()).distinct().collect(Collectors.toList());
|
||||
if (ObjectUtils.isEmpty(role)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user