保存进度!

This commit is contained in:
Kane Wang 2023-11-21 19:21:01 +08:00
parent 84b2e906f3
commit 0c89df8c34
8 changed files with 88 additions and 56 deletions

View File

@ -22,13 +22,13 @@
"@babel/eslint-parser": "^7.23.3", "@babel/eslint-parser": "^7.23.3",
"@rushstack/eslint-patch": "^1.5.1", "@rushstack/eslint-patch": "^1.5.1",
"@typescript-eslint/eslint-plugin": "^6.11.0", "@typescript-eslint/eslint-plugin": "^6.11.0",
"@vitejs/plugin-vue": "^4.4.1", "@vitejs/plugin-vue": "^4.5.0",
"@vue/cli-plugin-eslint": "^5.0.8", "@vue/cli-plugin-eslint": "^5.0.8",
"@vue/eslint-config-typescript": "^12.0.0", "@vue/eslint-config-typescript": "^12.0.0",
"axios": "^1.6.1", "axios": "^1.6.2",
"babel": "^6.23.0", "babel": "^6.23.0",
"eslint-config-recommended": "^4.1.0", "eslint-config-recommended": "^4.1.0",
"eslint-config-standard-with-typescript": "^39.1.1", "eslint-config-standard-with-typescript": "^40.0.0",
"eslint-plugin-vue": "^9.18.1", "eslint-plugin-vue": "^9.18.1",
"node-sass": "^9.0.0", "node-sass": "^9.0.0",
"sass": "^1.69.5", "sass": "^1.69.5",
@ -2041,15 +2041,15 @@
} }
}, },
"node_modules/@vitejs/plugin-vue": { "node_modules/@vitejs/plugin-vue": {
"version": "4.4.1", "version": "4.5.0",
"resolved": "https://registry.npmmirror.com/@vitejs/plugin-vue/-/plugin-vue-4.4.1.tgz", "resolved": "https://registry.npmmirror.com/@vitejs/plugin-vue/-/plugin-vue-4.5.0.tgz",
"integrity": "sha512-HCQG8VDFDM7YDAdcj5QI5DvUi+r6xvo9LgvYdk7LSkUNwdpempdB5horkMSZsbdey9Ywsf5aaU8kEPw9M5kREA==", "integrity": "sha512-a2WSpP8X8HTEww/U00bU4mX1QpLINNuz/2KMNpLsdu3BzOpak3AGI1CJYBTXcc4SPhaD0eNRUp7IyQK405L5dQ==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "^14.18.0 || >=16.0.0" "node": "^14.18.0 || >=16.0.0"
}, },
"peerDependencies": { "peerDependencies": {
"vite": "^4.0.0", "vite": "^4.0.0 || ^5.0.0",
"vue": "^3.2.25" "vue": "^3.2.25"
} }
}, },
@ -3248,9 +3248,9 @@
} }
}, },
"node_modules/axios": { "node_modules/axios": {
"version": "1.6.1", "version": "1.6.2",
"resolved": "https://registry.npmmirror.com/axios/-/axios-1.6.1.tgz", "resolved": "https://registry.npmmirror.com/axios/-/axios-1.6.2.tgz",
"integrity": "sha512-vfBmhDpKafglh0EldBEbVuoe7DyAavGSLWhuSm5ZSEKQnHhBf0xAAwybbNH1IkrJNGnS/VG4I5yxig1pCEXE4g==", "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"follow-redirects": "^1.15.0", "follow-redirects": "^1.15.0",
@ -6777,9 +6777,9 @@
} }
}, },
"node_modules/eslint-config-standard-with-typescript": { "node_modules/eslint-config-standard-with-typescript": {
"version": "39.1.1", "version": "40.0.0",
"resolved": "https://registry.npmmirror.com/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-39.1.1.tgz", "resolved": "https://registry.npmmirror.com/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-40.0.0.tgz",
"integrity": "sha512-t6B5Ep8E4I18uuoYeYxINyqcXb2UbC0SOOTxRtBSt2JUs+EzeXbfe2oaiPs71AIdnoWhXDO2fYOHz8df3kV84A==", "integrity": "sha512-GXUJcwIXiTQaS3H4etv8a1lejVVdZYaxZNz3g7vt6GoJosQqMTurbmSC4FVGyHiGT/d1TjFr3+47A3xsHhsG+Q==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/parser": "^6.4.0", "@typescript-eslint/parser": "^6.4.0",

View File

@ -23,13 +23,13 @@
"@babel/eslint-parser": "^7.23.3", "@babel/eslint-parser": "^7.23.3",
"@rushstack/eslint-patch": "^1.5.1", "@rushstack/eslint-patch": "^1.5.1",
"@typescript-eslint/eslint-plugin": "^6.11.0", "@typescript-eslint/eslint-plugin": "^6.11.0",
"@vitejs/plugin-vue": "^4.4.1", "@vitejs/plugin-vue": "^4.5.0",
"@vue/cli-plugin-eslint": "^5.0.8", "@vue/cli-plugin-eslint": "^5.0.8",
"@vue/eslint-config-typescript": "^12.0.0", "@vue/eslint-config-typescript": "^12.0.0",
"axios": "^1.6.1", "axios": "^1.6.2",
"babel": "^6.23.0", "babel": "^6.23.0",
"eslint-config-recommended": "^4.1.0", "eslint-config-recommended": "^4.1.0",
"eslint-config-standard-with-typescript": "^39.1.1", "eslint-config-standard-with-typescript": "^40.0.0",
"eslint-plugin-vue": "^9.18.1", "eslint-plugin-vue": "^9.18.1",
"node-sass": "^9.0.0", "node-sass": "^9.0.0",
"sass": "^1.69.5", "sass": "^1.69.5",

View File

@ -46,7 +46,7 @@
</div> </div>
<el-upload <el-upload
drag drag
action="http://222.76.244.118:11101/desktop_archievement_backend/file/file-upload.do" :action="ui.urlFileUpload"
name="files" name="files"
:show-file-list="false" :show-file-list="false"
:data="ui.uploadParameters" :data="ui.uploadParameters"
@ -62,7 +62,7 @@
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { reactive, ref, onBeforeMount } from "vue"; import { reactive, onBeforeMount } from "vue";
import { import {
type BIReportType, type BIReportType,
type ImportBIReportRequest, type ImportBIReportRequest,
@ -70,6 +70,7 @@ import {
type ImportBIReportResponseHandler, type ImportBIReportResponseHandler,
importBIReport importBIReport
} from "@/utils/BIReport.js"; } from "@/utils/BIReport.js";
import { API_URL } from "@/utils/api/config.js";
import { type FileUploadResponse } from "@/utils/fileUpload.js"; import { type FileUploadResponse } from "@/utils/fileUpload.js";
// import { UploadFilled } from "@element-plus/icons-vue"; // import { UploadFilled } from "@element-plus/icons-vue";
import { type UploadProps, type UploadFile, type UploadFiles, ElMessage, ElMessageBox } from "element-plus"; import { type UploadProps, type UploadFile, type UploadFiles, ElMessage, ElMessageBox } from "element-plus";
@ -84,6 +85,7 @@ interface UI
hasCaption: boolean, hasCaption: boolean,
uploadParameters: any, uploadParameters: any,
showFileList: boolean, showFileList: boolean,
urlFileUpload: string,
} }
export default { export default {
@ -118,12 +120,13 @@ export default {
reportTypeName: "当月个车续保率跟踪报表【机构】", reportTypeName: "当月个车续保率跟踪报表【机构】",
},], },],
sheetIndex: 0, sheetIndex: 0,
firstRow: 2, firstRow: 1,
hasCaption: true, hasCaption: true,
uploadParameters: { uploadParameters: {
"task-name": "1234", "task-name": "1234",
}, },
showFileList: false, showFileList: false,
urlFileUpload: API_URL.URL_UPLOAD_FILE,
}); });
/** /**

View File

@ -14,6 +14,7 @@
<el-button <el-button
type="warning" type="warning"
icon="upload" icon="upload"
@click="showUploadFileDialog"
> >
上传 上传
</el-button> </el-button>
@ -96,6 +97,20 @@
@size-change="onTablePageSizeChange" @size-change="onTablePageSizeChange"
/> />
</div> </div>
<div
class="upload-dialog-wrapper"
>
<el-dialog
v-model="ui.showUploadDialog"
title="上传报表"
width="600px"
:close-on-click-modal="false"
:close-on-press-escape="false"
:show-close="true"
>
<BiDataUploadView :report-type="3" />
</el-dialog>
</div>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
@ -107,11 +122,12 @@ import {
queryDepartmentRenewalRateData queryDepartmentRenewalRateData
} from "@/utils/BIReport.js"; } from "@/utils/BIReport.js";
import { ElMessageBox, ElMessage } from "element-plus"; import { ElMessageBox, ElMessage } from "element-plus";
import BiDataUploadView from "@/views/data/bi/BiDataUploadView.vue";
interface UI interface UI
{ {
showUI: boolean; showUI: boolean;
showUploadFileDialog: boolean; showUploadDialog: boolean;
tablePageSize: number; tablePageSize: number;
tableCurrentPageIndex: number; tableCurrentPageIndex: number;
BIDepartmentRenewalRateData: BIDepartmentRenewalRateRecord[]; BIDepartmentRenewalRateData: BIDepartmentRenewalRateRecord[];
@ -119,11 +135,12 @@ interface UI
export default { export default {
name: "DepartmentRenewalRateView", name: "DepartmentRenewalRateView",
components: { BiDataUploadView, },
setup() setup()
{ {
const ui: UI = reactive({ const ui: UI = reactive({
showUI: true, showUI: true,
showUploadFileDialog: false, showUploadDialog: false,
tablePageSize: 10, tablePageSize: 10,
tableCurrentPageIndex: 1, tableCurrentPageIndex: 1,
BIDepartmentRenewalRateData: [], BIDepartmentRenewalRateData: [],
@ -183,6 +200,11 @@ export default {
} }
}; };
const showUploadFileDialog = (): void =>
{
ui.showUploadDialog = true;
};
onBeforeMount((): void => onBeforeMount((): void =>
{ {
refresh(); refresh();
@ -197,6 +219,7 @@ export default {
ui, ui,
onCurrentPageIndexChange, onCurrentPageIndexChange,
onTablePageSizeChange, onTablePageSizeChange,
showUploadFileDialog,
// //
tableData, tableData,
refresh, refresh,

View File

@ -13,7 +13,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target> <maven.compiler.target>17</maven.compiler.target>
<spring.version>5.3.30</spring.version> <spring.version>5.3.24</spring.version>
<log4j2.version>2.20.0</log4j2.version> <log4j2.version>2.20.0</log4j2.version>
<!-- <spring.version>6.0.11</spring.version> --> <!-- <spring.version>6.0.11</spring.version> -->
</properties> </properties>

View File

@ -22,6 +22,8 @@ public class MybatisUtils
{ {
private static HashMap<String, SqlSession> SessionMap = new HashMap<>( 5 ); private static HashMap<String, SqlSession> SessionMap = new HashMap<>( 5 );
private static HashMap<String, SqlSession> SessionMapBatch = new HashMap<>( 5 ); private static HashMap<String, SqlSession> SessionMapBatch = new HashMap<>( 5 );
private static HashMap<String, SqlSessionFactory> SessionFactoryMap = new HashMap<>( 5 );
private static HashMap<String, SqlSessionFactory> SessionFactoryMapBatch = new HashMap<>( 5 );
private static String DEFAULT_CONFIGFILE = "mybatis/mybatis-config.xml"; private static String DEFAULT_CONFIGFILE = "mybatis/mybatis-config.xml";
/** /**
@ -33,43 +35,45 @@ public class MybatisUtils
public static SqlSession getSqlSession( String configFile ) throws IOException public static SqlSession getSqlSession( String configFile ) throws IOException
{ {
// 根据配置文件的路径查找是否已经创建了对应的session // 根据配置文件的路径查找是否已经创建了对应的session
SqlSession session = SessionMap.get( configFile ); SqlSessionFactory factory = SessionFactoryMap.get( configFile );
// 找到就直接返回 // 找到就直接返回
if ( session != null ) if ( factory != null )
{ {
return session; return factory.openSession();
} }
// 没找到就创建一个 // 没找到就创建一个
InputStream configIS = Resources.getResourceAsStream( configFile ); InputStream configIS = Resources.getResourceAsStream( configFile );
SqlSessionFactory factory = new SqlSessionFactoryBuilder().build( configIS ); factory = new SqlSessionFactoryBuilder().build( configIS );
session = factory.openSession(); SqlSession session = factory.openSession();
// 保存 // 保存
SessionMap.put( configFile, session ); SessionFactoryMap.put( configFile, factory );
return session; return session;
} }
public static SqlSession getSqlSessionBatch( String configFile ) throws IOException public static SqlSession getSqlSessionBatch( String configFile ) throws IOException
{ {
SqlSession sessionBatch = SessionMapBatch.get( configFile ); // 根据配置文件的路径查找是否已经创建了对应的session
SqlSessionFactory factory = SessionFactoryMap.get( configFile );
if ( sessionBatch != null ) // 找到就直接返回
if ( factory != null )
{ {
return sessionBatch; return factory.openSession();
} }
// 有缓存的就创建一个新的 // 找到就创建一个
InputStream configIS = Resources.getResourceAsStream( configFile ); InputStream configIS = Resources.getResourceAsStream( configFile );
SqlSessionFactory factory = new SqlSessionFactoryBuilder().build( configIS ); factory = new SqlSessionFactoryBuilder().build( configIS );
sessionBatch = factory.openSession(ExecutorType.BATCH, false ); SqlSession session = factory.openSession( ExecutorType.BATCH, false );
// 保存 // 保存
SessionMapBatch.put( configFile, sessionBatch ); SessionFactoryMap.put( configFile, factory );
return sessionBatch; return session;
} }
/** /**
@ -80,21 +84,21 @@ public class MybatisUtils
public static SqlSession getSqlSession() throws IOException public static SqlSession getSqlSession() throws IOException
{ {
// 根据配置文件的路径查找是否已经创建了对应的session // 根据配置文件的路径查找是否已经创建了对应的session
SqlSession session = SessionMap.get( DEFAULT_CONFIGFILE ); SqlSessionFactory factory = SessionFactoryMap.get( DEFAULT_CONFIGFILE );
// 找到就直接返回 // 找到就直接返回
if ( session != null ) if ( factory != null )
{ {
return session; return factory.openSession();
} }
// 没找到就创建一个 // 没找到就创建一个
InputStream configIS = Resources.getResourceAsStream( DEFAULT_CONFIGFILE ); InputStream configIS = Resources.getResourceAsStream( DEFAULT_CONFIGFILE );
SqlSessionFactory factory = new SqlSessionFactoryBuilder().build( configIS ); factory = new SqlSessionFactoryBuilder().build( configIS );
session = factory.openSession(); SqlSession session = factory.openSession();
// 保存 // 保存
SessionMap.put( DEFAULT_CONFIGFILE, session ); SessionFactoryMap.put( DEFAULT_CONFIGFILE, factory );
return session; return session;
} }
@ -108,21 +112,23 @@ public class MybatisUtils
*/ */
public static SqlSession getSqlSessionBatch() throws IOException public static SqlSession getSqlSessionBatch() throws IOException
{ {
SqlSession sessionBatch = SessionMapBatch.get( DEFAULT_CONFIGFILE ); // 根据配置文件的路径查找是否已经创建了对应的session
SqlSessionFactory factory = SessionFactoryMap.get( DEFAULT_CONFIGFILE );
if ( sessionBatch != null ) // 找到就直接返回
if ( factory != null )
{ {
return sessionBatch; return factory.openSession();
} }
// 有缓存的就创建一个新的 // 找到就创建一个
InputStream configIS = Resources.getResourceAsStream( DEFAULT_CONFIGFILE ); InputStream configIS = Resources.getResourceAsStream( DEFAULT_CONFIGFILE );
SqlSessionFactory factory = new SqlSessionFactoryBuilder().build( configIS ); factory = new SqlSessionFactoryBuilder().build( configIS );
sessionBatch = factory.openSession(ExecutorType.BATCH, false ); SqlSession session = factory.openSession( ExecutorType.BATCH, false );
// 保存 // 保存
SessionMapBatch.put( DEFAULT_CONFIGFILE, sessionBatch ); SessionFactoryMap.put( DEFAULT_CONFIGFILE, factory );
return sessionBatch; return session;
} }
} }

View File

@ -61,7 +61,7 @@ public class CallerArchievement
params.put( "a_caller_code", callerCode ); params.put( "a_caller_code", callerCode );
session.clearCache(); // session.clearCache();
mapper.getCallerArchievement( params ); mapper.getCallerArchievement( params );
// 总业绩 // 总业绩

View File

@ -38,7 +38,7 @@
</insert> </insert>
<select id="cleanTelsalerAttachingRateData" statementType="CALLABLE"> <select id="cleanTelsalerAttachingRateData" statementType="CALLABLE">
call telsale_bi_utils.清理BI电销坐席车非渗透跟踪表() call telsale_bi_utils.清理BI电销坐席车非渗透跟踪表()
</select> </select>
<select id="cleanTelsalerRenewalRateData" statementType="CALLABLE"> <select id="cleanTelsalerRenewalRateData" statementType="CALLABLE">
call telsale_bi_utils.清理BI电销坐席续保率跟踪表() call telsale_bi_utils.清理BI电销坐席续保率跟踪表()