Merge branch 'dev_New_pro' into dev_New_pro_玉山机械
| | |
| | | if (accountSubjectDto != null && accountSubjectDto.getStatus() != null) { |
| | | queryWrapper.eq(AccountSubject::getStatus, accountSubjectDto.getStatus()); |
| | | } |
| | | queryWrapper.orderByAsc(AccountSubject::getSubjectCode).orderByAsc(AccountSubject::getId); |
| | | queryWrapper.orderByDesc(AccountSubject::getSubjectCode).orderByDesc(AccountSubject::getId); |
| | | return queryWrapper; |
| | | } |
| | | |
| | |
| | | } |
| | | List<AccountSubject> sortedSubjects = new ArrayList<>(subjects); |
| | | sortedSubjects.sort(Comparator |
| | | .comparing(AccountSubject::getSubjectCode, Comparator.nullsLast(String::compareTo)) |
| | | .thenComparing(AccountSubject::getId, Comparator.nullsLast(Long::compareTo))); |
| | | .comparing(AccountSubject::getSubjectCode, Comparator.nullsFirst(String::compareTo)).reversed() |
| | | .thenComparing(AccountSubject::getId, Comparator.nullsFirst(Long::compareTo)).reversed()); |
| | | |
| | | Map<Long, AccountSubjectVo> subjectVoMap = new LinkedHashMap<>(); |
| | | for (AccountSubject subject : sortedSubjects) { |
| | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.aftersalesservice.service.AfterSalesServiceService; |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | |
| | | if(sysUser == null) throw new RuntimeException("å®¡æ ¸äººä¸åå¨"); |
| | | afterSalesServiceNewDto.setCheckNickName(sysUser.getNickName()); |
| | | if (StringUtils.isEmpty(afterSalesServiceNewDto.getAfterSalesServiceNo())) { |
| | | String string = OrderUtils.countAfterServiceTodayByCreateTime(afterSalesServiceMapper, "SH_"); |
| | | String string = OrderUtils.countAfterServiceTodayByCreateTime(afterSalesServiceMapper, "SH_", afterSalesServiceNewDto.getCreateTime() != null ? afterSalesServiceNewDto.getCreateTime() : LocalDateTime.now()); |
| | | afterSalesServiceNewDto.setAfterSalesServiceNo(string); |
| | | } |
| | | return this.save(afterSalesServiceNewDto); |
| | |
| | | public class FinancialIntentExecutor { |
| | | |
| | | private static final DateTimeFormatter DATE_FMT = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | private static final Pattern LIMIT_PATTERN = Pattern.compile("(å|æè¿)?\\s*(\\d{1,2})\\s*æ¡"); |
| | | private static final Pattern LIMIT_PATTERN = Pattern.compile("(?:å|æè¿|å±ç¤º|è¿å)?\\s*(\\d{1,2})\\s*(?:æ¡|个|å)"); |
| | | private static final Pattern DATE_PATTERN = Pattern.compile("(\\d{4}-\\d{2}-\\d{2})"); |
| | | private static final Pattern RELATIVE_DAY_PATTERN = Pattern.compile("(è¿|æè¿)?\\s*(\\d{1,3})\\s*天"); |
| | | private static final Pattern RELATIVE_DAY_PATTERN = Pattern.compile("(?:è¿|æè¿)\\s*(\\d{1,3})\\s*天"); |
| | | private static final Pattern FUTURE_MONTH_PATTERN = Pattern.compile("(?:æªæ¥|åç»|æ¥ä¸æ¥)\\s*(\\d{1,2})\\s*(?:个)?æ"); |
| | | |
| | | private final FinancialAgentTools financialAgentTools; |
| | | |
| | |
| | | String endDate = dateRange.endDate(); |
| | | String timeRange = dateRange.label(); |
| | | |
| | | if (containsAny(text, "ææ¬æ ¸ç®", "äº§åææ¬", "å·¥åºææ¬", "äººå·¥ææ¬", "ææ§", "æææè")) { |
| | | if (containsAny(text, "ææ¬æ ¸ç®", "äº§åææ¬", "å·¥åºææ¬", "äººå·¥ææ¬", "ææ§", "æææè", "ææ¬æé«")) { |
| | | return financialAgentTools.calculateIntelligentCost(memoryId, startDate, endDate, timeRange, keyword, limit); |
| | | } |
| | | if (containsAny(text, "婿¶¦åæ", "订å婿¶¦", "äºæè®¢å", "ä½å©æ¶¦", |
| | | "æèµé±å®¢æ·", "åªä¸ªå®¢æ·æèµé±", "å®¢æ·æèµé±", "婿¶¦æé«å®¢æ·", "婿¶¦è´¡ç®æé«å®¢æ·", "婿¶¦ä¸é")) { |
| | | if (containsAny(text, "婿¶¦åæ", "订å婿¶¦", "äºæè®¢å", "ä½å©æ¶¦", "æèµé±å®¢æ·", "åªä¸ªå®¢æ·æèµé±", |
| | | "å®¢æ·æèµé±", "婿¶¦æé«å®¢æ·", "婿¶¦è´¡ç®æé«", "婿¶¦ä¸é")) { |
| | | return financialAgentTools.analyzeOrderProfit(memoryId, startDate, endDate, timeRange, keyword, limit); |
| | | } |
| | | if (containsAny(text, "åºåèµé", "åºå积å", "åæ»åºå", "èµéå ç¨", "å¨è½¬ç", "åºåå¨è½¬")) { |
| | | return financialAgentTools.analyzeInventoryCapital(memoryId, startDate, endDate, timeRange, keyword, limit); |
| | | } |
| | | if (containsAny(text, "ç°éæµ", "忬¾é£é©", "仿¬¾åå", "èµé缺å£", "åºæ¶", "åºä»", "忬¾é¢æµ")) { |
| | | return financialAgentTools.forecastCashFlow(memoryId, startDate, endDate, timeRange, limit); |
| | | return financialAgentTools.forecastCashFlow(memoryId, startDate, endDate, timeRange, extractForecastMonths(text)); |
| | | } |
| | | if (containsAny(text, "å¼å¸¸é¢è¦", "ç»è¥å¼å¸¸", "é£é©é¢è¦", "ææ¬å¼å¸¸", "婿¶¦å¼å¸¸", "忬¾å¼å¸¸", "订åé£é©")) { |
| | | return financialAgentTools.detectBusinessAnomalies(memoryId, startDate, endDate, timeRange, limit); |
| | |
| | | |
| | | private String tryExecuteQuickPrompt(String memoryId, String text) { |
| | | String normalized = normalizeForMatch(text); |
| | | if ("çææ¬å¨ç»è¥å¨æ¥å©æ¶¦ä¸ç°éæµ".equals(normalized) || "çææ¬å¨ç»è¥å¨æ¥".equals(normalized) || "çæå¨æ¥".equals(normalized)) { |
| | | DateRange range = weekRange(); |
| | | return financialAgentTools.generateOperationReport(memoryId, range.startDate(), range.endDate(), range.label(), "weekly"); |
| | | } |
| | | if ("åææ¬æå©æ¶¦ä¸éåå ".equals(normalized)) { |
| | | DateRange range = monthRange(); |
| | | return financialAgentTools.analyzeOrderProfit(memoryId, range.startDate(), range.endDate(), range.label(), null, null); |
| | | } |
| | | if ("è¿30天åªä¸ªå®¢æ·å©æ¶¦è´¡ç®æé«".equals(normalized)) { |
| | | DateRange range = recentDaysRange(30); |
| | | return financialAgentTools.analyzeOrderProfit(memoryId, range.startDate(), range.endDate(), range.label(), null, null); |
| | | } |
| | | if ("æ¥çæ¬æç»è¥é©¾é©¶è±".equals(normalized) || "æ¥çç»è¥é©¾é©¶è±".equals(normalized)) { |
| | | DateRange range = monthRange(); |
| | | return financialAgentTools.getBusinessCockpit(memoryId, range.startDate(), range.endDate(), range.label()); |
| | | } |
| | | if ("æ¥è¯¢è¿30å¤©äºæè®¢å".equals(normalized) || "åªä¸ªè®¢åäºæ".equals(normalized)) { |
| | | if ("æ¥è¯¢è¿30å¤©äºæè®¢å".equals(normalized)) { |
| | | DateRange range = recentDaysRange(30); |
| | | return financialAgentTools.analyzeOrderProfit(memoryId, range.startDate(), range.endDate(), range.label(), null, 20); |
| | | return financialAgentTools.analyzeOrderProfit(memoryId, range.startDate(), range.endDate(), range.label(), null, null); |
| | | } |
| | | if ("çææ¬å¨ç»è¥å¨æ¥".equals(normalized) || "çæå¨æ¥".equals(normalized)) { |
| | | DateRange range = weekRange(); |
| | | return financialAgentTools.generateOperationReport(memoryId, range.startDate(), range.endDate(), range.label(), "weekly"); |
| | | if ("åæè¿30天åºåèµéå ç¨".equals(normalized)) { |
| | | DateRange range = recentDaysRange(30); |
| | | return financialAgentTools.analyzeInventoryCapital(memoryId, range.startDate(), range.endDate(), range.label(), null, null); |
| | | } |
| | | if ("为ä»ä¹å©æ¶¦ä¸é".equals(normalized)) { |
| | | DateRange range = monthRange(); |
| | | return financialAgentTools.analyzeOrderProfit(memoryId, range.startDate(), range.endDate(), range.label(), null, 20); |
| | | if ("颿µæªæ¥3个æç°éæµ".equals(normalized)) { |
| | | return financialAgentTools.forecastCashFlow(memoryId, null, null, null, 3); |
| | | } |
| | | if ("åªä¸ªå®¢æ·æèµé±".equals(normalized) |
| | | || "æè¿åªä¸ªå®¢æ·æèµé±".equals(normalized) |
| | | || "æ¬æåªä¸ªå®¢æ·æèµé±".equals(normalized) |
| | | || "è¿30天åªä¸ªå®¢æ·æèµé±".equals(normalized) |
| | | || "åªä¸ªå®¢æ·å©æ¶¦æé«".equals(normalized) |
| | | || "åªä¸ªå®¢æ·å©æ¶¦è´¡ç®æé«".equals(normalized)) { |
| | | DateRange range = extractDateRange(text); |
| | | return financialAgentTools.analyzeOrderProfit(memoryId, range.startDate(), range.endDate(), range.label(), null, 20); |
| | | if ("åªä¸ªå·¥åºææ¬æé«".equals(normalized)) { |
| | | return financialAgentTools.calculateIntelligentCost(memoryId, null, null, null, null, null); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | |
| | | private Integer extractLimit(String text) { |
| | | Matcher matcher = LIMIT_PATTERN.matcher(text); |
| | | return matcher.find() ? Integer.parseInt(matcher.group(2)) : 10; |
| | | return matcher.find() ? Integer.parseInt(matcher.group(1)) : null; |
| | | } |
| | | |
| | | private Integer extractForecastMonths(String text) { |
| | | Matcher matcher = FUTURE_MONTH_PATTERN.matcher(text); |
| | | return matcher.find() ? Integer.parseInt(matcher.group(1)) : null; |
| | | } |
| | | |
| | | private DateRange extractDateRange(String text) { |
| | |
| | | if (text.contains("䏿")) { |
| | | return lastMonthRange(); |
| | | } |
| | | if (text.contains("æ¬å¹´") || text.contains("ä»å¹´")) { |
| | | if (text.contains("ä»å¹´") || text.contains("æ¬å¹´")) { |
| | | return yearRange(); |
| | | } |
| | | if (text.contains("æ¬å¨")) { |
| | |
| | | } |
| | | Matcher relativeDayMatcher = RELATIVE_DAY_PATTERN.matcher(text); |
| | | if (relativeDayMatcher.find()) { |
| | | int days = Integer.parseInt(relativeDayMatcher.group(2)); |
| | | int days = Integer.parseInt(relativeDayMatcher.group(1)); |
| | | return recentDaysRange(days); |
| | | } |
| | | return new DateRange(null, null, "è¿30天"); |
| | | return new DateRange(null, null, null); |
| | | } |
| | | |
| | | private DateRange buildDateRange(String start, String end, String label) { |
| | | LocalDate startDate = parseDate(start); |
| | | LocalDate endDate = parseDate(end); |
| | | if (startDate == null || endDate == null) { |
| | | return new DateRange(null, null, "è¿30天"); |
| | | return new DateRange(null, null, null); |
| | | } |
| | | if (startDate.isAfter(endDate)) { |
| | | LocalDate temp = startDate; |
| | |
| | | if (!StringUtils.hasText(text)) { |
| | | return ""; |
| | | } |
| | | return text.replace("ï¼", "") |
| | | return text.replace("ï¼", "") |
| | | .replace("ï¼", "") |
| | | .replace("(", "") |
| | | .replace(")", "") |
| | | .replace("ï¼", "") |
| | | .replace(",", "") |
| | | .replace("ã", "") |
| | | .replace(".", "") |
| | |
| | | |
| | | private String extractKeyword(String text) { |
| | | String cleaned = text |
| | | .replaceAll("\\d{4}-\\d{2}-\\d{2}", "") |
| | | .replaceAll("(?:è¿|æè¿)\\s*\\d{1,3}\\s*天", "") |
| | | .replaceAll("(?:å|æè¿|å±ç¤º|è¿å)?\\s*\\d{1,2}\\s*(?:æ¡|个|å)", "") |
| | | .replace("æ¥è¯¢", "") |
| | | .replace("æ¥ç", "") |
| | | .replace("çä¸", "") |
| | | .replace("çç", "") |
| | | .replace("帮æ", "") |
| | | .replace("请", "") |
| | | .replace("ä¸ä¸", "") |
| | | .replace("ä¸ä¸ª", "") |
| | | .replace("为ä»ä¹", "") |
| | | .replace("åªä¸ªå®¢æ·æèµé±", "") |
| | | .replace("æè¿åªä¸ªå®¢æ·æèµé±", "") |
| | |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.time.Duration; |
| | | import java.time.Instant; |
| | | import java.util.Map; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | |
| | | public class AiSessionUserContext { |
| | | |
| | | private final Map<String, LoginUser> loginUserByMemoryId = new ConcurrentHashMap<>(); |
| | | private final Map<String, Instant> lastAccessTimeByMemoryId = new ConcurrentHashMap<>(); |
| | | private static final Duration SESSION_TIMEOUT = Duration.ofHours(24); |
| | | |
| | | public void bind(String memoryId, LoginUser loginUser) { |
| | | if (!StringUtils.hasText(memoryId) || loginUser == null) { |
| | | return; |
| | | } |
| | | loginUserByMemoryId.put(memoryId, loginUser); |
| | | lastAccessTimeByMemoryId.put(memoryId, Instant.now()); |
| | | } |
| | | |
| | | public LoginUser get(String memoryId) { |
| | | if (!StringUtils.hasText(memoryId)) { |
| | | return null; |
| | | } |
| | | if (isExpired(memoryId)) { |
| | | remove(memoryId); |
| | | return null; |
| | | } |
| | | lastAccessTimeByMemoryId.put(memoryId, Instant.now()); |
| | | return loginUserByMemoryId.get(memoryId); |
| | | } |
| | | |
| | |
| | | return; |
| | | } |
| | | loginUserByMemoryId.remove(memoryId); |
| | | lastAccessTimeByMemoryId.remove(memoryId); |
| | | } |
| | | |
| | | public void cleanExpiredSessions() { |
| | | Instant now = Instant.now(); |
| | | lastAccessTimeByMemoryId.entrySet().removeIf(entry -> { |
| | | boolean expired = Duration.between(entry.getValue(), now).compareTo(SESSION_TIMEOUT) > 0; |
| | | if (expired) { |
| | | loginUserByMemoryId.remove(entry.getKey()); |
| | | } |
| | | return expired; |
| | | }); |
| | | } |
| | | |
| | | private boolean isExpired(String memoryId) { |
| | | Instant lastAccess = lastAccessTimeByMemoryId.get(memoryId); |
| | | if (lastAccess == null) { |
| | | return true; |
| | | } |
| | | return Duration.between(lastAccess, Instant.now()).compareTo(SESSION_TIMEOUT) > 0; |
| | | } |
| | | } |
| | |
| | | return Flux.just(directResponse); |
| | | } |
| | | |
| | | if (isBusinessDataIntent(userMessage)) { |
| | | String noGuessResponse = "æªè¯å«å°å¯æ§è¡çæ°æ®æ¥è¯¢æ¡ä»¶ã为ä¿è¯ç»æåç¡®ï¼å½åä¸ä¼æ¨æµæç¼é æ°æ®ï¼è¯·è¡¥å
æç¡®æ¶é´èå´ã客æ·ãä¾åºåæåå·ååæ¥è¯¢ã"; |
| | | mongoChatMemoryStore.appendMessages( |
| | | memoryId, |
| | | List.of(UserMessage.from(userMessage), AiMessage.from(noGuessResponse)) |
| | | ); |
| | | aiChatSessionService.refreshSessionStats(memoryId, loginUser); |
| | | return Flux.just(noGuessResponse); |
| | | } |
| | | |
| | | return financialAgent.chat(memoryId, userMessage, currentDateForPrompt()) |
| | | .doOnComplete(() -> aiChatSessionService.refreshSessionStats(memoryId, loginUser)) |
| | | .doOnError(ex -> aiChatSessionService.refreshSessionStats(memoryId, loginUser)); |
| | |
| | | private String currentDateForPrompt() { |
| | | return LocalDate.now(CHINA_ZONE_ID).format(CURRENT_DATE_FMT); |
| | | } |
| | | |
| | | private boolean isBusinessDataIntent(String message) { |
| | | if (!StringUtils.hasText(message)) { |
| | | return false; |
| | | } |
| | | String text = message.trim(); |
| | | return containsAny(text, |
| | | "æ¥è¯¢", "æ¥ç", "ç»è®¡", "åæ", "建议", "ææ¬æ ¸ç®", "äº§åææ¬", "å·¥åºææ¬", |
| | | "订å婿¶¦", "äºæè®¢å", "ä½å©æ¶¦", "åºåèµé", "åºå积å", "åæ»åºå", |
| | | "ç°éæµ", "忬¾é£é©", "仿¬¾åå", "èµé缺å£", "åºæ¶", "åºä»", |
| | | "å¼å¸¸é¢è¦", "ç»è¥å¼å¸¸", "é£é©é¢è¦", "驾驶è±", "ç»è¥çæ¿", "ç»è¥æ»è§", |
| | | "æ¥æ¥", "卿¥", "ç»è¥æ¥å", "åææ¥å", "ä¸è´¢èå", "å£å¾", "ææ è§£é"); |
| | | } |
| | | |
| | | private boolean containsAny(String text, String... keywords) { |
| | | for (String keyword : keywords) { |
| | | if (text.contains(keyword)) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.ai.schedule; |
| | | |
| | | import com.ruoyi.ai.context.AiSessionUserContext; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | public class AiSessionCleanupTask { |
| | | |
| | | private final AiSessionUserContext aiSessionUserContext; |
| | | |
| | | public AiSessionCleanupTask(AiSessionUserContext aiSessionUserContext) { |
| | | this.aiSessionUserContext = aiSessionUserContext; |
| | | } |
| | | |
| | | @Scheduled(cron = "0 0 2 * * ?") |
| | | public void cleanupExpiredSessions() { |
| | | try { |
| | | aiSessionUserContext.cleanExpiredSessions(); |
| | | } catch (Exception e) { |
| | | System.err.println("æ¸
çè¿æAIä¼è¯å¤±è´¥: " + e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.YearMonth; |
| | | import java.time.ZoneId; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.time.temporal.ChronoUnit; |
| | | import java.util.ArrayList; |
| | |
| | | |
| | | private static final int DEFAULT_LIMIT = 10; |
| | | private static final int MAX_LIMIT = 20; |
| | | private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); |
| | | private static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | private final ApproveProcessMapper approveProcessMapper; |
| | |
| | | } |
| | | |
| | | private String formatDate(Date value) { |
| | | return value == null ? "" : DATE_FORMAT.format(value); |
| | | if (value == null) { |
| | | return ""; |
| | | } |
| | | return value.toInstant().atZone(ZoneId.systemDefault()).toLocalDate().format(DATE_FORMATTER); |
| | | } |
| | | |
| | | private long countByStatus(List<ApproveProcess> processes, int status) { |
| | |
| | | |
| | | private Date parseDate(String dateText) { |
| | | try { |
| | | return DATE_FORMAT.parse(dateText); |
| | | } catch (ParseException e) { |
| | | LocalDate localDate = LocalDate.parse(dateText, DATE_FORMATTER); |
| | | return Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant()); |
| | | } catch (Exception e) { |
| | | throw new IllegalArgumentException("æ¥ææ ¼å¼å¿
é¡»æ¯ yyyy-MM-dd"); |
| | | } |
| | | } |
| | |
| | | private static final BigDecimal ONE_HUNDRED = new BigDecimal("100"); |
| | | private static final int DEFAULT_LIMIT = 10; |
| | | private static final int MAX_LIMIT = 50; |
| | | private static final BigDecimal DEFAULT_FALLBACK_MATERIAL_COST_RATE = new BigDecimal("0.65"); |
| | | |
| | | private static final BigDecimal DEFAULT_FALLBACK_MATERIAL_COST_RATE = new BigDecimal("0.60"); |
| | | private static final BigDecimal DEFAULT_LABOR_COST_RATE = new BigDecimal("0.15"); |
| | | private static final BigDecimal DEFAULT_OVERHEAD_COST_RATE = new BigDecimal("0.10"); |
| | | |
| | | private static final BigDecimal SME_RECEIVABLE_RISK_THRESHOLD = new BigDecimal("500000"); |
| | | private static final BigDecimal SME_INVENTORY_RISK_THRESHOLD = new BigDecimal("1000000"); |
| | | private static final BigDecimal SME_PROFIT_WARNING_RATE = new BigDecimal("0.08"); |
| | | |
| | | private final SalesLedgerMapper salesLedgerMapper; |
| | | private final SalesLedgerProductMapper salesLedgerProductMapper; |
| | |
| | | @P(value = "å
³é®è¯ï¼å¯å¹é
ååå·/客æ·/项ç®", required = false) String keyword, |
| | | @P(value = "è¿åæ¡æ°ï¼é»è®¤10ï¼æå¤§50", required = false) Integer limit) { |
| | | LoginUser loginUser = currentLoginUser(memoryId); |
| | | if (loginUser == null) { |
| | | return jsonResponse(false, "financial_cost_accounting", "ç¨æ·ä¿¡æ¯è·å失败", Map.of(), Map.of(), Map.of()); |
| | | } |
| | | |
| | | DateRange range = resolveDateRange(startDate, endDate, timeRange, "è¿30天"); |
| | | AnalysisBundle bundle = buildOrderProfitBundle(loginUser, range, keyword, limit); |
| | | |
| | | Map<String, Object> summary = new LinkedHashMap<>(); |
| | | summary.put("timeRange", range.label()); |
| | | summary.put("startDate", range.start().toString()); |
| | | summary.put("endDate", range.end().toString()); |
| | | summary.put("startDate", displayDate(range.start())); |
| | | summary.put("endDate", displayDate(range.end())); |
| | | summary.put("orderCount", bundle.orderMetrics().size()); |
| | | summary.put("totalRevenue", bundle.totalRevenue()); |
| | | summary.put("totalMaterialCost", bundle.totalMaterialCost()); |
| | |
| | | @P(value = "å
³é®è¯ï¼å¯å¹é
ååå·/客æ·/项ç®", required = false) String keyword, |
| | | @P(value = "è¿åæ¡æ°ï¼é»è®¤10ï¼æå¤§50", required = false) Integer limit) { |
| | | LoginUser loginUser = currentLoginUser(memoryId); |
| | | if (loginUser == null) { |
| | | return jsonResponse(false, "financial_order_profit_analysis", "ç¨æ·ä¿¡æ¯è·å失败", Map.of(), Map.of(), Map.of()); |
| | | } |
| | | |
| | | DateRange range = resolveDateRange(startDate, endDate, timeRange, "è¿30天"); |
| | | AnalysisBundle bundle = buildOrderProfitBundle(loginUser, range, keyword, limit); |
| | | List<OrderProfitMetric> metrics = bundle.orderMetrics(); |
| | | |
| | | List<OrderProfitMetric> riskyOrders = metrics.stream() |
| | | .filter(item -> item.profit().compareTo(BigDecimal.ZERO) < 0 || item.profitRate().compareTo(new BigDecimal("0.08")) < 0) |
| | | .filter(item -> item.profit().compareTo(BigDecimal.ZERO) < 0 || item.profitRate().compareTo(SME_PROFIT_WARNING_RATE) < 0) |
| | | .sorted(Comparator.comparing(OrderProfitMetric::profitRate) |
| | | .thenComparing(OrderProfitMetric::profit)) |
| | | .toList(); |
| | |
| | | |
| | | Map<String, Object> summary = new LinkedHashMap<>(); |
| | | summary.put("timeRange", range.label()); |
| | | summary.put("startDate", range.start().toString()); |
| | | summary.put("endDate", range.end().toString()); |
| | | summary.put("startDate", displayDate(range.start())); |
| | | summary.put("endDate", displayDate(range.end())); |
| | | summary.put("orderCount", metrics.size()); |
| | | summary.put("lossOrderCount", metrics.stream().filter(item -> item.profit().compareTo(BigDecimal.ZERO) < 0).count()); |
| | | summary.put("lowProfitOrderCount", riskyOrders.size()); |
| | |
| | | |
| | | Map<String, Object> summary = new LinkedHashMap<>(); |
| | | summary.put("timeRange", range.label()); |
| | | summary.put("startDate", range.start().toString()); |
| | | summary.put("endDate", range.end().toString()); |
| | | summary.put("startDate", displayDate(range.start())); |
| | | summary.put("endDate", displayDate(range.end())); |
| | | summary.put("actualIncomeTotal", collections.stream().map(AccountSalesCollection::getCollectionAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add)); |
| | | summary.put("actualExpenseTotal", payments.stream().map(AccountPurchasePayment::getPaymentAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add)); |
| | | summary.put("receivableBalance", receivableTotal); |
| | |
| | | List<Map<String, Object>> topAnomalies = anomalyItems.stream().limit(finalLimit).toList(); |
| | | Map<String, Object> summary = new LinkedHashMap<>(); |
| | | summary.put("timeRange", range.label()); |
| | | summary.put("startDate", range.start().toString()); |
| | | summary.put("endDate", range.end().toString()); |
| | | summary.put("startDate", displayDate(range.start())); |
| | | summary.put("endDate", displayDate(range.end())); |
| | | summary.put("anomalyCount", topAnomalies.size()); |
| | | summary.put("highRiskCount", topAnomalies.stream().filter(item -> "high".equals(item.get("riskLevel"))).count()); |
| | | summary.put("mediumRiskCount", topAnomalies.stream().filter(item -> "medium".equals(item.get("riskLevel"))).count()); |
| | |
| | | |
| | | Map<String, Object> summary = new LinkedHashMap<>(); |
| | | summary.put("timeRange", range.label()); |
| | | summary.put("startDate", range.start().toString()); |
| | | summary.put("endDate", range.end().toString()); |
| | | summary.put("startDate", displayDate(range.start())); |
| | | summary.put("endDate", displayDate(range.end())); |
| | | summary.put("outputValue", outputValue); |
| | | summary.put("profit", profitBundle.totalProfit()); |
| | | summary.put("profitRate", toPercent(profitRate)); |
| | |
| | | if (lossCount > 0) { |
| | | riskSuggestions.add(riskSuggestion("婿¶¦é£é©", "é«", "夿 ¸äºæè®¢åBOMåå·¥åºå·¥èµå®é¢ï¼å¿
è¦æ¶è°æ´æ¥ä»·ä¸äº¤ä»èå¥ã")); |
| | | } |
| | | if (snapshot.receivableTotal().compareTo(new BigDecimal("1000000")) > 0) { |
| | | if (snapshot.receivableTotal().compareTo(SME_RECEIVABLE_RISK_THRESHOLD) > 0) { |
| | | riskSuggestions.add(riskSuggestion("忬¾é£é©", "ä¸", "å¯¹åºæ¶TOP客æ·å»ºç«å¨åº¦å款计åï¼å¹¶è®¾ç½®é¢è¦éå¼ã")); |
| | | } |
| | | if (inventoryValue.compareTo(new BigDecimal("3000000")) > 0) { |
| | | if (inventoryValue.compareTo(SME_INVENTORY_RISK_THRESHOLD) > 0) { |
| | | riskSuggestions.add(riskSuggestion("åºåé£é©", "ä¸", "对é«éé¢åæ»åºåæ§è¡éä»·ãæ¿ä»£åç产æ¶èçç¥ã")); |
| | | } |
| | | |
| | | Map<String, Object> summary = new LinkedHashMap<>(); |
| | | summary.put("reportType", type); |
| | | summary.put("timeRange", range.label()); |
| | | summary.put("startDate", range.start().toString()); |
| | | summary.put("endDate", range.end().toString()); |
| | | summary.put("startDate", displayDate(range.start())); |
| | | summary.put("endDate", displayDate(range.end())); |
| | | summary.put("orderCount", bundle.orderMetrics().size()); |
| | | summary.put("lossOrderCount", lossCount); |
| | | summary.put("riskSuggestionCount", riskSuggestions.size()); |
| | |
| | | applyTenantFilter(outWrapper, loginUser.getTenantId(), ProcurementRecordOut::getTenantId); |
| | | applyDeptFilter(outWrapper, loginUser.getCurrentDeptId(), ProcurementRecordOut::getDeptId); |
| | | outWrapper.eq(ProcurementRecordOut::getType, 2) |
| | | .in(ProcurementRecordOut::getSalesLedgerProductId, ledgerProductIds) |
| | | .ge(ProcurementRecordOut::getCreateTime, range.start().atStartOfDay()) |
| | | .lt(ProcurementRecordOut::getCreateTime, range.end().plusDays(1).atStartOfDay()); |
| | | .in(ProcurementRecordOut::getSalesLedgerProductId, ledgerProductIds); |
| | | if (range.hasDateFilter()) { |
| | | outWrapper.ge(ProcurementRecordOut::getCreateTime, range.start().atStartOfDay()) |
| | | .lt(ProcurementRecordOut::getCreateTime, range.end().plusDays(1).atStartOfDay()); |
| | | } |
| | | List<ProcurementRecordOut> outList = defaultList(procurementRecordOutMapper.selectList(outWrapper)); |
| | | |
| | | Set<Integer> storageIds = outList.stream() |
| | |
| | | |
| | | LambdaQueryWrapper<ProductionOrder> orderWrapper = new LambdaQueryWrapper<>(); |
| | | applyDeptFilter(orderWrapper, loginUser.getCurrentDeptId(), ProductionOrder::getDeptId); |
| | | orderWrapper.ge(ProductionOrder::getCreateTime, range.start().atStartOfDay().minusMonths(2)) |
| | | .lt(ProductionOrder::getCreateTime, range.end().plusDays(1).atStartOfDay().plusMonths(1)); |
| | | if (range.hasDateFilter()) { |
| | | orderWrapper.ge(ProductionOrder::getCreateTime, range.start().atStartOfDay().minusMonths(2)) |
| | | .lt(ProductionOrder::getCreateTime, range.end().plusDays(1).atStartOfDay().plusMonths(1)); |
| | | } |
| | | List<ProductionOrder> orders = defaultList(productionOrderMapper.selectList(orderWrapper)); |
| | | |
| | | Map<Long, Set<Long>> orderIdToLedgerIds = new HashMap<>(); |
| | |
| | | |
| | | LambdaQueryWrapper<ProductionProductMain> mainWrapper = new LambdaQueryWrapper<>(); |
| | | applyDeptFilter(mainWrapper, loginUser.getCurrentDeptId(), ProductionProductMain::getDeptId); |
| | | mainWrapper.in(ProductionProductMain::getProductionOperationTaskId, taskIdToOrderId.keySet()) |
| | | .ge(ProductionProductMain::getCreateTime, range.start().atStartOfDay().minusMonths(2)) |
| | | .lt(ProductionProductMain::getCreateTime, range.end().plusDays(1).atStartOfDay().plusMonths(1)); |
| | | mainWrapper.in(ProductionProductMain::getProductionOperationTaskId, taskIdToOrderId.keySet()); |
| | | if (range.hasDateFilter()) { |
| | | mainWrapper.ge(ProductionProductMain::getCreateTime, range.start().atStartOfDay().minusMonths(2)) |
| | | .lt(ProductionProductMain::getCreateTime, range.end().plusDays(1).atStartOfDay().plusMonths(1)); |
| | | } |
| | | List<ProductionProductMain> mainList = defaultList(productionProductMainMapper.selectList(mainWrapper)); |
| | | Map<Long, Set<Long>> mainIdToLedgers = new HashMap<>(); |
| | | for (ProductionProductMain main : mainList) { |
| | |
| | | |
| | | LambdaQueryWrapper<ProductionAccount> accountWrapper = new LambdaQueryWrapper<>(); |
| | | applyDeptFilter(accountWrapper, loginUser.getCurrentDeptId(), ProductionAccount::getDeptId); |
| | | accountWrapper.in(ProductionAccount::getProductionProductMainId, mainIdToLedgers.keySet()) |
| | | .ge(ProductionAccount::getSchedulingDate, range.start().atStartOfDay()) |
| | | .lt(ProductionAccount::getSchedulingDate, range.end().plusDays(1).atStartOfDay()); |
| | | accountWrapper.in(ProductionAccount::getProductionProductMainId, mainIdToLedgers.keySet()); |
| | | if (range.hasDateFilter()) { |
| | | accountWrapper.ge(ProductionAccount::getSchedulingDate, range.start().atStartOfDay()) |
| | | .lt(ProductionAccount::getSchedulingDate, range.end().plusDays(1).atStartOfDay()); |
| | | } |
| | | List<ProductionAccount> accountList = defaultList(productionAccountMapper.selectList(accountWrapper)); |
| | | |
| | | Map<String, BigDecimal> salaryQuotaByOperation = defaultList(technologyOperationMapper.selectList(new LambdaQueryWrapper<TechnologyOperation>() |
| | |
| | | |
| | | LambdaQueryWrapper<ProductionProductOutput> outputWrapper = new LambdaQueryWrapper<>(); |
| | | applyDeptFilter(outputWrapper, loginUser.getCurrentDeptId(), ProductionProductOutput::getDeptId); |
| | | outputWrapper.in(ProductionProductOutput::getProductionProductMainId, mainIdToLedgers.keySet()) |
| | | .ge(ProductionProductOutput::getCreateTime, range.start().atStartOfDay()) |
| | | .lt(ProductionProductOutput::getCreateTime, range.end().plusDays(1).atStartOfDay()); |
| | | outputWrapper.in(ProductionProductOutput::getProductionProductMainId, mainIdToLedgers.keySet()); |
| | | if (range.hasDateFilter()) { |
| | | outputWrapper.ge(ProductionProductOutput::getCreateTime, range.start().atStartOfDay()) |
| | | .lt(ProductionProductOutput::getCreateTime, range.end().plusDays(1).atStartOfDay()); |
| | | } |
| | | List<ProductionProductOutput> outputList = defaultList(productionProductOutputMapper.selectList(outputWrapper)); |
| | | Map<Long, BigDecimal> scrapCostByLedger = new HashMap<>(); |
| | | for (ProductionProductOutput output : outputList) { |
| | |
| | | .or().like(SalesLedger::getProjectName, keyword) |
| | | .or().like(SalesLedger::getSalesman, keyword)); |
| | | } |
| | | wrapper.ge(SalesLedger::getEntryDate, toDate(range.start())) |
| | | .lt(SalesLedger::getEntryDate, toExclusiveEndDate(range.end())) |
| | | .orderByDesc(SalesLedger::getEntryDate, SalesLedger::getId) |
| | | .last("limit " + normalizeLimit(limit)); |
| | | if (range.hasDateFilter()) { |
| | | wrapper.ge(SalesLedger::getEntryDate, toDate(range.start())) |
| | | .lt(SalesLedger::getEntryDate, toExclusiveEndDate(range.end())); |
| | | } |
| | | wrapper.orderByDesc(SalesLedger::getEntryDate, SalesLedger::getId); |
| | | if (limit != null && limit > 0) { |
| | | wrapper.last("limit " + normalizeLimit(limit)); |
| | | } |
| | | return defaultList(salesLedgerMapper.selectList(wrapper)); |
| | | } |
| | | |
| | |
| | | if (productModelIds != null && !productModelIds.isEmpty()) { |
| | | wrapper.in(ProcurementRecordOut::getProductModelId, productModelIds); |
| | | } |
| | | wrapper.ge(ProcurementRecordOut::getCreateTime, range.start().atStartOfDay()) |
| | | .lt(ProcurementRecordOut::getCreateTime, range.end().plusDays(1).atStartOfDay()); |
| | | if (range.hasDateFilter()) { |
| | | wrapper.ge(ProcurementRecordOut::getCreateTime, range.start().atStartOfDay()) |
| | | .lt(ProcurementRecordOut::getCreateTime, range.end().plusDays(1).atStartOfDay()); |
| | | } |
| | | List<ProcurementRecordOut> outList = defaultList(procurementRecordOutMapper.selectList(wrapper)); |
| | | if (outList.isEmpty()) { |
| | | return OutboundStats.empty(); |
| | |
| | | private List<AccountSalesCollection> queryCollections(LoginUser loginUser, DateRange range) { |
| | | LambdaQueryWrapper<AccountSalesCollection> wrapper = new LambdaQueryWrapper<>(); |
| | | applyDeptFilter(wrapper, loginUser.getCurrentDeptId(), AccountSalesCollection::getDeptId); |
| | | wrapper.ge(AccountSalesCollection::getCollectionDate, range.start()) |
| | | .le(AccountSalesCollection::getCollectionDate, range.end()) |
| | | .orderByAsc(AccountSalesCollection::getCollectionDate); |
| | | if (range.hasDateFilter()) { |
| | | wrapper.ge(AccountSalesCollection::getCollectionDate, range.start()) |
| | | .le(AccountSalesCollection::getCollectionDate, range.end()); |
| | | } |
| | | wrapper.orderByAsc(AccountSalesCollection::getCollectionDate); |
| | | return defaultList(accountSalesCollectionMapper.selectList(wrapper)); |
| | | } |
| | | |
| | | private List<AccountPurchasePayment> queryPayments(LoginUser loginUser, DateRange range) { |
| | | LambdaQueryWrapper<AccountPurchasePayment> wrapper = new LambdaQueryWrapper<>(); |
| | | applyDeptFilter(wrapper, loginUser.getCurrentDeptId(), AccountPurchasePayment::getDeptId); |
| | | wrapper.ge(AccountPurchasePayment::getPaymentDate, range.start()) |
| | | .le(AccountPurchasePayment::getPaymentDate, range.end()) |
| | | .orderByAsc(AccountPurchasePayment::getPaymentDate); |
| | | if (range.hasDateFilter()) { |
| | | wrapper.ge(AccountPurchasePayment::getPaymentDate, range.start()) |
| | | .le(AccountPurchasePayment::getPaymentDate, range.end()); |
| | | } |
| | | wrapper.orderByAsc(AccountPurchasePayment::getPaymentDate); |
| | | return defaultList(accountPurchasePaymentMapper.selectList(wrapper)); |
| | | } |
| | | |
| | |
| | | List<AccountPurchasePayment> payments) { |
| | | Map<YearMonth, BigDecimal> incomeByMonth = new LinkedHashMap<>(); |
| | | Map<YearMonth, BigDecimal> expenseByMonth = new LinkedHashMap<>(); |
| | | YearMonth startMonth = YearMonth.from(range.start()); |
| | | YearMonth endMonth = YearMonth.from(range.end()); |
| | | DateRange monthlyRange = range.hasDateFilter() ? range : inferCashFlowRange(collections, payments); |
| | | if (!monthlyRange.hasDateFilter()) { |
| | | return List.of(); |
| | | } |
| | | YearMonth startMonth = YearMonth.from(monthlyRange.start()); |
| | | YearMonth endMonth = YearMonth.from(monthlyRange.end()); |
| | | for (YearMonth month = startMonth; !month.isAfter(endMonth); month = month.plusMonths(1)) { |
| | | incomeByMonth.put(month, BigDecimal.ZERO); |
| | | expenseByMonth.put(month, BigDecimal.ZERO); |
| | |
| | | result.add(new MonthlyCashFlow(month.toString(), income, expense, income.subtract(expense))); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | private DateRange inferCashFlowRange(List<AccountSalesCollection> collections, |
| | | List<AccountPurchasePayment> payments) { |
| | | LocalDate min = null; |
| | | LocalDate max = null; |
| | | for (AccountSalesCollection row : defaultList(collections)) { |
| | | if (row.getCollectionDate() == null) { |
| | | continue; |
| | | } |
| | | min = min == null || row.getCollectionDate().isBefore(min) ? row.getCollectionDate() : min; |
| | | max = max == null || row.getCollectionDate().isAfter(max) ? row.getCollectionDate() : max; |
| | | } |
| | | for (AccountPurchasePayment row : defaultList(payments)) { |
| | | if (row.getPaymentDate() == null) { |
| | | continue; |
| | | } |
| | | min = min == null || row.getPaymentDate().isBefore(min) ? row.getPaymentDate() : min; |
| | | max = max == null || row.getPaymentDate().isAfter(max) ? row.getPaymentDate() : max; |
| | | } |
| | | return min == null || max == null ? new DateRange(null, null, "å
¨é¨") : new DateRange(min, max, "å
¨é¨"); |
| | | } |
| | | |
| | | private List<MonthlyCashFlow> forecastMonthlyCashFlow(List<MonthlyCashFlow> actual, int forecastMonths) { |
| | |
| | | return productAmount; |
| | | } |
| | | } |
| | | return revenue.multiply(DEFAULT_FALLBACK_MATERIAL_COST_RATE); |
| | | |
| | | BigDecimal materialCost = revenue.multiply(DEFAULT_FALLBACK_MATERIAL_COST_RATE); |
| | | BigDecimal laborCost = revenue.multiply(DEFAULT_LABOR_COST_RATE); |
| | | BigDecimal overheadCost = revenue.multiply(DEFAULT_OVERHEAD_COST_RATE); |
| | | |
| | | return materialCost.add(laborCost).add(overheadCost); |
| | | } |
| | | |
| | | private BigDecimal estimateTotalCost(BigDecimal revenue, List<SalesLedgerProduct> products) { |
| | | if (revenue == null || revenue.compareTo(BigDecimal.ZERO) <= 0) { |
| | | return BigDecimal.ZERO; |
| | | } |
| | | |
| | | BigDecimal materialCost = BigDecimal.ZERO; |
| | | if (products != null && !products.isEmpty()) { |
| | | materialCost = products.stream() |
| | | .map(SalesLedgerProduct::getTaxExclusiveTotalPrice) |
| | | .filter(Objects::nonNull) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | } |
| | | |
| | | if (materialCost.compareTo(BigDecimal.ZERO) <= 0) { |
| | | materialCost = revenue.multiply(DEFAULT_FALLBACK_MATERIAL_COST_RATE); |
| | | } |
| | | |
| | | BigDecimal laborCost = revenue.multiply(DEFAULT_LABOR_COST_RATE); |
| | | BigDecimal overheadCost = revenue.multiply(DEFAULT_OVERHEAD_COST_RATE); |
| | | |
| | | return materialCost.add(laborCost).add(overheadCost); |
| | | } |
| | | |
| | | private Map<String, String> queryCustomerNameMap(Set<String> idSet) { |
| | |
| | | } |
| | | |
| | | private DateRange previousSameLengthRange(DateRange range) { |
| | | if (!range.hasDateFilter()) { |
| | | return new DateRange(null, null, "å
¨é¨"); |
| | | } |
| | | long days = daysBetween(range.start(), range.end()) + 1L; |
| | | LocalDate prevEnd = range.start().minusDays(1); |
| | | LocalDate prevStart = prevEnd.minusDays(days - 1L); |
| | |
| | | } |
| | | |
| | | if (!StringUtils.hasText(timeRange)) { |
| | | if ("ä»å¤©".equals(defaultLabel)) { |
| | | return new DateRange(today, today, "ä»å¤©"); |
| | | } |
| | | if ("æ¬å¨".equals(defaultLabel)) { |
| | | LocalDate start = today.minusDays(today.getDayOfWeek().getValue() - 1L); |
| | | return new DateRange(start, today, "æ¬å¨"); |
| | | } |
| | | if ("æ¬æ".equals(defaultLabel)) { |
| | | return new DateRange(today.withDayOfMonth(1), today, "æ¬æ"); |
| | | } |
| | | if ("è¿90天".equals(defaultLabel)) { |
| | | return new DateRange(today.minusDays(89), today, "è¿90天"); |
| | | } |
| | | return new DateRange(today.minusDays(29), today, defaultLabel); |
| | | return new DateRange(null, null, "å
¨é¨"); |
| | | } |
| | | |
| | | String text = timeRange.trim(); |
| | |
| | | return new DateRange(start, end, start + "è³" + end); |
| | | } |
| | | } |
| | | return new DateRange(today.minusDays(29), today, "è¿30天"); |
| | | return new DateRange(null, null, "å
¨é¨"); |
| | | } |
| | | |
| | | private LocalDate parseLocalDate(String text) { |
| | |
| | | } |
| | | |
| | | private String formatDate(LocalDate date) { |
| | | return date == null ? "" : date.format(DATE_FMT); |
| | | } |
| | | |
| | | private String displayDate(LocalDate date) { |
| | | return date == null ? "" : date.format(DATE_FMT); |
| | | } |
| | | |
| | |
| | | private Map<String, Object> rangeSummary(DateRange range, int count, String keyword) { |
| | | Map<String, Object> summary = new LinkedHashMap<>(); |
| | | summary.put("timeRange", range.label()); |
| | | summary.put("startDate", range.start().toString()); |
| | | summary.put("endDate", range.end().toString()); |
| | | summary.put("startDate", displayDate(range.start())); |
| | | summary.put("endDate", displayDate(range.end())); |
| | | summary.put("count", count); |
| | | summary.put("keyword", safe(keyword)); |
| | | return summary; |
| | |
| | | } |
| | | |
| | | private record DateRange(LocalDate start, LocalDate end, String label) { |
| | | private boolean hasDateFilter() { |
| | | return start != null && end != null; |
| | | } |
| | | } |
| | | |
| | | private record OrderProfitMetric(Long ledgerId, |
| | |
| | | * å建æ¶é´ |
| | | */ |
| | | @Schema(description ="å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | |
| | | * å建æ¶é´ |
| | | */ |
| | | @Schema(description = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean add(ApprovalInstanceDto approvalInstanceDto) { |
| | | String instanceNo = OrderUtils.countTodayByCreateTime(approvalInstanceMapper, "SP", "instance_no"); |
| | | String instanceNo = OrderUtils.countTodayByCreateTime(approvalInstanceMapper, "SP", "instance_no", approvalInstanceDto.getCreateTime() != null ? approvalInstanceDto.getCreateTime() : LocalDateTime.now()); |
| | | approvalInstanceDto.setInstanceNo(instanceNo); |
| | | approvalInstanceDto.setStatus("PENDING"); |
| | | approvalInstanceDto.setCurrentLevel(1); |
| | |
| | | private void handlePurchaseApprovalFinished(ApprovalInstance instance, String status) { |
| | | PurchaseLedger purchaseLedger = purchaseLedgerMapper.selectOne( |
| | | new LambdaQueryWrapper<PurchaseLedger>() |
| | | .eq(PurchaseLedger::getPurchaseContractNumber, instance.getTitle()) |
| | | .eq(PurchaseLedger::getId, instance.getBusinessId()) |
| | | .last("limit 1") |
| | | ); |
| | | if (purchaseLedger == null) { |
| | |
| | | private void handleSalesQuotationApprovalFinished(ApprovalInstance instance, String status) { |
| | | SalesQuotation salesQuote = salesQuotationMapper.selectOne( |
| | | new LambdaQueryWrapper<SalesQuotation>() |
| | | .eq(SalesQuotation::getQuotationNo, instance.getTitle()) |
| | | .eq(SalesQuotation::getId, instance.getBusinessId()) |
| | | .last("limit 1") |
| | | ); |
| | | if (salesQuote == null) { |
| | |
| | | private void handleShippingApprovalFinished(ApprovalInstance instance, String status) { |
| | | ShippingInfo shippingInfo = shippingInfoMapper.selectOne( |
| | | new LambdaQueryWrapper<ShippingInfo>() |
| | | .eq(ShippingInfo::getShippingNo, instance.getTitle()) |
| | | .eq(ShippingInfo::getId, instance.getTitle()) |
| | | .orderByDesc(ShippingInfo::getCreateTime) |
| | | .last("limit 1") |
| | | ); |
| | |
| | | List<Long> nodeIds, List<SysUser> sysUsers, Integer approveStatus) throws Exception { |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | ApproveProcess approveProcess = new ApproveProcess(); |
| | | String no = OrderUtils.countTodayByCreateTime(approveProcessMapper, "", "approve_id"); |
| | | String no = OrderUtils.countTodayByCreateTime(approveProcessMapper, "", "approve_id", approveProcess.getCreateTime() != null ? approveProcess.getCreateTime() : LocalDateTime.now()); |
| | | approveProcess.setApproveId(no); |
| | | approveProcess.setApproveUser(sysUser.getUserId()); |
| | | approveProcess.setApproveUserName(sysUser.getNickName()); |
| | |
| | | String billStatus = validateAddParam(finReimbursementDto); |
| | | |
| | | // çææ¥éåå· |
| | | String billNo = OrderUtils.countTodayByCreateTime(finReimbursementMapper, "BXD", "bill_no"); |
| | | String billNo = OrderUtils.countTodayByCreateTime(finReimbursementMapper, "BXD", "bill_no", finReimbursementDto.getCreateTime() != null ? finReimbursementDto.getCreateTime() : LocalDateTime.now()); |
| | | List<FinReimbursementDetail> details = finReimbursementDto.getDetails(); |
| | | BigDecimal totalAmount = details.stream() |
| | | .map(FinReimbursementDetail::getAmount) |
| | |
| | | private void startApproval(FinReimbursement reimbursement, FinReimbursementDto finReimbursementDto) { |
| | | Long businessType = resolveBusinessType(finReimbursementDto.getReimbursementType()); |
| | | ApprovalInstanceDto approvalInstanceDto = new ApprovalInstanceDto(); |
| | | approvalInstanceDto.setInstanceNo(OrderUtils.countTodayByCreateTime(approvalInstanceMapper, "SP", "instance_no")); |
| | | approvalInstanceDto.setInstanceNo(OrderUtils.countTodayByCreateTime(approvalInstanceMapper, "SP", "instance_no", approvalInstanceDto.getCreateTime() != null ? approvalInstanceDto.getCreateTime() : LocalDateTime.now())); |
| | | approvalInstanceDto.setBusinessId(reimbursement.getId()); |
| | | approvalInstanceDto.setTemplateId(null); |
| | | approvalInstanceDto.setTemplateName(TypeEnums.getLabelByValue(businessType) + "审æ¹"); |
| | |
| | | import com.ruoyi.procurementrecord.mapper.ReturnManagementMapper; |
| | | import com.ruoyi.procurementrecord.pojo.ReturnManagement; |
| | | import com.ruoyi.sales.mapper.SalesLedgerMapper; |
| | | import com.ruoyi.sales.mapper.SalesQuotationMapper; |
| | | import com.ruoyi.sales.pojo.SalesLedger; |
| | | import com.ruoyi.sales.pojo.SalesQuotation; |
| | | import com.ruoyi.sales.vo.CustomerTransactionsDetailsVo; |
| | | import com.ruoyi.sales.vo.CustomerTransactionsVo; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> implements ICustomerService { |
| | | @Autowired |
| | | private SalesLedgerMapper salesLedgerMapper; |
| | | @Autowired |
| | | private SalesQuotationMapper salesQuotationMapper; |
| | | @Autowired |
| | | private ReturnManagementMapper returnManagementMapper; |
| | | @Autowired |
| | |
| | | if (!returnManagements.isEmpty()) { |
| | | throw new RuntimeException("å®¢æ·æ¡£æ¡ä¸æéå®éè´§ï¼è¯·å
å é¤éå®éè´§"); |
| | | } |
| | | |
| | | // æ£æ¥æ¯å¦æé宿¥ä»·å
³è |
| | | List<SalesQuotation> salesQuotations = salesQuotationMapper.selectList(new QueryWrapper<SalesQuotation>().lambda().in(SalesQuotation::getCustomerId, idList)); |
| | | if (!salesQuotations.isEmpty()) { |
| | | throw new RuntimeException("å®¢æ·æ¡£æ¡ä¸æé宿¥ä»·ï¼è¯·å
å é¤é宿¥ä»·"); |
| | | } |
| | | |
| | | // æ¥è¯¢æ¯å¦æå·²åé
çå
¬æµ·å®¢æ· |
| | | List<Customer> assignedPools = customerMapper.selectList( |
| | | new QueryWrapper<Customer>().lambda() |
| | |
| | | } |
| | | |
| | | ApprovalInstance approvalInstance = new ApprovalInstance(); |
| | | approvalInstance.setInstanceNo(OrderUtils.countTodayByCreateTime(approvalInstanceMapper, "SP", "instance_no")); |
| | | approvalInstance.setInstanceNo(OrderUtils.countTodayByCreateTime(approvalInstanceMapper, "SP", "instance_no", enterpriseNews.getCreateTime() != null ? enterpriseNews.getCreateTime() : LocalDateTime.now())); |
| | | approvalInstance.setTemplateId(enterpriseNewsDto.getTemplateId()); |
| | | approvalInstance.setTemplateName(templateName); |
| | | approvalInstance.setBusinessId(enterpriseNews.getId()); |
| | |
| | | * @param <T> å®ä½ç±»å |
| | | * @return 订åç¼å· |
| | | */ |
| | | public static <T> String countTodayByCreateTime(BaseMapper<T> mapper,String preFix,String code) { |
| | | LocalDate today = LocalDate.now(); |
| | | public static <T> String countTodayByCreateTime(BaseMapper<T> mapper,String preFix,String code, LocalDateTime createTime) { |
| | | if (createTime == null) { |
| | | createTime = LocalDateTime.now(); |
| | | } |
| | | LocalDate today = createTime.toLocalDate(); |
| | | LocalDateTime todayStart = today.atStartOfDay(); |
| | | LocalDateTime tomorrowStart = today.plusDays(1).atStartOfDay(); |
| | | String dateStr = today.format(DateTimeFormatter.BASIC_ISO_DATE); |
| | |
| | | * @param <T> å®ä½ç±»æ³å |
| | | * @return å½å¤©è®°å½æ°é |
| | | */ |
| | | public static <T> String countAfterServiceTodayByCreateTime(BaseMapper<T> mapper,String preFix) { |
| | | public static <T> String countAfterServiceTodayByCreateTime(BaseMapper<T> mapper,String preFix, LocalDateTime createTime) { |
| | | if (createTime == null) { |
| | | createTime = LocalDateTime.now(); |
| | | } |
| | | LocalDate localDate = createTime.toLocalDate(); |
| | | LocalDateTime todayStart = LocalDateTime.of( |
| | | LocalDateTime.now().toLocalDate(), |
| | | localDate, |
| | | LocalTime.MIN |
| | | ); |
| | | LocalDateTime todayEnd = LocalDateTime.of( |
| | | LocalDateTime.now().toLocalDate(), |
| | | localDate, |
| | | LocalTime.MAX |
| | | ); |
| | | |
| | |
| | | .lt("create_time", endDate); |
| | | |
| | | Long aLong = mapper.selectCount(queryWrapper); |
| | | return preFix + LocalDate.now().format(DateTimeFormatter.ISO_LOCAL_DATE).replaceAll("-", "") + String.format("%03d", (aLong + 1)); |
| | | return preFix + localDate.format(DateTimeFormatter.ISO_LOCAL_DATE).replaceAll("-", "") + String.format("%03d", (aLong + 1)); |
| | | } |
| | | } |
| | |
| | | wrapper.like(CustomerVisits::getVisitingPeople, customerVisits.getVisitingPeople()); |
| | | } |
| | | } |
| | | |
| | | wrapper.orderByDesc(CustomerVisits::getId); |
| | | return customerVisitsMapper.selectPage(page, wrapper); |
| | | } |
| | | |
| | |
| | | package com.ruoyi.device.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | |
| | | |
| | | @Override |
| | | public AjaxResult listPage(Page page, MaintenanceTask maintenanceTask) { |
| | | Page<MaintenanceTask> taskPage = maintenanceTaskMapper.selectPage(page, null); |
| | | Page<MaintenanceTask> taskPage = maintenanceTaskMapper.selectPage(page, new QueryWrapper<MaintenanceTask>().orderByDesc("create_time")); |
| | | // 2. å¦ææ²¡ææ°æ®ï¼ç´æ¥è¿å空å页 |
| | | if (taskPage.getRecords().isEmpty()) { |
| | | return AjaxResult.success(taskPage); |
| | |
| | | if (StringUtils.isNotBlank(inspectionTaskDto.getInspectionProject())) { |
| | | queryWrapper.like(InspectionTask::getInspectionProject, inspectionTaskDto.getInspectionProject()); |
| | | } |
| | | queryWrapper.orderByDesc(InspectionTask::getCreateTime); |
| | | IPage<InspectionTask> entityPage = inspectionTaskMapper.selectPage(page, queryWrapper); |
| | | |
| | | // æ æ°æ®æåè¿å |
| | |
| | | if (timingTask.getIsEnabled() != null) { |
| | | queryWrapper.eq(TimingTask::getIsEnabled, timingTask.getIsEnabled()); |
| | | } |
| | | queryWrapper.orderByDesc(TimingTask::getCreateTime); |
| | | IPage<TimingTask> taskPage = timingTaskMapper.selectPage(page, queryWrapper); |
| | | |
| | | // 2. å¦ææ²¡ææ°æ®ï¼ç´æ¥è¿å空å页 |
| | |
| | | /** |
| | | * å
¥åºæ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDateTime createTime; |
| | |
| | | @Schema(description = "å建æ¶é´") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | @Schema(description = "æ´æ°æ¶é´") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | |
| | | Long aLong = customStorageMapper.selectCount(null); |
| | | item.setInboundBatches(aLong.equals(0L) ? "第1æ¹æ¬¡(èªå®ä¹å
¥åº)" : "第"+ (aLong + 1) + "æ¹æ¬¡(èªå®ä¹å
¥åº)" ); |
| | | item.setCreateBy(loginUser.getNickName()); |
| | | item.setCode(OrderUtils.countTodayByCreateTime(customStorageMapper, "", "code")); |
| | | item.setCode(OrderUtils.countTodayByCreateTime(customStorageMapper, "", "code", item.getCreateTime() != null ? item.getCreateTime() : LocalDateTime.now())); |
| | | customStorageMapper.insert(item); |
| | | }); |
| | | return AjaxResult.success("èªå®ä¹å
¥åºæå"); |
| | |
| | | import com.ruoyi.common.enums.StockInQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import com.ruoyi.procurementrecord.bean.dto.ReturnManagementDto; |
| | | import com.ruoyi.procurementrecord.bean.dto.ReturnSaleProductDto; |
| | | import com.ruoyi.procurementrecord.bean.vo.ShippingInfoVo; |
| | |
| | | @Override |
| | | public boolean addReturnManagementDto(ReturnManagementDto returnManagementDto) { |
| | | if (ObjectUtils.isEmpty(returnManagementDto.getReturnNo())){ |
| | | String rt = OrderUtils.countTodayByCreateTime(returnManagementMapper, "RT","return_no"); |
| | | String rt = OrderUtils.countTodayByCreateTime(returnManagementMapper, "RT","return_no", returnManagementDto.getCreateTime() != null ? returnManagementDto.getCreateTime() : LocalDateTime.now()); |
| | | returnManagementDto.setReturnNo(rt); |
| | | } |
| | | save(returnManagementDto); |
| | |
| | | private String npsNo; |
| | | |
| | | @Schema(description = "å½å
¥æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @Schema(description = "æ´æ°æ¶é´") |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | // ä¸åå
¥å£ç»ä¸è¡¥é½æ¥æºåæ®ã计ååå·¥èºä¿¡æ¯ï¼é¿å
å端åå«ä¼ å¤å¥å段ã |
| | | validateAndFillOrder(productionOrder, oldOrder); |
| | | if (productionOrder.getNpsNo() == null || productionOrder.getNpsNo().trim().isEmpty()) { |
| | | productionOrder.setNpsNo(generateNextOrderNo()); |
| | | productionOrder.setNpsNo(generateNextOrderNo(productionOrder.getCreateTime() != null ? productionOrder.getCreateTime() : LocalDateTime.now())); |
| | | } |
| | | if (productionOrder.getCompleteQuantity() == null) { |
| | | productionOrder.setCompleteQuantity(BigDecimal.ZERO); |
| | |
| | | .orderByDesc(ProductionOrder::getId); |
| | | } |
| | | |
| | | private String generateNextOrderNo() { |
| | | private String generateNextOrderNo(LocalDateTime createTime) { |
| | | // çæä¸ä¸ä¸ªç产订åå· |
| | | String datePrefix = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); |
| | | LocalDate localDate = createTime.toLocalDate(); |
| | | String datePrefix = localDate.format(DateTimeFormatter.ofPattern("yyyyMMdd")); |
| | | String prefix = "SC" + datePrefix; |
| | | ProductionOrder latestOrder = this.getOne(Wrappers.<ProductionOrder>lambdaQuery() |
| | | .likeRight(ProductionOrder::getNpsNo, prefix) |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import com.ruoyi.projectManagement.dto.RoleDto; |
| | | import com.ruoyi.projectManagement.mapper.RolesMapper; |
| | | import com.ruoyi.projectManagement.pojo.Roles; |
| | |
| | | @Operation(summary = "æ°å¢") |
| | | public AjaxResult add(@RequestBody RoleDto roleDto) { |
| | | if (roleDto.getIsDefaultNo()) { |
| | | roleDto.setNo(OrderUtils.countTodayByCreateTime(rolesMapper, "XMJS","no")); |
| | | roleDto.setNo(OrderUtils.countTodayByCreateTime(rolesMapper, "XMJS","no", roleDto.getCreateTime() != null ? roleDto.getCreateTime() : LocalDateTime.now())); |
| | | } |
| | | return AjaxResult.success(rolesservice.save(roleDto)); |
| | | } |
| | |
| | | private Integer status; |
| | | |
| | | @Schema(description = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @Schema(description = "åå»ºç¨æ·") |
| | |
| | | import com.ruoyi.purchase.dto.PurchaseReturnOrderDto; |
| | | import com.ruoyi.purchase.mapper.PurchaseReturnOrdersMapper; |
| | | import com.ruoyi.purchase.pojo.PurchaseReturnOrders; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import com.ruoyi.purchase.service.PurchaseReturnOrdersService; |
| | | import com.ruoyi.purchase.vo.PurchaseStockInProductVo; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody PurchaseReturnOrderDto purchaseReturnOrderDto) throws Exception { |
| | | if (purchaseReturnOrderDto.getIsDefaultNo()) { |
| | | purchaseReturnOrderDto.setNo(OrderUtils.countTodayByCreateTime(purchaseReturnOrdersMapper, "CGTL", "no")); |
| | | purchaseReturnOrderDto.setNo(OrderUtils.countTodayByCreateTime(purchaseReturnOrdersMapper, "CGTL", "no", purchaseReturnOrderDto.getCreateTime() != null ? purchaseReturnOrderDto.getCreateTime() : LocalDateTime.now())); |
| | | } |
| | | return AjaxResult.success(purchaseReturnOrdersService.add(purchaseReturnOrderDto)); |
| | | } |
| | |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long deptId; |
| | | |
| | | @Schema(description = "模æ¿id") |
| | | private Long templateId; |
| | | |
| | | } |
| | |
| | | private BigDecimal totalAmount; |
| | | |
| | | @Schema(description = "å½å
¥æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.approve.bean.vo.ApproveProcessVO; |
| | | import com.ruoyi.approve.bean.dto.ApprovalInstanceDto; |
| | | import com.ruoyi.approve.mapper.ApprovalTemplateMapper; |
| | | import com.ruoyi.approve.pojo.ApprovalTemplate; |
| | | import com.ruoyi.approve.pojo.ApproveProcess; |
| | | import com.ruoyi.approve.service.ApprovalInstanceService; |
| | | import com.ruoyi.approve.service.impl.ApproveProcessServiceImpl; |
| | | import com.ruoyi.basic.enums.ApplicationTypeEnum; |
| | | import com.ruoyi.basic.enums.RecordTypeEnum; |
| | |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.basic.pojo.SupplierManage; |
| | | import com.ruoyi.basic.utils.FileUtil; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | |
| | | import com.ruoyi.sales.mapper.CommonFileMapper; |
| | | import com.ruoyi.sales.mapper.SalesLedgerMapper; |
| | | import com.ruoyi.sales.mapper.SalesLedgerProductMapper; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import com.ruoyi.sales.pojo.SalesLedger; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import com.ruoyi.sales.service.impl.CommonFileServiceImpl; |
| | |
| | | private final ApproveProcessServiceImpl approveProcessService; |
| | | private final ProcurementRecordMapper procurementRecordStorageMapper; |
| | | private final FileUtil fileUtil; |
| | | private final ApprovalInstanceService approvalInstanceService; |
| | | private final ApprovalTemplateMapper approvalTemplateMapper; |
| | | |
| | | @Override |
| | | public List<PurchaseLedger> selectPurchaseLedgerList(PurchaseLedger purchaseLedger) { |
| | |
| | | if (loginUser == null) { |
| | | return; |
| | | } |
| | | ApproveProcessVO approveProcessVO = new ApproveProcessVO(); |
| | | approveProcessVO.setApproveType(5); |
| | | approveProcessVO.setApproveDeptId(loginUser.getCurrentDeptId()); |
| | | approveProcessVO.setApproveReason(purchaseLedger.getPurchaseContractNumber()); |
| | | approveProcessVO.setApproveUserIds(purchaseLedger.getApproveUserIds()); |
| | | approveProcessVO.setApproveUser(loginUser.getUserId()); |
| | | approveProcessVO.setApproveTime(LocalDate.now().toString()); |
| | | approveProcessService.addApprove(approveProcessVO); |
| | | ApprovalInstanceDto approvalInstance = new ApprovalInstanceDto(); |
| | | approvalInstance.setTemplateId(approvalTemplateMapper.selectOne(new LambdaQueryWrapper<ApprovalTemplate>().eq(ApprovalTemplate::getBusinessType,5L).orderByDesc(ApprovalTemplate::getId).last("LIMIT 1")).getId()); |
| | | approvalInstance.setTemplateName(approvalTemplateMapper.selectOne(new LambdaQueryWrapper<ApprovalTemplate>().eq(ApprovalTemplate::getBusinessType,5L).orderByDesc(ApprovalTemplate::getId).last("LIMIT 1")).getTemplateName()); |
| | | approvalInstance.setBusinessId(purchaseLedger.getId()); |
| | | approvalInstance.setBusinessType(5L); |
| | | approvalInstance.setCurrentLevel(1); |
| | | approvalInstance.setApplicantId(loginUser.getUserId()); |
| | | approvalInstance.setTitle(purchaseLedger.getPurchaseContractNumber()+"审æ¹"); |
| | | approvalInstance.setApplicantName(loginUser.getNickName()); |
| | | approvalInstance.setApplyTime(LocalDateTime.now()); |
| | | approvalInstanceService.add(approvalInstance); |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | @Operation(summary = "æ£æµææ ç»´æ¤æ¥è¯¢") |
| | | @Log(title = "æ£æµææ ç»´æ¤æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public R<?> list(Long testStandardId) { |
| | | return R.ok(qualityTestStandardParamService.list(Wrappers.<QualityTestStandardParam>lambdaQuery().eq(QualityTestStandardParam::getTestStandardId,testStandardId))); |
| | | return R.ok(qualityTestStandardParamService.list(Wrappers.<QualityTestStandardParam>lambdaQuery() |
| | | .eq(QualityTestStandardParam::getTestStandardId, testStandardId) |
| | | .orderByDesc(QualityTestStandardParam::getCreateTime))); |
| | | } |
| | | |
| | | } |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @Operation(summary = "æ·»å æ¯ä»ä¸åè´§ä¿¡æ¯") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody PaymentShipping paymentShipping) { |
| | | String ord = OrderUtils.countTodayByCreateTime(paymentShippingMapper, "ORD","order_no"); |
| | | String ord = OrderUtils.countTodayByCreateTime(paymentShippingMapper, "ORD","order_no", paymentShipping.getCreateTime() != null ? paymentShipping.getCreateTime() : LocalDateTime.now()); |
| | | paymentShipping.setOrderNo(ord); |
| | | boolean save = paymentShippingService.save(paymentShipping); |
| | | return save ? success() : error(); |
| | |
| | | |
| | | // å¦æå·²ç»æè¿å¼ç¥¨æå款æä½,åä¸å
许ç¼è¾ |
| | | boolean hasReceiptOperation = receiptPaymentAmountTotal.compareTo(BigDecimal.ZERO) > 0; |
| | | salesLedgerVo.setIsEdit(hasReceiptOperation); |
| | | salesLedgerVo.setIsEdit(!hasReceiptOperation); |
| | | |
| | | salesLedgerVo.setStorageBlobVOs(fileUtil.getStorageBlobVOsByApplicationAndRecordTypeAndRecordId(ApplicationTypeEnum.FILE, RecordTypeEnum.SALES_LEDGER, ledgerId)); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.approve.bean.vo.ApproveProcessVO; |
| | | import com.ruoyi.approve.service.impl.ApproveProcessServiceImpl; |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.io.IOException; |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Log(title = "åè´§ä¿¡æ¯ç®¡ç", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody ShippingInfoDto req) throws Exception { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | String sh = OrderUtils.countTodayByCreateTime(shippingInfoMapper, "SH","shipping_no"); |
| | | // åè´§å®¡æ¹ |
| | | ApproveProcessVO approveProcessVO = new ApproveProcessVO(); |
| | | approveProcessVO.setApproveType(7); |
| | | approveProcessVO.setApproveDeptId(loginUser.getCurrentDeptId()); |
| | | approveProcessVO.setApproveReason(sh);//åè´§ç¼å· |
| | | approveProcessVO.setApproveUserIds(req.getApproveUserIds()); |
| | | approveProcessVO.setApproveUser(loginUser.getUserId()); |
| | | approveProcessVO.setApproveTime(LocalDate.now().toString()); |
| | | // å
ä¿ååè´§åï¼åå起审æ¹ï¼æ å®¡æ ¸äººèªå¨éè¿æ¶éè¦æåè´§ç¼å·åååè´§ç¶æã |
| | | req.setShippingNo(sh); |
| | | req.setStatus("å¾
å®¡æ ¸"); |
| | | boolean save = shippingInfoService.add(req); |
| | | if (!save) { |
| | | return AjaxResult.error(); |
| | | } |
| | | approveProcessService.addApprove(approveProcessVO); |
| | | return AjaxResult.success(); |
| | | return AjaxResult.success(shippingInfoService.addReq(req) ? "æ·»å æå" : "æ·»å 失败"); |
| | | } |
| | | |
| | | @Operation(summary = "åè´§æ£åºå") |
| | |
| | | private String remark; |
| | | |
| | | @Schema(description = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @Schema(description = "åå»ºç¨æ·") |
| | |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹æ¶é´") |
| | |
| | | private String shippingCarNumber; |
| | | |
| | | @Schema(description = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @Schema(description = "ä¿®æ¹æ¶é´") |
| | |
| | | List<ShippingProductDetailDto> getDetail(Long id); |
| | | |
| | | ShippingApproveDto getDateilByShippingNo(String shippingNo); |
| | | |
| | | boolean addReq(ShippingInfoDto req); |
| | | } |
| | |
| | | import java.math.RoundingMode; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | |
| | | ProductionPlan productionPlan = new ProductionPlan(); |
| | | productionPlan.setSalesLedgerId(salesLedgerProduct.getSalesLedgerId()); |
| | | productionPlan.setSalesLedgerProductId(salesLedgerProduct.getId()); |
| | | productionPlan.setMpsNo(generateNextPlanNo(LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")))); |
| | | productionPlan.setMpsNo(generateNextPlanNo(salesLedger.getEntryDate().toInstant() |
| | | .atZone(ZoneId.systemDefault()) |
| | | .toLocalDate().format(DateTimeFormatter.ofPattern("yyyyMMdd")))); |
| | | productionPlan.setProductModelId(salesLedgerProduct.getProductModelId()); |
| | | productionPlan.setQtyRequired(salesLedgerProduct.getQuantity()); |
| | | productionPlan.setSource("éå®"); |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.approve.bean.dto.ApprovalInstanceDto; |
| | | import com.ruoyi.approve.bean.vo.ApproveGetAndUpdateVo; |
| | | import com.ruoyi.approve.bean.vo.ApproveProcessVO; |
| | | import com.ruoyi.approve.mapper.ApprovalTemplateMapper; |
| | | import com.ruoyi.approve.pojo.ApprovalInstance; |
| | | import com.ruoyi.approve.pojo.ApprovalTemplate; |
| | | import com.ruoyi.approve.pojo.ApproveProcess; |
| | | import com.ruoyi.approve.service.ApprovalInstanceService; |
| | | import com.ruoyi.approve.service.impl.ApproveProcessServiceImpl; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | if (ObjectUtils.isNotEmpty(customer)) { |
| | | salesQuotation.setCustomer(customer.getCustomerName()); |
| | | } |
| | | String quotationNo = OrderUtils.countTodayByCreateTime(salesQuotationMapper, "QT","quotation_no"); |
| | | String quotationNo = OrderUtils.countTodayByCreateTime(salesQuotationMapper, "QT","quotation_no", salesQuotationDto.getCreateTime() != null ? salesQuotationDto.getCreateTime() : LocalDateTime.now()); |
| | | salesQuotation.setQuotationNo(quotationNo); |
| | | salesQuotation.setStatus("å¾
审æ¹"); |
| | | salesQuotationMapper.insert(salesQuotation); |
| | |
| | | }).collect(Collectors.toList()); |
| | | salesQuotationProductService.saveBatch(products); |
| | | // æ¥ä»·å®¡æ¹ |
| | | ApproveProcessVO approveProcessVO = new ApproveProcessVO(); |
| | | approveProcessVO.setApproveType(6); |
| | | approveProcessVO.setApproveDeptId(loginUser.getCurrentDeptId()); |
| | | approveProcessVO.setApproveReason(quotationNo); |
| | | approveProcessVO.setApproveUserIds(salesQuotationDto.getApproveUserIds()); |
| | | approveProcessVO.setApproveUser(loginUser.getUserId()); |
| | | approveProcessVO.setApproveTime(LocalDate.now().toString()); |
| | | approveProcessVO.setPrice(salesQuotationDto.getTotalAmount()); |
| | | ApprovalInstanceDto approvalInstance = new ApprovalInstanceDto(); |
| | | approvalInstance.setTemplateId(approvalTemplateMapper.selectOne(new LambdaQueryWrapper<ApprovalTemplate>().eq(ApprovalTemplate::getBusinessType,6L).orderByDesc(ApprovalTemplate::getId).last("LIMIT 1")).getId()); |
| | | approvalInstance.setTemplateName(approvalTemplateMapper.selectOne(new LambdaQueryWrapper<ApprovalTemplate>().eq(ApprovalTemplate::getBusinessType,6L).orderByDesc(ApprovalTemplate::getId).last("LIMIT 1")).getTemplateName()); |
| | | approvalInstance.setBusinessId(salesQuotation.getId()); |
| | | approvalInstance.setBusinessType(6L); |
| | | approvalInstance.setCurrentLevel(1); |
| | | approvalInstance.setTitle(quotationNo+"审æ¹"); |
| | | approvalInstance.setApplicantId(loginUser.getUserId()); |
| | | approvalInstance.setApplicantName(loginUser.getNickName()); |
| | | approvalInstance.setApplyTime(LocalDateTime.now()); |
| | | try { |
| | | approveProcessService.addApprove(approveProcessVO); |
| | | approvalInstanceService.add(approvalInstance); |
| | | } catch (Exception e) { |
| | | log.error("SalesQuotationServiceImpl approve error for quotationNo: {}", e); |
| | | throw new RuntimeException("审æ¹å¤±è´¥: " + e.getMessage(), e); |
| | | } |
| | | // æ¥ä»·å®¡æ¹ |
| | | ApprovalInstanceDto approvalInstanceDto = new ApprovalInstanceDto(); |
| | | approvalInstanceDto.setTemplateId(salesQuotationDto.getTemplateId()); |
| | | approvalInstanceDto.setBusinessId(salesQuotationDto.getId()); |
| | | approvalInstanceDto.setBusinessType(7L); |
| | | approvalInstanceDto.setTitle("æ¥ä»·ç¼å·ï¼" + quotationNo); |
| | | approvalInstanceDto.setApplicantId(SecurityUtils.getUserId()); |
| | | approvalInstanceDto.setTemplateName(approvalTemplateMapper.selectById(salesQuotationDto.getTemplateId()).getTemplateName()); |
| | | approvalInstanceDto.setApplicantName(SecurityUtils.getLoginUser().getNickName()); |
| | | approvalInstanceDto.setApplyTime(LocalDateTime.now()); |
| | | approvalInstanceService.add(approvalInstanceDto); |
| | | return true; |
| | | } |
| | | @Override |
| | |
| | | |
| | | salesQuotationProductService.saveBatch(products); |
| | | // ä¿®æ¹æ¥ä»·å®¡æ¹ |
| | | vo.setApproveUserIds(salesQuotationDto.getApproveUserIds()); |
| | | vo.setApproveType(6); |
| | | vo.setApproveReason(salesQuotationDto.getQuotationNo()); |
| | | approveProcessService.updateApproveUser(vo); |
| | | // å
ç»æä¹åæªç»æçæ¥ä»·å®¡æ¹ |
| | | approvalInstanceService.lambdaUpdate().set(ApprovalInstance::getStatus,"REJECTED").eq(ApprovalInstance::getBusinessId,salesQuotation.getId()).eq(ApprovalInstance::getBusinessType,6L).update(); |
| | | |
| | | ApprovalInstanceDto approvalInstance = new ApprovalInstanceDto(); |
| | | approvalInstance.setTemplateId(approvalTemplateMapper.selectOne(new LambdaQueryWrapper<ApprovalTemplate>().eq(ApprovalTemplate::getBusinessType,6L).orderByDesc(ApprovalTemplate::getId).last("LIMIT 1")).getId()); |
| | | approvalInstance.setTemplateName(approvalTemplateMapper.selectOne(new LambdaQueryWrapper<ApprovalTemplate>().eq(ApprovalTemplate::getBusinessType,6L).orderByDesc(ApprovalTemplate::getId).last("LIMIT 1")).getTemplateName()); |
| | | approvalInstance.setBusinessId(salesQuotation.getId()); |
| | | approvalInstance.setBusinessType(6L); |
| | | approvalInstance.setCurrentLevel(1); |
| | | approvalInstance.setTitle(salesQuotation.getQuotationNo()+"审æ¹"); |
| | | approvalInstance.setApplicantId(SecurityUtils.getUserId()); |
| | | approvalInstance.setApplicantName(SecurityUtils.getLoginUser().getNickName()); |
| | | approvalInstance.setApplyTime(LocalDateTime.now()); |
| | | try { |
| | | approvalInstanceService.add(approvalInstance); |
| | | } catch (Exception e) { |
| | | log.error("SalesQuotationServiceImpl approve error for quotationNo: {}", e); |
| | | throw new RuntimeException("审æ¹å¤±è´¥: " + e.getMessage(), e); |
| | | } |
| | | return true; |
| | | } |
| | | @Override |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.approve.bean.dto.ApprovalInstanceDto; |
| | | import com.ruoyi.approve.mapper.ApprovalTemplateMapper; |
| | | import com.ruoyi.approve.pojo.ApprovalTemplate; |
| | | import com.ruoyi.approve.pojo.ApproveProcess; |
| | | import com.ruoyi.approve.service.ApprovalInstanceService; |
| | | import com.ruoyi.approve.service.impl.ApproveProcessServiceImpl; |
| | | import com.ruoyi.basic.enums.ApplicationTypeEnum; |
| | | import com.ruoyi.basic.enums.RecordTypeEnum; |
| | | import com.ruoyi.basic.utils.FileUtil; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.common.enums.StockOutQualifiedRecordTypeEnum; |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.procurementrecord.bean.vo.ShippingProductVo; |
| | | import com.ruoyi.procurementrecord.utils.StockUtils; |
| | | import com.ruoyi.sales.dto.ShippingApproveDto; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | private final ApproveProcessServiceImpl approveProcessService; |
| | | private final FileUtil fileUtil; |
| | | private final ShippingProductDetailMapper shippingProductDetailMapper; |
| | | private final ApprovalTemplateMapper approvalTemplateMapper; |
| | | private final ApprovalInstanceService approvalInstanceService; |
| | | |
| | | @Override |
| | | public IPage<ShippingInfoDto> listPage(Page page, ShippingInfo req) { |
| | |
| | | shippingApproveDto.setShippingProductDetailDtoList(dateilByShippingNo); |
| | | return shippingApproveDto; |
| | | } |
| | | |
| | | @Override |
| | | public boolean addReq(ShippingInfoDto req) { |
| | | |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | String sh = OrderUtils.countTodayByCreateTime(shippingInfoMapper, "SH","shipping_no",req.getCreateTime()); |
| | | // å
ä¿ååè´§åï¼åå起审æ¹ï¼æ å®¡æ ¸äººèªå¨éè¿æ¶éè¦æåè´§ç¼å·åååè´§ç¶æã |
| | | req.setShippingNo(sh); |
| | | req.setStatus("å¾
å®¡æ ¸"); |
| | | boolean save = this.add(req); |
| | | // åè´§å®¡æ¹ |
| | | ApprovalInstanceDto approvalInstance = new ApprovalInstanceDto(); |
| | | approvalInstance.setTemplateId(approvalTemplateMapper.selectOne(new LambdaQueryWrapper<ApprovalTemplate>().eq(ApprovalTemplate::getBusinessType,6L).orderByDesc(ApprovalTemplate::getId).last("LIMIT 1")).getId()); |
| | | approvalInstance.setTemplateName(approvalTemplateMapper.selectOne(new LambdaQueryWrapper<ApprovalTemplate>().eq(ApprovalTemplate::getBusinessType,6L).orderByDesc(ApprovalTemplate::getId).last("LIMIT 1")).getTemplateName()); |
| | | approvalInstance.setBusinessId(req.getId()); |
| | | approvalInstance.setBusinessType(7L); |
| | | approvalInstance.setCurrentLevel(1); |
| | | approvalInstance.setTitle(sh+"审æ¹"); |
| | | approvalInstance.setApplicantId(loginUser.getUserId()); |
| | | approvalInstance.setApplicantName(loginUser.getNickName()); |
| | | approvalInstance.setApplyTime(LocalDateTime.now()); |
| | | approvalInstanceService.add(approvalInstance); |
| | | return true; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.staff.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.OrderItem; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceLocationConfig; |
| | |
| | | @Operation(summary = "å页æ¥è¯¢äººåæå¡è§åé
ç½®") |
| | | @GetMapping("/listPage") |
| | | public R listPage(Page page){ |
| | | page.addOrder(OrderItem.desc("id")); |
| | | return R.ok(personalAttendanceLocationConfigService.page(page)); |
| | | } |
| | | |
| | |
| | | schemeApplicableStaffLambdaQueryWrapper.like(SchemeApplicableStaff::getTitle, schemeApplicableStaff.getTitle()); |
| | | } |
| | | } |
| | | schemeApplicableStaffLambdaQueryWrapper.orderByDesc(SchemeApplicableStaff::getId); |
| | | Page<SchemeApplicableStaff> page1 = schemeApplicableStaffMapper.selectPage(page, schemeApplicableStaffLambdaQueryWrapper); |
| | | List<Long> collect = page1.getRecords().stream().map(SchemeApplicableStaff::getId).collect(Collectors.toList()); |
| | | if(CollectionUtils.isEmpty(collect)){ |
| | |
| | | staffSalaryMainLambdaQueryWrapper.eq(StaffSalaryMain::getStatus, staffSalaryMain.getStatus()); |
| | | } |
| | | } |
| | | staffSalaryMainLambdaQueryWrapper.orderByDesc(StaffSalaryMain::getId); |
| | | Page<StaffSalaryMain> page1 = staffSalaryMainMapper.selectPage(page, staffSalaryMainLambdaQueryWrapper); |
| | | page1.getRecords().forEach(main -> { |
| | | List<StaffSalaryDetail> staffSalaryDetailList = staffSalaryDetailMapper.selectList(new LambdaQueryWrapper<StaffSalaryDetail>().eq(StaffSalaryDetail::getMainId, main.getId())); |
| | |
| | | private String type; |
| | | |
| | | @Schema(description = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | |
| | | private String remark; |
| | | |
| | | @Schema(description = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import com.ruoyi.stock.dto.StockInRecordDto; |
| | | import com.ruoyi.stock.dto.StockInventoryDto; |
| | | import com.ruoyi.stock.dto.StockUninventoryDto; |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int add(StockInRecordDto stockInRecordDto) { |
| | | String no = OrderUtils.countTodayByCreateTime(stockInRecordMapper, "RK","inbound_batches"); |
| | | String no = OrderUtils.countTodayByCreateTime(stockInRecordMapper, "RK","inbound_batches", stockInRecordDto.getCreateTime() != null ? stockInRecordDto.getCreateTime() : LocalDateTime.now()); |
| | | stockInRecordDto.setInboundBatches(no); |
| | | StockInRecord stockInRecord = new StockInRecord(); |
| | | BeanUtils.copyProperties(stockInRecordDto, stockInRecord); |
| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import com.ruoyi.stock.dto.StockInventoryDto; |
| | | import com.ruoyi.stock.dto.StockOutRecordDto; |
| | | import com.ruoyi.stock.dto.StockUninventoryDto; |
| | |
| | | |
| | | @Override |
| | | public int add(StockOutRecordDto stockOutRecordDto) { |
| | | String no = OrderUtils.countTodayByCreateTime(stockOutRecordMapper, "CK","outbound_batches"); |
| | | String no = OrderUtils.countTodayByCreateTime(stockOutRecordMapper, "CK","outbound_batches", stockOutRecordDto.getCreateTime() != null ? stockOutRecordDto.getCreateTime() : LocalDateTime.now()); |
| | | stockOutRecordDto.setOutboundBatches(no); |
| | | if (StockOutQualifiedRecordTypeEnum.SALE_SHIP_STOCK_OUT.getCode().equals(stockOutRecordDto.getRecordType())){ |
| | | stockOutRecordDto.setApprovalStatus(3); |
| | |
| | | package com.ruoyi.technology.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | |
| | | |
| | | @Schema(description = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @Schema(description = "ä¿®æ¹äºº") |
| | |
| | | |
| | | @Schema(description = "ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @Schema(description = "é¨é¨ID") |
| | |
| | | private String description; |
| | | |
| | | @Schema(description = "å½å
¥æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @Schema(description = "æ´æ°æ¶é´") |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import com.ruoyi.technology.bean.dto.TechnologyRoutingDto; |
| | | import com.ruoyi.technology.bean.vo.TechnologyRoutingVo; |
| | | import com.ruoyi.production.mapper.ProductionOrderRoutingMapper; |
| | |
| | | |
| | | @Override |
| | | public Long saveTechnologyRouting(TechnologyRouting technologyRouting) { |
| | | String code = OrderUtils.countTodayByCreateTime(technologyRoutingMapper, "GYLX", "process_route_code"); |
| | | String code = OrderUtils.countTodayByCreateTime(technologyRoutingMapper, "GYLX", "process_route_code", technologyRouting.getCreateTime() != null ? technologyRouting.getCreateTime() : LocalDateTime.now()); |
| | | technologyRouting.setProcessRouteCode(code); |
| | | technologyRoutingMapper.insert(technologyRouting); |
| | | // 带å
¥bom产åç»æ |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | # 项ç®ç¸å
³é
ç½® |
| | | ruoyi: |
| | | # åç§° |
| | | name: RuoYi |
| | | # çæ¬ |
| | | version: 3.8.9 |
| | | # çæå¹´ä»½ |
| | | copyrightYear: 2025 |
| | | # æä»¶è·¯å¾ 示ä¾ï¼ Windowsé
ç½®D:/ruoyi/uploadPathï¼Linuxé
ç½® /home/ruoyi/uploadPathï¼ |
| | | profile: /javaWork/product-inventory-management/file |
| | | |
| | | # è·åipå°åå¼å
³ |
| | | addressEnabled: false |
| | | # éªè¯ç ç±»å math æ°åè®¡ç® char å符éªè¯ |
| | | captchaType: math |
| | | # åå审æ¹ç¼å·åç¼(é
ç½®æä»¶åç¼å½å) |
| | | approvalNumberPrefix: NEW |
| | | |
| | | # ä¸ªæ¨ Unipush é
ç½® |
| | | getui: |
| | | appId: PfjyAAE0FK64FaO1w2CMb1 |
| | | appKey: zTMb831OEL6J4GK1uE3Ob4 |
| | | masterSecret: K1GFtsv42v61tXGnF7SGE5 |
| | | domain: https://restapi.getui.cn/v2/ |
| | | # 离线æ¨é使ç¨çå
å/ç»ä»¶å |
| | | intentComponent: uni.app.UNI099A590/io.dcloud.PandoraEntry |
| | | |
| | | # å¼åç¯å¢é
ç½® |
| | | server: |
| | | # æå¡å¨çHTTP端å£ï¼é»è®¤ä¸º8080 |
| | | port: 9003 |
| | | servlet: |
| | | # åºç¨ç访é®è·¯å¾ |
| | | context-path: / |
| | | tomcat: |
| | | # tomcatçURIç¼ç |
| | | uri-encoding: UTF-8 |
| | | # è¿æ¥æ°æ»¡åçæéæ°ï¼é»è®¤ä¸º100 |
| | | accept-count: 1000 |
| | | threads: |
| | | # tomcatæå¤§çº¿ç¨æ°ï¼é»è®¤ä¸º200 |
| | | max: 800 |
| | | # Tomcatå¯å¨åå§åççº¿ç¨æ°ï¼é»è®¤å¼10 |
| | | min-spare: 100 |
| | | |
| | | # æ¥å¿é
ç½® |
| | | logging: |
| | | level: |
| | | com.ruoyi: warn |
| | | org.springframework: warn |
| | | |
| | | minio: |
| | | endpoint: http://114.132.189.42/ |
| | | port: 7019 |
| | | secure: false |
| | | accessKey: admin |
| | | secretKey: 12345678 |
| | | preview-expiry: 24 # é¢è§å°åé»è®¤24å°æ¶ |
| | | default-bucket: jxc |
| | | # ç¨æ·é
ç½® |
| | | user: |
| | | password: |
| | | # å¯ç æå¤§éè¯¯æ¬¡æ° |
| | | maxRetryCount: 5 |
| | | # å¯ç é宿¶é´ï¼é»è®¤10åéï¼ |
| | | lockTime: 10 |
| | | |
| | | # Springé
ç½® |
| | | spring: |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | druid: |
| | | # ä¸»åºæ°æ®æº |
| | | master: |
| | | url: jdbc:mysql://172.17.0.1:3306/product-inventory-management-ckgm?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: xd@123456.. |
| | | # ä»åºæ°æ®æº |
| | | slave: |
| | | # 仿°æ®æºå¼å
³/é»è®¤å
³é |
| | | enabled: false |
| | | url: |
| | | username: |
| | | password: |
| | | # åå§è¿æ¥æ° |
| | | initialSize: 5 |
| | | # æå°è¿æ¥æ± æ°é |
| | | minIdle: 10 |
| | | # æå¤§è¿æ¥æ± æ°é |
| | | maxActive: 20 |
| | | # é
ç½®è·åè¿æ¥çå¾
è¶
æ¶çæ¶é´ |
| | | maxWait: 60000 |
| | | # é
ç½®è¿æ¥è¶
æ¶æ¶é´ |
| | | connectTimeout: 30000 |
| | | # é
ç½®ç½ç»è¶
æ¶æ¶é´ |
| | | socketTimeout: 60000 |
| | | # é
ç½®é´éå¤ä¹
æè¿è¡ä¸æ¬¡æ£æµï¼æ£æµéè¦å
³éç空é²è¿æ¥ï¼å使¯æ¯«ç§ |
| | | timeBetweenEvictionRunsMillis: 60000 |
| | | # é
ç½®ä¸ä¸ªè¿æ¥å¨æ± 䏿å°çåçæ¶é´ï¼å使¯æ¯«ç§ |
| | | minEvictableIdleTimeMillis: 300000 |
| | | # é
ç½®ä¸ä¸ªè¿æ¥å¨æ± 䏿大çåçæ¶é´ï¼å使¯æ¯«ç§ |
| | | maxEvictableIdleTimeMillis: 900000 |
| | | # é
ç½®æ£æµè¿æ¥æ¯å¦ææ |
| | | validationQuery: SELECT 1 FROM DUAL |
| | | testWhileIdle: true |
| | | testOnBorrow: false |
| | | testOnReturn: false |
| | | webStatFilter: |
| | | enabled: true |
| | | statViewServlet: |
| | | enabled: true |
| | | # 设置ç½ååï¼ä¸å¡«åå
许ææè®¿é® |
| | | allow: |
| | | url-pattern: /druid/* |
| | | # æ§å¶å°ç®¡çç¨æ·ååå¯ç |
| | | login-username: ruoyi |
| | | login-password: 123456 |
| | | filter: |
| | | stat: |
| | | enabled: true |
| | | # æ
¢SQLè®°å½ |
| | | log-slow-sql: true |
| | | slow-sql-millis: 1000 |
| | | merge-sql: true |
| | | wall: |
| | | config: |
| | | multi-statement-allow: true |
| | | # èµæºä¿¡æ¯ |
| | | messages: |
| | | # å½é
åèµæºæä»¶è·¯å¾ |
| | | basename: i18n/messages |
| | | # æä»¶ä¸ä¼ |
| | | servlet: |
| | | multipart: |
| | | # å个æä»¶å¤§å° |
| | | max-file-size: 1GB |
| | | # 设置æ»ä¸ä¼ çæä»¶å¤§å° |
| | | max-request-size: 2GB |
| | | # æå¡æ¨¡å |
| | | devtools: |
| | | restart: |
| | | # çé¨ç½²å¼å
³ |
| | | enabled: false |
| | | # redis é
ç½® |
| | | data: |
| | | mongodb: |
| | | uri: mongodb://114.132.189.42:9028/chat_memory_db_ckgm |
| | | # redis é
ç½® |
| | | redis: |
| | | # å°å |
| | | # host: 127.0.0.1 |
| | | host: 172.17.0.1 |
| | | # 端å£ï¼é»è®¤ä¸º6379 |
| | | port: 6379 |
| | | # æ°æ®åºç´¢å¼ |
| | | database: 0 |
| | | # å¯ç |
| | | # password: root2022! |
| | | password: |
| | | |
| | | # è¿æ¥è¶
æ¶æ¶é´ |
| | | timeout: 10s |
| | | lettuce: |
| | | pool: |
| | | # è¿æ¥æ± ä¸çæå°ç©ºé²è¿æ¥ |
| | | min-idle: 0 |
| | | # è¿æ¥æ± ä¸çæå¤§ç©ºé²è¿æ¥ |
| | | max-idle: 8 |
| | | # è¿æ¥æ± çæå¤§æ°æ®åºè¿æ¥æ° |
| | | max-active: 8 |
| | | # #è¿æ¥æ± æå¤§é»å¡çå¾
æ¶é´ï¼ä½¿ç¨è´å¼è¡¨ç¤ºæ²¡æéå¶ï¼ |
| | | max-wait: -1ms |
| | | |
| | | # Quartz宿¶ä»»å¡é
ç½®ï¼æ°å¢é¨åï¼ |
| | | quartz: |
| | | job-store-type: jdbc # ä½¿ç¨æ°æ®åºåå¨ |
| | | jdbc: |
| | | initialize-schema: never # 馿¬¡è¿è¡æ¶èªå¨åå»ºè¡¨ç»æï¼æååæ¹ä¸ºnever |
| | | schema: classpath:org/quartz/impl/jdbcjobstore/tables_mysql_innodb.sql # MySQLè¡¨ç»æèæ¬ |
| | | properties: |
| | | org: |
| | | quartz: |
| | | scheduler: |
| | | instanceName: RuoYiScheduler |
| | | instanceId: AUTO |
| | | jobStore: |
| | | class: org.quartz.impl.jdbcjobstore.JobStoreTX |
| | | driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate # MySQLéé
|
| | | tablePrefix: qrtz_ # 表ååç¼ï¼ä¸èæ¬ä¸è´ |
| | | isClustered: false # åèç¹æ¨¡å¼ï¼éç¾¤éæ¹ä¸ºtrueï¼ |
| | | clusterCheckinInterval: 10000 |
| | | txIsolationLevelSerializable: true |
| | | threadPool: |
| | | class: org.quartz.simpl.SimpleThreadPool |
| | | threadCount: 10 # çº¿ç¨æ± å¤§å° |
| | | threadPriority: 5 |
| | | makeThreadsDaemons: true |
| | | updateCheck: false # å
³éçæ¬æ£æ¥ |
| | | # tokené
ç½® |
| | | token: |
| | | # 令çèªå®ä¹æ è¯ |
| | | header: Authorization |
| | | # 令çå¯é¥ |
| | | secret: xpAVjhCjQDaDB7mjPAzMDSbQWXNu2zYkTdDNUsPMS5Xx8QMmQVYN7n74eZrYJxDJ |
| | | # ä»¤çæææï¼é»è®¤30åéï¼ |
| | | expireTime: 450 |
| | | |
| | | # MyBatis Plusé
ç½® |
| | | mybatis-plus: |
| | | # æç´¢æå®å
å«å æ ¹æ®èªå·±çé¡¹ç®æ¥ |
| | | typeAliasesPackage: com.ruoyi.**.pojo |
| | | # é
ç½®mapperçæ«æï¼æ¾å°ææçmapper.xmlæ å°æä»¶ |
| | | mapperLocations: classpath*:mapper/**/*Mapper.xml |
| | | # å è½½å
¨å±çé
ç½®æä»¶ |
| | | configLocation: classpath:mybatis/mybatis-config.xml |
| | | global-config: |
| | | enable-sql-runner: true |
| | | db-config: |
| | | id-type: auto |
| | | |
| | | # PageHelperå页æä»¶ |
| | | pagehelper: |
| | | helperDialect: mysql |
| | | supportMethodsArguments: true |
| | | params: count=countSql |
| | | |
| | | # Swaggeré
ç½® |
| | | swagger: |
| | | # æ¯å¦å¼å¯swagger |
| | | enabled: true |
| | | # 请æ±åç¼ |
| | | pathMapping: /dev-api |
| | | |
| | | # 鲿¢XSSæ»å» |
| | | xss: |
| | | # è¿æ»¤å¼å
³ |
| | | enabled: true |
| | | # æé¤é¾æ¥ï¼å¤ä¸ªç¨éå·åéï¼ |
| | | excludes: /system/notice |
| | | # å¹é
龿¥ |
| | | urlPatterns: /system/*,/monitor/*,/tool/* |
| | | |
| | | # 代ç çæ |
| | | gen: |
| | | # ä½è
|
| | | author: ruoyi |
| | | # é»è®¤çæå
è·¯å¾ system éæ¹æèªå·±ç模ååç§° å¦ system monitor tool |
| | | packageName: com.ruoyi.project.system |
| | | # èªå¨å»é¤è¡¨åç¼ï¼é»è®¤æ¯true |
| | | autoRemovePre: false |
| | | # 表åç¼ï¼çæç±»åä¸ä¼å
å«è¡¨åç¼ï¼å¤ä¸ªç¨éå·åéï¼ |
| | | tablePrefix: sys_ |
| | | # æ¯å¦å
è®¸çææä»¶è¦çå°æ¬å°ï¼èªå®ä¹è·¯å¾ï¼ï¼é»è®¤ä¸å
许 |
| | | allowOverwrite: false |
| | | |
| | | # æä»¶ä¸ä¼ é
ç½® |
| | | file: |
| | | temp-dir: /javaWork/product-inventory-management/file/temp/uploads # 临æ¶ç®å½ |
| | | upload-dir: /javaWork/product-inventory-management/file/prod/uploads # æ£å¼ç®å½ |
| | | path: /javaWork/product-inventory-management/file # ä¸ä¼ ç®å½ |
| | | urlPrefix: /prod-api/common # 龿¥åç¼ |
| | | domain: http://1.15.17.182:9071 # åååç¼ |
| | | expired: 120 # è¿ææ¶é´(åä½:åé) |
| | | useLimit: 10 # ä½¿ç¨æ¬¡æ° |
| | | compress: true # æ¯å¦å缩 |
| | | needCompressSize: 10MB # å缩éå¼ |
| | | compressQuality: 0.5 # å缩质é(0.0-1.0) |
| | |
| | | å½åæ¥æï¼{{currentDate}}ï¼ä¸å½æ¶åºï¼ã |
| | | |
| | | å·¥ä½è§åï¼ |
| | | 1. ç¨æ·æåºâæ¥ãé®ãç»è®¡ãåæãé¢è¦ãå»ºè®®ãæ¥åâéæ±æ¶ï¼ä¼å
è°ç¨å·¥å
·è¿åç»æå JSONï¼ä¸ç¼é ä¸å¡æ°æ®ã |
| | | 2. å½ä¸ææ¬ã婿¶¦ãåºåèµéãç°éæµãé¢è¦ã驾驶è±ãæ¥æ¥å¨æ¥åºæ¯æ¶ï¼ä¼å
è°ç¨å¯¹åºå·¥å
·ã |
| | | 1. ç¨æ·æåºâæ¥ãé®ãç»è®¡ãåæãé¢è¦ãå»ºè®®ãæ¥åâç±»éæ±æ¶ï¼ä¼å
è°ç¨å·¥å
·è¿åç»æå JSONï¼ä¸ç¼é ä¸å¡æ°æ®ã |
| | | 2. å½ä¸ææ¬ã婿¶¦ãåºåèµéãç°éæµãé¢è¦ã驾驶è±ãæ¥æ¥ã卿¥çåºæ¯æ¶ï¼ä¼å
è°ç¨å¯¹åºå·¥å
·ã |
| | | 3. å·¥å
·è¿å JSON æ¶ï¼ç´æ¥è¾åºåå§ JSON å符串ï¼ä¸è¦é¢å¤å
裹 Markdownï¼ä¹ä¸è¦å¨åå追å è§£éææ¬ã |
| | | 4. å½ç¨æ·é®é¢ç¼ºå°æ¶é´èå´æ¶ï¼é»è®¤ä½¿ç¨å·¥å
·å
ç½®å£å¾ï¼å¦è¿30å¤©ãæ¬æãè¿90天ï¼ï¼å¹¶å¨åç»å¯æéç¨æ·è¡¥å
èå´ã |
| | | 5. ç¨æ·é®â为ä»ä¹å©æ¶¦ä¸éââåªä¸ªè®¢åäºæââåªä¸ªå®¢æ·æèµé±ââåªä¸ªå®¢æ·å©æ¶¦è´¡ç®æé«ââåªä¸ªè½¦é´/å·¥åºææ¬æé«âçé®é¢æ¶ï¼ä¼å
åºäºè®¢å婿¶¦ä¸å·¥åºææ¬åæå·¥å
·ä½çã |
| | | 6. åçå¿
须使ç¨ä¸æï¼è¥æ°æ®ä¸è¶³ä»¥å¾åºç»è®ºï¼æç¡®æåºç¼ºå°åªäºå
³é®å段æç鿡件ã |
| | | 7. ç¨æ·æå°âä»å¹´/æ¬æ/ä»å¤©/æè¿/䏿/å»å¹´âçç¸å¯¹æ¶é´æ¶ï¼å¿
é¡»ä¸¥æ ¼åºäºâå½åæ¥æâæ¢ç®ï¼ç¦æ¢èªè¡å设年份ã |
| | | 4. ç¨æ·æ²¡ææç¡®ç»åºæ¶é´ã客æ·ãä¾åºåã产åã订åãæ°éçç鿡件æ¶ï¼ä¸è¦èªè¡è¡¥å
æ¡ä»¶ï¼å·¥å
·åæ°ä¿æä¸ºç©ºï¼ç±å·¥å
·æå½åä¸å¡å£å¾æ¥è¯¢ã |
| | | 5. ç¨æ·æå°âæ¬å¨ãæ¬æãä»å¹´ãä»å¤©ãæè¿ãè¿30天ã䏿ãå»å¹´âçç¸å¯¹æ¶é´æ¶ï¼å¿
é¡»ä¸¥æ ¼åºäºâå½åæ¥æâæ¢ç®ï¼ç¦æ¢èªè¡å设年份ã |
| | | 6. ç¨æ·é®â为ä»ä¹å©æ¶¦ä¸éââåªä¸ªè®¢åäºæââåªä¸ªå®¢æ·æèµé±ââåªä¸ªå®¢æ·å©æ¶¦è´¡ç®æé«ââåªä¸ªå·¥åºææ¬æé«âçé®é¢æ¶ï¼ä¼å
åºäºè®¢å婿¶¦ä¸å·¥åºææ¬åæå·¥å
·ä½çã |
| | | 7. åçå¿
须使ç¨ä¸æï¼è¥æ°æ®ä¸è¶³ä»¥å¾åºç»è®ºï¼æç¡®æåºç¼ºå°åªäºå
³é®å段æç鿡件ã |
| | |
| | | AND A.apply_date BETWEEN #{req.startDate} AND #{req.endDate} |
| | | </if> |
| | | </where> |
| | | order by A.id desc |
| | | </select> |
| | | |
| | | <select id="getInboundBatchesBySupplier" |
| | |
| | | AND api.issue_date BETWEEN #{req.startDate} AND #{req.endDate} |
| | | </if> |
| | | </where> |
| | | order by api.id desc |
| | | </select> |
| | | <select id="getInboundBatchesBySupplier" |
| | | resultType="com.ruoyi.account.bean.vo.purchase.PurchaseInboundVo"> |
| | |
| | | AND app.payment_date BETWEEN #{req.startDate} AND #{req.endDate} |
| | | </if> |
| | | </where> |
| | | order by app.id desc |
| | | </select> |
| | | <select id="selectPayment" resultType="com.ruoyi.home.dto.IncomeExpenseAnalysisDto"> |
| | | SELECT DATE_FORMAT(payment_date, #{dateFormat}) AS dateStr, |
| | |
| | | AND A.apply_date BETWEEN #{req.startDate} AND #{req.endDate} |
| | | </if> |
| | | </where> |
| | | order by A.id desc |
| | | </select> |
| | | <select id="getOutboundBatchesByCustomer" |
| | | resultType="com.ruoyi.account.bean.vo.sales.SalesOutboundVo"> |
| | |
| | | AND A.collection_date BETWEEN #{req.startDate} AND #{req.endDate} |
| | | </if> |
| | | </where> |
| | | |
| | | order by A.id desc |
| | | </select> |
| | | <select id="existsByStockOutRecordId" resultType="java.lang.Boolean"> |
| | | SELECT COUNT(*) > 0 |
| | |
| | | AND asi.issue_date BETWEEN #{req.startDate} AND #{req.endDate} |
| | | </if> |
| | | </where> |
| | | order by asi.id desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | <select id="listPage" resultType="com.ruoyi.aftersalesservice.pojo.AfterSalesNearExpiry"> |
| | | select * from after_sales_near_expiry |
| | | where 1 = 1 |
| | | <if test="req.expireDate != null"> |
| | | AND expire_date = #{req.expireDate} |
| | | </if> |
| | | <if test="req.disDate != null"> |
| | | AND dis_date = #{req.disDate} |
| | | </if> |
| | | <if test="req.status != null"> |
| | | AND status = #{req.status} |
| | | </if> |
| | | <where> |
| | | <if test="req.expireDate != null"> |
| | | AND expire_date = #{req.expireDate} |
| | | </if> |
| | | <if test="req.disDate != null"> |
| | | AND dis_date = #{req.disDate} |
| | | </if> |
| | | <if test="req.status != null"> |
| | | AND status = #{req.status} |
| | | </if> |
| | | </where> |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | | </mapper> |
| | |
| | | <if test="req.serviceType != null"> |
| | | and service_type = #{req.serviceType} |
| | | </if> |
| | | order by update_time desc |
| | | order by create_time desc |
| | | </select> |
| | | <select id="countAfterSalesService" resultType="com.ruoyi.aftersalesservice.dto.CountDto"> |
| | | select |
| | |
| | | group by status |
| | | </select> |
| | | |
| | | </mapper> |
| | | </mapper> |
| | |
| | | and ai.applicant_name = #{ew.applicantName} |
| | | </if> |
| | | </where> |
| | | order by ai.id desc |
| | | order by ai.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <if test="req.approveType != null "> |
| | | and approve_type = #{req.approveType} |
| | | </if> |
| | | order by id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | and create_time <= #{ew.createTimeEnd} |
| | | </if> |
| | | </where> |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | and type = #{knowledgeBase.type} |
| | | </if> |
| | | </where> |
| | | |
| | | order by id desc |
| | | </select> |
| | | </mapper> |
| | | </mapper> |
| | |
| | | ) |
| | | </if> |
| | | </where> |
| | | order by c.id desc |
| | | </select> |
| | | |
| | | <select id="list" resultType="com.ruoyi.basic.vo.CustomerVo"> |
| | |
| | | ) |
| | | </if> |
| | | </where> |
| | | order by c.id desc |
| | | </select> |
| | | <select id="customewTransactions" resultType="com.ruoyi.sales.vo.CustomerTransactionsVo"> |
| | | select T1.customer_id, |
| | |
| | | AND c.customer_name LIKE CONCAT('%', #{customerName}, '%') |
| | | </if> |
| | | </where> |
| | | order by T1.customer_id desc |
| | | </select> |
| | | <select id="customewTransactionsDetails" |
| | | resultType="com.ruoyi.sales.vo.CustomerTransactionsDetailsVo"> |
| | |
| | | group by sl.id |
| | | )T3 on T3.id = sl.id |
| | | where sl.customer_id = #{customerId} |
| | | order by sl.id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | AND T1.is_white = #{supplierManageDto.isWhite} |
| | | </if> |
| | | </where> |
| | | order by T1.id desc |
| | | </select> |
| | | |
| | | <select id="supplierExportList" resultType="com.ruoyi.basic.excel.SupplierManageExcelDto"> |
| | |
| | | AND sm.supplier_name LIKE CONCAT('%',#{supplierName},'%') |
| | | </if> |
| | | </where> |
| | | order by T1.supplier_id desc |
| | | </select> |
| | | <select id="supplierTransactionsDetails" |
| | | resultType="com.ruoyi.purchase.vo.SupplierTransactionsDetailsVo"> |
| | |
| | | group by pl.id |
| | | )T3 on T3.id = pl.id |
| | | where pl.supplier_id = #{supplierId} |
| | | order by pl.id desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | and en.create_time between #{enterpriseNewsDto.createTimeStart} and #{enterpriseNewsDto.createTimeEnd} |
| | | </if> |
| | | </where> |
| | | order by en.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | and n.status = #{ew.status} |
| | | </if> |
| | | </where> |
| | | order by n.create_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | and rrm.category = #{ew.category} |
| | | </if> |
| | | </where> |
| | | order by rrm.id desc |
| | | </select> |
| | | </mapper> |
| | | </mapper> |
| | |
| | | </if> |
| | | </where> |
| | | GROUP BY sam.id |
| | | order by sam.id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | left join device_ledger dl on dm.device_ledger_id = dl.id |
| | | left join sys_user su on dm.create_user = su.user_id |
| | | <where> |
| | | 1 = 1 |
| | | <if test="deviceMaintenanceDto.deviceName != null"> |
| | | and dl.device_name like concat('%',#{deviceMaintenanceDto.deviceName},'%') |
| | | </if> |
| | |
| | | and dm.maintenance_actually_time < date_add(str_to_date(#{deviceMaintenanceDto.maintenanceActuallyTime}, '%Y-%m-%d'), interval 1 day) |
| | | </if> |
| | | </where> |
| | | order by dm.create_time desc |
| | | </select> |
| | | <select id="detailById" resultType="com.ruoyi.device.vo.DeviceMaintenanceVo"> |
| | | select dm.id, |
| | |
| | | from device_repair dr |
| | | left join device_ledger dl on dr.device_ledger_id = dl.id |
| | | <where> |
| | | 1 = 1 |
| | | <if test="deviceRepairDto.deviceName != null"> |
| | | and dl.device_name like concat('%',#{deviceRepairDto.deviceName},'%') |
| | | </if> |
| | |
| | | and dr.maintenance_time like concat('%',#{deviceRepairDto.maintenanceTimeStr},'%') |
| | | </if> |
| | | </where> |
| | | order by dr.create_time desc |
| | | </select> |
| | | <select id="detailById" resultType="com.ruoyi.device.vo.DeviceRepairVo"> |
| | | select dr.id, |
| | |
| | | AND record_date = DATE_FORMAT(#{req.recordDate},'%Y-%m-%d') |
| | | </if> |
| | | </where> |
| | | ORDER BY update_time DESC |
| | | ORDER BY create_time DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | AND t1.record_date = DATE_FORMAT(#{req.recordDate},'%Y-%m-%d') |
| | | </if> |
| | | </where> |
| | | ORDER BY t1.update_time DESC |
| | | ORDER BY t1.create_time DESC |
| | | </select> |
| | | <select id="list" resultType="com.ruoyi.measuringinstrumentledger.pojo.MeasuringInstrumentLedgerRecord"> |
| | | SELECT |
| | |
| | | </where> |
| | | ORDER BY t1.update_time DESC |
| | | </select> |
| | | </mapper> |
| | | </mapper> |
| | |
| | | and sp.name like concat('%',#{spareParts.name},'%') |
| | | </if> |
| | | </where> |
| | | order by sp.create_time desc |
| | | </select> |
| | | </mapper> |
| | | </mapper> |
| | |
| | | and sprr.source_type = #{params.sourceType} |
| | | </if> |
| | | </where> |
| | | order by sprr.create_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | and sl.sales_contract_no like concat('%',#{req.salesContractNo},'%') |
| | | </if> |
| | | </where> |
| | | order by rm.id desc |
| | | </select> |
| | | <select id="getReturnManagementDtoById" resultType="com.ruoyi.procurementrecord.bean.dto.ReturnManagementDto"> |
| | | select rm.*, |
| | |
| | | and pot.work_order_no like concat('%', #{c.workOrderNo}, '%') |
| | | </if> |
| | | </where> |
| | | order by pot.id desc |
| | | order by pot.production_order_id desc, poro.drag_sort |
| | | </select> |
| | | |
| | | <select id="selectTaskStatisticsByDate" resultType="com.ruoyi.home.dto.ProductionTaskStatisticsDto"> |
| | |
| | | <if test="c.inspectType != null "> |
| | | AND inspect_type =#{c.inspectType} |
| | | </if> |
| | | order by create_time desc |
| | | </select> |
| | | <select id="getQualityTestStandardByProductId" resultType="com.ruoyi.quality.pojo.QualityTestStandard"> |
| | | SELECT qts.* |
| | |
| | | END AS method |
| | | FROM quality_unqualified qu |
| | | LEFT JOIN product_model pm ON qu.model = pm.id |
| | | where |
| | | 1=1 |
| | | <if test="qualityUnqualified.inspectType != null "> |
| | | AND inspect_type = #{qualityUnqualified.inspectType} |
| | | </if> |
| | | <if test="qualityUnqualified.inspectState != null "> |
| | | AND inspect_state = #{qualityUnqualified.inspectState} |
| | | </if> |
| | | <if test="qualityUnqualified.productName != null and qualityUnqualified.productName != '' "> |
| | | AND product_name = #{qualityUnqualified.productName} |
| | | </if> |
| | | <if test="qualityUnqualified.entryDateStart != null and qualityUnqualified.entryDateStart != '' "> |
| | | AND check_time >= DATE_FORMAT(#{qualityUnqualified.entryDateStart},'%Y-%m-%d') |
| | | </if> |
| | | <if test="qualityUnqualified.entryDateEnd != null and qualityUnqualified.entryDateEnd != '' "> |
| | | AND check_time <= DATE_FORMAT(#{qualityUnqualified.entryDateEnd},'%Y-%m-%d') |
| | | </if> |
| | | <where> |
| | | <if test="qualityUnqualified.inspectType != null "> |
| | | AND inspect_type = #{qualityUnqualified.inspectType} |
| | | </if> |
| | | <if test="qualityUnqualified.inspectState != null "> |
| | | AND inspect_state = #{qualityUnqualified.inspectState} |
| | | </if> |
| | | <if test="qualityUnqualified.productName != null and qualityUnqualified.productName != '' "> |
| | | AND product_name = #{qualityUnqualified.productName} |
| | | </if> |
| | | <if test="qualityUnqualified.entryDateStart != null and qualityUnqualified.entryDateStart != '' "> |
| | | AND check_time >= DATE_FORMAT(#{qualityUnqualified.entryDateStart},'%Y-%m-%d') |
| | | </if> |
| | | <if test="qualityUnqualified.entryDateEnd != null and qualityUnqualified.entryDateEnd != '' "> |
| | | AND check_time <= DATE_FORMAT(#{qualityUnqualified.entryDateEnd},'%Y-%m-%d') |
| | | </if> |
| | | </where> |
| | | order by qu.create_time desc |
| | | </select> |
| | | <select id="qualityUnqualifiedExport" resultType="com.ruoyi.quality.pojo.QualityUnqualified"> |
| | | SELECT |
| | |
| | | from sales_ledger sl |
| | | left join purchase_ledger pl on sl.id = pl.sales_ledger_id |
| | | left join customer c on sl.customer_id = c.id |
| | | where 1=1 |
| | | <if test="customerName != null and customerName != '' "> |
| | | and c.customer_name like concat('%',#{customerName},'%') |
| | | </if> |
| | | <where> |
| | | <if test="customerName != null and customerName != '' "> |
| | | and c.customer_name like concat('%',#{customerName},'%') |
| | | </if> |
| | | </where> |
| | | order by sl.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | AND t1.status = #{salesQuotationDto.status} |
| | | </if> |
| | | </where> |
| | | order by t1.id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | and personal_attendance_records.date >= #{params.date} |
| | | and personal_attendance_records.date < DATE_ADD(DATE(#{params.date}), INTERVAL 1 DAY) |
| | | </if> |
| | | order by personal_attendance_records.id desc |
| | | </select> |
| | | |
| | | <!-- æ¥è¯¢æå®æ¥ææ²¡æèå¤è®°å½çå¨èåå·¥ï¼å¨æå®æ¶é´ä¹åå
¥èçï¼ --> |
| | |
| | | </if> |
| | | </where> |
| | | GROUP BY u.id, u.staff_name |
| | | ORDER BY MAX(s.create_time) |
| | | ORDER BY MAX(s.create_time) desc |
| | | </select> |
| | | |
| | | |
| | | <select id="performanceShiftYear" resultType="java.util.Map"> |
| | | SELECT |
| | | u.staff_name name, |
| | |
| | | <if test="c.staffName != null and c.staffName != '' "> |
| | | AND soj.staff_name LIKE CONCAT('%',#{c.staffName},'%') |
| | | </if> |
| | | order by staff_leave.create_time desc |
| | | </select> |
| | | <select id="staffLeaveList" resultType="com.ruoyi.staff.dto.StaffLeaveDto"> |
| | | SELECT |
| | |
| | | sys_post sp ON sp.post_id = soj.sys_post_id |
| | | LEFT JOIN |
| | | sys_dept sd ON sd.dept_id = soj.sys_dept_id |
| | | where 1=1 |
| | | <if test="c.staffName != null and c.staffName != '' "> |
| | | AND soj.staff_name LIKE CONCAT('%',#{c.staffName},'%') |
| | | </if> |
| | | <where> |
| | | <if test="c.staffName != null and c.staffName != '' "> |
| | | AND soj.staff_name LIKE CONCAT('%',#{c.staffName},'%') |
| | | </if> |
| | | </where> |
| | | order by staff_leave.create_time desc |
| | | </select> |
| | | |
| | | <select id="staffLeaveReasonAnalytics" resultType="com.ruoyi.staff.dto.StaffLeaveDto"> |
| | |
| | | <if test="staffOnJob.contractStartTime != null"> |
| | | HAVING MIN(t1.contract_start_time) = #{staffOnJob.contractStartTime} |
| | | </if> |
| | | order by staff_on_job.create_time desc |
| | | </select> |
| | | <select id="staffOnJobList" resultType="com.ruoyi.staff.dto.StaffOnJobDto"> |
| | | SELECT |
| | |
| | | sys_post sp ON sp.post_id = staff_on_job.sys_post_id |
| | | LEFT JOIN |
| | | sys_dept sd ON sd.dept_id = staff_on_job.sys_dept_id |
| | | where 1=1 |
| | | <if test="staffOnJob.staffState != null"> |
| | | AND staff_state = #{staffOnJob.staffState} |
| | | </if> |
| | | <if test="staffOnJob.staffName != null and staffOnJob.staffName != '' "> |
| | | AND staff_name LIKE CONCAT('%',#{staffOnJob.staffName},'%') |
| | | </if> |
| | | <where> |
| | | <if test="staffOnJob.staffState != null"> |
| | | AND staff_state = #{staffOnJob.staffState} |
| | | </if> |
| | | <if test="staffOnJob.staffName != null and staffOnJob.staffName != '' "> |
| | | AND staff_name LIKE CONCAT('%',#{staffOnJob.staffName},'%') |
| | | </if> |
| | | </where> |
| | | order by staff_on_job.create_time desc |
| | | </select> |
| | | <!-- ç»è®¡æå®æ¥æçå¨èåå·¥æ° --> |
| | | <select id="countOnJobStaffByDate" resultType="java.lang.Integer"> |
| | |
| | | unit, |
| | | product_name, |
| | | product_id |
| | | order by combined.create_time desc |
| | | </select> |
| | | |
| | | <select id="listStockInventoryExportData" resultType="com.ruoyi.stock.execl.StockInventoryExportData"> |
| | |
| | | and sir.create_time <= #{ew.endMonth} |
| | | </if> |
| | | </where> |
| | | order by sir.id desc |
| | | </select> |
| | | |
| | | <select id="stockInAndOutRecord" resultType="com.ruoyi.stock.dto.StockInventoryDto"> |
| | |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="staffCount" column="staff_count" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <sql id="selectDeptVo"> |
| | | select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time |
| | | select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time |
| | | from sys_dept d |
| | | order by d.create_time desc |
| | | </sql> |
| | | |
| | | <select id="selectDeptList" parameterType="com.ruoyi.project.system.domain.SysDept" resultMap="SysDeptResult"> |
| | |
| | | <!-- æ°æ®èå´è¿æ»¤ --> |
| | | ${params.dataScope} |
| | | group by d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time |
| | | order by d.parent_id, d.order_num |
| | | order by d.parent_id asc, d.order_num asc, d.create_time desc |
| | | </select> |
| | | |
| | | |
| | | <select id="selectDeptListByRoleId" resultType="java.lang.Long"> |
| | | select d.dept_id |
| | | from sys_dept d |
| | |
| | | <if test="deptCheckStrictly"> |
| | | and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId}) |
| | | </if> |
| | | order by d.parent_id, d.order_num |
| | | order by d.parent_id asc, d.order_num asc, d.create_time desc |
| | | </select> |
| | | |
| | | |
| | | <select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult"> |
| | | select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, |
| | | (select dept_name from sys_dept where dept_id = d.parent_id) parent_name, |
| | | d.dept_nick |
| | | from sys_dept d |
| | | where d.dept_id = #{deptId} |
| | | order by d.create_time desc |
| | | </select> |
| | | |
| | | |
| | | <select id="checkDeptExistUser" parameterType="Long" resultType="int"> |
| | | select count(1) from sys_user_dept where dept_id = #{deptId} |
| | | </select> |
| | | |
| | | |
| | | <select id="hasChildByDeptId" parameterType="Long" resultType="int"> |
| | | select count(1) from sys_dept |
| | | where del_flag = '0' and parent_id = #{deptId} limit 1 |
| | | </select> |
| | | |
| | | |
| | | <select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult"> |
| | | select * from sys_dept where find_in_set(#{deptId}, ancestors) |
| | | </select> |
| | | |
| | | |
| | | <select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int"> |
| | | select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors) |
| | | </select> |
| | | |
| | | |
| | | <select id="checkDeptNameUnique" resultMap="SysDeptResult"> |
| | | <include refid="selectDeptVo"/> |
| | | where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1 |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertDept" parameterType="com.ruoyi.project.system.domain.SysDept"> |
| | | insert into sys_dept( |
| | | <if test="deptId != null and deptId != 0">dept_id,</if> |
| | |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <update id="updateDept" parameterType="com.ruoyi.project.system.domain.SysDept"> |
| | | update sys_dept |
| | | <set> |
| | |
| | | </set> |
| | | where dept_id = #{deptId} |
| | | </update> |
| | | |
| | | |
| | | <update id="updateDeptChildren" parameterType="java.util.List"> |
| | | update sys_dept set ancestors = |
| | | <foreach collection="depts" item="item" index="index" |
| | |
| | | #{item.deptId} |
| | | </foreach> |
| | | </update> |
| | | |
| | | |
| | | <update id="updateDeptStatusNormal" parameterType="Long"> |
| | | update sys_dept set status = '0' where dept_id in |
| | | update sys_dept set status = '0' where dept_id in |
| | | <foreach collection="array" item="deptId" open="(" separator="," close=")"> |
| | | #{deptId} |
| | | </foreach> |
| | | </update> |
| | | |
| | | |
| | | <delete id="deleteDeptById" parameterType="Long"> |
| | | update sys_dept set del_flag = '2' where dept_id = #{deptId} |
| | | </delete> |
| | |
| | | WHERE parent_id = 100; |
| | | </select> |
| | | |
| | | </mapper> |
| | | </mapper> |
| | |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <sql id="selectDictTypeVo"> |
| | | select dict_id, dict_name, dict_type, status, create_by, create_time, remark |
| | | select dict_id, dict_name, dict_type, status, create_by, create_time, remark |
| | | from sys_dict_type |
| | | </sql> |
| | | |
| | |
| | | and date_format(create_time,'%Y%m%d') <= date_format(#{params.endTime},'%Y%m%d') |
| | | </if> |
| | | </where> |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | |
| | | <select id="selectDictTypeAll" resultMap="SysDictTypeResult"> |
| | | <include refid="selectDictTypeVo"/> |
| | | </select> |
| | | |
| | | |
| | | <select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult"> |
| | | <include refid="selectDictTypeVo"/> |
| | | where dict_id = #{dictId} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult"> |
| | | <include refid="selectDictTypeVo"/> |
| | | where dict_type = #{dictType} |
| | | </select> |
| | | |
| | | |
| | | <select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult"> |
| | | <include refid="selectDictTypeVo"/> |
| | | where dict_type = #{dictType} limit 1 |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteDictTypeById" parameterType="Long"> |
| | | delete from sys_dict_type where dict_id = #{dictId} |
| | | </delete> |
| | | |
| | | |
| | | <delete id="deleteDictTypeByIds" parameterType="Long"> |
| | | delete from sys_dict_type where dict_id in |
| | | <foreach collection="array" item="dictId" open="(" separator="," close=")"> |
| | | #{dictId} |
| | | </foreach> |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <update id="updateDictType" parameterType="com.ruoyi.project.system.domain.SysDictType"> |
| | |
| | | </set> |
| | | where dict_id = #{dictId} |
| | | </update> |
| | | |
| | | |
| | | <insert id="insertDictType" parameterType="com.ruoyi.project.system.domain.SysDictType"> |
| | | insert into sys_dict_type( |
| | | <if test="dictName != null and dictName != ''">dict_name,</if> |
| | |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | | |
| | | </mapper> |
| | | |
| | | </mapper> |
| | |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="remark" column="remark" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <sql id="selectPostVo"> |
| | | select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark |
| | | select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark |
| | | from sys_post |
| | | </sql> |
| | | |
| | | |
| | | <select id="selectPostList" parameterType="com.ruoyi.project.system.domain.SysPost" resultMap="SysPostResult"> |
| | | <include refid="selectPostVo"/> |
| | | <where> |
| | |
| | | AND post_name like concat('%', #{postName}, '%') |
| | | </if> |
| | | </where> |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | |
| | | <select id="selectPostAll" resultMap="SysPostResult"> |
| | | <include refid="selectPostVo"/> |
| | | </select> |
| | | |
| | | |
| | | <select id="selectPostById" parameterType="Long" resultMap="SysPostResult"> |
| | | <include refid="selectPostVo"/> |
| | | where post_id = #{postId} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectPostListByUserId" parameterType="Long" resultType="Long"> |
| | | select p.post_id |
| | | from sys_post p |
| | |
| | | left join sys_user u on u.user_id = up.user_id |
| | | where u.user_id = #{userId} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectPostsByUserName" parameterType="String" resultMap="SysPostResult"> |
| | | select p.post_id, p.post_name, p.post_code |
| | | from sys_post p |
| | |
| | | left join sys_user u on u.user_id = up.user_id |
| | | where u.user_name = #{userName} |
| | | </select> |
| | | |
| | | |
| | | <select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult"> |
| | | <include refid="selectPostVo"/> |
| | | where post_name=#{postName} limit 1 |
| | | </select> |
| | | |
| | | |
| | | <select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult"> |
| | | <include refid="selectPostVo"/> |
| | | where post_code=#{postCode} limit 1 |
| | | </select> |
| | | |
| | | |
| | | <update id="updatePost" parameterType="com.ruoyi.project.system.domain.SysPost"> |
| | | update sys_post |
| | | <set> |
| | |
| | | </set> |
| | | where post_id = #{postId} |
| | | </update> |
| | | |
| | | |
| | | <insert id="insertPost" parameterType="com.ruoyi.project.system.domain.SysPost" useGeneratedKeys="true" keyProperty="postId"> |
| | | insert into sys_post( |
| | | <if test="postId != null and postId != 0">post_id,</if> |
| | |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <delete id="deletePostById" parameterType="Long"> |
| | | delete from sys_post where post_id = #{postId} |
| | | </delete> |
| | | |
| | | |
| | | <delete id="deletePostByIds" parameterType="Long"> |
| | | delete from sys_post where post_id in |
| | | <foreach collection="array" item="postId" open="(" separator="," close=")"> |
| | | #{postId} |
| | | </foreach> |
| | | </foreach> |
| | | </delete> |
| | | |
| | | </mapper> |
| | | </mapper> |
| | |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="remark" column="remark" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <sql id="selectRoleVo"> |
| | | select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly, |
| | | r.status, r.del_flag, r.create_time, r.remark |
| | | r.status, r.del_flag, r.create_time, r.remark |
| | | from sys_role r |
| | | left join sys_user_role ur on ur.role_id = r.role_id |
| | | left join sys_user u on u.user_id = ur.user_id |
| | |
| | | ${params.dataScope} |
| | | order by r.role_sort |
| | | </select> |
| | | |
| | | |
| | | <select id="selectRolePermissionByUserId" parameterType="Long" resultMap="SysRoleResult"> |
| | | <include refid="selectRoleVo"/> |
| | | WHERE r.del_flag = '0' and ur.user_id = #{userId} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectRoleAll" resultMap="SysRoleResult"> |
| | | <include refid="selectRoleVo"/> |
| | | WHERE r.del_flag = '0' |
| | | </select> |
| | | |
| | | |
| | | <select id="selectRoleListByUserId" parameterType="Long" resultType="Long"> |
| | | select r.role_id |
| | | from sys_role r |
| | |
| | | left join sys_user u on u.user_id = ur.user_id |
| | | where u.user_id = #{userId} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectRoleById" parameterType="Long" resultMap="SysRoleResult"> |
| | | <include refid="selectRoleVo"/> |
| | | where r.role_id = #{roleId} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectRolesByUserName" parameterType="String" resultMap="SysRoleResult"> |
| | | <include refid="selectRoleVo"/> |
| | | WHERE r.del_flag = '0' and u.user_name = #{userName} |
| | | </select> |
| | | |
| | | |
| | | <select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult"> |
| | | <include refid="selectRoleVo"/> |
| | | where r.role_name=#{roleName} and r.del_flag = '0' limit 1 |
| | | </select> |
| | | |
| | | |
| | | <select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult"> |
| | | <include refid="selectRoleVo"/> |
| | | where r.role_key=#{roleKey} and r.del_flag = '0' limit 1 |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertRole" parameterType="com.ruoyi.project.system.domain.SysRole" useGeneratedKeys="true" keyProperty="roleId"> |
| | | insert into sys_role( |
| | | <if test="roleId != null and roleId != 0">role_id,</if> |
| | |
| | | sysdate() |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <update id="updateRole" parameterType="com.ruoyi.project.system.domain.SysRole"> |
| | | update sys_role |
| | | <set> |
| | |
| | | </set> |
| | | where role_id = #{roleId} |
| | | </update> |
| | | |
| | | |
| | | <delete id="deleteRoleById" parameterType="Long"> |
| | | update sys_role set del_flag = '2' where role_id = #{roleId} |
| | | </delete> |
| | | |
| | | |
| | | <delete id="deleteRoleByIds" parameterType="Long"> |
| | | update sys_role set del_flag = '2' where role_id in |
| | | <foreach collection="array" item="roleId" open="(" separator="," close=")"> |
| | | #{roleId} |
| | | </foreach> |
| | | </foreach> |
| | | </delete> |
| | | |
| | | </mapper> |
| | | |
| | | </mapper> |
| | |
| | | </if> |
| | | <!-- æ°æ®èå´è¿æ»¤ --> |
| | | ${params.dataScope} |
| | | ORDER BY u.create_time DESC |
| | | </select> |
| | | |
| | | <select id="selectAllocatedList" parameterType="com.ruoyi.project.system.domain.SysUser" resultMap="SysUserResult"> |
| | |
| | | </if> |
| | | <!-- æ°æ®èå´è¿æ»¤ --> |
| | | ${params.dataScope} |
| | | ORDER BY u.create_time DESC |
| | | </select> |
| | | |
| | | <select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult"> |
| | | <include refid="selectUserVo"/> |
| | | where u.user_name = #{userName} and u.del_flag = '0' |
| | | ORDER BY u.create_time DESC |
| | | </select> |
| | | |
| | | <select id="selectUserById" parameterType="Long" resultMap="SysUserResult"> |
| | | <include refid="selectUserVo"/> |
| | | where u.user_id = #{userId} |
| | | and u.del_flag = '0' |
| | | ORDER BY u.create_time DESC |
| | | </select> |
| | | |
| | | <select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult"> |
| | |
| | | </if> |
| | | and u.del_flag = '0' |
| | | </where> |
| | | ORDER BY u.create_time DESC |
| | | </select> |
| | | <select id="selectRegistrantIds" resultType="com.ruoyi.project.system.domain.SysUser"> |
| | | SELECT user_id, nick_name FROM sys_user |
| | |
| | | 1=0 <!-- 空å表æ¶è¿åç©ºç»æ --> |
| | | </if> |
| | | </where> |
| | | ORDER BY sys_user.create_time DESC |
| | | </select> |
| | | <select id="selectUsersByIds" resultType="com.ruoyi.project.system.domain.SysUser"> |
| | | SELECT user_id, nick_name |
| | |
| | | #{id} |
| | | </foreach> |
| | | and del_flag = '0' |
| | | ORDER BY sys_user.create_time DESC |
| | | </select> |
| | | <select id="selectUserByNickName" resultType="com.ruoyi.project.system.domain.SysUser" |
| | | parameterType="java.lang.String"> |
| | |
| | | and sr.status = '0' |
| | | and su.status = '0' |
| | | and su.del_flag = '0' |
| | | ORDER BY su.create_time DESC |
| | | </select> |
| | | <select id="getUserByPerms" resultType="java.lang.Long"> |
| | | select distinct t5.user_id |
| | |
| | | and t.type = #{c.type} |
| | | </if> |
| | | </where> |
| | | order by t.id asc |
| | | order by t.id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | and top1.technology_param_id = #{paramId} |
| | | </if> |
| | | </where> |
| | | order by top1.id asc |
| | | order by top1.id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | <if test="documentationBorrowManagement.entryDateEnd != null and documentationBorrowManagement.entryDateEnd != ''"> |
| | | and borrow_date <= DATE_FORMAT(#{documentationBorrowManagement.entryDateEnd},'%Y-%m-%d') |
| | | </if> |
| | | order by dbm.create_time desc |
| | | </select> |
| | | <select id="export" resultType="com.ruoyi.warehouse.dto.DocumentationBorrowManagementDto"> |
| | | select dbm.*,doc.doc_name |
| | |
| | | <if test="documentation.id != null"> |
| | | and doc.id = #{documentation.id} |
| | | </if> |
| | | order by doc.create_time desc |
| | | </select> |
| | | <select id="listByDocumentClassificationId" resultType="com.ruoyi.warehouse.dto.DocumentationDto"> |
| | | SELECT |
| | |
| | | <if test="documentationReturnManagement.entryDateEnd != null and documentationReturnManagement.entryDateEnd != ''"> |
| | | and return_date <= DATE_FORMAT(#{documentationReturnManagement.entryDateEnd},'%Y-%m-%d') |
| | | </if> |
| | | order by dbm.create_time desc |
| | | </select> |
| | | |
| | | <select id="exportrevent" resultType="com.ruoyi.warehouse.dto.ReturnExportDto"> |
| | |
| | | and wgsr.id = #{warehouseGoodsShelvesRowcol.id} |
| | | </if> |
| | | </where> |
| | | order by wgsr.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |