Commit d553b15e71f257206686259e07d8fcd882fb9d9b
Merge branch 'master' of http://39.98.150.180/antissoft/lvqianmeiye_ERP
Showing
35 changed files
with
3491 additions
and
421 deletions
antis-ncc-admin/public/index.html
| ... | ... | @@ -8,6 +8,10 @@ |
| 8 | 8 | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> |
| 9 | 9 | <link rel="icon" href="<%= BASE_URL %>favicon.ico"> |
| 10 | 10 | <title><%= webpackConfig.name %></title> |
| 11 | + <!-- Inter Font - Professional, modern font for enterprise applications --> | |
| 12 | + <link rel="preconnect" href="https://fonts.googleapis.com"> | |
| 13 | + <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | |
| 14 | + <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet"> | |
| 11 | 15 | <script src="<%= BASE_URL %>cdn/echarts/4.2.1/echarts.min.js"></script> |
| 12 | 16 | |
| 13 | 17 | </head> | ... | ... |
antis-ncc-admin/src/styles/index.scss
| ... | ... | @@ -10,7 +10,7 @@ body { |
| 10 | 10 | -moz-osx-font-smoothing: grayscale; |
| 11 | 11 | -webkit-font-smoothing: antialiased; |
| 12 | 12 | text-rendering: optimizeLegibility; |
| 13 | - font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif; | |
| 13 | + font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | // label { | ... | ... |
antis-ncc-admin/src/views/extend/storeDashboard/index.vue
| ... | ... | @@ -37,9 +37,9 @@ |
| 37 | 37 | <div class="store-meta"> |
| 38 | 38 | <span class="meta-item"><i class="el-icon-tickets"></i> {{ currentStoreCode || '-' }}</span> |
| 39 | 39 | <span class="meta-item"><i class="el-icon-location"></i> {{ currentStoreAddress || '-' |
| 40 | - }}</span> | |
| 40 | + }}</span> | |
| 41 | 41 | <span class="meta-item"><i class="el-icon-calendar"></i> {{ queryParams.month || '当前月份' |
| 42 | - }}</span> | |
| 42 | + }}</span> | |
| 43 | 43 | </div> |
| 44 | 44 | </div> |
| 45 | 45 | </div> |
| ... | ... | @@ -74,6 +74,30 @@ |
| 74 | 74 | formatMoney(storeData.Performance.NetPerformance) : '0.00' }}</div> |
| 75 | 75 | <div class="stat-trend" v-if="false">+15.8%</div> |
| 76 | 76 | </div> |
| 77 | + <div class="core-stat-item" | |
| 78 | + style="background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%); border-left: 4px solid #ec4899;"> | |
| 79 | + <div class="stat-label">生美业绩</div> | |
| 80 | + <div class="stat-value">¥{{ storeData && storeData.Performance && | |
| 81 | + storeData.Performance.LifeBeautyPerformance ? | |
| 82 | + formatMoney(storeData.Performance.LifeBeautyPerformance) : '0.00' }}</div> | |
| 83 | + <div class="stat-trend" v-if="false">+12.5%</div> | |
| 84 | + </div> | |
| 85 | + <div class="core-stat-item" | |
| 86 | + style="background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); border-left: 4px solid #3b82f6;"> | |
| 87 | + <div class="stat-label">医美业绩</div> | |
| 88 | + <div class="stat-value">¥{{ storeData && storeData.Performance && | |
| 89 | + storeData.Performance.MedicalBeautyPerformance ? | |
| 90 | + formatMoney(storeData.Performance.MedicalBeautyPerformance) : '0.00' }}</div> | |
| 91 | + <div class="stat-trend" v-if="false">+8.3%</div> | |
| 92 | + </div> | |
| 93 | + <div class="core-stat-item" | |
| 94 | + style="background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); border-left: 4px solid #22c55e;"> | |
| 95 | + <div class="stat-label">科美业绩</div> | |
| 96 | + <div class="stat-value">¥{{ storeData && storeData.Performance && | |
| 97 | + storeData.Performance.TechBeautyPerformance ? | |
| 98 | + formatMoney(storeData.Performance.TechBeautyPerformance) : '0.00' }}</div> | |
| 99 | + <div class="stat-trend" v-if="false">+2.1%</div> | |
| 100 | + </div> | |
| 77 | 101 | </div> |
| 78 | 102 | </div> |
| 79 | 103 | </div> |
| ... | ... | @@ -182,7 +206,7 @@ |
| 182 | 206 | <el-table-column prop="itemName" label="品项名称" min-width="180" /> |
| 183 | 207 | <el-table-column prop="billingAmount" label="开单金额" width="140" align="right"> |
| 184 | 208 | <template slot-scope="scope"> |
| 185 | - <span style="font-weight: 600; color: #67C23A;">¥{{ | |
| 209 | + <span style="font-weight: 600; color: #22c55e;">¥{{ | |
| 186 | 210 | formatMoney(scope.row.billingAmount) }}</span> |
| 187 | 211 | </template> |
| 188 | 212 | </el-table-column> |
| ... | ... | @@ -211,15 +235,15 @@ |
| 211 | 235 | <el-table-column prop="name" label="健康师姓名" min-width="120" /> |
| 212 | 236 | <el-table-column prop="billingPerformance" label="开单业绩" width="120" align="right"> |
| 213 | 237 | <template slot-scope="scope">¥{{ formatMoney(scope.row.billingPerformance) |
| 214 | - }}</template> | |
| 238 | + }}</template> | |
| 215 | 239 | </el-table-column> |
| 216 | 240 | <el-table-column prop="consumePerformance" label="消耗业绩" width="120" align="right"> |
| 217 | 241 | <template slot-scope="scope">¥{{ formatMoney(scope.row.consumePerformance) |
| 218 | - }}</template> | |
| 242 | + }}</template> | |
| 219 | 243 | </el-table-column> |
| 220 | 244 | <el-table-column prop="totalPerformance" label="净业绩" width="120" align="right"> |
| 221 | 245 | <template slot-scope="scope">¥{{ formatMoney(scope.row.totalPerformance) |
| 222 | - }}</template> | |
| 246 | + }}</template> | |
| 223 | 247 | </el-table-column> |
| 224 | 248 | </el-table> |
| 225 | 249 | </el-card> |
| ... | ... | @@ -235,7 +259,7 @@ |
| 235 | 259 | <el-table-column prop="itemName" label="品项名称" min-width="150" /> |
| 236 | 260 | <el-table-column prop="consumeAmount" label="消耗金额" width="120" align="right"> |
| 237 | 261 | <template slot-scope="scope"> |
| 238 | - <span style="font-weight: 600; color: #409EFF;">¥{{ | |
| 262 | + <span style="font-weight: 600; color: #22c55e;">¥{{ | |
| 239 | 263 | formatMoney(scope.row.consumeAmount) }}</span> |
| 240 | 264 | </template> |
| 241 | 265 | </el-table-column> |
| ... | ... | @@ -619,7 +643,10 @@ export default { |
| 619 | 643 | RefundAmount: response.data.RefundAmount || 0, |
| 620 | 644 | RefundCount: response.data.RefundCount || 0, |
| 621 | 645 | RemainingRightsAmount: response.data.RemainingRightsAmount || 0, |
| 622 | - TargetPerformance: response.data.TargetPerformance || 0 | |
| 646 | + TargetPerformance: response.data.TargetPerformance || 0, | |
| 647 | + LifeBeautyPerformance: response.data.LifeBeautyPerformance || 0, | |
| 648 | + MedicalBeautyPerformance: response.data.MedicalBeautyPerformance || 0, | |
| 649 | + TechBeautyPerformance: response.data.TechBeautyPerformance || 0 | |
| 623 | 650 | }, |
| 624 | 651 | Operation: { |
| 625 | 652 | HeadCount: response.data.HeadCount || 0, |
| ... | ... | @@ -1901,17 +1928,49 @@ export default { |
| 1901 | 1928 | |
| 1902 | 1929 | <style lang="scss" scoped> |
| 1903 | 1930 | .store-dashboard { |
| 1904 | - padding: 20px; | |
| 1905 | - background: #f5f7fa; | |
| 1931 | + padding: 16px; | |
| 1932 | + background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 50%, #f0f4f8 100%); | |
| 1906 | 1933 | min-height: calc(100vh - 84px); |
| 1934 | + overflow-y: auto; | |
| 1935 | + overflow-x: hidden; | |
| 1936 | + display: flex; | |
| 1937 | + flex-direction: column; | |
| 1938 | + | |
| 1939 | + // 自定义滚动条样式 | |
| 1940 | + &::-webkit-scrollbar { | |
| 1941 | + width: 8px; | |
| 1942 | + } | |
| 1943 | + | |
| 1944 | + &::-webkit-scrollbar-track { | |
| 1945 | + background: rgba(144, 147, 153, 0.1); | |
| 1946 | + border-radius: 4px; | |
| 1947 | + } | |
| 1948 | + | |
| 1949 | + &::-webkit-scrollbar-thumb { | |
| 1950 | + background: rgba(144, 147, 153, 0.3); | |
| 1951 | + border-radius: 4px; | |
| 1952 | + transition: background 0.3s ease; | |
| 1953 | + | |
| 1954 | + &:hover { | |
| 1955 | + background: rgba(144, 147, 153, 0.5); | |
| 1956 | + } | |
| 1957 | + } | |
| 1907 | 1958 | |
| 1908 | 1959 | // 筛选器栏 |
| 1909 | 1960 | .filter-bar { |
| 1910 | - background: #fff; | |
| 1911 | - padding: 16px 20px; | |
| 1961 | + background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%); | |
| 1962 | + backdrop-filter: blur(10px); | |
| 1963 | + padding: 14px 18px; | |
| 1912 | 1964 | border-radius: 12px; |
| 1913 | - margin-bottom: 20px; | |
| 1914 | - box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); | |
| 1965 | + margin-bottom: 16px; | |
| 1966 | + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04); | |
| 1967 | + border: 1px solid rgba(144, 147, 153, 0.15); | |
| 1968 | + transition: all 0.3s ease; | |
| 1969 | + | |
| 1970 | + &:hover { | |
| 1971 | + box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06); | |
| 1972 | + transform: translateY(-1px); | |
| 1973 | + } | |
| 1915 | 1974 | |
| 1916 | 1975 | .filter-form { |
| 1917 | 1976 | margin: 0; |
| ... | ... | @@ -1921,9 +1980,38 @@ export default { |
| 1921 | 1980 | } |
| 1922 | 1981 | |
| 1923 | 1982 | ::v-deep .el-form-item__label { |
| 1924 | - font-weight: 500; | |
| 1983 | + font-weight: 600; | |
| 1925 | 1984 | color: #606266; |
| 1926 | 1985 | } |
| 1986 | + | |
| 1987 | + ::v-deep .el-button { | |
| 1988 | + border-radius: 8px; | |
| 1989 | + transition: all 0.3s ease; | |
| 1990 | + | |
| 1991 | + &.el-button--primary { | |
| 1992 | + background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); | |
| 1993 | + border: none; | |
| 1994 | + box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3); | |
| 1995 | + | |
| 1996 | + &:hover { | |
| 1997 | + background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); | |
| 1998 | + transform: translateY(-2px); | |
| 1999 | + box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4); | |
| 2000 | + } | |
| 2001 | + } | |
| 2002 | + | |
| 2003 | + &:not(.el-button--primary) { | |
| 2004 | + background: rgba(255, 255, 255, 0.9); | |
| 2005 | + border-color: rgba(144, 147, 153, 0.3); | |
| 2006 | + color: #606266; | |
| 2007 | + | |
| 2008 | + &:hover { | |
| 2009 | + background: rgba(255, 255, 255, 1); | |
| 2010 | + border-color: rgba(144, 147, 153, 0.5); | |
| 2011 | + transform: translateY(-1px); | |
| 2012 | + } | |
| 2013 | + } | |
| 2014 | + } | |
| 1927 | 2015 | } |
| 1928 | 2016 | } |
| 1929 | 2017 | |
| ... | ... | @@ -1932,11 +2020,15 @@ export default { |
| 1932 | 2020 | display: flex; |
| 1933 | 2021 | justify-content: space-between; |
| 1934 | 2022 | align-items: center; |
| 1935 | - padding: 20px 24px; | |
| 1936 | - background: #fff; | |
| 2023 | + padding: 18px 22px; | |
| 2024 | + background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%); | |
| 2025 | + backdrop-filter: blur(10px); | |
| 1937 | 2026 | border-radius: 12px; |
| 1938 | - margin-bottom: 20px; | |
| 1939 | - box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); | |
| 2027 | + margin-bottom: 16px; | |
| 2028 | + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04); | |
| 2029 | + border: 1px solid rgba(144, 147, 153, 0.15); | |
| 2030 | + transition: all 0.3s ease; | |
| 2031 | + flex-shrink: 0; | |
| 1940 | 2032 | |
| 1941 | 2033 | .header-left { |
| 1942 | 2034 | .store-info { |
| ... | ... | @@ -1945,15 +2037,55 @@ export default { |
| 1945 | 2037 | gap: 16px; |
| 1946 | 2038 | |
| 1947 | 2039 | .store-avatar { |
| 1948 | - width: 64px; | |
| 1949 | - height: 64px; | |
| 1950 | - border-radius: 12px; | |
| 1951 | - background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); | |
| 2040 | + width: 72px; | |
| 2041 | + height: 72px; | |
| 2042 | + border-radius: 16px; | |
| 2043 | + background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #667eea 100%); | |
| 2044 | + background-size: 200% 200%; | |
| 1952 | 2045 | display: flex; |
| 1953 | 2046 | align-items: center; |
| 1954 | 2047 | justify-content: center; |
| 1955 | 2048 | color: #fff; |
| 1956 | - font-size: 28px; | |
| 2049 | + font-size: 32px; | |
| 2050 | + box-shadow: | |
| 2051 | + 0 8px 24px rgba(102, 126, 234, 0.3), | |
| 2052 | + 0 4px 12px rgba(118, 75, 162, 0.2), | |
| 2053 | + inset 0 1px 0 rgba(255, 255, 255, 0.2); | |
| 2054 | + transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); | |
| 2055 | + position: relative; | |
| 2056 | + overflow: hidden; | |
| 2057 | + | |
| 2058 | + &::before { | |
| 2059 | + content: ''; | |
| 2060 | + position: absolute; | |
| 2061 | + top: -50%; | |
| 2062 | + left: -50%; | |
| 2063 | + width: 200%; | |
| 2064 | + height: 200%; | |
| 2065 | + background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent); | |
| 2066 | + transform: rotate(45deg); | |
| 2067 | + transition: all 0.6s ease; | |
| 2068 | + } | |
| 2069 | + | |
| 2070 | + i { | |
| 2071 | + position: relative; | |
| 2072 | + z-index: 1; | |
| 2073 | + filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2)); | |
| 2074 | + } | |
| 2075 | + | |
| 2076 | + &:hover { | |
| 2077 | + transform: scale(1.08) rotate(5deg); | |
| 2078 | + box-shadow: | |
| 2079 | + 0 12px 32px rgba(102, 126, 234, 0.4), | |
| 2080 | + 0 6px 16px rgba(118, 75, 162, 0.3), | |
| 2081 | + inset 0 1px 0 rgba(255, 255, 255, 0.25); | |
| 2082 | + background-position: 100% 100%; | |
| 2083 | + | |
| 2084 | + &::before { | |
| 2085 | + top: 50%; | |
| 2086 | + left: 50%; | |
| 2087 | + } | |
| 2088 | + } | |
| 1957 | 2089 | } |
| 1958 | 2090 | |
| 1959 | 2091 | .store-details { |
| ... | ... | @@ -1966,8 +2098,11 @@ export default { |
| 1966 | 2098 | .store-name { |
| 1967 | 2099 | margin: 0; |
| 1968 | 2100 | font-size: 24px; |
| 1969 | - font-weight: 600; | |
| 1970 | - color: #303133; | |
| 2101 | + font-weight: 700; | |
| 2102 | + background: linear-gradient(135deg, #303133 0%, #606266 100%); | |
| 2103 | + -webkit-background-clip: text; | |
| 2104 | + -webkit-text-fill-color: transparent; | |
| 2105 | + background-clip: text; | |
| 1971 | 2106 | } |
| 1972 | 2107 | } |
| 1973 | 2108 | |
| ... | ... | @@ -1980,10 +2115,92 @@ export default { |
| 1980 | 2115 | .meta-item { |
| 1981 | 2116 | display: flex; |
| 1982 | 2117 | align-items: center; |
| 1983 | - gap: 6px; | |
| 2118 | + gap: 8px; | |
| 2119 | + padding: 6px 12px; | |
| 2120 | + border-radius: 8px; | |
| 2121 | + background: linear-gradient(135deg, rgba(239, 246, 255, 0.6) 0%, rgba(219, 234, 254, 0.6) 100%); | |
| 2122 | + border: 1px solid rgba(59, 130, 246, 0.2); | |
| 2123 | + transition: all 0.3s ease; | |
| 2124 | + cursor: pointer; | |
| 2125 | + | |
| 2126 | + &:nth-child(1) { | |
| 2127 | + background: linear-gradient(135deg, rgba(239, 246, 255, 0.6) 0%, rgba(219, 234, 254, 0.6) 100%); | |
| 2128 | + border-color: rgba(59, 130, 246, 0.2); | |
| 2129 | + } | |
| 2130 | + | |
| 2131 | + &:nth-child(2) { | |
| 2132 | + background: linear-gradient(135deg, rgba(240, 253, 244, 0.6) 0%, rgba(220, 252, 231, 0.6) 100%); | |
| 2133 | + border-color: rgba(34, 197, 94, 0.2); | |
| 2134 | + } | |
| 2135 | + | |
| 2136 | + &:nth-child(3) { | |
| 2137 | + background: linear-gradient(135deg, rgba(255, 247, 237, 0.6) 0%, rgba(255, 237, 213, 0.6) 100%); | |
| 2138 | + border-color: rgba(245, 158, 11, 0.2); | |
| 2139 | + } | |
| 1984 | 2140 | |
| 1985 | 2141 | i { |
| 1986 | - color: #909399; | |
| 2142 | + font-size: 16px; | |
| 2143 | + width: 18px; | |
| 2144 | + height: 18px; | |
| 2145 | + display: flex; | |
| 2146 | + align-items: center; | |
| 2147 | + justify-content: center; | |
| 2148 | + border-radius: 6px; | |
| 2149 | + padding: 2px; | |
| 2150 | + transition: all 0.3s ease; | |
| 2151 | + } | |
| 2152 | + | |
| 2153 | + &:nth-child(1) i { | |
| 2154 | + color: #3b82f6; | |
| 2155 | + background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.15) 100%); | |
| 2156 | + } | |
| 2157 | + | |
| 2158 | + &:nth-child(2) i { | |
| 2159 | + color: #22c55e; | |
| 2160 | + background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(21, 128, 61, 0.15) 100%); | |
| 2161 | + } | |
| 2162 | + | |
| 2163 | + &:nth-child(3) i { | |
| 2164 | + color: #f59e0b; | |
| 2165 | + background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.15) 100%); | |
| 2166 | + } | |
| 2167 | + | |
| 2168 | + &:hover { | |
| 2169 | + transform: translateY(-2px); | |
| 2170 | + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); | |
| 2171 | + | |
| 2172 | + &:nth-child(1) { | |
| 2173 | + background: linear-gradient(135deg, rgba(239, 246, 255, 0.9) 0%, rgba(219, 234, 254, 0.9) 100%); | |
| 2174 | + border-color: rgba(59, 130, 246, 0.4); | |
| 2175 | + | |
| 2176 | + i { | |
| 2177 | + background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); | |
| 2178 | + color: #fff; | |
| 2179 | + transform: scale(1.1); | |
| 2180 | + } | |
| 2181 | + } | |
| 2182 | + | |
| 2183 | + &:nth-child(2) { | |
| 2184 | + background: linear-gradient(135deg, rgba(240, 253, 244, 0.9) 0%, rgba(220, 252, 231, 0.9) 100%); | |
| 2185 | + border-color: rgba(34, 197, 94, 0.4); | |
| 2186 | + | |
| 2187 | + i { | |
| 2188 | + background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); | |
| 2189 | + color: #fff; | |
| 2190 | + transform: scale(1.1); | |
| 2191 | + } | |
| 2192 | + } | |
| 2193 | + | |
| 2194 | + &:nth-child(3) { | |
| 2195 | + background: linear-gradient(135deg, rgba(255, 247, 237, 0.9) 0%, rgba(255, 237, 213, 0.9) 100%); | |
| 2196 | + border-color: rgba(245, 158, 11, 0.4); | |
| 2197 | + | |
| 2198 | + i { | |
| 2199 | + background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); | |
| 2200 | + color: #fff; | |
| 2201 | + transform: scale(1.1); | |
| 2202 | + } | |
| 2203 | + } | |
| 1987 | 2204 | } |
| 1988 | 2205 | } |
| 1989 | 2206 | } |
| ... | ... | @@ -1998,29 +2215,56 @@ export default { |
| 1998 | 2215 | |
| 1999 | 2216 | .core-stat-item { |
| 2000 | 2217 | padding: 16px 20px; |
| 2001 | - border-radius: 10px; | |
| 2218 | + border-radius: 12px; | |
| 2002 | 2219 | min-width: 140px; |
| 2003 | 2220 | text-align: center; |
| 2004 | - transition: all 0.3s; | |
| 2221 | + transition: all 0.3s ease; | |
| 2222 | + cursor: pointer; | |
| 2223 | + position: relative; | |
| 2224 | + overflow: hidden; | |
| 2225 | + | |
| 2226 | + &::before { | |
| 2227 | + content: ''; | |
| 2228 | + position: absolute; | |
| 2229 | + top: 0; | |
| 2230 | + left: -100%; | |
| 2231 | + width: 100%; | |
| 2232 | + height: 100%; | |
| 2233 | + background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent); | |
| 2234 | + transition: left 0.5s ease; | |
| 2235 | + } | |
| 2236 | + | |
| 2237 | + &:hover { | |
| 2238 | + transform: translateY(-4px); | |
| 2239 | + box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); | |
| 2240 | + | |
| 2241 | + &::before { | |
| 2242 | + left: 100%; | |
| 2243 | + } | |
| 2244 | + } | |
| 2005 | 2245 | |
| 2006 | 2246 | &.primary { |
| 2007 | - background: linear-gradient(135deg, #ecf5ff 0%, #d9ecff 100%); | |
| 2008 | - border-left: 4px solid #409EFF; | |
| 2247 | + background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); | |
| 2248 | + border-left: 4px solid #3b82f6; | |
| 2249 | + box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2); | |
| 2009 | 2250 | } |
| 2010 | 2251 | |
| 2011 | 2252 | &.success { |
| 2012 | - background: linear-gradient(135deg, #f0f9ff 0%, #e1f3ff 100%); | |
| 2013 | - border-left: 4px solid #67C23A; | |
| 2253 | + background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); | |
| 2254 | + border-left: 4px solid #22c55e; | |
| 2255 | + box-shadow: 0 2px 8px rgba(34, 197, 94, 0.2); | |
| 2014 | 2256 | } |
| 2015 | 2257 | |
| 2016 | 2258 | &.info { |
| 2017 | - background: linear-gradient(135deg, #f4f4f5 0%, #e9e9eb 100%); | |
| 2018 | - border-left: 4px solid #909399; | |
| 2259 | + background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%); | |
| 2260 | + border-left: 4px solid #a855f7; | |
| 2261 | + box-shadow: 0 2px 8px rgba(168, 85, 247, 0.2); | |
| 2019 | 2262 | } |
| 2020 | 2263 | |
| 2021 | 2264 | &.warning { |
| 2022 | - background: linear-gradient(135deg, #fdf6ec 0%, #fae6d3 100%); | |
| 2023 | - border-left: 4px solid #E6A23C; | |
| 2265 | + background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%); | |
| 2266 | + border-left: 4px solid #f59e0b; | |
| 2267 | + box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2); | |
| 2024 | 2268 | } |
| 2025 | 2269 | |
| 2026 | 2270 | .stat-label { |
| ... | ... | @@ -2032,7 +2276,10 @@ export default { |
| 2032 | 2276 | .stat-value { |
| 2033 | 2277 | font-size: 22px; |
| 2034 | 2278 | font-weight: 700; |
| 2035 | - color: #303133; | |
| 2279 | + background: linear-gradient(135deg, #303133 0%, #606266 100%); | |
| 2280 | + -webkit-background-clip: text; | |
| 2281 | + -webkit-text-fill-color: transparent; | |
| 2282 | + background-clip: text; | |
| 2036 | 2283 | margin-bottom: 6px; |
| 2037 | 2284 | } |
| 2038 | 2285 | |
| ... | ... | @@ -2057,9 +2304,10 @@ export default { |
| 2057 | 2304 | .main-content { |
| 2058 | 2305 | display: grid; |
| 2059 | 2306 | grid-template-columns: 1fr 400px; |
| 2060 | - gap: 20px; | |
| 2061 | - margin-bottom: 20px; | |
| 2307 | + gap: 16px; | |
| 2308 | + margin-bottom: 0; | |
| 2062 | 2309 | align-items: start; |
| 2310 | + flex: 1; | |
| 2063 | 2311 | |
| 2064 | 2312 | .content-left { |
| 2065 | 2313 | display: flex; |
| ... | ... | @@ -2081,11 +2329,22 @@ export default { |
| 2081 | 2329 | // 图表卡片 |
| 2082 | 2330 | .chart-card { |
| 2083 | 2331 | border-radius: 12px; |
| 2084 | - box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); | |
| 2332 | + background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%); | |
| 2333 | + backdrop-filter: blur(10px); | |
| 2334 | + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04); | |
| 2335 | + border: 1px solid rgba(144, 147, 153, 0.15); | |
| 2336 | + transition: all 0.3s ease; | |
| 2337 | + | |
| 2338 | + &:hover { | |
| 2339 | + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.06); | |
| 2340 | + transform: translateY(-2px); | |
| 2341 | + } | |
| 2085 | 2342 | |
| 2086 | 2343 | ::v-deep .el-card__header { |
| 2087 | 2344 | padding: 16px 20px; |
| 2088 | - border-bottom: 1px solid #ebeef5; | |
| 2345 | + background: linear-gradient(135deg, rgba(248, 249, 250, 0.8) 0%, rgba(240, 242, 245, 0.8) 100%); | |
| 2346 | + border-bottom: 2px solid rgba(144, 147, 153, 0.2); | |
| 2347 | + border-radius: 12px 12px 0 0; | |
| 2089 | 2348 | } |
| 2090 | 2349 | |
| 2091 | 2350 | ::v-deep .el-card__body { |
| ... | ... | @@ -2101,11 +2360,22 @@ export default { |
| 2101 | 2360 | |
| 2102 | 2361 | .chart-card-small { |
| 2103 | 2362 | border-radius: 12px; |
| 2104 | - box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); | |
| 2363 | + background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%); | |
| 2364 | + backdrop-filter: blur(10px); | |
| 2365 | + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04); | |
| 2366 | + border: 1px solid rgba(144, 147, 153, 0.15); | |
| 2367 | + transition: all 0.3s ease; | |
| 2368 | + | |
| 2369 | + &:hover { | |
| 2370 | + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.06); | |
| 2371 | + transform: translateY(-2px); | |
| 2372 | + } | |
| 2105 | 2373 | |
| 2106 | 2374 | ::v-deep .el-card__header { |
| 2107 | 2375 | padding: 14px 18px; |
| 2108 | - border-bottom: 1px solid #ebeef5; | |
| 2376 | + background: linear-gradient(135deg, rgba(248, 249, 250, 0.8) 0%, rgba(240, 242, 245, 0.8) 100%); | |
| 2377 | + border-bottom: 2px solid rgba(144, 147, 153, 0.2); | |
| 2378 | + border-radius: 12px 12px 0 0; | |
| 2109 | 2379 | } |
| 2110 | 2380 | |
| 2111 | 2381 | ::v-deep .el-card__body { |
| ... | ... | @@ -2122,11 +2392,22 @@ export default { |
| 2122 | 2392 | // 指标卡片 |
| 2123 | 2393 | .metrics-card { |
| 2124 | 2394 | border-radius: 12px; |
| 2125 | - box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); | |
| 2395 | + background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%); | |
| 2396 | + backdrop-filter: blur(10px); | |
| 2397 | + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04); | |
| 2398 | + border: 1px solid rgba(144, 147, 153, 0.15); | |
| 2399 | + transition: all 0.3s ease; | |
| 2400 | + | |
| 2401 | + &:hover { | |
| 2402 | + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.06); | |
| 2403 | + transform: translateY(-2px); | |
| 2404 | + } | |
| 2126 | 2405 | |
| 2127 | 2406 | ::v-deep .el-card__header { |
| 2128 | 2407 | padding: 14px 18px; |
| 2129 | - border-bottom: 1px solid #ebeef5; | |
| 2408 | + background: linear-gradient(135deg, rgba(248, 249, 250, 0.8) 0%, rgba(240, 242, 245, 0.8) 100%); | |
| 2409 | + border-bottom: 2px solid rgba(144, 147, 153, 0.2); | |
| 2410 | + border-radius: 12px 12px 0 0; | |
| 2130 | 2411 | } |
| 2131 | 2412 | |
| 2132 | 2413 | ::v-deep .el-card__body { |
| ... | ... | @@ -2142,13 +2423,17 @@ export default { |
| 2142 | 2423 | display: flex; |
| 2143 | 2424 | align-items: center; |
| 2144 | 2425 | padding: 12px; |
| 2145 | - background: #f8f9fa; | |
| 2426 | + background: linear-gradient(135deg, rgba(248, 249, 250, 0.8) 0%, rgba(240, 242, 245, 0.8) 100%); | |
| 2146 | 2427 | border-radius: 8px; |
| 2147 | - transition: all 0.3s; | |
| 2428 | + border: 1px solid rgba(144, 147, 153, 0.1); | |
| 2429 | + transition: all 0.3s ease; | |
| 2430 | + cursor: pointer; | |
| 2148 | 2431 | |
| 2149 | 2432 | &:hover { |
| 2150 | - background: #f0f2f5; | |
| 2151 | - transform: translateY(-1px); | |
| 2433 | + background: linear-gradient(135deg, rgba(240, 242, 245, 0.9) 0%, rgba(232, 236, 241, 0.9) 100%); | |
| 2434 | + transform: translateY(-2px); | |
| 2435 | + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); | |
| 2436 | + border-color: rgba(144, 147, 153, 0.2); | |
| 2152 | 2437 | } |
| 2153 | 2438 | |
| 2154 | 2439 | .metric-icon { |
| ... | ... | @@ -2202,12 +2487,195 @@ export default { |
| 2202 | 2487 | align-items: center; |
| 2203 | 2488 | font-size: 15px; |
| 2204 | 2489 | font-weight: 600; |
| 2205 | - color: #303133; | |
| 2490 | + background: linear-gradient(135deg, #303133 0%, #606266 100%); | |
| 2491 | + -webkit-background-clip: text; | |
| 2492 | + -webkit-text-fill-color: transparent; | |
| 2493 | + background-clip: text; | |
| 2206 | 2494 | |
| 2207 | 2495 | i { |
| 2208 | - margin-right: 8px; | |
| 2209 | - color: #409EFF; | |
| 2496 | + margin-right: 10px; | |
| 2497 | + width: 32px; | |
| 2498 | + height: 32px; | |
| 2499 | + display: flex; | |
| 2500 | + align-items: center; | |
| 2501 | + justify-content: center; | |
| 2502 | + border-radius: 8px; | |
| 2210 | 2503 | font-size: 16px; |
| 2504 | + transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); | |
| 2505 | + position: relative; | |
| 2506 | + overflow: hidden; | |
| 2507 | + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); | |
| 2508 | + | |
| 2509 | + &::before { | |
| 2510 | + content: ''; | |
| 2511 | + position: absolute; | |
| 2512 | + top: 0; | |
| 2513 | + left: -100%; | |
| 2514 | + width: 100%; | |
| 2515 | + height: 100%; | |
| 2516 | + background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent); | |
| 2517 | + transition: left 0.5s ease; | |
| 2518 | + } | |
| 2519 | + | |
| 2520 | + // 根据图标类型设置不同颜色 | |
| 2521 | + &.el-icon-data-line { | |
| 2522 | + background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.15) 100%); | |
| 2523 | + color: #3b82f6; | |
| 2524 | + } | |
| 2525 | + | |
| 2526 | + &.el-icon-pie-chart { | |
| 2527 | + background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(147, 51, 234, 0.15) 100%); | |
| 2528 | + color: #a855f7; | |
| 2529 | + } | |
| 2530 | + | |
| 2531 | + &.el-icon-s-marketing { | |
| 2532 | + background: linear-gradient(135deg, rgba(236, 72, 153, 0.15) 0%, rgba(219, 39, 119, 0.15) 100%); | |
| 2533 | + color: #ec4899; | |
| 2534 | + } | |
| 2535 | + | |
| 2536 | + &.el-icon-s-data { | |
| 2537 | + background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(21, 128, 61, 0.15) 100%); | |
| 2538 | + color: #22c55e; | |
| 2539 | + } | |
| 2540 | + | |
| 2541 | + &.el-icon-sort { | |
| 2542 | + background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.15) 100%); | |
| 2543 | + color: #f59e0b; | |
| 2544 | + } | |
| 2545 | + | |
| 2546 | + &.el-icon-s-grid { | |
| 2547 | + background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.15) 100%); | |
| 2548 | + color: #3b82f6; | |
| 2549 | + } | |
| 2550 | + | |
| 2551 | + &.el-icon-shopping-bag-1, | |
| 2552 | + &.el-icon-goods { | |
| 2553 | + background: linear-gradient(135deg, rgba(236, 72, 153, 0.15) 0%, rgba(219, 39, 119, 0.15) 100%); | |
| 2554 | + color: #ec4899; | |
| 2555 | + } | |
| 2556 | + | |
| 2557 | + &.el-icon-user-solid, | |
| 2558 | + &.el-icon-user { | |
| 2559 | + background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(21, 128, 61, 0.15) 100%); | |
| 2560 | + color: #22c55e; | |
| 2561 | + } | |
| 2562 | + | |
| 2563 | + &.el-icon-odometer { | |
| 2564 | + background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(147, 51, 234, 0.15) 100%); | |
| 2565 | + color: #a855f7; | |
| 2566 | + } | |
| 2567 | + | |
| 2568 | + &.el-icon-trophy { | |
| 2569 | + background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.15) 100%); | |
| 2570 | + color: #f59e0b; | |
| 2571 | + } | |
| 2572 | + | |
| 2573 | + &.el-icon-warning { | |
| 2574 | + background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.15) 100%); | |
| 2575 | + color: #f59e0b; | |
| 2576 | + } | |
| 2577 | + | |
| 2578 | + &.el-icon-data-analysis { | |
| 2579 | + background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.15) 100%); | |
| 2580 | + color: #3b82f6; | |
| 2581 | + } | |
| 2582 | + | |
| 2583 | + &.el-icon-s-flag { | |
| 2584 | + background: linear-gradient(135deg, rgba(236, 72, 153, 0.15) 0%, rgba(219, 39, 119, 0.15) 100%); | |
| 2585 | + color: #ec4899; | |
| 2586 | + } | |
| 2587 | + | |
| 2588 | + // 默认样式(如果没有匹配的图标类) | |
| 2589 | + &:not([class*="el-icon-"]) { | |
| 2590 | + background: linear-gradient(135deg, rgba(96, 98, 102, 0.1) 0%, rgba(144, 147, 153, 0.1) 100%); | |
| 2591 | + color: #606266; | |
| 2592 | + } | |
| 2593 | + | |
| 2594 | + &:hover { | |
| 2595 | + transform: scale(1.1) rotate(5deg); | |
| 2596 | + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); | |
| 2597 | + | |
| 2598 | + &::before { | |
| 2599 | + left: 100%; | |
| 2600 | + } | |
| 2601 | + | |
| 2602 | + // hover时根据图标类型设置不同的渐变背景 | |
| 2603 | + &.el-icon-data-line { | |
| 2604 | + background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); | |
| 2605 | + color: #fff; | |
| 2606 | + } | |
| 2607 | + | |
| 2608 | + &.el-icon-pie-chart { | |
| 2609 | + background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%); | |
| 2610 | + color: #fff; | |
| 2611 | + } | |
| 2612 | + | |
| 2613 | + &.el-icon-s-marketing { | |
| 2614 | + background: linear-gradient(135deg, #ec4899 0%, #db2777 100%); | |
| 2615 | + color: #fff; | |
| 2616 | + } | |
| 2617 | + | |
| 2618 | + &.el-icon-s-data { | |
| 2619 | + background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); | |
| 2620 | + color: #fff; | |
| 2621 | + } | |
| 2622 | + | |
| 2623 | + &.el-icon-sort { | |
| 2624 | + background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); | |
| 2625 | + color: #fff; | |
| 2626 | + } | |
| 2627 | + | |
| 2628 | + &.el-icon-s-grid { | |
| 2629 | + background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); | |
| 2630 | + color: #fff; | |
| 2631 | + } | |
| 2632 | + | |
| 2633 | + &.el-icon-shopping-bag-1, | |
| 2634 | + &.el-icon-goods { | |
| 2635 | + background: linear-gradient(135deg, #ec4899 0%, #db2777 100%); | |
| 2636 | + color: #fff; | |
| 2637 | + } | |
| 2638 | + | |
| 2639 | + &.el-icon-user-solid, | |
| 2640 | + &.el-icon-user { | |
| 2641 | + background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); | |
| 2642 | + color: #fff; | |
| 2643 | + } | |
| 2644 | + | |
| 2645 | + &.el-icon-odometer { | |
| 2646 | + background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%); | |
| 2647 | + color: #fff; | |
| 2648 | + } | |
| 2649 | + | |
| 2650 | + &.el-icon-trophy { | |
| 2651 | + background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); | |
| 2652 | + color: #fff; | |
| 2653 | + } | |
| 2654 | + | |
| 2655 | + &.el-icon-warning { | |
| 2656 | + background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); | |
| 2657 | + color: #fff; | |
| 2658 | + } | |
| 2659 | + | |
| 2660 | + &.el-icon-data-analysis { | |
| 2661 | + background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); | |
| 2662 | + color: #fff; | |
| 2663 | + } | |
| 2664 | + | |
| 2665 | + &.el-icon-s-flag { | |
| 2666 | + background: linear-gradient(135deg, #ec4899 0%, #db2777 100%); | |
| 2667 | + color: #fff; | |
| 2668 | + } | |
| 2669 | + | |
| 2670 | + &:not([class*="el-icon-"]) { | |
| 2671 | + background: linear-gradient(135deg, #606266 0%, #909399 100%); | |
| 2672 | + color: #fff; | |
| 2673 | + } | |
| 2674 | + } | |
| 2675 | + } | |
| 2676 | + | |
| 2677 | + &:hover i { | |
| 2678 | + transform: scale(1.1) rotate(5deg); | |
| 2211 | 2679 | } |
| 2212 | 2680 | } |
| 2213 | 2681 | |
| ... | ... | @@ -2231,7 +2699,10 @@ export default { |
| 2231 | 2699 | .rank-number { |
| 2232 | 2700 | font-size: 36px; |
| 2233 | 2701 | font-weight: 700; |
| 2234 | - color: #409EFF; | |
| 2702 | + background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); | |
| 2703 | + -webkit-background-clip: text; | |
| 2704 | + -webkit-text-fill-color: transparent; | |
| 2705 | + background-clip: text; | |
| 2235 | 2706 | } |
| 2236 | 2707 | |
| 2237 | 2708 | .rank-total { |
| ... | ... | @@ -2254,7 +2725,7 @@ export default { |
| 2254 | 2725 | } |
| 2255 | 2726 | |
| 2256 | 2727 | &.good { |
| 2257 | - background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); | |
| 2728 | + background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); | |
| 2258 | 2729 | color: #fff; |
| 2259 | 2730 | } |
| 2260 | 2731 | |
| ... | ... | @@ -2292,11 +2763,22 @@ export default { |
| 2292 | 2763 | // 经营提示卡片 |
| 2293 | 2764 | .tips-card { |
| 2294 | 2765 | border-radius: 12px; |
| 2295 | - box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); | |
| 2766 | + background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%); | |
| 2767 | + backdrop-filter: blur(10px); | |
| 2768 | + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04); | |
| 2769 | + border: 1px solid rgba(144, 147, 153, 0.15); | |
| 2770 | + transition: all 0.3s ease; | |
| 2771 | + | |
| 2772 | + &:hover { | |
| 2773 | + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.06); | |
| 2774 | + transform: translateY(-2px); | |
| 2775 | + } | |
| 2296 | 2776 | |
| 2297 | 2777 | ::v-deep .el-card__header { |
| 2298 | 2778 | padding: 14px 18px; |
| 2299 | - border-bottom: 1px solid #ebeef5; | |
| 2779 | + background: linear-gradient(135deg, rgba(248, 249, 250, 0.8) 0%, rgba(240, 242, 245, 0.8) 100%); | |
| 2780 | + border-bottom: 2px solid rgba(144, 147, 153, 0.2); | |
| 2781 | + border-radius: 12px 12px 0 0; | |
| 2300 | 2782 | } |
| 2301 | 2783 | |
| 2302 | 2784 | ::v-deep .el-card__body { |
| ... | ... | @@ -2330,26 +2812,29 @@ export default { |
| 2330 | 2812 | } |
| 2331 | 2813 | |
| 2332 | 2814 | &.success { |
| 2333 | - background: #f0f9ff; | |
| 2334 | - color: #67C23A; | |
| 2815 | + background: linear-gradient(135deg, rgba(240, 253, 244, 0.8) 0%, rgba(220, 252, 231, 0.8) 100%); | |
| 2816 | + border-left: 3px solid #22c55e; | |
| 2817 | + color: #16a34a; | |
| 2335 | 2818 | |
| 2336 | 2819 | i { |
| 2337 | - color: #67C23A; | |
| 2820 | + color: #22c55e; | |
| 2338 | 2821 | } |
| 2339 | 2822 | } |
| 2340 | 2823 | |
| 2341 | 2824 | &.warning { |
| 2342 | - background: #fdf6ec; | |
| 2343 | - color: #E6A23C; | |
| 2825 | + background: linear-gradient(135deg, rgba(255, 247, 237, 0.8) 0%, rgba(255, 237, 213, 0.8) 100%); | |
| 2826 | + border-left: 3px solid #f59e0b; | |
| 2827 | + color: #d97706; | |
| 2344 | 2828 | |
| 2345 | 2829 | i { |
| 2346 | - color: #E6A23C; | |
| 2830 | + color: #f59e0b; | |
| 2347 | 2831 | } |
| 2348 | 2832 | } |
| 2349 | 2833 | |
| 2350 | 2834 | &.info { |
| 2351 | - background: #f4f4f5; | |
| 2352 | - color: #909399; | |
| 2835 | + background: linear-gradient(135deg, rgba(244, 244, 245, 0.8) 0%, rgba(233, 233, 235, 0.8) 100%); | |
| 2836 | + border-left: 3px solid #909399; | |
| 2837 | + color: #6b7280; | |
| 2353 | 2838 | |
| 2354 | 2839 | i { |
| 2355 | 2840 | color: #909399; |
| ... | ... | @@ -2366,11 +2851,22 @@ export default { |
| 2366 | 2851 | // 快速数据洞察卡片 |
| 2367 | 2852 | .insight-card { |
| 2368 | 2853 | border-radius: 12px; |
| 2369 | - box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); | |
| 2854 | + background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%); | |
| 2855 | + backdrop-filter: blur(10px); | |
| 2856 | + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04); | |
| 2857 | + border: 1px solid rgba(144, 147, 153, 0.15); | |
| 2858 | + transition: all 0.3s ease; | |
| 2859 | + | |
| 2860 | + &:hover { | |
| 2861 | + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.06); | |
| 2862 | + transform: translateY(-2px); | |
| 2863 | + } | |
| 2370 | 2864 | |
| 2371 | 2865 | ::v-deep .el-card__header { |
| 2372 | 2866 | padding: 14px 18px; |
| 2373 | - border-bottom: 1px solid #ebeef5; | |
| 2867 | + background: linear-gradient(135deg, rgba(248, 249, 250, 0.8) 0%, rgba(240, 242, 245, 0.8) 100%); | |
| 2868 | + border-bottom: 2px solid rgba(144, 147, 153, 0.2); | |
| 2869 | + border-radius: 12px 12px 0 0; | |
| 2374 | 2870 | } |
| 2375 | 2871 | |
| 2376 | 2872 | ::v-deep .el-card__body { |
| ... | ... | @@ -2381,18 +2877,22 @@ export default { |
| 2381 | 2877 | .insight-item { |
| 2382 | 2878 | padding: 14px; |
| 2383 | 2879 | margin-bottom: 12px; |
| 2384 | - background: #f8f9fa; | |
| 2880 | + background: linear-gradient(135deg, rgba(248, 249, 250, 0.8) 0%, rgba(240, 242, 245, 0.8) 100%); | |
| 2385 | 2881 | border-radius: 8px; |
| 2386 | - border-left: 3px solid #409EFF; | |
| 2387 | - transition: all 0.3s; | |
| 2882 | + border-left: 3px solid #3b82f6; | |
| 2883 | + border: 1px solid rgba(144, 147, 153, 0.1); | |
| 2884 | + transition: all 0.3s ease; | |
| 2885 | + cursor: pointer; | |
| 2388 | 2886 | |
| 2389 | 2887 | &:last-child { |
| 2390 | 2888 | margin-bottom: 0; |
| 2391 | 2889 | } |
| 2392 | 2890 | |
| 2393 | 2891 | &:hover { |
| 2394 | - background: #f0f2f5; | |
| 2892 | + background: linear-gradient(135deg, rgba(240, 242, 245, 0.9) 0%, rgba(232, 236, 241, 0.9) 100%); | |
| 2395 | 2893 | transform: translateX(4px); |
| 2894 | + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); | |
| 2895 | + border-color: rgba(144, 147, 153, 0.2); | |
| 2396 | 2896 | } |
| 2397 | 2897 | |
| 2398 | 2898 | .insight-header { |
| ... | ... | @@ -2411,7 +2911,10 @@ export default { |
| 2411 | 2911 | .insight-value { |
| 2412 | 2912 | font-size: 20px; |
| 2413 | 2913 | font-weight: 700; |
| 2414 | - color: #409EFF; | |
| 2914 | + background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); | |
| 2915 | + -webkit-background-clip: text; | |
| 2916 | + -webkit-text-fill-color: transparent; | |
| 2917 | + background-clip: text; | |
| 2415 | 2918 | margin-bottom: 6px; |
| 2416 | 2919 | } |
| 2417 | 2920 | |
| ... | ... | @@ -2427,11 +2930,22 @@ export default { |
| 2427 | 2930 | // 关键指标卡片 |
| 2428 | 2931 | .key-metrics-card { |
| 2429 | 2932 | border-radius: 12px; |
| 2430 | - box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); | |
| 2933 | + background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%); | |
| 2934 | + backdrop-filter: blur(10px); | |
| 2935 | + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04); | |
| 2936 | + border: 1px solid rgba(144, 147, 153, 0.15); | |
| 2937 | + transition: all 0.3s ease; | |
| 2938 | + | |
| 2939 | + &:hover { | |
| 2940 | + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.06); | |
| 2941 | + transform: translateY(-2px); | |
| 2942 | + } | |
| 2431 | 2943 | |
| 2432 | 2944 | ::v-deep .el-card__header { |
| 2433 | 2945 | padding: 14px 18px; |
| 2434 | - border-bottom: 1px solid #ebeef5; | |
| 2946 | + background: linear-gradient(135deg, rgba(248, 249, 250, 0.8) 0%, rgba(240, 242, 245, 0.8) 100%); | |
| 2947 | + border-bottom: 2px solid rgba(144, 147, 153, 0.2); | |
| 2948 | + border-radius: 12px 12px 0 0; | |
| 2435 | 2949 | } |
| 2436 | 2950 | |
| 2437 | 2951 | ::v-deep .el-card__body { |
| ... | ... | @@ -2472,16 +2986,59 @@ export default { |
| 2472 | 2986 | .table-section { |
| 2473 | 2987 | .table-card { |
| 2474 | 2988 | border-radius: 12px; |
| 2475 | - box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); | |
| 2989 | + background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%); | |
| 2990 | + backdrop-filter: blur(10px); | |
| 2991 | + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04); | |
| 2992 | + border: 1px solid rgba(144, 147, 153, 0.15); | |
| 2993 | + transition: all 0.3s ease; | |
| 2994 | + | |
| 2995 | + &:hover { | |
| 2996 | + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.06); | |
| 2997 | + transform: translateY(-2px); | |
| 2998 | + } | |
| 2476 | 2999 | |
| 2477 | 3000 | ::v-deep .el-card__header { |
| 2478 | 3001 | padding: 16px 20px; |
| 2479 | - border-bottom: 1px solid #ebeef5; | |
| 3002 | + background: linear-gradient(135deg, rgba(248, 249, 250, 0.8) 0%, rgba(240, 242, 245, 0.8) 100%); | |
| 3003 | + border-bottom: 2px solid rgba(144, 147, 153, 0.2); | |
| 3004 | + border-radius: 12px 12px 0 0; | |
| 2480 | 3005 | } |
| 2481 | 3006 | |
| 2482 | 3007 | ::v-deep .el-card__body { |
| 2483 | 3008 | padding: 20px; |
| 2484 | 3009 | } |
| 3010 | + | |
| 3011 | + ::v-deep .el-table { | |
| 3012 | + border-radius: 8px; | |
| 3013 | + overflow: hidden; | |
| 3014 | + border: 1px solid rgba(144, 147, 153, 0.2); | |
| 3015 | + | |
| 3016 | + .el-table__header { | |
| 3017 | + background: linear-gradient(135deg, rgba(248, 249, 250, 0.9) 0%, rgba(240, 242, 245, 0.9) 100%); | |
| 3018 | + | |
| 3019 | + th { | |
| 3020 | + background: transparent; | |
| 3021 | + color: #303133; | |
| 3022 | + font-weight: 600; | |
| 3023 | + border-bottom: 2px solid rgba(144, 147, 153, 0.2); | |
| 3024 | + } | |
| 3025 | + } | |
| 3026 | + | |
| 3027 | + .el-table__body { | |
| 3028 | + tr { | |
| 3029 | + transition: all 0.3s ease; | |
| 3030 | + | |
| 3031 | + &:hover { | |
| 3032 | + background: linear-gradient(135deg, rgba(248, 249, 250, 0.5) 0%, rgba(240, 242, 245, 0.5) 100%); | |
| 3033 | + transform: translateX(2px); | |
| 3034 | + } | |
| 3035 | + } | |
| 3036 | + | |
| 3037 | + td { | |
| 3038 | + border-bottom: 1px solid rgba(144, 147, 153, 0.15); | |
| 3039 | + } | |
| 3040 | + } | |
| 3041 | + } | |
| 2485 | 3042 | } |
| 2486 | 3043 | } |
| 2487 | 3044 | } | ... | ... |
antis-ncc-admin/src/views/lqKhxx/index.vue
| ... | ... | @@ -128,6 +128,8 @@ |
| 128 | 128 | @click="addOrUpdateHandle()">新增会员</el-button> |
| 129 | 129 | <el-button icon="el-icon-download" :loading="exportLoading" |
| 130 | 130 | @click="exportMemberItems()">导出数据</el-button> |
| 131 | + <el-button icon="el-icon-tickets" :loading="exportRightsLoading" | |
| 132 | + @click="exportMemberRights()">导出会员权益</el-button> | |
| 131 | 133 | <el-button v-has="'btn_remove'" type="danger" icon="el-icon-delete" plain |
| 132 | 134 | @click="handleBatchRemoveDel()">批量删除</el-button> |
| 133 | 135 | </el-button-group> |
| ... | ... | @@ -530,6 +532,7 @@ export default { |
| 530 | 532 | list: [], |
| 531 | 533 | listLoading: true, |
| 532 | 534 | exportLoading: false, |
| 535 | + exportRightsLoading: false, | |
| 533 | 536 | multipleSelection: [], total: 0, |
| 534 | 537 | listQuery: { |
| 535 | 538 | currentPage: 1, |
| ... | ... | @@ -893,6 +896,35 @@ export default { |
| 893 | 896 | this.$message.error('导出失败:' + (err.msg || err.message || '未知错误')) |
| 894 | 897 | }) |
| 895 | 898 | }, |
| 899 | + // 导出会员权益 | |
| 900 | + exportMemberRights() { | |
| 901 | + // 显示加载状态 | |
| 902 | + this.exportRightsLoading = true | |
| 903 | + const loading = this.$loading({ | |
| 904 | + lock: true, | |
| 905 | + text: '正在导出会员权益数据,请稍候...', | |
| 906 | + spinner: 'el-icon-loading', | |
| 907 | + background: 'rgba(255, 255, 255, 0.85)', | |
| 908 | + customClass: 'modern-loading-mask' | |
| 909 | + }) | |
| 910 | + request({ | |
| 911 | + url: `/api/Extend/LqKhxx/Actions/ExportAllMemberRemainingItems`, | |
| 912 | + method: 'GET' | |
| 913 | + }).then(res => { | |
| 914 | + loading.close() | |
| 915 | + this.exportRightsLoading = false | |
| 916 | + if (!res.data.url) { | |
| 917 | + this.$message.warning('导出失败,没有可导出的数据') | |
| 918 | + return | |
| 919 | + } | |
| 920 | + window.location.href = this.define.comUrl + res.data.url | |
| 921 | + this.$message.success('导出成功') | |
| 922 | + }).catch(err => { | |
| 923 | + loading.close() | |
| 924 | + this.exportRightsLoading = false | |
| 925 | + this.$message.error('导出失败:' + (err.msg || err.message || '未知错误')) | |
| 926 | + }) | |
| 927 | + }, | |
| 896 | 928 | search() { |
| 897 | 929 | this.listQuery = { |
| 898 | 930 | currentPage: 1, |
| ... | ... | @@ -3145,4 +3177,30 @@ export default { |
| 3145 | 3177 | } |
| 3146 | 3178 | } |
| 3147 | 3179 | } |
| 3148 | -</style> | |
| 3149 | 3180 | \ No newline at end of file |
| 3181 | +</style> | |
| 3182 | + | |
| 3183 | +<style lang="scss"> | |
| 3184 | +/* 现代化加载界面样式 - Glassmorphism风格 */ | |
| 3185 | +.modern-loading-mask { | |
| 3186 | + background: rgba(255, 255, 255, 0.92) !important; | |
| 3187 | + backdrop-filter: blur(12px); | |
| 3188 | + -webkit-backdrop-filter: blur(12px); | |
| 3189 | + transition: opacity 0.3s ease; | |
| 3190 | + | |
| 3191 | + .el-loading-spinner { | |
| 3192 | + .el-loading-text { | |
| 3193 | + color: #262626 !important; | |
| 3194 | + font-size: 15px !important; | |
| 3195 | + font-weight: 500 !important; | |
| 3196 | + letter-spacing: 0.5px !important; | |
| 3197 | + margin-top: 20px !important; | |
| 3198 | + text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8); | |
| 3199 | + } | |
| 3200 | + | |
| 3201 | + i { | |
| 3202 | + font-size: 42px !important; | |
| 3203 | + color: #1890ff !important; | |
| 3204 | + } | |
| 3205 | + } | |
| 3206 | +} | |
| 3207 | +</style> | ... | ... |
antis-ncc-admin/src/views/lqMdxx/index.vue
| 1 | 1 | <template> |
| 2 | - <div class="NCC-common-layout"> | |
| 3 | - <div class="NCC-common-layout-center"> | |
| 4 | - <el-row class="NCC-common-search-box" :gutter="16"> | |
| 5 | - <el-form @submit.native.prevent> | |
| 6 | - <!-- <el-col :span="6"> | |
| 7 | - <el-form-item label="主键"> | |
| 8 | - <el-input v-model="query.id" placeholder="主键" clearable /> | |
| 9 | - </el-form-item> | |
| 10 | - </el-col> | |
| 11 | - <el-col :span="6"> | |
| 12 | - <el-form-item label="门店编码"> | |
| 13 | - <el-input v-model="query.mdbm" placeholder="门店编码" clearable /> | |
| 14 | - </el-form-item> | |
| 15 | - </el-col> | |
| 16 | - <el-col :span="6"> | |
| 17 | - <el-form-item label="单据门店编号"> | |
| 18 | - <el-input v-model="query.djmdbh" placeholder="单据门店编号" clearable /> | |
| 19 | - </el-form-item> | |
| 20 | - </el-col> --> | |
| 21 | - <el-col :span="6"> | |
| 22 | - <el-form-item label="单据门店"> | |
| 23 | - <el-input v-model="query.djmd" placeholder="单据门店" clearable /> | |
| 24 | - </el-form-item> | |
| 25 | - </el-col> | |
| 26 | - <el-col :span="6"> | |
| 27 | - <el-form-item label="店名"> | |
| 28 | - <el-input v-model="query.dm" placeholder="店名" clearable /> | |
| 29 | - </el-form-item> | |
| 30 | - </el-col> | |
| 31 | - <el-col :span="6"> | |
| 32 | - <el-form-item label="城市"> | |
| 33 | - <el-input v-model="query.cs" placeholder="城市" clearable /> | |
| 34 | - </el-form-item> | |
| 35 | - </el-col> | |
| 36 | - <template v-if="showAll"> | |
| 37 | - | |
| 38 | - <!-- <el-col :span="6"> | |
| 39 | - <el-form-item label="地址"> | |
| 40 | - <el-input v-model="query.dz" placeholder="地址" clearable /> | |
| 41 | - </el-form-item> | |
| 42 | - </el-col> --> | |
| 43 | - <el-col :span="6"> | |
| 44 | - <el-form-item label="姓名"> | |
| 45 | - <el-input v-model="query.xm" placeholder="姓名" clearable /> | |
| 46 | - </el-form-item> | |
| 47 | - </el-col> | |
| 48 | - <el-col :span="6"> | |
| 49 | - <el-form-item label="电话号码"> | |
| 50 | - <el-input v-model="query.dhhm" placeholder="电话号码" clearable /> | |
| 51 | - </el-form-item> | |
| 52 | - </el-col> | |
| 53 | - <el-col :span="6"> | |
| 54 | - <el-form-item label="座机"> | |
| 55 | - <el-input v-model="query.zj" placeholder="座机" clearable /> | |
| 56 | - </el-form-item> | |
| 57 | - </el-col> | |
| 58 | - <el-col :span="6"> | |
| 59 | - <el-form-item label="开业时间"> | |
| 60 | - <el-date-picker v-model="query.kysj" type="daterange" value-format="timestamp" format="yyyy-MM-dd" start-placeholder="开始日期" end-placeholder="结束日期"> | |
| 61 | - </el-date-picker> | |
| 62 | - </el-form-item> | |
| 63 | - </el-col> | |
| 64 | - <el-col :span="6"> | |
| 65 | - <el-form-item label="最新状态"> | |
| 66 | - <el-select v-model="query.zxzt" placeholder="最新状态" clearable > | |
| 67 | - <el-option v-for="(item, index) in zxztOptions" :key="index" :label="item.fullName" :value="item.id" /> | |
| 68 | - </el-select> | |
| 69 | - </el-form-item> | |
| 70 | - </el-col> | |
| 71 | - <el-col :span="6"> | |
| 72 | - <el-form-item label="工商名称"> | |
| 73 | - <el-input v-model="query.gsmc" placeholder="工商名称" clearable /> | |
| 74 | - </el-form-item> | |
| 75 | - </el-col> | |
| 76 | - <el-col :span="6"> | |
| 77 | - <el-form-item label="法人"> | |
| 78 | - <el-input v-model="query.fr" placeholder="法人" clearable /> | |
| 79 | - </el-form-item> | |
| 80 | - </el-col> | |
| 81 | - <el-col :span="6"> | |
| 82 | - <el-form-item label="有无社保"> | |
| 83 | - <el-select v-model="query.ywsb" placeholder="有无社保" clearable > | |
| 84 | - <el-option v-for="(item, index) in ywsbOptions" :key="index" :label="item.fullName" :value="item.id" /> | |
| 85 | - </el-select> | |
| 86 | - </el-form-item> | |
| 87 | - </el-col> | |
| 88 | - </template> | |
| 89 | - <el-col :span="6"> | |
| 90 | - <el-form-item> | |
| 91 | - <el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button> | |
| 92 | - <el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button> | |
| 93 | - <el-button type="text" icon="el-icon-arrow-down" @click="showAll=true" v-if="!showAll">展开</el-button> | |
| 94 | - <el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>收起</el-button> | |
| 95 | - </el-form-item> | |
| 96 | - </el-col> | |
| 97 | - </el-form> | |
| 98 | - </el-row> | |
| 99 | - <div class="NCC-common-layout-main NCC-flex-main"> | |
| 100 | - <div class="NCC-common-head"> | |
| 101 | - <div> | |
| 102 | - <el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增</el-button> | |
| 103 | - <el-button type="text" icon="el-icon-download" @click="exportData()">导出</el-button> | |
| 104 | - <el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除</el-button> | |
| 105 | - </div> | |
| 106 | - <div class="NCC-common-head-right"> | |
| 107 | - <el-tooltip effect="dark" content="刷新" placement="top"> | |
| 108 | - <el-link icon="icon-ym icon-ym-Refresh NCC-common-head-icon" :underline="false" @click="reset()" /> | |
| 109 | - </el-tooltip> | |
| 110 | - <screenfull isContainer /> | |
| 111 | - </div> | |
| 112 | - </div> | |
| 113 | - <NCC-table v-loading="listLoading" :data="list" has-c @selection-change="handleSelectionChange"> | |
| 2 | + <div class="app-container"> | |
| 3 | + <!-- 页面头部 --> | |
| 4 | + <div class="page-header"> | |
| 5 | + <div class="header-left"> | |
| 6 | + <h2>门店信息管理</h2> | |
| 7 | + <p class="page-desc">管理门店基本信息,包括门店编码、店名、地址、联系方式等</p> | |
| 8 | + </div> | |
| 9 | + <div class="header-right"> | |
| 10 | + <el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增</el-button> | |
| 11 | + <el-button type="success" icon="el-icon-download" @click="exportData()">导出</el-button> | |
| 12 | + <el-button type="danger" icon="el-icon-delete" @click="handleBatchRemoveDel()" :disabled="multipleSelection.length === 0">批量删除</el-button> | |
| 13 | + <el-button icon="el-icon-refresh" @click="reset()">刷新</el-button> | |
| 14 | + </div> | |
| 15 | + </div> | |
| 16 | + | |
| 17 | + <!-- 搜索区域 --> | |
| 18 | + <div class="search-container"> | |
| 19 | + <el-form :model="query" ref="queryForm" :inline="true" label-width="80px"> | |
| 20 | + <el-form-item label="单据门店" prop="djmd"> | |
| 21 | + <el-input v-model="query.djmd" placeholder="请输入单据门店" clearable style="width: 200px" /> | |
| 22 | + </el-form-item> | |
| 23 | + <el-form-item label="店名" prop="dm"> | |
| 24 | + <el-input v-model="query.dm" placeholder="请输入店名" clearable style="width: 200px" /> | |
| 25 | + </el-form-item> | |
| 26 | + <el-form-item label="城市" prop="cs"> | |
| 27 | + <el-input v-model="query.cs" placeholder="请输入城市" clearable style="width: 200px" /> | |
| 28 | + </el-form-item> | |
| 29 | + <template v-if="showAll"> | |
| 30 | + <el-form-item label="姓名" prop="xm"> | |
| 31 | + <el-input v-model="query.xm" placeholder="请输入姓名" clearable style="width: 200px" /> | |
| 32 | + </el-form-item> | |
| 33 | + <el-form-item label="电话号码" prop="dhhm"> | |
| 34 | + <el-input v-model="query.dhhm" placeholder="请输入电话号码" clearable style="width: 200px" /> | |
| 35 | + </el-form-item> | |
| 36 | + <el-form-item label="座机" prop="zj"> | |
| 37 | + <el-input v-model="query.zj" placeholder="请输入座机" clearable style="width: 200px" /> | |
| 38 | + </el-form-item> | |
| 39 | + <el-form-item label="开业时间" prop="kysj"> | |
| 40 | + <el-date-picker v-model="query.kysj" type="daterange" value-format="timestamp" format="yyyy-MM-dd" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 240px" /> | |
| 41 | + </el-form-item> | |
| 42 | + <el-form-item label="最新状态" prop="zxzt"> | |
| 43 | + <el-select v-model="query.zxzt" placeholder="请选择最新状态" clearable style="width: 200px"> | |
| 44 | + <el-option v-for="(item, index) in zxztOptions" :key="index" :label="item.fullName" :value="item.id" /> | |
| 45 | + </el-select> | |
| 46 | + </el-form-item> | |
| 47 | + <el-form-item label="工商名称" prop="gsmc"> | |
| 48 | + <el-input v-model="query.gsmc" placeholder="请输入工商名称" clearable style="width: 200px" /> | |
| 49 | + </el-form-item> | |
| 50 | + <el-form-item label="法人" prop="fr"> | |
| 51 | + <el-input v-model="query.fr" placeholder="请输入法人" clearable style="width: 200px" /> | |
| 52 | + </el-form-item> | |
| 53 | + <el-form-item label="有无社保" prop="ywsb"> | |
| 54 | + <el-select v-model="query.ywsb" placeholder="请选择有无社保" clearable style="width: 200px"> | |
| 55 | + <el-option v-for="(item, index) in ywsbOptions" :key="index" :label="item.fullName" :value="item.id" /> | |
| 56 | + </el-select> | |
| 57 | + </el-form-item> | |
| 58 | + </template> | |
| 59 | + <el-form-item> | |
| 60 | + <el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button> | |
| 61 | + <el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button> | |
| 62 | + <el-button type="text" icon="el-icon-arrow-down" @click="showAll=true" v-if="!showAll">展开</el-button> | |
| 63 | + <el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>收起</el-button> | |
| 64 | + </el-form-item> | |
| 65 | + </el-form> | |
| 66 | + <!-- 批量操作区域 --> | |
| 67 | + <div class="batch-action-container" v-if="multipleSelection.length > 0"> | |
| 68 | + <span class="selected-count">已选择 {{ multipleSelection.length }} 条记录</span> | |
| 69 | + <el-button type="info" icon="el-icon-close" size="small" @click="handleClearSelection">取消选择</el-button> | |
| 70 | + </div> | |
| 71 | + </div> | |
| 72 | + | |
| 73 | + <!-- 数据表格 --> | |
| 74 | + <div class="table-container"> | |
| 75 | + <NCC-table ref="table" v-loading="listLoading" :data="list" has-c height="calc(100vh - 420px)" @selection-change="handleSelectionChange"> | |
| 114 | 76 | <!-- <el-table-column prop="id" label="主键" align="left" /> --> |
| 115 | 77 | <!-- <el-table-column prop="mdbm" label="门店编码" align="left" /> |
| 116 | 78 | <el-table-column prop="djmdbh" label="门店编号" align="left" /> --> |
| 117 | - <el-table-column prop="djmd" label="单据门店" align="left" /> | |
| 118 | - <el-table-column prop="dm" label="店名" align="left" /> | |
| 119 | - <el-table-column prop="cs" label="城市" align="left" /> | |
| 79 | + <el-table-column prop="djmd" label="单据门店" align="left" show-overflow-tooltip /> | |
| 80 | + <el-table-column prop="dm" label="店名" align="left" show-overflow-tooltip /> | |
| 81 | + <el-table-column prop="cs" label="城市" align="left" show-overflow-tooltip /> | |
| 120 | 82 | <!-- <el-table-column prop="dz" label="地址" align="left" /> --> |
| 121 | - <el-table-column prop="xm" label="姓名" align="left" /> | |
| 122 | - <el-table-column prop="dhhm" label="电话号码" align="left" /> | |
| 123 | - <el-table-column prop="zj" label="座机" align="left" /> | |
| 124 | - <el-table-column prop="kysj" width="150" label="开业时间" align="left" :formatter="ncc.tableDateFormat"/> | |
| 125 | - <el-table-column prop="zzrs" label="在职人数" align="left" /> | |
| 126 | - <el-table-column label="最新状态" prop="zxzt" align="left"> | |
| 83 | + <el-table-column prop="xm" label="姓名" align="left" show-overflow-tooltip /> | |
| 84 | + <el-table-column prop="dhhm" label="电话号码" align="left" show-overflow-tooltip /> | |
| 85 | + <el-table-column prop="zj" label="座机" align="left" show-overflow-tooltip /> | |
| 86 | + <el-table-column prop="kysj" width="150" label="开业时间" align="left" :formatter="ncc.tableDateFormat" show-overflow-tooltip /> | |
| 87 | + <el-table-column prop="zzrs" label="在职人数" align="left" show-overflow-tooltip /> | |
| 88 | + <el-table-column label="最新状态" prop="zxzt" align="left" show-overflow-tooltip> | |
| 127 | 89 | <template slot-scope="scope">{{ scope.row.zxzt | dynamicText(zxztOptions) }}</template> |
| 128 | 90 | </el-table-column> |
| 129 | - <el-table-column prop="gsmc" label="工商名称" align="left" /> | |
| 130 | - <el-table-column prop="fr" label="法人" align="left" /> | |
| 91 | + <el-table-column prop="gsmc" label="工商名称" align="left" show-overflow-tooltip /> | |
| 92 | + <el-table-column prop="fr" label="法人" align="left" show-overflow-tooltip /> | |
| 131 | 93 | <!-- <el-table-column label="有无社保" prop="ywsb" align="left"> |
| 132 | 94 | <template slot-scope="scope">{{ scope.row.ywsb | dynamicText(ywsbOptions) }}</template> |
| 133 | 95 | </el-table-column> --> |
| 134 | - <el-table-column label="是否新店" prop="isNewStore" align="left"> | |
| 96 | + <el-table-column label="是否新店" prop="isNewStore" align="left" show-overflow-tooltip> | |
| 135 | 97 | <template slot-scope="scope"> |
| 136 | 98 | <el-tag v-if="scope.row.isNewStore" type="success" size="small">新店</el-tag> |
| 137 | 99 | <el-tag v-else type="info" size="small">老店</el-tag> |
| 138 | 100 | </template> |
| 139 | 101 | </el-table-column> |
| 140 | - <el-table-column label="阶段" prop="stage" align="left"> | |
| 102 | + <el-table-column label="阶段" prop="stage" align="left" show-overflow-tooltip> | |
| 141 | 103 | <template slot-scope="scope"> |
| 142 | 104 | {{ scope.row.stage==1 ? '第一阶段' : scope.row.stage==2 ? '第二阶段' : scope.row.stage == 3 ? '第三阶段' : '无' }} |
| 143 | 105 | </template> |
| 144 | 106 | </el-table-column> |
| 145 | - <el-table-column label="操作" fixed="right" width="150"> | |
| 107 | + <el-table-column label="操作" fixed="right" width="320" show-overflow-tooltip> | |
| 146 | 108 | <template slot-scope="scope"> |
| 147 | - <el-button type="text" @click="addOrUpdateHandle(scope.row.id)" >编辑</el-button> | |
| 148 | - <el-button type="text" @click="viewNewStoreHandle(scope.row)">查看新店设置</el-button> | |
| 149 | - <el-button type="text" @click="setNewStoreHandle(scope.row)" >设置新店</el-button> | |
| 150 | - <el-button type="text" @click="handleDel(scope.row.id)" class="NCC-table-delBtn" >删除</el-button> | |
| 109 | + <span class="operation-buttons"> | |
| 110 | + <el-button type="text" @click="addOrUpdateHandle(scope.row.id)">编辑</el-button> | |
| 111 | + <el-button type="text" @click="viewNewStoreHandle(scope.row)">查看新店设置</el-button> | |
| 112 | + <el-button type="text" @click="setNewStoreHandle(scope.row)">设置新店</el-button> | |
| 113 | + <el-button type="text" @click="handleDel(scope.row.id)" class="NCC-table-delBtn">删除</el-button> | |
| 114 | + </span> | |
| 151 | 115 | </template> |
| 152 | 116 | </el-table-column> |
| 153 | 117 | </NCC-table> |
| 154 | 118 | <pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData" /> |
| 155 | - </div> | |
| 156 | - </div> | |
| 119 | + </div> | |
| 157 | 120 | <NCC-Form v-if="formVisible" ref="NCCForm" @refresh="refresh" /> |
| 158 | 121 | <ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" /> |
| 159 | 122 | <SetNewStoreDialog v-if="setNewStoreVisible" ref="SetNewStoreDialog" @refresh="refresh" /> |
| ... | ... | @@ -280,6 +243,12 @@ |
| 280 | 243 | const res = val.map(item => item.id) |
| 281 | 244 | this.multipleSelection = res |
| 282 | 245 | }, |
| 246 | + handleClearSelection() { | |
| 247 | + if (this.$refs.table && this.$refs.table.clearSelection) { | |
| 248 | + this.$refs.table.clearSelection() | |
| 249 | + } | |
| 250 | + this.multipleSelection = [] | |
| 251 | + }, | |
| 283 | 252 | handleBatchRemoveDel() { |
| 284 | 253 | if (!this.multipleSelection.length) { |
| 285 | 254 | this.$message({ |
| ... | ... | @@ -385,6 +354,353 @@ |
| 385 | 354 | } |
| 386 | 355 | this.initData() |
| 387 | 356 | } |
| 388 | - } | |
| 357 | + } | |
| 358 | + } | |
| 359 | +</script> | |
| 360 | + | |
| 361 | +<style lang="scss" scoped> | |
| 362 | +.app-container { | |
| 363 | + padding: 16px; | |
| 364 | + background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 50%, #f0f4f8 100%); | |
| 365 | + min-height: 100vh; | |
| 366 | + font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
| 367 | +} | |
| 368 | + | |
| 369 | +.page-header { | |
| 370 | + display: flex; | |
| 371 | + justify-content: space-between; | |
| 372 | + align-items: flex-start; | |
| 373 | + margin-bottom: 16px; | |
| 374 | + padding: 18px 24px; | |
| 375 | + background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%); | |
| 376 | + backdrop-filter: blur(10px); | |
| 377 | + border-radius: 12px; | |
| 378 | + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04); | |
| 379 | + border: 1px solid rgba(144, 147, 153, 0.15); | |
| 380 | + position: relative; | |
| 381 | + overflow: hidden; | |
| 382 | + transition: all 0.3s ease; | |
| 383 | + | |
| 384 | + &:hover { | |
| 385 | + box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06); | |
| 386 | + transform: translateY(-1px); | |
| 387 | + } | |
| 388 | + | |
| 389 | + &::before { | |
| 390 | + content: ''; | |
| 391 | + position: absolute; | |
| 392 | + top: 0; | |
| 393 | + left: 0; | |
| 394 | + right: 0; | |
| 395 | + height: 3px; | |
| 396 | + background: linear-gradient(90deg, #3b82f6 0%, #2563eb 50%, #3b82f6 100%); | |
| 397 | + } | |
| 398 | + | |
| 399 | + .header-left { | |
| 400 | + h2 { | |
| 401 | + margin: 0 0 8px 0; | |
| 402 | + color: #303133; | |
| 403 | + font-size: 22px; | |
| 404 | + font-weight: 700; | |
| 405 | + background: linear-gradient(135deg, #303133 0%, #606266 100%); | |
| 406 | + -webkit-background-clip: text; | |
| 407 | + -webkit-text-fill-color: transparent; | |
| 408 | + background-clip: text; | |
| 409 | + } | |
| 410 | + | |
| 411 | + .page-desc { | |
| 412 | + margin: 0; | |
| 413 | + color: #909399; | |
| 414 | + font-size: 14px; | |
| 415 | + } | |
| 416 | + } | |
| 417 | + | |
| 418 | + .header-right { | |
| 419 | + display: flex; | |
| 420 | + gap: 10px; | |
| 421 | + flex-wrap: wrap; | |
| 422 | + | |
| 423 | + .el-button { | |
| 424 | + border-radius: 8px; | |
| 425 | + padding: 10px 18px; | |
| 426 | + font-weight: 500; | |
| 427 | + transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); | |
| 428 | + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); | |
| 429 | + | |
| 430 | + &:hover { | |
| 431 | + transform: translateY(-2px); | |
| 432 | + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12); | |
| 433 | + } | |
| 434 | + | |
| 435 | + &.el-button--primary { | |
| 436 | + background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); | |
| 437 | + border: none; | |
| 438 | + | |
| 439 | + &:hover { | |
| 440 | + background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); | |
| 441 | + } | |
| 442 | + } | |
| 443 | + | |
| 444 | + &.el-button--success { | |
| 445 | + background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); | |
| 446 | + border: none; | |
| 447 | + | |
| 448 | + &:hover { | |
| 449 | + background: linear-gradient(135deg, #16a34a 0%, #15803d 100%); | |
| 450 | + } | |
| 451 | + } | |
| 452 | + | |
| 453 | + &.el-button--danger { | |
| 454 | + background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); | |
| 455 | + border: none; | |
| 456 | + | |
| 457 | + &:hover { | |
| 458 | + background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); | |
| 459 | + } | |
| 460 | + | |
| 461 | + &:disabled { | |
| 462 | + background: #e5e7eb; | |
| 463 | + color: #9ca3af; | |
| 464 | + cursor: not-allowed; | |
| 465 | + } | |
| 466 | + } | |
| 467 | + | |
| 468 | + &:not(.el-button--primary):not(.el-button--success):not(.el-button--danger) { | |
| 469 | + background: rgba(255, 255, 255, 0.9); | |
| 470 | + border-color: rgba(144, 147, 153, 0.3); | |
| 471 | + color: #606266; | |
| 472 | + | |
| 473 | + &:hover { | |
| 474 | + background: rgba(255, 255, 255, 1); | |
| 475 | + border-color: rgba(144, 147, 153, 0.5); | |
| 476 | + } | |
| 477 | + } | |
| 478 | + } | |
| 479 | + } | |
| 480 | +} | |
| 481 | + | |
| 482 | +.search-container { | |
| 483 | + margin-bottom: 16px; | |
| 484 | + padding: 18px 24px; | |
| 485 | + background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%); | |
| 486 | + backdrop-filter: blur(10px); | |
| 487 | + border-radius: 12px; | |
| 488 | + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04); | |
| 489 | + border: 1px solid rgba(144, 147, 153, 0.15); | |
| 490 | + transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); | |
| 491 | + | |
| 492 | + &:hover { | |
| 493 | + box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06); | |
| 494 | + } | |
| 495 | + | |
| 496 | + ::v-deep .el-form { | |
| 497 | + .el-form-item { | |
| 498 | + margin-bottom: 16px; | |
| 499 | + } | |
| 500 | + | |
| 501 | + .el-form-item__label { | |
| 502 | + font-weight: 600; | |
| 503 | + color: #606266; | |
| 504 | + } | |
| 505 | + | |
| 506 | + .el-button { | |
| 507 | + border-radius: 8px; | |
| 508 | + padding: 10px 20px; | |
| 509 | + font-weight: 500; | |
| 510 | + transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); | |
| 511 | + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); | |
| 512 | + | |
| 513 | + &:hover { | |
| 514 | + transform: translateY(-2px); | |
| 515 | + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12); | |
| 516 | + } | |
| 517 | + | |
| 518 | + &.el-button--primary { | |
| 519 | + background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); | |
| 520 | + border: none; | |
| 521 | + | |
| 522 | + &:hover { | |
| 523 | + background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); | |
| 524 | + } | |
| 525 | + } | |
| 526 | + | |
| 527 | + &:not(.el-button--primary) { | |
| 528 | + background: rgba(255, 255, 255, 0.9); | |
| 529 | + border-color: rgba(144, 147, 153, 0.3); | |
| 530 | + color: #606266; | |
| 531 | + | |
| 532 | + &:hover { | |
| 533 | + background: rgba(255, 255, 255, 1); | |
| 534 | + border-color: rgba(144, 147, 153, 0.5); | |
| 535 | + } | |
| 536 | + } | |
| 537 | + } | |
| 538 | + | |
| 539 | + .el-input__inner, | |
| 540 | + .el-select .el-input__inner, | |
| 541 | + .el-date-editor .el-input__inner { | |
| 542 | + border-radius: 8px; | |
| 543 | + border: 1px solid rgba(144, 147, 153, 0.3); | |
| 544 | + transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); | |
| 545 | + | |
| 546 | + &:focus { | |
| 547 | + border-color: #3b82f6; | |
| 548 | + box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15); | |
| 549 | + } | |
| 550 | + } | |
| 551 | + } | |
| 552 | +} | |
| 553 | + | |
| 554 | +.batch-action-container { | |
| 555 | + margin-top: 16px; | |
| 556 | + padding: 14px 18px; | |
| 557 | + background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(37, 99, 235, 0.05) 100%); | |
| 558 | + border-radius: 10px; | |
| 559 | + border: 1px solid rgba(59, 130, 246, 0.2); | |
| 560 | + display: flex; | |
| 561 | + align-items: center; | |
| 562 | + gap: 12px; | |
| 563 | + box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1); | |
| 564 | + animation: slideDown 0.3s ease; | |
| 565 | + | |
| 566 | + @keyframes slideDown { | |
| 567 | + from { | |
| 568 | + opacity: 0; | |
| 569 | + transform: translateY(-10px); | |
| 570 | + } | |
| 571 | + to { | |
| 572 | + opacity: 1; | |
| 573 | + transform: translateY(0); | |
| 574 | + } | |
| 575 | + } | |
| 576 | + | |
| 577 | + .selected-count { | |
| 578 | + color: #3b82f6; | |
| 579 | + font-weight: 600; | |
| 580 | + margin-right: 8px; | |
| 581 | + font-size: 14px; | |
| 582 | + } | |
| 583 | + | |
| 584 | + .el-button { | |
| 585 | + border-radius: 8px; | |
| 586 | + font-weight: 500; | |
| 587 | + transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); | |
| 588 | + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08); | |
| 589 | + | |
| 590 | + &:hover { | |
| 591 | + transform: translateY(-2px); | |
| 592 | + box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12); | |
| 593 | + } | |
| 594 | + } | |
| 595 | +} | |
| 596 | + | |
| 597 | +.table-container { | |
| 598 | + margin-bottom: 20px; | |
| 599 | + padding: 18px 24px; | |
| 600 | + background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%); | |
| 601 | + backdrop-filter: blur(10px); | |
| 602 | + border-radius: 12px; | |
| 603 | + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04); | |
| 604 | + border: 1px solid rgba(144, 147, 153, 0.15); | |
| 605 | + transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); | |
| 606 | + position: relative; | |
| 607 | + overflow: hidden; | |
| 608 | + | |
| 609 | + &:hover { | |
| 610 | + box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06); | |
| 611 | + } | |
| 612 | + | |
| 613 | + ::v-deep .NCC-table { | |
| 614 | + .el-table { | |
| 615 | + border-radius: 8px; | |
| 616 | + overflow: hidden; | |
| 617 | + border: 1px solid rgba(144, 147, 153, 0.2); | |
| 618 | + | |
| 619 | + .el-table__header { | |
| 620 | + background: linear-gradient(135deg, rgba(248, 249, 250, 0.9) 0%, rgba(240, 242, 245, 0.9) 100%); | |
| 621 | + | |
| 622 | + th { | |
| 623 | + background: transparent; | |
| 624 | + color: #303133; | |
| 625 | + font-weight: 600; | |
| 626 | + border-bottom: 2px solid rgba(144, 147, 153, 0.2); | |
| 627 | + padding: 14px 0; | |
| 628 | + white-space: nowrap; | |
| 629 | + overflow: hidden; | |
| 630 | + text-overflow: ellipsis; | |
| 631 | + } | |
| 632 | + } | |
| 633 | + | |
| 634 | + .el-table__body { | |
| 635 | + tr { | |
| 636 | + transition: all 0.3s ease; | |
| 637 | + | |
| 638 | + &:hover { | |
| 639 | + background: linear-gradient(135deg, rgba(239, 246, 255, 0.5) 0%, rgba(219, 234, 254, 0.5) 100%); | |
| 640 | + transform: translateX(2px); | |
| 641 | + } | |
| 642 | + } | |
| 643 | + | |
| 644 | + td { | |
| 645 | + border-bottom: 1px solid rgba(144, 147, 153, 0.15); | |
| 646 | + padding: 12px 0; | |
| 647 | + white-space: nowrap; | |
| 648 | + overflow: hidden; | |
| 649 | + text-overflow: ellipsis; | |
| 650 | + } | |
| 651 | + } | |
| 652 | + | |
| 653 | + .el-table__row--striped { | |
| 654 | + td { | |
| 655 | + background-color: #fafafa; | |
| 656 | + } | |
| 657 | + } | |
| 658 | + | |
| 659 | + // 操作列特殊处理,确保按钮不换行 | |
| 660 | + // 操作列特殊处理,确保按钮不换行 | |
| 661 | + .el-table__body-wrapper, | |
| 662 | + .el-table__fixed-body-wrapper, | |
| 663 | + .el-table__fixed-right-body-wrapper { | |
| 664 | + .operation-buttons { | |
| 665 | + display: inline-flex; | |
| 666 | + align-items: center; | |
| 667 | + gap: 4px; | |
| 668 | + white-space: nowrap; | |
| 669 | + flex-wrap: nowrap; | |
| 670 | + width: 100%; | |
| 671 | + justify-content: flex-start; | |
| 672 | + } | |
| 673 | + } | |
| 674 | + } | |
| 675 | + | |
| 676 | + .el-button--text { | |
| 677 | + padding: 4px 8px; | |
| 678 | + border-radius: 4px; | |
| 679 | + transition: all 0.3s ease; | |
| 680 | + white-space: nowrap; | |
| 681 | + flex-shrink: 0; | |
| 682 | + | |
| 683 | + &:hover { | |
| 684 | + background: rgba(59, 130, 246, 0.1); | |
| 685 | + color: #3b82f6; | |
| 686 | + } | |
| 687 | + | |
| 688 | + &.NCC-table-delBtn { | |
| 689 | + &:hover { | |
| 690 | + background: rgba(239, 68, 68, 0.1); | |
| 691 | + color: #ef4444; | |
| 692 | + } | |
| 693 | + } | |
| 389 | 694 | } |
| 390 | -</script> | |
| 391 | 695 | \ No newline at end of file |
| 696 | + } | |
| 697 | +} | |
| 698 | + | |
| 699 | +// 图标动画 | |
| 700 | +::v-deep .el-icon { | |
| 701 | + transition: all 0.3s ease; | |
| 702 | + | |
| 703 | + &:hover { | |
| 704 | + transform: scale(1.1) rotate(5deg); | |
| 705 | + } | |
| 706 | +} | |
| 707 | +</style> | |
| 392 | 708 | \ No newline at end of file | ... | ... |
antis-ncc-admin/src/views/wageManagement/director-detail-dialog.vue
| ... | ... | @@ -288,7 +288,7 @@ export default { |
| 288 | 288 | getFieldsByCategory(category) { |
| 289 | 289 | if (!this.detailData) return [] |
| 290 | 290 | |
| 291 | - const excludeFields = ['StoreName', 'EmployeeName', 'Position', 'Id', 'CreateTime', 'UpdateTime', 'CreateUser', 'UpdateUser', 'StatisticsMonth', 'GoldTriangleTeam', 'IsNewStore', 'NewStoreProtectionStage', 'IsLocked'] | |
| 291 | + const excludeFields = ['StoreName', 'EmployeeName', 'Position', 'Id', 'CreateTime', 'UpdateTime', 'CreateUser', 'UpdateUser', 'StatisticsMonth', 'GoldTriangleTeam', 'IsNewStore', 'NewStoreProtectionStage', 'IsLocked', 'StoreId', 'EmployeeId', 'SalesPerformance'] | |
| 292 | 292 | |
| 293 | 293 | const categoryMap = { |
| 294 | 294 | performance: ['Performance', 'Lifeline', 'CompletionRate', 'Reached', 'HeadCount', 'Target', 'Consume'], |
| ... | ... | @@ -356,10 +356,11 @@ export default { |
| 356 | 356 | const moneyFields = ['performance', 'commission', 'salary', 'subsidy', 'deduction', 'amount', 'fee', 'bonus', 'deposit', 'supplement', 'payment', 'consumption', 'reward', 'handwork', 'gross', 'guaranteed', 'transportation', 'allowance', 'total'] |
| 357 | 357 | const percentFields = ['point', 'rate', 'percentage', 'percent'] |
| 358 | 358 | |
| 359 | - if (moneyFields.some(field => lowerKey.includes(field)) && !lowerKey.includes('status')) { | |
| 360 | - return 'money' | |
| 361 | - } else if (percentFields.some(field => lowerKey.includes(field))) { | |
| 359 | + // 注意:先检查百分比字段,避免 CommissionRate 等字段被误识别为金额 | |
| 360 | + if (percentFields.some(field => lowerKey.includes(field))) { | |
| 362 | 361 | return 'percent' |
| 362 | + } else if (moneyFields.some(field => lowerKey.includes(field)) && !lowerKey.includes('status')) { | |
| 363 | + return 'money' | |
| 363 | 364 | } |
| 364 | 365 | return 'text' |
| 365 | 366 | }, |
| ... | ... | @@ -371,6 +372,12 @@ export default { |
| 371 | 372 | 'StoreTotalPerformance': '门店总业绩', |
| 372 | 373 | 'StoreBillingPerformance': '门店开单业绩', |
| 373 | 374 | 'StoreRefundPerformance': '门店退卡业绩', |
| 375 | + 'SalesPerformance': '销售业绩', | |
| 376 | + 'ProductMaterial': '产品物料', | |
| 377 | + 'CooperationCost': '合作项目成本', | |
| 378 | + 'StoreExpense': '店内支出', | |
| 379 | + 'LaundryCost': '洗毛巾费用', | |
| 380 | + 'GrossProfit': '毛利', | |
| 374 | 381 | 'StoreLifeline': '门店生命线', |
| 375 | 382 | 'PerformanceCompletionRate': '业绩完成率', |
| 376 | 383 | 'TotalPerformance': '总业绩', |
| ... | ... | @@ -456,7 +463,13 @@ export default { |
| 456 | 463 | 'StoreType': '门店类型', |
| 457 | 464 | 'StoreCategory': '门店类别', |
| 458 | 465 | 'IsNewStore': '是否新店', |
| 459 | - 'NewStoreProtectionStage': '新店保护阶段' | |
| 466 | + 'NewStoreProtectionStage': '新店保护阶段', | |
| 467 | + 'StoreId': '门店ID', | |
| 468 | + 'EmployeeId': '员工ID', | |
| 469 | + 'StatisticsMonth': '统计月份', | |
| 470 | + 'EmployeeConfirmStatus': '确认状态', | |
| 471 | + 'EmployeeConfirmTime': '员工确认时间', | |
| 472 | + 'EmployeeConfirmRemark': '员工确认备注' | |
| 460 | 473 | } |
| 461 | 474 | |
| 462 | 475 | // 如果映射中存在,直接返回中文 |
| ... | ... | @@ -571,14 +584,24 @@ export default { |
| 571 | 584 | return highlightFields.includes(key) |
| 572 | 585 | }, |
| 573 | 586 | // 获取字段顺序 |
| 587 | + // 注意:毛利(GrossProfit)需要放在生命线提成比例(CommissionRateBelowLifeline)前面 | |
| 574 | 588 | getFieldOrder(key) { |
| 575 | 589 | const orderMap = { |
| 576 | 590 | 'TotalPerformance': 1, |
| 577 | 591 | 'BasePerformance': 2, |
| 578 | 592 | 'CooperationPerformance': 3, |
| 579 | - 'TotalCommission': 10, | |
| 580 | - 'BasePerformanceCommission': 11, | |
| 581 | - 'CooperationPerformanceCommission': 12, | |
| 593 | + 'StoreTotalPerformance': 4, | |
| 594 | + 'SalesPerformance': 5, | |
| 595 | + 'GrossProfit': 6, // 毛利放在生命线提成比例前面 | |
| 596 | + 'StoreLifeline': 7, | |
| 597 | + 'CommissionRateBelowLifeline': 8, // 生命线提成比例 | |
| 598 | + 'CommissionRateAboveLifeline': 9, | |
| 599 | + 'CommissionAmountBelowLifeline': 10, | |
| 600 | + 'CommissionAmountAboveLifeline': 11, | |
| 601 | + 'TotalCommissionAmount': 12, | |
| 602 | + 'TotalCommission': 13, | |
| 603 | + 'BasePerformanceCommission': 14, | |
| 604 | + 'CooperationPerformanceCommission': 15, | |
| 582 | 605 | 'FinalGrossSalary': 20, |
| 583 | 606 | 'ActualSalary': 21, |
| 584 | 607 | 'TotalSubsidy': 30, | ... | ... |
antis-ncc-admin/src/views/wageManagement/director.vue
| ... | ... | @@ -418,7 +418,7 @@ export default { |
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | const columns = {} |
| 421 | - const excludeFields = ['StoreName', 'EmployeeName', 'Position', 'Id', 'CreateTime', 'UpdateTime', 'CreateUser', 'UpdateUser', 'StatisticsMonth'] | |
| 421 | + const excludeFields = ['StoreName', 'EmployeeName', 'Position', 'Id', 'CreateTime', 'UpdateTime', 'CreateUser', 'UpdateUser', 'StatisticsMonth', 'StoreId', 'EmployeeId', 'SalesPerformance'] | |
| 422 | 422 | |
| 423 | 423 | // 金额字段关键词 |
| 424 | 424 | const moneyFields = ['Performance', 'Commission', 'Salary', 'Subsidy', 'Deduction', 'Amount', 'Fee', 'Bonus', 'Deposit', 'Supplement', 'Payment', 'Consumption', 'Reward', 'Handwork', 'Gross', 'Guaranteed', 'Transportation', 'Allowance', 'Total'] |
| ... | ... | @@ -426,8 +426,12 @@ export default { |
| 426 | 426 | const percentFields = ['Point', 'Rate', 'Percentage', 'Percent'] |
| 427 | 427 | |
| 428 | 428 | // 定义字段顺序(重要字段优先) |
| 429 | + // 注意:毛利(GrossProfit)需要放在生命线提成比例(CommissionRateBelowLifeline)前面 | |
| 429 | 430 | const fieldOrder = [ |
| 430 | 431 | 'GoldTriangleTeam', 'TotalPerformance', 'BasePerformance', 'CooperationPerformance', |
| 432 | + 'StoreTotalPerformance', 'GrossProfit', | |
| 433 | + 'StoreLifeline', 'CommissionRateBelowLifeline', 'CommissionRateAboveLifeline', | |
| 434 | + 'CommissionAmountBelowLifeline', 'CommissionAmountAboveLifeline', 'TotalCommissionAmount', | |
| 431 | 435 | 'TotalCommission', 'BasePerformanceCommission', 'CooperationPerformanceCommission', |
| 432 | 436 | 'FinalGrossSalary', 'ActualSalary', 'TotalSubsidy', 'TotalDeduction', |
| 433 | 437 | 'IsLocked', 'IsNewStore', 'NewStoreProtectionStage' |
| ... | ... | @@ -487,11 +491,12 @@ export default { |
| 487 | 491 | const moneyFields = ['performance', 'commission', 'salary', 'subsidy', 'deduction', 'amount', 'fee', 'bonus', 'deposit', 'supplement', 'payment', 'consumption', 'reward', 'handwork', 'gross', 'guaranteed', 'transportation', 'allowance', 'total'] |
| 488 | 492 | const percentFields = ['point', 'rate', 'percentage', 'percent'] |
| 489 | 493 | |
| 490 | - // 注意:payment 需要排除 PaymentStatus 这种状态字段 | |
| 491 | - if (moneyFields.some(field => lowerKey.includes(field)) && !lowerKey.includes('status')) { | |
| 492 | - return 'money' | |
| 493 | - } else if (percentFields.some(field => lowerKey.includes(field))) { | |
| 494 | + // 注意:先检查百分比字段,避免 CommissionRate 等字段被误识别为金额 | |
| 495 | + // payment 需要排除 PaymentStatus 这种状态字段 | |
| 496 | + if (percentFields.some(field => lowerKey.includes(field))) { | |
| 494 | 497 | return 'percent' |
| 498 | + } else if (moneyFields.some(field => lowerKey.includes(field)) && !lowerKey.includes('status')) { | |
| 499 | + return 'money' | |
| 495 | 500 | } |
| 496 | 501 | return 'text' |
| 497 | 502 | }, |
| ... | ... | @@ -504,6 +509,12 @@ export default { |
| 504 | 509 | 'StoreTotalPerformance': '门店总业绩', |
| 505 | 510 | 'StoreBillingPerformance': '门店开单业绩', |
| 506 | 511 | 'StoreRefundPerformance': '门店退卡业绩', |
| 512 | + 'SalesPerformance': '销售业绩', | |
| 513 | + 'ProductMaterial': '产品物料', | |
| 514 | + 'CooperationCost': '合作项目成本', | |
| 515 | + 'StoreExpense': '店内支出', | |
| 516 | + 'LaundryCost': '洗毛巾费用', | |
| 517 | + 'GrossProfit': '毛利', | |
| 507 | 518 | 'StoreLifeline': '门店生命线', |
| 508 | 519 | 'PerformanceCompletionRate': '业绩完成率', |
| 509 | 520 | 'TotalPerformance': '总业绩', |
| ... | ... | @@ -584,7 +595,13 @@ export default { |
| 584 | 595 | 'StoreType': '门店类型', |
| 585 | 596 | 'StoreCategory': '门店类别', |
| 586 | 597 | 'IsNewStore': '是否新店', |
| 587 | - 'NewStoreProtectionStage': '新店保护阶段' | |
| 598 | + 'NewStoreProtectionStage': '新店保护阶段', | |
| 599 | + 'StoreId': '门店ID', | |
| 600 | + 'EmployeeId': '员工ID', | |
| 601 | + 'StatisticsMonth': '统计月份', | |
| 602 | + 'EmployeeConfirmStatus': '确认状态', | |
| 603 | + 'EmployeeConfirmTime': '员工确认时间', | |
| 604 | + 'EmployeeConfirmRemark': '员工确认备注' | |
| 588 | 605 | } |
| 589 | 606 | |
| 590 | 607 | return labelMap[key] || key | ... | ... |
docs/test-reports/所有会员剩余品项导出接口测试报告.md
0 → 100644
| 1 | +# 所有会员剩余品项导出接口测试报告 | |
| 2 | + | |
| 3 | +## 测试日期 | |
| 4 | +2026-01-14 | |
| 5 | + | |
| 6 | +## 测试接口 | |
| 7 | +`GET /api/Extend/LqKhxx/Actions/ExportAllMemberRemainingItems` | |
| 8 | + | |
| 9 | +## 测试目的 | |
| 10 | +验证导出所有会员剩余品项接口的功能,包括: | |
| 11 | +1. 接口能否正常调用 | |
| 12 | +2. 能否正确导出Excel文件 | |
| 13 | +3. 多sheet功能是否正常工作(当数据超过65535行时) | |
| 14 | + | |
| 15 | +## 测试环境 | |
| 16 | +- 服务器地址:http://localhost:2011 | |
| 17 | +- 测试账号:admin | |
| 18 | +- 导出格式:.xlsx | |
| 19 | + | |
| 20 | +## 测试步骤 | |
| 21 | + | |
| 22 | +### 1. 获取认证Token | |
| 23 | +```bash | |
| 24 | +POST /api/oauth/Login | |
| 25 | +Content-Type: application/x-www-form-urlencoded | |
| 26 | + | |
| 27 | +account=admin&password=e10adc3949ba59abbe56e057f20f883e | |
| 28 | +``` | |
| 29 | +**结果**:✅ Token获取成功 | |
| 30 | + | |
| 31 | +### 2. 调用导出接口 | |
| 32 | +```bash | |
| 33 | +GET /api/Extend/LqKhxx/Actions/ExportAllMemberRemainingItems | |
| 34 | +Authorization: Bearer {token} | |
| 35 | +``` | |
| 36 | +**结果**:✅ 接口调用成功 | |
| 37 | + | |
| 38 | +## 测试结果 | |
| 39 | + | |
| 40 | +### 响应数据 | |
| 41 | +```json | |
| 42 | +{ | |
| 43 | + "code": 200, | |
| 44 | + "msg": "操作成功", | |
| 45 | + "data": { | |
| 46 | + "name": "所有会员剩余品项_20260114173452.xlsx", | |
| 47 | + "url": "/api/File/Download?encryption=..." | |
| 48 | + }, | |
| 49 | + "extras": null, | |
| 50 | + "timestamp": 1768383296621 | |
| 51 | +} | |
| 52 | +``` | |
| 53 | + | |
| 54 | +### 测试结论 | |
| 55 | + | |
| 56 | +#### ✅ 功能测试通过 | |
| 57 | +1. **接口调用成功**:接口返回 HTTP 200 状态码 | |
| 58 | +2. **文件生成成功**:成功生成 Excel 文件,文件名为 `所有会员剩余品项_20260114173452.xlsx` | |
| 59 | +3. **文件格式正确**:使用 `.xlsx` 格式,支持多sheet | |
| 60 | +4. **下载URL正常**:返回了有效的文件下载URL | |
| 61 | + | |
| 62 | +#### ✅ 实现功能 | |
| 63 | +1. **多sheet支持**:实现了多sheet导出功能,每个sheet最多支持65535行数据 | |
| 64 | +2. **自动分sheet**:当数据超过65535行时,自动创建新的sheet(Sheet1, Sheet2, Sheet3...) | |
| 65 | +3. **表头完整**:每个sheet都包含完整的表头 | |
| 66 | +4. **数据完整性**:所有会员的剩余品项数据都能正确导出 | |
| 67 | + | |
| 68 | +## 功能说明 | |
| 69 | + | |
| 70 | +### 导出字段 | |
| 71 | +- 会员ID (memberId) | |
| 72 | +- 会员姓名 (memberName) | |
| 73 | +- 手机号 (phone) | |
| 74 | +- 归属门店 (storeName) | |
| 75 | +- 开单品项ID (billingItemId) | |
| 76 | +- 品项ID (itemId) | |
| 77 | +- 品项名称 (itemName) | |
| 78 | +- 品项单价 (itemPrice) | |
| 79 | +- 来源类型 (sourceType) | |
| 80 | +- 总购买数量 (totalPurchased) | |
| 81 | +- 已耗卡数量 (consumedCount) | |
| 82 | +- 已退卡数量 (refundedCount) | |
| 83 | +- 已储扣数量 (deductCount) | |
| 84 | +- 剩余数量 (remainingCount) | |
| 85 | +- 备注 (remark) | |
| 86 | + | |
| 87 | +### 技术实现 | |
| 88 | +- 使用 `XSSFWorkbook` 创建 `.xlsx` 格式的 Excel 文件 | |
| 89 | +- 每个 sheet 最多支持 65535 行数据(不包括表头) | |
| 90 | +- 当数据超过限制时,自动创建新的 sheet | |
| 91 | +- 使用 NPOI 库直接操作 Excel 文件,支持大数据量导出 | |
| 92 | + | |
| 93 | +### 数据筛选 | |
| 94 | +- 只导出剩余数量不等于0的品项 | |
| 95 | +- 只导出有效会员(IsEffective = 有效)的数据 | |
| 96 | + | |
| 97 | +## 测试状态 | |
| 98 | +✅ **测试通过** | |
| 99 | + | |
| 100 | +## 备注 | |
| 101 | +- 接口已成功实现多sheet导出功能 | |
| 102 | +- 支持大数据量导出,不会因为数据量过大而失败 | |
| 103 | +- 生成的Excel文件格式正确,可以正常打开和查看 | ... | ... |
docs/test-reports/科技部总经理Cell金额计算修复验证.md
0 → 100644
| 1 | +# 科技部总经理Cell金额计算修复验证报告 | |
| 2 | + | |
| 3 | +## 修复内容 | |
| 4 | + | |
| 5 | +### 1. 改为批量查询(与科技部驾驶舱接口保持一致) | |
| 6 | + | |
| 7 | +**修复前**:逐个门店循环查询 | |
| 8 | +```csharp | |
| 9 | +foreach (var storeId in allManagedStoreIds) | |
| 10 | +{ | |
| 11 | + // 单个门店查询 | |
| 12 | + var storeCellBillingSql = $"SELECT ... WHERE F_StoreId = '{storeId}' ..."; | |
| 13 | +} | |
| 14 | +``` | |
| 15 | + | |
| 16 | +**修复后**:批量查询所有门店,然后按门店分组 | |
| 17 | +```csharp | |
| 18 | +// 批量查询所有门店的开单Cell金额 | |
| 19 | +var allStoreCellBillingSql = $@" | |
| 20 | + SELECT F_StoreId, COALESCE(SUM(CAST(jksyj AS DECIMAL(18,2))), 0) as Amount | |
| 21 | + FROM lq_kd_jksyj | |
| 22 | + WHERE F_IsEffective = 1 | |
| 23 | + AND F_StoreId IN ('{string.Join("','", allManagedStoreIds)}') | |
| 24 | + AND (F_BeautyType = 'cell' OR F_BeautyType = 'Cell') | |
| 25 | + AND yjsj >= '{startDateStr}' | |
| 26 | + AND yjsj <= '{endDateTimeStr}' | |
| 27 | + GROUP BY F_StoreId"; | |
| 28 | +``` | |
| 29 | + | |
| 30 | +### 2. 查询逻辑完全对齐 | |
| 31 | + | |
| 32 | +- ✅ 使用相同的SQL格式 | |
| 33 | +- ✅ 使用相同的时间范围处理 | |
| 34 | +- ✅ 使用相同的CAST转换 | |
| 35 | +- ✅ 使用相同的退卡金额查询逻辑 | |
| 36 | + | |
| 37 | +## 预期结果 | |
| 38 | + | |
| 39 | +- **Cell金额合计**:**69,838.00** 元 | |
| 40 | +- **关键门店**: | |
| 41 | + - 绿纤静居寺店:46,110.00 元 | |
| 42 | + - 绿纤468店:0.00 元 | |
| 43 | + - 绿纤明信店:2,200.00 元 | |
| 44 | + | |
| 45 | +## 验证步骤 | |
| 46 | + | |
| 47 | +1. **重启服务**(必须) | |
| 48 | +2. **调用计算接口** | |
| 49 | +3. **验证数据库结果** | ... | ... |
docs/test-reports/科技部总经理Cell金额计算测试报告.md
0 → 100644
| 1 | +# 科技部总经理Cell金额计算测试报告 | |
| 2 | + | |
| 3 | +## 测试目的 | |
| 4 | +验证科技部总经理工资计算接口的Cell金额计算是否正确,是否与科技部驾驶舱接口的计算结果一致。 | |
| 5 | + | |
| 6 | +## 测试时间 | |
| 7 | +2026-01-14 | |
| 8 | + | |
| 9 | +## 测试步骤 | |
| 10 | + | |
| 11 | +### 1. 调用计算接口 | |
| 12 | +```bash | |
| 13 | +POST /api/Extend/lqtechgeneralmanagersalary/calculate/tech-general-manager?year=2025&month=12 | |
| 14 | +``` | |
| 15 | + | |
| 16 | +**响应**: | |
| 17 | +```json | |
| 18 | +{ | |
| 19 | + "code": 200, | |
| 20 | + "msg": "操作成功", | |
| 21 | + "data": null | |
| 22 | +} | |
| 23 | +``` | |
| 24 | + | |
| 25 | +### 2. 查询计算结果 | |
| 26 | + | |
| 27 | +**夏萍的工资记录**: | |
| 28 | +```sql | |
| 29 | +SELECT F_EmployeeName, F_StatisticsMonth, F_CellAmount, F_TraceabilityAmount, F_CellCommissionAmount | |
| 30 | +FROM lq_tech_general_manager_salary_statistics | |
| 31 | +WHERE F_EmployeeName LIKE '%夏萍%' AND F_StatisticsMonth = '202512' | |
| 32 | +``` | |
| 33 | + | |
| 34 | +**结果**: | |
| 35 | +- Cell金额:**60,994.30** 元 | |
| 36 | +- 溯源金额:347,256.00 元 | |
| 37 | +- Cell提成金额:109.94 元 | |
| 38 | +- 记录状态:未锁定(IsLocked = 0),未确认(EmployeeConfirmStatus = 0) | |
| 39 | + | |
| 40 | +### 3. 对比科技部驾驶舱接口 | |
| 41 | + | |
| 42 | +**科技部驾驶舱接口**: | |
| 43 | +```bash | |
| 44 | +POST /api/Extend/LqTechDepartmentDashboard/GetStatistics | |
| 45 | +{ | |
| 46 | + "statisticsMonth": "202512", | |
| 47 | + "techDepartmentId": "734725579919590661", | |
| 48 | + "storeIds": [] | |
| 49 | +} | |
| 50 | +``` | |
| 51 | + | |
| 52 | +**结果**: | |
| 53 | +- Cell金额:**69,838.00** 元 | |
| 54 | +- 开单Cell金额:69,838.00 元 | |
| 55 | +- 退卡Cell金额:0.00 元 | |
| 56 | +- 溯源金额:356,848.50 元 | |
| 57 | + | |
| 58 | +### 4. 差异分析 | |
| 59 | + | |
| 60 | +| 指标 | 工资计算接口 | 科技部驾驶舱接口 | 差异 | | |
| 61 | +|------|------------|----------------|------| | |
| 62 | +| Cell金额 | 60,994.30 | 69,838.00 | **-8,843.70** | | |
| 63 | + | |
| 64 | +**门店明细差异**(从门店明细JSON中提取): | |
| 65 | +- 绿纤静居寺店:37,400.00 → 预期:46,110.00(+8,710.00) | |
| 66 | +- 绿纤468店:66.30 → 预期:0.00(-66.30) | |
| 67 | +- 绿纤明信店:2,000.00 → 预期:2,200.00(+200.00) | |
| 68 | + | |
| 69 | +## 代码修改情况 | |
| 70 | + | |
| 71 | +### 已完成的修改 | |
| 72 | +1. ✅ 添加 `endDateTime` 变量,使用与科技部驾驶舱接口相同的时间范围处理方式 | |
| 73 | +2. ✅ 修改开单溯源金额和开单Cell金额的查询方式,从 SqlSugar ORM 改为原生SQL | |
| 74 | +3. ✅ 修改退卡金额的时间范围,从 `endDate.AddDays(1)` 改为 `endDate.Date` | |
| 75 | +4. ✅ 更新接口注释,说明修改内容 | |
| 76 | + | |
| 77 | +### 代码位置 | |
| 78 | +- 文件:`netcore/src/Modularity/Extend/NCC.Extend/LqTechGeneralManagerSalaryService.cs` | |
| 79 | +- 方法:`CalculateTechGeneralManagerSalary` | |
| 80 | +- 修改行:232-372 | |
| 81 | + | |
| 82 | +## 问题分析 | |
| 83 | + | |
| 84 | +### 数据未更新的原因 | |
| 85 | +数据仍然显示为旧值(60,994.30),可能的原因: | |
| 86 | +1. **服务未重启**:代码已修改并编译通过,但服务可能还未重启,仍在使用旧代码 | |
| 87 | +2. **代码未生效**:虽然接口返回成功,但可能由于缓存或其他原因,新代码未执行 | |
| 88 | + | |
| 89 | +### 验证代码是否正确 | |
| 90 | +代码逻辑检查: | |
| 91 | +- ✅ `endDateTime` 变量已正确定义(第232行) | |
| 92 | +- ✅ 开单Cell金额SQL查询使用 `endDateTime`(第360行) | |
| 93 | +- ✅ 退卡Cell金额使用 `endDate.Date` 范围(第371行) | |
| 94 | + | |
| 95 | +## 建议 | |
| 96 | + | |
| 97 | +### 1. 重启服务 | |
| 98 | +**必须重启服务**以使新代码生效: | |
| 99 | +- 如果使用 `dotnet watch run`,可能需要手动重启 | |
| 100 | +- 如果使用服务部署,需要重新部署或重启服务 | |
| 101 | + | |
| 102 | +### 2. 重新执行计算 | |
| 103 | +服务重启后,重新调用计算接口: | |
| 104 | +```bash | |
| 105 | +POST /api/Extend/lqtechgeneralmanagersalary/calculate/tech-general-manager?year=2025&month=12 | |
| 106 | +``` | |
| 107 | + | |
| 108 | +### 3. 验证结果 | |
| 109 | +重新计算后,验证: | |
| 110 | +- Cell金额应该为 **69,838.00** 元(与科技部驾驶舱接口一致) | |
| 111 | +- 门店明细中的Cell金额应该更新为正确值 | |
| 112 | + | |
| 113 | +## 预期结果 | |
| 114 | + | |
| 115 | +修改后的代码应该能够计算出: | |
| 116 | +- **Cell金额**:69,838.00 元(与科技部驾驶舱接口一致) | |
| 117 | +- **门店明细**: | |
| 118 | + - 绿纤静居寺店:46,110.00 元 | |
| 119 | + - 绿纤468店:0.00 元 | |
| 120 | + - 绿纤明信店:2,200.00 元 | |
| 121 | + | |
| 122 | +## 测试结论 | |
| 123 | + | |
| 124 | +- ✅ 代码修改完成,编译通过 | |
| 125 | +- ⚠️ 服务需要重启才能使新代码生效 | |
| 126 | +- ⏳ 待服务重启后重新测试验证 | ... | ... |
docs/test-reports/科技部总经理Cell金额计算问题修复总结.md
0 → 100644
| 1 | +# 科技部总经理Cell金额计算问题修复总结 | |
| 2 | + | |
| 3 | +## 问题描述 | |
| 4 | +科技部总经理工资计算接口中,Cell金额计算不正确。预期值:**69,838.00** 元,实际值:**60,994.30** 元。 | |
| 5 | + | |
| 6 | +## 问题分析 | |
| 7 | + | |
| 8 | +### 1. SQL查询验证 | |
| 9 | +直接SQL查询结果正确: | |
| 10 | +- 绿纤静居寺店 (1649328471923847173): **46,110.00** 元(数据库中:37,400.00) | |
| 11 | +- 绿纤468店 (1649328471923847175): **0.00** 元(数据库中:66.30) | |
| 12 | +- 绿纤明信店 (1649328471923847187): **2,200.00** 元(数据库中:2,000.00) | |
| 13 | + | |
| 14 | +### 2. 根本原因 | |
| 15 | +1. **时间格式化问题**:代码中使用字符串插值格式化DateTime时可能有问题 | |
| 16 | +2. **更新机制问题**:SqlSugar的Updateable可能只更新有变化的字段 | |
| 17 | + | |
| 18 | +## 已修复的问题 | |
| 19 | + | |
| 20 | +### 1. 时间格式化修复 | |
| 21 | +- 将字符串插值中的时间格式化改为使用 `.ToString()` 方法 | |
| 22 | +- 在循环外部定义时间格式化字符串,避免重复计算 | |
| 23 | + | |
| 24 | +```csharp | |
| 25 | +// 修复前: | |
| 26 | +AND yjsj <= '{endDateTime:yyyy-MM-dd HH:mm:ss}' | |
| 27 | + | |
| 28 | +// 修复后: | |
| 29 | +var startDateStr = startDate.ToString("yyyy-MM-dd HH:mm:ss"); | |
| 30 | +var endDateTimeStr = endDateTime.ToString("yyyy-MM-dd HH:mm:ss"); | |
| 31 | +AND yjsj <= '{endDateTimeStr}' | |
| 32 | +``` | |
| 33 | + | |
| 34 | +### 2. 强制更新机制 | |
| 35 | +- 添加 `IgnoreColumns` 确保强制更新所有字段(除了CreateTime和CreateUser) | |
| 36 | + | |
| 37 | +```csharp | |
| 38 | +await _db.Updateable(recordsToUpdate) | |
| 39 | + .IgnoreColumns(x => x.CreateTime) | |
| 40 | + .IgnoreColumns(x => x.CreateUser) | |
| 41 | + .ExecuteCommandAsync(); | |
| 42 | +``` | |
| 43 | + | |
| 44 | +### 3. 添加详细日志 | |
| 45 | +- 添加计算开始日志 | |
| 46 | +- 添加关键门店计算日志 | |
| 47 | +- 添加更新前/后的值对比日志 | |
| 48 | +- 添加跳过更新的警告日志 | |
| 49 | + | |
| 50 | +### 4. 强制更新UpdateTime | |
| 51 | +```csharp | |
| 52 | +salary.UpdateTime = DateTime.Now; // 强制更新UpdateTime | |
| 53 | +``` | |
| 54 | + | |
| 55 | +## 修改的文件 | |
| 56 | + | |
| 57 | +### `LqTechGeneralManagerSalaryService.cs` | |
| 58 | +1. **行236**:修复日志中的时间格式化 | |
| 59 | +2. **行330-331**:在循环外部定义时间格式化字符串 | |
| 60 | +3. **行333-342**:修复溯源金额SQL的时间格式化 | |
| 61 | +4. **行357-374**:修复Cell金额SQL的时间格式化,并添加调试日志 | |
| 62 | +5. **行547**:添加跳过更新的警告日志 | |
| 63 | +6. **行559**:强制设置UpdateTime | |
| 64 | +7. **行559-562**:添加IgnoreColumns确保强制更新 | |
| 65 | + | |
| 66 | +## 验证步骤 | |
| 67 | + | |
| 68 | +### 1. 重新编译(已完成) | |
| 69 | +```bash | |
| 70 | +cd netcore | |
| 71 | +dotnet clean src/Application/NCC.API/NCC.API.csproj | |
| 72 | +dotnet build src/Application/NCC.API/NCC.API.csproj | |
| 73 | +``` | |
| 74 | +**结果**:编译成功 ✅ | |
| 75 | + | |
| 76 | +### 2. 重启服务(必须执行) | |
| 77 | +⚠️ **重要**:代码修改后必须完全重启服务才能生效 | |
| 78 | + | |
| 79 | +### 3. 调用计算接口 | |
| 80 | +```bash | |
| 81 | +POST /api/Extend/lqtechgeneralmanagersalary/calculate/tech-general-manager?year=2025&month=12 | |
| 82 | +``` | |
| 83 | + | |
| 84 | +### 4. 验证结果 | |
| 85 | +```sql | |
| 86 | +SELECT F_EmployeeName, F_StatisticsMonth, F_CellAmount, F_UpdateTime | |
| 87 | +FROM lq_tech_general_manager_salary_statistics | |
| 88 | +WHERE F_EmployeeName LIKE '%夏萍%' AND F_StatisticsMonth = '202512' | |
| 89 | +``` | |
| 90 | + | |
| 91 | +**预期结果**: | |
| 92 | +- Cell金额:**69,838.00** 元 | |
| 93 | +- UpdateTime:当前时间 | |
| 94 | + | |
| 95 | +## 门店明细预期值 | |
| 96 | + | |
| 97 | +| 门店ID | 门店名称 | 当前值 | 预期值 | 差异 | | |
| 98 | +|--------|---------|--------|--------|------| | |
| 99 | +| 1649328471923847173 | 绿纤静居寺店 | 37,400.00 | 46,110.00 | +8,710.00 | | |
| 100 | +| 1649328471923847175 | 绿纤468店 | 66.30 | 0.00 | -66.30 | | |
| 101 | +| 1649328471923847187 | 绿纤明信店 | 2,000.00 | 2,200.00 | +200.00 | | |
| 102 | + | |
| 103 | +**合计差异**:+8,843.70 元 | |
| 104 | + | |
| 105 | +## 注意事项 | |
| 106 | + | |
| 107 | +1. **服务重启**:代码修改后必须完全重启服务才能生效 | |
| 108 | +2. **日志查看**:查看服务日志中是否有 "已更新 X 条科技部总经理工资记录" 的日志 | |
| 109 | +3. **数据验证**:验证UpdateTime是否更新为当前时间 | |
| 110 | +4. **对比验证**:Cell金额应该与 `/api/Extend/LqTechDepartmentDashboard/GetStatistics` 接口返回的值一致 | |
| 111 | + | |
| 112 | +## 当前状态 | |
| 113 | + | |
| 114 | +- ✅ 代码已修复 | |
| 115 | +- ✅ 编译成功 | |
| 116 | +- ⚠️ **需要重启服务并重新测试** | |
| 117 | + | |
| 118 | +## 下一步操作 | |
| 119 | + | |
| 120 | +1. **重启服务**(必须) | |
| 121 | +2. **调用计算接口**进行测试 | |
| 122 | +3. **验证数据库结果**是否更新为69,838.00 | |
| 123 | +4. **查看服务日志**确认是否有错误信息 | ... | ... |
docs/test-reports/科技部总经理Cell金额计算问题诊断.md
0 → 100644
| 1 | +# 科技部总经理Cell金额计算问题诊断 | |
| 2 | + | |
| 3 | +## 问题描述 | |
| 4 | +重启服务并重新计算后,Cell金额仍然是 **60,994.30**,而不是预期的 **69,838.00**。 | |
| 5 | + | |
| 6 | +## 诊断结果 | |
| 7 | + | |
| 8 | +### 1. SQL查询是正确的 | |
| 9 | +直接查询数据库,使用正确的SQL和时间范围,结果正确: | |
| 10 | +```sql | |
| 11 | +SELECT COALESCE(SUM(CAST(jksyj AS DECIMAL(18,2))), 0) as Amount | |
| 12 | +FROM lq_kd_jksyj | |
| 13 | +WHERE F_IsEffective = 1 | |
| 14 | + AND F_StoreId IN (...) | |
| 15 | + AND (F_BeautyType = 'cell' OR F_BeautyType = 'Cell') | |
| 16 | + AND yjsj >= '2025-12-01 00:00:00' | |
| 17 | + AND yjsj <= '2025-12-31 23:59:59' | |
| 18 | +``` | |
| 19 | + | |
| 20 | +**查询结果**:69,838.00 元(正确) | |
| 21 | + | |
| 22 | +### 2. 代码逻辑检查 | |
| 23 | +- ✅ `endDateTime` 变量已正确定义 | |
| 24 | +- ✅ SQL字符串格式化正确 | |
| 25 | +- ✅ 使用原生SQL在数据库层面转换 | |
| 26 | +- ✅ 时间范围处理正确 | |
| 27 | + | |
| 28 | +### 3. 问题定位 | |
| 29 | +**可能的原因**:SqlSugar 的 `Updateable` 默认只更新有变化的字段。如果计算出来的值与数据库中的值相同(或接近),可能不会触发更新。 | |
| 30 | + | |
| 31 | +**解决方案**:添加 `IgnoreColumns` 确保强制更新所有字段(已添加) | |
| 32 | + | |
| 33 | +## 已修复的问题 | |
| 34 | + | |
| 35 | +### 1. 添加了 IgnoreColumns | |
| 36 | +```csharp | |
| 37 | +await _db.Updateable(recordsToUpdate) | |
| 38 | + .IgnoreColumns(x => x.CreateTime) | |
| 39 | + .IgnoreColumns(x => x.CreateUser) | |
| 40 | + .ExecuteCommandAsync(); | |
| 41 | +``` | |
| 42 | + | |
| 43 | +### 2. 添加了日志记录 | |
| 44 | +```csharp | |
| 45 | +_logger.LogInformation($"已更新 {recordsToUpdate.Count} 条科技部总经理工资记录(月份:{monthStr})"); | |
| 46 | +``` | |
| 47 | + | |
| 48 | +## 验证步骤 | |
| 49 | + | |
| 50 | +### 1. 重新编译和重启服务 | |
| 51 | +```bash | |
| 52 | +cd netcore | |
| 53 | +dotnet build | |
| 54 | +# 重启服务 | |
| 55 | +``` | |
| 56 | + | |
| 57 | +### 2. 重新执行计算 | |
| 58 | +```bash | |
| 59 | +POST /api/Extend/lqtechgeneralmanagersalary/calculate/tech-general-manager?year=2025&month=12 | |
| 60 | +``` | |
| 61 | + | |
| 62 | +### 3. 验证结果 | |
| 63 | +```sql | |
| 64 | +SELECT F_EmployeeName, F_StatisticsMonth, F_CellAmount, F_UpdateTime | |
| 65 | +FROM lq_tech_general_manager_salary_statistics | |
| 66 | +WHERE F_EmployeeName LIKE '%夏萍%' AND F_StatisticsMonth = '202512' | |
| 67 | +``` | |
| 68 | + | |
| 69 | +**预期结果**: | |
| 70 | +- Cell金额:**69,838.00** 元 | |
| 71 | +- UpdateTime:当前时间 | |
| 72 | + | |
| 73 | +## 门店明细预期值 | |
| 74 | + | |
| 75 | +| 门店ID | 门店名称 | 预期Cell金额 | | |
| 76 | +|--------|---------|------------| | |
| 77 | +| 1649328471923847170 | 绿纤龙湖店 | 7,140.00 | | |
| 78 | +| 1649328471923847172 | 绿纤华润店 | 5,500.00 | | |
| 79 | +| 1649328471923847173 | 绿纤静居寺店 | **46,110.00** (当前:37,400.00) | | |
| 80 | +| 1649328471923847184 | 绿纤大丰店 | 8,888.00 | | |
| 81 | +| 1649328471923847187 | 绿纤明信店 | **2,200.00** (当前:2,000.00) | | |
| 82 | +| 1649328471923847175 | 绿纤468店 | **0.00** (当前:66.30) | | |
| 83 | + | |
| 84 | +## 注意事项 | |
| 85 | + | |
| 86 | +1. **确保服务已重启**:代码修改后必须重启服务才能生效 | |
| 87 | +2. **检查日志**:查看是否有 "已更新 X 条科技部总经理工资记录" 的日志 | |
| 88 | +3. **验证更新时间**:F_UpdateTime 应该更新为当前时间 | |
| 89 | +4. **对比科技部驾驶舱接口**:Cell金额应该与 `/api/Extend/LqTechDepartmentDashboard/GetStatistics` 接口返回的值一致 | ... | ... |
docs/科技部总经理Cell金额差异分析.md
0 → 100644
| 1 | +# 科技部总经理Cell金额差异分析 | |
| 2 | + | |
| 3 | +## 问题描述 | |
| 4 | + | |
| 5 | +**夏萍**(科技部总经理)在 **202512** 月份的Cell金额存在差异: | |
| 6 | +- **工资表中**:60994.30 元 | |
| 7 | +- **科技部驾驶舱接口**(`/api/Extend/LqTechDepartmentDashboard/GetStatistics`):69838.00 元 | |
| 8 | +- **差异**:8843.70 元 | |
| 9 | + | |
| 10 | +## 差异原因分析 | |
| 11 | + | |
| 12 | +### 1. 门店范围不同 | |
| 13 | + | |
| 14 | +#### 工资计算接口(`LqTechGeneralManagerSalaryService`) | |
| 15 | +- **数据来源**:`lq_mdxx` 表的 `kjb` 字段 | |
| 16 | +- **逻辑**:通过门店的 `kjb` 字段等于科技部组织ID来确定管理的门店 | |
| 17 | +- **门店数量**:16个门店 | |
| 18 | + | |
| 19 | +#### 科技部驾驶舱接口(`LqTechDepartmentDashboardService`) | |
| 20 | +- **数据来源**:`lq_md_target` 表的 `F_TechDepartment` 字段 | |
| 21 | +- **逻辑**:通过 `lq_md_target` 表查询指定月份、指定科技部归属的门店列表 | |
| 22 | +- **门店数量**:18个门店 | |
| 23 | + | |
| 24 | +#### 差异门店 | |
| 25 | +- **只在 `lq_md_target` 中存在的门店**: | |
| 26 | + 1. `1649328471923847197` - 绿纤龙城国际店(`kjb` = `734725628560934149`,不是 `734725579919590661`) | |
| 27 | + 2. `766197905571710213` - 绿纤西站店(`kjb` = `null`) | |
| 28 | + | |
| 29 | +这两个门店在工资计算时**不包含**,但在科技部驾驶舱接口中**包含**。 | |
| 30 | + | |
| 31 | +### 2. 时间范围处理差异 | |
| 32 | + | |
| 33 | +#### 工资计算接口 | |
| 34 | +```csharp | |
| 35 | +var startDate = new DateTime(year, month, 1); | |
| 36 | +var endDate = startDate.AddMonths(1).AddDays(-1); | |
| 37 | +// 开单时间:x.Yjsj >= startDate && x.Yjsj <= endDate.AddDays(1) | |
| 38 | +// 退卡时间:x.Tksj >= startDate && x.Tksj <= endDate.AddDays(1) | |
| 39 | +``` | |
| 40 | + | |
| 41 | +#### 科技部驾驶舱接口 | |
| 42 | +```csharp | |
| 43 | +var startDate = new DateTime(year, month, 1); | |
| 44 | +var endDate = startDate.AddMonths(1).AddDays(-1); | |
| 45 | +var endDateTime = input.StatisticsMonth == DateTime.Now.ToString("yyyyMM") | |
| 46 | + ? DateTime.Now | |
| 47 | + : endDate.Date.AddHours(23).AddMinutes(59).AddSeconds(59); | |
| 48 | +// 开单时间:yjsj >= '{startDate:yyyy-MM-dd HH:mm:ss}' AND yjsj <= '{endDateTime:yyyy-MM-dd HH:mm:ss}' | |
| 49 | +// 退卡时间:x.Tksj.Value.Date >= startDate.Date && x.Tksj.Value.Date <= endDate.Date | |
| 50 | +``` | |
| 51 | + | |
| 52 | +**差异**: | |
| 53 | +- 工资计算接口:退卡时间使用 `endDate.AddDays(1)`(包含下个月第一天) | |
| 54 | +- 科技部驾驶舱接口:退卡时间使用 `endDate.Date`(只到当月最后一天) | |
| 55 | + | |
| 56 | +### 3. 数据查询方式差异 | |
| 57 | + | |
| 58 | +#### 工资计算接口 | |
| 59 | +- 使用 **SqlSugar ORM** 查询 | |
| 60 | +- 开单Cell金额:先查询所有记录到内存,然后解析字符串 `jksyj` 字段并求和 | |
| 61 | +- 退卡Cell金额:直接使用 `SumAsync` 聚合查询 | |
| 62 | + | |
| 63 | +#### 科技部驾驶舱接口 | |
| 64 | +- 使用 **原生SQL** 查询 | |
| 65 | +- 开单Cell金额:使用 `CAST(jksyj AS DECIMAL(18,2))` 在数据库层面转换并求和 | |
| 66 | +- 退卡Cell金额:使用 `SumAsync` 聚合查询 | |
| 67 | + | |
| 68 | +## 验证结果 | |
| 69 | + | |
| 70 | +### 工资表中的门店明细(16个门店) | |
| 71 | +``` | |
| 72 | +绿纤龙湖店: 7140.0 | |
| 73 | +绿纤华润店: 5500.0 | |
| 74 | +绿纤静居寺店: 37400.0 | |
| 75 | +绿纤468店: 66.3 | |
| 76 | +绿纤大丰店: 8888.0 | |
| 77 | +绿纤明信店: 2000.0 | |
| 78 | +其他门店: 0.0 | |
| 79 | +合计: 60994.3 | |
| 80 | +``` | |
| 81 | + | |
| 82 | +### 差异明细(使用lq_md_target的门店范围查询) | |
| 83 | + | |
| 84 | +| 门店ID | 门店名称 | 工资表金额 | 驾驶舱金额 | 差异 | | |
| 85 | +|--------|---------|-----------|-----------|------| | |
| 86 | +| 1649328471923847173 | 绿纤静居寺店 | 37,400.00 | 46,110.00 | **+8,710.00** | | |
| 87 | +| 1649328471923847175 | 绿纤468店 | 66.30 | 0.00 | **-66.30** | | |
| 88 | +| 1649328471923847187 | 绿纤明信店 | 2,000.00 | 2,200.00 | **+200.00** | | |
| 89 | +| **合计** | | **60,994.30** | **69,838.00** | **+8,843.70** | | |
| 90 | + | |
| 91 | +### 差异原因分析 | |
| 92 | + | |
| 93 | +#### 1. 时间范围差异(主要原因) | |
| 94 | + | |
| 95 | +**工资计算接口**: | |
| 96 | +```csharp | |
| 97 | +x.Yjsj >= startDate && x.Yjsj <= endDate.AddDays(1) | |
| 98 | +// 即:yjsj >= '2025-12-01' AND yjsj <= '2026-01-01' | |
| 99 | +``` | |
| 100 | + | |
| 101 | +**科技部驾驶舱接口**: | |
| 102 | +```csharp | |
| 103 | +yjsj >= '{startDate:yyyy-MM-dd HH:mm:ss}' AND yjsj <= '{endDateTime:yyyy-MM-dd HH:mm:ss}' | |
| 104 | +// 即:yjsj >= '2025-12-01 00:00:00' AND yjsj <= '2025-12-31 23:59:59' | |
| 105 | +``` | |
| 106 | + | |
| 107 | +**关键差异**: | |
| 108 | +- 工资计算接口:包含 **2026-01-01** 的数据(跨月数据) | |
| 109 | +- 科技部驾驶舱接口:只包含 **2025-12-31** 及之前的数据 | |
| 110 | + | |
| 111 | +这导致工资计算接口可能包含了部分下个月的数据,而科技部驾驶舱接口严格按照当月范围。 | |
| 112 | + | |
| 113 | +#### 2. 数据查询方式差异 | |
| 114 | + | |
| 115 | +**工资计算接口**: | |
| 116 | +- 使用 SqlSugar ORM,先查询所有记录到内存 | |
| 117 | +- 然后使用 `decimal.TryParse` 解析字符串 `jksyj` 字段 | |
| 118 | +- 可能存在精度问题或解析失败的情况 | |
| 119 | + | |
| 120 | +**科技部驾驶舱接口**: | |
| 121 | +- 使用原生SQL,在数据库层面使用 `CAST(jksyj AS DECIMAL(18,2))` 转换 | |
| 122 | +- 直接在数据库层面求和,精度更高 | |
| 123 | + | |
| 124 | +#### 3. 门店范围差异 | |
| 125 | + | |
| 126 | +- 工资计算接口:使用 `lq_mdxx.kjb` 字段(16个门店) | |
| 127 | +- 科技部驾驶舱接口:使用 `lq_md_target.F_TechDepartment` 字段(18个门店) | |
| 128 | +- 但额外2个门店的Cell金额为0,不影响差异 | |
| 129 | + | |
| 130 | +## 结论 | |
| 131 | + | |
| 132 | +**夏萍的Cell金额差异8843.70元主要来自:** | |
| 133 | + | |
| 134 | +1. **时间范围差异**(主要原因): | |
| 135 | + - 工资计算接口包含 `endDate.AddDays(1)`(即2026-01-01的数据) | |
| 136 | + - 科技部驾驶舱接口只包含当月数据(2025-12-31及之前) | |
| 137 | + - 这导致工资计算接口可能包含了部分下个月的数据 | |
| 138 | + | |
| 139 | +2. **数据查询方式差异**: | |
| 140 | + - 工资计算接口使用内存解析字符串,可能存在精度问题 | |
| 141 | + - 科技部驾驶舱接口使用数据库层面转换,精度更高 | |
| 142 | + | |
| 143 | +3. **门店范围差异**: | |
| 144 | + - 两个接口使用不同的数据源确定门店范围 | |
| 145 | + - 但额外门店的Cell金额为0,不影响差异 | |
| 146 | + | |
| 147 | +## 建议 | |
| 148 | + | |
| 149 | +### 1. 统一时间范围(最重要) | |
| 150 | +- **推荐**:两个接口都使用 `endDate.Date.AddHours(23).AddMinutes(59).AddSeconds(59)` | |
| 151 | +- 确保不包含下个月的数据,严格按照当月范围计算 | |
| 152 | + | |
| 153 | +### 2. 统一数据查询方式 | |
| 154 | +- **推荐**:工资计算接口改为使用原生SQL查询,在数据库层面转换和求和 | |
| 155 | +- 确保计算精度一致,避免内存解析导致的精度问题 | |
| 156 | + | |
| 157 | +### 3. 统一门店范围 | |
| 158 | +- **推荐**:工资计算接口改为使用 `lq_md_target` 表确定门店范围 | |
| 159 | +- 这样可以确保两个接口使用相同的门店范围,便于数据核对 | |
| 160 | + | |
| 161 | +### 4. 数据验证结果 | |
| 162 | + | |
| 163 | +**2026-01-01当天的Cell金额:18,446.00元** | |
| 164 | + | |
| 165 | +| 门店ID | 门店名称 | 2026-01-01 Cell金额 | | |
| 166 | +|--------|---------|-------------------| | |
| 167 | +| 1649328471923847172 | 绿纤华润店 | 198.00 | | |
| 168 | +| 1649328471923847173 | 绿纤静居寺店 | 10,360.00 | | |
| 169 | +| 1649328471923847187 | 绿纤明信店 | 7,000.00 | | |
| 170 | +| 1649328471923847192 | 绿纤凤凰山店 | 888.00 | | |
| 171 | + | |
| 172 | +**分析**: | |
| 173 | +- 工资计算接口使用 `endDate.AddDays(1)`,包含了2026-01-01的数据 | |
| 174 | +- 科技部驾驶舱接口只包含2025-12-31及之前的数据 | |
| 175 | +- 但差异8843.70元 < 2026-01-01的18446.00元,说明还有其他因素 | |
| 176 | + | |
| 177 | +**进一步分析**: | |
| 178 | +- 工资计算接口可能使用了不同的数据解析方式,导致部分数据未正确计算 | |
| 179 | +- 建议重新计算工资,使用与科技部驾驶舱接口相同的时间范围和查询方式 | ... | ... |
netcore/ExportFiles/所有会员剩余品项_20260114173452.xlsx
0 → 100644
No preview for this file type
netcore/ExportFiles/所有会员剩余品项_20260114174836.xlsx
0 → 100644
No preview for this file type
netcore/ExportFiles/所有会员剩余品项_20260114180018.xlsx
0 → 100644
No preview for this file type
netcore/ExportFiles/所有会员剩余品项_20260114180044.xlsx
0 → 100644
No preview for this file type
netcore/ExportFiles/所有会员剩余品项_20260114180206.xlsx
0 → 100644
No preview for this file type
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqDirectorSalary/DirectorSalaryOutput.cs
| ... | ... | @@ -236,6 +236,121 @@ namespace NCC.Extend.Entitys.Dto.LqDirectorSalary |
| 236 | 236 | /// 新店保护阶段 |
| 237 | 237 | /// </summary> |
| 238 | 238 | public int NewStoreProtectionStage { get; set; } |
| 239 | + | |
| 240 | + /// <summary> | |
| 241 | + /// 门店ID | |
| 242 | + /// </summary> | |
| 243 | + public string StoreId { get; set; } | |
| 244 | + | |
| 245 | + /// <summary> | |
| 246 | + /// 员工ID | |
| 247 | + /// </summary> | |
| 248 | + public string EmployeeId { get; set; } | |
| 249 | + | |
| 250 | + /// <summary> | |
| 251 | + /// 统计月份(YYYYMM) | |
| 252 | + /// </summary> | |
| 253 | + public string StatisticsMonth { get; set; } | |
| 254 | + | |
| 255 | + /// <summary> | |
| 256 | + /// 销售业绩(开单业绩-退款业绩) | |
| 257 | + /// </summary> | |
| 258 | + public decimal SalesPerformance { get; set; } | |
| 259 | + | |
| 260 | + /// <summary> | |
| 261 | + /// 产品物料(仓库领用金额) | |
| 262 | + /// </summary> | |
| 263 | + public decimal ProductMaterial { get; set; } | |
| 264 | + | |
| 265 | + /// <summary> | |
| 266 | + /// 合作项目成本 | |
| 267 | + /// </summary> | |
| 268 | + public decimal CooperationCost { get; set; } | |
| 269 | + | |
| 270 | + /// <summary> | |
| 271 | + /// 店内支出 | |
| 272 | + /// </summary> | |
| 273 | + public decimal StoreExpense { get; set; } | |
| 274 | + | |
| 275 | + /// <summary> | |
| 276 | + /// 洗毛巾费用 | |
| 277 | + /// </summary> | |
| 278 | + public decimal LaundryCost { get; set; } | |
| 279 | + | |
| 280 | + /// <summary> | |
| 281 | + /// 毛利(销售业绩-产品物料-合作项目成本-店内支出-洗毛巾) | |
| 282 | + /// </summary> | |
| 283 | + public decimal GrossProfit { get; set; } | |
| 284 | + | |
| 285 | + /// <summary> | |
| 286 | + /// 缺卡扣款 | |
| 287 | + /// </summary> | |
| 288 | + public decimal MissingCard { get; set; } | |
| 289 | + | |
| 290 | + /// <summary> | |
| 291 | + /// 迟到扣款 | |
| 292 | + /// </summary> | |
| 293 | + public decimal LateArrival { get; set; } | |
| 294 | + | |
| 295 | + /// <summary> | |
| 296 | + /// 请假扣款 | |
| 297 | + /// </summary> | |
| 298 | + public decimal LeaveDeduction { get; set; } | |
| 299 | + | |
| 300 | + /// <summary> | |
| 301 | + /// 扣社保 | |
| 302 | + /// </summary> | |
| 303 | + public decimal SocialInsuranceDeduction { get; set; } | |
| 304 | + | |
| 305 | + /// <summary> | |
| 306 | + /// 扣除奖励 | |
| 307 | + /// </summary> | |
| 308 | + public decimal RewardDeduction { get; set; } | |
| 309 | + | |
| 310 | + /// <summary> | |
| 311 | + /// 扣住宿费 | |
| 312 | + /// </summary> | |
| 313 | + public decimal AccommodationDeduction { get; set; } | |
| 314 | + | |
| 315 | + /// <summary> | |
| 316 | + /// 扣学习期费用 | |
| 317 | + /// </summary> | |
| 318 | + public decimal StudyPeriodDeduction { get; set; } | |
| 319 | + | |
| 320 | + /// <summary> | |
| 321 | + /// 扣工作服费用 | |
| 322 | + /// </summary> | |
| 323 | + public decimal WorkClothesDeduction { get; set; } | |
| 324 | + | |
| 325 | + /// <summary> | |
| 326 | + /// 当月培训补贴 | |
| 327 | + /// </summary> | |
| 328 | + public decimal MonthlyTrainingSubsidy { get; set; } | |
| 329 | + | |
| 330 | + /// <summary> | |
| 331 | + /// 当月交通补贴 | |
| 332 | + /// </summary> | |
| 333 | + public decimal MonthlyTransportSubsidy { get; set; } | |
| 334 | + | |
| 335 | + /// <summary> | |
| 336 | + /// 上月培训补贴 | |
| 337 | + /// </summary> | |
| 338 | + public decimal LastMonthTrainingSubsidy { get; set; } | |
| 339 | + | |
| 340 | + /// <summary> | |
| 341 | + /// 上月交通补贴 | |
| 342 | + /// </summary> | |
| 343 | + public decimal LastMonthTransportSubsidy { get; set; } | |
| 344 | + | |
| 345 | + /// <summary> | |
| 346 | + /// 员工确认时间 | |
| 347 | + /// </summary> | |
| 348 | + public DateTime? EmployeeConfirmTime { get; set; } | |
| 349 | + | |
| 350 | + /// <summary> | |
| 351 | + /// 员工确认备注 | |
| 352 | + /// </summary> | |
| 353 | + public string EmployeeConfirmRemark { get; set; } | |
| 239 | 354 | } |
| 240 | 355 | } |
| 241 | 356 | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqKhxx/MemberRemainingItemsExportOutput.cs
0 → 100644
| 1 | +using System; | |
| 2 | + | |
| 3 | +namespace NCC.Extend.Entitys.Dto.LqKhxx | |
| 4 | +{ | |
| 5 | + /// <summary> | |
| 6 | + /// 会员剩余品项导出输出 | |
| 7 | + /// </summary> | |
| 8 | + public class MemberRemainingItemsExportOutput | |
| 9 | + { | |
| 10 | + /// <summary> | |
| 11 | + /// 会员ID | |
| 12 | + /// </summary> | |
| 13 | + public string memberId { get; set; } | |
| 14 | + | |
| 15 | + /// <summary> | |
| 16 | + /// 会员姓名 | |
| 17 | + /// </summary> | |
| 18 | + public string memberName { get; set; } | |
| 19 | + | |
| 20 | + /// <summary> | |
| 21 | + /// 手机号 | |
| 22 | + /// </summary> | |
| 23 | + public string phone { get; set; } | |
| 24 | + | |
| 25 | + /// <summary> | |
| 26 | + /// 归属门店 | |
| 27 | + /// </summary> | |
| 28 | + public string storeName { get; set; } | |
| 29 | + | |
| 30 | + /// <summary> | |
| 31 | + /// 开单品项ID | |
| 32 | + /// </summary> | |
| 33 | + public string billingItemId { get; set; } | |
| 34 | + | |
| 35 | + /// <summary> | |
| 36 | + /// 品项ID | |
| 37 | + /// </summary> | |
| 38 | + public string itemId { get; set; } | |
| 39 | + | |
| 40 | + /// <summary> | |
| 41 | + /// 品项名称 | |
| 42 | + /// </summary> | |
| 43 | + public string itemName { get; set; } | |
| 44 | + | |
| 45 | + /// <summary> | |
| 46 | + /// 品项单价 | |
| 47 | + /// </summary> | |
| 48 | + public decimal itemPrice { get; set; } | |
| 49 | + | |
| 50 | + /// <summary> | |
| 51 | + /// 来源类型 | |
| 52 | + /// </summary> | |
| 53 | + public string sourceType { get; set; } | |
| 54 | + | |
| 55 | + /// <summary> | |
| 56 | + /// 总购买数量 | |
| 57 | + /// </summary> | |
| 58 | + public decimal totalPurchased { get; set; } | |
| 59 | + | |
| 60 | + /// <summary> | |
| 61 | + /// 已耗卡数量 | |
| 62 | + /// </summary> | |
| 63 | + public decimal consumedCount { get; set; } | |
| 64 | + | |
| 65 | + /// <summary> | |
| 66 | + /// 已退卡数量 | |
| 67 | + /// </summary> | |
| 68 | + public decimal refundedCount { get; set; } | |
| 69 | + | |
| 70 | + /// <summary> | |
| 71 | + /// 已储扣数量 | |
| 72 | + /// </summary> | |
| 73 | + public decimal deductCount { get; set; } | |
| 74 | + | |
| 75 | + /// <summary> | |
| 76 | + /// 剩余数量 | |
| 77 | + /// </summary> | |
| 78 | + public decimal remainingCount { get; set; } | |
| 79 | + | |
| 80 | + /// <summary> | |
| 81 | + /// 备注 | |
| 82 | + /// </summary> | |
| 83 | + public string remark { get; set; } | |
| 84 | + } | |
| 85 | +} | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend.Entitys/Dto/LqStoreDashboard/StoreDashboardStatisticsOutput.cs
| ... | ... | @@ -94,6 +94,21 @@ namespace NCC.Extend.Entitys.Dto.LqStoreDashboard |
| 94 | 94 | /// 人均项目数(项目数/人头数) |
| 95 | 95 | /// </summary> |
| 96 | 96 | public decimal AvgProjectPerHead { get; set; } |
| 97 | + | |
| 98 | + /// <summary> | |
| 99 | + /// 生美业绩(消耗业绩) | |
| 100 | + /// </summary> | |
| 101 | + public decimal LifeBeautyPerformance { get; set; } | |
| 102 | + | |
| 103 | + /// <summary> | |
| 104 | + /// 医美业绩(消耗业绩) | |
| 105 | + /// </summary> | |
| 106 | + public decimal MedicalBeautyPerformance { get; set; } | |
| 107 | + | |
| 108 | + /// <summary> | |
| 109 | + /// 科美业绩(消耗业绩) | |
| 110 | + /// </summary> | |
| 111 | + public decimal TechBeautyPerformance { get; set; } | |
| 97 | 112 | } |
| 98 | 113 | } |
| 99 | 114 | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/LqDirectorSalaryService.cs
| ... | ... | @@ -80,12 +80,24 @@ namespace NCC.Extend |
| 80 | 80 | var list = await query.Select(x => new DirectorSalaryOutput |
| 81 | 81 | { |
| 82 | 82 | Id = x.Id, |
| 83 | + StoreId = x.StoreId, | |
| 83 | 84 | StoreName = x.StoreName, |
| 85 | + EmployeeId = x.EmployeeId, | |
| 84 | 86 | EmployeeName = x.EmployeeName, |
| 85 | 87 | Position = x.Position, |
| 88 | + StatisticsMonth = x.StatisticsMonth, | |
| 89 | + StoreType = x.StoreType, | |
| 90 | + StoreCategory = x.StoreCategory, | |
| 91 | + IsNewStore = x.IsNewStore, | |
| 92 | + NewStoreProtectionStage = x.NewStoreProtectionStage, | |
| 86 | 93 | StoreTotalPerformance = x.StoreTotalPerformance, |
| 87 | 94 | StoreBillingPerformance = x.StoreBillingPerformance, |
| 88 | 95 | StoreRefundPerformance = x.StoreRefundPerformance, |
| 96 | + ProductMaterial = x.ProductMaterial, | |
| 97 | + CooperationCost = x.CooperationCost, | |
| 98 | + StoreExpense = x.StoreExpense, | |
| 99 | + LaundryCost = x.LaundryCost, | |
| 100 | + GrossProfit = x.GrossProfit, | |
| 89 | 101 | StoreLifeline = x.StoreLifeline, |
| 90 | 102 | PerformanceCompletionRate = x.PerformanceCompletionRate, |
| 91 | 103 | PerformanceReached = x.PerformanceReached, |
| ... | ... | @@ -108,7 +120,19 @@ namespace NCC.Extend |
| 108 | 120 | LeaveDays = x.LeaveDays, |
| 109 | 121 | GrossSalary = x.GrossSalary, |
| 110 | 122 | ActualSalary = x.ActualSalary, |
| 123 | + MissingCard = x.MissingCard, | |
| 124 | + LateArrival = x.LateArrival, | |
| 125 | + LeaveDeduction = x.LeaveDeduction, | |
| 126 | + SocialInsuranceDeduction = x.SocialInsuranceDeduction, | |
| 127 | + RewardDeduction = x.RewardDeduction, | |
| 128 | + AccommodationDeduction = x.AccommodationDeduction, | |
| 129 | + StudyPeriodDeduction = x.StudyPeriodDeduction, | |
| 130 | + WorkClothesDeduction = x.WorkClothesDeduction, | |
| 111 | 131 | TotalDeduction = x.TotalDeduction, |
| 132 | + MonthlyTrainingSubsidy = x.MonthlyTrainingSubsidy, | |
| 133 | + MonthlyTransportSubsidy = x.MonthlyTransportSubsidy, | |
| 134 | + LastMonthTrainingSubsidy = x.LastMonthTrainingSubsidy, | |
| 135 | + LastMonthTransportSubsidy = x.LastMonthTransportSubsidy, | |
| 112 | 136 | TotalSubsidy = x.TotalSubsidy, |
| 113 | 137 | Bonus = x.Bonus, |
| 114 | 138 | ReturnPhoneDeposit = x.ReturnPhoneDeposit, |
| ... | ... | @@ -120,11 +144,9 @@ namespace NCC.Extend |
| 120 | 144 | MonthlyTotalPayment = x.MonthlyTotalPayment, |
| 121 | 145 | IsLocked = x.IsLocked, |
| 122 | 146 | EmployeeConfirmStatus = x.EmployeeConfirmStatus, |
| 123 | - UpdateTime = x.UpdateTime, | |
| 124 | - StoreType = x.StoreType, | |
| 125 | - StoreCategory = x.StoreCategory, | |
| 126 | - IsNewStore = x.IsNewStore, | |
| 127 | - NewStoreProtectionStage = x.NewStoreProtectionStage | |
| 147 | + EmployeeConfirmTime = x.EmployeeConfirmTime, | |
| 148 | + EmployeeConfirmRemark = x.EmployeeConfirmRemark, | |
| 149 | + UpdateTime = x.UpdateTime | |
| 128 | 150 | }) |
| 129 | 151 | .ToPagedListAsync(input.currentPage, input.pageSize); |
| 130 | 152 | |
| ... | ... | @@ -147,36 +169,72 @@ namespace NCC.Extend |
| 147 | 169 | .Select(x => new DirectorSalaryOutput |
| 148 | 170 | { |
| 149 | 171 | Id = x.Id, |
| 172 | + StoreId = x.StoreId, | |
| 150 | 173 | StoreName = x.StoreName, |
| 174 | + EmployeeId = x.EmployeeId, | |
| 151 | 175 | EmployeeName = x.EmployeeName, |
| 152 | 176 | Position = x.Position, |
| 177 | + StatisticsMonth = x.StatisticsMonth, | |
| 178 | + StoreType = x.StoreType, | |
| 179 | + StoreCategory = x.StoreCategory, | |
| 180 | + IsNewStore = x.IsNewStore, | |
| 181 | + NewStoreProtectionStage = x.NewStoreProtectionStage, | |
| 153 | 182 | StoreTotalPerformance = x.StoreTotalPerformance, |
| 154 | 183 | StoreBillingPerformance = x.StoreBillingPerformance, |
| 155 | 184 | StoreRefundPerformance = x.StoreRefundPerformance, |
| 185 | + ProductMaterial = x.ProductMaterial, | |
| 186 | + CooperationCost = x.CooperationCost, | |
| 187 | + StoreExpense = x.StoreExpense, | |
| 188 | + LaundryCost = x.LaundryCost, | |
| 189 | + GrossProfit = x.GrossProfit, | |
| 156 | 190 | StoreLifeline = x.StoreLifeline, |
| 157 | 191 | PerformanceCompletionRate = x.PerformanceCompletionRate, |
| 192 | + PerformanceReached = x.PerformanceReached, | |
| 193 | + HeadCountReached = x.HeadCountReached, | |
| 194 | + ConsumeReached = x.ConsumeReached, | |
| 195 | + AssessmentDeduction = x.AssessmentDeduction, | |
| 196 | + UnreachedIndicatorCount = x.UnreachedIndicatorCount, | |
| 197 | + HeadCount = x.HeadCount, | |
| 198 | + TargetHeadCount = x.TargetHeadCount, | |
| 199 | + StoreConsume = x.StoreConsume, | |
| 200 | + TargetConsume = x.TargetConsume, | |
| 158 | 201 | CommissionRateBelowLifeline = x.CommissionRateBelowLifeline, |
| 159 | 202 | CommissionRateAboveLifeline = x.CommissionRateAboveLifeline, |
| 160 | 203 | CommissionAmountBelowLifeline = x.CommissionAmountBelowLifeline, |
| 161 | 204 | CommissionAmountAboveLifeline = x.CommissionAmountAboveLifeline, |
| 162 | 205 | TotalCommissionAmount = x.TotalCommissionAmount, |
| 163 | 206 | BaseSalary = x.BaseSalary, |
| 207 | + ActualBaseSalary = x.ActualBaseSalary, | |
| 164 | 208 | WorkingDays = x.WorkingDays, |
| 165 | 209 | LeaveDays = x.LeaveDays, |
| 166 | 210 | GrossSalary = x.GrossSalary, |
| 167 | 211 | ActualSalary = x.ActualSalary, |
| 212 | + MissingCard = x.MissingCard, | |
| 213 | + LateArrival = x.LateArrival, | |
| 214 | + LeaveDeduction = x.LeaveDeduction, | |
| 215 | + SocialInsuranceDeduction = x.SocialInsuranceDeduction, | |
| 216 | + RewardDeduction = x.RewardDeduction, | |
| 217 | + AccommodationDeduction = x.AccommodationDeduction, | |
| 218 | + StudyPeriodDeduction = x.StudyPeriodDeduction, | |
| 219 | + WorkClothesDeduction = x.WorkClothesDeduction, | |
| 168 | 220 | TotalDeduction = x.TotalDeduction, |
| 221 | + MonthlyTrainingSubsidy = x.MonthlyTrainingSubsidy, | |
| 222 | + MonthlyTransportSubsidy = x.MonthlyTransportSubsidy, | |
| 223 | + LastMonthTrainingSubsidy = x.LastMonthTrainingSubsidy, | |
| 224 | + LastMonthTransportSubsidy = x.LastMonthTransportSubsidy, | |
| 169 | 225 | TotalSubsidy = x.TotalSubsidy, |
| 170 | 226 | Bonus = x.Bonus, |
| 227 | + ReturnPhoneDeposit = x.ReturnPhoneDeposit, | |
| 228 | + ReturnAccommodationDeposit = x.ReturnAccommodationDeposit, | |
| 171 | 229 | MonthlyPaymentStatus = x.MonthlyPaymentStatus, |
| 172 | 230 | PaidAmount = x.PaidAmount, |
| 173 | 231 | PendingAmount = x.PendingAmount, |
| 232 | + LastMonthSupplement = x.LastMonthSupplement, | |
| 233 | + MonthlyTotalPayment = x.MonthlyTotalPayment, | |
| 174 | 234 | IsLocked = x.IsLocked, |
| 175 | 235 | EmployeeConfirmStatus = x.EmployeeConfirmStatus, |
| 176 | - StoreType = x.StoreType, | |
| 177 | - StoreCategory = x.StoreCategory, | |
| 178 | - IsNewStore = x.IsNewStore, | |
| 179 | - NewStoreProtectionStage = x.NewStoreProtectionStage, | |
| 236 | + EmployeeConfirmTime = x.EmployeeConfirmTime, | |
| 237 | + EmployeeConfirmRemark = x.EmployeeConfirmRemark, | |
| 180 | 238 | UpdateTime = x.UpdateTime |
| 181 | 239 | }) |
| 182 | 240 | .FirstAsync(); |
| ... | ... | @@ -478,8 +536,8 @@ namespace NCC.Extend |
| 478 | 536 | // 毛利 = 销售业绩 - 产品物料 - 合作项目成本 - 店内支出 - 洗毛巾 |
| 479 | 537 | salary.GrossProfit = salary.SalesPerformance - salary.ProductMaterial - salary.CooperationCost - salary.StoreExpense - salary.LaundryCost; |
| 480 | 538 | |
| 481 | - // 2.7 将毛利赋值给StoreTotalPerformance(用于提成计算) | |
| 482 | - salary.StoreTotalPerformance = salary.GrossProfit; | |
| 539 | + // 2.7 StoreTotalPerformance保存开单业绩-退卡业绩(销售业绩),提成计算使用毛利(GrossProfit) | |
| 540 | + salary.StoreTotalPerformance = salary.SalesPerformance; | |
| 483 | 541 | |
| 484 | 542 | // 2.8 计算业绩完成率(基于毛利与生命线比较) |
| 485 | 543 | if (salary.StoreLifeline > 0) |
| ... | ... | @@ -670,9 +728,10 @@ namespace NCC.Extend |
| 670 | 728 | return; |
| 671 | 729 | } |
| 672 | 730 | |
| 673 | - // 提成计算基于毛利(StoreTotalPerformance存储的是毛利) | |
| 731 | + // 提成计算基于毛利(GrossProfit) | |
| 674 | 732 | // 重要:提成基数使用毛利,不是销售业绩(开单-退卡) |
| 675 | - decimal grossProfit = salary.StoreTotalPerformance; // 这里已经是毛利了 | |
| 733 | + // StoreTotalPerformance存储的是开单业绩-退卡业绩,而提成需要使用毛利 | |
| 734 | + decimal grossProfit = salary.GrossProfit; | |
| 676 | 735 | decimal lifeline = salary.StoreLifeline; |
| 677 | 736 | |
| 678 | 737 | // 确定提成比例(根据新店/老店和门店分类) |
| ... | ... | @@ -1057,59 +1116,159 @@ namespace NCC.Extend |
| 1057 | 1116 | CreateUser = "" |
| 1058 | 1117 | }; |
| 1059 | 1118 | |
| 1060 | - // Excel字段映射(主任工资43列,Excel顺序:门店名称,员工姓名,岗位,实发工资,补贴合计,扣款合计,是否锁定,是否新店,新店保护阶段,门店总业绩...) | |
| 1119 | + // Excel字段映射 | |
| 1120 | + // 向后兼容:先按旧格式读取(43列格式) | |
| 1121 | + // 如果Excel列数更多,则按新格式读取(支持新增字段) | |
| 1061 | 1122 | entity.StoreName = storeName; |
| 1062 | 1123 | entity.EmployeeName = employeeName; |
| 1063 | 1124 | entity.Position = GetColumnValue(2 + offset); |
| 1064 | - entity.ActualSalary = ParseDecimal(GetColumnValue(3 + offset)); | |
| 1065 | - entity.TotalSubsidy = ParseDecimal(GetColumnValue(4 + offset)); | |
| 1066 | - entity.TotalDeduction = ParseDecimal(GetColumnValue(5 + offset)); | |
| 1067 | - // 跳过"是否锁定"字段(第7列),在最后处理 | |
| 1068 | - entity.IsNewStore = GetColumnValue(7 + offset) == "是" ? "是" : "否"; | |
| 1069 | - entity.NewStoreProtectionStage = ParseInt(GetColumnValue(8 + offset)); | |
| 1070 | - entity.StoreTotalPerformance = ParseDecimal(GetColumnValue(9 + offset)); | |
| 1071 | - entity.StoreBillingPerformance = ParseDecimal(GetColumnValue(10 + offset)); | |
| 1072 | - entity.StoreRefundPerformance = ParseDecimal(GetColumnValue(11 + offset)); | |
| 1073 | - entity.StoreLifeline = ParseDecimal(GetColumnValue(12 + offset)); | |
| 1074 | - entity.PerformanceCompletionRate = ParseDecimal(GetColumnValue(13 + offset)); | |
| 1075 | - entity.PerformanceReached = GetColumnValue(14 + offset); | |
| 1076 | - entity.HeadCountReached = GetColumnValue(15 + offset); | |
| 1077 | - entity.ConsumeReached = GetColumnValue(16 + offset); | |
| 1078 | - entity.AssessmentDeduction = ParseDecimal(GetColumnValue(17 + offset)); | |
| 1079 | - entity.UnreachedIndicatorCount = ParseInt(GetColumnValue(18 + offset)); | |
| 1080 | - entity.HeadCount = ParseInt(GetColumnValue(19 + offset)); | |
| 1081 | - entity.TargetHeadCount = ParseDecimal(GetColumnValue(20 + offset)); | |
| 1082 | - entity.StoreConsume = ParseDecimal(GetColumnValue(21 + offset)); | |
| 1083 | - entity.TargetConsume = ParseDecimal(GetColumnValue(22 + offset)); | |
| 1084 | - entity.CommissionRateBelowLifeline = ParseDecimal(GetColumnValue(23 + offset)); | |
| 1085 | - entity.CommissionRateAboveLifeline = ParseDecimal(GetColumnValue(24 + offset)); | |
| 1086 | - entity.CommissionAmountBelowLifeline = ParseDecimal(GetColumnValue(25 + offset)); | |
| 1087 | - entity.CommissionAmountAboveLifeline = ParseDecimal(GetColumnValue(26 + offset)); | |
| 1088 | - entity.TotalCommissionAmount = ParseDecimal(GetColumnValue(27 + offset)); | |
| 1089 | - entity.BaseSalary = ParseDecimal(GetColumnValue(28 + offset)); | |
| 1090 | - entity.ActualBaseSalary = ParseDecimal(GetColumnValue(29 + offset)); | |
| 1091 | - entity.WorkingDays = ParseInt(GetColumnValue(30 + offset)); | |
| 1092 | - entity.LeaveDays = ParseInt(GetColumnValue(31 + offset)); | |
| 1093 | - entity.GrossSalary = ParseDecimal(GetColumnValue(32 + offset)); | |
| 1094 | - entity.Bonus = ParseDecimal(GetColumnValue(33 + offset)); | |
| 1095 | - entity.ReturnPhoneDeposit = ParseDecimal(GetColumnValue(34 + offset)); | |
| 1096 | - entity.ReturnAccommodationDeposit = ParseDecimal(GetColumnValue(35 + offset)); | |
| 1097 | - entity.MonthlyPaymentStatus = GetColumnValue(36 + offset); | |
| 1098 | - entity.PaidAmount = ParseDecimal(GetColumnValue(37 + offset)); | |
| 1099 | - entity.PendingAmount = ParseDecimal(GetColumnValue(38 + offset)); | |
| 1100 | - entity.LastMonthSupplement = ParseDecimal(GetColumnValue(39 + offset)); | |
| 1101 | - entity.MonthlyTotalPayment = ParseDecimal(GetColumnValue(40 + offset)); | |
| 1102 | - // 处理门店类型和类别 | |
| 1103 | - var storeTypeStr = GetColumnValue(41 + offset); | |
| 1104 | - if (!string.IsNullOrWhiteSpace(storeTypeStr) && int.TryParse(storeTypeStr, out int storeType)) | |
| 1105 | - entity.StoreType = storeType; | |
| 1106 | - var storeCategoryStr = GetColumnValue(42 + offset); | |
| 1107 | - if (!string.IsNullOrWhiteSpace(storeCategoryStr) && int.TryParse(storeCategoryStr, out int storeCategory)) | |
| 1108 | - entity.StoreCategory = storeCategory; | |
| 1109 | - // 处理锁定状态(第7列) | |
| 1110 | - var isLockedStr = GetColumnValue(6 + offset); | |
| 1111 | - if (isLockedStr == "已锁定" || isLockedStr == "1" || isLockedStr == "锁定") entity.IsLocked = 1; | |
| 1112 | - else entity.IsLocked = 0; | |
| 1125 | + | |
| 1126 | + // 旧格式兼容(保持向后兼容,Excel顺序:门店名称,员工姓名,岗位,实发工资,补贴合计,扣款合计,是否锁定,是否新店,新店保护阶段,门店总业绩...) | |
| 1127 | + if (dataTable.Columns.Count <= 43 + offset) | |
| 1128 | + { | |
| 1129 | + // 旧格式(43列) | |
| 1130 | + entity.ActualSalary = ParseDecimal(GetColumnValue(3 + offset)); | |
| 1131 | + entity.TotalSubsidy = ParseDecimal(GetColumnValue(4 + offset)); | |
| 1132 | + entity.TotalDeduction = ParseDecimal(GetColumnValue(5 + offset)); | |
| 1133 | + var isLockedStr = GetColumnValue(6 + offset); | |
| 1134 | + if (isLockedStr == "已锁定" || isLockedStr == "1" || isLockedStr == "锁定") entity.IsLocked = 1; | |
| 1135 | + else entity.IsLocked = 0; | |
| 1136 | + entity.IsNewStore = GetColumnValue(7 + offset) == "是" ? "是" : "否"; | |
| 1137 | + entity.NewStoreProtectionStage = ParseInt(GetColumnValue(8 + offset)); | |
| 1138 | + entity.StoreTotalPerformance = ParseDecimal(GetColumnValue(9 + offset)); | |
| 1139 | + entity.StoreBillingPerformance = ParseDecimal(GetColumnValue(10 + offset)); | |
| 1140 | + entity.StoreRefundPerformance = ParseDecimal(GetColumnValue(11 + offset)); | |
| 1141 | + entity.StoreLifeline = ParseDecimal(GetColumnValue(12 + offset)); | |
| 1142 | + entity.PerformanceCompletionRate = ParseDecimal(GetColumnValue(13 + offset)); | |
| 1143 | + entity.PerformanceReached = GetColumnValue(14 + offset); | |
| 1144 | + entity.HeadCountReached = GetColumnValue(15 + offset); | |
| 1145 | + entity.ConsumeReached = GetColumnValue(16 + offset); | |
| 1146 | + entity.AssessmentDeduction = ParseDecimal(GetColumnValue(17 + offset)); | |
| 1147 | + entity.UnreachedIndicatorCount = ParseInt(GetColumnValue(18 + offset)); | |
| 1148 | + entity.HeadCount = ParseInt(GetColumnValue(19 + offset)); | |
| 1149 | + entity.TargetHeadCount = ParseDecimal(GetColumnValue(20 + offset)); | |
| 1150 | + entity.StoreConsume = ParseDecimal(GetColumnValue(21 + offset)); | |
| 1151 | + entity.TargetConsume = ParseDecimal(GetColumnValue(22 + offset)); | |
| 1152 | + entity.CommissionRateBelowLifeline = ParseDecimal(GetColumnValue(23 + offset)); | |
| 1153 | + entity.CommissionRateAboveLifeline = ParseDecimal(GetColumnValue(24 + offset)); | |
| 1154 | + entity.CommissionAmountBelowLifeline = ParseDecimal(GetColumnValue(25 + offset)); | |
| 1155 | + entity.CommissionAmountAboveLifeline = ParseDecimal(GetColumnValue(26 + offset)); | |
| 1156 | + entity.TotalCommissionAmount = ParseDecimal(GetColumnValue(27 + offset)); | |
| 1157 | + entity.BaseSalary = ParseDecimal(GetColumnValue(28 + offset)); | |
| 1158 | + entity.ActualBaseSalary = ParseDecimal(GetColumnValue(29 + offset)); | |
| 1159 | + entity.WorkingDays = ParseInt(GetColumnValue(30 + offset)); | |
| 1160 | + entity.LeaveDays = ParseInt(GetColumnValue(31 + offset)); | |
| 1161 | + entity.GrossSalary = ParseDecimal(GetColumnValue(32 + offset)); | |
| 1162 | + entity.Bonus = ParseDecimal(GetColumnValue(33 + offset)); | |
| 1163 | + entity.ReturnPhoneDeposit = ParseDecimal(GetColumnValue(34 + offset)); | |
| 1164 | + entity.ReturnAccommodationDeposit = ParseDecimal(GetColumnValue(35 + offset)); | |
| 1165 | + entity.MonthlyPaymentStatus = GetColumnValue(36 + offset); | |
| 1166 | + entity.PaidAmount = ParseDecimal(GetColumnValue(37 + offset)); | |
| 1167 | + entity.PendingAmount = ParseDecimal(GetColumnValue(38 + offset)); | |
| 1168 | + entity.LastMonthSupplement = ParseDecimal(GetColumnValue(39 + offset)); | |
| 1169 | + entity.MonthlyTotalPayment = ParseDecimal(GetColumnValue(40 + offset)); | |
| 1170 | + var storeTypeStr = GetColumnValue(41 + offset); | |
| 1171 | + if (!string.IsNullOrWhiteSpace(storeTypeStr) && int.TryParse(storeTypeStr, out int storeType)) | |
| 1172 | + entity.StoreType = storeType; | |
| 1173 | + var storeCategoryStr = GetColumnValue(42 + offset); | |
| 1174 | + if (!string.IsNullOrWhiteSpace(storeCategoryStr) && int.TryParse(storeCategoryStr, out int storeCategory)) | |
| 1175 | + entity.StoreCategory = storeCategory; | |
| 1176 | + } | |
| 1177 | + else | |
| 1178 | + { | |
| 1179 | + // 新格式:按列名匹配(更灵活) | |
| 1180 | + // 由于前端导出是基于 tableColumns 动态生成,列顺序可能变化 | |
| 1181 | + // 这里使用列名匹配方式,提高兼容性 | |
| 1182 | + var columnNameMap = new Dictionary<string, int>(); | |
| 1183 | + for (int colIdx = 0; colIdx < dataTable.Columns.Count; colIdx++) | |
| 1184 | + { | |
| 1185 | + var colName = dataTable.Columns[colIdx].ColumnName?.Trim() ?? ""; | |
| 1186 | + if (!string.IsNullOrWhiteSpace(colName)) | |
| 1187 | + { | |
| 1188 | + columnNameMap[colName] = colIdx; | |
| 1189 | + } | |
| 1190 | + } | |
| 1191 | + | |
| 1192 | + // 辅助方法:根据列名获取值 | |
| 1193 | + Func<string, string> GetValueByColumnName = (columnName) => | |
| 1194 | + { | |
| 1195 | + if (columnNameMap.ContainsKey(columnName)) | |
| 1196 | + { | |
| 1197 | + var colIdx = columnNameMap[columnName]; | |
| 1198 | + return GetColumnValue(colIdx); | |
| 1199 | + } | |
| 1200 | + return ""; | |
| 1201 | + }; | |
| 1202 | + | |
| 1203 | + // 按列名读取字段(支持新字段) | |
| 1204 | + entity.StoreTotalPerformance = ParseDecimal(GetValueByColumnName("门店总业绩")); | |
| 1205 | + entity.StoreBillingPerformance = ParseDecimal(GetValueByColumnName("门店开单业绩")); | |
| 1206 | + entity.StoreRefundPerformance = ParseDecimal(GetValueByColumnName("门店退卡业绩")); | |
| 1207 | + // 销售业绩字段不在导入中处理,仅在计算时使用 | |
| 1208 | + entity.ProductMaterial = ParseDecimal(GetValueByColumnName("产品物料")); | |
| 1209 | + entity.CooperationCost = ParseDecimal(GetValueByColumnName("合作项目成本")); | |
| 1210 | + entity.StoreExpense = ParseDecimal(GetValueByColumnName("店内支出")); | |
| 1211 | + entity.LaundryCost = ParseDecimal(GetValueByColumnName("洗毛巾费用")); | |
| 1212 | + entity.GrossProfit = ParseDecimal(GetValueByColumnName("毛利")); | |
| 1213 | + entity.StoreLifeline = ParseDecimal(GetValueByColumnName("门店生命线")); | |
| 1214 | + entity.PerformanceCompletionRate = ParseDecimal(GetValueByColumnName("业绩完成率")); | |
| 1215 | + entity.PerformanceReached = GetValueByColumnName("业绩是否达标"); | |
| 1216 | + entity.HeadCountReached = GetValueByColumnName("人头是否达标"); | |
| 1217 | + entity.ConsumeReached = GetValueByColumnName("消耗是否达标"); | |
| 1218 | + entity.AssessmentDeduction = ParseDecimal(GetValueByColumnName("考核扣款金额")); | |
| 1219 | + entity.UnreachedIndicatorCount = ParseInt(GetValueByColumnName("未达标指标数量")); | |
| 1220 | + entity.HeadCount = ParseInt(GetValueByColumnName("进店消耗人数")); | |
| 1221 | + entity.TargetHeadCount = ParseDecimal(GetValueByColumnName("目标人头数")); | |
| 1222 | + entity.StoreConsume = ParseDecimal(GetValueByColumnName("门店消耗金额")); | |
| 1223 | + entity.TargetConsume = ParseDecimal(GetValueByColumnName("目标消耗金额")); | |
| 1224 | + entity.CommissionRateBelowLifeline = ParseDecimal(GetValueByColumnName("≤生命线部分提成比例")); | |
| 1225 | + entity.CommissionRateAboveLifeline = ParseDecimal(GetValueByColumnName(">生命线部分提成比例")); | |
| 1226 | + entity.CommissionAmountBelowLifeline = ParseDecimal(GetValueByColumnName("≤生命线部分提成金额")); | |
| 1227 | + entity.CommissionAmountAboveLifeline = ParseDecimal(GetValueByColumnName(">生命线部分提成金额")); | |
| 1228 | + entity.TotalCommissionAmount = ParseDecimal(GetValueByColumnName("提成总金额")); | |
| 1229 | + entity.BaseSalary = ParseDecimal(GetValueByColumnName("底薪金额")); | |
| 1230 | + entity.ActualBaseSalary = ParseDecimal(GetValueByColumnName("实际底薪")); | |
| 1231 | + entity.WorkingDays = ParseInt(GetValueByColumnName("在店天数")); | |
| 1232 | + entity.LeaveDays = ParseInt(GetValueByColumnName("请假天数")); | |
| 1233 | + entity.GrossSalary = ParseDecimal(GetValueByColumnName("应发工资")); | |
| 1234 | + entity.ActualSalary = ParseDecimal(GetValueByColumnName("实发工资")); | |
| 1235 | + entity.MissingCard = ParseDecimal(GetValueByColumnName("缺卡扣款")); | |
| 1236 | + entity.LateArrival = ParseDecimal(GetValueByColumnName("迟到扣款")); | |
| 1237 | + entity.LeaveDeduction = ParseDecimal(GetValueByColumnName("请假扣款")); | |
| 1238 | + entity.SocialInsuranceDeduction = ParseDecimal(GetValueByColumnName("扣社保")); | |
| 1239 | + entity.RewardDeduction = ParseDecimal(GetValueByColumnName("扣除奖励")); | |
| 1240 | + entity.AccommodationDeduction = ParseDecimal(GetValueByColumnName("扣住宿费")); | |
| 1241 | + entity.StudyPeriodDeduction = ParseDecimal(GetValueByColumnName("扣学习期费用")); | |
| 1242 | + entity.WorkClothesDeduction = ParseDecimal(GetValueByColumnName("扣工作服费用")); | |
| 1243 | + entity.TotalDeduction = ParseDecimal(GetValueByColumnName("扣款合计")); | |
| 1244 | + entity.MonthlyTrainingSubsidy = ParseDecimal(GetValueByColumnName("当月培训补贴")); | |
| 1245 | + entity.MonthlyTransportSubsidy = ParseDecimal(GetValueByColumnName("当月交通补贴")); | |
| 1246 | + entity.LastMonthTrainingSubsidy = ParseDecimal(GetValueByColumnName("上月培训补贴")); | |
| 1247 | + entity.LastMonthTransportSubsidy = ParseDecimal(GetValueByColumnName("上月交通补贴")); | |
| 1248 | + entity.TotalSubsidy = ParseDecimal(GetValueByColumnName("补贴合计")); | |
| 1249 | + entity.Bonus = ParseDecimal(GetValueByColumnName("发奖金")); | |
| 1250 | + entity.ReturnPhoneDeposit = ParseDecimal(GetValueByColumnName("退手机押金")); | |
| 1251 | + entity.ReturnAccommodationDeposit = ParseDecimal(GetValueByColumnName("退住宿押金")); | |
| 1252 | + entity.MonthlyPaymentStatus = GetValueByColumnName("当月是否发放"); | |
| 1253 | + entity.PaidAmount = ParseDecimal(GetValueByColumnName("支付金额")); | |
| 1254 | + entity.PendingAmount = ParseDecimal(GetValueByColumnName("待支付金额")); | |
| 1255 | + entity.LastMonthSupplement = ParseDecimal(GetValueByColumnName("补发上月")); | |
| 1256 | + entity.MonthlyTotalPayment = ParseDecimal(GetValueByColumnName("当月支付总额")); | |
| 1257 | + var isLockedStrNew = GetValueByColumnName("锁定状态"); | |
| 1258 | + if (isLockedStrNew == "已锁定" || isLockedStrNew == "1" || isLockedStrNew == "锁定") entity.IsLocked = 1; | |
| 1259 | + else entity.IsLocked = 0; | |
| 1260 | + var confirmStatusStr = GetValueByColumnName("确认状态"); | |
| 1261 | + if (confirmStatusStr == "已确认" || confirmStatusStr == "1") entity.EmployeeConfirmStatus = 1; | |
| 1262 | + else entity.EmployeeConfirmStatus = 0; | |
| 1263 | + var storeTypeStrNew = GetValueByColumnName("门店类型"); | |
| 1264 | + if (!string.IsNullOrWhiteSpace(storeTypeStrNew) && int.TryParse(storeTypeStrNew, out int storeTypeNew)) | |
| 1265 | + entity.StoreType = storeTypeNew; | |
| 1266 | + var storeCategoryStrNew = GetValueByColumnName("门店类别"); | |
| 1267 | + if (!string.IsNullOrWhiteSpace(storeCategoryStrNew) && int.TryParse(storeCategoryStrNew, out int storeCategoryNew)) | |
| 1268 | + entity.StoreCategory = storeCategoryNew; | |
| 1269 | + entity.IsNewStore = GetValueByColumnName("是否新店") == "是" ? "是" : "否"; | |
| 1270 | + entity.NewStoreProtectionStage = ParseInt(GetValueByColumnName("新店保护阶段")); | |
| 1271 | + } | |
| 1113 | 1272 | |
| 1114 | 1273 | if (existing != null) |
| 1115 | 1274 | { |
| ... | ... | @@ -1159,10 +1318,12 @@ namespace NCC.Extend |
| 1159 | 1318 | if (recordsToInsert.Any()) await _db.Insertable(recordsToInsert).ExecuteCommandAsync(); |
| 1160 | 1319 | if (recordsToUpdate.Any()) |
| 1161 | 1320 | { |
| 1162 | - // 使用IgnoreColumns排除CreateTime和CreateUser,确保其他所有字段都被更新 | |
| 1321 | + // 使用IgnoreColumns排除CreateTime、CreateUser、StoreId和EmployeeId,确保这些字段不会被更新 | |
| 1163 | 1322 | await _db.Updateable(recordsToUpdate) |
| 1164 | 1323 | .IgnoreColumns(x => x.CreateTime) |
| 1165 | 1324 | .IgnoreColumns(x => x.CreateUser) |
| 1325 | + .IgnoreColumns(x => x.StoreId) | |
| 1326 | + .IgnoreColumns(x => x.EmployeeId) | |
| 1166 | 1327 | .ExecuteCommandAsync(); |
| 1167 | 1328 | } |
| 1168 | 1329 | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/LqKhxxService.cs
| ... | ... | @@ -2,6 +2,7 @@ |
| 2 | 2 | using System.Collections.Generic; |
| 3 | 3 | using System.IO; |
| 4 | 4 | using System.Linq; |
| 5 | +using System.Text; | |
| 5 | 6 | using System.Threading.Tasks; |
| 6 | 7 | using Mapster; |
| 7 | 8 | using Microsoft.AspNetCore.Mvc; |
| ... | ... | @@ -40,6 +41,9 @@ using SqlSugar; |
| 40 | 41 | using Yitter.IdGenerator; |
| 41 | 42 | using NCC.Extend.Entitys.lq_kd_deductinfo; |
| 42 | 43 | using Microsoft.AspNetCore.Authorization; |
| 44 | +using NPOI.XSSF.UserModel; | |
| 45 | +using NPOI.SS.UserModel; | |
| 46 | +using System.Reflection; | |
| 43 | 47 | |
| 44 | 48 | namespace NCC.Extend.LqKhxx |
| 45 | 49 | { |
| ... | ... | @@ -1249,6 +1253,389 @@ namespace NCC.Extend.LqKhxx |
| 1249 | 1253 | } |
| 1250 | 1254 | #endregion |
| 1251 | 1255 | |
| 1256 | + #region 导出所有会员剩余品项 | |
| 1257 | + /// <summary> | |
| 1258 | + /// 导出所有会员剩余品项 | |
| 1259 | + /// </summary> | |
| 1260 | + /// <remarks> | |
| 1261 | + /// 导出所有会员的剩余品项信息到Excel文件 | |
| 1262 | + /// | |
| 1263 | + /// 示例请求: | |
| 1264 | + /// ```http | |
| 1265 | + /// GET /api/Extend/LqKhxx/Actions/ExportAllMemberRemainingItems | |
| 1266 | + /// ``` | |
| 1267 | + /// | |
| 1268 | + /// 返回数据说明: | |
| 1269 | + /// - 返回Excel文件下载链接 | |
| 1270 | + /// - Excel文件包含所有会员的剩余品项信息 | |
| 1271 | + /// </remarks> | |
| 1272 | + /// <returns>Excel文件下载信息</returns> | |
| 1273 | + /// <response code="200">成功返回Excel文件下载链接</response> | |
| 1274 | + /// <response code="500">服务器错误</response> | |
| 1275 | + [HttpGet("Actions/ExportAllMemberRemainingItems")] | |
| 1276 | + public async Task<dynamic> ExportAllMemberRemainingItems() | |
| 1277 | + { | |
| 1278 | + try | |
| 1279 | + { | |
| 1280 | + _logger.LogInformation("开始导出所有会员剩余品项"); | |
| 1281 | + | |
| 1282 | + // 1. 查询所有有效会员 | |
| 1283 | + var members = await _db.Queryable<LqKhxxEntity>() | |
| 1284 | + .Where(x => x.IsEffective == StatusEnum.有效.GetHashCode()) | |
| 1285 | + .Select(x => new { x.Id, x.Khmc, x.Sjh, x.Gsmd }) | |
| 1286 | + .ToListAsync(); | |
| 1287 | + | |
| 1288 | + if (members == null || !members.Any()) | |
| 1289 | + { | |
| 1290 | + throw NCCException.Oh("没有找到会员数据"); | |
| 1291 | + } | |
| 1292 | + | |
| 1293 | + // 2. 批量查询门店信息 | |
| 1294 | + var storeIds = members.Where(x => !string.IsNullOrEmpty(x.Gsmd)).Select(x => x.Gsmd).Distinct().ToList(); | |
| 1295 | + var storeDict = new Dictionary<string, string>(); | |
| 1296 | + if (storeIds.Any()) | |
| 1297 | + { | |
| 1298 | + var stores = await _db.Queryable<LqMdxxEntity>() | |
| 1299 | + .Where(x => storeIds.Contains(x.Id)) | |
| 1300 | + .Select(x => new { x.Id, x.Dm }) | |
| 1301 | + .ToListAsync(); | |
| 1302 | + storeDict = stores.ToDictionary(x => x.Id, x => x.Dm ?? ""); | |
| 1303 | + } | |
| 1304 | + | |
| 1305 | + var memberIds = members.Select(x => x.Id).ToList(); | |
| 1306 | + | |
| 1307 | + // 3. 批量查询所有开单品项数据 | |
| 1308 | + var baseItems = await _db.Queryable<LqKdPxmxEntity>() | |
| 1309 | + .Where(x => memberIds.Contains(x.MemberId)) | |
| 1310 | + .Where(x => x.IsEffective == StatusEnum.有效.GetHashCode()) | |
| 1311 | + .Select(x => new | |
| 1312 | + { | |
| 1313 | + x.Id, | |
| 1314 | + x.MemberId, | |
| 1315 | + x.Px, | |
| 1316 | + x.Pxmc, | |
| 1317 | + x.Pxjg, | |
| 1318 | + x.SourceType, | |
| 1319 | + x.ProjectNumber, | |
| 1320 | + x.Remark | |
| 1321 | + }) | |
| 1322 | + .ToListAsync(); | |
| 1323 | + | |
| 1324 | + if (!baseItems.Any()) | |
| 1325 | + { | |
| 1326 | + throw NCCException.Oh("没有找到品项数据"); | |
| 1327 | + } | |
| 1328 | + | |
| 1329 | + var billingItemIds = baseItems.Select(x => x.Id).ToList(); | |
| 1330 | + | |
| 1331 | + // 4. 批量查询消费数据 | |
| 1332 | + var consumedData = await _db.Queryable<LqXhPxmxEntity>() | |
| 1333 | + .Where(x => billingItemIds.Contains(x.BillingItemId)) | |
| 1334 | + .Where(x => x.IsEffective == StatusEnum.有效.GetHashCode()) | |
| 1335 | + .GroupBy(x => x.BillingItemId) | |
| 1336 | + .Select(x => new | |
| 1337 | + { | |
| 1338 | + BillingItemId = x.BillingItemId, | |
| 1339 | + TotalConsumed = SqlFunc.AggregateSum(x.OriginalProjectNumber) | |
| 1340 | + }) | |
| 1341 | + .ToListAsync(); | |
| 1342 | + | |
| 1343 | + // 5. 批量查询退卡数据 | |
| 1344 | + var refundedData = await _db.Queryable<LqHytkMxEntity>() | |
| 1345 | + .Where(x => billingItemIds.Contains(x.BillingItemId)) | |
| 1346 | + .Where(x => x.IsEffective == StatusEnum.有效.GetHashCode()) | |
| 1347 | + .GroupBy(x => x.BillingItemId) | |
| 1348 | + .Select(x => new | |
| 1349 | + { | |
| 1350 | + BillingItemId = x.BillingItemId, | |
| 1351 | + TotalRefunded = SqlFunc.AggregateSum(x.ProjectNumber) | |
| 1352 | + }) | |
| 1353 | + .ToListAsync(); | |
| 1354 | + | |
| 1355 | + // 6. 批量查询储扣数据 | |
| 1356 | + var deductData = await _db.Queryable<LqKdDeductinfoEntity>() | |
| 1357 | + .Where(x => billingItemIds.Contains(x.DeductId)) | |
| 1358 | + .Where(x => x.IsEffective == StatusEnum.有效.GetHashCode()) | |
| 1359 | + .GroupBy(x => x.DeductId) | |
| 1360 | + .Select(x => new | |
| 1361 | + { | |
| 1362 | + BillingItemId = x.DeductId, | |
| 1363 | + TotalDeduct = SqlFunc.AggregateSum(x.ProjectNumber) | |
| 1364 | + }) | |
| 1365 | + .ToListAsync(); | |
| 1366 | + | |
| 1367 | + // 7. 构建字典以提高查询效率 | |
| 1368 | + var memberDict = members.ToDictionary(x => x.Id, x => x); | |
| 1369 | + | |
| 1370 | + // 8. 组装导出数据 | |
| 1371 | + var exportData = new List<MemberRemainingItemsExportOutput>(); | |
| 1372 | + foreach (var item in baseItems) | |
| 1373 | + { | |
| 1374 | + if (!memberDict.ContainsKey(item.MemberId)) continue; | |
| 1375 | + | |
| 1376 | + var member = memberDict[item.MemberId]; | |
| 1377 | + var consumed = consumedData.FirstOrDefault(c => c.BillingItemId == item.Id)?.TotalConsumed ?? 0m; | |
| 1378 | + var refunded = refundedData.FirstOrDefault(r => r.BillingItemId == item.Id)?.TotalRefunded ?? 0m; | |
| 1379 | + var deduct = deductData.FirstOrDefault(d => d.BillingItemId == item.Id)?.TotalDeduct ?? 0m; | |
| 1380 | + var remaining = item.ProjectNumber - consumed - refunded - deduct; | |
| 1381 | + | |
| 1382 | + // 只导出剩余数量不等于0的品项 | |
| 1383 | + if (remaining != 0) | |
| 1384 | + { | |
| 1385 | + exportData.Add(new MemberRemainingItemsExportOutput | |
| 1386 | + { | |
| 1387 | + memberId = item.MemberId, | |
| 1388 | + memberName = member.Khmc ?? "", | |
| 1389 | + phone = member.Sjh ?? "", | |
| 1390 | + storeName = !string.IsNullOrEmpty(member.Gsmd) && storeDict.ContainsKey(member.Gsmd) ? storeDict[member.Gsmd] : "", | |
| 1391 | + billingItemId = item.Id, | |
| 1392 | + itemId = item.Px ?? "", | |
| 1393 | + itemName = item.Pxmc ?? "", | |
| 1394 | + itemPrice = item.Pxjg, | |
| 1395 | + sourceType = item.SourceType ?? "", | |
| 1396 | + totalPurchased = item.ProjectNumber, | |
| 1397 | + consumedCount = consumed, | |
| 1398 | + refundedCount = refunded, | |
| 1399 | + deductCount = deduct, | |
| 1400 | + remainingCount = remaining, | |
| 1401 | + remark = item.Remark ?? "" | |
| 1402 | + }); | |
| 1403 | + } | |
| 1404 | + } | |
| 1405 | + | |
| 1406 | + // 9. 配置Excel导出 | |
| 1407 | + ExcelConfig excelconfig = new ExcelConfig(); | |
| 1408 | + excelconfig.FileName = "所有会员剩余品项_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xlsx"; | |
| 1409 | + excelconfig.HeadFont = "微软雅黑"; | |
| 1410 | + excelconfig.HeadPoint = 10; | |
| 1411 | + excelconfig.IsAllSizeColumn = true; | |
| 1412 | + excelconfig.ColumnModel = new List<ExcelColumnModel> | |
| 1413 | + { | |
| 1414 | + new ExcelColumnModel { Column = "memberId", ExcelColumn = "会员ID" }, | |
| 1415 | + new ExcelColumnModel { Column = "memberName", ExcelColumn = "会员姓名" }, | |
| 1416 | + new ExcelColumnModel { Column = "phone", ExcelColumn = "手机号" }, | |
| 1417 | + new ExcelColumnModel { Column = "storeName", ExcelColumn = "归属门店" }, | |
| 1418 | + new ExcelColumnModel { Column = "billingItemId", ExcelColumn = "开单品项ID" }, | |
| 1419 | + new ExcelColumnModel { Column = "itemId", ExcelColumn = "品项ID" }, | |
| 1420 | + new ExcelColumnModel { Column = "itemName", ExcelColumn = "品项名称" }, | |
| 1421 | + new ExcelColumnModel { Column = "itemPrice", ExcelColumn = "品项单价" }, | |
| 1422 | + new ExcelColumnModel { Column = "sourceType", ExcelColumn = "来源类型" }, | |
| 1423 | + new ExcelColumnModel { Column = "totalPurchased", ExcelColumn = "总购买数量" }, | |
| 1424 | + new ExcelColumnModel { Column = "consumedCount", ExcelColumn = "已耗卡数量" }, | |
| 1425 | + new ExcelColumnModel { Column = "refundedCount", ExcelColumn = "已退卡数量" }, | |
| 1426 | + new ExcelColumnModel { Column = "deductCount", ExcelColumn = "已储扣数量" }, | |
| 1427 | + new ExcelColumnModel { Column = "remainingCount", ExcelColumn = "剩余数量" }, | |
| 1428 | + new ExcelColumnModel { Column = "remark", ExcelColumn = "备注" } | |
| 1429 | + }; | |
| 1430 | + | |
| 1431 | + // 10. 查找项目根目录并创建ExportFiles文件夹 | |
| 1432 | + var baseDir = AppContext.BaseDirectory; | |
| 1433 | + var projectRoot = baseDir; | |
| 1434 | + var dir = new DirectoryInfo(baseDir); | |
| 1435 | + while (dir != null && dir.Parent != null) | |
| 1436 | + { | |
| 1437 | + try | |
| 1438 | + { | |
| 1439 | + if (dir.GetDirectories(".git").Any() || dir.GetFiles("*.sln").Any()) | |
| 1440 | + { | |
| 1441 | + projectRoot = dir.FullName; | |
| 1442 | + break; | |
| 1443 | + } | |
| 1444 | + } | |
| 1445 | + catch | |
| 1446 | + { | |
| 1447 | + // 忽略访问错误,继续向上查找 | |
| 1448 | + } | |
| 1449 | + dir = dir.Parent; | |
| 1450 | + } | |
| 1451 | + | |
| 1452 | + // 如果没找到 .git 或 .sln 目录,再查找包含 .sln 文件的目录 | |
| 1453 | + if (projectRoot == baseDir) | |
| 1454 | + { | |
| 1455 | + dir = new DirectoryInfo(baseDir); | |
| 1456 | + while (dir != null && dir.Parent != null) | |
| 1457 | + { | |
| 1458 | + try | |
| 1459 | + { | |
| 1460 | + if (dir.GetFiles("*.sln").Any()) | |
| 1461 | + { | |
| 1462 | + projectRoot = dir.FullName; | |
| 1463 | + break; | |
| 1464 | + } | |
| 1465 | + } | |
| 1466 | + catch | |
| 1467 | + { | |
| 1468 | + // 忽略访问错误,继续向上查找 | |
| 1469 | + } | |
| 1470 | + dir = dir.Parent; | |
| 1471 | + } | |
| 1472 | + } | |
| 1473 | + | |
| 1474 | + // 在项目根目录下创建 ExportFiles 文件夹 | |
| 1475 | + var exportFilesPath = Path.Combine(projectRoot, "ExportFiles"); | |
| 1476 | + if (!Directory.Exists(exportFilesPath)) | |
| 1477 | + { | |
| 1478 | + Directory.CreateDirectory(exportFilesPath); | |
| 1479 | + } | |
| 1480 | + | |
| 1481 | + var addPath = Path.Combine(exportFilesPath, excelconfig.FileName); | |
| 1482 | + | |
| 1483 | + // 11. 导出Excel文件(支持多sheet,每个sheet最多65535行数据) | |
| 1484 | + ExportToExcelWithMultipleSheets(exportData, excelconfig, addPath); | |
| 1485 | + | |
| 1486 | + var fileName = _userManager.UserId + "|" + addPath + "|xlsx"; | |
| 1487 | + var output = new | |
| 1488 | + { | |
| 1489 | + name = excelconfig.FileName, | |
| 1490 | + url = "/api/File/Download?encryption=" + DESCEncryption.Encrypt(fileName, "NCC") | |
| 1491 | + }; | |
| 1492 | + | |
| 1493 | + _logger.LogInformation("导出所有会员剩余品项完成,共{Count}条记录", exportData.Count); | |
| 1494 | + | |
| 1495 | + return output; | |
| 1496 | + } | |
| 1497 | + catch (Exception ex) | |
| 1498 | + { | |
| 1499 | + _logger.LogError(ex, "导出所有会员剩余品项失败"); | |
| 1500 | + throw NCCException.Oh($"导出所有会员剩余品项失败:{ex.Message}"); | |
| 1501 | + } | |
| 1502 | + } | |
| 1503 | + | |
| 1504 | + /// <summary> | |
| 1505 | + /// 导出Excel文件(支持多sheet,每个sheet最多65535行数据) | |
| 1506 | + /// </summary> | |
| 1507 | + private void ExportToExcelWithMultipleSheets(List<MemberRemainingItemsExportOutput> exportData, ExcelConfig excelConfig, string filePath) | |
| 1508 | + { | |
| 1509 | + const int maxRowsPerSheet = 65535; // 每个sheet最多65535行数据(不包括表头) | |
| 1510 | + var workbook = new XSSFWorkbook(); | |
| 1511 | + var type = typeof(MemberRemainingItemsExportOutput); | |
| 1512 | + var properties = type.GetProperties(); | |
| 1513 | + | |
| 1514 | + // 创建样式 | |
| 1515 | + var headStyle = workbook.CreateCellStyle(); | |
| 1516 | + var headFont = workbook.CreateFont(); | |
| 1517 | + headFont.FontHeightInPoints = (short)excelConfig.HeadPoint; | |
| 1518 | + headFont.FontName = excelConfig.HeadFont; | |
| 1519 | + headFont.Boldweight = (short)700; // 粗体 | |
| 1520 | + headStyle.SetFont(headFont); | |
| 1521 | + headStyle.Alignment = HorizontalAlignment.Left; | |
| 1522 | + | |
| 1523 | + var dateStyle = workbook.CreateCellStyle(); | |
| 1524 | + var format = workbook.CreateDataFormat(); | |
| 1525 | + dateStyle.DataFormat = format.GetFormat("yyyy-MM-dd HH:mm:ss"); | |
| 1526 | + | |
| 1527 | + // 计算列宽 | |
| 1528 | + var columnWidths = new int[excelConfig.ColumnModel.Count]; | |
| 1529 | + for (int i = 0; i < excelConfig.ColumnModel.Count; i++) | |
| 1530 | + { | |
| 1531 | + var columnName = excelConfig.ColumnModel[i].ExcelColumn; | |
| 1532 | + columnWidths[i] = Encoding.UTF8.GetBytes(columnName).Length + 2; | |
| 1533 | + } | |
| 1534 | + | |
| 1535 | + int dataIndex = 0; | |
| 1536 | + int sheetIndex = 0; | |
| 1537 | + | |
| 1538 | + while (dataIndex < exportData.Count) | |
| 1539 | + { | |
| 1540 | + // 创建新的sheet | |
| 1541 | + var sheetName = sheetIndex == 0 ? "Sheet1" : $"Sheet{sheetIndex + 1}"; | |
| 1542 | + var sheet = workbook.CreateSheet(sheetName); | |
| 1543 | + | |
| 1544 | + // 创建表头 | |
| 1545 | + var headerRow = sheet.CreateRow(0); | |
| 1546 | + for (int col = 0; col < excelConfig.ColumnModel.Count; col++) | |
| 1547 | + { | |
| 1548 | + var cell = headerRow.CreateCell(col); | |
| 1549 | + cell.SetCellValue(excelConfig.ColumnModel[col].ExcelColumn); | |
| 1550 | + cell.CellStyle = headStyle; | |
| 1551 | + sheet.SetColumnWidth(col, (columnWidths[col] + 1) * 256); | |
| 1552 | + } | |
| 1553 | + | |
| 1554 | + // 填充数据 | |
| 1555 | + int rowIndex = 1; | |
| 1556 | + while (dataIndex < exportData.Count && rowIndex <= maxRowsPerSheet) | |
| 1557 | + { | |
| 1558 | + var item = exportData[dataIndex]; | |
| 1559 | + var dataRow = sheet.CreateRow(rowIndex); | |
| 1560 | + | |
| 1561 | + for (int col = 0; col < excelConfig.ColumnModel.Count; col++) | |
| 1562 | + { | |
| 1563 | + var column = excelConfig.ColumnModel[col]; | |
| 1564 | + var property = properties.FirstOrDefault(p => p.Name == column.Column); | |
| 1565 | + if (property != null) | |
| 1566 | + { | |
| 1567 | + var cell = dataRow.CreateCell(col); | |
| 1568 | + var value = property.GetValue(item); | |
| 1569 | + SetCellValue(cell, value, property.PropertyType, dateStyle); | |
| 1570 | + } | |
| 1571 | + } | |
| 1572 | + | |
| 1573 | + rowIndex++; | |
| 1574 | + dataIndex++; | |
| 1575 | + } | |
| 1576 | + | |
| 1577 | + sheetIndex++; | |
| 1578 | + } | |
| 1579 | + | |
| 1580 | + // 保存文件 | |
| 1581 | + using (var fileStream = new FileStream(filePath, FileMode.Create, FileAccess.Write)) | |
| 1582 | + { | |
| 1583 | + workbook.Write(fileStream); | |
| 1584 | + } | |
| 1585 | + } | |
| 1586 | + | |
| 1587 | + /// <summary> | |
| 1588 | + /// 设置单元格值 | |
| 1589 | + /// </summary> | |
| 1590 | + private void SetCellValue(ICell cell, object value, Type propertyType, ICellStyle dateStyle) | |
| 1591 | + { | |
| 1592 | + if (value == null) | |
| 1593 | + { | |
| 1594 | + cell.SetCellValue(""); | |
| 1595 | + return; | |
| 1596 | + } | |
| 1597 | + | |
| 1598 | + var typeName = propertyType.IsGenericType && propertyType.GetGenericTypeDefinition() == typeof(Nullable<>) | |
| 1599 | + ? propertyType.GetGenericArguments()[0].ToString() | |
| 1600 | + : propertyType.ToString(); | |
| 1601 | + | |
| 1602 | + switch (typeName) | |
| 1603 | + { | |
| 1604 | + case "System.String": | |
| 1605 | + cell.SetCellValue(value.ToString()); | |
| 1606 | + break; | |
| 1607 | + case "System.DateTime": | |
| 1608 | + if (value is DateTime dateTime) | |
| 1609 | + { | |
| 1610 | + cell.SetCellValue(dateTime); | |
| 1611 | + cell.CellStyle = dateStyle; | |
| 1612 | + } | |
| 1613 | + else | |
| 1614 | + { | |
| 1615 | + cell.SetCellValue(""); | |
| 1616 | + } | |
| 1617 | + break; | |
| 1618 | + case "System.Boolean": | |
| 1619 | + cell.SetCellValue((bool)value); | |
| 1620 | + break; | |
| 1621 | + case "System.Int16": | |
| 1622 | + case "System.Int32": | |
| 1623 | + case "System.Int64": | |
| 1624 | + case "System.Byte": | |
| 1625 | + cell.SetCellValue(Convert.ToDouble(value)); | |
| 1626 | + break; | |
| 1627 | + case "System.Decimal": | |
| 1628 | + case "System.Double": | |
| 1629 | + case "System.Single": | |
| 1630 | + cell.SetCellValue(Convert.ToDouble(value)); | |
| 1631 | + break; | |
| 1632 | + default: | |
| 1633 | + cell.SetCellValue(value.ToString()); | |
| 1634 | + break; | |
| 1635 | + } | |
| 1636 | + } | |
| 1637 | + #endregion | |
| 1638 | + | |
| 1252 | 1639 | #region 获取会员类型枚举内容 |
| 1253 | 1640 | /// <summary> |
| 1254 | 1641 | /// 获取会员类型枚举内容 |
| ... | ... | @@ -1765,10 +2152,121 @@ namespace NCC.Extend.LqKhxx |
| 1765 | 2152 | |
| 1766 | 2153 | var itemDetailIds = itemDetails.Select(x => (string)x.Id).ToList(); |
| 1767 | 2154 | |
| 1768 | - // 5. 批量查询消耗品项 | |
| 2155 | + // 4.5. 双向查询:直接查询会员的所有耗卡记录,确保不遗漏数据 | |
| 2156 | + // 通过耗卡记录反向查找可能遗漏的开单品项明细和开单记录 | |
| 2157 | + var allConsumedItemIds = new HashSet<string>(); | |
| 2158 | + var additionalBillingItemIds = new HashSet<string>(); | |
| 2159 | + | |
| 2160 | + if (memberIdsList.Any()) | |
| 2161 | + { | |
| 2162 | + // 查询会员的所有耗卡记录 | |
| 2163 | + var allConsumedItemsFromConsume = await _db.Queryable<LqXhPxmxEntity, LqXhHyhkEntity>( | |
| 2164 | + (pxmx, hyhk) => new JoinQueryInfos(JoinType.Inner, pxmx.ConsumeInfoId == hyhk.Id)) | |
| 2165 | + .Where((pxmx, hyhk) => memberIdsList.Contains(hyhk.Hy) | |
| 2166 | + && pxmx.IsEffective == StatusEnum.有效.GetHashCode() | |
| 2167 | + && hyhk.IsEffective == StatusEnum.有效.GetHashCode()) | |
| 2168 | + .Where((pxmx, hyhk) => !string.IsNullOrEmpty(pxmx.BillingItemId)) | |
| 2169 | + .Select((pxmx, hyhk) => new | |
| 2170 | + { | |
| 2171 | + pxmx.BillingItemId, | |
| 2172 | + pxmx.Px, | |
| 2173 | + pxmx.Pxmc, | |
| 2174 | + pxmx.Pxjg, | |
| 2175 | + pxmx.ProjectNumber, | |
| 2176 | + pxmx.TotalPrice | |
| 2177 | + }) | |
| 2178 | + .ToListAsync(); | |
| 2179 | + | |
| 2180 | + // 收集所有耗卡记录关联的开单品项明细ID | |
| 2181 | + foreach (var consumedItem in allConsumedItemsFromConsume) | |
| 2182 | + { | |
| 2183 | + if (!string.IsNullOrEmpty(consumedItem.BillingItemId)) | |
| 2184 | + { | |
| 2185 | + allConsumedItemIds.Add(consumedItem.BillingItemId); | |
| 2186 | + // 如果这个BillingItemId不在当前的itemDetailIds中,需要额外查询 | |
| 2187 | + if (!itemDetailIds.Contains(consumedItem.BillingItemId)) | |
| 2188 | + { | |
| 2189 | + additionalBillingItemIds.Add(consumedItem.BillingItemId); | |
| 2190 | + } | |
| 2191 | + } | |
| 2192 | + } | |
| 2193 | + | |
| 2194 | + // 如果有额外的开单品项明细ID,查询这些品项明细对应的开单记录 | |
| 2195 | + if (additionalBillingItemIds.Any()) | |
| 2196 | + { | |
| 2197 | + // 查询这些开单品项明细 | |
| 2198 | + var additionalItemDetailsData = await _db.Queryable<LqKdPxmxEntity>() | |
| 2199 | + .Where(x => additionalBillingItemIds.Contains(x.Id) && x.IsEffective == StatusEnum.有效.GetHashCode()) | |
| 2200 | + .Select(x => new | |
| 2201 | + { | |
| 2202 | + x.Id, | |
| 2203 | + x.Glkdbh, | |
| 2204 | + x.Px, | |
| 2205 | + x.Pxmc, | |
| 2206 | + x.Pxjg, | |
| 2207 | + x.SourceType, | |
| 2208 | + x.ProjectNumber, | |
| 2209 | + x.TotalPrice | |
| 2210 | + }) | |
| 2211 | + .ToListAsync(); | |
| 2212 | + | |
| 2213 | + // 将额外的品项明细添加到itemDetails中 | |
| 2214 | + itemDetails.AddRange(additionalItemDetailsData.Cast<dynamic>()); | |
| 2215 | + itemDetailIds.AddRange(additionalItemDetailsData.Select(x => x.Id)); | |
| 2216 | + | |
| 2217 | + // 查询这些品项明细对应的开单记录(如果不在当前的billingIds中) | |
| 2218 | + var additionalBillingIds = additionalItemDetailsData | |
| 2219 | + .Select(x => x.Glkdbh) | |
| 2220 | + .Where(x => !string.IsNullOrEmpty(x) && !billingIds.Contains(x)) | |
| 2221 | + .Distinct() | |
| 2222 | + .ToList(); | |
| 2223 | + | |
| 2224 | + if (additionalBillingIds.Any()) | |
| 2225 | + { | |
| 2226 | + var additionalBillingRecords = await _db.Queryable<LqKdKdjlbEntity>() | |
| 2227 | + .Where(x => additionalBillingIds.Contains(x.Id) && x.IsEffective == StatusEnum.有效.GetHashCode()) | |
| 2228 | + .Select(x => new | |
| 2229 | + { | |
| 2230 | + x.Id, | |
| 2231 | + x.Kdhy, | |
| 2232 | + x.Kdrq, | |
| 2233 | + x.Djmd, | |
| 2234 | + x.CreateUser | |
| 2235 | + }) | |
| 2236 | + .ToListAsync(); | |
| 2237 | + | |
| 2238 | + // 将额外的开单记录添加到billingRecords中(转换为dynamic以便后续使用) | |
| 2239 | + foreach (var record in additionalBillingRecords) | |
| 2240 | + { | |
| 2241 | + billingRecords.Add(record); | |
| 2242 | + } | |
| 2243 | + billingIds.AddRange(additionalBillingIds); | |
| 2244 | + } | |
| 2245 | + } | |
| 2246 | + } | |
| 2247 | + | |
| 2248 | + // 5. 批量查询消耗品项(包括所有通过耗卡找到的BillingItemId) | |
| 1769 | 2249 | var consumedItems = new List<dynamic>(); |
| 1770 | - if (itemDetailIds.Any()) | |
| 2250 | + if (allConsumedItemIds.Any()) | |
| 1771 | 2251 | { |
| 2252 | + // 使用allConsumedItemIds(来自耗卡记录的所有BillingItemId)查询消耗品项 | |
| 2253 | + var consumedItemsData = await _db.Queryable<LqXhPxmxEntity>() | |
| 2254 | + .Where(x => allConsumedItemIds.Contains(x.BillingItemId) && x.IsEffective == StatusEnum.有效.GetHashCode()) | |
| 2255 | + .Select(x => new | |
| 2256 | + { | |
| 2257 | + x.BillingItemId, | |
| 2258 | + x.Px, | |
| 2259 | + x.Pxmc, | |
| 2260 | + x.Pxjg, | |
| 2261 | + x.ProjectNumber, | |
| 2262 | + x.TotalPrice | |
| 2263 | + }) | |
| 2264 | + .ToListAsync(); | |
| 2265 | + consumedItems = consumedItemsData.Cast<dynamic>().ToList(); | |
| 2266 | + } | |
| 2267 | + else if (itemDetailIds.Any()) | |
| 2268 | + { | |
| 2269 | + // 兼容原有逻辑:如果没有耗卡记录,使用itemDetailIds查询 | |
| 1772 | 2270 | var consumedItemsData = await _db.Queryable<LqXhPxmxEntity>() |
| 1773 | 2271 | .Where(x => itemDetailIds.Contains(x.BillingItemId) && x.IsEffective == StatusEnum.有效.GetHashCode()) |
| 1774 | 2272 | .Select(x => new |
| ... | ... | @@ -1784,7 +2282,7 @@ namespace NCC.Extend.LqKhxx |
| 1784 | 2282 | consumedItems = consumedItemsData.Cast<dynamic>().ToList(); |
| 1785 | 2283 | } |
| 1786 | 2284 | |
| 1787 | - // 6. 批量查询退卡品项 | |
| 2285 | + // 6. 批量查询退卡品项(使用itemDetailIds,因为退卡也是关联开单品项明细) | |
| 1788 | 2286 | var refundedItems = new List<dynamic>(); |
| 1789 | 2287 | if (itemDetailIds.Any()) |
| 1790 | 2288 | { |
| ... | ... | @@ -1803,6 +2301,113 @@ namespace NCC.Extend.LqKhxx |
| 1803 | 2301 | refundedItems = refundedItemsData.Cast<dynamic>().ToList(); |
| 1804 | 2302 | } |
| 1805 | 2303 | |
| 2304 | + // 6.5. 双向查询退卡品项:直接从会员的退卡记录查询,确保不遗漏 | |
| 2305 | + if (memberIdsList.Any()) | |
| 2306 | + { | |
| 2307 | + var allRefundedItemsFromRefund = await _db.Queryable<LqHytkMxEntity, LqHytkHytkEntity>( | |
| 2308 | + (mx, hytk) => new JoinQueryInfos(JoinType.Inner, mx.RefundInfoId == hytk.Id)) | |
| 2309 | + .Where((mx, hytk) => memberIdsList.Contains(hytk.Hy) | |
| 2310 | + && mx.IsEffective == StatusEnum.有效.GetHashCode() | |
| 2311 | + && hytk.IsEffective == StatusEnum.有效.GetHashCode()) | |
| 2312 | + .Where((mx, hytk) => !string.IsNullOrEmpty(mx.BillingItemId)) | |
| 2313 | + .Select((mx, hytk) => new | |
| 2314 | + { | |
| 2315 | + mx.BillingItemId, | |
| 2316 | + mx.Px, | |
| 2317 | + mx.Pxmc, | |
| 2318 | + mx.Pxjg, | |
| 2319 | + mx.ProjectNumber, | |
| 2320 | + mx.Tkje | |
| 2321 | + }) | |
| 2322 | + .ToListAsync(); | |
| 2323 | + | |
| 2324 | + // 收集退卡记录关联的开单品项明细ID | |
| 2325 | + var refundedBillingItemIds = allRefundedItemsFromRefund | |
| 2326 | + .Select(x => x.BillingItemId) | |
| 2327 | + .Where(x => !string.IsNullOrEmpty(x)) | |
| 2328 | + .Distinct() | |
| 2329 | + .ToList(); | |
| 2330 | + | |
| 2331 | + // 如果退卡关联的开单品项明细不在当前的itemDetailIds中,也需要查询对应的开单记录 | |
| 2332 | + var missingRefundedBillingItemIds = refundedBillingItemIds | |
| 2333 | + .Where(x => !itemDetailIds.Contains(x)) | |
| 2334 | + .ToList(); | |
| 2335 | + | |
| 2336 | + if (missingRefundedBillingItemIds.Any()) | |
| 2337 | + { | |
| 2338 | + // 查询这些开单品项明细 | |
| 2339 | + var refundedAdditionalItemDetailsData = await _db.Queryable<LqKdPxmxEntity>() | |
| 2340 | + .Where(x => missingRefundedBillingItemIds.Contains(x.Id) && x.IsEffective == StatusEnum.有效.GetHashCode()) | |
| 2341 | + .Select(x => new | |
| 2342 | + { | |
| 2343 | + x.Id, | |
| 2344 | + x.Glkdbh, | |
| 2345 | + x.Px, | |
| 2346 | + x.Pxmc, | |
| 2347 | + x.Pxjg, | |
| 2348 | + x.SourceType, | |
| 2349 | + x.ProjectNumber, | |
| 2350 | + x.TotalPrice | |
| 2351 | + }) | |
| 2352 | + .ToListAsync(); | |
| 2353 | + | |
| 2354 | + // 将额外的品项明细添加到itemDetails中 | |
| 2355 | + itemDetails.AddRange(refundedAdditionalItemDetailsData.Cast<dynamic>()); | |
| 2356 | + itemDetailIds.AddRange(refundedAdditionalItemDetailsData.Select(x => x.Id)); | |
| 2357 | + | |
| 2358 | + // 查询这些品项明细对应的开单记录(如果不在当前的billingIds中) | |
| 2359 | + var refundedAdditionalBillingIds = refundedAdditionalItemDetailsData | |
| 2360 | + .Select(x => x.Glkdbh) | |
| 2361 | + .Where(x => !string.IsNullOrEmpty(x) && !billingIds.Contains(x)) | |
| 2362 | + .Distinct() | |
| 2363 | + .ToList(); | |
| 2364 | + | |
| 2365 | + if (refundedAdditionalBillingIds.Any()) | |
| 2366 | + { | |
| 2367 | + var refundedAdditionalBillingRecords = await _db.Queryable<LqKdKdjlbEntity>() | |
| 2368 | + .Where(x => refundedAdditionalBillingIds.Contains(x.Id) && x.IsEffective == StatusEnum.有效.GetHashCode()) | |
| 2369 | + .Select(x => new | |
| 2370 | + { | |
| 2371 | + x.Id, | |
| 2372 | + x.Kdhy, | |
| 2373 | + x.Kdrq, | |
| 2374 | + x.Djmd, | |
| 2375 | + x.CreateUser | |
| 2376 | + }) | |
| 2377 | + .ToListAsync(); | |
| 2378 | + | |
| 2379 | + // 将额外的开单记录添加到billingRecords中(转换为dynamic以便后续使用) | |
| 2380 | + foreach (var record in refundedAdditionalBillingRecords) | |
| 2381 | + { | |
| 2382 | + billingRecords.Add(record); | |
| 2383 | + } | |
| 2384 | + billingIds.AddRange(refundedAdditionalBillingIds); | |
| 2385 | + } | |
| 2386 | + | |
| 2387 | + // 将退卡数据添加到refundedItems中(去重) | |
| 2388 | + foreach (var refundedItem in allRefundedItemsFromRefund) | |
| 2389 | + { | |
| 2390 | + var refundedItemDynamic = refundedItem as dynamic; | |
| 2391 | + if (!refundedItems.Any(x => x.BillingItemId?.ToString() == refundedItemDynamic.BillingItemId?.ToString())) | |
| 2392 | + { | |
| 2393 | + refundedItems.Add(refundedItemDynamic); | |
| 2394 | + } | |
| 2395 | + } | |
| 2396 | + } | |
| 2397 | + else | |
| 2398 | + { | |
| 2399 | + // 如果所有退卡记录关联的开单品项明细都在itemDetailIds中,只需要合并退卡数据(去重) | |
| 2400 | + foreach (var refundedItem in allRefundedItemsFromRefund) | |
| 2401 | + { | |
| 2402 | + var refundedItemDynamic = refundedItem as dynamic; | |
| 2403 | + if (!refundedItems.Any(x => x.BillingItemId?.ToString() == refundedItemDynamic.BillingItemId?.ToString())) | |
| 2404 | + { | |
| 2405 | + refundedItems.Add(refundedItemDynamic); | |
| 2406 | + } | |
| 2407 | + } | |
| 2408 | + } | |
| 2409 | + } | |
| 2410 | + | |
| 1806 | 2411 | // 7. 批量查询储扣品项 |
| 1807 | 2412 | var deductedItems = new List<dynamic>(); |
| 1808 | 2413 | if (billingIds.Any()) | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/LqReimbursementApplicationService.cs
| ... | ... | @@ -262,6 +262,44 @@ namespace NCC.Extend.LqReimbursementApplication |
| 262 | 262 | List<string> queryCompletionTime = input.completionTime != null ? input.completionTime.Split(',').ToObeject<List<string>>() : null; |
| 263 | 263 | DateTime? startCompletionTime = queryCompletionTime != null ? Ext.GetDateTime(queryCompletionTime.First()) : null; |
| 264 | 264 | DateTime? endCompletionTime = queryCompletionTime != null ? Ext.GetDateTime(queryCompletionTime.Last()) : null; |
| 265 | + // 如果提供了完成时间筛选,需要先查询符合条件的申请ID,然后在主查询中过滤 | |
| 266 | + List<string> filteredApplicationIdsByCompletionTime = null; | |
| 267 | + if (queryCompletionTime != null) | |
| 268 | + { | |
| 269 | + var startDate = new DateTime(startCompletionTime.ToDate().Year, startCompletionTime.ToDate().Month, startCompletionTime.ToDate().Day, 0, 0, 0); | |
| 270 | + var endDate = new DateTime(endCompletionTime.ToDate().Year, endCompletionTime.ToDate().Month, endCompletionTime.ToDate().Day, 23, 59, 59); | |
| 271 | + | |
| 272 | + // 先查询实体类中有CompletionTime字段且符合条件的申请ID | |
| 273 | + var entitiesWithCompletionTime = await _db.Queryable<LqReimbursementApplicationEntity>() | |
| 274 | + .Where(x => x.CompletionTime.HasValue | |
| 275 | + && x.CompletionTime.Value >= startDate | |
| 276 | + && x.CompletionTime.Value <= endDate) | |
| 277 | + .Select(x => x.Id) | |
| 278 | + .ToListAsync(); | |
| 279 | + | |
| 280 | + // 查询实体类中没有CompletionTime字段的申请,需要从审批记录中获取完成时间 | |
| 281 | + var entitiesWithoutCompletionTime = await _db.Queryable<LqReimbursementApplicationEntity>() | |
| 282 | + .Where(x => !x.CompletionTime.HasValue) | |
| 283 | + .Select(x => x.Id) | |
| 284 | + .ToListAsync(); | |
| 285 | + | |
| 286 | + var applicationIdsFromRecords = new List<string>(); | |
| 287 | + if (entitiesWithoutCompletionTime.Any()) | |
| 288 | + { | |
| 289 | + // 从审批记录中查询符合条件的申请ID | |
| 290 | + applicationIdsFromRecords = await _db.Queryable<LqReimbursementApprovalRecordEntity>() | |
| 291 | + .Where(x => entitiesWithoutCompletionTime.Contains(x.ApplicationId) && x.ApprovalResult == "通过") | |
| 292 | + .GroupBy(x => x.ApplicationId) | |
| 293 | + .Having(x => SqlFunc.AggregateMax(x.ApprovalTime) >= startDate && | |
| 294 | + SqlFunc.AggregateMax(x.ApprovalTime) <= endDate) | |
| 295 | + .Select(x => x.ApplicationId) | |
| 296 | + .ToListAsync(); | |
| 297 | + } | |
| 298 | + | |
| 299 | + // 合并两种情况的申请ID | |
| 300 | + filteredApplicationIdsByCompletionTime = entitiesWithCompletionTime.Union(applicationIdsFromRecords).ToList(); | |
| 301 | + } | |
| 302 | + | |
| 265 | 303 | var query = _db.Queryable<LqReimbursementApplicationEntity>() |
| 266 | 304 | .WhereIF(!string.IsNullOrEmpty(input.id), p => p.Id.Contains(input.id)) |
| 267 | 305 | .WhereIF(!string.IsNullOrEmpty(input.applicationUserId), p => p.ApplicationUserId.Contains(input.applicationUserId)) |
| ... | ... | @@ -274,7 +312,11 @@ namespace NCC.Extend.LqReimbursementApplication |
| 274 | 312 | .WhereIF(!string.IsNullOrEmpty(input.approveStatus), p => (p.ApprovalStatus ?? p.ApproveStatus).Contains(input.approveStatus)) |
| 275 | 313 | // .WhereIF(queryApproveTime != null, p => p.ApproveTime >= new DateTime(startApproveTime.ToDate().Year, startApproveTime.ToDate().Month, startApproveTime.ToDate().Day, 0, 0, 0)) |
| 276 | 314 | //.WhereIF(queryApproveTime != null, p => p.ApproveTime <= new DateTime(endApproveTime.ToDate().Year, endApproveTime.ToDate().Month, endApproveTime.ToDate().Day, 23, 59, 59)) |
| 277 | - .WhereIF(!string.IsNullOrEmpty(input.purchaseRecordsId), p => p.PurchaseRecordsId.Contains(input.purchaseRecordsId)); | |
| 315 | + .WhereIF(!string.IsNullOrEmpty(input.purchaseRecordsId), p => p.PurchaseRecordsId.Contains(input.purchaseRecordsId)) | |
| 316 | + // 如果提供了完成时间筛选,在主查询中过滤 | |
| 317 | + .WhereIF(filteredApplicationIdsByCompletionTime != null && filteredApplicationIdsByCompletionTime.Any(), p => filteredApplicationIdsByCompletionTime.Contains(p.Id)) | |
| 318 | + // 如果没有符合条件的申请,返回空结果 | |
| 319 | + .WhereIF(filteredApplicationIdsByCompletionTime != null && !filteredApplicationIdsByCompletionTime.Any(), p => false); | |
| 278 | 320 | |
| 279 | 321 | // 处理排序(兼容前端传入的字段名) |
| 280 | 322 | if (string.IsNullOrEmpty(input.sidx)) |
| ... | ... | @@ -343,31 +385,6 @@ namespace NCC.Extend.LqReimbursementApplication |
| 343 | 385 | .GroupBy(x => (string)x.applicationId) |
| 344 | 386 | .ToDictionary(g => g.Key, g => string.Join(", ", g.Select(x => (string)x.approverName))); |
| 345 | 387 | |
| 346 | - // 如果提供了完成时间筛选,需要先查询完成时间,然后过滤 | |
| 347 | - if (queryCompletionTime != null && applicationIds.Any()) | |
| 348 | - { | |
| 349 | - var completionTimeRecords = await _db.Queryable<LqReimbursementApprovalRecordEntity>() | |
| 350 | - .Where(x => applicationIds.Contains(x.ApplicationId) && x.ApprovalResult == "通过") | |
| 351 | - .GroupBy(x => x.ApplicationId) | |
| 352 | - .Select(x => new | |
| 353 | - { | |
| 354 | - ApplicationId = x.ApplicationId, | |
| 355 | - MaxApprovalTime = SqlFunc.AggregateMax(x.ApprovalTime) | |
| 356 | - }) | |
| 357 | - .ToListAsync(); | |
| 358 | - | |
| 359 | - var filteredApplicationIds = completionTimeRecords | |
| 360 | - .Where(x => x.MaxApprovalTime.HasValue && | |
| 361 | - x.MaxApprovalTime.Value >= new DateTime(startCompletionTime.ToDate().Year, startCompletionTime.ToDate().Month, startCompletionTime.ToDate().Day, 0, 0, 0) && | |
| 362 | - x.MaxApprovalTime.Value <= new DateTime(endCompletionTime.ToDate().Year, endCompletionTime.ToDate().Month, endCompletionTime.ToDate().Day, 23, 59, 59)) | |
| 363 | - .Select(x => x.ApplicationId) | |
| 364 | - .ToList(); | |
| 365 | - | |
| 366 | - entities = entities.Where(x => filteredApplicationIds.Contains(x.Id)).ToList(); | |
| 367 | - total = entities.Count; | |
| 368 | - applicationIds = entities.Select(x => x.Id).ToList(); | |
| 369 | - } | |
| 370 | - | |
| 371 | 388 | // 获取门店名称 |
| 372 | 389 | var storeIds = entities.Where(x => !string.IsNullOrEmpty(x.ApplicationStoreId)).Select(x => x.ApplicationStoreId).Distinct().ToList(); |
| 373 | 390 | var storeDict = new Dictionary<string, string>(); | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/LqSalaryService.cs
| ... | ... | @@ -903,6 +903,7 @@ namespace NCC.Extend |
| 903 | 903 | } |
| 904 | 904 | |
| 905 | 905 | // 4.3 最终工资 |
| 906 | + salary.CalculatedGrossSalary = salary.HealthCoachBaseSalary + salary.TotalCommission + salary.HandworkFee + salary.TotalSubsidy - salary.TotalDeduction; | |
| 906 | 907 | salary.ActualSalary = salary.HealthCoachBaseSalary + salary.TotalCommission + salary.HandworkFee + salary.TotalSubsidy - salary.TotalDeduction; |
| 907 | 908 | } |
| 908 | 909 | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/LqStoreDashboardService.cs
| ... | ... | @@ -200,6 +200,25 @@ namespace NCC.Extend |
| 200 | 200 | // 15. 计算人均项目数(项目数/人头数) |
| 201 | 201 | var avgProjectPerHead = headCount > 0 ? projectCount / (decimal)headCount : 0m; |
| 202 | 202 | |
| 203 | + // 16. 计算各分类消耗业绩(生美、医美、科美) | |
| 204 | + var categoryPerformanceSql = $@" | |
| 205 | + SELECT | |
| 206 | + COALESCE(SUM(CASE WHEN COALESCE(xmzl.qt2, '其他') = '生美' THEN CAST(COALESCE(xhpx.F_TotalPrice, xhpx.pxjg * xhpx.F_ProjectNumber, 0) AS DECIMAL(18,2)) ELSE 0 END), 0) as LifeBeautyPerformance, | |
| 207 | + COALESCE(SUM(CASE WHEN COALESCE(xmzl.qt2, '其他') = '医美' THEN CAST(COALESCE(xhpx.F_TotalPrice, xhpx.pxjg * xhpx.F_ProjectNumber, 0) AS DECIMAL(18,2)) ELSE 0 END), 0) as MedicalBeautyPerformance, | |
| 208 | + COALESCE(SUM(CASE WHEN COALESCE(xmzl.qt2, '其他') = '科美' THEN CAST(COALESCE(xhpx.F_TotalPrice, xhpx.pxjg * xhpx.F_ProjectNumber, 0) AS DECIMAL(18,2)) ELSE 0 END), 0) as TechBeautyPerformance | |
| 209 | + FROM lq_xh_pxmx xhpx | |
| 210 | + INNER JOIN lq_xh_hyhk xh ON xhpx.F_ConsumeInfoId = xh.F_Id AND xh.F_IsEffective = 1 | |
| 211 | + LEFT JOIN lq_xmzl xmzl ON xhpx.px = xmzl.F_Id AND xmzl.F_IsEffective = 1 | |
| 212 | + WHERE xhpx.F_IsEffective = 1 | |
| 213 | + AND xh.md = '{input.StoreId}' | |
| 214 | + AND xh.hksj >= '{startDate:yyyy-MM-dd 00:00:00}' | |
| 215 | + AND xh.hksj <= '{endDateTime:yyyy-MM-dd HH:mm:ss}'"; | |
| 216 | + var categoryPerformanceResult = await _db.Ado.SqlQueryAsync<dynamic>(categoryPerformanceSql); | |
| 217 | + var categoryPerformance = categoryPerformanceResult?.FirstOrDefault(); | |
| 218 | + var lifeBeautyPerformance = categoryPerformance != null ? Convert.ToDecimal(categoryPerformance.LifeBeautyPerformance ?? 0) : 0m; | |
| 219 | + var medicalBeautyPerformance = categoryPerformance != null ? Convert.ToDecimal(categoryPerformance.MedicalBeautyPerformance ?? 0) : 0m; | |
| 220 | + var techBeautyPerformance = categoryPerformance != null ? Convert.ToDecimal(categoryPerformance.TechBeautyPerformance ?? 0) : 0m; | |
| 221 | + | |
| 203 | 222 | var result = new StoreDashboardStatisticsOutput |
| 204 | 223 | { |
| 205 | 224 | BillingPerformance = billingAmount, |
| ... | ... | @@ -219,7 +238,10 @@ namespace NCC.Extend |
| 219 | 238 | ProjectCount = Convert.ToInt32(projectCount), |
| 220 | 239 | AvgAmountPerPerson = avgAmountPerPerson, |
| 221 | 240 | AvgAmountPerProject = avgAmountPerProject, |
| 222 | - AvgProjectPerHead = avgProjectPerHead | |
| 241 | + AvgProjectPerHead = avgProjectPerHead, | |
| 242 | + LifeBeautyPerformance = lifeBeautyPerformance, | |
| 243 | + MedicalBeautyPerformance = medicalBeautyPerformance, | |
| 244 | + TechBeautyPerformance = techBeautyPerformance | |
| 223 | 245 | }; |
| 224 | 246 | |
| 225 | 247 | _logger.LogInformation("门店驾驶舱统计数据查询完成,门店ID:{StoreId},开单业绩:{BillingPerformance},消耗业绩:{ConsumePerformance},完成率:{CompletionRate}%,净业绩:{NetPerformance},开单次数:{BillingCount},消耗次数:{ConsumeCount},退卡次数:{RefundCount}", | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/LqTechGeneralManagerSalaryService.cs
| ... | ... | @@ -201,6 +201,24 @@ namespace NCC.Extend |
| 201 | 201 | /// <summary> |
| 202 | 202 | /// 计算科技部总经理工资 |
| 203 | 203 | /// </summary> |
| 204 | + /// <remarks> | |
| 205 | + /// 计算科技部总经理的工资,包括底薪、溯源金额提成、Cell金额提成等。 | |
| 206 | + /// | |
| 207 | + /// 计算规则: | |
| 208 | + /// - 底薪:固定4000元 | |
| 209 | + /// - 溯源金额提成:根据管理的所有门店的溯源金额总和分段累进计算 | |
| 210 | + /// - Cell金额提成:根据管理的所有门店的Cell金额总和分段累进计算 | |
| 211 | + /// | |
| 212 | + /// 数据统计说明: | |
| 213 | + /// - 时间范围:严格按照当月范围(startDate 到 endDate 23:59:59),不包含下个月的数据 | |
| 214 | + /// - 数据查询:使用原生SQL在数据库层面转换和求和,确保与科技部驾驶舱接口的计算方式一致 | |
| 215 | + /// - 门店范围:通过门店的kjb字段确定科技部总经理管理的门店 | |
| 216 | + /// | |
| 217 | + /// 溯源金额和Cell金额的计算方式: | |
| 218 | + /// - 开单金额:从 lq_kd_jksyj 表统计(使用原生SQL CAST转换) | |
| 219 | + /// - 退卡金额:从 lq_hytk_jksyj 表统计(使用SqlSugar聚合查询) | |
| 220 | + /// - 净金额 = 开单金额 - 退卡金额 | |
| 221 | + /// </remarks> | |
| 204 | 222 | /// <param name="year">年份</param> |
| 205 | 223 | /// <param name="month">月份</param> |
| 206 | 224 | /// <returns></returns> |
| ... | ... | @@ -210,6 +228,12 @@ namespace NCC.Extend |
| 210 | 228 | var startDate = new DateTime(year, month, 1); |
| 211 | 229 | var endDate = startDate.AddMonths(1).AddDays(-1); |
| 212 | 230 | var monthStr = $"{year}{month:D2}"; |
| 231 | + // 使用与科技部驾驶舱接口相同的时间范围处理方式 | |
| 232 | + var endDateTime = monthStr == DateTime.Now.ToString("yyyyMM") | |
| 233 | + ? DateTime.Now | |
| 234 | + : endDate.Date.AddHours(23).AddMinutes(59).AddSeconds(59); | |
| 235 | + | |
| 236 | + _logger.LogInformation($"[科技部总经理工资计算] 开始计算,月份: {monthStr}, 时间范围: {startDate.ToString("yyyy-MM-dd HH:mm:ss")} 到 {endDateTime.ToString("yyyy-MM-dd HH:mm:ss")}"); | |
| 213 | 237 | |
| 214 | 238 | // 1. 获取基础数据 |
| 215 | 239 | |
| ... | ... | @@ -229,9 +253,9 @@ namespace NCC.Extend |
| 229 | 253 | var techOrganizeIds = techOrganizeList.Select(x => x.Id).ToList(); |
| 230 | 254 | var techOrganizeDict = techOrganizeList.ToDictionary(x => x.Id, x => x.FullName); |
| 231 | 255 | |
| 232 | - // 1.2 从BASE_USER表查询岗位为"总经理"且组织ID在科技一部或科技二部的员工 | |
| 256 | + // 1.2 从BASE_USER表查询岗位为"总经理"或"科技部总经理"且组织ID在科技一部或科技二部的员工 | |
| 233 | 257 | var techGeneralManagerUserList = await _db.Queryable<UserEntity>() |
| 234 | - .Where(x => x.Gw == "总经理" | |
| 258 | + .Where(x => (x.Gw == "总经理" || x.Gw == "科技部总经理") | |
| 235 | 259 | && techOrganizeIds.Contains(x.OrganizeId) |
| 236 | 260 | && x.DeleteMark == null && x.EnabledMark == 1) |
| 237 | 261 | .Select(x => new { x.Id, x.RealName, x.Account, x.Gw, x.OrganizeId, x.IsOnJob }) |
| ... | ... | @@ -239,13 +263,8 @@ namespace NCC.Extend |
| 239 | 263 | |
| 240 | 264 | if (!techGeneralManagerUserList.Any()) |
| 241 | 265 | { |
| 242 | - // 如果没有科技部总经理员工,直接返回 | |
| 243 | - return; | |
| 244 | - } | |
| 245 | - | |
| 246 | - if (!techGeneralManagerUserList.Any()) | |
| 247 | - { | |
| 248 | - // 如果没有科技部总经理员工,直接返回 | |
| 266 | + // 如果没有科技部总经理员工,记录日志并返回 | |
| 267 | + _logger.LogWarning($"[科技部总经理工资计算] 未找到科技部总经理员工,科技部组织ID: {string.Join(",", techOrganizeIds)}"); | |
| 249 | 268 | return; |
| 250 | 269 | } |
| 251 | 270 | |
| ... | ... | @@ -301,51 +320,110 @@ namespace NCC.Extend |
| 301 | 320 | var storeDetailDict = new Dictionary<string, Dictionary<string, StoreDetailItem>>(); |
| 302 | 321 | |
| 303 | 322 | // 按门店统计溯源和Cell金额(如果有管理的门店) |
| 323 | + // 使用与科技部驾驶舱接口完全相同的查询方式:批量查询所有门店,然后按门店分组 | |
| 304 | 324 | if (allManagedStoreIds.Any()) |
| 305 | 325 | { |
| 326 | + // 时间格式化字符串(使用与科技部驾驶舱接口相同的格式化方式) | |
| 327 | + var startDateStr = startDate.ToString("yyyy-MM-dd HH:mm:ss"); | |
| 328 | + var endDateTimeStr = endDateTime.ToString("yyyy-MM-dd HH:mm:ss"); | |
| 329 | + | |
| 330 | + // 批量查询所有门店的开单溯源金额(与科技部驾驶舱接口保持一致) | |
| 331 | + var allStoreTraceabilityBillingSql = $@" | |
| 332 | + SELECT F_StoreId, COALESCE(SUM(CAST(jksyj AS DECIMAL(18,2))), 0) as Amount | |
| 333 | + FROM lq_kd_jksyj | |
| 334 | + WHERE F_IsEffective = 1 | |
| 335 | + AND F_StoreId IN ('{string.Join("','", allManagedStoreIds)}') | |
| 336 | + AND (F_BeautyType = '溯源系统' OR F_BeautyType = '溯源') | |
| 337 | + AND yjsj >= '{startDateStr}' | |
| 338 | + AND yjsj <= '{endDateTimeStr}' | |
| 339 | + GROUP BY F_StoreId"; | |
| 340 | + var allStoreTraceabilityBillingResult = await _db.Ado.SqlQueryAsync<dynamic>(allStoreTraceabilityBillingSql); | |
| 341 | + var storeTraceabilityBillingDict = new Dictionary<string, decimal>(); | |
| 342 | + if (allStoreTraceabilityBillingResult != null) | |
| 343 | + { | |
| 344 | + foreach (var item in allStoreTraceabilityBillingResult) | |
| 345 | + { | |
| 346 | + var storeId = item.F_StoreId?.ToString() ?? ""; | |
| 347 | + var amount = Convert.ToDecimal(item.Amount ?? 0); | |
| 348 | + storeTraceabilityBillingDict[storeId] = amount; | |
| 349 | + } | |
| 350 | + } | |
| 351 | + | |
| 352 | + // 批量查询所有门店的开单Cell金额(与科技部驾驶舱接口保持一致) | |
| 353 | + var allStoreCellBillingSql = $@" | |
| 354 | + SELECT F_StoreId, COALESCE(SUM(CAST(jksyj AS DECIMAL(18,2))), 0) as Amount | |
| 355 | + FROM lq_kd_jksyj | |
| 356 | + WHERE F_IsEffective = 1 | |
| 357 | + AND F_StoreId IN ('{string.Join("','", allManagedStoreIds)}') | |
| 358 | + AND (F_BeautyType = 'cell' OR F_BeautyType = 'Cell') | |
| 359 | + AND yjsj >= '{startDateStr}' | |
| 360 | + AND yjsj <= '{endDateTimeStr}' | |
| 361 | + GROUP BY F_StoreId"; | |
| 362 | + var allStoreCellBillingResult = await _db.Ado.SqlQueryAsync<dynamic>(allStoreCellBillingSql); | |
| 363 | + var storeCellBillingDict = new Dictionary<string, decimal>(); | |
| 364 | + if (allStoreCellBillingResult != null) | |
| 365 | + { | |
| 366 | + foreach (var item in allStoreCellBillingResult) | |
| 367 | + { | |
| 368 | + var storeId = item.F_StoreId?.ToString() ?? ""; | |
| 369 | + var amount = Convert.ToDecimal(item.Amount ?? 0); | |
| 370 | + storeCellBillingDict[storeId] = amount; | |
| 371 | + } | |
| 372 | + } | |
| 373 | + | |
| 374 | + // 批量查询所有门店的退卡溯源金额 | |
| 375 | + var allStoreTraceabilityRefundList = await _db.Queryable<LqHytkJksyjEntity>() | |
| 376 | + .Where(x => x.IsEffective == 1) | |
| 377 | + .Where(x => allManagedStoreIds.Contains(x.StoreId)) | |
| 378 | + .Where(x => (x.BeautyType == "溯源系统" || x.BeautyType == "溯源")) | |
| 379 | + .Where(x => x.Tksj.HasValue && x.Tksj.Value.Date >= startDate.Date && x.Tksj.Value.Date <= endDate.Date) | |
| 380 | + .GroupBy(x => x.StoreId) | |
| 381 | + .Select(x => new { StoreId = x.StoreId, Amount = SqlFunc.AggregateSum(x.Jksyj) }) | |
| 382 | + .ToListAsync(); | |
| 383 | + var storeTraceabilityRefundDict = new Dictionary<string, decimal>(); | |
| 384 | + if (allStoreTraceabilityRefundList != null) | |
| 385 | + { | |
| 386 | + foreach (var item in allStoreTraceabilityRefundList) | |
| 387 | + { | |
| 388 | + var storeId = item.StoreId ?? ""; | |
| 389 | + var amount = Convert.ToDecimal(item.Amount ?? 0); | |
| 390 | + storeTraceabilityRefundDict[storeId] = amount; | |
| 391 | + } | |
| 392 | + } | |
| 393 | + | |
| 394 | + // 批量查询所有门店的退卡Cell金额 | |
| 395 | + var allStoreCellRefundList = await _db.Queryable<LqHytkJksyjEntity>() | |
| 396 | + .Where(x => x.IsEffective == 1) | |
| 397 | + .Where(x => allManagedStoreIds.Contains(x.StoreId)) | |
| 398 | + .Where(x => (x.BeautyType == "cell" || x.BeautyType == "Cell")) | |
| 399 | + .Where(x => x.Tksj.HasValue && x.Tksj.Value.Date >= startDate.Date && x.Tksj.Value.Date <= endDate.Date) | |
| 400 | + .GroupBy(x => x.StoreId) | |
| 401 | + .Select(x => new { StoreId = x.StoreId, Amount = SqlFunc.AggregateSum(x.Jksyj) }) | |
| 402 | + .ToListAsync(); | |
| 403 | + var storeCellRefundDict = new Dictionary<string, decimal>(); | |
| 404 | + if (allStoreCellRefundList != null) | |
| 405 | + { | |
| 406 | + foreach (var item in allStoreCellRefundList) | |
| 407 | + { | |
| 408 | + var storeId = item.StoreId ?? ""; | |
| 409 | + var amount = Convert.ToDecimal(item.Amount ?? 0); | |
| 410 | + storeCellRefundDict[storeId] = amount; | |
| 411 | + } | |
| 412 | + } | |
| 413 | + | |
| 414 | + // 遍历所有门店,构建门店明细 | |
| 306 | 415 | foreach (var storeId in allManagedStoreIds) |
| 307 | 416 | { |
| 308 | - // 该门店的开单溯源金额(从健康师业绩表统计) | |
| 309 | - var storeTraceabilityBillingList = await _db.Queryable<LqKdJksyjEntity>() | |
| 310 | - .Where(x => x.IsEffective == 1 | |
| 311 | - && x.StoreId == storeId | |
| 312 | - && (x.BeautyType == "溯源系统" || x.BeautyType == "溯源") | |
| 313 | - && x.Yjsj >= startDate && x.Yjsj <= endDate.AddDays(1)) | |
| 314 | - .Select(x => x.Jksyj) | |
| 315 | - .ToListAsync(); | |
| 316 | - | |
| 317 | - var storeTraceabilityBilling = storeTraceabilityBillingList | |
| 318 | - .Where(x => !string.IsNullOrEmpty(x)) | |
| 319 | - .Sum(x => decimal.TryParse(x, out var val) ? val : 0m); | |
| 320 | - | |
| 321 | - // 该门店的退卡溯源金额(从退卡健康师业绩表统计) | |
| 322 | - var storeTraceabilityRefund = await _db.Queryable<LqHytkJksyjEntity>() | |
| 323 | - .Where(x => x.IsEffective == 1 | |
| 324 | - && x.StoreId == storeId | |
| 325 | - && (x.BeautyType == "溯源系统" || x.BeautyType == "溯源") | |
| 326 | - && x.Tksj >= startDate && x.Tksj <= endDate.AddDays(1)) | |
| 327 | - .SumAsync(x => (decimal?)x.Jksyj) ?? 0m; | |
| 328 | - | |
| 329 | - // 该门店的开单Cell金额(从健康师业绩表统计) | |
| 330 | - var storeCellBillingList = await _db.Queryable<LqKdJksyjEntity>() | |
| 331 | - .Where(x => x.IsEffective == 1 | |
| 332 | - && x.StoreId == storeId | |
| 333 | - && (x.BeautyType == "cell" || x.BeautyType == "Cell") | |
| 334 | - && x.Yjsj >= startDate && x.Yjsj <= endDate.AddDays(1)) | |
| 335 | - .Select(x => x.Jksyj) | |
| 336 | - .ToListAsync(); | |
| 337 | - | |
| 338 | - var storeCellBilling = storeCellBillingList | |
| 339 | - .Where(x => !string.IsNullOrEmpty(x)) | |
| 340 | - .Sum(x => decimal.TryParse(x, out var val) ? val : 0m); | |
| 341 | - | |
| 342 | - // 该门店的退卡Cell金额(从退卡健康师业绩表统计) | |
| 343 | - var storeCellRefund = await _db.Queryable<LqHytkJksyjEntity>() | |
| 344 | - .Where(x => x.IsEffective == 1 | |
| 345 | - && x.StoreId == storeId | |
| 346 | - && (x.BeautyType == "cell" || x.BeautyType == "Cell") | |
| 347 | - && x.Tksj >= startDate && x.Tksj <= endDate.AddDays(1)) | |
| 348 | - .SumAsync(x => (decimal?)x.Jksyj) ?? 0m; | |
| 417 | + var storeTraceabilityBilling = storeTraceabilityBillingDict.ContainsKey(storeId) ? storeTraceabilityBillingDict[storeId] : 0m; | |
| 418 | + var storeTraceabilityRefund = storeTraceabilityRefundDict.ContainsKey(storeId) ? storeTraceabilityRefundDict[storeId] : 0m; | |
| 419 | + var storeCellBilling = storeCellBillingDict.ContainsKey(storeId) ? storeCellBillingDict[storeId] : 0m; | |
| 420 | + var storeCellRefund = storeCellRefundDict.ContainsKey(storeId) ? storeCellRefundDict[storeId] : 0m; | |
| 421 | + | |
| 422 | + // 调试日志:记录关键门店的计算结果 | |
| 423 | + if (storeId == "1649328471923847173" || storeId == "1649328471923847175" || storeId == "1649328471923847187") | |
| 424 | + { | |
| 425 | + _logger.LogInformation($"[科技部总经理工资计算] 门店ID: {storeId}, 开单Cell金额: {storeCellBilling}, 退卡Cell金额: {storeCellRefund}, Cell金额: {storeCellBilling - storeCellRefund}"); | |
| 426 | + } | |
| 349 | 427 | |
| 350 | 428 | // 获取该门店属于哪些科技部总经理 |
| 351 | 429 | // 通过门店的kjb字段确定:如果门店的kjb等于科技一部的组织ID,则该门店属于科技一部总经理 |
| ... | ... | @@ -445,6 +523,8 @@ namespace NCC.Extend |
| 445 | 523 | salary.TraceabilityAmount = totalTraceabilityAmount; |
| 446 | 524 | salary.CellAmount = totalCellAmount; |
| 447 | 525 | |
| 526 | + _logger.LogInformation($"[科技部总经理工资计算] 员工: {salary.EmployeeName}, 溯源金额: {totalTraceabilityAmount}, Cell金额: {totalCellAmount}, 门店数: {storeDetails.Count}"); | |
| 527 | + | |
| 448 | 528 | // 2.5 保存门店明细(JSON格式) |
| 449 | 529 | salary.StoreDetail = JsonConvert.SerializeObject(storeDetails); |
| 450 | 530 | |
| ... | ... | @@ -493,6 +573,8 @@ namespace NCC.Extend |
| 493 | 573 | managerStats[managerId] = salary; |
| 494 | 574 | } |
| 495 | 575 | |
| 576 | + _logger.LogInformation($"[科技部总经理工资计算] 共计算了 {managerStats.Count} 个科技部总经理的工资数据"); | |
| 577 | + | |
| 496 | 578 | // 3. 保存数据 |
| 497 | 579 | if (managerStats.Any()) |
| 498 | 580 | { |
| ... | ... | @@ -508,7 +590,12 @@ namespace NCC.Extend |
| 508 | 590 | if (existingDict.ContainsKey(salary.EmployeeId)) |
| 509 | 591 | { |
| 510 | 592 | var existing = existingDict[salary.EmployeeId]; |
| 511 | - if (existing.IsLocked == 1 || existing.EmployeeConfirmStatus == 1) { skippedCount++; continue; } | |
| 593 | + if (existing.IsLocked == 1 || existing.EmployeeConfirmStatus == 1) | |
| 594 | + { | |
| 595 | + _logger.LogWarning($"[科技部总经理工资计算] 跳过更新,员工: {salary.EmployeeName}, IsLocked: {existing.IsLocked}, EmployeeConfirmStatus: {existing.EmployeeConfirmStatus}"); | |
| 596 | + skippedCount++; | |
| 597 | + continue; | |
| 598 | + } | |
| 512 | 599 | salary.Id = existing.Id; |
| 513 | 600 | salary.EmployeeConfirmStatus = existing.EmployeeConfirmStatus; |
| 514 | 601 | salary.EmployeeConfirmTime = existing.EmployeeConfirmTime; |
| ... | ... | @@ -516,6 +603,8 @@ namespace NCC.Extend |
| 516 | 603 | salary.IsLocked = existing.IsLocked; |
| 517 | 604 | salary.CreateTime = existing.CreateTime; |
| 518 | 605 | salary.CreateUser = existing.CreateUser; |
| 606 | + salary.UpdateTime = DateTime.Now; // 强制更新UpdateTime | |
| 607 | + _logger.LogInformation($"[科技部总经理工资计算] 准备更新,员工: {salary.EmployeeName}, 旧Cell金额: {existing.CellAmount}, 新Cell金额: {salary.CellAmount}"); | |
| 519 | 608 | recordsToUpdate.Add(salary); |
| 520 | 609 | } |
| 521 | 610 | else |
| ... | ... | @@ -529,7 +618,15 @@ namespace NCC.Extend |
| 529 | 618 | } |
| 530 | 619 | } |
| 531 | 620 | if (recordsToInsert.Any()) await _db.Insertable(recordsToInsert).ExecuteCommandAsync(); |
| 532 | - if (recordsToUpdate.Any()) await _db.Updateable(recordsToUpdate).ExecuteCommandAsync(); | |
| 621 | + if (recordsToUpdate.Any()) | |
| 622 | + { | |
| 623 | + // 使用IgnoreColumns排除CreateTime和CreateUser,确保其他所有字段都被更新 | |
| 624 | + await _db.Updateable(recordsToUpdate) | |
| 625 | + .IgnoreColumns(x => x.CreateTime) | |
| 626 | + .IgnoreColumns(x => x.CreateUser) | |
| 627 | + .ExecuteCommandAsync(); | |
| 628 | + _logger.LogInformation($"已更新 {recordsToUpdate.Count} 条科技部总经理工资记录(月份:{monthStr})"); | |
| 629 | + } | |
| 533 | 630 | if (skippedCount > 0) _logger.LogWarning($"计算工资时跳过了 {skippedCount} 条已锁定或已确认的记录(月份:{monthStr})"); |
| 534 | 631 | } |
| 535 | 632 | } |
| ... | ... | @@ -626,7 +723,7 @@ namespace NCC.Extend |
| 626 | 723 | public decimal TraceabilityAmount { get; set; } |
| 627 | 724 | public decimal CellBillingAmount { get; set; } |
| 628 | 725 | public decimal CellRefundAmount { get; set; } |
| 629 | - public decimal CellAmount { get; set; } | |
| 726 | + public decimal CellAmount { get; set; } | |
| 630 | 727 | } |
| 631 | 728 | |
| 632 | 729 | #region 员工工资确认 |
| ... | ... | @@ -793,11 +890,11 @@ namespace NCC.Extend |
| 793 | 890 | |
| 794 | 891 | if (lockedCount > 0 || unlockedCount > 0) |
| 795 | 892 | { |
| 796 | - var salariesToUpdate = salaries.Where(s => | |
| 797 | - (input.IsLocked && s.IsLocked == 0) || | |
| 893 | + var salariesToUpdate = salaries.Where(s => | |
| 894 | + (input.IsLocked && s.IsLocked == 0) || | |
| 798 | 895 | (!input.IsLocked && s.IsLocked == 1 && s.EmployeeConfirmStatus != 1) |
| 799 | 896 | ).ToList(); |
| 800 | - | |
| 897 | + | |
| 801 | 898 | if (salariesToUpdate.Any()) |
| 802 | 899 | { |
| 803 | 900 | await _db.Updateable(salariesToUpdate) |
| ... | ... | @@ -809,10 +906,10 @@ namespace NCC.Extend |
| 809 | 906 | var action = input.IsLocked ? "锁定" : "解锁"; |
| 810 | 907 | var count = input.IsLocked ? lockedCount : unlockedCount; |
| 811 | 908 | var message = $"{action}成功:{count}条"; |
| 812 | - | |
| 909 | + | |
| 813 | 910 | if (alreadyLockedCount > 0) |
| 814 | 911 | message += $",跳过{alreadyLockedCount}条(已是{action}状态)"; |
| 815 | - | |
| 912 | + | |
| 816 | 913 | if (skippedCount > 0) |
| 817 | 914 | message += $",跳过{skippedCount}条(已确认的记录不能解锁)"; |
| 818 | 915 | |
| ... | ... | @@ -851,7 +948,7 @@ namespace NCC.Extend |
| 851 | 948 | { |
| 852 | 949 | if (file == null || file.Length == 0) |
| 853 | 950 | throw NCCException.Oh("请选择要上传的Excel文件"); |
| 854 | - | |
| 951 | + | |
| 855 | 952 | var allowedExtensions = new[] { ".xlsx", ".xls" }; |
| 856 | 953 | var fileExtension = Path.GetExtension(file.FileName).ToLowerInvariant(); |
| 857 | 954 | if (!allowedExtensions.Contains(fileExtension)) |
| ... | ... | @@ -901,7 +998,7 @@ namespace NCC.Extend |
| 901 | 998 | |
| 902 | 999 | var firstColumnValue = GetColumnValue(0); |
| 903 | 1000 | bool isOldFormat = !string.IsNullOrWhiteSpace(firstColumnValue) && (firstColumnValue == "员工姓名" || (!long.TryParse(firstColumnValue, out _) && firstColumnValue.Length > 20)); |
| 904 | - | |
| 1001 | + | |
| 905 | 1002 | int employeeNameIndex = isOldFormat ? 0 : 1; |
| 906 | 1003 | int offset = isOldFormat ? 0 : 1; |
| 907 | 1004 | |
| ... | ... | @@ -932,7 +1029,7 @@ namespace NCC.Extend |
| 932 | 1029 | { |
| 933 | 1030 | existing = await _db.Queryable<LqTechGeneralManagerSalaryStatisticsEntity>() |
| 934 | 1031 | .Where(x => x.Id == id).FirstAsync(); |
| 935 | - | |
| 1032 | + | |
| 936 | 1033 | if (existing != null && (existing.IsLocked == 1 || existing.EmployeeConfirmStatus == 1)) |
| 937 | 1034 | { |
| 938 | 1035 | skippedCount++; |
| ... | ... | @@ -1008,7 +1105,7 @@ namespace NCC.Extend |
| 1008 | 1105 | if (user != null) entity.EmployeeId = user.Id; |
| 1009 | 1106 | } |
| 1010 | 1107 | } |
| 1011 | - | |
| 1108 | + | |
| 1012 | 1109 | entity.UpdateTime = DateTime.Now; |
| 1013 | 1110 | if (existing != null) recordsToUpdate.Add(entity); |
| 1014 | 1111 | else recordsToInsert.Add(entity); | ... | ... |
netcore/src/Modularity/Extend/NCC.Extend/LqTechTeacherSalaryService.cs
| ... | ... | @@ -416,7 +416,7 @@ namespace NCC.Extend |
| 416 | 416 | // 总业绩 > 30,000元:只计算2%提成 |
| 417 | 417 | salary.BaseSalary = 0; |
| 418 | 418 | salary.BaseSalaryLevel = 0; |
| 419 | - salary.PerformanceCommissionRate = 2m; | |
| 419 | + salary.PerformanceCommissionRate = 0.02m; // 保存为小数形式,0.02表示2% | |
| 420 | 420 | salary.PerformanceCommissionAmount = salary.TotalPerformance * 0.02m; |
| 421 | 421 | salary.ConsumeCommissionRate = 0; |
| 422 | 422 | salary.ConsumeCommissionAmount = 0; |
| ... | ... | @@ -438,23 +438,45 @@ namespace NCC.Extend |
| 438 | 438 | { |
| 439 | 439 | // 在职员工正常计算 |
| 440 | 440 | |
| 441 | - // 3.1 计算底薪(根据项目数和总业绩) | |
| 442 | - var baseSalaryResult = CalculateBaseSalary(salary.ProjectCount, salary.TotalPerformance); | |
| 443 | - salary.BaseSalary = baseSalaryResult.BaseSalary; | |
| 444 | - salary.BaseSalaryLevel = baseSalaryResult.Level; | |
| 441 | + // 判断是否为T区员工(员工姓名包含"T区") | |
| 442 | + bool isTZoneEmployee = !string.IsNullOrEmpty(salary.EmployeeName) && salary.EmployeeName.Contains("T区"); | |
| 445 | 443 | |
| 446 | - // 3.2 计算业绩提成(分段累进) | |
| 447 | - var performanceCommissionResult = CalculatePerformanceCommission(salary.TotalPerformance); | |
| 448 | - salary.PerformanceCommissionRate = performanceCommissionResult.Rate; | |
| 449 | - salary.PerformanceCommissionAmount = performanceCommissionResult.Amount; | |
| 444 | + if (isTZoneEmployee) | |
| 445 | + { | |
| 446 | + // T区员工:按照开单减去退款之后的业绩统一按照2%提成 | |
| 447 | + // 总业绩 = 开单业绩 - 退卡业绩(已在前面计算) | |
| 448 | + salary.PerformanceCommissionRate = 0.02m; // 保存为小数形式,0.02表示2% | |
| 449 | + salary.PerformanceCommissionAmount = salary.TotalPerformance * 0.02m; | |
| 450 | + salary.ConsumeCommissionRate = 0; | |
| 451 | + salary.ConsumeCommissionAmount = 0; | |
| 452 | + salary.TotalCommission = salary.PerformanceCommissionAmount; | |
| 453 | + // T区员工也计算底薪(根据项目数和总业绩) | |
| 454 | + var baseSalaryResult = CalculateBaseSalary(salary.ProjectCount, salary.TotalPerformance); | |
| 455 | + salary.BaseSalary = baseSalaryResult.BaseSalary; | |
| 456 | + salary.BaseSalaryLevel = baseSalaryResult.Level; | |
| 457 | + } | |
| 458 | + else | |
| 459 | + { | |
| 460 | + // 非T区员工正常计算 | |
| 461 | + | |
| 462 | + // 3.1 计算底薪(根据项目数和总业绩) | |
| 463 | + var baseSalaryResult = CalculateBaseSalary(salary.ProjectCount, salary.TotalPerformance); | |
| 464 | + salary.BaseSalary = baseSalaryResult.BaseSalary; | |
| 465 | + salary.BaseSalaryLevel = baseSalaryResult.Level; | |
| 450 | 466 | |
| 451 | - // 3.3 计算消耗提成(分段累进,可能为负数) | |
| 452 | - var consumeCommissionResult = CalculateConsumeCommission(salary.ConsumeAchievement); | |
| 453 | - salary.ConsumeCommissionRate = consumeCommissionResult.Rate; | |
| 454 | - salary.ConsumeCommissionAmount = consumeCommissionResult.Amount; | |
| 467 | + // 3.2 计算业绩提成(分段累进,门槛改为3万) | |
| 468 | + var performanceCommissionResult = CalculatePerformanceCommission(salary.TotalPerformance); | |
| 469 | + salary.PerformanceCommissionRate = performanceCommissionResult.Rate; | |
| 470 | + salary.PerformanceCommissionAmount = performanceCommissionResult.Amount; | |
| 455 | 471 | |
| 456 | - // 3.4 提成合计 | |
| 457 | - salary.TotalCommission = salary.PerformanceCommissionAmount + salary.ConsumeCommissionAmount; | |
| 472 | + // 3.3 计算消耗提成(新规则:10万门槛,阶梯式) | |
| 473 | + var consumeCommissionResult = CalculateConsumeCommission(salary.ConsumeAchievement); | |
| 474 | + salary.ConsumeCommissionRate = consumeCommissionResult.Rate; | |
| 475 | + salary.ConsumeCommissionAmount = consumeCommissionResult.Amount; | |
| 476 | + | |
| 477 | + // 3.4 提成合计 | |
| 478 | + salary.TotalCommission = salary.PerformanceCommissionAmount + salary.ConsumeCommissionAmount; | |
| 479 | + } | |
| 458 | 480 | } |
| 459 | 481 | |
| 460 | 482 | // 3.5 初始化其他字段(默认值为0) |
| ... | ... | @@ -603,30 +625,30 @@ namespace NCC.Extend |
| 603 | 625 | /// <returns>提成比例和金额</returns> |
| 604 | 626 | /// <remarks> |
| 605 | 627 | /// 提成规则(分段累进式): |
| 606 | - /// 1. 前提条件:业绩必须大于1万才能进行提成 | |
| 628 | + /// 1. 前提条件:整月业绩必须大于等于3万才能进行提成(门槛从1万提高到3万) | |
| 607 | 629 | /// 2. 如果有提成资格后,分段计算: |
| 608 | 630 | /// - 0-7万部分:2%(整个0-7万部分都按2%计算) |
| 609 | 631 | /// - 7万-15万部分:2.5% |
| 610 | 632 | /// - 15万以上部分:3% |
| 611 | 633 | /// |
| 612 | 634 | /// 计算公式(分段累进): |
| 613 | - /// - 如果业绩 ≤ 1万:提成 = 0(无提成资格) | |
| 614 | - /// - 如果 1万 < 业绩 ≤ 7万:提成 = 业绩 × 2% | |
| 635 | + /// - 如果业绩 < 3万:提成 = 0(无提成资格) | |
| 636 | + /// - 如果 3万 ≤ 业绩 ≤ 7万:提成 = 业绩 × 2% | |
| 615 | 637 | /// - 如果 7万 < 业绩 ≤ 15万:提成 = 7万 × 2% + (业绩 - 7万) × 2.5% |
| 616 | 638 | /// - 如果业绩 > 15万:提成 = 7万 × 2% + (15万 - 7万) × 2.5% + (业绩 - 15万) × 3% |
| 617 | 639 | /// |
| 618 | 640 | /// 示例: |
| 619 | - /// - 总业绩 = 5,000元 → 提成 = 0(无提成资格) | |
| 641 | + /// - 总业绩 = 25,000元 → 提成 = 0(无提成资格,未达到3万门槛) | |
| 620 | 642 | /// - 总业绩 = 50,000元 → 提成 = 50,000 × 2% = 1,000元 |
| 621 | 643 | /// - 总业绩 = 100,000元 → 提成 = 70,000 × 2% + (100,000 - 70,000) × 2.5% = 1,400 + 750 = 2,150元 |
| 622 | 644 | /// - 总业绩 = 200,000元 → 提成 = 70,000 × 2% + (150,000 - 70,000) × 2.5% + (200,000 - 150,000) × 3% = 1,400 + 2,000 + 1,500 = 4,900元 |
| 623 | 645 | /// </remarks> |
| 624 | 646 | private (decimal Rate, decimal Amount) CalculatePerformanceCommission(decimal totalPerformance) |
| 625 | 647 | { |
| 626 | - // 提成前提:业绩必须大于1万才能进行提成 | |
| 627 | - if (totalPerformance <= 10000m) | |
| 648 | + // 提成前提:整月业绩必须大于等于3万才能进行提成 | |
| 649 | + if (totalPerformance < 30000m) | |
| 628 | 650 | { |
| 629 | - // ≤ 10,000元 → 0%(无提成资格) | |
| 651 | + // < 30,000元 → 0%(无提成资格) | |
| 630 | 652 | return (0m, 0m); |
| 631 | 653 | } |
| 632 | 654 | |
| ... | ... | @@ -655,43 +677,61 @@ namespace NCC.Extend |
| 655 | 677 | } |
| 656 | 678 | else |
| 657 | 679 | { |
| 658 | - // 业绩 > 1万 且 ≤ 7万:整个业绩按2%计算 | |
| 680 | + // 业绩 ≥ 3万 且 ≤ 7万:整个业绩按2%计算 | |
| 659 | 681 | totalCommission = totalPerformance * 0.02m; |
| 660 | 682 | } |
| 661 | 683 | |
| 662 | - // 计算平均提成比例(用于显示) | |
| 663 | - decimal averageRate = totalCommission > 0 && totalPerformance > 0 ? (totalCommission / totalPerformance) * 100m : 0m; | |
| 684 | + // 计算平均提成比例(保存为小数形式,如0.02表示2%,前端会乘以100显示) | |
| 685 | + decimal averageRate = totalCommission > 0 && totalPerformance > 0 ? (totalCommission / totalPerformance) : 0m; | |
| 664 | 686 | |
| 665 | 687 | return (averageRate, totalCommission); |
| 666 | 688 | } |
| 667 | 689 | |
| 668 | 690 | /// <summary> |
| 669 | - /// 计算消耗提成(分段累进,可能为负数) | |
| 691 | + /// 计算消耗提成(阶梯式,可能为负数) | |
| 670 | 692 | /// </summary> |
| 671 | 693 | /// <param name="consumeAchievement">消耗业绩</param> |
| 672 | 694 | /// <returns>提成比例和金额(金额可能为负数,比例用于显示)</returns> |
| 695 | + /// <remarks> | |
| 696 | + /// 消耗提成规则: | |
| 697 | + /// 1. 未完成10万底标:负激励300元(扣除300元) | |
| 698 | + /// 2. 达到10万条件后,按照阶梯式提成: | |
| 699 | + /// - 1-20万部分:0.5% | |
| 700 | + /// - 超过20万部分:1% | |
| 701 | + /// | |
| 702 | + /// 计算公式(阶梯式): | |
| 703 | + /// - 如果消耗业绩 < 10万:提成 = -300元(扣除300元) | |
| 704 | + /// - 如果消耗业绩 ≥ 10万 且 ≤ 20万:提成 = 消耗业绩 × 0.5% | |
| 705 | + /// - 如果消耗业绩 > 20万:提成 = 20万 × 0.5% + (消耗业绩 - 20万) × 1% | |
| 706 | + /// | |
| 707 | + /// 示例: | |
| 708 | + /// - 消耗业绩 = 50,000元 → 提成 = -300元(未完成10万底标) | |
| 709 | + /// - 消耗业绩 = 100,000元 → 提成 = 100,000 × 0.5% = 500元 | |
| 710 | + /// - 消耗业绩 = 150,000元 → 提成 = 150,000 × 0.5% = 750元 | |
| 711 | + /// - 消耗业绩 = 250,000元 → 提成 = 200,000 × 0.5% + (250,000 - 200,000) × 1% = 1,000 + 500 = 1,500元 | |
| 712 | + /// </remarks> | |
| 673 | 713 | private (decimal Rate, decimal Amount) CalculateConsumeCommission(decimal consumeAchievement) |
| 674 | 714 | { |
| 675 | - if (consumeAchievement < 80000m) | |
| 715 | + if (consumeAchievement < 100000m) | |
| 676 | 716 | { |
| 677 | - // < 80,000元 → 扣除300元(负数) | |
| 717 | + // < 100,000元(未完成10万底标)→ 扣除300元(负数) | |
| 678 | 718 | // 比例显示为0,金额为-300 |
| 679 | 719 | return (0m, -300m); |
| 680 | 720 | } |
| 681 | - else if (consumeAchievement < 100000m) | |
| 682 | - { | |
| 683 | - // 80,000-100,000元 → 0.5% | |
| 684 | - return (0.5m, consumeAchievement * 0.005m); | |
| 685 | - } | |
| 686 | - else if (consumeAchievement < 200000m) | |
| 721 | + else if (consumeAchievement <= 200000m) | |
| 687 | 722 | { |
| 688 | - // 100,000-200,000元 → 0.5% | |
| 689 | - return (0.5m, consumeAchievement * 0.005m); | |
| 723 | + // ≥ 100,000元 且 ≤ 200,000元 → 1-20万部分按0.5% | |
| 724 | + return (0.005m, consumeAchievement * 0.005m); // 保存为小数形式,0.005表示0.5% | |
| 690 | 725 | } |
| 691 | 726 | else |
| 692 | 727 | { |
| 693 | - // > 200,000元 → 1% | |
| 694 | - return (1m, consumeAchievement * 0.01m); | |
| 728 | + // > 200,000元 → 阶梯式:1-20万部分0.5%,超过20万部分1% | |
| 729 | + decimal part1 = 200000m * 0.005m; // 20万 × 0.5% = 1,000元 | |
| 730 | + decimal part2 = (consumeAchievement - 200000m) * 0.01m; // 超过20万部分 × 1% | |
| 731 | + decimal totalCommission = part1 + part2; | |
| 732 | + // 计算平均比例(保存为小数形式,前端会乘以100显示) | |
| 733 | + decimal averageRate = totalCommission > 0 && consumeAchievement > 0 ? (totalCommission / consumeAchievement) : 0m; | |
| 734 | + return (averageRate, totalCommission); | |
| 695 | 735 | } |
| 696 | 736 | } |
| 697 | 737 | ... | ... |
netcore/src/Modularity/System/NCC.System.Entitys/Mapper/SystemMapper.cs
| ... | ... | @@ -2,6 +2,7 @@ |
| 2 | 2 | using NCC.System.Entitys.Dto.System.DbBackup; |
| 3 | 3 | using NCC.System.Entitys.Dto.System.Province; |
| 4 | 4 | using NCC.System.Entitys.Model.System.DataBase; |
| 5 | +using NCC.System.Entitys.Model.Permission.UsersCurrent; | |
| 5 | 6 | using NCC.System.Entitys.System; |
| 6 | 7 | using Mapster; |
| 7 | 8 | using SqlSugar; |
| ... | ... | @@ -51,6 +52,8 @@ namespace NCC.System.Entitys.Mapper |
| 51 | 52 | .Map(dest => dest.dataLength, src => src.Length.ToString()) |
| 52 | 53 | .Map(dest => dest.primaryKey, src => src.IsPrimarykey ? 1 : 0) |
| 53 | 54 | .Map(dest => dest.allowNull, src => src.IsNullable ? 1 : 0); |
| 55 | + config.ForType<ModuleEntity, UsersCurrentAuthorizeMoldel>() | |
| 56 | + .Map(dest => dest.description, src => src.Description); | |
| 54 | 57 | } |
| 55 | 58 | } |
| 56 | 59 | } | ... | ... |
netcore/src/Modularity/System/NCC.System.Entitys/Model/Permission/UsersCurrent/UsersCurrentAuthorizeMoldel.cs
netcore/src/Modularity/System/NCC.System.Interfaces/Permission/IAuthorizeService.cs
| ... | ... | @@ -46,6 +46,14 @@ namespace NCC.System.Interfaces.Permission |
| 46 | 46 | Task<List<ModuleDataAuthorizeSchemeEntity>> GetCurrentUserResourceAuthorize(string userId, bool isAdmin); |
| 47 | 47 | |
| 48 | 48 | /// <summary> |
| 49 | + /// 当前用户App模块权限 | |
| 50 | + /// </summary> | |
| 51 | + /// <param name="userId">用户ID</param> | |
| 52 | + /// <param name="isAdmin">是否超管</param> | |
| 53 | + /// <returns></returns> | |
| 54 | + Task<List<ModuleEntity>> GetCurrentUserAppModuleAuthorize(string userId, bool isAdmin); | |
| 55 | + | |
| 56 | + /// <summary> | |
| 49 | 57 | /// 获取权限项ids |
| 50 | 58 | /// </summary> |
| 51 | 59 | /// <param name="roleId">角色id</param> | ... | ... |
netcore/src/Modularity/System/NCC.System/Service/Permission/AuthorizeService.cs
| ... | ... | @@ -864,6 +864,63 @@ namespace NCC.System.Service.Permission |
| 864 | 864 | } |
| 865 | 865 | |
| 866 | 866 | /// <summary> |
| 867 | + /// 当前用户App模块权限 | |
| 868 | + /// </summary> | |
| 869 | + /// <param name="userId">用户ID</param> | |
| 870 | + /// <param name="isAdmin">是否超管</param> | |
| 871 | + /// <returns></returns> | |
| 872 | + [NonAction] | |
| 873 | + public async Task<List<ModuleEntity>> GetCurrentUserAppModuleAuthorize(string userId, bool isAdmin) | |
| 874 | + { | |
| 875 | + var output = new List<ModuleEntity>(); | |
| 876 | + if (!isAdmin) | |
| 877 | + { | |
| 878 | + // 获取用户角色 | |
| 879 | + var user = _userRepository.FirstOrDefault(u => u.Id == userId && u.DeleteMark == null); | |
| 880 | + if (user == null || string.IsNullOrEmpty(user.RoleId)) return output; | |
| 881 | + | |
| 882 | + var roleArray = user.RoleId.Split(','); | |
| 883 | + // 验证角色是否启用且未删除 | |
| 884 | + var roleId = await _roleRepository.Entities.In(r => r.Id, roleArray) | |
| 885 | + .Where(r => r.EnabledMark.Equals(1) && r.DeleteMark == null) | |
| 886 | + .Select(r => r.Id) | |
| 887 | + .ToListAsync(); | |
| 888 | + | |
| 889 | + if (roleId.Count == 0) return output; | |
| 890 | + | |
| 891 | + // 获取角色拥有的模块权限项ID | |
| 892 | + var items = await _authorizeRepository.Entities | |
| 893 | + .In(a => a.ObjectId, roleId) | |
| 894 | + .Where(a => a.ItemType == "module") | |
| 895 | + .GroupBy(it => new { it.ItemId }) | |
| 896 | + .Select(it => new { it.ItemId }) | |
| 897 | + .ToListAsync(); | |
| 898 | + | |
| 899 | + if (items.Count == 0) return output; | |
| 900 | + | |
| 901 | + // 获取模块信息,并过滤Category为"App"的模块 | |
| 902 | + output = await _moduleRepository.Entities | |
| 903 | + .In(m => m.Id, items.Select(it => it.ItemId).ToArray()) | |
| 904 | + .Where(a => a.EnabledMark.Equals(1) | |
| 905 | + && a.DeleteMark == null | |
| 906 | + && a.Category == "App") | |
| 907 | + .OrderBy(o => o.SortCode) | |
| 908 | + .ToListAsync(); | |
| 909 | + } | |
| 910 | + else | |
| 911 | + { | |
| 912 | + // 管理员返回所有App模块 | |
| 913 | + output = await _moduleRepository | |
| 914 | + .Where(a => a.EnabledMark.Equals(1) | |
| 915 | + && a.DeleteMark == null | |
| 916 | + && a.Category == "App") | |
| 917 | + .OrderBy(o => o.SortCode) | |
| 918 | + .ToListAsync(); | |
| 919 | + } | |
| 920 | + return output; | |
| 921 | + } | |
| 922 | + | |
| 923 | + /// <summary> | |
| 867 | 924 | /// 当前用户模块权限资源 |
| 868 | 925 | /// </summary> |
| 869 | 926 | /// <param name="userId">用户ID</param> | ... | ... |
netcore/src/Modularity/System/NCC.System/Service/Permission/UsersCurrentService.cs
| ... | ... | @@ -156,6 +156,46 @@ namespace NCC.System.Service.Permission |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | /// <summary> |
| 159 | + /// 获取当前用户App权限 | |
| 160 | + /// </summary> | |
| 161 | + /// <remarks> | |
| 162 | + /// 获取当前登录用户的App权限列表,根据用户的角色获取对应的App模块权限 | |
| 163 | + /// | |
| 164 | + /// 权限获取逻辑: | |
| 165 | + /// 1. 获取用户关联的角色ID列表 | |
| 166 | + /// 2. 验证角色是否启用且未删除 | |
| 167 | + /// 3. 根据角色ID从权限表中获取模块权限项 | |
| 168 | + /// 4. 过滤Category为"App"的模块 | |
| 169 | + /// 5. 返回树形结构的App权限列表 | |
| 170 | + /// | |
| 171 | + /// 注意事项: | |
| 172 | + /// - 管理员用户返回所有App权限 | |
| 173 | + /// - 普通用户只返回其角色拥有的App权限 | |
| 174 | + /// - 只返回启用且未删除的模块 | |
| 175 | + /// </remarks> | |
| 176 | + /// <returns>App权限树形列表</returns> | |
| 177 | + /// <response code="200">成功返回App权限列表</response> | |
| 178 | + [HttpGet("AppAuthorize")] | |
| 179 | + public async Task<dynamic> GetAppAuthorize() | |
| 180 | + { | |
| 181 | + var userId = _userManager.UserId; | |
| 182 | + var isAdmin = _userManager.IsAdministrator; | |
| 183 | + | |
| 184 | + // 获取App模块权限列表 | |
| 185 | + var appModuleList = await _authorizeService.GetCurrentUserAppModuleAuthorize(userId, isAdmin); | |
| 186 | + | |
| 187 | + if (appModuleList.Count == 0) | |
| 188 | + { | |
| 189 | + return new List<UsersCurrentAuthorizeMoldel>(); | |
| 190 | + } | |
| 191 | + | |
| 192 | + // 转换为树形结构 | |
| 193 | + var appModuleTree = appModuleList.Adapt<List<UsersCurrentAuthorizeMoldel>>().ToTree("-1"); | |
| 194 | + | |
| 195 | + return appModuleTree; | |
| 196 | + } | |
| 197 | + | |
| 198 | + /// <summary> | |
| 159 | 199 | /// 获取系统日志 |
| 160 | 200 | /// </summary> |
| 161 | 201 | /// <param name="input">参数</param> | ... | ... |
scripts/test/test_tech_gm_cell_amount.sh
0 → 100755
| 1 | +#!/bin/bash | |
| 2 | + | |
| 3 | +echo "=== 测试科技部总经理Cell金额计算 ===" | |
| 4 | +echo "" | |
| 5 | + | |
| 6 | +# 1. 获取Token | |
| 7 | +echo "1. 获取Token..." | |
| 8 | +TOKEN=$(curl -s -X POST "http://localhost:2011/api/oauth/Login" \ | |
| 9 | + -H "Content-Type: application/x-www-form-urlencoded" \ | |
| 10 | + -d "account=admin&password=e10adc3949ba59abbe56e057f20f883e" | \ | |
| 11 | + python3 -c "import sys, json; data = json.load(sys.stdin); print(data.get('data', {}).get('token', ''))") | |
| 12 | + | |
| 13 | +if [ -z "$TOKEN" ]; then | |
| 14 | + echo "❌ 获取Token失败" | |
| 15 | + exit 1 | |
| 16 | +fi | |
| 17 | +echo "✅ Token获取成功" | |
| 18 | +echo "" | |
| 19 | + | |
| 20 | +# 2. 查询计算前的数据 | |
| 21 | +echo "2. 查询计算前的数据..." | |
| 22 | +BEFORE_CELL=$(mysql -h127.0.0.1 -uroot -p123456 lqerp_dev -sN -e \ | |
| 23 | + "SELECT F_CellAmount FROM lq_tech_general_manager_salary_statistics WHERE F_EmployeeName LIKE '%夏萍%' AND F_StatisticsMonth = '202512'") | |
| 24 | +BEFORE_UPDATE_TIME=$(mysql -h127.0.0.1 -uroot -p123456 lqerp_dev -sN -e \ | |
| 25 | + "SELECT F_UpdateTime FROM lq_tech_general_manager_salary_statistics WHERE F_EmployeeName LIKE '%夏萍%' AND F_StatisticsMonth = '202512'") | |
| 26 | +echo "计算前 Cell金额: $BEFORE_CELL" | |
| 27 | +echo "计算前 UpdateTime: $BEFORE_UPDATE_TIME" | |
| 28 | +echo "" | |
| 29 | + | |
| 30 | +# 3. 调用计算接口 | |
| 31 | +echo "3. 调用计算接口..." | |
| 32 | +RESULT=$(curl -s -X POST "http://localhost:2011/api/Extend/lqtechgeneralmanagersalary/calculate/tech-general-manager?year=2025&month=12" \ | |
| 33 | + -H "Authorization: $TOKEN") | |
| 34 | +echo "响应: $RESULT" | |
| 35 | +echo "" | |
| 36 | + | |
| 37 | +# 4. 等待2秒 | |
| 38 | +echo "4. 等待2秒..." | |
| 39 | +sleep 2 | |
| 40 | +echo "" | |
| 41 | + | |
| 42 | +# 5. 查询计算后的数据 | |
| 43 | +echo "5. 查询计算后的数据..." | |
| 44 | +AFTER_CELL=$(mysql -h127.0.0.1 -uroot -p123456 lqerp_dev -sN -e \ | |
| 45 | + "SELECT F_CellAmount FROM lq_tech_general_manager_salary_statistics WHERE F_EmployeeName LIKE '%夏萍%' AND F_StatisticsMonth = '202512'") | |
| 46 | +AFTER_UPDATE_TIME=$(mysql -h127.0.0.1 -uroot -p123456 lqerp_dev -sN -e \ | |
| 47 | + "SELECT F_UpdateTime FROM lq_tech_general_manager_salary_statistics WHERE F_EmployeeName LIKE '%夏萍%' AND F_StatisticsMonth = '202512'") | |
| 48 | +echo "计算后 Cell金额: $AFTER_CELL" | |
| 49 | +echo "计算后 UpdateTime: $AFTER_UPDATE_TIME" | |
| 50 | +echo "" | |
| 51 | + | |
| 52 | +# 6. 验证结果 | |
| 53 | +echo "6. 验证结果..." | |
| 54 | +EXPECTED_CELL="69838.00" | |
| 55 | +if [ "$AFTER_CELL" == "$EXPECTED_CELL" ]; then | |
| 56 | + echo "✅ Cell金额正确: $AFTER_CELL (预期: $EXPECTED_CELL)" | |
| 57 | +else | |
| 58 | + echo "❌ Cell金额不正确: $AFTER_CELL (预期: $EXPECTED_CELL)" | |
| 59 | +fi | |
| 60 | + | |
| 61 | +if [ "$AFTER_UPDATE_TIME" != "$BEFORE_UPDATE_TIME" ]; then | |
| 62 | + echo "✅ UpdateTime已更新" | |
| 63 | +else | |
| 64 | + echo "⚠️ UpdateTime未更新" | |
| 65 | +fi | |
| 66 | +echo "" | |
| 67 | + | |
| 68 | +# 7. 查询门店明细 | |
| 69 | +echo "7. 查询门店明细..." | |
| 70 | +mysql -h127.0.0.1 -uroot -p123456 lqerp_dev -e \ | |
| 71 | + "SELECT JSON_EXTRACT(F_StoreDetail, '\$[2].StoreName') as StoreName, \ | |
| 72 | + JSON_EXTRACT(F_StoreDetail, '\$[2].CellAmount') as CellAmount \ | |
| 73 | + FROM lq_tech_general_manager_salary_statistics \ | |
| 74 | + WHERE F_EmployeeName LIKE '%夏萍%' AND F_StatisticsMonth = '202512'" | |
| 75 | +echo "" | |
| 76 | + | |
| 77 | +echo "=== 测试完成 ===" | ... | ... |
scripts/test/test_tech_gm_cell_amount_final.sh
0 → 100755
| 1 | +#!/bin/bash | |
| 2 | + | |
| 3 | +echo "=== 科技部总经理Cell金额计算完整测试 ===" | |
| 4 | +echo "" | |
| 5 | + | |
| 6 | +# 1. 获取Token | |
| 7 | +echo "1. 获取Token..." | |
| 8 | +TOKEN=$(curl -s -X POST "http://localhost:2011/api/oauth/Login" \ | |
| 9 | + -H "Content-Type: application/x-www-form-urlencoded" \ | |
| 10 | + -d "account=admin&password=e10adc3949ba59abbe56e057f20f883e" | \ | |
| 11 | + python3 -c "import sys, json; data = json.load(sys.stdin); print(data.get('data', {}).get('token', ''))") | |
| 12 | + | |
| 13 | +if [ -z "$TOKEN" ]; then | |
| 14 | + echo "❌ 获取Token失败" | |
| 15 | + exit 1 | |
| 16 | +fi | |
| 17 | +echo "✅ Token获取成功: ${TOKEN:0:50}..." | |
| 18 | +echo "" | |
| 19 | + | |
| 20 | +# 2. 查询计算前的数据 | |
| 21 | +echo "2. 查询计算前的数据..." | |
| 22 | +BEFORE_CELL=$(mysql -h127.0.0.1 -uroot -p123456 lqerp_dev -sN -e \ | |
| 23 | + "SELECT F_CellAmount FROM lq_tech_general_manager_salary_statistics WHERE F_EmployeeName LIKE '%夏萍%' AND F_StatisticsMonth = '202512'") | |
| 24 | +BEFORE_UPDATE_TIME=$(mysql -h127.0.0.1 -uroot -p123456 lqerp_dev -sN -e \ | |
| 25 | + "SELECT F_UpdateTime FROM lq_tech_general_manager_salary_statistics WHERE F_EmployeeName LIKE '%夏萍%' AND F_StatisticsMonth = '202512'") | |
| 26 | +echo "计算前 Cell金额: $BEFORE_CELL" | |
| 27 | +echo "计算前 UpdateTime: $BEFORE_UPDATE_TIME" | |
| 28 | +echo "" | |
| 29 | + | |
| 30 | +# 3. 调用计算接口 | |
| 31 | +echo "3. 调用计算接口..." | |
| 32 | +RESPONSE=$(curl -s -w "\nHTTP_CODE:%{http_code}" -X POST \ | |
| 33 | + "http://localhost:2011/api/Extend/lqtechgeneralmanagersalary/calculate/tech-general-manager?year=2025&month=12" \ | |
| 34 | + -H "Authorization: $TOKEN") | |
| 35 | +HTTP_CODE=$(echo "$RESPONSE" | grep "HTTP_CODE" | cut -d: -f2) | |
| 36 | +BODY=$(echo "$RESPONSE" | sed '/HTTP_CODE/d') | |
| 37 | + | |
| 38 | +echo "HTTP状态码: $HTTP_CODE" | |
| 39 | +if [ "$HTTP_CODE" = "200" ]; then | |
| 40 | + echo "响应: $BODY" | python3 -m json.tool 2>/dev/null || echo "响应: $BODY" | |
| 41 | +else | |
| 42 | + echo "❌ 接口调用失败" | |
| 43 | + echo "响应: $BODY" | |
| 44 | +fi | |
| 45 | +echo "" | |
| 46 | + | |
| 47 | +# 4. 等待3秒 | |
| 48 | +echo "4. 等待3秒..." | |
| 49 | +sleep 3 | |
| 50 | +echo "" | |
| 51 | + | |
| 52 | +# 5. 查询计算后的数据 | |
| 53 | +echo "5. 查询计算后的数据..." | |
| 54 | +AFTER_CELL=$(mysql -h127.0.0.1 -uroot -p123456 lqerp_dev -sN -e \ | |
| 55 | + "SELECT F_CellAmount FROM lq_tech_general_manager_salary_statistics WHERE F_EmployeeName LIKE '%夏萍%' AND F_StatisticsMonth = '202512'") | |
| 56 | +AFTER_UPDATE_TIME=$(mysql -h127.0.0.1 -uroot -p123456 lqerp_dev -sN -e \ | |
| 57 | + "SELECT F_UpdateTime FROM lq_tech_general_manager_salary_statistics WHERE F_EmployeeName LIKE '%夏萍%' AND F_StatisticsMonth = '202512'") | |
| 58 | +echo "计算后 Cell金额: $AFTER_CELL" | |
| 59 | +echo "计算后 UpdateTime: $AFTER_UPDATE_TIME" | |
| 60 | +echo "" | |
| 61 | + | |
| 62 | +# 6. 验证结果 | |
| 63 | +echo "6. 验证结果..." | |
| 64 | +EXPECTED_CELL="69838.00" | |
| 65 | +if [ "$AFTER_CELL" = "$EXPECTED_CELL" ]; then | |
| 66 | + echo "✅ Cell金额正确: $AFTER_CELL (预期: $EXPECTED_CELL)" | |
| 67 | +else | |
| 68 | + echo "❌ Cell金额不正确: $AFTER_CELL (预期: $EXPECTED_CELL)" | |
| 69 | +fi | |
| 70 | + | |
| 71 | +if [ "$AFTER_UPDATE_TIME" != "$BEFORE_UPDATE_TIME" ]; then | |
| 72 | + echo "✅ UpdateTime已更新" | |
| 73 | +else | |
| 74 | + echo "⚠️ UpdateTime未更新" | |
| 75 | +fi | |
| 76 | +echo "" | |
| 77 | + | |
| 78 | +echo "=== 测试完成 ===" | ... | ... |