Merge remote-tracking branch 'origin/master'

This commit is contained in:
zjh 2025-12-09 14:58:35 +08:00
commit 3dd52d4edd
11 changed files with 82 additions and 95 deletions

View File

@ -81,12 +81,8 @@ public class PermissionController {
//获取角色权限 //获取角色权限
@GetMapping("/selectPersByRole") @GetMapping("/selectPersByRole")
Response selectPersByRole(@RequestParam String roleID){ Response selectPersByRole(@RequestParam String roleID){
try {
List<MenuParamView> views = modelRoleService.selectPersByRole(roleID); List<MenuParamView> views = modelRoleService.selectPersByRole(roleID);
return Response.ok().data(views); 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()); throw new RuntimeException(e.getMessage());
} }
} }
//修改单个角色信息(基础信息) // 修改单个角色信息(基础信息)
@PostMapping("/updateRole") @PostMapping("/updateRole")
public Response updateRole(@RequestBody ModelRolesPojo modelRolesPojo,@RequestParam String userID){ public Response updateRole(@RequestBody ModelRolesPojo modelRolesPojo,@RequestParam String userID){
try {
modelRoleService.updateRole(modelRolesPojo,userID); modelRoleService.updateRole(modelRolesPojo,userID);
return Response.ok(); return Response.ok();
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
}
} }
//菜单查询 //菜单查询
@GetMapping("/selectMenus") @GetMapping("/selectMenus")
Response selectMenus(){ Response selectMenus(){

View File

@ -33,10 +33,14 @@ public class EngineParamDetailRequest {
* 子系统 * 子系统
*/ */
private String subsystemName; 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;
/** /**
* 大版本审核通过后变更的 * 大版本审核通过后变更的
*/ */

View File

@ -4,7 +4,7 @@ import lombok.Data;
@Data @Data
public class RolePerJoinRequest { public class RolePerJoinRequest {
//角色ID 菜单ID 参数ID //角色ID 菜单name 参数ID
private String roleId; private String roleId;
private String menuName; private String menuName;
private String parameterId; private String parameterId;

View File

@ -86,7 +86,8 @@ public class EngineModelListener implements ReadListener<DataEntryEngineModelExc
List<DataEntryEngineModelPojo> modelPojos = sw.buildFromDatasource("xdap_app_223770822127386625") List<DataEntryEngineModelPojo> modelPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
.eq("product_number", data.getProductNumber()) .eq("product_number", data.getProductNumber())
.eq("model_name", data.getModelName()) .eq("model_name", data.getModelName())
.eq("brand", data.getBrand()).doQuery(DataEntryEngineModelPojo.class); // .eq("brand", data.getBrand())
.doQuery(DataEntryEngineModelPojo.class);
if (ObjectUtils.isNotEmpty(modelPojos)) { if (ObjectUtils.isNotEmpty(modelPojos)) {
throw new ExcelImportException( throw new ExcelImportException(
String.format("请检查该型号是否已经存在,%s页第%d行", sheetName, rowIndex) String.format("请检查该型号是否已经存在,%s页第%d行", sheetName, rowIndex)

View File

@ -15,8 +15,8 @@ public class ModelMenuDictionaryPojo {
@RowID(sequence = "yfsjglpt_model_menu_dictionary_s", type = RowIDType.UUID) @RowID(sequence = "yfsjglpt_model_menu_dictionary_s", type = RowIDType.UUID)
private String id ; private String id ;
/** 上级名称,; */ /** 上级ID,; */
private String parentName ; private String parentId;
/** 菜单名称,; */ /** 菜单名称,; */
private String menuName ; private String menuName ;
/** 菜单代码,; */ /** 菜单代码,; */
@ -34,9 +34,4 @@ public class ModelMenuDictionaryPojo {
/** 最后更新时间,; */ /** 最后更新时间,; */
private Date lastUpdateDate ; private Date lastUpdateDate ;
public ModelMenuDictionaryPojo(String id, String parentName, String menuName) {
this.id = id;
this.parentName = parentName;
this.menuName = menuName;
}
} }

View File

@ -2,6 +2,8 @@ package com.xdap.self_development.pojo.dto;
import lombok.Data; import lombok.Data;
import java.util.Date;
@Data @Data
public class ActivitiRecordDTO { public class ActivitiRecordDTO {
@ -23,4 +25,8 @@ public class ActivitiRecordDTO {
* 节点顺序 * 节点顺序
*/ */
private Integer nodeOrder; private Integer nodeOrder;
/**
* 操作时间
*/
private Date operateTime;
} }

View File

@ -500,6 +500,7 @@ public class ActivitiProcessServiceImpl implements ActivitiProcessService {
activitiRecordDTO.setApproverPersons(approverPerson); activitiRecordDTO.setApproverPersons(approverPerson);
activitiRecordDTO.setCommon(paramApprovalRecordPojo.getApprovalComment()); activitiRecordDTO.setCommon(paramApprovalRecordPojo.getApprovalComment());
activitiRecordDTO.setNodeOrder(paramApprovalRecordPojo.getNodeOrder()); activitiRecordDTO.setNodeOrder(paramApprovalRecordPojo.getNodeOrder());
activitiRecordDTO.setOperateTime(paramApprovalRecordPojo.getOperateTime());
activitiRecordDTOS.add(activitiRecordDTO); activitiRecordDTOS.add(activitiRecordDTO);
} }
//找到下一级审批人 //找到下一级审批人

View File

@ -253,6 +253,16 @@ public class DataEntryEngineModelServiceImpl implements DataEntryEngineModelServ
DataEntryEngineModelPojo modelPojo = new DataEntryEngineModelPojo(); DataEntryEngineModelPojo modelPojo = new DataEntryEngineModelPojo();
BeanUtils.copyProperties(request, modelPojo, "status"); BeanUtils.copyProperties(request, modelPojo, "status");
List<ResponsiblePerson> personPojos = responsiblePerService.selectByDepName(request.getDepartment()); 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)) { // 去掉责任人 if (ObjectUtils.isEmpty(personPojos)) {
// throw new ExcelImportException( // throw new ExcelImportException(
// String.format("请检查该部门是否有责任人,部门:%s", request.getDepartment()) // String.format("请检查该部门是否有责任人,部门:%s", request.getDepartment())

View File

@ -171,10 +171,9 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
public Map<String, List<EngineParamDetailDTO>> selectValueByMoreParam(EngineParamDetailRequest engineParamDetailRequest) { public Map<String, List<EngineParamDetailDTO>> selectValueByMoreParam(EngineParamDetailRequest engineParamDetailRequest) {
String engineModelID = engineParamDetailRequest.getEngineModelID(); 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("传入参数为空,请检查"); throw new RuntimeException("传入参数为空,请检查");
} }
List<EngineParamDetailPojo> detailPojos = new ArrayList<>(); List<EngineParamDetailPojo> detailPojos = new ArrayList<>();
@ -189,79 +188,51 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
if (ObjectUtils.isNotEmpty(versionStatus)) { if (ObjectUtils.isNotEmpty(versionStatus)) {
code = ParamValueVersionEnum.getByDesc(versionStatus).getCode(); code = ParamValueVersionEnum.getByDesc(versionStatus).getCode();
} }
for (String subsystemType : subsystemTypes) {
if (subsystemType.split("-").length != 2) {
throw new RuntimeException("查询条件异常,需子系统-类型");
}
String subsystem = subsystemType.split("-")[0];
String type = subsystemType.split("-")[1];
//若传入填写人则查询填写人需要填写的参数 //若传入填写人则查询填写人需要填写的参数
if (ObjectUtils.isNotEmpty(filledById)) { if (ObjectUtils.isNotEmpty(filledById)) {
detailPojos = sw.buildFromDatasource("xdap_app_223770822127386625") detailPojos.addAll(sw.buildFromDatasource("xdap_app_223770822127386625")
.eq("filled_by", filledById) .eq("filled_by", filledById)
.eq("engine_model_id", engineModelID) .eq("engine_model_id", engineModelID)
.eq("version_status", code) .eq("version_status", code)
.in("subsystem_name", subsystemNames) .eq("subsystem_name", subsystem)
.in("parameter_type", parameterTypes) .eq("parameter_type", type)
.doQuery(EngineParamDetailPojo.class); .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());
}
} else if (ObjectUtils.isNotEmpty(resId)) { } else if (ObjectUtils.isNotEmpty(resId)) {
//若传入责任人则查询责任人需要分发的参数 //若传入责任人则查询责任人需要分发的参数
detailPojos = sw.buildFromDatasource("xdap_app_223770822127386625") detailPojos.addAll(sw.buildFromDatasource("xdap_app_223770822127386625")
.eq("engine_model_id", engineModelID) .eq("engine_model_id", engineModelID)
.eq("responsible_person_id", resId) .eq("responsible_person_id", resId)
.eq("version_status", code) .eq("version_status", code)
.in("subsystem_name", subsystemNames) .eq("subsystem_name", subsystem)
.in("parameter_type", parameterTypes) .eq("parameter_type", type)
.doQuery(EngineParamDetailPojo.class); .doQuery(EngineParamDetailPojo.class));
//若传入版本则查询该版本否则查询最新版本 } else {
if (ObjectUtils.isNotEmpty(engineParamDetailRequest.getMajorVersion()) && engineParamDetailRequest.getMajorVersion() != 0) { detailPojos.addAll(sw.buildFromDatasource("xdap_app_223770822127386625")
detailPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
.eq("engine_model_id", engineModelID) .eq("engine_model_id", engineModelID)
.eq("major_version", engineParamDetailRequest.getMajorVersion()) .eq("version_status", code)
.in("subsystem_name", subsystemNames) .eq("subsystem_name", subsystem)
.in("parameter_type", parameterTypes) .eq("parameter_type", type)
.doQuery(EngineParamDetailPojo.class); .doQuery(EngineParamDetailPojo.class));
}
}
if (ObjectUtils.isNotEmpty(engineParamDetailRequest.getMajorVersion()) && engineParamDetailRequest.getMajorVersion() != 0) {
detailPojos = detailPojos.stream() detailPojos = detailPojos.stream()
.filter(x -> engineParamDetailRequest.getMajorVersion() .filter(x -> engineParamDetailRequest.getMajorVersion()
.equals(x.getMajorVersion())).collect(Collectors.toList()); .equals(x.getMajorVersion())).collect(Collectors.toList());
} else { } else {
detailPojos = 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(); EngineParamDetailPojo engineParamDetailPojo = detailPojos.stream().max(Comparator.comparingInt(x -> x.getMajorVersion())).get();
detailPojos = detailPojos.stream() detailPojos = detailPojos.stream()
.filter(x -> engineParamDetailPojo.getMajorVersion() .filter(x -> engineParamDetailPojo.getMajorVersion()
.equals(x.getMajorVersion())).collect(Collectors.toList()); .equals(x.getMajorVersion())).collect(Collectors.toList());
} }
} 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());
}
}
//pojo转换dto填写人Id转换为名称 //pojo转换dto填写人Id转换为名称
log.info("找到数据{}条", detailPojos.size()); log.info("找到数据{}条", detailPojos.size());
for (EngineParamDetailPojo detailPojo : detailPojos) { for (EngineParamDetailPojo detailPojo : detailPojos) {
@ -583,7 +554,7 @@ public class EngineParamDetailServiceImpl implements EngineParamDetailService {
List<XdapUsers> xdapUsersPojos = new ArrayList<>(); List<XdapUsers> xdapUsersPojos = new ArrayList<>();
List<ResponsiblePerson> personPojos = responsiblePerService.selectBysubSystemDept(subSystem, dept); List<ResponsiblePerson> personPojos = responsiblePerService.selectBysubSystemDept(subSystem, dept);
if (ObjectUtils.isEmpty(personPojos)) { if (ObjectUtils.isEmpty(personPojos)) {
throw new RuntimeException("该子系统和部门没有查找到相关人子系统:"+subSystem+",部门:"+dept); throw new RuntimeException("该子系统和部门没有查找到相关人子系统:" + subSystem + ",部门:" + dept);
} }
try { try {
List<ResponsiblePerson> collected = personPojos.stream().filter(x -> x.getPersonLevel() == type).collect(Collectors.toList()); List<ResponsiblePerson> collected = personPojos.stream().filter(x -> x.getPersonLevel() == type).collect(Collectors.toList());

View File

@ -44,15 +44,15 @@ public class ModelMenuPermissionServiceImpl implements ModelMenuPermissionServic
} }
for (ModelMenuDictionaryPojo pojo : permissionPojos) { for (ModelMenuDictionaryPojo pojo : permissionPojos) {
String parentName = pojo.getParentName(); String parentId = pojo.getParentId();
MenuListView currentNode = nodeMap.get(pojo.getId()); MenuListView currentNode = nodeMap.get(pojo.getId());
if (ObjectUtils.isEmpty(parentName) || !nodeMap.containsKey(parentName)) { if (ObjectUtils.isEmpty(parentId) || !nodeMap.containsKey(parentId)) {
// 根节点 // 根节点
views.add(currentNode); views.add(currentNode);
} else { } else {
// 子节点添加到父节点 // 子节点添加到父节点
MenuListView parentNode = nodeMap.get(parentName); MenuListView parentNode = nodeMap.get(parentId);
if (parentNode.getListViews() == null) { if (parentNode.getListViews() == null) {
parentNode.setListViews(new ArrayList<>()); parentNode.setListViews(new ArrayList<>());
} }

View File

@ -114,6 +114,7 @@ public class ModelRoleServiceImpl implements ModelRoleService {
pojo.setPerId(id); pojo.setPerId(id);
pojo.setCreationDate(new Date()); pojo.setCreationDate(new Date());
pojo.setCreatedBy(request.getUserId()); pojo.setCreatedBy(request.getUserId());
pojo.setIsEnable(1);
businessDatabase.getBusinessDatabase() businessDatabase.getBusinessDatabase()
.doInsert(pojo); .doInsert(pojo);
} }
@ -124,7 +125,11 @@ public class ModelRoleServiceImpl implements ModelRoleService {
modelRolesPojo.setLastUpdatedBy(userID); modelRolesPojo.setLastUpdatedBy(userID);
modelRolesPojo.setLastUpdateDate(new Date()); modelRolesPojo.setLastUpdateDate(new Date());
businessDatabase.getBusinessDatabase() 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 @Override
@ -152,6 +157,7 @@ public class ModelRoleServiceImpl implements ModelRoleService {
ArrayList<MenuParamView> menuParamViews = new ArrayList<>(); ArrayList<MenuParamView> menuParamViews = new ArrayList<>();
List<ModelRolePermissionPojo> role = businessDatabase.getBusinessDatabase() List<ModelRolePermissionPojo> role = businessDatabase.getBusinessDatabase()
.eq("role_id", roleID) .eq("role_id", roleID)
.eq("is_enable", 1)
.doQuery(ModelRolePermissionPojo.class); .doQuery(ModelRolePermissionPojo.class);
List<String> perids = role.stream().map(x -> x.getPerId()).distinct().collect(Collectors.toList()); List<String> perids = role.stream().map(x -> x.getPerId()).distinct().collect(Collectors.toList());
if (ObjectUtils.isEmpty(role)) { if (ObjectUtils.isEmpty(role)) {