Merge remote-tracking branch 'origin/master'
| | |
| | | @Data |
| | | //å¯¼åº |
| | | public class ProcessReportDto extends ProcessReport { |
| | | @Schema(description = "éæ ·æ¥æ") |
| | | private java.time.LocalDate sampleDate; |
| | | |
| | | private List<Integer> ids; |
| | | |
| | |
| | | cpr.update_user, |
| | | cpr.update_time, |
| | | cpr.inspection_order_id, |
| | | io.sample_date, |
| | | cpr.receive_date, |
| | | cpr.receive_user, |
| | | u1.name sendUserName |
| | |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | order by A.send_time desc, A.id desc |
| | | order by (A.sample_date IS NULL) asc, A.sample_date desc, A.inspection_order_id desc, A.id desc |
| | | </select> |
| | | <select id="exportProcessReport" resultType="com.ruoyi.process.dto.ProcessReportDto"> |
| | | select ROW_NUMBER() OVER (ORDER BY cpr.id) AS indexs, |
| | |
| | | import com.ruoyi.inspect.pojo.InsProduct; |
| | | import com.ruoyi.inspect.pojo.InsSample; |
| | | import com.ruoyi.inspect.service.InsOrderService; |
| | | import com.ruoyi.inspect.service.InsOrderDeletionService; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.inspect.service.InsOrderTemplateService; |
| | | import com.ruoyi.inspect.service.InsProductService; |
| | | import com.ruoyi.inspect.service.InsSampleService; |
| | |
| | | public class InsOrderController { |
| | | |
| | | private InsOrderService insOrderService; |
| | | |
| | | private InsOrderDeletionService insOrderDeletionService; |
| | | |
| | | private InsSampleService insSampleService; |
| | | |
| | |
| | | return Result.success(insOrderService.updateInsOrder(insOrderUpdateDto)); |
| | | } |
| | | |
| | | @Operation(summary = "å é¤éå订å") |
| | | @Operation(summary = "å é¤å§æååå
¨é¨å
³èè®°å½") |
| | | @PreAuthorize("@ss.hasPermi('delete:insOrder')") |
| | | @Log(title = "å§æååå
³èè®°å½", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/delInsOrder") |
| | | public Result<?> delInsOrder(Integer insOrderId) { |
| | | // æ¥è¯¢è®¢å |
| | | InsOrder order = insOrderService.getById(insOrderId); |
| | | if (!(order.getState().equals(2) || order.getState().equals(3))) { |
| | | throw new ErrorException("åªæéå订åæè½å é¤"); |
| | | } |
| | | |
| | | return Result.success(insOrderService.removeById(insOrderId)); |
| | | public Result<?> delInsOrder(@RequestParam Integer insOrderId) { |
| | | return Result.success(insOrderDeletionService.deleteOrder(insOrderId)); |
| | | } |
| | | |
| | | @Operation(summary = "æåæ ç¾æå°") |
| | |
| | | |
| | | @Data |
| | | public class ReportPageDto extends InsReport implements Serializable { |
| | | @Schema(description = "éæ ·æ¥æ") |
| | | private java.time.LocalDate sampleDate; |
| | | |
| | | @Schema(description = "å§æç¼å·") |
| | | private String entrustCode; |
| | |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | public class SampleReceiptPageDto { |
| | | @Schema(description = "éæ ·æ¥æ") |
| | | private java.time.LocalDate sampleDate; |
| | | |
| | | @Schema(description = "æ ·åæ¥æ¶è®°å½ID") |
| | | private Integer receiptId; |
| | |
| | | private String sealIds; |
| | | private String sealNames; |
| | | private String projectName; |
| | | @TableField(exist = false) |
| | | @Schema(description = "éæ ·æ¥æ") |
| | | private java.time.LocalDate sampleDate; |
| | | private Integer useUserId; |
| | | private String useUserName; |
| | | private Integer copies; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspect.service; |
| | | |
| | | import com.ruoyi.framework.exception.ErrorException; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * å é¤å§ææ¥æçä¸å¡è®°å½ï¼æ åãæ¨¡æ¿ã设å¤ãç¨æ·çå
Œ
±èµæä¸å±äºå§æã |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class InsOrderDeletionService { |
| | | |
| | | private final NamedParameterJdbcTemplate jdbc; |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int deleteOrder(Integer orderId) { |
| | | if (orderId == null || orderId <= 0) { |
| | | throw new ErrorException("è¯·éæ©è¦å é¤çå§æå"); |
| | | } |
| | | List<Map<String, Object>> orders = jdbc.queryForList( |
| | | "SELECT type_source, ifs_inventory_id FROM ins_order WHERE id = :id FOR UPDATE", |
| | | Collections.singletonMap("id", orderId)); |
| | | if (orders.isEmpty()) { |
| | | throw new ErrorException("å§æåä¸åå¨æå·²è¢«å é¤"); |
| | | } |
| | | Map<String, Object> order = orders.get(0); |
| | | Object source = order.get("type_source"); |
| | | Object inventoryId = order.get("ifs_inventory_id"); |
| | | if ((source instanceof Number && ((Number) source).intValue() == 1) |
| | | || (inventoryId != null && !inventoryId.toString().trim().isEmpty())) { |
| | | throw new ErrorException("æ¤å
¥å£ä»
å
许å é¤å§æä¸åä¸çå§æå"); |
| | | } |
| | | |
| | | List<Long> orderIds = Collections.singletonList(orderId.longValue()); |
| | | List<Long> sampleIds = ids("ins_sample", "id", "ins_order_id", orderIds); |
| | | List<Long> productIds = ids("ins_product", "id", "ins_sample_id", sampleIds); |
| | | List<Long> reportIds = ids("ins_report", "id", "ins_order_id", orderIds); |
| | | List<Long> inspectionIds = ids("cnas_inspection_order", "inspection_order_id", "ins_order_id", orderIds); |
| | | List<Long> processSampleIds = ids("cnas_process_sample", "id", "inspection_order_id", inspectionIds); |
| | | List<Long> satisfactionIds = ids("cnas_client_satisfaction", "client_satisfaction_id", "order_id", orderIds); |
| | | List<Long> verifyIds = ids("ins_order_factory_verify", "factory_verify_id", "ins_order_id", orderIds); |
| | | List<Long> warningIds = ids("ins_product_deviation_warning", "deviation_warning_id", "ins_order_id", orderIds); |
| | | List<Long> evaluateIds = ids("cnas_quality_monitor_details_evaluate", "details_evaluate_id", "ins_order_id", orderIds); |
| | | List<Long> retestIds = ids("ins_unqualified_retest_product", "id", "ins_product_id", productIds); |
| | | List<Long> handlerIds = ids("ins_unqualified_handler", "id", "ins_order_id", orderIds); |
| | | |
| | | // å
å é¤å¤é¨ä¸å¡æ¨¡åä¸ç±æ¬å§æçæçè®°å½ï¼åå 餿£éªä¸»ä»è¡¨ã |
| | | delete("cnas_client_satisfaction_attachment", "client_satisfaction_id", satisfactionIds); |
| | | delete("cnas_client_satisfaction", "client_satisfaction_id", satisfactionIds); |
| | | delete("cnas_process_complain", "ins_report_id", reportIds); |
| | | delete("cnas_quality_monitor_details_evaluate_file", "details_evaluate_id", evaluateIds); |
| | | delete("cnas_quality_monitor_details_evaluate", "ins_order_id", orderIds); |
| | | delete("cnas_process_deal", "ins_sample_id", sampleIds); |
| | | delete("cnas_process_deal", "process_sample_id", processSampleIds); |
| | | // æ¥ååéè®°å½çåå²å段 inspection_order_id å®é
åå¨ ins_order.idã |
| | | delete("cnas_process_report", "inspection_order_id", orderIds); |
| | | delete("cnas_process_order_device", "inspection_order_id", inspectionIds); |
| | | delete("cnas_process_sample", "inspection_order_id", inspectionIds); |
| | | delete("cnas_inspection_order_detail", "inspection_order_id", inspectionIds); |
| | | delete("cnas_inspection_order", "inspection_order_id", inspectionIds); |
| | | |
| | | delete("auxiliary_output_working_hours", "order_id", orderIds); |
| | | delete("auxiliary_output_working_hours_temporary", "order_id", orderIds); |
| | | delete("auxiliary_output_working_hours", "sample_id", sampleIds); |
| | | delete("auxiliary_output_working_hours_temporary", "sample_id", sampleIds); |
| | | delete("auxiliary_output_working_hours", "ins_product_id", productIds); |
| | | delete("auxiliary_output_working_hours_temporary", "ins_product_id", productIds); |
| | | |
| | | delete("ins_report_edit_session", "report_id", reportIds); |
| | | delete("ins_report_return_record", "report_id", reportIds); |
| | | delete("ins_report_return_record", "ins_order_id", orderIds); |
| | | delete("seal_usage_ledger", "report_id", reportIds); |
| | | delete("seal_usage_ledger", "ins_order_id", orderIds); |
| | | delete("ins_report", "ins_order_id", orderIds); |
| | | |
| | | delete("ins_product_deviation_warning_detail", "deviation_warning_id", warningIds); |
| | | delete("ins_product_deviation_warning_detail", "ins_order_id", orderIds); |
| | | delete("ins_product_deviation_warning_detail", "ins_product_id", productIds); |
| | | delete("ins_product_deviation_warning", "ins_order_id", orderIds); |
| | | delete("ins_product_deviation_warning", "ins_product_id", productIds); |
| | | delete("ins_order_rates", "ins_order_id", orderIds); |
| | | delete("ins_order_rates", "ins_product_id", productIds); |
| | | delete("ins_unqualified_retest_result", "retest_product_id", retestIds); |
| | | delete("ins_unqualified_retest_product", "ins_product_id", productIds); |
| | | delete("ins_unqualified_retest_product", "ins_sample_id", sampleIds); |
| | | delete("ins_unqualified_handler_file", "unqualified_id", handlerIds); |
| | | delete("ins_unqualified_handler", "ins_order_id", orderIds); |
| | | delete("ins_product_result", "ins_product_id", productIds); |
| | | delete("ins_product_user", "ins_product_id", productIds); |
| | | delete("ins_product", "ins_sample_id", sampleIds); |
| | | delete("warehouse_history", "ins_sample_id", sampleIds); |
| | | delete("ins_sample_receipt", "ins_order_id", orderIds); |
| | | // åå²å段å为 ins_sample_idï¼å®é
åå¨ ins_order.idï¼ä¸è½ææ ·å ID å é¤ã |
| | | delete("ins_sample_user", "ins_sample_id", orderIds); |
| | | delete("ins_sample", "ins_order_id", orderIds); |
| | | |
| | | delete("ins_order_factory_verify_item", "factory_verify_id", verifyIds); |
| | | delete("ins_order_factory_verify", "ins_order_id", orderIds); |
| | | delete("device_record", "ins_order_id", orderIds); |
| | | delete("ins_order_file", "ins_order_id", orderIds); |
| | | delete("ins_order_template_device", "ins_order_id", orderIds); |
| | | delete("ins_order_standard_template", "ins_order_id", orderIds); |
| | | delete("ins_order_state", "ins_order_id", orderIds); |
| | | return delete("ins_order", "id", orderIds); |
| | | } |
| | | |
| | | // 表åãååä»
æ¥èªæ¬ç±»åºå®çå
³èæ¸
åï¼ææä¸å¡ ID å使ç¨ç»å®åæ°ã |
| | | private List<Long> ids(String table, String key, String foreignKey, List<Long> parentIds) { |
| | | if (parentIds.isEmpty()) { |
| | | return Collections.emptyList(); |
| | | } |
| | | return jdbc.queryForList("SELECT " + key + " FROM " + table + " WHERE " + foreignKey + " IN (:ids)", |
| | | Collections.singletonMap("ids", parentIds), Long.class); |
| | | } |
| | | |
| | | private int delete(String table, String foreignKey, List<Long> parentIds) { |
| | | if (parentIds.isEmpty()) { |
| | | return 0; |
| | | } |
| | | return jdbc.update("DELETE FROM " + table + " WHERE " + foreignKey + " IN (:ids)", |
| | | Collections.singletonMap("ids", parentIds)); |
| | | } |
| | | } |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int addInsOrder(List<SampleProductDto> list, InsOrder insOrder) { |
| | | if (insOrder == null || insOrder.getSampleDate() == null) { |
| | | throw new ErrorException("éæ ·æ¥æä¸è½ä¸ºç©º"); |
| | | } |
| | | // todo: ä¸åå¤ææ½æ ·è®¡åçå¯ä¸æ§ |
| | | if (insOrder.getQuarterItemId() != null) { |
| | | Long quarterItemCount = insOrderMapper.selectCount(Wrappers.<InsOrder>lambdaQuery() |
| | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | public class InsOrderPlanVO{ |
| | | @Schema(description = "æ£éªä»»å¡å表信æ¯") |
| | | public class InsOrderPlanVO { |
| | | @Schema(description = "éæ ·æ¥æ") |
| | | private LocalDate sampleDate; |
| | | |
| | | |
| | | @Schema(description = "å§æåID") |
| | | private Integer id; |
| | | |
| | | @Schema(description = "å§æç¼å·") |
| | | private String entrustCode; |
| | | |
| | | @Schema(description = "任塿¥æº") |
| | | private String taskSource; |
| | | @Schema(description = "è´¨éçæ§è®¡åæç»ID") |
| | | private Integer qualityMonitorDetailsId; |
| | | @Schema(description = "çæ§é¡¹ç®") |
| | | private String monitorProject; |
| | | @Schema(description = "计åæé") |
| | | private String dueDate; |
| | | @Schema(description = "çæ§ç®ç") |
| | | private String monitorPurpose; |
| | | @Schema(description = "çæ§æ¹å¼") |
| | | private String monitorWay; |
| | | @Schema(description = "æ ·åè§æ ¼") |
| | | private String sampleSpec; |
| | | @Schema(description = "æ åç¼å·") |
| | | private String standardCode; |
| | | @Schema(description = "è¯ä»·äººID") |
| | | private Integer evaluatorUserId; |
| | | @Schema(description = "çæ§è®¡åæ¹å人ID") |
| | | private Integer planRatifyUserId; |
| | | @Schema(description = "è´¨éçæ§è¯ä»·ç¶æ") |
| | | private Integer evaluateStatus; |
| | | @Schema(description = "ææ¯æ åææ¬") |
| | | private String technicalStandardText; |
| | | |
| | | @Schema(description = "æ ·ååç§°") |
| | |
| | | @Schema(description = "夿 ¸äºº") |
| | | private String checkName; |
| | | |
| | | @Schema(description = "ç¨æ·ID") |
| | | private Integer userId; |
| | | |
| | | @Schema(description = "æ£éªå¼å§æ¶é´") |
| | |
| | | private String reportReturnSource; |
| | | |
| | | |
| | | @Schema(description = "åå®éªå®¤") |
| | | private String sonLaboratory; |
| | | |
| | | @Schema(description = "ä¸å人ID") |
| | | private Integer orderUserId; |
| | | |
| | | @Schema(description = "夿 ¸äººID") |
| | | private Integer verifyUser; |
| | | |
| | | @Schema(description = "ä¸åç±»å«") |
| | |
| | | AND io.laboratory=#{laboratory} |
| | | </if> |
| | | GROUP BY io.id,type |
| | | order by type desc,io.id desc |
| | | order by (io.sample_date is null) asc, io.sample_date desc, io.id desc |
| | | ) a |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | ORDER BY (a.sample_date IS NULL) ASC, a.sample_date DESC, a.id DESC |
| | | </select> |
| | | |
| | | <select id="selectInsOrderParameter" resultType="com.ruoyi.inspect.pojo.InsOrder"> |
| | |
| | | select |
| | | ir.*, |
| | | io.entrust_code, |
| | | io.sample_date, |
| | | u.name write_user_name, |
| | | u1.name ratify_user, |
| | | u2.name examine_user, |
| | |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | ORDER BY a.create_time DESC |
| | | ORDER BY (a.sample_date IS NULL) ASC, a.sample_date DESC, a.ins_order_id DESC, a.id DESC |
| | | </select> |
| | | <select id="getLaboratoryByName" resultType="java.lang.String"> |
| | | select s.address from seal s |
| | |
| | | io.entrust_code, |
| | | io.type, |
| | | io.appointed, |
| | | io.sample_date, |
| | | io.send_time, |
| | | io.order_type, |
| | | io.task_source, |
| | |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | | ORDER BY send_time desc |
| | | ORDER BY (A.sample_date IS NULL) ASC, A.sample_date DESC, A.id DESC, A.son_laboratory ASC |
| | | |
| | | </select> |
| | | |
| | |
| | | <mapper namespace="com.ruoyi.inspect.mapper.InsSampleReceiptMapper"> |
| | | <sql id="receiptColumns"> |
| | | r.id receipt_id, r.ins_order_id order_id, r.ins_sample_id sample_id, r.status, |
| | | COALESCE(NULLIF(io.sample_view, ''), isa.sample) AS sample_name, isa.sample_code, io.entrust_code, |
| | | COALESCE(NULLIF(io.sample_view, ''), isa.sample) AS sample_name, isa.sample_code, io.entrust_code, io.sample_date, |
| | | COALESCE(iost.method_standard, sm.code) method_standard, |
| | | ip.inspection_item, r.main_inspector_id, u.name main_inspector_name, |
| | | COALESCE(isa.remark, io.remark) remark, r.reject_remark, r.receive_time, |
| | |
| | | LIKE CONCAT('%', #{query.sampleName}, '%') |
| | | </if> |
| | | GROUP BY r.id |
| | | ORDER BY r.create_time DESC |
| | | ORDER BY (io.sample_date IS NULL) ASC, io.sample_date DESC, io.id DESC, r.id DESC |
| | | </select> |
| | | <select id="selectDetail" resultType="com.ruoyi.inspect.dto.SampleReceiptPageDto"> |
| | | SELECT <include refid="receiptColumns"/> |
| | |
| | | <sql id="LedgerColumns"> |
| | | ledger.id, ledger.report_id, ledger.report_code, ledger.ins_order_id, |
| | | ledger.use_time, ledger.seal_ids, ledger.seal_names, |
| | | COALESCE(io.sample_view, '') AS project_name, |
| | | COALESCE(io.sample_view, '') AS project_name, io.sample_date, |
| | | ledger.use_user_id, ledger.use_user_name, ledger.copies, ledger.version, |
| | | ledger.create_user, ledger.create_time, ledger.update_user, ledger.update_time |
| | | </sql> |
| | |
| | | LEFT JOIN ins_order io ON io.id = ledger.ins_order_id |
| | | WHERE 1 = 1 |
| | | <include refid="LedgerFilters"/> |
| | | ORDER BY ledger.use_time DESC, ledger.id DESC |
| | | ORDER BY (io.sample_date IS NULL) ASC, io.sample_date DESC, io.id DESC, ledger.id DESC |
| | | </select> |
| | | |
| | | <select id="selectForExport" resultType="com.ruoyi.inspect.pojo.SealUsageLedger"> |
| | |
| | | Set<String> roles = permissionService.getRolePermission(user); |
| | | // æééå |
| | | Set<String> permissions = permissionService.getMenuPermission(user); |
| | | if (!loginUser.getPermissions().equals(permissions)) |
| | | { |
| | | loginUser.setPermissions(permissions); |
| | | tokenService.refreshToken(loginUser); |
| | | } |
| | | // å³ä½¿æéå符串ç¸åï¼è§è²èº«ä»½åæ°æ®èå´ä¹å¯è½ååï¼éè¦ä¿åææ°è§è²å¿«ç
§ã |
| | | loginUser.setPermissions(permissions); |
| | | tokenService.refreshToken(loginUser); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("user", user); |
| | | ajax.put("roles", roles); |
| | |
| | | /** |
| | | * å 载对åºè§è²èåå表æ |
| | | */ |
| | | @GetMapping(value = "/roleMenuTreeselect/{roleId}") |
| | | public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) |
| | | @PreAuthorize("@ss.hasAnyPermi('system:role:add,system:role:edit')") |
| | | @GetMapping(value = {"/roleMenuTreeselect", "/roleMenuTreeselect/{roleId}"}) |
| | | public AjaxResult roleMenuTreeselect(@PathVariable(value = "roleId", required = false) Long roleId) |
| | | { |
| | | List<SysMenu> menus = menuService.selectMenuList(getUserId()); |
| | | List<SysMenu> menus = menuService.selectRoleMenuList(getUserId()); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId)); |
| | | ajax.put("checkedKeys", roleId == null ? java.util.Collections.emptyList() |
| | | : menuService.selectMenuListByRoleId(roleId)); |
| | | ajax.put("menus", menuService.buildMenuTreeSelect(menus)); |
| | | return ajax; |
| | | } |
| | |
| | | } |
| | | return toAjax(menuService.deleteMenuById(menuId)); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | List<SysRole> roles = user.getRoles(); |
| | | // ç»å½åçè§è²åé
å¯è½å·²æ¹åï¼ä¸è½ç»§ç»ä½¿ç¨ token ä¸çè§è²å¿«ç
§ã |
| | | List<SysRole> roles = roleService.selectAssignedRolesByUserId(user.getUserId()); |
| | | user.setRoles(roles); |
| | | if (!CollectionUtils.isEmpty(roles)) |
| | | { |
| | | // å¤è§è²è®¾ç½®permissions屿§ï¼ä»¥ä¾¿æ°æ®æéå¹é
æé |
| | |
| | | // 管çåæ¥ææææéï¼è·³è¿ |
| | | continue; |
| | | } |
| | | // å¤æè¯¥ç¨æ·æ¯å¦æ¥ææ¤è§è² |
| | | boolean previouslyHadRole = loginUser.getUser().getRoles() != null |
| | | && loginUser.getUser().getRoles().stream().anyMatch(r -> roleId.equals(r.getRoleId())); |
| | | // æé计ç®ä¼åæ¶è¯»åå½åè§è²å
³ç³»ï¼è¦çæ°å¢è§è²æªè¿å
¥æ§ token çæ
åµã |
| | | java.util.Set<String> permissions = permissionService.getMenuPermission(loginUser.getUser()); |
| | | boolean hasRole = loginUser.getUser().getRoles() != null |
| | | && loginUser.getUser().getRoles().stream().anyMatch(r -> roleId.equals(r.getRoleId())); |
| | | if (!hasRole) |
| | | if (!previouslyHadRole && !hasRole) |
| | | { |
| | | continue; |
| | | } |
| | | // å·æ°æéç¼å |
| | | loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser())); |
| | | loginUser.setPermissions(permissions); |
| | | refreshToken(loginUser); |
| | | log.info("è§è²[{}]æéåæ´ï¼å·²å·æ°å¨çº¿ç¨æ·[{}]çæéç¼å", roleId, loginUser.getUsername()); |
| | | } |
| | |
| | | */ |
| | | public List<SysMenu> selectMenuList(Long userId); |
| | | |
| | | /** è§è²ææä½¿ç¨çèåå表ï¼å
å«å§æä¸åå¯åé
çå 餿éã */ |
| | | public List<SysMenu> selectRoleMenuList(Long userId); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·æ¥è¯¢ç³»ç»èåå表 |
| | | * |
| | |
| | | */ |
| | | public List<SysRole> selectRolesByUserId(Long userId); |
| | | |
| | | /** æ¥è¯¢ç¨æ·å½åå®é
æ¥æçè§è²ï¼ä¸å
å«è§è²éæ©æ¡ä¸çæªéè§è²ã */ |
| | | public List<SysRole> selectAssignedRolesByUserId(Long userId); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·IDæ¥è¯¢è§è²æé |
| | | * |
| | |
| | | return selectMenuList(new SysMenu(), userId); |
| | | } |
| | | |
| | | @Override |
| | | public List<SysMenu> selectRoleMenuList(Long userId) |
| | | { |
| | | List<SysMenu> menus = new ArrayList<>(selectMenuList(userId)); |
| | | Set<Long> visibleIds = menus.stream().map(SysMenu::getMenuId).collect(Collectors.toSet()); |
| | | // è§è²ç®¡çåå¯åé
å§æåå 餿éï¼æ éå
æ¥æå é¤ä¸å¡æ°æ®çæéã |
| | | // ä»
å¨å·²æå§æä¸åç¶èåä¸è¡¥å
该æé®ï¼å
¶ä»èåä»éµå¾ªåæå¯è§èå´ã |
| | | for (SysMenu menu : menuMapper.selectMenuList(new SysMenu())) |
| | | { |
| | | if ("delete:insOrder".equals(menu.getPerms()) |
| | | && "F".equals(menu.getMenuType()) |
| | | && "0".equals(menu.getStatus()) |
| | | && visibleIds.contains(menu.getParentId()) |
| | | && visibleIds.add(menu.getMenuId())) |
| | | { |
| | | menus.add(menu); |
| | | } |
| | | } |
| | | return menus; |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç³»ç»èåå表 |
| | | * |
| | |
| | | return roles; |
| | | } |
| | | |
| | | @Override |
| | | public List<SysRole> selectAssignedRolesByUserId(Long userId) |
| | | { |
| | | return roleMapper.selectRolePermissionByUserId(userId); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·IDæ¥è¯¢æé |
| | | * |