From c2510f71c09cc38bb1a6c7e4a00a0053e0391c57 Mon Sep 17 00:00:00 2001 From: lzh Date: Sat, 3 Dec 2022 01:47:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E5=BA=93=E6=98=8E=E7=BB=86=E8=A1=A8?= =?UTF-8?q?=E5=8F=8A=E7=BB=9F=E8=AE=A1=E5=85=A5=E5=BA=93=E5=95=86=E5=93=81?= =?UTF-8?q?=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 49 ++++++- base-ui/src/layout/components/Navbar.vue | 19 +-- base-ui/src/layout/index.vue | 3 +- base-ui/src/main.js | 138 +++++++++--------- .../supervise-portal-biz/pom.xml | 10 ++ .../portal/biz/gdinstorage/GdInstorage.java | 73 +++++++++ .../biz/gdinstorage/GdInstorageCount.java | 52 +++++++ .../gdinstorage/GdInstorageCountMapper.java | 46 ++++++ .../gdinstorage/GdInstorageCountService.java | 46 ++++++ .../portal/biz/gdinstorage/GdInstorageGd.java | 71 +++++++++ .../biz/gdinstorage/GdInstorageGdMapper.java | 46 ++++++ .../biz/gdinstorage/GdInstorageGdService.java | 46 ++++++ .../biz/gdinstorage/GdInstorageMapper.java | 46 ++++++ .../biz/gdinstorage/GdInstorageRest.java | 68 +++++++++ .../biz/gdinstorage/GdInstorageService.java | 99 +++++++++++++ .../biz/gdinventory/GdInventoryRest.java | 4 +- .../biz/gdinventory/GdInventoryService.java | 19 ++- .../gdinventory/GdRescategoryProdService.java | 17 +++ .../biz/storeindex/StoreIndexService.java | 92 ++++++++++++ 19 files changed, 851 insertions(+), 93 deletions(-) create mode 100644 yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorage.java create mode 100644 yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCount.java create mode 100644 yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountMapper.java create mode 100644 yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountService.java create mode 100644 yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageGd.java create mode 100644 yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageGdMapper.java create mode 100644 yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageGdService.java create mode 100644 yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageMapper.java create mode 100644 yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageRest.java create mode 100644 yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageService.java diff --git a/.gitignore b/.gitignore index 9cc04b4a..ea4a4fc0 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,51 @@ target/ .svn/ .project rebel.xml -.rebel-remote.xml.* \ No newline at end of file +.rebel-remote.xml.* +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +# https://github.com/takari/maven-wrapper#usage-without-binary-jar +.mvn/wrapper/maven-wrapper.jar + +.DS_Store +HELP.md +## target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ +**/node_modules/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ \ No newline at end of file diff --git a/base-ui/src/layout/components/Navbar.vue b/base-ui/src/layout/components/Navbar.vue index 68547921..f1ca3fe5 100644 --- a/base-ui/src/layout/components/Navbar.vue +++ b/base-ui/src/layout/components/Navbar.vue @@ -1,16 +1,17 @@ @@ -21,8 +22,8 @@ export default { Orgname: '', departmentName: '', name: '', - year:'', - pNameAndDepartmentNameAndPostName:'' + year: '', + pNameAndDepartmentNameAndPostName: '' } }, mounted() { @@ -37,8 +38,8 @@ export default { logout() { window.opener = null window.open('about:blank', '_top').close() - }, - }, + } + } } diff --git a/base-ui/src/layout/index.vue b/base-ui/src/layout/index.vue index 0e1b8634..9da17125 100644 --- a/base-ui/src/layout/index.vue +++ b/base-ui/src/layout/index.vue @@ -10,8 +10,7 @@ />
diff --git a/base-ui/src/main.js b/base-ui/src/main.js index 5cfeba61..cba80207 100644 --- a/base-ui/src/main.js +++ b/base-ui/src/main.js @@ -27,7 +27,7 @@ Vue.component('eimage', eimage) import Print from '@/utils/print' // 引入附件的js文件 Vue.use(Print) // 注册 -import { setStorage, getStorage } from './utils/auth.js' +// import { setStorage, getStorage } from './utils/auth.js' import VueAMap from 'vue-amap' import request from '@/utils/request' @@ -40,82 +40,82 @@ VueAMap.initAMapApiLoader({ }) Vue.config.productionTip = false -let token = null -token = GetQueryString('token') +// let token = null +// token = GetQueryString('token') -if (token) { - setStorage(token) - let href = window.location.href -// href = href.split(`token=${token}`)[0] -// window.location.href = href.slice(0, href.length - 1) -} +// if (token) { +// setStorage(token) +// let href = window.location.href +// // href = href.split(`token=${token}`)[0] +// // window.location.href = href.slice(0, href.length - 1) +// } -function GetQueryString(name) { - var one = window.location.href.indexOf('?token=') + 7 - if(one<7) - return null; - var two = window.location.href.lastIndexOf('&') //+ 1 - var data = window.location.href.substr(one) - if (two > one) { - data = window.location.href.slice(one, two) - console.log('token', data) - } - if (data) { - return data - } - return null - // var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)') - // var r = window.location.search.substr(1).match(reg) - // if (r != null) return unescape(r[2]); return null -} +// function GetQueryString(name) { +// var one = window.location.href.indexOf('?token=') + 7 +// if(one<7) +// return null; +// var two = window.location.href.lastIndexOf('&') //+ 1 +// var data = window.location.href.substr(one) +// if (two > one) { +// data = window.location.href.slice(one, two) +// console.log('token', data) +// } +// if (data) { +// return data +// } +// return null +// // var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)') +// // var r = window.location.search.substr(1).match(reg) +// // if (r != null) return unescape(r[2]); return null +// } // 获取登录用户信息 -function getUserInfo() { - return request({ - url: '/portal/v1/sysuser/loginDetails', - method: 'post', - headers: { - 'Content-Type': 'application/json' - } - }).then(rep => { - const data = rep.data - let user = { - roleSid: data.roleSid, - name: data.name, - userName: data.userName, - departmentName: data.departmentName, // 部门名称 - departmentSid: data.departmentSid, // 部门sid - isAdmin: data.isAdmin, - staffSid: data.staffSid, // 业务员sid - userSid: data.sid, - orgSid: data.organizationSid, // 单位sid - Orgname: data.organizationName, - dwjb: data.dwjb, - orgNamePath: data.orgNamePath, // 使用组织全路径名称 - orgSidPath: data.orgSidPath, // 使用组织全路径Sid - pNameAndDepartmentNameAndPostName:data.pNameAndDepartmentNameAndPostName - }; - // 结果存入缓存 - window.sessionStorage.setItem('staffSid', user.staffSid) - window.sessionStorage.setItem('userSid', user.userSid) - window.sessionStorage.setItem('Orgname', user.Orgname) - window.sessionStorage.setItem('orgSid', user.orgSid) - window.sessionStorage.setItem('departmentName', user.departmentName) - window.sessionStorage.setItem('name', user.name) - window.sessionStorage.setItem('user', user) - window.sessionStorage.setItem('departmentName', user.departmentName) - window.sessionStorage.setItem('departmentSid', user.departmentSid) - window.sessionStorage.setItem('orgNamePath', user.orgNamePath) - window.sessionStorage.setItem('orgSidPath', user.orgSidPath) - window.sessionStorage.setItem('pNameAndDepartmentNameAndPostName', user.pNameAndDepartmentNameAndPostName) +// function getUserInfo() { +// return request({ +// url: '/portal/v1/sysuser/loginDetails', +// method: 'post', +// headers: { +// 'Content-Type': 'application/json' +// } +// }).then(rep => { +// const data = rep.data +// let user = { +// roleSid: data.roleSid, +// name: data.name, +// userName: data.userName, +// departmentName: data.departmentName, // 部门名称 +// departmentSid: data.departmentSid, // 部门sid +// isAdmin: data.isAdmin, +// staffSid: data.staffSid, // 业务员sid +// userSid: data.sid, +// orgSid: data.organizationSid, // 单位sid +// Orgname: data.organizationName, +// dwjb: data.dwjb, +// orgNamePath: data.orgNamePath, // 使用组织全路径名称 +// orgSidPath: data.orgSidPath, // 使用组织全路径Sid +// pNameAndDepartmentNameAndPostName:data.pNameAndDepartmentNameAndPostName +// }; +// // 结果存入缓存 +// window.sessionStorage.setItem('staffSid', user.staffSid) +// window.sessionStorage.setItem('userSid', user.userSid) +// window.sessionStorage.setItem('Orgname', user.Orgname) +// window.sessionStorage.setItem('orgSid', user.orgSid) +// window.sessionStorage.setItem('departmentName', user.departmentName) +// window.sessionStorage.setItem('name', user.name) +// window.sessionStorage.setItem('user', user) +// window.sessionStorage.setItem('departmentName', user.departmentName) +// window.sessionStorage.setItem('departmentSid', user.departmentSid) +// window.sessionStorage.setItem('orgNamePath', user.orgNamePath) +// window.sessionStorage.setItem('orgSidPath', user.orgSidPath) +// window.sessionStorage.setItem('pNameAndDepartmentNameAndPostName', user.pNameAndDepartmentNameAndPostName) new Vue({ el: '#app', router, store, render: h => h(App) }) - }) -} -getUserInfo() +// }) +// } +// getUserInfo() -export default getUserInfo() +// export default getUserInfo() diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/pom.xml b/yxt_supervise/supervise-portal/supervise-portal-biz/pom.xml index bf0c5abb..b5b9c0e7 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/pom.xml +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/pom.xml @@ -111,6 +111,16 @@ fastcsv 2.2.1 + + + + + + + xerces + xercesImpl + 2.12.2 + diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorage.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorage.java new file mode 100644 index 00000000..1b2a3dfe --- /dev/null +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorage.java @@ -0,0 +1,73 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.portal.biz.gdinstorage; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.yxt.common.core.domain.EntityWithId; +import lombok.Data; + +/** + * Project: yxt_supervise
+ * File: GdInstorage.java
+ * Class: com.yxt.supervise.portal.biz.gdinstorage.GdInstorage
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/12/3 0:57
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@TableName("gd_instorage") +public class GdInstorage extends EntityWithId { + + private String cola0; // 企业组织机构代码证 + private String colb1; // 仓库/门店编号 + private String colc2; // 仓库/门店名称 + private String cold3; // 入库时间 + private String cole4; // 供应商名称 + private String colf5; // 单据号 + private String colg6; // 单据类型 + private String colh7; // 货号 + private String coli8; // 商品名称 + private String colj9; // 商品生产日期 + private String colk10; // 商品保质期 + private String coll11; // 商品规格 + private String colm12; // 类别编号 + private String coln13; // 类别名称 + private String colo14; // 一级类别名称 + private String colp15; // 二级类别名称 + private String colq16; // 入库金额 + private String colr17; // 入库数量 + private String cols18; // 成本金额 + private String colt19; // 成本税额 + private String colu20; // 不含税成本 + private String colv21; // 进项税率 + private String orderDate; // 单据日期 + private String storeType; // 门店类型 +} diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCount.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCount.java new file mode 100644 index 00000000..86b2ea5c --- /dev/null +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCount.java @@ -0,0 +1,52 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.portal.biz.gdinstorage; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.yxt.common.core.domain.EntityWithId; +import lombok.Data; + +/** + * Project: yxt_supervise
+ * File: GdInstorageCount.java
+ * Class: com.yxt.supervise.portal.biz.gdinstorage.GdInstorageCount
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/12/3 1:04
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@TableName("gd_instorage_count") +public class GdInstorageCount extends EntityWithId { + private String prodCode; //商品编码 + private String prodName; //商品名称 + private int prodNum; //'商品数量 + private double prodValue; //商品货值 +} diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountMapper.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountMapper.java new file mode 100644 index 00000000..a8a52e3b --- /dev/null +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountMapper.java @@ -0,0 +1,46 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.portal.biz.gdinstorage; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * Project: yxt_supervise
+ * File: GdInstorageCountMapper.java
+ * Class: com.yxt.supervise.portal.biz.gdinstorage.GdInstorageCountMapper
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/12/3 1:06
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface GdInstorageCountMapper extends BaseMapper { +} diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountService.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountService.java new file mode 100644 index 00000000..e7a02be4 --- /dev/null +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageCountService.java @@ -0,0 +1,46 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.portal.biz.gdinstorage; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * Project: yxt_supervise
+ * File: GdInstorageCountService.java
+ * Class: com.yxt.supervise.portal.biz.gdinstorage.GdInstorageCountService
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/12/3 1:07
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class GdInstorageCountService extends ServiceImpl { +} diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageGd.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageGd.java new file mode 100644 index 00000000..526493ba --- /dev/null +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageGd.java @@ -0,0 +1,71 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.portal.biz.gdinstorage; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.yxt.common.core.domain.EntityWithId; +import lombok.Data; + +/** + * Project: yxt_supervise
+ * File: GdInstorageGd.java
+ * Class: com.yxt.supervise.portal.biz.gdinstorage.GdInstorageGd
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/12/3 0:58
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@TableName("gd_instorage_gd") +public class GdInstorageGd extends EntityWithId { + + private String cola0; // 企业组织机构代码证 + private String colb1; // 仓库/门店编号 + private String colc2; // 仓库/门店名称 + private String cold3; // 入库时间 + private String cole4; // 供应商名称 + private String colf5; // 单据号 + private String colg6; // 单据类型 + private String colh7; // 货号 + private String coli8; // 商品名称 + private String colj9; // 商品生产日期 + private String colk10; // 商品保质期 + private String coll11; // 商品规格 + private String colm12; // 类别编号 + private String coln13; // 类别名称 + private String colo14; // 一级类别名称 + private String colp15; // 二级类别名称 + private String colq16; // 入库金额 + private String colr17; // 入库数量 + private String cols18; // 成本金额 + private String colt19; // 成本税额 + private String colu20; // 不含税成本 + private String colv21; // 进项税率 +} diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageGdMapper.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageGdMapper.java new file mode 100644 index 00000000..0573f116 --- /dev/null +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageGdMapper.java @@ -0,0 +1,46 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.portal.biz.gdinstorage; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * Project: yxt_supervise
+ * File: GdInstorageGdMapper.java
+ * Class: com.yxt.supervise.portal.biz.gdinstorage.GdInstorageGdMapper
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/12/3 1:00
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface GdInstorageGdMapper extends BaseMapper { +} diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageGdService.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageGdService.java new file mode 100644 index 00000000..f35d28b0 --- /dev/null +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageGdService.java @@ -0,0 +1,46 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.portal.biz.gdinstorage; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + * Project: yxt_supervise
+ * File: GdInstorageGdService.java
+ * Class: com.yxt.supervise.portal.biz.gdinstorage.GdInstorageGdService
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/12/3 1:00
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class GdInstorageGdService extends ServiceImpl { +} diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageMapper.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageMapper.java new file mode 100644 index 00000000..68378e3e --- /dev/null +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageMapper.java @@ -0,0 +1,46 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.portal.biz.gdinstorage; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * Project: yxt_supervise
+ * File: GdInstorageMapper.java
+ * Class: com.yxt.supervise.portal.biz.gdinstorage.GdInstorageMapper
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/12/3 1:02
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Mapper +public interface GdInstorageMapper extends BaseMapper { +} diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageRest.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageRest.java new file mode 100644 index 00000000..90c92ad1 --- /dev/null +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageRest.java @@ -0,0 +1,68 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' /| |// '. * + * / /||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | /\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.portal.biz.gdinstorage; + +import com.yxt.common.core.result.ResultBean; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * Project: yxt_supervise
+ * File: GdInstorageRest.java
+ * Class: com.yxt.supervise.portal.biz.gdinstorage.GdInstorageRest
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/12/3 1:08
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@RestController("com.yxt.supervise.portal.biz.gdinstorage.GdInstorageRest") +@RequestMapping("gdinstorage") +public class GdInstorageRest { + + @Autowired + private GdInstorageService gdInstorageService; + @GetMapping("/test") + public ResultBean test() { + + gdInstorageService.doimp("D:/works/projects/javaee/lzh/niejinyi/yunyan/docs/sheji/wx20221202/23/23汇融银行_入库明细表.xlsx"); + gdInstorageService.doimp("D:/works/projects/javaee/lzh/niejinyi/yunyan/docs/sheji/wx20221202/23/24汇融银行_入库明细表.xlsx"); + gdInstorageService.doimp("D:/works/projects/javaee/lzh/niejinyi/yunyan/docs/sheji/wx20221202/23/25汇融银行_入库明细表.xlsx"); + gdInstorageService.doimp("D:/works/projects/javaee/lzh/niejinyi/yunyan/docs/sheji/wx20221202/23/26汇融银行_入库明细表.xlsx"); + gdInstorageService.doimp("D:/works/projects/javaee/lzh/niejinyi/yunyan/docs/sheji/wx20221202/23/27汇融银行_入库明细表.xlsx"); + gdInstorageService.doimp("D:/works/projects/javaee/lzh/niejinyi/yunyan/docs/sheji/wx20221202/23/28汇融银行_入库明细表.xlsx"); + gdInstorageService.doimp("D:/works/projects/javaee/lzh/niejinyi/yunyan/docs/sheji/wx20221202/23/29汇融银行_入库明细表.xlsx"); + gdInstorageService.doimp("D:/works/projects/javaee/lzh/niejinyi/yunyan/docs/sheji/wx20221202/23/30汇融银行_入库明细表.xlsx"); + gdInstorageService.doimp("D:/works/projects/javaee/lzh/niejinyi/yunyan/docs/sheji/wx20221202/23/12-1汇融银行_入库明细表.xlsx"); + + return ResultBean.fireSuccess(); + } +} diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageService.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageService.java new file mode 100644 index 00000000..821332c2 --- /dev/null +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinstorage/GdInstorageService.java @@ -0,0 +1,99 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.supervise.portal.biz.gdinstorage; + +import cn.hutool.poi.excel.ExcelReader; +import cn.hutool.poi.excel.ExcelUtil; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yxt.supervise.portal.biz.gdoutstorage.GdOutstorageGd; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * Project: yxt_supervise
+ * File: GdInstorageService.java
+ * Class: com.yxt.supervise.portal.biz.gdinstorage.GdInstorageService
+ * Description: <描述类的功能>.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2022/12/3 1:02
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Service +public class GdInstorageService extends ServiceImpl { + + @Autowired + private GdInstorageGdService gdInstorageGdService; + + public void doimp(String filePath) { + long millis = System.currentTimeMillis(); + ExcelReader reader = ExcelUtil.getReader(filePath); + int rowCount = reader.getRowCount(); + List toInsertList = new ArrayList<>(); + for (int i = 1; i < rowCount; i++) { + List objects = reader.readRow(i); + GdInstorageGd gd = rowToEntity(objects); + toInsertList.add(gd); + } + if (toInsertList != null && !toInsertList.isEmpty()) { + gdInstorageGdService.saveBatch(toInsertList); + } + System.out.println("用时:" + (System.currentTimeMillis() - millis)); + } + + private GdInstorageGd rowToEntity(List r) { + GdInstorageGd gd = new GdInstorageGd(); + gd.setCola0("" + r.get(0)); // 企业组织机构代码证 + gd.setColb1("" + r.get(1)); // 仓库/门店编号 + gd.setColc2("" + r.get(2)); // 仓库/门店名称 + gd.setCold3("" + r.get(3)); // 入库时间 + gd.setCole4("" + r.get(4)); // 供应商名称 + gd.setColf5("" + r.get(5)); // 单据号 + gd.setColg6("" + r.get(6)); // 单据类型 + gd.setColh7("" + r.get(7)); // 货号 + gd.setColi8("" + r.get(8)); // 商品名称 + gd.setColj9("" + r.get(9)); // 商品生产日期 + gd.setColk10("" + r.get(10)); // 商品保质期 + gd.setColl11("" + r.get(11)); // 商品规格 + gd.setColm12("" + r.get(12)); // 类别编号 + gd.setColn13("" + r.get(13)); // 类别名称 + gd.setColo14("" + r.get(14)); // 一级类别名称 + gd.setColp15("" + r.get(15)); // 二级类别名称 + gd.setColq16("" + r.get(16)); // 入库金额 + gd.setColr17("" + r.get(17)); // 入库数量 + gd.setCols18("" + r.get(18)); // 成本金额 + gd.setColt19("" + r.get(19)); // 成本税额 + gd.setColu20("" + r.get(20)); // 不含税成本 + gd.setColv21("" + r.get(21)); // 进项税率 + return gd; + } +} diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryRest.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryRest.java index 3af69cae..10dbc310 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryRest.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryRest.java @@ -54,11 +54,11 @@ public class GdInventoryRest { @GetMapping("/implInventory") public ResultBean implInventory() { - // gdInventoryService.doCheck(); + gdInventoryService.doCheck(); // gdInventoryService.importFromCsvFilePathHutool("D:/works/projects/javaee/lzh/niejinyi/yunyan/docs/sheji/wx20221130/汇融银行_库存信息查询.csv"); // gdInventoryService.importFromCsvFilePathFastCsv("D:/works/projects/javaee/lzh/niejinyi/yunyan/docs/sheji/wx20221130/汇融银行_库存信息查询.csv"); // gdInventoryService.importFromCsvFilePathJavaCsv("D:/works/projects/javaee/lzh/niejinyi/yunyan/docs/sheji/wx20221130/汇融银行_库存信息查询.csv"); - gdInventoryService.importFromXlsx("D:/works/projects/javaee/lzh/niejinyi/yunyan/docs/sheji/wx20221130/汇融银行_库存信息查询.xlsx"); + // gdInventoryService.importFromXlsx("D:/works/projects/javaee/lzh/niejinyi/yunyan/docs/sheji/wx20221202/汇融银行_库存信息查询.xlsx"); return ResultBean.fireSuccess(); } } diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryService.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryService.java index a79b4f7c..75c16450 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryService.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/gdinventory/GdInventoryService.java @@ -31,6 +31,7 @@ import cn.hutool.core.text.csv.*; import cn.hutool.poi.excel.ExcelUtil; import cn.hutool.poi.excel.sax.handler.RowHandler; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yxt.supervise.portal.biz.storeindex.StoreIndexService; import com.yxt.supervise.portal.extexcel.CsvTool; import com.yxt.supervise.portal.extexcel.ExcelTool; import org.apache.poi.ss.usermodel.CellStyle; @@ -60,20 +61,16 @@ import java.util.List; */ @Service public class GdInventoryService extends ServiceImpl { - - private static List codeList = null; - @Autowired private GdRescategoryProdService gdRescategoryProdService; @Autowired private GdInventoryOkService gdInventoryOkService; + @Autowired + private StoreIndexService storeIndexService; public void doCheck() { - if (codeList == null) { - codeList = gdRescategoryProdService.listCode(); - } - + long millis = System.currentTimeMillis(); List list = super.list(); long ll = list.size(); int x = 0; @@ -82,13 +79,13 @@ public class GdInventoryService extends ServiceImpl okList = new ArrayList<>(); for (GdInventory entity : list) { - if (codeList.contains(entity.getProdCode().trim())) { + if (gdRescategoryProdService.containsCode(entity.getProdCode()) && storeIndexService.containsCodeWithOne(entity.getWarehouseCode())) { GdInventoryOk ok = new GdInventoryOk(); BeanUtil.copyProperties(entity, ok, "id"); // gdInventoryOkService.save(ok); okList.add(ok); - if (500 == num) { + if (1500 == num) { gdInventoryOkService.saveBatch(okList); num = 0; okList.clear(); @@ -107,6 +104,8 @@ public class GdInventoryService extends ServiceImpl { + + private static List codeList = null; + public List listCode() { List res = new ArrayList<>(); List list = super.list(); list.forEach(entity -> res.add(entity.getProdCode().trim())); return res; } + + public List allProdCodeList() { + if (codeList == null) { + codeList = this.listCode(); + } + return codeList; + } + + public boolean containsCode(String code) { + if (StringUtils.isBlank(code)) + return false; + return allProdCodeList().contains(code.trim()); + } } diff --git a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/storeindex/StoreIndexService.java b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/storeindex/StoreIndexService.java index 6ad8d3fb..bfa10dc8 100644 --- a/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/storeindex/StoreIndexService.java +++ b/yxt_supervise/supervise-portal/supervise-portal-biz/src/main/java/com/yxt/supervise/portal/biz/storeindex/StoreIndexService.java @@ -25,9 +25,18 @@ *********************************************************/ package com.yxt.supervise.portal.biz.storeindex; +import cn.hutool.core.collection.ListUtil; +import cn.hutool.core.map.MapUtil; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yxt.supervise.portal.biz.gdinventory.GdRescategoryProd; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * Project: yxt_supervise
* File: StoreIndexService.java
@@ -43,4 +52,87 @@ import org.springframework.stereotype.Service; */ @Service public class StoreIndexService extends ServiceImpl { + + private static List oneCodeList = ListUtil.toLinkedList("101", "199", "51", "52", "54", "55"); + private static Map oneNameMap = MapUtil.builder(new HashMap()) + .put("101", "365常温仓") + .put("199", "365配送残品仓") + .put("51", "唐山正常仓") + .put("52", "唐山残损仓") + .put("54", "唐山烟草仓") + .put("55", "唐山中转仓").build(); + private static Map oneTypeMap = MapUtil.builder(new HashMap()) + .put("101", "配送中心") + .put("199", "配送中心") + .put("51", "配送中心") + .put("52", "配送中心") + .put("54", "配送中心") + .put("55", "配送中心").build(); + + private static List codeList = null; + private static Map nameMap = null; + private static Map typeMap = null; + + public List listCode() { + List res = new ArrayList<>(); + List list = super.list(); + list.forEach(entity -> res.add(entity.getCode().trim())); + return res; + } + + public List allStoreCodeList() { + if (codeList == null) { + codeList = this.listCode(); + } + return codeList; + } + + public boolean containsCode(String code) { + if (StringUtils.isBlank(code)) + return false; + return allStoreCodeList().contains(code.trim()); + } + + public boolean containsCodeWithOne(String code) { + if (StringUtils.isBlank(code)) + return false; + boolean contains = allStoreCodeList().contains(code.trim()); + if (contains) + return true; + return oneCodeList.contains(code.trim()); + } + + public String nameOfCode(String code) { + if (nameMap == null) + nameMap = mapNames(); + String trim = code.trim(); + String s = nameMap.get(trim); + if (StringUtils.isBlank(s)) + s = oneNameMap.get(trim); + return s; + } + + public String typeOfCode(String code) { + if (typeMap == null) + typeMap = mapTypes(); + String trim = code.trim(); + String s = typeMap.get(trim); + if (StringUtils.isBlank(s)) + s = oneTypeMap.get(trim); + return s; + } + + private Map mapNames() { + Map res = new HashMap<>(); + List list = super.list(); + list.forEach(entity -> res.put(entity.getCode().trim(), entity.getName().trim())); + return res; + } + + private Map mapTypes() { + Map res = new HashMap<>(); + List list = super.list(); + list.forEach(entity -> res.put(entity.getCode().trim(), entity.getType().trim())); + return res; + } }