commit
117a1f4469
339 changed files with 39417 additions and 0 deletions
@ -0,0 +1,19 @@ |
|||
root = true |
|||
|
|||
[*.{java, xml}] |
|||
charset = utf-8 |
|||
indent_style = space |
|||
indent_size = 4 |
|||
end_of_line = lf |
|||
trim_trailing_whitespace = true |
|||
insert_final_newline = true |
|||
tab_width = 4 |
|||
|
|||
[*.{yml}] |
|||
charset = utf-8 |
|||
indent_style = space |
|||
indent_size = 2 |
|||
end_of_line = lf |
|||
trim_trailing_whitespace = true |
|||
insert_final_newline = true |
|||
tab_width = 2 |
|||
@ -0,0 +1,71 @@ |
|||
# ===== Java 编译产物 ===== |
|||
*.class |
|||
*.jar |
|||
*.war |
|||
*.ear |
|||
target/ |
|||
build/ |
|||
out/ |
|||
|
|||
# ===== Maven / Gradle ===== |
|||
.gradle/ |
|||
.mvn/ |
|||
mvnw |
|||
mvnw.cmd |
|||
gradle/ |
|||
gradlew |
|||
gradlew.bat |
|||
|
|||
# ===== 静态资源目录(你指定不需要上传)===== |
|||
jeeplus-web/src/main/resources/static/ |
|||
|
|||
# ===== IDE - IntelliJ IDEA ===== |
|||
.idea/ |
|||
*.iml |
|||
*.iws |
|||
*.ipr |
|||
out/ |
|||
|
|||
# ===== IDE - VSCode ===== |
|||
.vscode/ |
|||
*.code-workspace |
|||
|
|||
# ===== Eclipse ===== |
|||
.classpath |
|||
.project |
|||
.settings/ |
|||
bin/ |
|||
|
|||
# ===== 日志 ===== |
|||
*.log |
|||
logs/ |
|||
logging/ |
|||
|
|||
# ===== 环境配置(含敏感信息)===== |
|||
.env |
|||
.env.local |
|||
application-local.yml |
|||
application-dev.yml.bak |
|||
|
|||
# ===== 系统文件 ===== |
|||
.DS_Store |
|||
Thumbs.db |
|||
desktop.ini |
|||
|
|||
# ===== 临时文件 ===== |
|||
*.tmp |
|||
*.bak |
|||
*.swp |
|||
*~ |
|||
tmp/ |
|||
temp/ |
|||
|
|||
# ===== 测试覆盖率 ===== |
|||
.coverage |
|||
htmlReport/ |
|||
jacoco/ |
|||
|
|||
# ===== 其他 ===== |
|||
*.pid |
|||
*.seed |
|||
*.pid.lock |
|||
@ -0,0 +1,253 @@ |
|||
# ticket system |
|||
|
|||
- 创建什么的功能... created |
|||
- 增加什么的功能... created |
|||
- 更新什么的功能... updated |
|||
- 移除什么的功能... removed |
|||
- 修复什么的功能... fixed bug |
|||
|
|||
# 10-20-2020 v1.1.12 |
|||
|
|||
- 属性值为null值的字段默认返回""空字符串 `created` |
|||
- 修改了一些sql的小bug `updated` |
|||
|
|||
# 10-12-2020 v1.1.11 |
|||
|
|||
- 所有票种发票重号不能添加 `created` |
|||
- 火车验真加载提示去掉 `updated` |
|||
- 增值税发票验真失败提示内容具体一点 `updated` |
|||
|
|||
# 10-10-2020 v1.1.10 |
|||
|
|||
- 添加druid线程池检测(将空连接的回收) `created` |
|||
- 用户注册默认添加公司和客户ID `created` |
|||
|
|||
# 09-27-2020 v1.1.09 |
|||
|
|||
- 修改了费用报告的发票总金额和发票总数量 `updated` |
|||
|
|||
# 09-27-2020 v1.1.09 |
|||
|
|||
- 在我的页面增加了姓名数据 `updated` |
|||
- 验真的触发改在发票的按钮上,不在扫描发票时就验真 `updated` |
|||
- 发票重票的逻辑修改,凡是发票重号一律不允许通过 `updated` |
|||
- 修复了火车票的金额小数值会没有的数据问题 `updated` |
|||
- 除了增值税专用发票发票状态为税票外,其他票全为普票 `updated` |
|||
|
|||
# 09-24-2020 v1.1.08 |
|||
|
|||
- 添加了费用报告提交功能及接口 created |
|||
- 添加了发票验真状态的验证功能 created |
|||
- 添加了城市数据接口 created |
|||
|
|||
# 09-22-2020 v1.1.07 |
|||
|
|||
- 添加用户和公司的关系,以及根据当前用户来判断发票的验证规则以及审核力度和是否通过 created |
|||
|
|||
# 09-18-2020 v1.1.06 |
|||
|
|||
- 新增公司表/客户表/规则集表/客户规则集关系表增删改查接口 created |
|||
- 新增用户对应公司所属客户发票查重逻辑判断 created |
|||
|
|||
# 09-16-2020 v1.1.05 |
|||
|
|||
- ocr发票扫描时添加增值税普通发票(卷票)票种 created |
|||
- 修改了发票回显时的报销金额数据 updated |
|||
|
|||
# 09-14-2020 v1.1.04 |
|||
|
|||
- 将ocr接口扫描的图片进行裁剪 created |
|||
- 将发票的字段排序进行修改 updated |
|||
|
|||
# 09-07-2020 v1.1.03 |
|||
|
|||
- 修改了图片的HTTPS路径以及回显 updated |
|||
- 修改了发票编辑时添加附件图片 created |
|||
- 修改了电子发票的时间和供应商以及一些其他字段的数据格式 updated |
|||
|
|||
# 09-05-2020 v1.1.02 |
|||
|
|||
- 修改了图片的HTTPS路径 updated |
|||
|
|||
# 09-04-2020 v1.1.01 |
|||
|
|||
- 对服务的部署添加了HTTPS和域名 created |
|||
|
|||
# 09-03-2020 v1.0.30 |
|||
|
|||
- 解决了添加页面没英文的问题 updated |
|||
- 对各种票中的发票状态进行修改 updated |
|||
- 修改了图片预览的功能 updated |
|||
|
|||
# 09-03-2020 v1.0.30 |
|||
|
|||
- 解决了添加页面没英文的问题 updated |
|||
- 对各种票中的发票状态进行修改 updated |
|||
- 修改了图片预览的功能 updated |
|||
|
|||
# 09-01-2020 v1.0.29 |
|||
|
|||
- 进行微信卡包的接口测试和联调,以及接口数据封装和转换 created |
|||
- 测试微信卡包的可用性和效果 created |
|||
|
|||
# 08-31-2020 v1.0.28 |
|||
|
|||
- 修改了所有票种扫描时发票的时间,进行格式化处理 created |
|||
- 添加了扫描发票进行回显发票 created |
|||
- 对微信卡包进行初测 created |
|||
|
|||
# 08-28-2020 v1.0.27 |
|||
|
|||
- 给费用报告添加动态字段的功能,创建动态字段表,创建动态字段的接口,进行增删改查的测试 created |
|||
- 对动态字段的中英文写法进行重新更新和测试 created |
|||
|
|||
# 08-27-2020 v1.0.26 |
|||
|
|||
- 将动态字段的下拉值通过value_set表来管理,重写动态字段的下拉值接口 created |
|||
- 和前端重新测试不同票种和不同费用类型的所需动态字段,重新创建接口以及写法 created |
|||
- 并且测试了不同票种和不同费用类型的动态字段以及下拉框的数据接口 created |
|||
|
|||
# 08-26-2020 v1.0.25 |
|||
|
|||
- 添加了增值税发票的验真功能 created |
|||
- 商量讨论了动态字段的构造以及下拉选项的数据库构造问题 -created |
|||
|
|||
# 08-25-2020 v1.0.24 |
|||
|
|||
- 修改在扫描发票后图片的上传路径以及前端得到的图片路径 updated |
|||
- 进行发票的验真测试 created |
|||
- 修改手动添加发票的图片路径问题以及前段得到的图片路径 updated |
|||
- 修改了一些发票扫描结果的默认值问题 updated |
|||
|
|||
# 08-24-2020 v1.0.23 |
|||
|
|||
- 修改在扫描发票后图片的上传路径以及前端得到的图片路径 updated |
|||
- 对动态字段进行修改和更新 updated |
|||
|
|||
# 08-21-2020 v1.0.22 |
|||
|
|||
- 对动态字段进行修改和更新 updated |
|||
- 新建动态字段表,重写动态字段的写法 created |
|||
|
|||
# 08-20-2020 v1.0.21 |
|||
|
|||
- 对动态字段进行修改 updated |
|||
- 增加费用用途数据接口 updated |
|||
- 对ocr进行更新和修改 created |
|||
|
|||
# 08-19-2020 v1.0.20 |
|||
|
|||
- 对ocr接口进行更新和修改 updated |
|||
- 进行阿里云服务器的搭建和初步测试 |
|||
|
|||
# 08-18-2020 v1.0.19 |
|||
|
|||
- 对ocr接口进行更新和修改 updated |
|||
- 对阿里云短信服务进行二次调试完成功能 updated |
|||
- 对所有功能进行测试,修改偏好设置功能,增加回显手机号,以及发票移动和筛选的更新和修改 created |
|||
|
|||
# 08-17-2020 v1.0.18 |
|||
|
|||
- 对ocr接口进行更新和修改 updated |
|||
- 对阿里云短信服务进行初次测试 created |
|||
|
|||
# 08-15-2020 v1.0.17 |
|||
|
|||
- 对ocr接口进行更新和修改,添加多张发票的扫描以及对发票支持种类进行添加 updated |
|||
|
|||
# 08-14-2020 v1.0.16 |
|||
|
|||
- 对ocr接口进行更新和修改 updated |
|||
- 对偏好设置的功能进行测试和再次修改 updated |
|||
|
|||
# 08-13-2020 v1.0.15 |
|||
|
|||
- 对ocr接口进行更新和修改 updated |
|||
- 添加了偏好设置的功能并进行测试和再次修改 created |
|||
|
|||
# 08-12-2020 v1.0.14 |
|||
|
|||
- 对ocr接口进行更新和修改 updated |
|||
|
|||
# 08-11-2020 v1.0.13 |
|||
|
|||
- 对登录进行更新修改 updated |
|||
- 查看了ocr接口代码,并测试调通接口,实现接口1.0 created |
|||
- 对不同的发票类型动态添加字段的数据库和sql进行了修改 updated |
|||
|
|||
# 08-10-2020 v1.0.12 |
|||
|
|||
- 修改发票查询的sql,发票查询时要同时查到这张发票所对应的图片 updated |
|||
- 修改发票添加是图片的添加sql,发票图片添加要知道这些发票图片对应着那些发票 |
|||
- 和前端修改了没授权的显示问题 |
|||
|
|||
# 08-7-2020 v1.0.11 |
|||
|
|||
- 添加币种的后台接口 created |
|||
- 添加了帮助页面的后台数据接口 created |
|||
- 修改多条件查询功能 updated |
|||
- 修改了之前接口的查询条件,用户根据自己的微信唯一openID查询自己的数据 updated |
|||
- 用户的语言设置通过接口来实现 created |
|||
|
|||
# 08-6-2020 v1.0.10 |
|||
|
|||
- 添加了权限控制(通过拦截器实现的) created |
|||
- 修改了发票的查询方法,改为多条件查询 updated |
|||
|
|||
# 08-5-2020 v1.0.9 |
|||
|
|||
- 对国际化的数据接口进行了修改 updated |
|||
- 增加了发送手机验证码的功能(模拟) created |
|||
- 增加了手机验证码的验证以及账号的添加和权限的验证 created |
|||
|
|||
# 08-4-2020 v1.0.8 |
|||
|
|||
- 增加了国际化数据接口 created |
|||
- 增加了费用类型下拉列表的数据接口 created |
|||
- 增加了费用类型下拉列表选择的时候添加动态字段输入框的接口 created |
|||
- 对之前的发票搜索进行修改更新(增加了费用类型的搜索) updated |
|||
|
|||
# 08-3-2020 v1.0.7 |
|||
|
|||
- 增加了设置偏好设置时,将费用类型和消费类型下拉选项的数据从数据库获得,在数据库建表并写增删改查 created |
|||
- 增加了偏好设置的添加功能,修改功能,删除功能,查询功能 created |
|||
- 修改了费用类型的下拉功能,更新了下拉数据的层级关系 updated |
|||
|
|||
# 07-31-2020 v1.0.6 |
|||
|
|||
- 增加了对发票拍照进行扫描并将图片上传到后台(模拟) created |
|||
- 增加了冲相册选择多张图片进行扫描并将图片上传到后台(模拟) created |
|||
- 增加了费用类型的下拉功能,创建数据库并实现增删改查 created |
|||
|
|||
# 07-30-2020 v1.0.5 |
|||
|
|||
- 修改了查询费用报告对应的发票的金额问题 updated |
|||
- 增加了发票添加的时候图片的多张上传以及图片的回显信息 created |
|||
- 创建文件的数据库表以及增删改查 |
|||
|
|||
# 07-29-2020 v1.0.4 |
|||
|
|||
- 增加了发票删除的功能 created |
|||
- 增加了发票的移动,发票可以随意移动到别的费用报告里面 created |
|||
- 增加了发票的搜索功能,在费用类型里面发票可以根据发票的金额、发票的开票时间、发票的状态、 还有发票的币种进行搜索 created |
|||
|
|||
# 07-28-2020 v1.0.3 |
|||
|
|||
- 增加了发票添加的功能 created |
|||
- 增加了发票根据不同的费用报告类型进行查询的功能 created |
|||
- 对之前费用报告的查询sql进行修改,每个费用报告的总金额和总笔数更准确 updated |
|||
|
|||
# 07-27-2020 v1.0.2 |
|||
|
|||
- 增加了费用报告的查询功能 created |
|||
- 增加了费用报告的修改功能 created |
|||
- 增加了费用报告的删除功能 created |
|||
- 更新了费用报告的查询功能,和报销表进行新的联动 updated |
|||
|
|||
# 07-24-2020 v1.0.1 |
|||
|
|||
- 根据数据库创建实体类,并写相应的mapper,service,controller层代码,增加了 添加费用报告的功能 created |
|||
|
|||
# 07-21-2020 v1.0.0 |
|||
|
|||
- 初始化系统架构 |
|||
@ -0,0 +1,23 @@ |
|||
# ticket system |
|||
|
|||
> 状态码:`10` ==> `添加失败` |
|||
|
|||
> 状态码:`11` ==> `修改失败` |
|||
|
|||
> 状态码:`12` ==> `删除失败` |
|||
|
|||
> 状态码:`10001` ==> `费用报告名称为空` |
|||
|
|||
> 状态码:`10002` ==> `费用创建时间为空` |
|||
|
|||
> 状态码:`10003` ==> `主键id不能为空` |
|||
|
|||
> 状态码:`10004` ==> `INVOICE_ID为null` |
|||
|
|||
> 状态码:`10005` ==> `传递集合为空` |
|||
|
|||
> 状态码:`10006` ==> `上传图片失败` |
|||
|
|||
> 状态码:`10007` ==> `该用户不存在` |
|||
|
|||
> 状态码:`10008` ==> `参数对象为空` |
|||
@ -0,0 +1,44 @@ |
|||
[ |
|||
{ |
|||
"id": 23, |
|||
"value": "项目", |
|||
"subs": [ |
|||
{ |
|||
"id": 1, |
|||
"name": "项目1" |
|||
}, |
|||
{ |
|||
"id": 2, |
|||
"name": "项目2" |
|||
} |
|||
], |
|||
"child": [ |
|||
{ |
|||
"id": 24, |
|||
"value": "Study Code", |
|||
"subs": [ |
|||
{ |
|||
"id": 1, |
|||
"name": "China01_1", |
|||
"pid": 1 |
|||
}, |
|||
{ |
|||
"id": 2, |
|||
"name": "China01_2", |
|||
"pid": 1 |
|||
}, |
|||
{ |
|||
"id": 3, |
|||
"name": "China02_1", |
|||
"pid": 2 |
|||
}, |
|||
{ |
|||
"id": 4, |
|||
"name": "China02_2", |
|||
"pid": 2 |
|||
} |
|||
] |
|||
} |
|||
] |
|||
} |
|||
] |
|||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,17 @@ |
|||
##### PDF转图片中文字体处理 |
|||
|
|||
````sh |
|||
1.在/usr/shared/fonts下创建fees目录,将AdobeKaitiStd-Regular.otf,STSong-Light.ttf 复制进去 |
|||
2.安装索引 |
|||
yum install mkfontscale |
|||
3.修改文件夹权限 |
|||
chmod -R 755 /usr/share/fonts/fees |
|||
4.yum -y install ttmkfdir |
|||
5.ttmkfdir -e /usr/share/X11/fonts/encodings/encodings.dir |
|||
6.vi /etc/fonts/fonts.conf |
|||
<dir>/usr/share/fonts/fees</dir> |
|||
7.fc-cache |
|||
```` |
|||
|
|||
|
|||
|
|||
@ -0,0 +1,526 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|||
xmlns="http://maven.apache.org/POM/4.0.0" |
|||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
<parent> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-parent</artifactId> |
|||
<version>2.2.5.RELEASE</version> |
|||
<relativePath/> |
|||
</parent> |
|||
|
|||
<groupId>com.cmsen</groupId> |
|||
<artifactId>ticket</artifactId> |
|||
<version>2.3.31</version> |
|||
<packaging>jar</packaging> |
|||
|
|||
<properties> |
|||
<java.version>1.8</java.version> |
|||
<skipTests>true</skipTests> |
|||
<maven.test.skip>true</maven.test.skip> |
|||
<maven.build.timestamp.format>MMddyymm</maven.build.timestamp.format> |
|||
<log4j2.version>2.17.1</log4j2.version> |
|||
</properties> |
|||
<repositories> |
|||
<repository> |
|||
<id>rdc-snapshots</id> |
|||
<url>https://repo.rdc.aliyun.com/repository/124956-snapshot-jMwdvf/</url> |
|||
<snapshots> |
|||
<enabled>true</enabled> |
|||
<updatePolicy>never</updatePolicy> |
|||
</snapshots> |
|||
</repository> |
|||
</repositories> |
|||
|
|||
<dependencies> |
|||
<dependency> |
|||
<groupId>net.smarttax</groupId> |
|||
<artifactId>sim-client-starter</artifactId> |
|||
<version>1.2.3.0-SNAPSHOT</version> |
|||
</dependency> |
|||
<!-- <dependency>--> |
|||
<!-- <groupId>org.springframework.cloud</groupId>--> |
|||
<!-- <artifactId>spring-cloud-starter-openfeign</artifactId>--> |
|||
<!-- <version>2.0.4.RELEASE</version>--> |
|||
<!-- </dependency>--> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-web</artifactId> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.mybatis.spring.boot</groupId> |
|||
<artifactId>mybatis-spring-boot-starter</artifactId> |
|||
<version>2.1.1</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>mysql</groupId> |
|||
<artifactId>mysql-connector-java</artifactId> |
|||
<scope>runtime</scope> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.cmsen.common</groupId> |
|||
<artifactId>cmsen-common</artifactId> |
|||
<version>2.0.2</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.projectlombok</groupId> |
|||
<artifactId>lombok</artifactId> |
|||
<optional>true</optional> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.cmsen.ofd</groupId> |
|||
<artifactId>cmsen-ofd</artifactId> |
|||
<version>1.0.0</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-test</artifactId> |
|||
<scope>test</scope> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.cmsenframework.springboot</groupId> |
|||
<artifactId>cmsen-springboot-security</artifactId> |
|||
<version>1.1.1</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.alibaba</groupId> |
|||
<artifactId>fastjson</artifactId> |
|||
<version>2.0.63</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.sun.mail</groupId> |
|||
<artifactId>javax.mail</artifactId> |
|||
<version>1.6.2</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>cn.hutool</groupId> |
|||
<artifactId>hutool-all</artifactId> |
|||
<version>5.5.8</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.cmsen.einvoice</groupId> |
|||
<artifactId>cmsen-einvoice</artifactId> |
|||
<version>1.0.0</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.ofdbox</groupId> |
|||
<artifactId>converter</artifactId> |
|||
<version>1.0-SNAPSHOT</version> |
|||
<exclusions> |
|||
<exclusion> |
|||
<artifactId>log4j</artifactId> |
|||
<groupId>log4j</groupId> |
|||
</exclusion> |
|||
</exclusions> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.alibaba</groupId> |
|||
<artifactId>easyexcel</artifactId> |
|||
<version>3.3.2</version> |
|||
<exclusions> |
|||
<exclusion> |
|||
<artifactId>poi-ooxml</artifactId> |
|||
<groupId>org.apache.poi</groupId> |
|||
</exclusion> |
|||
<exclusion> |
|||
<artifactId>poi</artifactId> |
|||
<groupId>org.apache.poi</groupId> |
|||
</exclusion> |
|||
<exclusion> |
|||
<groupId>org.apache.poi</groupId> |
|||
<artifactId>poi-ooxml-schemas</artifactId> |
|||
</exclusion> |
|||
</exclusions> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.apache.poi</groupId> |
|||
<artifactId>poi</artifactId> |
|||
<version>5.2.3</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.apache.poi</groupId> |
|||
<artifactId>poi-ooxml</artifactId> |
|||
<version>5.2.3</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>commons-io</groupId> |
|||
<artifactId>commons-io</artifactId> |
|||
<version>2.11.0</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>fr.opensagres.xdocreport</groupId> |
|||
<artifactId>org.apache.poi.xwpf.converter.pdf</artifactId> |
|||
<version>1.0.6</version> |
|||
<exclusions> |
|||
<exclusion> |
|||
<artifactId>poi-ooxml</artifactId> |
|||
<groupId>org.apache.poi</groupId> |
|||
</exclusion> |
|||
</exclusions> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.apache.poi</groupId> |
|||
<artifactId>poi-scratchpad</artifactId> |
|||
<version>5.2.1</version> |
|||
<exclusions> |
|||
<exclusion> |
|||
<artifactId>poi-ooxml</artifactId> |
|||
<groupId>org.apache.poi</groupId> |
|||
</exclusion> |
|||
</exclusions> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.jsoup</groupId> |
|||
<artifactId>jsoup</artifactId> |
|||
<version>1.16.2</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.github.xiaoymin</groupId> |
|||
<artifactId>knife4j-spring-boot-starter</artifactId> |
|||
<version>2.0.8</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-mail</artifactId> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.github.pagehelper</groupId> |
|||
<artifactId>pagehelper-spring-boot-starter</artifactId> |
|||
<version>1.2.5</version> |
|||
</dependency> |
|||
|
|||
<!-- <dependency>--> |
|||
<!-- <groupId>org.springframework.boot</groupId>--> |
|||
<!-- <artifactId>spring-boot-starter-data-redis</artifactId>--> |
|||
<!-- </dependency>--> |
|||
<dependency> |
|||
<groupId>com.cmsen.pdf</groupId> |
|||
<artifactId>cmsen-pdf</artifactId> |
|||
<version>2.0.0</version> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>com.squareup.okhttp3</groupId> |
|||
<artifactId>okhttp</artifactId> |
|||
<version>3.11.0</version> |
|||
</dependency> |
|||
|
|||
<!-- quartz --> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-quartz</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-websocket</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>com.github.jai-imageio</groupId> |
|||
<artifactId>jai-imageio-core</artifactId> |
|||
<version>1.4.0</version> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>com.github.jai-imageio</groupId> |
|||
<artifactId>jai-imageio-jpeg2000</artifactId> |
|||
<version>1.3.0</version> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.apache.pdfbox</groupId> |
|||
<artifactId>pdfbox</artifactId> |
|||
<version>2.0.25</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.dom4j</groupId> |
|||
<artifactId>dom4j</artifactId> |
|||
<version>2.1.3</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.apache.httpcomponents</groupId> |
|||
<artifactId>httpclient</artifactId> |
|||
<version>4.5.13</version> |
|||
</dependency> |
|||
|
|||
<!-- https://mvnrepository.com/artifact/com.alibaba/simpleimage --> |
|||
<dependency> |
|||
<groupId>com.alibaba</groupId> |
|||
<artifactId>simpleimage</artifactId> |
|||
<version>1.1.9</version> |
|||
<exclusions> |
|||
<exclusion> |
|||
<groupId>javax.media</groupId> |
|||
<artifactId>jai_cliwrapper_jiio</artifactId> |
|||
</exclusion> |
|||
<exclusion> |
|||
<groupId>javax.media</groupId> |
|||
<artifactId>jai_imageio</artifactId> |
|||
</exclusion> |
|||
<exclusion> |
|||
<groupId>javax.media</groupId> |
|||
<artifactId>jai_mlibwrapper</artifactId> |
|||
</exclusion> |
|||
<exclusion> |
|||
<groupId>log4j</groupId> |
|||
<artifactId>log4j</artifactId> |
|||
</exclusion> |
|||
</exclusions> |
|||
</dependency> |
|||
<!-- https://mvnrepository.com/artifact/javax.media/jai_codec --> |
|||
<dependency> |
|||
<groupId>javax.media</groupId> |
|||
<artifactId>jai_codec</artifactId> |
|||
<version>1.1.3</version> |
|||
</dependency> |
|||
<!-- https://mvnrepository.com/artifact/javax.media/jai_core --> |
|||
<dependency> |
|||
<groupId>javax.media</groupId> |
|||
<artifactId>jai_core</artifactId> |
|||
<version>1.1.3</version> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>com.jacob</groupId> |
|||
<artifactId>jacob</artifactId> |
|||
<version>1.19</version> |
|||
<scope>system</scope> |
|||
<systemPath>${project.basedir}/lib/jacob.jar</systemPath> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>cn.databytes.btw</groupId> |
|||
<artifactId>btw</artifactId> |
|||
<version>1.0</version> |
|||
<scope>system</scope> |
|||
<systemPath>${project.basedir}/lib/bartender-printer-service.jar</systemPath> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.apache.commons</groupId> |
|||
<artifactId>commons-exec</artifactId> |
|||
<version>1.3</version> |
|||
</dependency> |
|||
|
|||
<!-- <dependency>--> |
|||
<!-- <groupId>com.jcraft</groupId>--> |
|||
<!-- <artifactId>jsch</artifactId>--> |
|||
<!-- <version>0.1.54</version>--> |
|||
<!-- </dependency>--> |
|||
<dependency> |
|||
<groupId>com.github.mwiede</groupId> |
|||
<artifactId>jsch</artifactId> |
|||
<version>2.27.9</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.twelvemonkeys.imageio</groupId> |
|||
<artifactId>imageio-tiff</artifactId> |
|||
<version>3.9.4</version> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>com.microsoft.ews-java-api</groupId> |
|||
<artifactId>ews-java-api</artifactId> |
|||
<version>2.0</version> |
|||
</dependency> |
|||
|
|||
<!-- office 365 --> |
|||
<dependency> |
|||
<groupId>com.google.guava</groupId> |
|||
<artifactId>guava</artifactId> |
|||
<version>32.1.3-jre</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.azure</groupId> |
|||
<artifactId>azure-identity</artifactId> |
|||
<version>1.11.1</version> |
|||
<scope>compile</scope> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.microsoft.graph</groupId> |
|||
<artifactId>microsoft-graph</artifactId> |
|||
<version>5.77.0</version> |
|||
</dependency> |
|||
<!-- office 365 --> |
|||
|
|||
<dependency> |
|||
<groupId>com.microsoft.graph</groupId> |
|||
<artifactId>microsoft-graph-auth</artifactId> |
|||
<version>0.3.0</version> |
|||
</dependency> |
|||
<dependency> |
|||
<!-- Include the sdk as a dependency --> |
|||
<groupId>com.microsoft.graph</groupId> |
|||
<artifactId>microsoft-graph-core</artifactId> |
|||
<version>2.0.14</version> |
|||
</dependency> |
|||
|
|||
<!-- ftp 2024-05-09--> |
|||
<dependency> |
|||
<groupId>commons-net</groupId> |
|||
<artifactId>commons-net</artifactId> |
|||
<version>3.6</version> |
|||
</dependency> |
|||
|
|||
<!-- 图片压缩 2024-05-21--> |
|||
<dependency> |
|||
<groupId>net.coobird</groupId> |
|||
<artifactId>thumbnailator</artifactId> |
|||
<version>0.4.20</version> |
|||
</dependency> |
|||
|
|||
<!--word转pdf--> |
|||
<dependency> |
|||
<groupId>com.documents4j</groupId> |
|||
<artifactId>documents4j-local</artifactId> |
|||
<version>1.1.12</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.documents4j</groupId> |
|||
<artifactId>documents4j-transformer-msoffice-word</artifactId> |
|||
<version>1.1.12</version> |
|||
</dependency> |
|||
|
|||
<!-- 7Z 解压缩 --> |
|||
<dependency> |
|||
<groupId>org.apache.commons</groupId> |
|||
<artifactId>commons-compress</artifactId> |
|||
<version>1.25.0</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.tukaani</groupId> |
|||
<artifactId>xz</artifactId> |
|||
<version>1.9</version> <!-- 最新稳定版 --> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>net.sf.sevenzipjbinding</groupId> |
|||
<artifactId>sevenzipjbinding</artifactId> |
|||
<version>16.02-2.01</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>net.sf.sevenzipjbinding</groupId> |
|||
<artifactId>sevenzipjbinding-all-platforms</artifactId> |
|||
<version>16.02-2.01</version> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.ofdrw</groupId> |
|||
<artifactId>ofdrw-converter</artifactId> |
|||
<version>2.3.2</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.profesorfalken</groupId> |
|||
<artifactId>jPowerShell</artifactId> |
|||
<version>3.1.1</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.microsoft.sqlserver</groupId> |
|||
<artifactId>mssql-jdbc</artifactId> |
|||
<version>12.8.1.jre8</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.opensaml</groupId> |
|||
<artifactId>opensaml-core</artifactId> |
|||
<version>3.4.6</version> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.opensaml</groupId> |
|||
<artifactId>opensaml-saml-api</artifactId> |
|||
<version>3.4.6</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.opensaml</groupId> |
|||
<artifactId>opensaml-saml-impl</artifactId> |
|||
<version>3.4.6</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.opensaml</groupId> |
|||
<artifactId>opensaml-security-api</artifactId> |
|||
<version>3.4.6</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.opensaml</groupId> |
|||
<artifactId>opensaml-security-impl</artifactId> |
|||
<version>3.4.6</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.opensaml</groupId> |
|||
<artifactId>opensaml-profile-api</artifactId> |
|||
<version>3.4.6</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.opensaml</groupId> |
|||
<artifactId>opensaml-profile-impl</artifactId> |
|||
<version>3.4.6</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.opensaml</groupId> |
|||
<artifactId>opensaml-soap-api</artifactId> |
|||
<version>3.4.6</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.opensaml</groupId> |
|||
<artifactId>opensaml-soap-impl</artifactId> |
|||
<version>3.4.6</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.opensaml</groupId> |
|||
<artifactId>opensaml-xmlsec-api</artifactId> |
|||
<version>3.4.6</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.opensaml</groupId> |
|||
<artifactId>opensaml-xmlsec-impl</artifactId> |
|||
<version>3.4.6</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.dtflys.forest</groupId> |
|||
<artifactId>forest-core</artifactId> |
|||
<version>1.7.1</version> |
|||
</dependency> |
|||
|
|||
<!-- <dependency>--> |
|||
<!-- <groupId>net.snowflake</groupId>--> |
|||
<!-- <artifactId>snowflake-jdbc</artifactId>--> |
|||
<!-- <version>3.24.2</version>--> |
|||
<!-- </dependency>--> |
|||
<!--BPM环境需要这个jar包--> |
|||
<!--<dependency> |
|||
<groupId>org.openjdk.nashorn</groupId> |
|||
<artifactId>nashorn-core</artifactId> |
|||
<version>15.3</version> |
|||
</dependency> |
|||
--> |
|||
</dependencies> |
|||
|
|||
<build> |
|||
<plugins> |
|||
<plugin> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-maven-plugin</artifactId> |
|||
<version>2.3.12.RELEASE</version> |
|||
<configuration> |
|||
<includeSystemScope>true</includeSystemScope> |
|||
</configuration> |
|||
</plugin> |
|||
|
|||
<!-- <plugin>--> |
|||
<!-- <artifactId>maven-compiler-plugin</artifactId>--> |
|||
<!-- <configuration>--> |
|||
<!-- <source>1.8</source>--> |
|||
<!-- <target>1.8</target>--> |
|||
<!-- <encoding>UTF-8</encoding>--> |
|||
<!-- <compilerArguments>--> |
|||
<!-- <verbose />--> |
|||
<!-- <!– 将jdk的依赖jar打入项目中,这样项目中使用的jdk的依赖就尅正常使用 –>--> |
|||
<!-- <bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar;${java.home}/lib/jsse.jar</bootclasspath>--> |
|||
<!-- </compilerArguments>--> |
|||
<!-- </configuration>--> |
|||
<!-- </plugin>--> |
|||
</plugins> |
|||
</build> |
|||
|
|||
</project> |
|||
@ -0,0 +1,2 @@ |
|||
alter table invoice_image |
|||
add POSTED_AMOUNT VARCHAR(20) null; |
|||
@ -0,0 +1,6 @@ |
|||
ALTER TABLE `fees_invoice`.`invoice_img` |
|||
ADD COLUMN `ext01` varchar(50) NULL AFTER `ORG_NAME`, |
|||
ADD COLUMN `ext02` varchar(50) NULL AFTER `ext01`, |
|||
ADD COLUMN `ext03` varchar(50) NULL AFTER `ext02`, |
|||
ADD COLUMN `ext04` varchar(50) NULL AFTER `ext03`, |
|||
ADD COLUMN `ext05` varchar(255) NULL AFTER `ext04`; |
|||
@ -0,0 +1,532 @@ |
|||
alter table supplier_order |
|||
change ORG_NAME COMPANY_NAME varchar(120) null; |
|||
|
|||
alter table supplier_order |
|||
add COMPANY_CODE VARCHAR(50) null; |
|||
|
|||
alter table supplier_order |
|||
add COSTCENTER VARCHAR(50) null; |
|||
|
|||
alter table supplier_order |
|||
add ORG_CODE VARCHAR(50) null; |
|||
|
|||
alter table supplier_order |
|||
add ITEM_NAME VARCHAR(255) null; |
|||
|
|||
alter table supplier_order |
|||
add TAX_RATE VARCHAR(10) null; |
|||
|
|||
alter table supplier_order |
|||
add OWNER VARCHAR(100) null; |
|||
|
|||
alter table supplier_order |
|||
add DESCRIPTION VARCHAR(100) null; |
|||
|
|||
alter table supplier_order |
|||
add CREATION_TIME DATETIME null; |
|||
|
|||
alter table supplier_order |
|||
add UPDATE_TIME DATETIME null; |
|||
|
|||
alter table supplier_order |
|||
drop column V_STATUS_NAME; |
|||
|
|||
create table sys_user_org |
|||
( |
|||
USER_ID int null, |
|||
AUTHORIZED_ORG VARCHAR(255) null comment '授权组织id集合', |
|||
OWNED_ORG varchar(255) null comment '所属的组织' |
|||
) |
|||
comment '用户组织关联表'; |
|||
|
|||
create unique index sys_user_org_USER_ID_uindex |
|||
on sys_user_org (USER_ID); |
|||
|
|||
alter table sys_user_org |
|||
add constraint sys_user_org_pk |
|||
primary key (USER_ID); |
|||
|
|||
alter table corporate_invoice |
|||
add OWNER int null comment '所属用户ID'; |
|||
|
|||
alter table sys_user_org |
|||
drop column OWNED_ORG; |
|||
|
|||
alter table sys_user_org |
|||
add DATA_AUTH_TYPE TINYINT(1) default 0 null comment '数据权限 0 All,1 by org,2 by owner'; |
|||
|
|||
|
|||
alter table supplier_order_item_matching |
|||
modify PRICE VARCHAR(50) default 0 null comment '价格'; |
|||
|
|||
alter table supplier_order_item_matching |
|||
modify TOTAL VARCHAR(50) default 0 null comment '金额'; |
|||
|
|||
alter table supplier_order_item_matching |
|||
modify TAX VARCHAR(50) default 0 null comment '税额'; |
|||
|
|||
alter table supplier_order_item_matching |
|||
add RECEIVE_NO VARCHAR(50) null comment '收货号码'; |
|||
|
|||
alter table supplier_order_item_matching |
|||
add DEDUCTION_AMOUNT varchar(50) default 0 null comment '抵扣金额'; |
|||
|
|||
alter table supplier_order_item_matching |
|||
add DEDUCTION_TAX varchar(50) default 0 null comment '抵扣税额'; |
|||
|
|||
alter table supplier_order_item_matching |
|||
add DEDUCTION_TAX_RATE varchar(10) null comment '抵扣税率'; |
|||
alter table supplier_material |
|||
add SPECIFICATION varchar(100) null; |
|||
|
|||
alter table corporate_invoice |
|||
add IS_DEL TINYINT(1) default 0 null; |
|||
|
|||
alter table corporate_invoice_items |
|||
add IS_DEL TINYINT(1) default 0 null; |
|||
|
|||
alter table supplier_order_item_matching |
|||
add INVOICE_ID VARCHAR(100) null after ID; |
|||
|
|||
alter table supplier_order_item_matching |
|||
add ORDER_NO VARCHAR(100) null; |
|||
|
|||
alter table supplier_order |
|||
modify GOODS_NUM decimal(8) null; |
|||
alter table supplier_order |
|||
modify RECEIVED_NUM decimal(8) null; |
|||
|
|||
alter table supplier_order |
|||
modify UNIT_PRICE decimal(20, 5) null; |
|||
alter table supplier_order |
|||
modify AMOUNT decimal(20, 5) null; |
|||
|
|||
alter table supplier_order |
|||
modify GOODS_NUM int(8) null; |
|||
|
|||
alter table supplier_order |
|||
modify RECEIVED_NUM int(8) null; |
|||
|
|||
alter table supplier_order_item_matching |
|||
add RECEIVED_TOTAL decimal(20, 5) default 0 null; |
|||
|
|||
alter table supplier_order |
|||
change ITEM_NAME ITEM_NO varchar(100) null; |
|||
|
|||
|
|||
##### been updated |
|||
|
|||
alter table file |
|||
add DESCRIPTION VARCHAR(255) null; |
|||
|
|||
alter table file |
|||
add UPLOAD_USER int null; |
|||
|
|||
alter table file |
|||
add UPLOAD_TIME DATETIME null; |
|||
|
|||
#### been updated |
|||
|
|||
alter table invoice |
|||
add LOGIN_ID VARCHAR(255) null; |
|||
|
|||
alter table supplier_order_item_matching |
|||
add ITEM_NO VARCHAR(100) null comment '物料号'; |
|||
|
|||
|
|||
#### 2021/11/15 |
|||
|
|||
alter table corporate_invoice |
|||
add USE_STATUS TINYINT(1) default 0 null comment '使用状态 0 未使用 1 已使用 2 后票'; |
|||
|
|||
##### 2021/11/16 |
|||
alter table file |
|||
modify TYPE VARCHAR(100) null comment '附件类型'; |
|||
create index emp_id on t_10_employee (emp_id); |
|||
|
|||
create table expense_type_ticket |
|||
( |
|||
ID int comment '主键ID', |
|||
EXPENSE_TYPE_ID int not null comment '费用类型ID', |
|||
TICKET_TYPE_CODE VARCHAR(20) not null comment '票种对应CODE码', |
|||
KIND VARCHAR(20) null comment '消费类型,多个可以英文逗号隔开', |
|||
CONTENT VARCHAR(100) null comment '消费内容,可多个以英文逗号隔开', |
|||
ACTIVE BOOLEAN null comment '是否可用' |
|||
) |
|||
comment '费用类型票种关系表-用于特定规则'; |
|||
|
|||
create unique index EXPENSE_TYPE_TICKET_ID_uindex |
|||
on EXPENSE_TYPE_TICKET (ID); |
|||
|
|||
alter table EXPENSE_TYPE_TICKET |
|||
add constraint EXPENSE_TYPE_TICKET_pk |
|||
primary key (ID); |
|||
|
|||
alter table EXPENSE_TYPE_TICKET |
|||
modify ID int auto_increment comment '主键ID'; |
|||
|
|||
|
|||
alter table corporate_invoice_type |
|||
drop column PATH; |
|||
|
|||
alter table corporate_invoice_type |
|||
add REVIEW BOOLEAN default FALSE not null comment '是否需要审核 默认不需要'; |
|||
|
|||
alter table corporate_invoice |
|||
modify INVOICE_TYPE int null comment '发票类型'; |
|||
|
|||
create table invoice_item_mileage |
|||
( |
|||
ID BIGINT comment '主键ID', |
|||
ITEM_DATE DATE null comment '行程日期', |
|||
`FROM` VARCHAR(100) null comment '出发地', |
|||
`TO` VARCHAR(100) null comment '到达地', |
|||
MILEAGE DECIMAL(10, 2) default 0 null comment '里程数', |
|||
REASON VARCHAR(200) null comment '事由', |
|||
CUSTOM1 VARCHAR(100) null, |
|||
CUSTOM2 VARCHAR(100) null, |
|||
CUSTOM3 VARCHAR(100) null, |
|||
CUSTOM4 VARCHAR(100) null, |
|||
CUSTOM5 VARCHAR(100) null |
|||
) |
|||
comment '里程发票明细'; |
|||
|
|||
create unique index invoice_item_mileage_ID_uindex |
|||
on invoice_item_mileage (ID); |
|||
|
|||
alter table invoice_item_mileage |
|||
add constraint invoice_item_mileage_pk |
|||
primary key (ID); |
|||
|
|||
alter table invoice_item_mileage |
|||
modify ID BIGINT auto_increment comment '主键ID'; |
|||
|
|||
alter table invoice_item_mileage |
|||
add INVOICE_ID VARCHAR(50) not null comment '发票ID' after ID; |
|||
|
|||
|
|||
#### 1118 been updated |
|||
|
|||
alter table customer |
|||
modify ORG_UNIT_WORD varchar(20) not null; |
|||
|
|||
alter table customer |
|||
add COMPANY_WORD VARCHAR(20) not null after ORG_UNIT_WORD; |
|||
|
|||
alter table files |
|||
add MQ_ID VARCHAR(50) null comment 'MQ返回标识字符'; |
|||
|
|||
create table band_config |
|||
( |
|||
ID int, |
|||
BAND VARCHAR(50) null, |
|||
MILEAGE VARCHAR(20) null, |
|||
EXT01 VARCHAR(100) null, |
|||
EXT02 VARCHAR(100) null, |
|||
EXT03 VARCHAR(100) null, |
|||
EXT04 VARCHAR(100) null, |
|||
EXT05 VARCHAR(100) null, |
|||
EXT06 VARCHAR(100) null, |
|||
EXT07 VARCHAR(100) null, |
|||
EXT08 VARCHAR(100) null, |
|||
EXT09 VARCHAR(100) null, |
|||
EXT10 VARCHAR(100) null |
|||
); |
|||
|
|||
create unique index band_config_ID_uindex |
|||
on band_config (ID); |
|||
|
|||
alter table band_config |
|||
add constraint band_config_pk |
|||
primary key (ID); |
|||
|
|||
alter table band_config |
|||
modify ID int auto_increment; |
|||
|
|||
create table band_area_config |
|||
( |
|||
ID INT, |
|||
BAND VARCHAR(50) null, |
|||
AREA VARCHAR(100) null, |
|||
HOTEL VARCHAR(100) null, |
|||
EXT01 VARCHAR(100) null, |
|||
EXT02 VARCHAR(100) null, |
|||
EXT03 VARCHAR(100) null, |
|||
EXT04 VARCHAR(100) null, |
|||
EXT05 VARCHAR(100) null |
|||
); |
|||
|
|||
create unique index band_area_config_ID_uindex |
|||
on band_area_config (ID); |
|||
|
|||
alter table band_area_config |
|||
add constraint band_area_config_pk |
|||
primary key (ID); |
|||
|
|||
alter table band_area_config |
|||
modify ID INT auto_increment; |
|||
|
|||
|
|||
#### been updated 1122 |
|||
alter table corporate_invoice_type |
|||
add SEND_TYPE TINYINT(1) default 0 null; |
|||
#### been updated 1123 |
|||
|
|||
|
|||
alter table supplier_order |
|||
add EXT01 VARCHAR(50) null; |
|||
alter table supplier_order |
|||
add EXT02 VARCHAR(50) null; |
|||
alter table supplier_order |
|||
add EXT03 VARCHAR(50) null; |
|||
alter table supplier_order |
|||
add EXT04 VARCHAR(50) null; |
|||
alter table supplier_order |
|||
add EXT05 VARCHAR(50) null; |
|||
|
|||
alter table expense_type_ticket |
|||
add TYPE TINYINT(1) default 0 null comment '0允许报销 1不允许报销'; |
|||
|
|||
|
|||
alter table sys_org |
|||
add ORG_NAME VARCHAR(100) null; |
|||
##### updated 1201 |
|||
|
|||
|
|||
alter table invoice_attendees |
|||
add FILES_ID int null; |
|||
|
|||
alter table invoice_item_mileage |
|||
add FILES_ID int null; |
|||
|
|||
alter table invoice_items |
|||
add FILES_ID INT null; |
|||
|
|||
alter table expense_reports |
|||
add OWNER_ID VARCHAR(150) null; |
|||
|
|||
update expense_reports e |
|||
set e.OWNER_ID = (select u.EMAIL from user u where u.USER_ID = e.USER_ID) |
|||
where USER_ID is not null; |
|||
|
|||
|
|||
CREATE TABLE `t_10_employee` |
|||
( |
|||
`id` varchar(64) NOT NULL COMMENT 'UUID', |
|||
`emp_id` varchar(50) DEFAULT NULL COMMENT '员工Id', |
|||
`user_email` varchar(255) DEFAULT NULL COMMENT '邮箱 ', |
|||
`login_id` varchar(255) DEFAULT NULL COMMENT '登录Id', |
|||
`first_name` varchar(50) DEFAULT NULL COMMENT '姓名-名', |
|||
`last_name` varchar(50) DEFAULT NULL COMMENT '姓名-姓', |
|||
`org_unit1` varchar(200) DEFAULT NULL COMMENT '组织1', |
|||
`org_unit2` varchar(200) DEFAULT NULL COMMENT '组织2', |
|||
`org_unit3` varchar(200) DEFAULT NULL COMMENT '组织3', |
|||
`org_unit4` varchar(200) DEFAULT NULL COMMENT '组织4', |
|||
`org_unit5` varchar(200) DEFAULT NULL, |
|||
`org_unit6` varchar(200) DEFAULT NULL, |
|||
`attributer1` varchar(100) DEFAULT NULL COMMENT '属性1', |
|||
`attributer2` varchar(100) DEFAULT NULL COMMENT '属性2', |
|||
`attributer3` varchar(100) DEFAULT NULL COMMENT '属性3', |
|||
`attributer4` varchar(100) DEFAULT NULL COMMENT '属性4', |
|||
`attributer5` varchar(100) DEFAULT NULL COMMENT '属性5', |
|||
`attributer6` varchar(100) DEFAULT NULL COMMENT '属性6', |
|||
`attributer7` varchar(100) DEFAULT NULL COMMENT '属性7', |
|||
`attributer8` varchar(100) DEFAULT NULL COMMENT '属性8', |
|||
`attributer9` varchar(100) DEFAULT NULL COMMENT '属性9', |
|||
`attributer10` varchar(100) DEFAULT NULL COMMENT '属性10', |
|||
`create_by` varchar(36) DEFAULT NULL COMMENT '创建者 ', |
|||
`create_date` datetime DEFAULT NULL COMMENT '创建时间', |
|||
`update_by` varchar(36) DEFAULT NULL COMMENT '更新者', |
|||
`update_date` datetime DEFAULT NULL COMMENT '更新时间', |
|||
`remarks` varchar(200) DEFAULT NULL COMMENT '备注信息', |
|||
`expense_approver` varchar(10) DEFAULT NULL, |
|||
`expense_approver_employeeID` varchar(50) DEFAULT NULL, |
|||
`ext11` varchar(100) DEFAULT NULL COMMENT '扩展11', |
|||
`ext12` varchar(100) DEFAULT NULL COMMENT '扩展11', |
|||
`ext13` varchar(100) DEFAULT NULL COMMENT '扩展11', |
|||
`ext14` varchar(100) DEFAULT NULL COMMENT '扩展11', |
|||
`ext15` varchar(100) DEFAULT NULL COMMENT '扩展11', |
|||
`ext16` varchar(100) DEFAULT NULL COMMENT '扩展11', |
|||
`ext17` varchar(100) DEFAULT NULL COMMENT '扩展11', |
|||
`ext18` varchar(100) DEFAULT NULL COMMENT '扩展11', |
|||
`ext19` varchar(100) DEFAULT NULL COMMENT '扩展11', |
|||
`ext20` varchar(100) DEFAULT NULL COMMENT '扩展11', |
|||
`active` varchar(10) DEFAULT NULL COMMENT '是否激活', |
|||
`cash_advance_account_code` varchar(100) DEFAULT NULL COMMENT '科目', |
|||
`crn_key` varchar(100) DEFAULT NULL COMMENT 'crnKey', |
|||
`ctry_code` varchar(100) DEFAULT NULL COMMENT 'ctryCode', |
|||
`ctry_sub_code` varchar(100) DEFAULT NULL COMMENT 'subCode', |
|||
`custom1` varchar(100) DEFAULT NULL COMMENT '自定义1', |
|||
`custom2` varchar(100) DEFAULT NULL COMMENT '自定义', |
|||
`custom3` varchar(100) DEFAULT NULL COMMENT '自定义', |
|||
`custom4` varchar(100) DEFAULT NULL COMMENT '自定义', |
|||
`custom5` varchar(100) DEFAULT NULL COMMENT '自定义', |
|||
`custom6` varchar(100) DEFAULT NULL COMMENT '自定义', |
|||
`custom7` varchar(100) DEFAULT NULL COMMENT '自定义', |
|||
`custom8` varchar(100) DEFAULT NULL COMMENT '自定义', |
|||
`custom9` varchar(100) DEFAULT NULL COMMENT '自定义', |
|||
`custom10` varchar(100) DEFAULT NULL COMMENT '自定义', |
|||
`custom11` varchar(100) DEFAULT NULL COMMENT '自定义', |
|||
`custom12` varchar(100) DEFAULT NULL COMMENT '自定义', |
|||
`custom13` varchar(100) DEFAULT NULL COMMENT '自定义', |
|||
`custom14` varchar(100) DEFAULT NULL COMMENT '自定义', |
|||
`custom15` varchar(100) DEFAULT NULL COMMENT '自定义', |
|||
`custom16` varchar(100) DEFAULT NULL COMMENT '自定义', |
|||
`custom17` varchar(100) DEFAULT NULL COMMENT '自定义', |
|||
`custom18` varchar(100) DEFAULT NULL COMMENT '自定义', |
|||
`custom19` varchar(100) DEFAULT NULL COMMENT '自定义', |
|||
`custom20` varchar(100) DEFAULT NULL COMMENT '自定义', |
|||
`custom21` varchar(100) DEFAULT NULL COMMENT '自定义', |
|||
`invoice_approver` varchar(100) DEFAULT NULL COMMENT '是否发票审批', |
|||
`invoice_user` varchar(100) DEFAULT NULL COMMENT '发票审批人', |
|||
`is_test_emp` varchar(100) DEFAULT NULL COMMENT '是否测试', |
|||
`ledger_key` varchar(100) DEFAULT NULL COMMENT 'ledgerkey', |
|||
`ledger_name` varchar(100) DEFAULT NULL COMMENT 'ledgerName', |
|||
`locale_name` varchar(100) DEFAULT NULL COMMENT '本地名', |
|||
`trip_user` varchar(100) DEFAULT NULL COMMENT '是否临时用户', |
|||
`mi` varchar(100) DEFAULT NULL COMMENT 'mi', |
|||
PRIMARY KEY (`id`) |
|||
) ENGINE = InnoDB |
|||
DEFAULT CHARSET = utf8; |
|||
|
|||
alter table verified_user |
|||
add BAND VARCHAR(50) null; |
|||
|
|||
alter table verified_user |
|||
add EXT01 VARCHAR(50) null; |
|||
|
|||
alter table verified_user |
|||
add EXT02 VARCHAR(50) null; |
|||
|
|||
alter table verified_user |
|||
add EXT03 VARCHAR(50) null; |
|||
|
|||
alter table verified_user |
|||
add EXT04 VARCHAR(50) null; |
|||
|
|||
alter table verified_user |
|||
add EXT05 VARCHAR(50) null; |
|||
|
|||
alter table user |
|||
modify TEL varchar(255) null comment '用户电话'; |
|||
|
|||
alter table verified_user |
|||
modify TEL varchar(255) not null; |
|||
|
|||
alter table t_10_employee |
|||
modify login_id varchar(255) null comment '登录Id'; |
|||
alter table user |
|||
modify EMAIL varchar(255) null comment '用户邮箱'; |
|||
|
|||
alter table verified_user |
|||
modify LOGIN_ID varchar(255) not null; |
|||
|
|||
|
|||
####updated 1210 |
|||
create table user_guide |
|||
( |
|||
ID int, |
|||
TITLE VARCHAR(255) not null comment '标题', |
|||
CONTENT TEXT null comment '内容', |
|||
UPDATE_TIME DATETIME null comment '更新时间', |
|||
SORT int(5) default 0 null comment '排序', |
|||
IS_DEL BOOLEAN default 0 null comment '删除标记' |
|||
) |
|||
comment '用户向导'; |
|||
|
|||
create unique index user_guide_ID_uindex |
|||
on user_guide (ID); |
|||
|
|||
alter table user_guide |
|||
add constraint user_guide_pk |
|||
primary key (ID); |
|||
|
|||
alter table user_guide |
|||
modify ID int auto_increment; |
|||
|
|||
create table sys_notification |
|||
( |
|||
ID int, |
|||
TITLE VARCHAR(255) null comment '标题', |
|||
CONTENT TEXT null comment '内容', |
|||
LEVEL TINYINT(1) default 0 null comment '级别', |
|||
UPDATE_TIME DATETIME null comment '更新时间', |
|||
SORT INT(5) null comment '排序', |
|||
IS_DEL BOOLEAN default 0 null comment '删除标记' |
|||
) |
|||
comment '系统通知'; |
|||
|
|||
create unique index sys_notification_ID_uindex |
|||
on sys_notification (ID); |
|||
|
|||
alter table sys_notification |
|||
add constraint sys_notification_pk |
|||
primary key (ID); |
|||
|
|||
alter table sys_notification |
|||
modify ID int auto_increment; |
|||
|
|||
alter table user_guide |
|||
add TITLE_EN VARCHAR(255) null; |
|||
|
|||
alter table user_guide |
|||
add CONTENT_EN TEXT null; |
|||
|
|||
|
|||
#### updated 1214 |
|||
|
|||
create table invoice_kind_matching |
|||
( |
|||
ID int comment '主键', |
|||
CONTENT VARCHAR(255) null comment '内容关键字', |
|||
KIND VARCHAR(10) null comment '类型', |
|||
ACTIVE BOOLEAN default TRUE null comment '是否可用' |
|||
) |
|||
comment '发票消费类型匹配表'; |
|||
|
|||
create unique index invoice_kind_matching_ID_uindex |
|||
on invoice_kind_matching (ID); |
|||
|
|||
alter table invoice_kind_matching |
|||
add constraint invoice_kind_matching_pk |
|||
primary key (ID); |
|||
|
|||
alter table invoice_kind_matching |
|||
modify ID int auto_increment comment '主键'; |
|||
|
|||
|
|||
create index t_10_employee_login_id_index |
|||
on t_10_employee (login_id); |
|||
|
|||
create index invoice_image_REPORT_ID_index |
|||
on invoice_image (REPORT_ID); |
|||
|
|||
alter table expense_reports |
|||
add SOURCE varchar(10) default 'APP' null; |
|||
|
|||
|
|||
###### UPDATED 1220 |
|||
alter table supplier_order |
|||
add SUPPLIER_NAME VARCHAR(100) null; |
|||
|
|||
alter table invoice_image |
|||
modify CREATE_DATE DATETIME null; |
|||
|
|||
|
|||
|
|||
#####been updated |
|||
alter table corporate_invoice modify ORG_ID int(11) unsigned default 0 null; |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
@ -0,0 +1,53 @@ |
|||
|
|||
CREATE TABLE `invoice_pf_nc_info` ( |
|||
`id` int(11) NOT NULL AUTO_INCREMENT, |
|||
`billmaker` varchar(20) DEFAULT NULL COMMENT '提交人', |
|||
`corigcurrencyid` varchar(20) DEFAULT NULL COMMENT '币种', |
|||
`ntotalorigmny` varchar(20) DEFAULT NULL COMMENT '头入账金额', |
|||
`vbillcode` varchar(30) DEFAULT NULL COMMENT '发票号-nc号?', |
|||
`vmemo` varchar(255) DEFAULT NULL COMMENT '备注-是否需要处理?', |
|||
`vsourcecode` varchar(50) DEFAULT NULL COMMENT '收获单据号', |
|||
`vordercode` varchar(50) DEFAULT NULL COMMENT 'po号', |
|||
`vfirstrowno` varchar(10) DEFAULT NULL COMMENT 'Po行号', |
|||
`nastorigprice` varchar(20) DEFAULT NULL COMMENT '无税单价', |
|||
`nshouldnum` varchar(20) DEFAULT NULL COMMENT '供应商发货数量', |
|||
`nnum` varchar(20) DEFAULT NULL COMMENT '开票数量', |
|||
`norigmny` varchar(20) DEFAULT NULL COMMENT '无税金额', |
|||
`ntaxrate` varchar(20) DEFAULT NULL COMMENT '税率', |
|||
`pk_material_code` varchar(50) DEFAULT NULL COMMENT '物料编码', |
|||
`pk_material_name` varchar(255) DEFAULT NULL COMMENT '物料名称', |
|||
`pk_material_graphid` varchar(50) DEFAULT NULL COMMENT '物料图号', |
|||
`pk_material_materialspec` varchar(50) DEFAULT NULL COMMENT '物料规格', |
|||
`pk_material_materialtype` varchar(50) DEFAULT NULL COMMENT '物料型号', |
|||
`pk_supplier_name` varchar(255) DEFAULT NULL COMMENT '供应商名称', |
|||
`pk_supplier_code` varchar(20) DEFAULT NULL COMMENT '供应商编码', |
|||
`pk_supplier_taxpayerid` varchar(50) DEFAULT NULL COMMENT '供应商税号', |
|||
`ext01` varchar(255) DEFAULT NULL, |
|||
`ext02` varchar(255) DEFAULT NULL, |
|||
`ext03` varchar(255) DEFAULT NULL, |
|||
`ext04` varchar(255) DEFAULT NULL, |
|||
`ext05` varchar(255) DEFAULT NULL, |
|||
`ext06` varchar(255) DEFAULT NULL, |
|||
`ext07` varchar(255) DEFAULT NULL, |
|||
`ext08` varchar(255) DEFAULT NULL, |
|||
`ext09` varchar(255) DEFAULT NULL, |
|||
`ext10` varchar(255) DEFAULT NULL, |
|||
`create_date` datetime DEFAULT NULL, |
|||
`update_date` datetime DEFAULT NULL, |
|||
`flag` varchar(1) DEFAULT NULL, |
|||
`status` varchar(255) DEFAULT NULL, |
|||
PRIMARY KEY (`id`) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
|||
|
|||
|
|||
ALTER TABLE `invoice_pf_nc_info` |
|||
CHANGE COLUMN `ext09` `invoiceNumber` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `ext08`; |
|||
|
|||
ALTER TABLE `invoice_pf_nc_info` |
|||
CHANGE COLUMN `ext10` `vdef21` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL; |
|||
|
|||
ALTER TABLE `invoice_pf_nc_info` |
|||
CHANGE COLUMN `ext07` `dbilldate` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `ext06`, |
|||
CHANGE COLUMN `ext08` `pkorg` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `dbilldate`; |
|||
ALTER TABLE `invoice_pf_nc_info` |
|||
CHANGE COLUMN `ext06` `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `ext05`; |
|||
@ -0,0 +1,6 @@ |
|||
ALTER TABLE `ticket_type` |
|||
ADD COLUMN `ext01` varchar(50) NULL AFTER `TAX_RATE`, |
|||
ADD COLUMN `ext02` varchar(50) NULL AFTER `ext01`, |
|||
ADD COLUMN `ext03` varchar(50) NULL AFTER `ext02`, |
|||
ADD COLUMN `ext04` varchar(50) NULL AFTER `ext03`, |
|||
ADD COLUMN `ext05` varchar(50) NULL AFTER `ext04`; |
|||
@ -0,0 +1,5 @@ |
|||
CREATE TABLE `fees_invoice`.`hly_employee_company` ( |
|||
`employee_no` varchar(20) NOT NULL COMMENT '汇联易PWC接口创建人工号', |
|||
`company_name` varchar(255) NULL, |
|||
`company_code` varchar(50) NULL |
|||
); |
|||
@ -0,0 +1,7 @@ |
|||
ALTER TABLE `corporate_invoice` |
|||
MODIFY COLUMN `PO` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `ORIGINAL_FILE_PATH`; |
|||
ALTER TABLE `corporate_invoice_items` |
|||
MODIFY COLUMN `NAME` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `PID`; |
|||
ALTER TABLE `corporate_invoice_items` |
|||
MODIFY COLUMN `NAME` varchar(400) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `PID`; |
|||
|
|||
@ -0,0 +1,70 @@ |
|||
drop table if exists `corporate_invoice`; |
|||
CREATE TABLE `corporate_invoice` ( |
|||
`ID` varchar(40) NOT NULL, |
|||
`ORG_ID` int(10) unsigned DEFAULT NULL, |
|||
`NAME` varchar(80) DEFAULT NULL, |
|||
`SELLER` varchar(100) DEFAULT NULL, |
|||
`SELLER_NO` varchar(100) DEFAULT NULL, |
|||
`CODE` varchar(100) DEFAULT NULL, |
|||
`NUMBER` varchar(100) DEFAULT NULL, |
|||
`DATE` varchar(20) DEFAULT NULL, |
|||
`TOTAL` varchar(50) DEFAULT NULL, |
|||
`IMG_URI` varchar(255) DEFAULT NULL, |
|||
`EXTRA_FIELDS` text, |
|||
`REMARK` varchar(1000) DEFAULT NULL, |
|||
`LOGIN_ID` varchar(100) DEFAULT NULL, |
|||
`IS_SEND` tinyint(1) DEFAULT '0' COMMENT '0未发送 1已发送', |
|||
`ENTRY_ID` varchar(100) DEFAULT NULL, |
|||
`UPDATE_DATE` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, |
|||
`BUYER` varchar(50) DEFAULT NULL, |
|||
`BUYER_NO` varchar(50) DEFAULT NULL, |
|||
`ORIGINAL_FILE_PATH` varchar(300) DEFAULT NULL, |
|||
`PO` varchar(1000) DEFAULT NULL, |
|||
`TICKET_CODE` varchar(10) DEFAULT NULL, |
|||
`KIND` varchar(20) DEFAULT NULL, |
|||
`STATUS` smallint(6) DEFAULT '0' COMMENT '0 未处理 1 已处理 2 异常 3 pending', |
|||
`VERIFIED_CODE` varchar(50) DEFAULT NULL, |
|||
`PRETAX_AMOUNT` varchar(20) DEFAULT NULL, |
|||
`TAX` varchar(20) DEFAULT NULL, |
|||
`DETAILS` text, |
|||
`OPERATOR_ID` varchar(50) DEFAULT NULL, |
|||
`CREATE_DATE` datetime DEFAULT NULL, |
|||
`CURRENCY` varchar(10) DEFAULT NULL, |
|||
`CHECKED` smallint(6) DEFAULT NULL, |
|||
`DESC` varchar(100) DEFAULT NULL, |
|||
`MESSAGE` varchar(100) DEFAULT NULL, |
|||
`PAY_DATE` varchar(11) DEFAULT NULL, |
|||
`POSTING_DATE` date DEFAULT NULL, |
|||
`DEDUCT_TIME` date DEFAULT NULL, |
|||
`DEDUCT_STATUS` varchar(255) DEFAULT NULL, |
|||
`INVOICE_TYPE` int(11) DEFAULT NULL COMMENT '发票类型', |
|||
`VALID_STATUS` tinyint(1) DEFAULT '0' COMMENT '验真状态 0、未验真 1、已验真', |
|||
`VALID_COUNT` int(11) DEFAULT '0' COMMENT '验真总次数', |
|||
`VALID_DAY_COUNT` int(11) DEFAULT '0' COMMENT '当日验真次数', |
|||
`MATCH_STATUS` tinyint(3) unsigned DEFAULT NULL, |
|||
`OWNER` int(11) DEFAULT NULL COMMENT '所属用户ID', |
|||
`IS_DEL` tinyint(1) DEFAULT '0', |
|||
`USE_STATUS` tinyint(1) DEFAULT '0' COMMENT '使用状态 0 未使用 1 已使用 2 后票', |
|||
`SUBJECT` int(11) DEFAULT NULL COMMENT '科目id', |
|||
`MATCH_TYPE` tinyint(1) DEFAULT '0' COMMENT '匹配类型 0 金额 1 数量 一般为1', |
|||
`PRICE_TYPE` tinyint(1) DEFAULT '0' COMMENT '税前税后匹配:0 税前 1 税后', |
|||
`PERIOD` varchar(30) DEFAULT NULL, |
|||
`source_id` bigint(20) unsigned zerofill NOT NULL AUTO_INCREMENT, |
|||
`RECEIVED` varchar(50) DEFAULT NULL COMMENT '接收状态 1是正常 2是未找到对应数据 3是发票异常', |
|||
`NUMBER_BACKUP` varchar(100) DEFAULT NULL, |
|||
`NUMBER_CONFIRM` varchar(100) DEFAULT NULL, |
|||
`COMPANY_SEAL` varchar(100) DEFAULT NULL, |
|||
`DEDUCTION_AMOUNT` varchar(50) DEFAULT NULL COMMENT '抵扣金额', |
|||
`EXT01` varchar(100) DEFAULT NULL, |
|||
`EXT02` varchar(100) DEFAULT NULL, |
|||
`EXT03` varchar(100) DEFAULT NULL, |
|||
`EXT04` varchar(100) DEFAULT NULL, |
|||
`EXT05` varchar(100) DEFAULT NULL, |
|||
`EXT06` varchar(100) DEFAULT NULL COMMENT '标签编号', |
|||
`EXT07` varchar(100) DEFAULT NULL COMMENT '印泥', |
|||
`EXT08` varchar(100) DEFAULT NULL COMMENT '1:未拉取PO,2:已拉取PO,3:已生成XML', |
|||
`EXT09` varchar(100) DEFAULT NULL, |
|||
`EXT10` varchar(100) DEFAULT NULL, |
|||
PRIMARY KEY (`ID`) USING BTREE, |
|||
KEY `source_id` (`source_id`) USING BTREE |
|||
) ENGINE=InnoDB AUTO_INCREMENT=49352 DEFAULT CHARSET=utf8; |
|||
@ -0,0 +1,22 @@ |
|||
drop table if exists `invoice_pwc_send_log`; |
|||
CREATE TABLE `invoice_pwc_send_log` ( |
|||
`id` bigint(0) NOT NULL AUTO_INCREMENT, |
|||
`p_uuid` varchar(50) NULL COMMENT '发送消息号', |
|||
`p_code` varchar(10) NULL COMMENT '推送结果编码', |
|||
`p_msg` varchar(255) NULL COMMENT '推送结果说明', |
|||
`c_invoice_number` varchar(20) NULL COMMENT '发票号码', |
|||
`c_invoice_code` varchar(20) NULL COMMENT '发票代码', |
|||
`c_error_code` varchar(10) NULL COMMENT '错误code', |
|||
`c_error_msg` varchar(255) NULL COMMENT '错误信息', |
|||
`c_json` varchar(1000) NULL COMMENT '完整json数据', |
|||
`create_date` datetime(0) NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '日志时间', |
|||
`ext01` varchar(255) NULL, |
|||
`ext02` varchar(255) NULL, |
|||
`ext03` varchar(255) NULL, |
|||
`ext04` varchar(255) NULL, |
|||
`ext05` varchar(255) NULL, |
|||
`is_del` smallint(1) NULL, |
|||
`status` varchar(10) NULL, |
|||
`remarks` varchar(255) NULL, |
|||
PRIMARY KEY (`id`) |
|||
); |
|||
@ -0,0 +1,55 @@ |
|||
drop table if exists `invoice_pengfei_nc_header`; |
|||
|
|||
CREATE TABLE `invoice_pengfei_nc_header` ( |
|||
`id` int(11) NOT NULL AUTO_INCREMENT, |
|||
`billmaker` varchar(255) DEFAULT NULL COMMENT '制表人', |
|||
`corigcurrencyid` varchar(20) DEFAULT NULL COMMENT '币种', |
|||
`ntotalorigmny` varchar(20) DEFAULT NULL COMMENT '入账金额', |
|||
`vbillcode` varchar(30) DEFAULT NULL COMMENT '发票号-nc号', |
|||
`pk_invoice` varchar(255) DEFAULT NULL COMMENT '查询发票用的invoice', |
|||
`title` varchar(255) DEFAULT NULL COMMENT '返回的title', |
|||
`pkorg` varchar(255) DEFAULT NULL COMMENT '组织', |
|||
`vdef21` varchar(1000) DEFAULT NULL COMMENT '回写备注', |
|||
`create_date` datetime DEFAULT NULL, |
|||
`update_date` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, |
|||
`flag` varchar(1) DEFAULT NULL COMMENT '是否已发送rpa', |
|||
`status` varchar(255) DEFAULT NULL COMMENT '是否已执行匹配', |
|||
`ext01` varchar(255) DEFAULT NULL, |
|||
`ext02` varchar(255) DEFAULT NULL, |
|||
`ext03` varchar(255) DEFAULT NULL, |
|||
`ext04` varchar(255) DEFAULT NULL, |
|||
`ext05` varchar(255) DEFAULT NULL, |
|||
PRIMARY KEY (`id`), |
|||
UNIQUE KEY `pk` (`vbillcode`) |
|||
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8; |
|||
|
|||
drop table if exists `invoice_pengfei_nc_line`; |
|||
CREATE TABLE `invoice_pengfei_nc_line` ( |
|||
`id` int(11) NOT NULL AUTO_INCREMENT, |
|||
`header_id` int(11) DEFAULT NULL, |
|||
`vmemo` varchar(255) DEFAULT NULL COMMENT '备注-是否需要处理?', |
|||
`vsourcecode` varchar(50) DEFAULT NULL COMMENT '收获单据号', |
|||
`vordercode` varchar(50) DEFAULT NULL COMMENT 'po号', |
|||
`vfirstrowno` varchar(10) DEFAULT NULL COMMENT 'Po行号', |
|||
`nastorigprice` varchar(20) DEFAULT NULL COMMENT '无税单价', |
|||
`nshouldnum` varchar(20) DEFAULT NULL COMMENT '供应商发货数量', |
|||
`nnum` varchar(20) DEFAULT NULL COMMENT '开票数量', |
|||
`norigmny` varchar(20) DEFAULT NULL COMMENT '无税金额', |
|||
`ntaxrate` varchar(20) DEFAULT NULL COMMENT '税率', |
|||
`pk_material_code` varchar(50) DEFAULT NULL COMMENT '物料编码', |
|||
`pk_material_name` varchar(255) DEFAULT NULL COMMENT '物料名称', |
|||
`pk_material_graphid` varchar(50) DEFAULT NULL COMMENT '物料图号', |
|||
`pk_material_materialspec` varchar(255) DEFAULT NULL COMMENT '物料规格', |
|||
`pk_material_materialtype` varchar(255) DEFAULT NULL COMMENT '物料型号', |
|||
`pk_supplier_name` varchar(255) DEFAULT NULL COMMENT '供应商名称', |
|||
`pk_supplier_code` varchar(20) DEFAULT NULL COMMENT '供应商编码', |
|||
`pk_supplier_taxpayerid` varchar(50) DEFAULT NULL COMMENT '供应商税号', |
|||
`csourcebid` varchar(255) DEFAULT NULL, |
|||
`uom` varchar(255) DEFAULT NULL, |
|||
`ext01` varchar(255) DEFAULT NULL, |
|||
`ext02` varchar(255) DEFAULT NULL, |
|||
`ext03` varchar(255) DEFAULT NULL, |
|||
`pk_invoice` varchar(255) DEFAULT NULL, |
|||
`dbilldate` varchar(255) DEFAULT NULL, |
|||
PRIMARY KEY (`id`) |
|||
) ENGINE=InnoDB AUTO_INCREMENT=155 DEFAULT CHARSET=utf8; |
|||
@ -0,0 +1,8 @@ |
|||
ALTER TABLE `report_images` |
|||
ADD COLUMN `source` varchar(50) NULL AFTER `IMG_URI`, |
|||
ADD COLUMN `create_date` datetime NULL AFTER `source`, |
|||
ADD COLUMN `ext01` varchar(255) NULL AFTER `create_date`, |
|||
ADD COLUMN `ext02` varchar(255) NULL AFTER `ext01`, |
|||
ADD COLUMN `ext03` varchar(255) NULL AFTER `ext02`, |
|||
ADD COLUMN `ext04` varchar(255) NULL AFTER `ext03`, |
|||
ADD COLUMN `ext05` varchar(255) NULL AFTER `ext04`; |
|||
@ -0,0 +1,22 @@ |
|||
ALTER TABLE `fees_invoice`.`corporate_invoice_items` |
|||
ADD COLUMN `ITEM_NO` varchar(100) NULL AFTER `ORIGIN_PRICE`, |
|||
ADD COLUMN `EXT01` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `ITEM_NO`, |
|||
ADD COLUMN `EXT02` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `EXT01`, |
|||
ADD COLUMN `EXT03` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `EXT02`, |
|||
ADD COLUMN `EXT04` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `EXT03`, |
|||
ADD COLUMN `EXT05` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `EXT04`; |
|||
|
|||
CREATE TABLE `supplier_material_define` ( |
|||
`id` bigint(20) NOT NULL AUTO_INCREMENT, |
|||
`item_no` varchar(100) NOT NULL COMMENT '物料号', |
|||
`similar_item_no` varchar(100) DEFAULT NULL COMMENT '相似物料号', |
|||
`item_type` varchar(50) DEFAULT NULL COMMENT '0:按单价匹配/1:相似物料', |
|||
`remark` varchar(100) DEFAULT NULL, |
|||
`ext01` varchar(100) DEFAULT NULL, |
|||
`ext02` varchar(100) DEFAULT NULL, |
|||
`ext03` varchar(100) DEFAULT NULL, |
|||
`ext04` varchar(100) DEFAULT NULL, |
|||
`ext05` varchar(100) DEFAULT NULL, |
|||
PRIMARY KEY (`id`) |
|||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; |
|||
|
|||
@ -0,0 +1 @@ |
|||
INSERT INTO `<table_name>` (`company`, `NAME`, `SUBJECT`, `LEDGER`, `COMPANY_ID`, `DEPID`) VALUES ('上海博道电子商务有限公司', 'shop01', '返点积分', NULL, 6, '3202'); |
|||
@ -0,0 +1,82 @@ |
|||
create table supplier_diff_allow |
|||
( |
|||
id int, |
|||
org_id int not null, |
|||
cor_type_id int not null, |
|||
diff_allow boolean default true not null |
|||
) |
|||
comment '差异配置'; |
|||
|
|||
create unique index supplier_diff_allow_id_uindex |
|||
on supplier_diff_allow (id); |
|||
|
|||
alter table supplier_diff_allow |
|||
add constraint supplier_diff_allow_pk |
|||
primary key (id); |
|||
|
|||
alter table supplier_diff_allow |
|||
modify id int auto_increment; |
|||
|
|||
alter table supplier_matching_log |
|||
add REASON VARCHAR(255) null; |
|||
|
|||
create table concur_event_log |
|||
( |
|||
id bigint, |
|||
entry_id varchar(50) null, |
|||
filepath varchar(255) null, |
|||
original_path varchar(255) null, |
|||
create_time datetime null |
|||
) |
|||
comment 'concur event log'; |
|||
|
|||
create unique index concur_event_log_id_uindex |
|||
on concur_event_log (id); |
|||
|
|||
alter table concur_event_log |
|||
add constraint concur_event_log_pk |
|||
primary key (id); |
|||
|
|||
alter table concur_event_log |
|||
modify id bigint auto_increment; |
|||
|
|||
CREATE TABLE `mileage` |
|||
( |
|||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', |
|||
`name` varchar(255) DEFAULT NULL, |
|||
`money` double DEFAULT NULL COMMENT '金额', |
|||
`currency` varchar(50) DEFAULT NULL COMMENT '币种', |
|||
`mileage_sum` double NOT NULL DEFAULT '0' COMMENT '总里程', |
|||
`mileage_date` datetime DEFAULT NULL COMMENT '里程日期', |
|||
`mileage_date_sum` varchar(255) DEFAULT NULL COMMENT '耗时总计', |
|||
`location_start` varchar(255) DEFAULT NULL COMMENT '起点', |
|||
`location_end` varchar(255) DEFAULT NULL COMMENT '终点', |
|||
`status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0/未完成 1/已完成', |
|||
`used_status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0/未使用 1/已使用', |
|||
`user_id` int(11) NOT NULL, |
|||
`create_time` datetime DEFAULT NULL, |
|||
`update_time` datetime DEFAULT NULL, |
|||
`mileage_sum_affirm` double NOT NULL DEFAULT '0' COMMENT '确认里程数', |
|||
`remark` varchar(255) DEFAULT NULL, |
|||
`image` varchar(255) DEFAULT NULL, |
|||
PRIMARY KEY (`id`) USING BTREE |
|||
) ENGINE = InnoDB |
|||
AUTO_INCREMENT = 1669 |
|||
DEFAULT CHARSET = utf8; |
|||
|
|||
CREATE TABLE `mileage_detail` |
|||
( |
|||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', |
|||
`mileage_id` bigint(20) NOT NULL COMMENT '里程ID', |
|||
`sort` int NOT NULL DEFAULT '0' COMMENT '里程顺序 0为起点', |
|||
`title` varchar(255) DEFAULT NULL COMMENT '地点名称', |
|||
`longitude` double DEFAULT NULL COMMENT '经度', |
|||
`latitude` double DEFAULT NULL COMMENT '纬度', |
|||
`distance` double NOT NULL DEFAULT '0' COMMENT '与上一个地点的距离', |
|||
`arrive_time` datetime DEFAULT NULL COMMENT '到达该地点时间', |
|||
`create_time` datetime DEFAULT NULL, |
|||
`update_time` datetime DEFAULT NULL, |
|||
PRIMARY KEY (`id`) USING BTREE |
|||
) ENGINE = InnoDB |
|||
AUTO_INCREMENT = 1669 |
|||
DEFAULT CHARSET = utf8 COMMENT ='里程途径地点细节'; |
|||
@ -0,0 +1,31 @@ |
|||
/* |
|||
Navicat Premium Data Transfer |
|||
|
|||
Source Server : fees-invoice |
|||
Source Server Type : MySQL |
|||
Source Server Version : 50726 |
|||
Source Host : reg.qcisoft.com:29330 |
|||
Source Schema : fees_invoice |
|||
|
|||
Target Server Type : MySQL |
|||
Target Server Version : 50726 |
|||
File Encoding : 65001 |
|||
|
|||
Date: 22/03/2022 11:09:20 |
|||
*/ |
|||
|
|||
SET NAMES utf8mb4; |
|||
SET FOREIGN_KEY_CHECKS = 0; |
|||
|
|||
-- ---------------------------- |
|||
-- Table structure for account_period |
|||
-- ---------------------------- |
|||
DROP TABLE IF EXISTS `account_period`; |
|||
CREATE TABLE `account_period` ( |
|||
`ID` int(10) NOT NULL, |
|||
`STATUS` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
|||
`PERIOD` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
|||
PRIMARY KEY (`ID`) USING BTREE |
|||
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; |
|||
|
|||
SET FOREIGN_KEY_CHECKS = 1; |
|||
@ -0,0 +1,400 @@ |
|||
/* |
|||
Navicat Premium Data Transfer |
|||
|
|||
Source Server : fees-invoice |
|||
Source Server Type : MySQL |
|||
Source Server Version : 50726 |
|||
Source Host : reg.qcisoft.com:29330 |
|||
Source Schema : fees_invoice |
|||
|
|||
Target Server Type : MySQL |
|||
Target Server Version : 50726 |
|||
File Encoding : 65001 |
|||
|
|||
Date: 19/05/2022 16:43:48 |
|||
*/ |
|||
|
|||
SET NAMES utf8mb4; |
|||
SET FOREIGN_KEY_CHECKS = 0; |
|||
|
|||
-- ---------------------------- |
|||
-- Table structure for t_public_workday |
|||
-- ---------------------------- |
|||
DROP TABLE IF EXISTS `t_public_workday`; |
|||
CREATE TABLE `t_public_workday` ( |
|||
`ID` int(20) NOT NULL AUTO_INCREMENT, |
|||
`WORK_DAY` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, |
|||
`DAY_TYPE` int(10) NULL DEFAULT 0, |
|||
PRIMARY KEY (`ID`) USING BTREE |
|||
) ENGINE = InnoDB AUTO_INCREMENT = 366 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; |
|||
|
|||
-- ---------------------------- |
|||
-- Records of t_public_workday |
|||
-- ---------------------------- |
|||
INSERT INTO `t_public_workday` VALUES (1, '2022-01-01', 1); |
|||
INSERT INTO `t_public_workday` VALUES (2, '2022-01-02', 1); |
|||
INSERT INTO `t_public_workday` VALUES (3, '2022-01-03', 1); |
|||
INSERT INTO `t_public_workday` VALUES (4, '2022-01-04', 0); |
|||
INSERT INTO `t_public_workday` VALUES (5, '2022-01-05', 0); |
|||
INSERT INTO `t_public_workday` VALUES (6, '2022-01-06', 0); |
|||
INSERT INTO `t_public_workday` VALUES (7, '2022-01-07', 0); |
|||
INSERT INTO `t_public_workday` VALUES (8, '2022-01-08', 3); |
|||
INSERT INTO `t_public_workday` VALUES (9, '2022-01-09', 3); |
|||
INSERT INTO `t_public_workday` VALUES (10, '2022-01-10', 0); |
|||
INSERT INTO `t_public_workday` VALUES (11, '2022-01-11', 0); |
|||
INSERT INTO `t_public_workday` VALUES (12, '2022-01-12', 0); |
|||
INSERT INTO `t_public_workday` VALUES (13, '2022-01-13', 0); |
|||
INSERT INTO `t_public_workday` VALUES (14, '2022-01-14', 0); |
|||
INSERT INTO `t_public_workday` VALUES (15, '2022-01-15', 3); |
|||
INSERT INTO `t_public_workday` VALUES (16, '2022-01-16', 3); |
|||
INSERT INTO `t_public_workday` VALUES (17, '2022-01-17', 0); |
|||
INSERT INTO `t_public_workday` VALUES (18, '2022-01-18', 0); |
|||
INSERT INTO `t_public_workday` VALUES (19, '2022-01-19', 0); |
|||
INSERT INTO `t_public_workday` VALUES (20, '2022-01-20', 0); |
|||
INSERT INTO `t_public_workday` VALUES (21, '2022-01-21', 0); |
|||
INSERT INTO `t_public_workday` VALUES (22, '2022-01-22', 3); |
|||
INSERT INTO `t_public_workday` VALUES (23, '2022-01-23', 3); |
|||
INSERT INTO `t_public_workday` VALUES (24, '2022-01-24', 0); |
|||
INSERT INTO `t_public_workday` VALUES (25, '2022-01-25', 0); |
|||
INSERT INTO `t_public_workday` VALUES (26, '2022-01-26', 0); |
|||
INSERT INTO `t_public_workday` VALUES (27, '2022-01-27', 0); |
|||
INSERT INTO `t_public_workday` VALUES (28, '2022-01-28', 0); |
|||
INSERT INTO `t_public_workday` VALUES (29, '2022-01-29', 2); |
|||
INSERT INTO `t_public_workday` VALUES (30, '2022-01-30', 2); |
|||
INSERT INTO `t_public_workday` VALUES (31, '2022-01-31', 1); |
|||
INSERT INTO `t_public_workday` VALUES (32, '2022-02-01', 1); |
|||
INSERT INTO `t_public_workday` VALUES (33, '2022-02-02', 1); |
|||
INSERT INTO `t_public_workday` VALUES (34, '2022-02-03', 1); |
|||
INSERT INTO `t_public_workday` VALUES (35, '2022-02-04', 1); |
|||
INSERT INTO `t_public_workday` VALUES (36, '2022-02-05', 1); |
|||
INSERT INTO `t_public_workday` VALUES (37, '2022-02-06', 1); |
|||
INSERT INTO `t_public_workday` VALUES (38, '2022-02-07', 0); |
|||
INSERT INTO `t_public_workday` VALUES (39, '2022-02-08', 0); |
|||
INSERT INTO `t_public_workday` VALUES (40, '2022-02-09', 0); |
|||
INSERT INTO `t_public_workday` VALUES (41, '2022-02-10', 0); |
|||
INSERT INTO `t_public_workday` VALUES (42, '2022-02-11', 0); |
|||
INSERT INTO `t_public_workday` VALUES (43, '2022-02-12', 3); |
|||
INSERT INTO `t_public_workday` VALUES (44, '2022-02-13', 3); |
|||
INSERT INTO `t_public_workday` VALUES (45, '2022-02-14', 0); |
|||
INSERT INTO `t_public_workday` VALUES (46, '2022-02-15', 0); |
|||
INSERT INTO `t_public_workday` VALUES (47, '2022-02-16', 0); |
|||
INSERT INTO `t_public_workday` VALUES (48, '2022-02-17', 0); |
|||
INSERT INTO `t_public_workday` VALUES (49, '2022-02-18', 0); |
|||
INSERT INTO `t_public_workday` VALUES (50, '2022-02-19', 3); |
|||
INSERT INTO `t_public_workday` VALUES (51, '2022-02-20', 3); |
|||
INSERT INTO `t_public_workday` VALUES (52, '2022-02-21', 0); |
|||
INSERT INTO `t_public_workday` VALUES (53, '2022-02-22', 0); |
|||
INSERT INTO `t_public_workday` VALUES (54, '2022-02-23', 0); |
|||
INSERT INTO `t_public_workday` VALUES (55, '2022-02-24', 0); |
|||
INSERT INTO `t_public_workday` VALUES (56, '2022-02-25', 0); |
|||
INSERT INTO `t_public_workday` VALUES (57, '2022-02-26', 3); |
|||
INSERT INTO `t_public_workday` VALUES (58, '2022-02-27', 3); |
|||
INSERT INTO `t_public_workday` VALUES (59, '2022-02-28', 0); |
|||
INSERT INTO `t_public_workday` VALUES (60, '2022-03-01', 0); |
|||
INSERT INTO `t_public_workday` VALUES (61, '2022-03-02', 0); |
|||
INSERT INTO `t_public_workday` VALUES (62, '2022-03-03', 0); |
|||
INSERT INTO `t_public_workday` VALUES (63, '2022-03-04', 0); |
|||
INSERT INTO `t_public_workday` VALUES (64, '2022-03-05', 3); |
|||
INSERT INTO `t_public_workday` VALUES (65, '2022-03-06', 3); |
|||
INSERT INTO `t_public_workday` VALUES (66, '2022-03-07', 0); |
|||
INSERT INTO `t_public_workday` VALUES (67, '2022-03-08', 0); |
|||
INSERT INTO `t_public_workday` VALUES (68, '2022-03-09', 0); |
|||
INSERT INTO `t_public_workday` VALUES (69, '2022-03-10', 0); |
|||
INSERT INTO `t_public_workday` VALUES (70, '2022-03-11', 0); |
|||
INSERT INTO `t_public_workday` VALUES (71, '2022-03-12', 3); |
|||
INSERT INTO `t_public_workday` VALUES (72, '2022-03-13', 3); |
|||
INSERT INTO `t_public_workday` VALUES (73, '2022-03-14', 0); |
|||
INSERT INTO `t_public_workday` VALUES (74, '2022-03-15', 0); |
|||
INSERT INTO `t_public_workday` VALUES (75, '2022-03-16', 0); |
|||
INSERT INTO `t_public_workday` VALUES (76, '2022-03-17', 0); |
|||
INSERT INTO `t_public_workday` VALUES (77, '2022-03-18', 0); |
|||
INSERT INTO `t_public_workday` VALUES (78, '2022-03-19', 3); |
|||
INSERT INTO `t_public_workday` VALUES (79, '2022-03-20', 3); |
|||
INSERT INTO `t_public_workday` VALUES (80, '2022-03-21', 0); |
|||
INSERT INTO `t_public_workday` VALUES (81, '2022-03-22', 0); |
|||
INSERT INTO `t_public_workday` VALUES (82, '2022-03-23', 0); |
|||
INSERT INTO `t_public_workday` VALUES (83, '2022-03-24', 0); |
|||
INSERT INTO `t_public_workday` VALUES (84, '2022-03-25', 0); |
|||
INSERT INTO `t_public_workday` VALUES (85, '2022-03-26', 3); |
|||
INSERT INTO `t_public_workday` VALUES (86, '2022-03-27', 3); |
|||
INSERT INTO `t_public_workday` VALUES (87, '2022-03-28', 0); |
|||
INSERT INTO `t_public_workday` VALUES (88, '2022-03-29', 0); |
|||
INSERT INTO `t_public_workday` VALUES (89, '2022-03-30', 0); |
|||
INSERT INTO `t_public_workday` VALUES (90, '2022-03-31', 0); |
|||
INSERT INTO `t_public_workday` VALUES (91, '2022-04-01', 0); |
|||
INSERT INTO `t_public_workday` VALUES (92, '2022-04-02', 2); |
|||
INSERT INTO `t_public_workday` VALUES (93, '2022-04-03', 1); |
|||
INSERT INTO `t_public_workday` VALUES (94, '2022-04-04', 1); |
|||
INSERT INTO `t_public_workday` VALUES (95, '2022-04-05', 1); |
|||
INSERT INTO `t_public_workday` VALUES (96, '2022-04-06', 0); |
|||
INSERT INTO `t_public_workday` VALUES (97, '2022-04-07', 0); |
|||
INSERT INTO `t_public_workday` VALUES (98, '2022-04-08', 0); |
|||
INSERT INTO `t_public_workday` VALUES (99, '2022-04-09', 3); |
|||
INSERT INTO `t_public_workday` VALUES (100, '2022-04-10', 3); |
|||
INSERT INTO `t_public_workday` VALUES (101, '2022-04-11', 0); |
|||
INSERT INTO `t_public_workday` VALUES (102, '2022-04-12', 0); |
|||
INSERT INTO `t_public_workday` VALUES (103, '2022-04-13', 0); |
|||
INSERT INTO `t_public_workday` VALUES (104, '2022-04-14', 0); |
|||
INSERT INTO `t_public_workday` VALUES (105, '2022-04-15', 0); |
|||
INSERT INTO `t_public_workday` VALUES (106, '2022-04-16', 3); |
|||
INSERT INTO `t_public_workday` VALUES (107, '2022-04-17', 3); |
|||
INSERT INTO `t_public_workday` VALUES (108, '2022-04-18', 0); |
|||
INSERT INTO `t_public_workday` VALUES (109, '2022-04-19', 0); |
|||
INSERT INTO `t_public_workday` VALUES (110, '2022-04-20', 0); |
|||
INSERT INTO `t_public_workday` VALUES (111, '2022-04-21', 0); |
|||
INSERT INTO `t_public_workday` VALUES (112, '2022-04-22', 0); |
|||
INSERT INTO `t_public_workday` VALUES (113, '2022-04-23', 3); |
|||
INSERT INTO `t_public_workday` VALUES (114, '2022-04-24', 2); |
|||
INSERT INTO `t_public_workday` VALUES (115, '2022-04-25', 0); |
|||
INSERT INTO `t_public_workday` VALUES (116, '2022-04-26', 0); |
|||
INSERT INTO `t_public_workday` VALUES (117, '2022-04-27', 0); |
|||
INSERT INTO `t_public_workday` VALUES (118, '2022-04-28', 0); |
|||
INSERT INTO `t_public_workday` VALUES (119, '2022-04-29', 0); |
|||
INSERT INTO `t_public_workday` VALUES (120, '2022-04-30', 1); |
|||
INSERT INTO `t_public_workday` VALUES (121, '2022-05-01', 1); |
|||
INSERT INTO `t_public_workday` VALUES (122, '2022-05-02', 1); |
|||
INSERT INTO `t_public_workday` VALUES (123, '2022-05-03', 1); |
|||
INSERT INTO `t_public_workday` VALUES (124, '2022-05-04', 1); |
|||
INSERT INTO `t_public_workday` VALUES (125, '2022-05-05', 0); |
|||
INSERT INTO `t_public_workday` VALUES (126, '2022-05-06', 0); |
|||
INSERT INTO `t_public_workday` VALUES (127, '2022-05-07', 2); |
|||
INSERT INTO `t_public_workday` VALUES (128, '2022-05-08', 3); |
|||
INSERT INTO `t_public_workday` VALUES (129, '2022-05-09', 0); |
|||
INSERT INTO `t_public_workday` VALUES (130, '2022-05-10', 0); |
|||
INSERT INTO `t_public_workday` VALUES (131, '2022-05-11', 0); |
|||
INSERT INTO `t_public_workday` VALUES (132, '2022-05-12', 0); |
|||
INSERT INTO `t_public_workday` VALUES (133, '2022-05-13', 0); |
|||
INSERT INTO `t_public_workday` VALUES (134, '2022-05-14', 3); |
|||
INSERT INTO `t_public_workday` VALUES (135, '2022-05-15', 3); |
|||
INSERT INTO `t_public_workday` VALUES (136, '2022-05-16', 0); |
|||
INSERT INTO `t_public_workday` VALUES (137, '2022-05-17', 0); |
|||
INSERT INTO `t_public_workday` VALUES (138, '2022-05-18', 0); |
|||
INSERT INTO `t_public_workday` VALUES (139, '2022-05-19', 0); |
|||
INSERT INTO `t_public_workday` VALUES (140, '2022-05-20', 0); |
|||
INSERT INTO `t_public_workday` VALUES (141, '2022-05-21', 3); |
|||
INSERT INTO `t_public_workday` VALUES (142, '2022-05-22', 3); |
|||
INSERT INTO `t_public_workday` VALUES (143, '2022-05-23', 0); |
|||
INSERT INTO `t_public_workday` VALUES (144, '2022-05-24', 0); |
|||
INSERT INTO `t_public_workday` VALUES (145, '2022-05-25', 0); |
|||
INSERT INTO `t_public_workday` VALUES (146, '2022-05-26', 0); |
|||
INSERT INTO `t_public_workday` VALUES (147, '2022-05-27', 0); |
|||
INSERT INTO `t_public_workday` VALUES (148, '2022-05-28', 3); |
|||
INSERT INTO `t_public_workday` VALUES (149, '2022-05-29', 3); |
|||
INSERT INTO `t_public_workday` VALUES (150, '2022-05-30', 0); |
|||
INSERT INTO `t_public_workday` VALUES (151, '2022-05-31', 0); |
|||
INSERT INTO `t_public_workday` VALUES (152, '2022-06-01', 0); |
|||
INSERT INTO `t_public_workday` VALUES (153, '2022-06-02', 0); |
|||
INSERT INTO `t_public_workday` VALUES (154, '2022-06-03', 1); |
|||
INSERT INTO `t_public_workday` VALUES (155, '2022-06-04', 1); |
|||
INSERT INTO `t_public_workday` VALUES (156, '2022-06-05', 1); |
|||
INSERT INTO `t_public_workday` VALUES (157, '2022-06-06', 0); |
|||
INSERT INTO `t_public_workday` VALUES (158, '2022-06-07', 0); |
|||
INSERT INTO `t_public_workday` VALUES (159, '2022-06-08', 0); |
|||
INSERT INTO `t_public_workday` VALUES (160, '2022-06-09', 0); |
|||
INSERT INTO `t_public_workday` VALUES (161, '2022-06-10', 0); |
|||
INSERT INTO `t_public_workday` VALUES (162, '2022-06-11', 3); |
|||
INSERT INTO `t_public_workday` VALUES (163, '2022-06-12', 3); |
|||
INSERT INTO `t_public_workday` VALUES (164, '2022-06-13', 0); |
|||
INSERT INTO `t_public_workday` VALUES (165, '2022-06-14', 0); |
|||
INSERT INTO `t_public_workday` VALUES (166, '2022-06-15', 0); |
|||
INSERT INTO `t_public_workday` VALUES (167, '2022-06-16', 0); |
|||
INSERT INTO `t_public_workday` VALUES (168, '2022-06-17', 0); |
|||
INSERT INTO `t_public_workday` VALUES (169, '2022-06-18', 3); |
|||
INSERT INTO `t_public_workday` VALUES (170, '2022-06-19', 3); |
|||
INSERT INTO `t_public_workday` VALUES (171, '2022-06-20', 0); |
|||
INSERT INTO `t_public_workday` VALUES (172, '2022-06-21', 0); |
|||
INSERT INTO `t_public_workday` VALUES (173, '2022-06-22', 0); |
|||
INSERT INTO `t_public_workday` VALUES (174, '2022-06-23', 0); |
|||
INSERT INTO `t_public_workday` VALUES (175, '2022-06-24', 0); |
|||
INSERT INTO `t_public_workday` VALUES (176, '2022-06-25', 3); |
|||
INSERT INTO `t_public_workday` VALUES (177, '2022-06-26', 3); |
|||
INSERT INTO `t_public_workday` VALUES (178, '2022-06-27', 0); |
|||
INSERT INTO `t_public_workday` VALUES (179, '2022-06-28', 0); |
|||
INSERT INTO `t_public_workday` VALUES (180, '2022-06-29', 0); |
|||
INSERT INTO `t_public_workday` VALUES (181, '2022-06-30', 0); |
|||
INSERT INTO `t_public_workday` VALUES (182, '2022-07-01', 0); |
|||
INSERT INTO `t_public_workday` VALUES (183, '2022-07-02', 3); |
|||
INSERT INTO `t_public_workday` VALUES (184, '2022-07-03', 3); |
|||
INSERT INTO `t_public_workday` VALUES (185, '2022-07-04', 0); |
|||
INSERT INTO `t_public_workday` VALUES (186, '2022-07-05', 0); |
|||
INSERT INTO `t_public_workday` VALUES (187, '2022-07-06', 0); |
|||
INSERT INTO `t_public_workday` VALUES (188, '2022-07-07', 0); |
|||
INSERT INTO `t_public_workday` VALUES (189, '2022-07-08', 0); |
|||
INSERT INTO `t_public_workday` VALUES (190, '2022-07-09', 3); |
|||
INSERT INTO `t_public_workday` VALUES (191, '2022-07-10', 3); |
|||
INSERT INTO `t_public_workday` VALUES (192, '2022-07-11', 0); |
|||
INSERT INTO `t_public_workday` VALUES (193, '2022-07-12', 0); |
|||
INSERT INTO `t_public_workday` VALUES (194, '2022-07-13', 0); |
|||
INSERT INTO `t_public_workday` VALUES (195, '2022-07-14', 0); |
|||
INSERT INTO `t_public_workday` VALUES (196, '2022-07-15', 0); |
|||
INSERT INTO `t_public_workday` VALUES (197, '2022-07-16', 3); |
|||
INSERT INTO `t_public_workday` VALUES (198, '2022-07-17', 3); |
|||
INSERT INTO `t_public_workday` VALUES (199, '2022-07-18', 0); |
|||
INSERT INTO `t_public_workday` VALUES (200, '2022-07-19', 0); |
|||
INSERT INTO `t_public_workday` VALUES (201, '2022-07-20', 0); |
|||
INSERT INTO `t_public_workday` VALUES (202, '2022-07-21', 0); |
|||
INSERT INTO `t_public_workday` VALUES (203, '2022-07-22', 0); |
|||
INSERT INTO `t_public_workday` VALUES (204, '2022-07-23', 3); |
|||
INSERT INTO `t_public_workday` VALUES (205, '2022-07-24', 3); |
|||
INSERT INTO `t_public_workday` VALUES (206, '2022-07-25', 0); |
|||
INSERT INTO `t_public_workday` VALUES (207, '2022-07-26', 0); |
|||
INSERT INTO `t_public_workday` VALUES (208, '2022-07-27', 0); |
|||
INSERT INTO `t_public_workday` VALUES (209, '2022-07-28', 0); |
|||
INSERT INTO `t_public_workday` VALUES (210, '2022-07-29', 0); |
|||
INSERT INTO `t_public_workday` VALUES (211, '2022-07-30', 3); |
|||
INSERT INTO `t_public_workday` VALUES (212, '2022-07-31', 3); |
|||
INSERT INTO `t_public_workday` VALUES (213, '2022-08-01', 0); |
|||
INSERT INTO `t_public_workday` VALUES (214, '2022-08-02', 0); |
|||
INSERT INTO `t_public_workday` VALUES (215, '2022-08-03', 0); |
|||
INSERT INTO `t_public_workday` VALUES (216, '2022-08-04', 0); |
|||
INSERT INTO `t_public_workday` VALUES (217, '2022-08-05', 0); |
|||
INSERT INTO `t_public_workday` VALUES (218, '2022-08-06', 3); |
|||
INSERT INTO `t_public_workday` VALUES (219, '2022-08-07', 3); |
|||
INSERT INTO `t_public_workday` VALUES (220, '2022-08-08', 0); |
|||
INSERT INTO `t_public_workday` VALUES (221, '2022-08-09', 0); |
|||
INSERT INTO `t_public_workday` VALUES (222, '2022-08-10', 0); |
|||
INSERT INTO `t_public_workday` VALUES (223, '2022-08-11', 0); |
|||
INSERT INTO `t_public_workday` VALUES (224, '2022-08-12', 0); |
|||
INSERT INTO `t_public_workday` VALUES (225, '2022-08-13', 3); |
|||
INSERT INTO `t_public_workday` VALUES (226, '2022-08-14', 3); |
|||
INSERT INTO `t_public_workday` VALUES (227, '2022-08-15', 0); |
|||
INSERT INTO `t_public_workday` VALUES (228, '2022-08-16', 0); |
|||
INSERT INTO `t_public_workday` VALUES (229, '2022-08-17', 0); |
|||
INSERT INTO `t_public_workday` VALUES (230, '2022-08-18', 0); |
|||
INSERT INTO `t_public_workday` VALUES (231, '2022-08-19', 0); |
|||
INSERT INTO `t_public_workday` VALUES (232, '2022-08-20', 3); |
|||
INSERT INTO `t_public_workday` VALUES (233, '2022-08-21', 3); |
|||
INSERT INTO `t_public_workday` VALUES (234, '2022-08-22', 0); |
|||
INSERT INTO `t_public_workday` VALUES (235, '2022-08-23', 0); |
|||
INSERT INTO `t_public_workday` VALUES (236, '2022-08-24', 0); |
|||
INSERT INTO `t_public_workday` VALUES (237, '2022-08-25', 0); |
|||
INSERT INTO `t_public_workday` VALUES (238, '2022-08-26', 0); |
|||
INSERT INTO `t_public_workday` VALUES (239, '2022-08-27', 3); |
|||
INSERT INTO `t_public_workday` VALUES (240, '2022-08-28', 3); |
|||
INSERT INTO `t_public_workday` VALUES (241, '2022-08-29', 0); |
|||
INSERT INTO `t_public_workday` VALUES (242, '2022-08-30', 0); |
|||
INSERT INTO `t_public_workday` VALUES (243, '2022-08-31', 0); |
|||
INSERT INTO `t_public_workday` VALUES (244, '2022-09-01', 0); |
|||
INSERT INTO `t_public_workday` VALUES (245, '2022-09-02', 0); |
|||
INSERT INTO `t_public_workday` VALUES (246, '2022-09-03', 3); |
|||
INSERT INTO `t_public_workday` VALUES (247, '2022-09-04', 3); |
|||
INSERT INTO `t_public_workday` VALUES (248, '2022-09-05', 0); |
|||
INSERT INTO `t_public_workday` VALUES (249, '2022-09-06', 0); |
|||
INSERT INTO `t_public_workday` VALUES (250, '2022-09-07', 0); |
|||
INSERT INTO `t_public_workday` VALUES (251, '2022-09-08', 0); |
|||
INSERT INTO `t_public_workday` VALUES (252, '2022-09-09', 0); |
|||
INSERT INTO `t_public_workday` VALUES (253, '2022-09-10', 1); |
|||
INSERT INTO `t_public_workday` VALUES (254, '2022-09-11', 1); |
|||
INSERT INTO `t_public_workday` VALUES (255, '2022-09-12', 1); |
|||
INSERT INTO `t_public_workday` VALUES (256, '2022-09-13', 0); |
|||
INSERT INTO `t_public_workday` VALUES (257, '2022-09-14', 0); |
|||
INSERT INTO `t_public_workday` VALUES (258, '2022-09-15', 0); |
|||
INSERT INTO `t_public_workday` VALUES (259, '2022-09-16', 0); |
|||
INSERT INTO `t_public_workday` VALUES (260, '2022-09-17', 3); |
|||
INSERT INTO `t_public_workday` VALUES (261, '2022-09-18', 3); |
|||
INSERT INTO `t_public_workday` VALUES (262, '2022-09-19', 0); |
|||
INSERT INTO `t_public_workday` VALUES (263, '2022-09-20', 0); |
|||
INSERT INTO `t_public_workday` VALUES (264, '2022-09-21', 0); |
|||
INSERT INTO `t_public_workday` VALUES (265, '2022-09-22', 0); |
|||
INSERT INTO `t_public_workday` VALUES (266, '2022-09-23', 0); |
|||
INSERT INTO `t_public_workday` VALUES (267, '2022-09-24', 3); |
|||
INSERT INTO `t_public_workday` VALUES (268, '2022-09-25', 3); |
|||
INSERT INTO `t_public_workday` VALUES (269, '2022-09-26', 0); |
|||
INSERT INTO `t_public_workday` VALUES (270, '2022-09-27', 0); |
|||
INSERT INTO `t_public_workday` VALUES (271, '2022-09-28', 0); |
|||
INSERT INTO `t_public_workday` VALUES (272, '2022-09-29', 0); |
|||
INSERT INTO `t_public_workday` VALUES (273, '2022-09-30', 0); |
|||
INSERT INTO `t_public_workday` VALUES (274, '2022-10-01', 1); |
|||
INSERT INTO `t_public_workday` VALUES (275, '2022-10-02', 1); |
|||
INSERT INTO `t_public_workday` VALUES (276, '2022-10-03', 1); |
|||
INSERT INTO `t_public_workday` VALUES (277, '2022-10-04', 1); |
|||
INSERT INTO `t_public_workday` VALUES (278, '2022-10-05', 1); |
|||
INSERT INTO `t_public_workday` VALUES (279, '2022-10-06', 1); |
|||
INSERT INTO `t_public_workday` VALUES (280, '2022-10-07', 1); |
|||
INSERT INTO `t_public_workday` VALUES (281, '2022-10-08', 2); |
|||
INSERT INTO `t_public_workday` VALUES (282, '2022-10-09', 2); |
|||
INSERT INTO `t_public_workday` VALUES (283, '2022-10-10', 0); |
|||
INSERT INTO `t_public_workday` VALUES (284, '2022-10-11', 0); |
|||
INSERT INTO `t_public_workday` VALUES (285, '2022-10-12', 0); |
|||
INSERT INTO `t_public_workday` VALUES (286, '2022-10-13', 0); |
|||
INSERT INTO `t_public_workday` VALUES (287, '2022-10-14', 0); |
|||
INSERT INTO `t_public_workday` VALUES (288, '2022-10-15', 3); |
|||
INSERT INTO `t_public_workday` VALUES (289, '2022-10-16', 3); |
|||
INSERT INTO `t_public_workday` VALUES (290, '2022-10-17', 0); |
|||
INSERT INTO `t_public_workday` VALUES (291, '2022-10-18', 0); |
|||
INSERT INTO `t_public_workday` VALUES (292, '2022-10-19', 0); |
|||
INSERT INTO `t_public_workday` VALUES (293, '2022-10-20', 0); |
|||
INSERT INTO `t_public_workday` VALUES (294, '2022-10-21', 0); |
|||
INSERT INTO `t_public_workday` VALUES (295, '2022-10-22', 3); |
|||
INSERT INTO `t_public_workday` VALUES (296, '2022-10-23', 3); |
|||
INSERT INTO `t_public_workday` VALUES (297, '2022-10-24', 0); |
|||
INSERT INTO `t_public_workday` VALUES (298, '2022-10-25', 0); |
|||
INSERT INTO `t_public_workday` VALUES (299, '2022-10-26', 0); |
|||
INSERT INTO `t_public_workday` VALUES (300, '2022-10-27', 0); |
|||
INSERT INTO `t_public_workday` VALUES (301, '2022-10-28', 0); |
|||
INSERT INTO `t_public_workday` VALUES (302, '2022-10-29', 3); |
|||
INSERT INTO `t_public_workday` VALUES (303, '2022-10-30', 3); |
|||
INSERT INTO `t_public_workday` VALUES (304, '2022-10-31', 0); |
|||
INSERT INTO `t_public_workday` VALUES (305, '2022-11-01', 0); |
|||
INSERT INTO `t_public_workday` VALUES (306, '2022-11-02', 0); |
|||
INSERT INTO `t_public_workday` VALUES (307, '2022-11-03', 0); |
|||
INSERT INTO `t_public_workday` VALUES (308, '2022-11-04', 0); |
|||
INSERT INTO `t_public_workday` VALUES (309, '2022-11-05', 3); |
|||
INSERT INTO `t_public_workday` VALUES (310, '2022-11-06', 3); |
|||
INSERT INTO `t_public_workday` VALUES (311, '2022-11-07', 0); |
|||
INSERT INTO `t_public_workday` VALUES (312, '2022-11-08', 0); |
|||
INSERT INTO `t_public_workday` VALUES (313, '2022-11-09', 0); |
|||
INSERT INTO `t_public_workday` VALUES (314, '2022-11-10', 0); |
|||
INSERT INTO `t_public_workday` VALUES (315, '2022-11-11', 0); |
|||
INSERT INTO `t_public_workday` VALUES (316, '2022-11-12', 3); |
|||
INSERT INTO `t_public_workday` VALUES (317, '2022-11-13', 3); |
|||
INSERT INTO `t_public_workday` VALUES (318, '2022-11-14', 0); |
|||
INSERT INTO `t_public_workday` VALUES (319, '2022-11-15', 0); |
|||
INSERT INTO `t_public_workday` VALUES (320, '2022-11-16', 0); |
|||
INSERT INTO `t_public_workday` VALUES (321, '2022-11-17', 0); |
|||
INSERT INTO `t_public_workday` VALUES (322, '2022-11-18', 0); |
|||
INSERT INTO `t_public_workday` VALUES (323, '2022-11-19', 3); |
|||
INSERT INTO `t_public_workday` VALUES (324, '2022-11-20', 3); |
|||
INSERT INTO `t_public_workday` VALUES (325, '2022-11-21', 0); |
|||
INSERT INTO `t_public_workday` VALUES (326, '2022-11-22', 0); |
|||
INSERT INTO `t_public_workday` VALUES (327, '2022-11-23', 0); |
|||
INSERT INTO `t_public_workday` VALUES (328, '2022-11-24', 0); |
|||
INSERT INTO `t_public_workday` VALUES (329, '2022-11-25', 0); |
|||
INSERT INTO `t_public_workday` VALUES (330, '2022-11-26', 3); |
|||
INSERT INTO `t_public_workday` VALUES (331, '2022-11-27', 3); |
|||
INSERT INTO `t_public_workday` VALUES (332, '2022-11-28', 0); |
|||
INSERT INTO `t_public_workday` VALUES (333, '2022-11-29', 0); |
|||
INSERT INTO `t_public_workday` VALUES (334, '2022-11-30', 0); |
|||
INSERT INTO `t_public_workday` VALUES (335, '2022-12-01', 0); |
|||
INSERT INTO `t_public_workday` VALUES (336, '2022-12-02', 0); |
|||
INSERT INTO `t_public_workday` VALUES (337, '2022-12-03', 3); |
|||
INSERT INTO `t_public_workday` VALUES (338, '2022-12-04', 3); |
|||
INSERT INTO `t_public_workday` VALUES (339, '2022-12-05', 0); |
|||
INSERT INTO `t_public_workday` VALUES (340, '2022-12-06', 0); |
|||
INSERT INTO `t_public_workday` VALUES (341, '2022-12-07', 0); |
|||
INSERT INTO `t_public_workday` VALUES (342, '2022-12-08', 0); |
|||
INSERT INTO `t_public_workday` VALUES (343, '2022-12-09', 0); |
|||
INSERT INTO `t_public_workday` VALUES (344, '2022-12-10', 3); |
|||
INSERT INTO `t_public_workday` VALUES (345, '2022-12-11', 3); |
|||
INSERT INTO `t_public_workday` VALUES (346, '2022-12-12', 0); |
|||
INSERT INTO `t_public_workday` VALUES (347, '2022-12-13', 0); |
|||
INSERT INTO `t_public_workday` VALUES (348, '2022-12-14', 0); |
|||
INSERT INTO `t_public_workday` VALUES (349, '2022-12-15', 0); |
|||
INSERT INTO `t_public_workday` VALUES (350, '2022-12-16', 0); |
|||
INSERT INTO `t_public_workday` VALUES (351, '2022-12-17', 3); |
|||
INSERT INTO `t_public_workday` VALUES (352, '2022-12-18', 3); |
|||
INSERT INTO `t_public_workday` VALUES (353, '2022-12-19', 0); |
|||
INSERT INTO `t_public_workday` VALUES (354, '2022-12-20', 0); |
|||
INSERT INTO `t_public_workday` VALUES (355, '2022-12-21', 0); |
|||
INSERT INTO `t_public_workday` VALUES (356, '2022-12-22', 0); |
|||
INSERT INTO `t_public_workday` VALUES (357, '2022-12-23', 0); |
|||
INSERT INTO `t_public_workday` VALUES (358, '2022-12-24', 3); |
|||
INSERT INTO `t_public_workday` VALUES (359, '2022-12-25', 3); |
|||
INSERT INTO `t_public_workday` VALUES (360, '2022-12-26', 0); |
|||
INSERT INTO `t_public_workday` VALUES (361, '2022-12-27', 0); |
|||
INSERT INTO `t_public_workday` VALUES (362, '2022-12-28', 0); |
|||
INSERT INTO `t_public_workday` VALUES (363, '2022-12-29', 0); |
|||
INSERT INTO `t_public_workday` VALUES (364, '2022-12-30', 0); |
|||
INSERT INTO `t_public_workday` VALUES (365, '2022-12-31', 3); |
|||
|
|||
SET FOREIGN_KEY_CHECKS = 1; |
|||
File diff suppressed because it is too large
@ -0,0 +1,86 @@ |
|||
/** |
|||
* +--------------------------------------------------------- |
|||
* | Author Jared.Yan<yanhuaiwen@163.com> |
|||
* +--------------------------------------------------------- |
|||
* | Copyright (c) http://cmsen.com All rights reserved.
|
|||
* +--------------------------------------------------------- |
|||
*/ |
|||
package com.cmsen.ticket; |
|||
|
|||
import lombok.extern.log4j.Log4j2; |
|||
import net.smarttax.sim.annotation.EnableSmarttaxClient; |
|||
import org.springframework.boot.SpringApplication; |
|||
import org.springframework.boot.autoconfigure.SpringBootApplication; |
|||
import org.springframework.boot.builder.SpringApplicationBuilder; |
|||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; |
|||
import org.springframework.scheduling.annotation.EnableAsync; |
|||
import org.springframework.scheduling.annotation.EnableScheduling; |
|||
import org.springframework.transaction.annotation.EnableTransactionManagement; |
|||
|
|||
import java.lang.management.ManagementFactory; |
|||
import java.lang.management.MemoryMXBean; |
|||
import java.lang.management.MemoryUsage; |
|||
import java.nio.charset.Charset; |
|||
import java.util.TimeZone; |
|||
|
|||
//import org.springframework.cloud.openfeign.EnableFeignClients;
|
|||
|
|||
@EnableAsync |
|||
@SpringBootApplication |
|||
@EnableTransactionManagement(proxyTargetClass = true) |
|||
@EnableScheduling |
|||
@Log4j2 |
|||
@EnableSmarttaxClient(scanPackages = "com.cmsen.ticket.infrastructure.ocr2.listener") |
|||
//@EnableFeignClients
|
|||
public class TicketApplication extends SpringBootServletInitializer { |
|||
public static void main(String[] args) { |
|||
initPrintln(); |
|||
SpringApplication.run(TicketApplication.class, args); |
|||
} |
|||
|
|||
@Override |
|||
protected SpringApplicationBuilder configure(SpringApplicationBuilder SpringApplication) { |
|||
return SpringApplication.sources(TicketApplication.class); |
|||
} |
|||
|
|||
private static void initPrintln() { |
|||
log.info("---------------------------------SYSTEM INFO------------------------------"); |
|||
log.info("java sdk version: " + System.getProperty("java.version")); |
|||
log.info("java sdk vendor: " + System.getProperty("java.vendor")); |
|||
// 打印系统默认字符集
|
|||
log.info("System default charset: " + Charset.defaultCharset().name()); |
|||
log.info("System Type: " + System.getProperty("os.name")); |
|||
log.info("System Arch: " + System.getProperty("os.arch")); |
|||
log.info("System User: " + System.getProperty("user.name")); |
|||
log.info("System Language: " + System.getProperty("user.language")); |
|||
log.info("System default time zone: " + TimeZone.getDefault().getID()); |
|||
log.info("--------------------------------------------------------------------------"); |
|||
currentMemory(); |
|||
log.info("--------------------------------------------------------------------------"); |
|||
} |
|||
|
|||
private static void currentMemory() { |
|||
MemoryMXBean memoryMXBean = ManagementFactory.getMemoryMXBean(); |
|||
MemoryUsage memoryUsage = memoryMXBean.getHeapMemoryUsage(); // 椎内存使用情况
|
|||
long totalMemorySize = memoryUsage.getInit(); // 初始的总内存
|
|||
long maxMemorySize = memoryUsage.getMax(); // 最大可用内存
|
|||
long usedMemorySize = memoryUsage.getUsed(); // 已使用的内存
|
|||
log.info("Memory detail: " + String.format("Total:%s, Free:%s, Max:%s, Used:%s", |
|||
formatByte(totalMemorySize, 2, ""), |
|||
formatByte(totalMemorySize - usedMemorySize, 2, ""), |
|||
formatByte(maxMemorySize, 2, ""), |
|||
formatByte(usedMemorySize, 2, ""))); |
|||
} |
|||
|
|||
public static String formatByte(double length, int precision, String delimiter) { |
|||
if (length <= 0.0D) { |
|||
return "0" + delimiter + "B"; |
|||
} else { |
|||
String[] units = new String[]{"B", "KB", "MB", "GB", "TB", "PB"}; |
|||
int i = (int) (Math.log10(length) / Math.log10(1024.0D)); |
|||
return String.format("%." + precision + "f", length / Math.pow(1024.0D, (double) i)) + delimiter + units[i]; |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
@ -0,0 +1,40 @@ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
import com.cmsen.ticket.domain.entity.manager.InvoiceImage; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author OWTS |
|||
* @version 1.0.0 |
|||
* @date 2021/3/3 14:14 |
|||
**/ |
|||
public interface InvoiceImageService { |
|||
RestResponse list(Map<String, Object> params); |
|||
|
|||
RestResponse selectImg(Integer id); |
|||
|
|||
RestResponse selectByPrimaryKey(Integer id); |
|||
|
|||
RestResponse create(InvoiceImage invoiceImage); |
|||
|
|||
RestResponse update(InvoiceImage invoiceImage); |
|||
|
|||
RestResponse delete(Integer id); |
|||
|
|||
RestResponse deleteBatch(String ids); |
|||
|
|||
RestResponse download(Integer id, HttpServletResponse response); |
|||
|
|||
RestResponse exportExcel(Map<String, Object> params, HttpServletResponse response); |
|||
|
|||
RestResponse downloadImages(Map<String, Object> params, HttpServletResponse response); |
|||
|
|||
RestResponse downloadXmls(Map<String, Object> params, HttpServletResponse response); |
|||
|
|||
RestResponse downloadXmlsPoc(Map<String, Object> params, HttpServletResponse response); |
|||
|
|||
RestResponse getUnMatchImg(String reportId); |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
|
|||
import java.util.Map; |
|||
|
|||
public interface JsadapterService { |
|||
RestResponse list(Map<String, Object> params); |
|||
|
|||
|
|||
RestResponse delete(Integer id); |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author OWTS |
|||
* @version 1.0.0 |
|||
* @date 2022/10/9 16:06 |
|||
**/ |
|||
public interface MtAgreementService { |
|||
|
|||
RestResponse getList(Map<String, Object> params); |
|||
|
|||
RestResponse upload(MultipartFile file); |
|||
|
|||
} |
|||
@ -0,0 +1,54 @@ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author OWTS |
|||
* @version 1.0.0 |
|||
* @date 2022/11/17 16:06 |
|||
**/ |
|||
public interface MtListPcService { |
|||
|
|||
RestResponse listMeetPic(Map<String, Object> params); |
|||
|
|||
RestResponse deletePic(Long id); |
|||
|
|||
RestResponse meetPicUpload(MultipartFile file); |
|||
|
|||
RestResponse insertPic(MultipartFile file, String reqId, String picType, String expenseName, String extId); |
|||
|
|||
RestResponse reqList2(String reqName); |
|||
|
|||
RestResponse valueSetList(String category); |
|||
|
|||
RestResponse meetingSpeakerList(String reqId); |
|||
|
|||
RestResponse listMeeting(Map<String, Object> params); |
|||
|
|||
|
|||
RestResponse getOrgListByPid(Integer pid, String orgName); |
|||
|
|||
RestResponse checkinList(Map<String, Object> params); |
|||
|
|||
|
|||
RestResponse getEditFlag(String roleId); |
|||
|
|||
RestResponse meetingDetails(Long id); |
|||
|
|||
RestResponse meetRevoke(String reqId); |
|||
|
|||
RestResponse meetReActive(String reqId); |
|||
|
|||
RestResponse speakerFallBack(Long id); |
|||
|
|||
RestResponse checkinReset(String reqId); |
|||
|
|||
RestResponse checkinDel(Long id); |
|||
|
|||
RestResponse listSignMeet(Map<String, Object> params); |
|||
|
|||
RestResponse listSignMeetAttend(Map<String, Object> params); |
|||
} |
|||
@ -0,0 +1,99 @@ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
import com.cmsen.ticket.domain.dto.SubmitOrderMatchDto; |
|||
import com.cmsen.ticket.domain.entity.SupplierOrder; |
|||
|
|||
import java.util.Map; |
|||
|
|||
|
|||
public interface PaymentService { |
|||
|
|||
RestResponse list(Map<String, Object> params); |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
RestResponse listCompany(String keyword); |
|||
|
|||
RestResponse listOrg(String keyword); |
|||
|
|||
RestResponse codeList(); |
|||
|
|||
RestResponse getCompOrg(String userId); |
|||
|
|||
RestResponse getUserList(String keyword); |
|||
|
|||
RestResponse getSupplierList(String orgCode, String keyword, String isDigital); |
|||
|
|||
|
|||
RestResponse deleteHeader(String billId); |
|||
|
|||
RestResponse orderList(Map<String, Object> params); |
|||
|
|||
RestResponse createOrder(SupplierOrder supplierOrder); |
|||
|
|||
RestResponse updateOrder(SupplierOrder supplierOrder); |
|||
|
|||
RestResponse deleteOrder(String ids, String orderNo); |
|||
|
|||
RestResponse listItems(Map<String, Object> params); |
|||
|
|||
RestResponse submitOrderMatchList(SubmitOrderMatchDto dto); |
|||
|
|||
RestResponse deleteOrderMatch(Long matchId); |
|||
|
|||
RestResponse submitBill(String billId); |
|||
|
|||
RestResponse recallBill(String billId); |
|||
|
|||
RestResponse backBill(String billId); |
|||
|
|||
RestResponse matchBill(String billId); |
|||
|
|||
RestResponse getPayTypeList(String keyword); |
|||
|
|||
RestResponse getMaterialList(String keyword); |
|||
|
|||
RestResponse getWhiteCompList(String keyword); |
|||
|
|||
RestResponse listContracts(Map<String, Object> params); |
|||
|
|||
RestResponse listPurchaces(Map<String, Object> params); |
|||
|
|||
RestResponse getFlowType(); |
|||
|
|||
RestResponse listBrands(Map<String, Object> params); |
|||
|
|||
RestResponse listReceives(Map<String, Object> params); |
|||
|
|||
RestResponse listInternals(Map<String, Object> params); |
|||
|
|||
RestResponse valueSetList(String category, Integer pid, String keywords); |
|||
|
|||
RestResponse getSysConfig(String code); |
|||
|
|||
RestResponse getBillName(String businessType, String userName); |
|||
|
|||
RestResponse getMatchFlag(String roleId, String userId, String costCenter); |
|||
|
|||
RestResponse getMatchFinFlag(String roleId, String userId); |
|||
|
|||
RestResponse getTransferUser(Map<String, Object> params); |
|||
|
|||
RestResponse transferBill(String billId, String owner, String toUserId); |
|||
|
|||
RestResponse listForTransfer(Map<String, Object> params); |
|||
|
|||
RestResponse transferBatch(Map<String, Object> params, String current, String target); |
|||
|
|||
RestResponse transferRecallBatch(Map<String, Object> params); |
|||
|
|||
RestResponse listOwner(String keyword); |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* @author OWTS |
|||
* @version 1.0.0 |
|||
* @date 2023/6/26 16:06 |
|||
**/ |
|||
public interface PreferencesService { |
|||
RestResponse list(Map<String, Object> params); |
|||
|
|||
RestResponse delete(Integer id); |
|||
|
|||
RestResponse export(Map<String, Object> params, HttpServletResponse response); |
|||
|
|||
RestResponse upload(MultipartFile file); |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.util.Map; |
|||
|
|||
|
|||
public interface ProcureOrderService { |
|||
|
|||
RestResponse list(Map<String, Object> params); |
|||
|
|||
RestResponse detail(String po); |
|||
|
|||
|
|||
RestResponse deletePo(Integer id); |
|||
|
|||
RestResponse lineList(Map<String, Object> params); |
|||
|
|||
RestResponse deleteLine(String ids, String po); |
|||
|
|||
RestResponse uploadPo(MultipartFile file); |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author |
|||
* @version 1.0.0 |
|||
* @date 2024/2/18 16:23 |
|||
**/ |
|||
public interface RuleService { |
|||
RestResponse list(Map<String, Object> params); |
|||
|
|||
|
|||
RestResponse delete(Integer ids); |
|||
} |
|||
@ -0,0 +1,54 @@ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
import com.cmsen.ticket.domain.entity.manager.ComplianceCheck; |
|||
import com.cmsen.ticket.domain.response.Response; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author OWTS |
|||
* @version 1.0.0 |
|||
* @date 2021/9/9 16:20 |
|||
**/ |
|||
public interface SmartImageCheckService { |
|||
|
|||
Response<List<String>> getImages(String id); |
|||
|
|||
|
|||
Response<Object> batchCheck(List<String> reportIds); |
|||
|
|||
Response<Object> compliance(String reportId); |
|||
|
|||
Response<Object> uploadImage(MultipartFile file, String reportId); |
|||
|
|||
Response<Object> forcePassed(List<String> ids); |
|||
|
|||
Response<List<ComplianceCheck>> getComlianceCheckList(String id); |
|||
|
|||
Response<Object> approved(String id); |
|||
|
|||
Response<Object> rejected(String id, String comment); |
|||
|
|||
|
|||
Response<Object> deleteErrorReport(String reportId); |
|||
|
|||
Response<Object> updateErrorReport(Long id, String newReportId); |
|||
|
|||
Response<Object> reCheckErrorReport(Long id); |
|||
|
|||
RestResponse reportLine(String id); |
|||
|
|||
Response<List<String>> getLineImageList(String id); |
|||
|
|||
|
|||
RestResponse getLogList(Map<String, Object> params); |
|||
|
|||
Response<List<String>> getErrImages(String reportId); |
|||
|
|||
RestResponse editRemark(String reportId, String ext02); |
|||
|
|||
Response<Object> delPaperImage(String id); |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
import com.cmsen.ticket.domain.response.Response; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author OWTS |
|||
*/ |
|||
public interface SqlDownloadService { |
|||
//Response<Object> exportListData(SqlDownloadDto downloadDto, HttpServletResponse response);
|
|||
Response<Object> exportListData(Map<String, Object> params, HttpServletResponse response); |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
import com.cmsen.ticket.domain.entity.SupplierMaterialDefine; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author |
|||
* @version 1.0.0 |
|||
* @date 2025/07/25 10:19 |
|||
**/ |
|||
public interface SupplierMaterialDefineService { |
|||
RestResponse list(Map<String, Object> params); |
|||
|
|||
RestResponse create(SupplierMaterialDefine record); |
|||
|
|||
RestResponse update(SupplierMaterialDefine record); |
|||
|
|||
RestResponse delete(Long id); |
|||
} |
|||
@ -0,0 +1,53 @@ |
|||
/* |
|||
* +--------------------------------------------------------- |
|||
* | Author Jared.Yan<yanhuaiwen@163.com> |
|||
* +--------------------------------------------------------- |
|||
* | Copyright (c) http://cmsen.com All rights reserved.
|
|||
* +--------------------------------------------------------- |
|||
*/ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
import com.cmsen.ticket.domain.dto.SubmitLineMatchDto; |
|||
import com.cmsen.ticket.domain.entity.SupplierMaterialUom; |
|||
import com.cmsen.ticket.domain.response.Response; |
|||
import com.cmsen.ticket.interfaces.facade.form.SupplierInvoiceMatchForm; |
|||
import com.cmsen.ticket.interfaces.facade.manager.form.SupplierUpdatePriceForm; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface SupplierService { |
|||
/** |
|||
* 提交行匹配列表 |
|||
*/ |
|||
Response<Object> submitLineMatchList(SubmitLineMatchDto dto); |
|||
/** |
|||
* 发票匹配列表<br/> |
|||
* 匹配条件:ticketCode、seller、number、buyer |
|||
*/ |
|||
RestResponse SupplierInvoiceMatchList(SupplierInvoiceMatchForm form); |
|||
RestResponse autoSmartMatching(String invoiceId, String directCode); |
|||
|
|||
RestResponse autoSmartMatchingOld(String invoiceId); |
|||
|
|||
RestResponse autoSmartMatchingOutIn(String invoiceId, String directCode); |
|||
|
|||
RestResponse materialAutoMatching(String invoiceId, String directCode); |
|||
RestResponse matchInvoices(String numberS, String numberE, Integer invoiceType); |
|||
|
|||
/** |
|||
* 匹配完成 |
|||
*/ |
|||
Response<Object> completeMatching(List<Long> ids, String invoiceId); |
|||
|
|||
|
|||
RestResponse updatePrice(SupplierUpdatePriceForm form); |
|||
|
|||
|
|||
RestResponse updateUom(String invoiceId, String sellerTaxId); |
|||
|
|||
Response createSupplierMaterialUom(List<SupplierMaterialUom> supplierMaterialUoms); |
|||
|
|||
void syncUomFromMapping(String invoiceId, String supplierCode); |
|||
|
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
import com.cmsen.ticket.domain.entity.SupplierUomMapping; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author |
|||
* @version 1.0.0 |
|||
* @date 2025/07/25 10:19 |
|||
**/ |
|||
public interface SupplierUomMappingService { |
|||
RestResponse list(Map<String, Object> params); |
|||
|
|||
RestResponse create(SupplierUomMapping record); |
|||
|
|||
RestResponse update(SupplierUomMapping record); |
|||
|
|||
RestResponse delete(Long id); |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
import com.cmsen.ticket.domain.entity.manager.SysConfig; |
|||
|
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* @author OWTS |
|||
* @version 1.0.0 |
|||
* @date 2023/4/19 15:40 |
|||
**/ |
|||
public interface SysConfigService { |
|||
RestResponse list(Map<String, Object> params); |
|||
|
|||
RestResponse update(SysConfig sysConfig); |
|||
|
|||
RestResponse getByCode(String code); |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
/** |
|||
* @author OWTS |
|||
* @version 1.0.0 |
|||
* @date 2021/2/19 9:49 |
|||
**/ |
|||
public interface SysCorInvoiceService { |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author OWTS |
|||
* @version 1.0.0 |
|||
* @date 2021/3/2 13:22 |
|||
**/ |
|||
public interface SysExpenseTypeService { |
|||
RestResponse list(Map<String, Object> params); |
|||
|
|||
|
|||
RestResponse delete(Integer id); |
|||
|
|||
RestResponse selectByPaimaryKey(Integer id); |
|||
|
|||
RestResponse updateIsDel(Integer id, String isDel); |
|||
|
|||
RestResponse getPidList(Integer pid); |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author OWTS |
|||
* @version 1.0.0 |
|||
* @date 2021/3/2 13:33 |
|||
**/ |
|||
public interface SysExtraFieldsService { |
|||
RestResponse list(Map<String, Object> params); |
|||
|
|||
|
|||
RestResponse delete(Integer id); |
|||
|
|||
RestResponse selectByPaimaryKey(Integer id); |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author OWTS |
|||
* @version 1.0.0 |
|||
* @date 2021/3/2 14:19 |
|||
**/ |
|||
public interface SysExtraValueService { |
|||
RestResponse list(Map<String, Object> params); |
|||
|
|||
RestResponse selectByPrimaryKey(Integer id); |
|||
|
|||
RestResponse delete(Integer ids); |
|||
|
|||
RestResponse export(HttpServletResponse response); |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
import com.cmsen.ticket.domain.entity.manager.SysOrg; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author OWTS |
|||
* @version 1.0.0 |
|||
* @date 2021/2/18 15:40 |
|||
**/ |
|||
public interface SysOrgService { |
|||
RestResponse list(Map<String, Object> params); |
|||
|
|||
RestResponse create(SysOrg sysOrg); |
|||
|
|||
RestResponse update(SysOrg sysOrg); |
|||
|
|||
RestResponse delete(Integer id); |
|||
|
|||
RestResponse selectByPrimaryKey(Integer id); |
|||
RestResponse selectApproveOrgListByUserId(Integer userId); |
|||
RestResponse addOrg(String orgStr); |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author OWTS |
|||
* @version 1.0.0 |
|||
* @date 2021/2/22 10:11 |
|||
**/ |
|||
public interface SysPolicyService { |
|||
RestResponse list(Map<String, Object> params); |
|||
|
|||
RestResponse selectByPrimaryKey(Integer id); |
|||
|
|||
|
|||
RestResponse delete(Integer ids); |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
|
|||
import java.util.Map; |
|||
|
|||
public interface SysProxySetService { |
|||
RestResponse list(Map<String, Object> params); |
|||
|
|||
|
|||
RestResponse delete(Integer id); |
|||
|
|||
|
|||
RestResponse selectUserList(String keyword); |
|||
|
|||
RestResponse getRepresentedList(); |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
|
|||
import java.util.Map; |
|||
|
|||
public interface SysProxyUserService { |
|||
RestResponse list(Map<String, Object> params); |
|||
|
|||
|
|||
// RestResponse update(ProxyUser proxyUser);
|
|||
|
|||
RestResponse delete(Integer id); |
|||
|
|||
|
|||
RestResponse selectUserList(String name); |
|||
|
|||
// RestResponse selectByPaimaryKey(Integer id);
|
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
import com.cmsen.ticket.domain.entity.manager.SysRole; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author OWTS |
|||
* @version 1.0.0 |
|||
* @date 2021/2/18 15:33 |
|||
**/ |
|||
public interface SysRoleService { |
|||
RestResponse list(Map<String, Object> params); |
|||
|
|||
RestResponse create(SysRole sysRole); |
|||
|
|||
RestResponse update(SysRole sysRole); |
|||
|
|||
RestResponse delete(Integer id); |
|||
|
|||
RestResponse getMenus(Integer role); |
|||
|
|||
RestResponse assignPermissions(SysRole sysRole); |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author OWTS |
|||
* @version 1.0.0 |
|||
* @date 2021/2/22 10:56 |
|||
**/ |
|||
public interface SysRulesService { |
|||
RestResponse list(Map<String, Object> params); |
|||
|
|||
RestResponse selectByPrimaryKey(Integer id); |
|||
|
|||
RestResponse delete(Integer ids); |
|||
|
|||
RestResponse getRuleType(); |
|||
} |
|||
@ -0,0 +1,50 @@ |
|||
package com.cmsen.ticket.application.manager.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
import com.cmsen.ticket.domain.entity.CorporateInvoiceType; |
|||
import com.cmsen.ticket.domain.entity.SysUserOrg; |
|||
import com.cmsen.ticket.domain.entity.manager.SysOrg; |
|||
import com.cmsen.ticket.domain.entity.manager.SysUser; |
|||
import com.cmsen.ticket.domain.response.Response; |
|||
import com.cmsen.ticket.interfaces.facade.form.ChangePassword; |
|||
import com.cmsen.ticket.interfaces.facade.form.LoginForm; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
public interface SysUserService { |
|||
RestResponse login(LoginForm loginForm); |
|||
RestResponse singleLogin(LoginForm loginForm); |
|||
|
|||
RestResponse logout(HttpServletRequest request); |
|||
|
|||
RestResponse list(Map<String, Object> params); |
|||
|
|||
RestResponse create(SysUser sysUser); |
|||
|
|||
RestResponse update(SysUser sysUser); |
|||
|
|||
RestResponse delete(Integer id); |
|||
|
|||
RestResponse changePassword(ChangePassword changePassword, HttpServletRequest request); |
|||
|
|||
RestResponse resetPassword(Integer id); |
|||
|
|||
Response<List<CorporateInvoiceType>> getInvoiceTypes(Integer userId); |
|||
|
|||
Response<List<SysOrg>> getUserOrgs(String keyword, Integer userId); |
|||
|
|||
Response<Object> updateDataPermission(SysUserOrg userOrg); |
|||
|
|||
Response<SysUserOrg> getDataAuth(Integer userId); |
|||
|
|||
RestResponse uploadOrg(MultipartFile file); |
|||
|
|||
RestResponse uploadApprove(MultipartFile file); |
|||
|
|||
RestResponse getVerCode(String tel); |
|||
|
|||
RestResponse verCodeLogin(String tel, String code); |
|||
} |
|||
@ -0,0 +1,47 @@ |
|||
package com.cmsen.ticket.application.manager.service.impl; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
import com.cmsen.ticket.application.manager.service.SupplierMaterialDefineService; |
|||
import com.cmsen.ticket.domain.entity.SupplierMaterialDefine; |
|||
import com.cmsen.ticket.domain.mapper.SupplierMaterialDefineMapper; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author |
|||
* @version 1.0.0 |
|||
* @date 2025/07/25 10:19 |
|||
**/ |
|||
@Slf4j |
|||
@Service |
|||
public class SupplierMaterialDefineServiceImpl implements SupplierMaterialDefineService { |
|||
@Resource |
|||
private SupplierMaterialDefineMapper mapper; |
|||
|
|||
|
|||
@Override |
|||
public RestResponse list(Map<String, Object> params) { |
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public RestResponse create(SupplierMaterialDefine record) { |
|||
mapper.insert(record); |
|||
return RestResponse.success(); |
|||
} |
|||
|
|||
@Override |
|||
public RestResponse update(SupplierMaterialDefine record) { |
|||
mapper.updateByPrimaryKeySelective(record); |
|||
return RestResponse.success(); |
|||
} |
|||
|
|||
@Override |
|||
public RestResponse delete(Long id) { |
|||
mapper.deleteByPrimaryKey(id); |
|||
return RestResponse.success(); |
|||
} |
|||
} |
|||
File diff suppressed because it is too large
@ -0,0 +1,51 @@ |
|||
package com.cmsen.ticket.application.manager.service.impl; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
import com.cmsen.ticket.application.manager.service.SupplierUomMappingService; |
|||
import com.cmsen.ticket.domain.entity.SupplierUomMapping; |
|||
import com.cmsen.ticket.domain.mapper.SupplierUomMappingMapper; |
|||
import com.cmsen.ticket.domain.util.PaginationUtil; |
|||
import com.github.pagehelper.PageHelper; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author |
|||
* @version 1.0.0 |
|||
* @date 2025/07/25 10:19 |
|||
**/ |
|||
@Slf4j |
|||
@Service |
|||
public class SupplierUomMappingServiceImpl implements SupplierUomMappingService { |
|||
@Resource |
|||
private SupplierUomMappingMapper mapper; |
|||
@Override |
|||
public RestResponse list(Map<String, Object> params) { |
|||
PageHelper.startPage(Integer.parseInt(params.get("pageNum").toString()),Integer.parseInt(params.get("pageSize").toString())); |
|||
|
|||
List<SupplierUomMapping> list = mapper.listByParams(params); |
|||
int total = mapper.countByParams(params); |
|||
return RestResponse.success(PaginationUtil.getPageResult(total, params, list)); |
|||
} |
|||
@Override |
|||
public RestResponse create(SupplierUomMapping record) { |
|||
mapper.insert(record); |
|||
return RestResponse.success(); |
|||
} |
|||
|
|||
@Override |
|||
public RestResponse update(SupplierUomMapping record) { |
|||
mapper.updateByPrimaryKeySelective(record); |
|||
return RestResponse.success(); |
|||
} |
|||
|
|||
@Override |
|||
public RestResponse delete(Long id) { |
|||
mapper.deleteByPrimaryKey(id); |
|||
return RestResponse.success(); |
|||
} |
|||
} |
|||
@ -0,0 +1,55 @@ |
|||
package com.cmsen.ticket.application.manager.service.impl; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
import com.cmsen.ticket.application.manager.service.SysConfigService; |
|||
import com.cmsen.ticket.domain.entity.manager.SysConfig; |
|||
import com.cmsen.ticket.domain.mapper.manager.SysConfigMapper; |
|||
import com.cmsen.ticket.domain.util.PaginationUtil; |
|||
import com.github.pagehelper.PageHelper; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author OWTS |
|||
* @version 1.0.0 |
|||
* @date 2023/4/19 16:06 |
|||
**/ |
|||
@Slf4j |
|||
@Service |
|||
public class SysConfigServiceImpl implements SysConfigService { |
|||
|
|||
@Value("${manager-file.uploadPath}") |
|||
private String uploadPath; |
|||
@Override |
|||
public RestResponse list(Map<String, Object> params) { |
|||
//PaginationUtil.paginationInit(params);
|
|||
params.put("pageNum",params.get("pageNo").toString()); |
|||
PageHelper.startPage(Integer.parseInt(params.get("pageNum").toString()),Integer.parseInt(params.get("pageSize").toString())); |
|||
|
|||
List<SysConfig> list = sysConfigMapper.list2(params); |
|||
int count = sysConfigMapper.count(params); |
|||
|
|||
return RestResponse.success(PaginationUtil.getPageResult(count, params, list)); |
|||
} |
|||
@Resource |
|||
private SysConfigMapper sysConfigMapper; |
|||
|
|||
|
|||
@Override |
|||
public RestResponse update(SysConfig sysConfig) { |
|||
sysConfigMapper.updateByPrimaryKeySelective(sysConfig); |
|||
return RestResponse.success(); |
|||
} |
|||
|
|||
@Override |
|||
public RestResponse getByCode(String code) { |
|||
SysConfig config = sysConfigMapper.selectByCode(code); |
|||
return RestResponse.success(config); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
package com.cmsen.ticket.application.manager.service.impl; |
|||
|
|||
|
|||
import com.cmsen.ticket.application.manager.service.SysCorInvoiceService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
|
|||
/** |
|||
* @author OWTS |
|||
* @version 1.0.0 |
|||
* @date 2021/2/19 9:54 |
|||
**/ |
|||
@Slf4j |
|||
@Service |
|||
public class SysCorInvoiceServiceImpl implements SysCorInvoiceService { |
|||
|
|||
} |
|||
@ -0,0 +1,124 @@ |
|||
package com.cmsen.ticket.application.manager.service.impl; |
|||
|
|||
import com.alibaba.fastjson.JSONArray; |
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.cmsen.common.exception.ServiceException; |
|||
import com.cmsen.common.http.response.RestResponse; |
|||
import com.cmsen.ticket.application.manager.service.SysOrgService; |
|||
import com.cmsen.ticket.domain.entity.manager.SysOrg; |
|||
import com.cmsen.ticket.domain.mapper.manager.SysOrgMapper; |
|||
import com.cmsen.ticket.domain.util.PaginationUtil; |
|||
import com.github.pagehelper.PageHelper; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.util.Date; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author OWTS |
|||
* @version 1.0.0 |
|||
* @date 2021/2/18 16:06 |
|||
**/ |
|||
@Slf4j |
|||
@Service |
|||
public class SysOrgServiceImpl implements SysOrgService { |
|||
@Resource |
|||
private SysOrgMapper mapper; |
|||
|
|||
@Override |
|||
public RestResponse list(Map<String, Object> params) { |
|||
PaginationUtil.paginationInit(params); |
|||
if(null!=params.get("pageNo")){ |
|||
params.put("pageNum",params.get("pageNo").toString()); |
|||
PageHelper.startPage(Integer.parseInt(params.get("pageNum").toString()),Integer.parseInt(params.get("pageSize").toString())); |
|||
} |
|||
List<SysOrg> list = mapper.list(params); |
|||
int total = mapper.count(params); |
|||
return RestResponse.success(PaginationUtil.getPageResult(total, params, list)); |
|||
} |
|||
|
|||
@Override |
|||
public RestResponse selectByPrimaryKey(Integer id) { |
|||
return RestResponse.success(mapper.selectByPrimaryKey(id)); |
|||
} |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
@Override |
|||
public RestResponse create(SysOrg sysOrg) { |
|||
try { |
|||
mapper.insertSelective(sysOrg); |
|||
return RestResponse.success(sysOrg); |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
throw new ServiceException("系统错误"); |
|||
} |
|||
} |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
@Override |
|||
public RestResponse update(SysOrg sysOrg) { |
|||
try { |
|||
mapper.updateByPrimaryKeySelective(sysOrg); |
|||
return RestResponse.success(sysOrg); |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
throw new ServiceException("系统错误"); |
|||
} |
|||
} |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
@Override |
|||
public RestResponse delete(Integer id) { |
|||
try { |
|||
mapper.deleteByPrimaryKey(id); |
|||
return RestResponse.success(); |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
throw new ServiceException("系统错误"); |
|||
} |
|||
} |
|||
/** |
|||
* 添加组织信息 |
|||
* |
|||
* @param orgStr |
|||
* @return |
|||
*/ |
|||
@Transactional |
|||
@Override |
|||
public RestResponse addOrg(String orgStr) { |
|||
try { |
|||
JSONArray ls = JSONArray.parseArray(orgStr); |
|||
log.info("orgStr=>{}",orgStr); |
|||
Map<String, Object> params = new HashMap<>(); |
|||
// 处理json
|
|||
for (int i = 0; i < ls.size(); i++) { |
|||
JSONObject obj = JSONObject.parseObject(ls.get(i).toString()); |
|||
SysOrg org = JSONObject.parseObject(obj.toString(), SysOrg.class); |
|||
params.put("code",org.getCode()); |
|||
SysOrg tmp = mapper.selectByCode(org.getCode()); |
|||
if (null == tmp) { |
|||
org.setCreateTime(new Date()); |
|||
mapper.insertSelective(org); |
|||
}else{// 20240809添加修改
|
|||
SysOrg tmp1 = mapper.selectByCode(org.getCode()); |
|||
org.setId(tmp1.getId()); |
|||
mapper.updateByPrimaryKeySelective(org); |
|||
} |
|||
} |
|||
return RestResponse.success(); |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
throw new ServiceException("操作失败"); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public RestResponse selectApproveOrgListByUserId(Integer userId) { |
|||
return RestResponse.success(mapper.selectApproveOrgListByUserId(userId)); |
|||
} |
|||
} |
|||
@ -0,0 +1,137 @@ |
|||
package com.cmsen.ticket.application.manager.service.impl; |
|||
|
|||
import com.cmsen.common.exception.ServiceException; |
|||
import com.cmsen.common.http.response.RestResponse; |
|||
import com.cmsen.ticket.application.manager.service.SysRoleService; |
|||
import com.cmsen.ticket.domain.entity.manager.SysMenu; |
|||
import com.cmsen.ticket.domain.entity.manager.SysRole; |
|||
import com.cmsen.ticket.domain.entity.manager.SysUser; |
|||
import com.cmsen.ticket.domain.mapper.manager.SysMenuMapper; |
|||
import com.cmsen.ticket.domain.mapper.manager.SysRoleMapper; |
|||
import com.cmsen.ticket.domain.mapper.manager.SysUserMapper; |
|||
import com.cmsen.ticket.domain.util.PaginationUtil; |
|||
import com.github.pagehelper.PageHelper; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.util.ArrayList; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author OWTS |
|||
* @version 1.0.0 |
|||
* @date 2021/2/18 16:00 |
|||
**/ |
|||
@Slf4j |
|||
@Service |
|||
public class SysRoleServiceImpl implements SysRoleService { |
|||
|
|||
@Resource |
|||
private SysRoleMapper mapper; |
|||
|
|||
@Resource |
|||
private SysMenuMapper sysMenuMapper; |
|||
|
|||
@Resource |
|||
private SysUserMapper sysUserMapper; |
|||
|
|||
@Override |
|||
public RestResponse list(Map<String, Object> params) { |
|||
PaginationUtil.paginationInit(params); |
|||
if(null!=params.get("pageNo")){ |
|||
params.put("pageNum",params.get("pageNo").toString()); |
|||
PageHelper.startPage(Integer.parseInt(params.get("pageNum").toString()),Integer.parseInt(params.get("pageSize").toString())); |
|||
} |
|||
List<SysUser> list = mapper.list(params); |
|||
int total = mapper.count(params); |
|||
return RestResponse.success(PaginationUtil.getPageResult(total, params, list)); |
|||
} |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
@Override |
|||
public RestResponse create(SysRole sysRole) { |
|||
try { |
|||
mapper.insertSelective(sysRole); |
|||
return RestResponse.success(sysRole); |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
throw new ServiceException("系统错误"); |
|||
} |
|||
} |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
@Override |
|||
public RestResponse update(SysRole sysRole) { |
|||
try { |
|||
mapper.updateByPrimaryKeySelective(sysRole); |
|||
return RestResponse.success(sysRole); |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
throw new ServiceException("系统错误"); |
|||
} |
|||
} |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
@Override |
|||
public RestResponse delete(Integer id) { |
|||
try { |
|||
mapper.deleteByPrimaryKey(id); |
|||
return RestResponse.success(); |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
throw new ServiceException("系统错误"); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public RestResponse getMenus(Integer role) { |
|||
List<SysMenu> list = sysMenuMapper.queryAll(); |
|||
List<Integer> idList = new ArrayList<>(); |
|||
if (!role.equals(1)) { |
|||
List<Integer> ids = sysMenuMapper.selectAllMenus(role); |
|||
idList.addAll(ids); |
|||
} else { |
|||
for (SysMenu menu : list) { |
|||
idList.add(menu.getId()); |
|||
} |
|||
} |
|||
List<SysMenu> menus = generateTree(list, 0); |
|||
Map<String, Object> result = new HashMap<>(); |
|||
result.put("idList", idList); |
|||
result.put("menuTree", menus); |
|||
return RestResponse.success(result); |
|||
} |
|||
|
|||
@Transactional |
|||
@Override |
|||
public RestResponse assignPermissions(SysRole sysRole) { |
|||
try { |
|||
mapper.deleteMenusByRole(sysRole.getId()); |
|||
sysRole.getMenus().forEach(menu -> { |
|||
mapper.insertRoleAndMenu(sysRole.getId(), menu); |
|||
}); |
|||
return RestResponse.success(); |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
throw new ServiceException("系统错误"); |
|||
} |
|||
} |
|||
|
|||
public List<SysMenu> generateTree(List<SysMenu> list, int parentId) { |
|||
List<SysMenu> result = new ArrayList<>(); |
|||
for (SysMenu sysMenu : list) { |
|||
int parent = sysMenu.getPid(); |
|||
int id = sysMenu.getId(); |
|||
if (parent == parentId) { |
|||
List<SysMenu> sysMenus = generateTree(list, id); |
|||
sysMenu.setMenu(sysMenus); |
|||
result.add(sysMenu); |
|||
} |
|||
} |
|||
return result; |
|||
} |
|||
} |
|||
@ -0,0 +1,639 @@ |
|||
package com.cmsen.ticket.application.manager.service.impl; |
|||
|
|||
import com.alibaba.excel.EasyExcel; |
|||
import com.cmsen.common.exception.ServiceException; |
|||
import com.cmsen.common.http.ClientHttp; |
|||
import com.cmsen.common.http.ClientHttpRequest; |
|||
import com.cmsen.common.http.ClientHttpResponse; |
|||
import com.cmsen.common.http.ContentEnctype; |
|||
import com.cmsen.common.http.response.RestResponse; |
|||
import com.cmsen.common.util.DateFormat; |
|||
import com.cmsen.common.util.JsonUtil; |
|||
import com.cmsen.common.util.StorageCache; |
|||
import com.cmsen.common.util.StringUtil; |
|||
import com.cmsen.ticket.application.manager.service.SysUserService; |
|||
import com.cmsen.ticket.application.service.UserService; |
|||
import com.cmsen.ticket.domain.entity.CorporateInvoiceType; |
|||
import com.cmsen.ticket.domain.entity.SysUserApprove; |
|||
import com.cmsen.ticket.domain.entity.SysUserOrg; |
|||
import com.cmsen.ticket.domain.entity.manager.SysConfig; |
|||
import com.cmsen.ticket.domain.entity.manager.SysMenu; |
|||
import com.cmsen.ticket.domain.entity.manager.SysOrg; |
|||
import com.cmsen.ticket.domain.entity.manager.SysUser; |
|||
import com.cmsen.ticket.domain.mapper.CorporateInvoiceTypeMapper; |
|||
import com.cmsen.ticket.domain.mapper.SysUserApproveMapper; |
|||
import com.cmsen.ticket.domain.mapper.SysUserOrgMapper; |
|||
import com.cmsen.ticket.domain.mapper.manager.SysConfigMapper; |
|||
import com.cmsen.ticket.domain.mapper.manager.SysMenuMapper; |
|||
import com.cmsen.ticket.domain.mapper.manager.SysOrgMapper; |
|||
import com.cmsen.ticket.domain.mapper.manager.SysUserMapper; |
|||
import com.cmsen.ticket.domain.response.Response; |
|||
import com.cmsen.ticket.domain.util.PaginationUtil; |
|||
import com.cmsen.ticket.interfaces.facade.form.ChangePassword; |
|||
import com.cmsen.ticket.interfaces.facade.form.LoginForm; |
|||
import com.cmsenframework.security.RequestSecurityPolicy; |
|||
import com.cmsenframework.security.UserDetail; |
|||
import com.github.pagehelper.PageHelper; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.security.core.userdetails.UserDetailsService; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
import org.springframework.web.context.request.RequestAttributes; |
|||
import org.springframework.web.context.request.RequestContextHolder; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.annotation.Resource; |
|||
import javax.servlet.http.HttpServletRequest; |
|||
import javax.servlet.http.HttpSession; |
|||
import java.io.IOException; |
|||
import java.io.InputStream; |
|||
import java.util.*; |
|||
|
|||
@Slf4j |
|||
@Service |
|||
public class SysUserServiceImpl implements SysUserService { |
|||
private static final Base64.Decoder DECODER = Base64.getDecoder(); |
|||
@Resource |
|||
private UserService userService; |
|||
@Resource |
|||
private UserDetailsService userDetailService; |
|||
@Resource |
|||
private SysUserMapper sysUserMapper; |
|||
@Resource |
|||
private SysMenuMapper sysMenuMapper; |
|||
@Resource |
|||
private CorporateInvoiceTypeMapper corporateInvoiceTypeMapper; |
|||
@Resource |
|||
private SysOrgMapper sysOrgMapper; |
|||
@Resource |
|||
private SysUserOrgMapper sysUserOrgMapper; |
|||
@Resource |
|||
private SysConfigMapper sysConfigMapper; |
|||
@Resource |
|||
private SysUserApproveMapper sysUserApproveMapper; |
|||
|
|||
@Override |
|||
public RestResponse login(LoginForm loginForm) { |
|||
//获取RequestAttributes
|
|||
RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); |
|||
//从获取RequestAttributes中获取HttpServletRequest的信息
|
|||
HttpSession session = (HttpSession)requestAttributes.resolveReference(RequestAttributes.REFERENCE_SESSION); |
|||
// add-sso-login
|
|||
if(loginForm.getSsoId()!=null && loginForm.getSsoId().length()>0){ |
|||
List<Map<String, Object>> ls = sysUserMapper.execSelectSql("select login_id from sso_user where id='"+loginForm.getSsoId()+"'"); |
|||
if(ls.size()>0){ |
|||
loginForm.setUsername(ls.get(0).get("login_id").toString()); |
|||
sysUserMapper.execSelectSql("delete from sso_user where id='"+loginForm.getSsoId()+"'"); |
|||
}else { |
|||
return RestResponse.failure("无效的用户名。"); |
|||
} |
|||
}else { |
|||
// 如果存进session的count变量为null
|
|||
if (session.getAttribute("count") == null) { |
|||
// 初始化count
|
|||
session.setAttribute("count", 0); |
|||
} |
|||
log.info(session.getAttribute("count").toString()); |
|||
// 密码错误5次 则限制登陆一段时间
|
|||
if ((Integer) session.getAttribute("count") >= 5) { |
|||
// 如果当前时间大于session设置的时间则清楚session
|
|||
if (new Date().after((Date) session.getAttribute("time"))) { |
|||
// 清除session
|
|||
session.invalidate(); |
|||
} |
|||
return RestResponse.failure("登录错误次数过多,请半小时后再试"); |
|||
} |
|||
} |
|||
|
|||
// 创建日历对象,方便对时间做操作
|
|||
Calendar instance = Calendar.getInstance(); |
|||
// 为日历对象设置当前时间
|
|||
instance.setTime(new Date()); |
|||
// 给当前时间加时
|
|||
instance.add(Calendar.MINUTE, 120); |
|||
// 在获取当前时间加时
|
|||
Date time = instance.getTime(); |
|||
// 将当前时间设置到session中
|
|||
session.setAttribute("time", time); |
|||
|
|||
|
|||
SysUser user = sysUserMapper.selectByUserName(loginForm.getUsername()); |
|||
if (user == null) { |
|||
session.setAttribute("count", (Integer) session.getAttribute("count") + 1); |
|||
return RestResponse.failure("无效的用户名。"); |
|||
} |
|||
if (user.getInActive().equals(1)) { |
|||
return RestResponse.failure("账号异常,请联系管理员。"); |
|||
} |
|||
String userDetail = StringUtil.UUID(); |
|||
// add-sso-login
|
|||
if(loginForm.getSsoId()==null || loginForm.getSsoId().length()==0) { |
|||
loginForm.setPassword(new String(DECODER.decode(loginForm.getPassword()))); |
|||
if (!RequestSecurityPolicy.passwordVerify(loginForm.getPassword(), user.getPwd())) { |
|||
session.setAttribute("count", (Integer) session.getAttribute("count") + 1); |
|||
return RestResponse.failure("用户名或密码错误。"); |
|||
} |
|||
userDetail = userService.getUserDetail(loginForm.getUsername(), loginForm.getPassword()); |
|||
}else{ |
|||
try { |
|||
UserDetail userDetails = (UserDetail) userDetailService.loadUserByUsername(user.getName()); |
|||
StorageCache.write("Auth:Bearer " + userDetail, "Bearer " + userDetails.getToken(), 1000 * 60 * 60 * 4); |
|||
}catch (Exception e){ |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
String userDetail2 = userDetail; |
|||
List<SysMenu> menus; |
|||
List<SysMenu> menuList; |
|||
List<SysMenu> button; |
|||
if (user.getRole().equals(1)) { |
|||
menuList = sysMenuMapper.list(1); |
|||
button = sysMenuMapper.list(2); |
|||
} else { |
|||
menuList = sysMenuMapper.selectMenuButtonsByRole(user.getRole(), 1); |
|||
button = sysMenuMapper.selectMenuButtonsByRole(user.getRole(), 2); |
|||
} |
|||
|
|||
List<SysOrg> sysOrgList = sysOrgMapper.selectOrgListByUserId(user.getId()); |
|||
|
|||
menus = generateTree(menuList, 0); |
|||
String loginCode="0"; |
|||
// 判断是否需要二次短信认证
|
|||
SysConfig sysConfig = sysConfigMapper.selectByCode("LoginCodeNeed"); |
|||
if(sysConfig != null){ |
|||
loginCode=sysConfig.getValue(); |
|||
} |
|||
String loginCode2=loginCode; |
|||
return RestResponse.success(new LoginForm() {{ |
|||
setToken(userDetail2); |
|||
setUserId(user.getId()); |
|||
setUsername(user.getName()); |
|||
setRoleId(user.getRole()); |
|||
setMenu(menus); |
|||
setUser(user); |
|||
setButton(button); |
|||
setOrgList(sysOrgList); |
|||
setLoginCodeNeed(loginCode2); |
|||
setHomePage(user.getHomePage()); |
|||
setLanguage(StringUtil.isNotBlank(user.getNote()) ? user.getNote() : "zh"); |
|||
setRoleType(user.getRoleType()); |
|||
}}); |
|||
} |
|||
|
|||
|
|||
|
|||
@Override |
|||
public RestResponse singleLogin(LoginForm loginForm) { |
|||
if(loginForm.getUsername()==null || loginForm.getUsername().length()==0){ |
|||
|
|||
return RestResponse.failure("无效的登录信息"); |
|||
} |
|||
// 验证Code信息
|
|||
String code = loginForm.getUsername(); |
|||
// 获取token
|
|||
|
|||
SysConfig urlConfig = sysConfigMapper.selectByCode("BZ_SINGLE_LOGIN_URL"); |
|||
SysConfig keyConfig = sysConfigMapper.selectByCode("BZ_SINGLE_APP_KEY"); |
|||
SysConfig secretConfig = sysConfigMapper.selectByCode("BZ_SINGLE_SECRET"); |
|||
log.info("baozun single login code >>" + code ); |
|||
ClientHttpResponse post = ClientHttp.post(new ClientHttpRequest() |
|||
.setUrl(urlConfig.getValue() + "/oauth/token") |
|||
.setHeaders("Content-Type", ContentEnctype.URLENCODED) |
|||
.setParams("code",code) |
|||
.setParams("appKey",keyConfig.getValue()) |
|||
.setParams("secret",secretConfig.getValue()) |
|||
); |
|||
log.info("baozun single login code >> " + post); |
|||
|
|||
//判断token是否
|
|||
log.info("baozun single login >>" + post.getStatus()); |
|||
if(post.getStatus()!=200){//重新获取下token
|
|||
return RestResponse.failure("获取token失败,请重新登录"); |
|||
} |
|||
log.info("baozun single login 成功 >> "); |
|||
String accessToken = JsonUtil.toObject(post.toString()).get("accessToken").toString(); |
|||
if(accessToken.equals("get_cache_token_error")) return RestResponse.failure("获取用户失败,请重新登录"); |
|||
|
|||
log.info("baozun single login 成功Token >> "+accessToken); |
|||
ClientHttpResponse postUser = ClientHttp.post(new ClientHttpRequest() |
|||
.setUrl(urlConfig.getValue() + "/oauth/user-info") |
|||
.setHeaders("Content-Type", ContentEnctype.URLENCODED) |
|||
.setParams("access_token",accessToken) |
|||
); |
|||
log.info("baozun single login userMesg >> " + postUser); |
|||
// 获取用户具体信息
|
|||
log.info("baozun single getUser >>" + postUser.getStatus()); |
|||
if(postUser.getStatus()!=200){ |
|||
return RestResponse.failure("获取用户失败,请重新登录"); |
|||
} |
|||
|
|||
log.info("baozun single user 成功 >> "); |
|||
String loginName = JsonUtil.toObject(postUser.toString()).get("jobNumber").toString(); |
|||
|
|||
log.info("baozun single user 成功>> "+loginName); |
|||
if(loginName.equals("apinvoice")) loginName = "today"; |
|||
SysUser user = sysUserMapper.selectByUserName(loginName); |
|||
if (user == null) { |
|||
return RestResponse.failure("无效的用户名。"); |
|||
} |
|||
if (user.getInActive().equals(1)) { |
|||
return RestResponse.failure("账号异常,请联系管理员。"); |
|||
} |
|||
String userDetail =StringUtil.UUID(); |
|||
try { |
|||
UserDetail userDetails = (UserDetail) userDetailService.loadUserByUsername(user.getName()); |
|||
StorageCache.write("Auth:Bearer " + userDetail, "Bearer " + userDetails.getToken(), 1000 * 60 * 60 * 4); |
|||
}catch (Exception e){ |
|||
e.printStackTrace(); |
|||
} |
|||
|
|||
List<SysMenu> menus; |
|||
List<SysMenu> menuList; |
|||
List<SysMenu> button; |
|||
if (user.getRole().equals(1)) { |
|||
menuList = sysMenuMapper.list(1); |
|||
button = sysMenuMapper.list(2); |
|||
} else { |
|||
Integer roleNum = user.getRole(); |
|||
menuList = sysMenuMapper.selectMenuButtonsByRole(roleNum, 1); |
|||
button = sysMenuMapper.selectMenuButtonsByRole(roleNum, 2); |
|||
} |
|||
|
|||
List<SysOrg> sysOrgList = sysOrgMapper.selectOrgListByUserId(user.getId()); |
|||
|
|||
menus = generateTree(menuList, 0); |
|||
|
|||
return RestResponse.success(new LoginForm() {{ |
|||
setToken(userDetail); |
|||
setUserId(user.getId()); |
|||
setUsername(user.getName()); |
|||
setRoleId(user.getRole()); |
|||
setMenu(menus); |
|||
setUser(user); |
|||
setButton(button); |
|||
setOrgList(sysOrgList); |
|||
setHomePage(user.getHomePage()); |
|||
setLanguage(StringUtil.isNotBlank(user.getNote()) ? user.getNote() : "zh"); |
|||
setRoleType(user.getRoleType()); |
|||
}}); |
|||
} |
|||
|
|||
@Override |
|||
public RestResponse logout(HttpServletRequest request) { |
|||
RequestSecurityPolicy.setSecurityContext(new UserDetail(), request); |
|||
SysConfig sysConfig = sysConfigMapper.selectByCode("SSO_URL"); |
|||
Map<String,String> sso = new HashMap<>(); |
|||
if(sysConfig != null){ |
|||
sso.put("SSO_URL",sysConfig.getValue()); |
|||
} |
|||
// add-sso-out
|
|||
SysConfig sysConfigOut = sysConfigMapper.selectByCode("SSO_OUT_URL"); |
|||
if(sysConfigOut != null){ |
|||
sso.put("SSO_OUT_URL",sysConfigOut.getValue()); |
|||
} |
|||
return RestResponse.success(sso); |
|||
} |
|||
|
|||
@Override |
|||
public RestResponse list(Map<String, Object> params) { |
|||
//PaginationUtil.paginationInit(params);
|
|||
params.put("pageNum",params.get("pageNo").toString()); |
|||
PageHelper.startPage(Integer.parseInt(params.get("pageNum").toString()),Integer.parseInt(params.get("pageSize").toString())); |
|||
|
|||
List<SysUser> list = sysUserMapper.list(params); |
|||
int total = sysUserMapper.count(params); |
|||
return RestResponse.success(PaginationUtil.getPageResult(total, params, list)); |
|||
} |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
@Override |
|||
public RestResponse create(SysUser sysUser) { |
|||
try { |
|||
SysUser sysUser1 = sysUserMapper.selectByUserName(sysUser.getName()); |
|||
if (sysUser1 != null) { |
|||
return RestResponse.failure("该用户已存在,请直接登录"); |
|||
} |
|||
if (StringUtil.isEmpty(sysUser.getPwd())) { |
|||
//默认初始密码-从config中获取 2022/5/13
|
|||
SysConfig sysConfig = sysConfigMapper.selectByCode("DefaultPwd"); |
|||
if(sysConfig != null){ |
|||
sysUser.setPwd(sysConfig.getValue()); |
|||
}else{ |
|||
sysUser.setPwd("123456"); |
|||
} |
|||
} |
|||
sysUser.setPwd(RequestSecurityPolicy.encodedPassword(sysUser.getPwd())); |
|||
sysUser.setCreateTime(DateFormat.format(new Date(), DateFormat.DatePatternType.FORMAT_yyyy_MM_dd_HH_mm_ss)); |
|||
sysUserMapper.insertSelective(sysUser); |
|||
return RestResponse.success(sysUser); |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
throw new ServiceException("系统错误"); |
|||
} |
|||
} |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
@Override |
|||
public RestResponse update(SysUser sysUser) { |
|||
sysUser.setName(null); |
|||
sysUser.setPwd(null); |
|||
try { |
|||
sysUserMapper.updateByPrimaryKeySelective(sysUser); |
|||
return RestResponse.success(sysUser); |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
throw new ServiceException("系统错误"); |
|||
} |
|||
} |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
@Override |
|||
public RestResponse delete(Integer id) { |
|||
try { |
|||
sysUserMapper.deleteByPrimaryKey(id); |
|||
return RestResponse.success(); |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
throw new ServiceException("系统错误"); |
|||
} |
|||
} |
|||
|
|||
public List<SysMenu> generateTree(List<SysMenu> list, int parentId) { |
|||
List<SysMenu> result = new ArrayList<>(); |
|||
for (SysMenu sysMenu : list) { |
|||
int parent = sysMenu.getPid(); |
|||
int id = sysMenu.getId(); |
|||
if (parent == parentId) { |
|||
List<SysMenu> sysMenus = generateTree(list, id); |
|||
sysMenu.setMenu(sysMenus); |
|||
result.add(sysMenu); |
|||
} |
|||
} |
|||
return result; |
|||
} |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
@Override |
|||
public RestResponse changePassword(ChangePassword changePassword, HttpServletRequest request) { |
|||
try { |
|||
changePassword.setOldPassword(new String(DECODER.decode(changePassword.getOldPassword()))); |
|||
changePassword.setNewPassword(new String(DECODER.decode(changePassword.getNewPassword()))); |
|||
Integer userId = Integer.valueOf(String.valueOf(RequestSecurityPolicy.getUserId())); |
|||
SysUser sysUser = sysUserMapper.selectByPrimaryKey(userId); |
|||
if (RequestSecurityPolicy.passwordVerify(changePassword.getOldPassword(), sysUser.getPwd())) { |
|||
sysUser.setPwd(RequestSecurityPolicy.encodedPassword(changePassword.getNewPassword())); |
|||
// 添加密码最后修改日期
|
|||
sysUser.setLastUpdateTime(DateFormat.format(new Date(), DateFormat.DatePatternType.FORMAT_yyyy_MM_dd_HH_mm_ss)); |
|||
sysUserMapper.updateByPrimaryKeySelective(sysUser); |
|||
RequestSecurityPolicy.setSecurityContext(new UserDetail(), request); |
|||
return RestResponse.success(); |
|||
} |
|||
return RestResponse.failure("用户名或密码错误。"); |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
throw new ServiceException("系统异常"); |
|||
} |
|||
} |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
@Override |
|||
public RestResponse resetPassword(Integer id) { |
|||
try { |
|||
SysUser sysUser = sysUserMapper.selectByPrimaryKey(id); |
|||
if (sysUser != null) { |
|||
//默认初始密码-从config中获取 2022/5/13
|
|||
SysConfig sysConfig = sysConfigMapper.selectByCode("DefaultPwd"); |
|||
if(sysConfig != null){ |
|||
sysUser.setPwd(sysConfig.getValue()); |
|||
}else{ |
|||
sysUser.setPwd("123456"); |
|||
} |
|||
sysUser.setPwd(RequestSecurityPolicy.encodedPassword(sysUser.getPwd())); |
|||
sysUserMapper.updateByPrimaryKeySelective(sysUser); |
|||
return RestResponse.success(); |
|||
} |
|||
return RestResponse.failure("用户异常"); |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
throw new ServiceException("系统异常"); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public Response<SysUserOrg> getDataAuth(Integer userId) { |
|||
SysUserOrg result = sysUserOrgMapper.selectByPrimaryKey(userId); |
|||
if (result == null) { |
|||
result = new SysUserOrg(); |
|||
result.setUserId(userId); |
|||
} |
|||
return Response.success(result); |
|||
} |
|||
|
|||
@Override |
|||
public Response<List<CorporateInvoiceType>> getInvoiceTypes(Integer userId) { |
|||
List<CorporateInvoiceType> corporateInvoiceTypes = corporateInvoiceTypeMapper.selectByRecord(new CorporateInvoiceType() {{ |
|||
setActive(true); |
|||
}}); |
|||
return Response.success(corporateInvoiceTypes); |
|||
} |
|||
|
|||
@Override |
|||
public Response<List<SysOrg>> getUserOrgs(String keyword, Integer userId) { |
|||
List<SysOrg> list = sysOrgMapper.list(new HashMap<String, Object>() {{ |
|||
put("name", keyword); |
|||
}}); |
|||
List<SysOrg> sysOrgs = generateTreeForOrg(list, 0); |
|||
return Response.success(sysOrgs); |
|||
} |
|||
|
|||
@Transactional |
|||
@Override |
|||
public Response<Object> updateDataPermission(SysUserOrg userOrg) { |
|||
try { |
|||
SysUserOrg sysUserOrg = sysUserOrgMapper.selectByPrimaryKey(userOrg.getUserId()); |
|||
if (sysUserOrg == null) { |
|||
sysUserOrgMapper.insert(userOrg); |
|||
} else { |
|||
sysUserOrgMapper.updateByPrimaryKeySelective(userOrg); |
|||
} |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
throw new ServiceException("提交失败"); |
|||
} |
|||
return Response.success(); |
|||
} |
|||
|
|||
@Transactional |
|||
@Override |
|||
public RestResponse uploadOrg(MultipartFile file) { |
|||
try { |
|||
InputStream inputStream = file.getInputStream(); |
|||
List<Map<Integer, String>> sheetRowData = EasyExcel.read(inputStream).sheet(0).doReadSync(); |
|||
|
|||
Map<String, List<String>> mapList = new HashMap<>(); |
|||
|
|||
//数据处理
|
|||
for (int i = 0; i < sheetRowData.size(); i++) { |
|||
Map<Integer, String> sheetRowDatum = sheetRowData.get(i); |
|||
String org = StringUtil.trim(String.valueOf(sheetRowDatum.get(1))); |
|||
String jobNo = StringUtil.trim(String.valueOf(sheetRowDatum.get(2))); |
|||
|
|||
if(StringUtil.isEmpty(org) || StringUtil.isEmpty(jobNo)){ |
|||
continue; |
|||
} |
|||
|
|||
if (mapList.containsKey(jobNo)) { |
|||
mapList.get(jobNo).add(org); |
|||
} else { |
|||
mapList.put(jobNo, new ArrayList<String>() {{ |
|||
add(org); |
|||
}}); |
|||
} |
|||
} |
|||
|
|||
for (String key : mapList.keySet()) { |
|||
SysUser sysUser = sysUserMapper.selectByJobNo(key); |
|||
if(sysUser == null ){ |
|||
continue; |
|||
} |
|||
SysOrg sysOrg = sysOrgMapper.selectByCostcenter2(String.join(",", mapList.get(key))); |
|||
|
|||
SysUserOrg bean = sysUserOrgMapper.selectByPrimaryKey(sysUser.getId()); |
|||
if(bean == null){//插入
|
|||
SysUserOrg sysUserOrg = new SysUserOrg(){{ |
|||
setUserId(sysUser.getId()); |
|||
setAuthorizedOrg(sysOrg.getRemark()); |
|||
setCorInvType("1"); |
|||
setDataAuthType(1); |
|||
}}; |
|||
sysUserOrgMapper.insert(sysUserOrg); |
|||
}else{//更新
|
|||
bean.setAuthorizedOrg(sysOrg.getRemark()); |
|||
sysUserOrgMapper.updateByPrimaryKeySelective(bean); |
|||
} |
|||
} |
|||
return RestResponse.success(); |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
throw new ServiceException("授权导入失败"); |
|||
} |
|||
|
|||
} |
|||
|
|||
@Transactional |
|||
@Override |
|||
public RestResponse uploadApprove(MultipartFile file) { |
|||
try { |
|||
InputStream inputStream = file.getInputStream(); |
|||
List<Map<Integer, String>> sheetRowData = EasyExcel.read(inputStream).sheet(0).doReadSync(); |
|||
|
|||
Map<String, List<String>> mapList = new HashMap<>(); |
|||
|
|||
//数据处理
|
|||
for (int i = 0; i < sheetRowData.size(); i++) { |
|||
Map<Integer, String> sheetRowDatum = sheetRowData.get(i); |
|||
String org = StringUtil.trim(String.valueOf(sheetRowDatum.get(1))); |
|||
String jobNo = StringUtil.trim(String.valueOf(sheetRowDatum.get(2))); |
|||
|
|||
if(StringUtil.isEmpty(org) || StringUtil.isEmpty(jobNo)){ |
|||
continue; |
|||
} |
|||
|
|||
if (mapList.containsKey(jobNo)) { |
|||
mapList.get(jobNo).add(org); |
|||
} else { |
|||
mapList.put(jobNo, new ArrayList<String>() {{ |
|||
add(org); |
|||
}}); |
|||
} |
|||
} |
|||
|
|||
for (String key : mapList.keySet()) { |
|||
SysUser sysUser = sysUserMapper.selectByJobNo(key); |
|||
if(sysUser == null ){ |
|||
continue; |
|||
} |
|||
SysOrg sysOrg = sysOrgMapper.selectByCostcenter2(String.join(",", mapList.get(key))); |
|||
|
|||
SysUserApprove bean = sysUserApproveMapper.selectByPrimaryKey(sysUser.getId()); |
|||
if(bean == null){//插入
|
|||
SysUserApprove sysUserApprove = new SysUserApprove(){{ |
|||
setUserId(sysUser.getId()); |
|||
setAuthorizedOrg(sysOrg.getRemark()); |
|||
setCorInvType("1"); |
|||
setDataAuthType(1); |
|||
}}; |
|||
sysUserApproveMapper.insert(sysUserApprove); |
|||
}else{//更新
|
|||
bean.setAuthorizedOrg(sysOrg.getRemark()); |
|||
sysUserApproveMapper.updateByPrimaryKeySelective(bean); |
|||
} |
|||
} |
|||
return RestResponse.success(); |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
throw new ServiceException("授权导入失败"); |
|||
} |
|||
} |
|||
|
|||
public List<SysOrg> generateTreeForOrg(List<SysOrg> list, int parentId) { |
|||
List<SysOrg> result = new ArrayList<>(); |
|||
for (SysOrg org : list) { |
|||
int parent = org.getPid(); |
|||
int id = org.getId(); |
|||
if (parent == parentId) { |
|||
List<SysOrg> orgs = generateTreeForOrg(list, id); |
|||
org.setChild(orgs); |
|||
result.add(org); |
|||
} |
|||
} |
|||
return result; |
|||
} |
|||
|
|||
public static void main(String[] args) throws IOException { |
|||
// String url = "http://110.42.101.165:8103/ai/vector/save"+"?name="+"测试"+"&type="+2;
|
|||
// log.info(WebUtils.doGet(url,null));
|
|||
// byte[] as = new String("Ab1234").getBytes();
|
|||
// System.out.println(Base64Util.encodeToString(as));
|
|||
// BigDecimal pretaxAmountDecimal = new BigDecimal("263.39");
|
|||
|
|||
} |
|||
|
|||
@Override |
|||
public RestResponse getVerCode(String tel) { |
|||
SysUser sysUser = sysUserMapper.selectByTelAndCode(tel, null); |
|||
if(sysUser == null){ |
|||
return RestResponse.failure("该手机号用户不存在"); |
|||
} |
|||
|
|||
log.info("getVerCode {}", tel); |
|||
int code = (int) ((Math.random() * 9 + 1) * 100000); |
|||
|
|||
String sendSmsUrl = ""; |
|||
SysConfig sysConfig = sysConfigMapper.selectByCode("sendSmsUrl"); |
|||
if(sysConfig != null){ |
|||
sendSmsUrl = sysConfig.getValue(); |
|||
} |
|||
String sendSmsSign = "发票助手"; |
|||
sysConfig = sysConfigMapper.selectByCode("sendSmsSign"); |
|||
if(sysConfig != null){ |
|||
sendSmsSign = sysConfig.getValue(); |
|||
} |
|||
// SmsUtil.sendSms(tel, code, sendSmsUrl, sendSmsSign);
|
|||
|
|||
sysUser.setAge(code); |
|||
sysUserMapper.updateByPrimaryKeySelective(sysUser); |
|||
|
|||
return RestResponse.success(); |
|||
} |
|||
|
|||
@Override |
|||
public RestResponse verCodeLogin(String tel, String code) { |
|||
SysUser sysUser = sysUserMapper.selectByTelAndCode(tel, code); |
|||
if(sysUser == null){ |
|||
return RestResponse.failure("手机号、验证码不正确"); |
|||
} |
|||
return RestResponse.success(); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
package com.cmsen.ticket.application.manager.vo; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Data |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
public class ElementTreeNodes { |
|||
private int id; |
|||
private String label; |
|||
|
|||
private List<ElementTreeNodes> children; |
|||
|
|||
@JsonIgnore |
|||
private String parent; |
|||
|
|||
private String filterPath; |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
package com.cmsen.ticket.application.manager.vo; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Data |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
|
|||
public class GetMaterialParamVo { |
|||
private String data_base; |
|||
private List<String> data_list; |
|||
private String model_name; |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
package com.cmsen.ticket.application.manager.vo; |
|||
|
|||
import com.alibaba.fastjson2.JSONObject; |
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
@Data |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
public class MatterV3ResponseVo { |
|||
private String data; |
|||
private JSONObject info; |
|||
} |
|||
@ -0,0 +1,64 @@ |
|||
/* |
|||
* +--------------------------------------------------------- |
|||
* | Author Jared.Yan<yanhuaiwen@163.com> |
|||
* +--------------------------------------------------------- |
|||
* | Copyright (c) http://cmsen.com All rights reserved.
|
|||
* +--------------------------------------------------------- |
|||
*/ |
|||
package com.cmsen.ticket.application.manager.vo; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
@Data |
|||
public class SupplierInvoiceMatchOrderVo { |
|||
private Integer id; |
|||
private String orderNo; |
|||
private String supplierCode; |
|||
private String orgName; |
|||
private BigDecimal amount; |
|||
private BigDecimal unUsedAmount; |
|||
private BigDecimal usedAmount; |
|||
private BigDecimal price; |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
|||
private Date orderDate; |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
|||
private Date receiveDate; |
|||
|
|||
private String goods; |
|||
private String itemNo; |
|||
|
|||
private BigDecimal quantity; |
|||
private BigDecimal usedQuantity; |
|||
private BigDecimal unUsedQuantity; |
|||
|
|||
private String uom; |
|||
private String unit; |
|||
|
|||
|
|||
public BigDecimal getUnUsedAmount() { |
|||
if (usedAmount == null) return this.amount; |
|||
if (amount == null) return new BigDecimal("0"); |
|||
return amount.subtract(usedAmount); |
|||
} |
|||
|
|||
public BigDecimal getUsedAmount() { |
|||
return usedAmount == null ? BigDecimal.ZERO : usedAmount; |
|||
} |
|||
|
|||
public BigDecimal getUsedQuantity() { |
|||
return usedQuantity == null ? BigDecimal.ZERO : usedQuantity; |
|||
} |
|||
|
|||
public BigDecimal getUnUsedQuantity() { |
|||
if (usedQuantity == null) return this.quantity; |
|||
if (quantity == null) return BigDecimal.ZERO; |
|||
return quantity.subtract(usedQuantity); |
|||
} |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
package com.cmsen.ticket.application.manager.vo; |
|||
|
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
public class SupplierMaterialDefineVo { |
|||
|
|||
private String itemType; |
|||
private String similarItemNo; |
|||
} |
|||
@ -0,0 +1,73 @@ |
|||
package com.cmsen.ticket.application.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
import com.cmsen.ticket.domain.entity.Company; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* (Company)表服务接口 |
|||
* |
|||
* @author ran hao yu |
|||
* @since 2020-09-18 14:11:43 |
|||
*/ |
|||
public interface CompanyService { |
|||
|
|||
/** |
|||
* 通过ID查询单条数据 |
|||
* |
|||
* @param id 主键 |
|||
* @return 实例对象 |
|||
*/ |
|||
Company queryById(Integer id); |
|||
|
|||
/** |
|||
* 查询多条数据 |
|||
* |
|||
* @return 对象列表 |
|||
*/ |
|||
List<Company> queryAllByLimit(String code,String name,String taxNo); |
|||
|
|||
List<Company> queryAll(Company company); |
|||
|
|||
/** |
|||
* 新增数据 |
|||
* |
|||
* @param company 实例对象 |
|||
* @return 实例对象 |
|||
*/ |
|||
RestResponse insert(Company company); |
|||
|
|||
/** |
|||
* 修改数据 |
|||
* |
|||
* @param company 实例对象 |
|||
* @return 实例对象 |
|||
*/ |
|||
Company update(Company company); |
|||
|
|||
/** |
|||
* 通过主键删除数据 |
|||
* |
|||
* @param id 主键 |
|||
* @return 是否成功 |
|||
*/ |
|||
boolean deleteById(Integer id); |
|||
|
|||
/** |
|||
* 停用 |
|||
* |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
RestResponse clock(Integer id); |
|||
|
|||
/** |
|||
* 启用 |
|||
* |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
RestResponse active(Integer id); |
|||
|
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
package com.cmsen.ticket.application.service; |
|||
|
|||
/** |
|||
* @author OWTS |
|||
* @version 1.0.0 |
|||
* @date 2021/1/16 16:35 |
|||
**/ |
|||
public interface CorporateInvoiceService { |
|||
|
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
package com.cmsen.ticket.application.service; |
|||
|
|||
import com.cmsen.ticket.domain.entity.CorporateInvoice; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author OWTS |
|||
* @version 1.0.0 |
|||
* @date 2021/11/3 14:26 |
|||
**/ |
|||
public interface SupplierOutService { |
|||
|
|||
void sendInvoice(CorporateInvoice invoice, String type, String status); |
|||
|
|||
void sendMainDataToBaozun(CorporateInvoice invoice, String izt, String iid); |
|||
|
|||
int sendMatchingDataCustom(Long matchItemId, String type); |
|||
|
|||
void sendMatchingData(List<Long> ids, String invoiceId); |
|||
|
|||
String getBodyByMatchItemForBaozun(Long itemMatchingId); |
|||
|
|||
String getXmlBodyByMatchItemForBaozun(Long itemMatchingId); |
|||
|
|||
String getBodyByMatchItemForBaozunXml(Long itemMatchingId); |
|||
|
|||
String getXmlBodyByCorporateInvoiceForBaozun(CorporateInvoice invoice, String izt, String iid); |
|||
|
|||
} |
|||
@ -0,0 +1,38 @@ |
|||
package com.cmsen.ticket.application.service; |
|||
|
|||
import com.cmsen.common.http.response.RestResponse; |
|||
import com.cmsen.ticket.domain.entity.User; |
|||
import org.springframework.security.authentication.AuthenticationManager; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author ran hao yu |
|||
* @date 2020/7/31 9:31 |
|||
* @description 用户业务层接口 |
|||
*/ |
|||
public interface UserService { |
|||
RestResponse insert(User record); |
|||
|
|||
RestResponse appAuth(String jscode, String corCode, int type); |
|||
|
|||
RestResponse getMessagesCode(String jsCode, String tel); |
|||
|
|||
RestResponse verifyMessages(String jsCode, Integer verificationCode, String tel); |
|||
|
|||
RestResponse updateLanguageType(User user); |
|||
|
|||
RestResponse selectUser(String openID); |
|||
|
|||
String getUserDetail(String tel, String password); |
|||
|
|||
AuthenticationManager getAuthManager(); |
|||
|
|||
RestResponse addSendEmails(List<String> emails); |
|||
|
|||
RestResponse selectSendEmails(); |
|||
|
|||
RestResponse updateValidType(User user); |
|||
|
|||
RestResponse checkGps(); |
|||
} |
|||
@ -0,0 +1,134 @@ |
|||
package com.cmsen.ticket.application.service.impl; |
|||
|
|||
import com.cmsen.common.exception.ServiceException; |
|||
import com.cmsen.common.http.response.RestResponse; |
|||
import com.cmsen.ticket.application.service.CompanyService; |
|||
import com.cmsen.ticket.domain.entity.Company; |
|||
import com.cmsen.ticket.domain.mapper.CompanyMapper; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.text.SimpleDateFormat; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* (Company)表服务实现类 |
|||
* |
|||
* @author ran hao yu |
|||
* @since 2020-09-18 14:11:43 |
|||
*/ |
|||
@Service("companyService") |
|||
public class CompanyServiceImpl implements CompanyService { |
|||
@Resource |
|||
private CompanyMapper companyMapper; |
|||
|
|||
/** |
|||
* 通过ID查询单条数据 |
|||
* |
|||
* @param id 主键 |
|||
* @return 实例对象 |
|||
*/ |
|||
@Override |
|||
public Company queryById(Integer id) { |
|||
return this.companyMapper.queryById(id); |
|||
} |
|||
|
|||
/** |
|||
* 查询多条数据 |
|||
* |
|||
* @return 对象列表 |
|||
*/ |
|||
@Override |
|||
public List<Company> queryAllByLimit(String code,String name,String taxNo) { |
|||
return this.companyMapper.queryAllByLimit(code,name,taxNo); |
|||
} |
|||
|
|||
@Override |
|||
public List<Company> queryAll(Company company) { |
|||
return this.companyMapper.queryAll(company); |
|||
} |
|||
|
|||
/** |
|||
* 新增数据 |
|||
* |
|||
* @param company 实例对象 |
|||
* @return 实例对象 |
|||
*/ |
|||
@Override |
|||
public RestResponse insert(Company company) { |
|||
try { |
|||
SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd"); |
|||
company.setIsDel("0"); |
|||
company.setCustomerId(1); |
|||
company.setCreateTime(sim.format(new Date())); |
|||
this.companyMapper.insert(company); |
|||
return RestResponse.success("添加成功"); |
|||
} catch (ServiceException e) { |
|||
throw new ServiceException(e); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 修改数据 |
|||
* |
|||
* @param company 实例对象 |
|||
* @return 实例对象 |
|||
*/ |
|||
@Override |
|||
public Company update(Company company) { |
|||
this.companyMapper.update(company); |
|||
return this.queryById(company.getId()); |
|||
} |
|||
|
|||
/** |
|||
* 通过主键删除数据 |
|||
* |
|||
* @param id 主键 |
|||
* @return 是否成功 |
|||
*/ |
|||
@Override |
|||
public boolean deleteById(Integer id) { |
|||
return this.companyMapper.deleteById(id) > 0; |
|||
} |
|||
|
|||
/** |
|||
* 启用 |
|||
* |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public RestResponse active(Integer id) { |
|||
try { |
|||
Company company = queryById(id); |
|||
if (company == null) { |
|||
throw new ServiceException("id无效", 0001); |
|||
} |
|||
companyMapper.active(id); |
|||
return RestResponse.success(); |
|||
} catch (ServiceException e) { |
|||
throw new ServiceException(e); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 停用 |
|||
* |
|||
* @param id |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public RestResponse clock(Integer id) { |
|||
try { |
|||
Company company = queryById(id); |
|||
if (company == null) { |
|||
throw new ServiceException("id无效", 0001); |
|||
} |
|||
companyMapper.clock(id); |
|||
return RestResponse.success(); |
|||
} catch (ServiceException e) { |
|||
throw new ServiceException(e); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
package com.cmsen.ticket.application.service.impl; |
|||
|
|||
import com.cmsen.ticket.application.service.CorporateInvoiceService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* @author OWTS |
|||
* @version 1.0.0 |
|||
* @date 2021/1/16 16:38 |
|||
**/ |
|||
@Slf4j |
|||
@Service |
|||
public class CorporateInvoiceServiceImpl implements CorporateInvoiceService { |
|||
|
|||
} |
|||
File diff suppressed because it is too large
@ -0,0 +1,867 @@ |
|||
package com.cmsen.ticket.application.service.impl; |
|||
|
|||
import cn.hutool.http.HttpUtil; |
|||
import com.cmsen.common.exception.DataException; |
|||
import com.cmsen.common.exception.ServiceException; |
|||
import com.cmsen.common.http.ClientHttp; |
|||
import com.cmsen.common.http.ClientHttpRequest; |
|||
import com.cmsen.common.http.ClientHttpResponse; |
|||
import com.cmsen.common.http.ContentEnctype; |
|||
import com.cmsen.common.http.response.RestResponse; |
|||
import com.cmsen.common.util.DateFormat; |
|||
import com.cmsen.common.util.JsonUtil; |
|||
import com.cmsen.common.util.StorageCache; |
|||
import com.cmsen.common.util.StringUtil; |
|||
import com.cmsen.ticket.application.service.UserService; |
|||
import com.cmsen.ticket.domain.entity.Customer; |
|||
import com.cmsen.ticket.domain.entity.User; |
|||
import com.cmsen.ticket.domain.entity.VerifiedUser; |
|||
import com.cmsen.ticket.domain.entity.manager.SysConfig; |
|||
import com.cmsen.ticket.domain.entity.manager.SysUser; |
|||
import com.cmsen.ticket.domain.mapper.CustomerMapper; |
|||
import com.cmsen.ticket.domain.mapper.UserMapper; |
|||
import com.cmsen.ticket.domain.mapper.VerifiedUserMapper; |
|||
import com.cmsen.ticket.domain.mapper.manager.SysConfigMapper; |
|||
import com.cmsen.ticket.domain.mapper.manager.SysUserMapper; |
|||
import com.cmsenframework.security.*; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.security.authentication.AuthenticationManager; |
|||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; |
|||
import org.springframework.security.core.Authentication; |
|||
import org.springframework.security.core.userdetails.UserDetails; |
|||
import org.springframework.security.core.userdetails.UsernameNotFoundException; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Propagation; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
import org.springframework.util.StringUtils; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.util.*; |
|||
|
|||
/** |
|||
* @author ran hao yu |
|||
* @date 2020/7/31 9:32 |
|||
* @description |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
public class UserServiceImpl implements UserService, UserDetailService { |
|||
private static final long EXPIRE_IN = 24 * 60 * 60; |
|||
private static final int CODE_EXPIRE_TIME = 10 * 60 * 1000; |
|||
@Resource |
|||
private UserMapper userMapper; |
|||
@Value("${wechat.appId}") |
|||
private String appId; |
|||
@Value("${wechat.appSecret}") |
|||
private String appSecret; |
|||
@Value("${wechat.corAppId}") |
|||
private String corAppId; |
|||
@Value("${wechat.corSecret}") |
|||
private String corAppSecret; |
|||
@Value("${spring.jwt.password}") |
|||
private String defaultPassword; |
|||
@Value("${spring.jwt.en_password}") |
|||
private String enPassword; |
|||
@Resource |
|||
private VerifiedUserMapper verifiedUserMapper; |
|||
@Resource |
|||
private AuthenticationManager authenticationManager; |
|||
@Resource |
|||
private SysUserMapper sysUserMapper; |
|||
@Resource |
|||
private CustomerMapper customerMapper; |
|||
@Resource |
|||
private SysConfigMapper sysConfigMapper; |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public RestResponse insert(User record) { |
|||
try { |
|||
int i = userMapper.insert(record); |
|||
if (i > 0) { |
|||
return RestResponse.success("添加成功"); |
|||
} else { |
|||
throw new ServiceException("添加失败", 11); |
|||
} |
|||
} catch (ServiceException e) { |
|||
throw new ServiceException(e); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public RestResponse appAuth(String jscode, String corCode, int type) { |
|||
// 20240202特殊要求企业
|
|||
SysConfig authType = sysConfigMapper.selectByCode("Wechat_Auth_type"); |
|||
if(authType!=null && authType.getValue()!=null && authType.getValue().length()>0){ |
|||
if(authType.getValue().equals("bayer")){ |
|||
return corWechatAuthBayer(jscode,corCode); |
|||
} |
|||
} |
|||
//企业微信授权
|
|||
if (type == 1) { |
|||
return corWechatAuth(jscode, corCode); |
|||
} |
|||
//微信授权
|
|||
String url = "https://api.weixin.qq.com/sns/jscode2session" + |
|||
"?appid=" + appId + |
|||
"&secret=" + appSecret + |
|||
"&js_code=" + jscode + |
|||
"&grant_type=authorization_code"; |
|||
String openId = ""; |
|||
try { |
|||
String result = HttpUtil.get(url); |
|||
log.info("GET OPENID >> {}", result); |
|||
openId = String.valueOf(JsonUtil.toObject(result).get("openid")); |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
return RestResponse.failure("Get OpenId Failure"); |
|||
} |
|||
//获得openID
|
|||
if (StringUtil.isEmpty(openId) || "null".equals(openId)) { |
|||
return RestResponse.failure("Get OpenId Failure"); |
|||
} |
|||
User user = new User(); |
|||
user.setOpenid(openId); |
|||
User user1 = userMapper.selectByUser(user); |
|||
if (user1 == null || user1.getChecked().equals(0)) { |
|||
return RestResponse.success("请先验证手机号", 301); |
|||
} |
|||
VerifiedUser verifiedUser = verifiedUserMapper.checkByTelOrEmail(user1.getTel()); |
|||
if(verifiedUser != null){ |
|||
user1.setVUserExt05(verifiedUser.getExt05()); |
|||
} |
|||
|
|||
Map<String, Object> data = new HashMap<>(); |
|||
// 用户已绑定电话,生成 Token 返回
|
|||
String userDetail = getUserDetail("wechat" + user1.getTel(), null); |
|||
Customer customer = customerMapper.queryById(user1.getClient()); |
|||
Map<String, Object> tokenInfo = new HashMap<>(); |
|||
tokenInfo.put("token", userDetail); |
|||
data.put("tokenInfo", tokenInfo); |
|||
data.put("openId", user1.getOpenid()); |
|||
data.put("tel", user1.getTel()); |
|||
data.put("client", user1.getClient()); |
|||
data.put("userInfo", user1); |
|||
data.put("manual", user1.isManual()); |
|||
data.put("multiInv", customer.getMultiInv()); |
|||
data.put("manualFieldConfig", customer.getManualFieldConfig()); |
|||
data.put("userType", user1.getType()); |
|||
data.put("forceValid", customer.getForceValid()); |
|||
data.put("expenseTypeActive", customer.getExpenseTypeActive()); |
|||
data.put("locationMandantory",sysConfigMapper.selectByCode("LOCATION_MANDANTORY").getValue()); |
|||
data.put("bpmUrl",sysConfigMapper.selectByCode("BPM_URL").getValue()); |
|||
data.put("otherWechatAppId",sysConfigMapper.selectByCode("OTHER_WECHAT_APP_ID").getValue()); |
|||
|
|||
return RestResponse.success(data); |
|||
} |
|||
|
|||
private RestResponse corWechatAuth(String jsCode, String corCode) { |
|||
try { |
|||
//获取 微信openId
|
|||
String url = "https://api.weixin.qq.com/sns/jscode2session" + |
|||
"?appid=" + appId + |
|||
"&secret=" + appSecret + |
|||
"&js_code=" + jsCode + |
|||
"&grant_type=authorization_code"; |
|||
String openId = ""; |
|||
try { |
|||
String result = HttpUtil.get(url); |
|||
log.info("GET OPENID >> {}", result); |
|||
openId = String.valueOf(JsonUtil.toObject(result).get("openid")); |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
return RestResponse.failure("Get OpenId Failure"); |
|||
} |
|||
if (StringUtil.isEmpty(openId) || "null".equals(openId)) { |
|||
return RestResponse.failure("Get OpenId Failure"); |
|||
} |
|||
//比较数据库用户
|
|||
User userSearch = new User(); |
|||
userSearch.setOpenid(openId); |
|||
User user1 = userMapper.selectByUser(userSearch); |
|||
//有 登录
|
|||
if (user1 != null) { |
|||
Map<String, Object> data = new HashMap<>(); |
|||
String userDetail = getUserDetail("wechat" + user1.getTel(), null); |
|||
Customer customer = customerMapper.queryById(1); |
|||
Map<String, Object> tokenInfo = new HashMap<>(); |
|||
tokenInfo.put("token", userDetail); |
|||
data.put("tokenInfo", tokenInfo); |
|||
data.put("openId", user1.getOpenid()); |
|||
data.put("tel", user1.getTel()); |
|||
data.put("client", user1.getClient()); |
|||
data.put("userInfo", user1); |
|||
data.put("manual", user1.isManual()); |
|||
data.put("multiInv", customer.getMultiInv()); |
|||
data.put("manualFieldConfig", customer.getManualFieldConfig()); |
|||
data.put("userType", user1.getType()); |
|||
data.put("forceValid", customer.getForceValid()); |
|||
data.put("expenseTypeActive", customer.getExpenseTypeActive()); |
|||
data.put("locationMandantory",sysConfigMapper.selectByCode("LOCATION_MANDANTORY").getValue()); |
|||
data.put("bpmUrl",sysConfigMapper.selectByCode("BPM_URL").getValue()); |
|||
data.put("otherWechatAppId",sysConfigMapper.selectByCode("OTHER_WECHAT_APP_ID").getValue()); |
|||
|
|||
return RestResponse.success(data); |
|||
} |
|||
//无 获取企业微信userId
|
|||
String result = HttpUtil.get("https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=" |
|||
+ corAppId + "&corpsecret=" + corAppSecret); |
|||
String access_token = String.valueOf(JsonUtil.toObject(result).get("access_token")); |
|||
log.info("Access Token >> {}", result); |
|||
if (StringUtil.isEmpty(access_token) || "null".equals(access_token)) { |
|||
return RestResponse.failure("获取Access Token失败"); |
|||
} |
|||
String userResult = HttpUtil.get("https://qyapi.weixin.qq.com/cgi-bin/miniprogram/jscode2session?grant_type=authorization_code" |
|||
+ "&access_token=" + access_token + "&js_code=" + corCode); |
|||
String userid = String.valueOf(JsonUtil.toObject(userResult).get("userid")); |
|||
log.info("Cor User Info >> {}", userResult); |
|||
if (StringUtil.isEmpty(userid) || "null".equals(userid)) { |
|||
return RestResponse.failure("获取UserId失败"); |
|||
} |
|||
//比对verifyUser
|
|||
VerifiedUser verifiedUser = verifiedUserMapper.checkByTel(userid); |
|||
// 无 无使用权限
|
|||
if (verifiedUser == null) { |
|||
return RestResponse.failure("用户无使用权限"); |
|||
} |
|||
// 有创建用户 并登录
|
|||
User user2 = new User(); |
|||
user2.setUsername(verifiedUser.getName()); |
|||
user2.setEmail(verifiedUser.getLoginId()); |
|||
user2.setIsDel("0"); |
|||
user2.setCreateTime(DateFormat.format(new Date(), DateFormat.DatePatternType.FORMAT_yyyy_MM_dd_HH_mm_ss)); |
|||
user2.setUpdateTime(user2.getCreateTime()); |
|||
user2.setLanguageType("cn"); |
|||
user2.setClient(1); |
|||
user2.setChecked(1); |
|||
user2.setTel(userid); |
|||
user2.setOpenid(openId); |
|||
userMapper.insert(user2); |
|||
User user = userMapper.selectByUser(user2); |
|||
Map<String, Object> data = new HashMap<>(); |
|||
String userDetail = getUserDetail("wechat" + user2.getTel(), null); |
|||
Customer customer = customerMapper.queryById(1); |
|||
Map<String, Object> tokenInfo = new HashMap<>(); |
|||
tokenInfo.put("token", userDetail); |
|||
data.put("tokenInfo", tokenInfo); |
|||
data.put("openId", user.getOpenid()); |
|||
data.put("tel", user.getTel()); |
|||
data.put("client", user.getClient()); |
|||
data.put("userInfo", user); |
|||
data.put("manual", user.isManual()); |
|||
data.put("multiInv", customer.getMultiInv()); |
|||
data.put("manualFieldConfig", customer.getManualFieldConfig()); |
|||
data.put("userType", user.getType()); |
|||
data.put("forceValid", customer.getForceValid()); |
|||
data.put("expenseTypeActive", customer.getExpenseTypeActive()); |
|||
data.put("locationMandantory",sysConfigMapper.selectByCode("LOCATION_MANDANTORY").getValue()); |
|||
data.put("bpmUrl",sysConfigMapper.selectByCode("BPM_URL").getValue()); |
|||
data.put("otherWechatAppId",sysConfigMapper.selectByCode("OTHER_WECHAT_APP_ID").getValue()); |
|||
|
|||
return RestResponse.success(data); |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
throw new ServiceException("授权失败"); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* bayer企微单独接口 |
|||
* @param jsCode |
|||
* @param corCode |
|||
* @return |
|||
*/ |
|||
private RestResponse corWechatAuthBayer(String jsCode, String corCode) { |
|||
try { |
|||
SysConfig sid = sysConfigMapper.selectByCode("Bayer_Wechat_Auth_Sid"); |
|||
|
|||
if (sid==null ||sid.getValue()==null || sid.getValue().length()==0) { |
|||
return RestResponse.failure("Get Bayer Sid Failure"); |
|||
} |
|||
if(corCode==null || corCode.length()==0){ |
|||
corCode = jsCode; |
|||
} |
|||
//获取 微信openId
|
|||
String url = "https://apigetaway-bayerwechat.bayer.cn/connector-service/mini_login" ; |
|||
/*"?code=" + corCode + |
|||
"&sid=" + sid.getValue() ;*/ |
|||
String openId = ""; |
|||
String result =""; |
|||
Map<String,String> params = new HashMap<>(); |
|||
params.put("code",corCode); |
|||
params.put("sid",sid.getValue()); |
|||
Map<String,Object> mapUser = null; |
|||
Map<String,Object> mapUserCwid = null; |
|||
try { |
|||
/*HttpRequest reqPost = HttpUtil.createPost(url); |
|||
reqPost.form("code",corCode); |
|||
reqPost.form("sid",sid.getValue()); |
|||
result = reqPost.execute().body();*/ |
|||
ClientHttpResponse postReq = ClientHttp.post(new ClientHttpRequest() {{ |
|||
setUrl(url); |
|||
setHeaders("Content-Type", ContentEnctype.JSON); |
|||
setParams(JsonUtil.toString(params)); |
|||
}}); |
|||
result = postReq.getBody().toString(); |
|||
log.info("GET BAYER OPENID >> {}", result); |
|||
mapUser = (Map)JsonUtil.toObject(result); |
|||
mapUserCwid = (Map)mapUser.get("user"); |
|||
openId = mapUserCwid.get("UserIdentity").toString(); |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
return RestResponse.failure("无法获得对应的Concur账号,请联系IT热线"); |
|||
} |
|||
if (StringUtil.isEmpty(openId) || "null".equals(openId)) { |
|||
return RestResponse.failure("无法获得对应的Concur账号,请联系IT热线"); |
|||
} |
|||
//比较数据库用户
|
|||
User userSearch = new User(); |
|||
userSearch.setOpenid(openId); |
|||
User user1 = userMapper.selectByUser(userSearch); |
|||
//有 登录
|
|||
if (user1 != null) { |
|||
Map<String, Object> data = new HashMap<>(); |
|||
String userDetail = getUserDetail("wechat" + user1.getTel(), null); |
|||
Customer customer = customerMapper.queryById(1); |
|||
Map<String, Object> tokenInfo = new HashMap<>(); |
|||
tokenInfo.put("token", userDetail); |
|||
data.put("tokenInfo", tokenInfo); |
|||
data.put("openId", user1.getOpenid()); |
|||
data.put("tel", user1.getTel()); |
|||
data.put("client", user1.getClient()); |
|||
data.put("userInfo", user1); |
|||
data.put("manual", user1.isManual()); |
|||
data.put("multiInv", customer.getMultiInv()); |
|||
data.put("manualFieldConfig", customer.getManualFieldConfig()); |
|||
data.put("userType", user1.getType()); |
|||
data.put("forceValid", customer.getForceValid()); |
|||
data.put("expenseTypeActive", customer.getExpenseTypeActive()); |
|||
data.put("locationMandantory",sysConfigMapper.selectByCode("LOCATION_MANDANTORY").getValue()); |
|||
data.put("bpmUrl",sysConfigMapper.selectByCode("BPM_URL").getValue()); |
|||
data.put("otherWechatAppId",sysConfigMapper.selectByCode("OTHER_WECHAT_APP_ID").getValue()); |
|||
|
|||
return RestResponse.success(data); |
|||
} |
|||
Map<String,Object> mapBag = (Map)mapUserCwid.get("PropertyBag"); |
|||
List<Map> lsBag = (List)mapBag.get("TUSR_EX_bayer_ext_data"); |
|||
String userEmail=""; |
|||
for(int i=0; i<lsBag.size(); i++){ |
|||
Map<String,String> tmpObj = lsBag.get(i); |
|||
if(tmpObj.get("PropertyDisplayName").toString().equals("邮箱")){//邮箱对象
|
|||
userEmail =tmpObj.get("PropertyValue").toString(); |
|||
} |
|||
|
|||
} |
|||
//比对verifyUser
|
|||
VerifiedUser verifiedUser = verifiedUserMapper.checkByTelOrEmail(userEmail); |
|||
// 无 无使用权限
|
|||
if (verifiedUser == null) { |
|||
return RestResponse.failure("用户无使用权限"); |
|||
} |
|||
// CWID回写到verfiedUser
|
|||
if(verifiedUser.getTel()==null || verifiedUser.getTel().length()==0){ |
|||
verifiedUser.setTel(openId); |
|||
verifiedUserMapper.updateByPrimaryKeySelective(verifiedUser); |
|||
} |
|||
// 创建用户 并登录
|
|||
User user2 = new User(); |
|||
user2.setUsername(verifiedUser.getName()); |
|||
user2.setEmail(verifiedUser.getLoginId()); |
|||
user2.setIsDel("0"); |
|||
user2.setCreateTime(DateFormat.format(new Date(), DateFormat.DatePatternType.FORMAT_yyyy_MM_dd_HH_mm_ss)); |
|||
user2.setUpdateTime(user2.getCreateTime()); |
|||
user2.setLanguageType("cn"); |
|||
user2.setClient(1); |
|||
user2.setChecked(1); |
|||
user2.setTel(userEmail); |
|||
user2.setOpenid(openId); |
|||
userMapper.insert(user2); |
|||
User user = userMapper.selectByUser(user2); |
|||
Map<String, Object> data = new HashMap<>(); |
|||
String userDetail = getUserDetail("wechat" + user2.getTel(), null); |
|||
Customer customer = customerMapper.queryById(1); |
|||
Map<String, Object> tokenInfo = new HashMap<>(); |
|||
tokenInfo.put("token", userDetail); |
|||
data.put("tokenInfo", tokenInfo); |
|||
data.put("openId", user.getOpenid()); |
|||
data.put("tel", user.getTel()); |
|||
data.put("client", user.getClient()); |
|||
data.put("userInfo", user); |
|||
data.put("manual", user.isManual()); |
|||
data.put("multiInv", customer.getMultiInv()); |
|||
data.put("manualFieldConfig", customer.getManualFieldConfig()); |
|||
data.put("userType", user.getType()); |
|||
data.put("forceValid", customer.getForceValid()); |
|||
data.put("expenseTypeActive", customer.getExpenseTypeActive()); |
|||
data.put("locationMandantory",sysConfigMapper.selectByCode("LOCATION_MANDANTORY").getValue()); |
|||
data.put("bpmUrl",sysConfigMapper.selectByCode("BPM_URL").getValue()); |
|||
data.put("otherWechatAppId",sysConfigMapper.selectByCode("OTHER_WECHAT_APP_ID").getValue()); |
|||
|
|||
return RestResponse.success(data); |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
throw new ServiceException("授权失败"); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public RestResponse getMessagesCode(String jsCode, String tel) { |
|||
|
|||
//错误返回
|
|||
Map<String, Object> failMess = new HashMap<>(); |
|||
failMess.put("cn","账号不存在,请联系管理员"); |
|||
failMess.put("en","Login ID is invalid,Please contact administrator!"); |
|||
SysConfig config = sysConfigMapper.selectByCode("no_account_mesg"); |
|||
if(config != null){ |
|||
failMess.put("cn",config.getValue()); |
|||
failMess.put("en",config.getDesc()); |
|||
} |
|||
|
|||
log.info("Get Message Code >> {}", tel); |
|||
if (StringUtils.isEmpty(jsCode)) { |
|||
throw new DataException("jsCode required"); |
|||
} |
|||
|
|||
//判断手机号登录 or 邮箱登录
|
|||
boolean isTel = com.cmsen.ticket.domain.util.StringUtils.isInteger(tel); |
|||
|
|||
//根据手机号验证是否已存在用户,然后发送短信
|
|||
User user1 = new User(); |
|||
if (isTel) { |
|||
user1.setTel(tel); |
|||
} else { |
|||
user1.setEmail(tel); |
|||
} |
|||
User user2 = userMapper.selectByUser(user1); |
|||
|
|||
int code = (int) ((Math.random() * 9 + 1) * 100000); |
|||
User user = new User(); |
|||
if (isTel) { |
|||
user.setTel(tel); |
|||
} else { |
|||
user.setEmail(tel); |
|||
} |
|||
|
|||
if(user2 == null){//不存在用户
|
|||
//查询验证表单验证是否存在该使用者
|
|||
VerifiedUser verifiedUser = verifiedUserMapper.checkByTelOrEmail(tel); |
|||
if (verifiedUser == null) { |
|||
//return RestResponse.failure("账号未验证,请联系管理员进行认证。", 402);
|
|||
return RestResponse.failure(String.valueOf(failMess), 402); |
|||
} |
|||
String url = "https://api.weixin.qq.com/sns/jscode2session" + |
|||
"?appid=" + appId + |
|||
"&secret=" + appSecret + |
|||
"&js_code=" + jsCode + |
|||
"&grant_type=authorization_code"; |
|||
String openId = ""; |
|||
String unionId = ""; |
|||
try { |
|||
String result = HttpUtil.get(url); |
|||
log.info("GET OPENID >> {}", result); |
|||
openId = String.valueOf(JsonUtil.toObject(result).get("openid")); |
|||
unionId = String.valueOf(JsonUtil.toObject(result).get("unionid")); |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
//return RestResponse.failure("Get OpenId Failure");
|
|||
return RestResponse.failure(String.valueOf(failMess)); |
|||
} |
|||
//获得openID
|
|||
if (StringUtil.isEmpty(openId) || "null".equals(openId)) { |
|||
//return RestResponse.failure("Get OpenId Failure");
|
|||
return RestResponse.failure(String.valueOf(failMess)); |
|||
} |
|||
//判断openId 是否存在
|
|||
User userOpenId = userMapper.selectByOpenId(openId, "0"); |
|||
if(null == userOpenId){ |
|||
user.setOpenid(openId); |
|||
user.setUnionid(unionId); |
|||
user.setClient(verifiedUser.getClientId()); |
|||
user.setUsername(verifiedUser.getName()); |
|||
user.setEmail(verifiedUser.getLoginId()); |
|||
user.setTel(verifiedUser.getTel()); |
|||
user.setChecked(0); |
|||
userMapper.insert(user); |
|||
// proxyUserMapper.insert(new ProxyUser() {{
|
|||
// setMainId(user.getUserId());
|
|||
// setProxyId(user.getUserId());
|
|||
// }});
|
|||
}else{//存在
|
|||
if(StringUtil.isBlank(userOpenId.getUnionid())){ |
|||
userMapper.updateUnionId(unionId, userOpenId.getUserId()); |
|||
} |
|||
} |
|||
} |
|||
|
|||
//发送验证码
|
|||
if (isTel) { |
|||
|
|||
String sendSmsUrl = ""; |
|||
SysConfig sysConfig = sysConfigMapper.selectByCode("sendSmsUrl"); |
|||
if(sysConfig != null){ |
|||
sendSmsUrl = sysConfig.getValue(); |
|||
} |
|||
|
|||
String sendSmsSign = "发票助手"; |
|||
sysConfig = sysConfigMapper.selectByCode("sendSmsSign"); |
|||
if(sysConfig != null){ |
|||
sendSmsSign = sysConfig.getValue(); |
|||
} |
|||
|
|||
// SmsUtil.sendSms(tel, code, sendSmsUrl, sendSmsSign);
|
|||
} else { |
|||
// Boolean sendResult = sendMailService.sendVerifiedCode(tel, String.valueOf(code));
|
|||
// if (!sendResult) {
|
|||
// return RestResponse.failure("验证码发送失败");
|
|||
// }
|
|||
} |
|||
StorageCache.write(tel, code, CODE_EXPIRE_TIME); |
|||
return RestResponse.success(code); |
|||
|
|||
|
|||
/*if (user2 != null) { |
|||
//发送验证码
|
|||
if (isTel) { |
|||
|
|||
String sendSmsUrl = ""; |
|||
SysConfig sysConfig = sysConfigMapper.selectByCode("sendSmsUrl"); |
|||
if(sysConfig != null){ |
|||
sendSmsUrl = sysConfig.getValue(); |
|||
} |
|||
SmsUtil.sendSms(tel, code, sendSmsUrl); |
|||
} else { |
|||
Boolean sendResult = sendMailService.sendVerifiedCode(tel, String.valueOf(code)); |
|||
if (!sendResult) { |
|||
return RestResponse.failure("验证码发送失败"); |
|||
} |
|||
} |
|||
StorageCache.write(tel, code, CODE_EXPIRE_TIME); |
|||
return RestResponse.success(code); |
|||
} else { |
|||
//查询验证表单验证是否存在该使用者
|
|||
VerifiedUser verifiedUser = verifiedUserMapper.checkByTelOrEmail(tel); |
|||
if (verifiedUser == null) { |
|||
return RestResponse.failure("账号未验证,请联系管理员进行认证。", 402); |
|||
} |
|||
String url = "https://api.weixin.qq.com/sns/jscode2session" + |
|||
"?appid=" + appId + |
|||
"&secret=" + appSecret + |
|||
"&js_code=" + jsCode + |
|||
"&grant_type=authorization_code"; |
|||
String openId = ""; |
|||
try { |
|||
String result = HttpUtil.get(url); |
|||
log.info("GET OPENID >> {}", result); |
|||
openId = String.valueOf(JsonUtil.toObject(result).get("openid")); |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
return RestResponse.failure("Get OpenId Failure"); |
|||
} |
|||
//获得openID
|
|||
if (StringUtil.isEmpty(openId) || "null".equals(openId)) { |
|||
return RestResponse.failure("Get OpenId Failure"); |
|||
} |
|||
user.setOpenid(openId); |
|||
user.setClient(verifiedUser.getClientId()); |
|||
user.setUsername(verifiedUser.getName()); |
|||
user.setEmail(verifiedUser.getLoginId()); |
|||
user.setTel(verifiedUser.getTel()); |
|||
user.setChecked(0); |
|||
int insert = userMapper.insert(user); |
|||
if (insert > 0) { |
|||
//发送验证码
|
|||
proxyUserMapper.insert(new ProxyUser() {{ |
|||
setMainId(user.getUserId()); |
|||
setProxyId(user.getUserId()); |
|||
}}); |
|||
if (isTel) { |
|||
String sendSmsUrl = ""; |
|||
SysConfig sysConfig = sysConfigMapper.selectByCode("sendSmsUrl"); |
|||
if(sysConfig != null){ |
|||
sendSmsUrl = sysConfig.getValue(); |
|||
} |
|||
SmsUtil.sendSms(tel, code, sendSmsUrl); |
|||
} else { |
|||
Boolean sendResult = sendMailService.sendVerifiedCode(tel, String.valueOf(code)); |
|||
if (!sendResult) { |
|||
return RestResponse.failure("验证码发送失败"); |
|||
} |
|||
} |
|||
StorageCache.write(tel, code, CODE_EXPIRE_TIME); |
|||
return RestResponse.success(code); |
|||
} else { |
|||
return RestResponse.failure("获取验证码失败"); |
|||
} |
|||
}*/ |
|||
} |
|||
|
|||
@Override |
|||
public RestResponse verifyMessages(String jsCode, Integer verificationCode, String tel) { |
|||
log.info("verifyMessages {} {}", tel, verificationCode); |
|||
if (!StorageCache.containsKey(tel) || !Integer.valueOf(StorageCache.read(tel).toString()).equals(verificationCode)) { |
|||
return RestResponse.failure("验证码错误"); |
|||
} |
|||
boolean isTel = com.cmsen.ticket.domain.util.StringUtils.isInteger(tel); |
|||
User user1 = new User(); |
|||
if (isTel) { |
|||
user1.setTel(tel); |
|||
} else { |
|||
user1.setEmail(tel); |
|||
} |
|||
User user2 = userMapper.selectByUser(user1); |
|||
if (user2 != null) { |
|||
Map<String, Object> data = new HashMap<>(); |
|||
// 用户已绑定电话,生成 Token 返回
|
|||
String userDetail = getUserDetail("wechat" + tel, null); |
|||
Customer customer = customerMapper.queryById(user2.getClient()); |
|||
Map<String, Object> tokenInfo = new HashMap<>(); |
|||
tokenInfo.put("token", userDetail); |
|||
data.put("tokenInfo", tokenInfo); |
|||
data.put("code", verificationCode); |
|||
data.put("openId", user2.getOpenid()); |
|||
data.put("tel", user2.getTel()); |
|||
data.put("client", user2.getClient()); |
|||
data.put("userInfo", user2); |
|||
data.put("manual", user2.isManual()); |
|||
data.put("multiInv", customer.getMultiInv()); |
|||
data.put("manualFieldConfig", customer.getManualFieldConfig()); |
|||
data.put("userType", user2.getType()); |
|||
data.put("forceValid", customer.getForceValid()); |
|||
data.put("expenseTypeActive", customer.getExpenseTypeActive()); |
|||
data.put("locationMandantory",sysConfigMapper.selectByCode("LOCATION_MANDANTORY").getValue()); |
|||
data.put("bpmUrl",sysConfigMapper.selectByCode("BPM_URL").getValue()); |
|||
data.put("otherWechatAppId",sysConfigMapper.selectByCode("OTHER_WECHAT_APP_ID").getValue()); |
|||
|
|||
String titleCn = "智能发票助手"; |
|||
SysConfig sysConfig = sysConfigMapper.selectByCode("appletTitle_Cn"); |
|||
if(sysConfig != null){ |
|||
titleCn = sysConfig.getValue(); |
|||
} |
|||
|
|||
String titleEn = "Smart Invoice"; |
|||
sysConfig = sysConfigMapper.selectByCode("appletTitle_En"); |
|||
if(sysConfig != null){ |
|||
titleEn = sysConfig.getValue(); |
|||
} |
|||
data.put("titleCn",titleCn); |
|||
data.put("titleEn",titleEn); |
|||
|
|||
//新增GPS权限 2023/5/10
|
|||
VerifiedUser verifiedUser = verifiedUserMapper.checkByTel(user2.getTel()); |
|||
if(verifiedUser != null){ |
|||
data.put("isGPS",verifiedUser.getExt02()); |
|||
}else{ |
|||
data.put("isGPS","0"); |
|||
} |
|||
|
|||
String single_ai = ""; |
|||
sysConfig = sysConfigMapper.selectByCode("single_ai"); |
|||
if(sysConfig != null){ |
|||
single_ai = sysConfig.getValue(); |
|||
} |
|||
String multi_ai = ""; |
|||
sysConfig = sysConfigMapper.selectByCode("multi_ai"); |
|||
if(sysConfig != null){ |
|||
multi_ai = sysConfig.getValue(); |
|||
} |
|||
data.put("single_ai",single_ai); |
|||
data.put("multi_ai",multi_ai); |
|||
|
|||
user2.setChecked(1); |
|||
userMapper.updateByPrimaryKey(user2); |
|||
|
|||
return RestResponse.success(data); |
|||
} else { |
|||
return RestResponse.failure("验证码错误或已过期"); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public RestResponse updateLanguageType(User user) { |
|||
try { |
|||
if (user.getLanguageType() == null) { |
|||
throw new ServiceException("语言类型为空"); |
|||
} |
|||
int i = userMapper.updateByPrimaryKeySelective(user); |
|||
if (i > 0) { |
|||
return RestResponse.success("修改语言类型成功"); |
|||
} else { |
|||
throw new ServiceException("修改语言类型失败"); |
|||
} |
|||
} catch (ServiceException e) { |
|||
throw new ServiceException(e); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(propagation = Propagation.NOT_SUPPORTED) |
|||
public RestResponse selectUser(String openID) { |
|||
if (openID == null) { |
|||
throw new DataException("用户openID为空"); |
|||
} else { |
|||
User user1 = new User(); |
|||
user1.setOpenid(openID); |
|||
User user = userMapper.selectByUser(user1); |
|||
if (user == null) { |
|||
return RestResponse.success(""); |
|||
} else { |
|||
VerifiedUser verifiedUser = verifiedUserMapper.checkByTelOrEmail(user.getTel()); |
|||
if(verifiedUser != null){ |
|||
user.setVUserExt05(verifiedUser.getExt05()); |
|||
} |
|||
|
|||
return RestResponse.success(user); |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
//授权
|
|||
@Override |
|||
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { |
|||
if (username.startsWith("wechat")) { |
|||
String wechat = username.replace("wechat", ""); |
|||
boolean isTel = com.cmsen.ticket.domain.util.StringUtils.isInteger(wechat); |
|||
User user = userMapper.selectByUser(new User() {{ |
|||
if (isTel) { |
|||
setTel(wechat); |
|||
} else { |
|||
if(wechat.contains("@")) { |
|||
setEmail(wechat); |
|||
}else{ |
|||
setTel(wechat); |
|||
} |
|||
} |
|||
}}); |
|||
if (user == null) { |
|||
throw new ServiceException("Wrong Tel or Wrong Email"); |
|||
} |
|||
List<String> permissions = new ArrayList<>(); |
|||
for (RequestContextMap.Context value : RequestContextMap.get().values()) { |
|||
if (value.getPath().contains("mini")) { |
|||
permissions.add(value.getPermission()); |
|||
} |
|||
} |
|||
UserDetail userDetail = new UserDetail(); |
|||
userDetail.setUserId(Long.valueOf(user.getUserId().toString())); |
|||
userDetail.setUsername(user.getTel()); |
|||
userDetail.setPassword(enPassword); |
|||
userDetail.setPermissions(permissions); |
|||
JsonWebTokenUtil.setClaims("userId", user.getUserId()); |
|||
JsonWebTokenUtil.setClaims("username", user.getTel()); |
|||
JsonWebTokenUtil.setClaims("permissions", permissions); |
|||
userDetail.setToken(JsonWebTokenUtil.builder(user.getTel(), EXPIRE_IN)); |
|||
return userDetail; |
|||
} |
|||
|
|||
SysUser sysUser = sysUserMapper.selectByUserName(username); |
|||
if (sysUser == null) { |
|||
throw new ServiceException("wrong username or password"); |
|||
} |
|||
|
|||
List<String> permissions = new ArrayList<>(); |
|||
// if (sysUser.getRole().equals(1)) {
|
|||
for (RequestContextMap.Context value : RequestContextMap.get().values()) { |
|||
if (value.getPath().contains("manager")) { |
|||
permissions.add(value.getPermission()); |
|||
} |
|||
} |
|||
UserDetail userDetail = new UserDetail(); |
|||
userDetail.setUserId(Long.valueOf(sysUser.getId())); |
|||
userDetail.setUsername(sysUser.getName()); |
|||
userDetail.setPassword(sysUser.getPwd()); |
|||
userDetail.setPermissions(permissions); |
|||
JsonWebTokenUtil.setExpireIn(EXPIRE_IN); |
|||
JsonWebTokenUtil.setClaims("userId", sysUser.getId()); |
|||
JsonWebTokenUtil.setClaims("username", sysUser.getName()); |
|||
JsonWebTokenUtil.setClaims("permissions", permissions); |
|||
userDetail.setToken(JsonWebTokenUtil.builder(sysUser.getName())); |
|||
return userDetail; |
|||
} |
|||
|
|||
@Override |
|||
public String getUserDetail(String tel, String password) { |
|||
if (password == null) { |
|||
password = defaultPassword; |
|||
} |
|||
UsernamePasswordAuthenticationToken authenticate1 = RequestSecurityPolicy.authenticate(tel, password); |
|||
Authentication authenticate = authenticationManager.authenticate(authenticate1); |
|||
RequestSecurityPolicy.setAuthentication(authenticate); |
|||
UserDetail userDetail = RequestSecurityPolicy.getPrincipal(); |
|||
String uuid = StringUtil.UUID(); |
|||
StorageCache.write("Auth:Bearer " + uuid, "Bearer " + userDetail.getToken(), 1000 * 60 * 60 * 4); |
|||
// userDetail.setToken(uuid);
|
|||
return uuid; |
|||
} |
|||
|
|||
@Transactional |
|||
@Override |
|||
public RestResponse addSendEmails(List<String> emails) { |
|||
// try {
|
|||
// Integer userId = Integer.valueOf(String.valueOf(RequestSecurityPolicy.getUserId()));
|
|||
// userConfigListMapper.deleteByUserIdAndType(userId, "EMAIL");
|
|||
// StringBuilder params = new StringBuilder();
|
|||
// emails.forEach(email -> params.append(email).append(";"));
|
|||
// if (StringUtil.isNotEmpty(params.toString())) {
|
|||
// userConfigListMapper.insert(new UserConfigList() {{
|
|||
// setUserId(userId);
|
|||
// setParams1(params.toString());
|
|||
// setType("EMAIL");
|
|||
// }});
|
|||
// }
|
|||
// return RestResponse.success();
|
|||
// } catch (Exception e) {
|
|||
// log.error(e.getMessage(), e);
|
|||
// throw new ServiceException("系统错误");
|
|||
// }
|
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public RestResponse selectSendEmails() { |
|||
// Integer userId = Integer.valueOf(String.valueOf(RequestSecurityPolicy.getUserId()));
|
|||
// UserConfigList email = userConfigListMapper.selectByUserAndType(userId, "EMAIL");
|
|||
// if (email != null && StringUtil.isNotEmpty(email.getParams1())) {
|
|||
// return RestResponse.success(Arrays.stream(email.getParams1().split(";")).collect(Collectors.toList()));
|
|||
// }
|
|||
return RestResponse.success(new ArrayList<>()); |
|||
} |
|||
|
|||
@Transactional |
|||
@Override |
|||
public RestResponse updateValidType(User user) { |
|||
try { |
|||
userMapper.updateByPrimaryKeySelective(user); |
|||
return RestResponse.success(); |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
throw new ServiceException("更新失败"); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public AuthenticationManager getAuthManager() { |
|||
return authenticationManager; |
|||
} |
|||
|
|||
@Override |
|||
public RestResponse checkGps() { |
|||
try { |
|||
String isGPS = "0"; |
|||
User user = userMapper.selectByUser(new User() {{ |
|||
setUserId((int) RequestSecurityPolicy.getUserId()); |
|||
}}); |
|||
VerifiedUser verifiedUser = verifiedUserMapper.checkByTel(user.getTel()); |
|||
if(verifiedUser != null){ |
|||
isGPS = verifiedUser.getExt02(); |
|||
} |
|||
return RestResponse.success(isGPS); |
|||
} catch (Exception e) { |
|||
log.error(e.getMessage(), e); |
|||
throw new ServiceException("获取失败"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,378 @@ |
|||
package com.cmsen.ticket.bestsign.util; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.alibaba.fastjson2.JSONArray; |
|||
import com.cmsen.common.http.ClientHttpResponse; |
|||
import com.cmsen.common.util.JsonUtil; |
|||
import com.cmsen.common.util.StorageCache; |
|||
import com.cmsen.ticket.domain.entity.manager.SysConfig; |
|||
import com.cmsen.ticket.domain.mapper.manager.SysConfigMapper; |
|||
import com.cmsen.ticket.infrastructure.config.OkHttpMonitorInterceptor; |
|||
import com.cmsen.ticket.infrastructure.config.RestTemplateConfig; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import okhttp3.*; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.slf4j.MDC; |
|||
import org.springframework.http.HttpEntity; |
|||
import org.springframework.http.HttpHeaders; |
|||
import org.springframework.http.HttpMethod; |
|||
import org.springframework.http.ResponseEntity; |
|||
import org.springframework.http.client.SimpleClientHttpRequestFactory; |
|||
import org.springframework.stereotype.Component; |
|||
import org.springframework.util.DigestUtils; |
|||
import org.springframework.web.client.RestTemplate; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.io.IOException; |
|||
import java.net.InetSocketAddress; |
|||
import java.net.Proxy; |
|||
import java.text.SimpleDateFormat; |
|||
import java.util.HashMap; |
|||
import java.util.Map; |
|||
import java.util.UUID; |
|||
import java.util.concurrent.TimeUnit; |
|||
|
|||
/** |
|||
* 接口类 |
|||
* @author xp |
|||
* @date 2018年8月23日 14:57:10 |
|||
*/ |
|||
@Slf4j |
|||
@Component |
|||
public class InterfaceUtil { |
|||
|
|||
@Resource |
|||
private OkHttpMonitorInterceptor okHttpMonitorInterceptor; |
|||
@Resource |
|||
private RestTemplateConfig restTemplateConfig; |
|||
public OkHttpClient buildBasicAuthClient(final String name, final String password) { |
|||
return new OkHttpClient.Builder().authenticator(new Authenticator() { |
|||
@Override |
|||
public Request authenticate(Route route, Response response) throws IOException { |
|||
String credential = Credentials.basic(name, password); |
|||
return response.request().newBuilder().header("Authorization", credential).build(); |
|||
} |
|||
}).build(); |
|||
} |
|||
|
|||
/** |
|||
* 获取列表数据 |
|||
* @param url2 |
|||
* @param params |
|||
* @return |
|||
* @throws IOException |
|||
*/ |
|||
public String[] httpMainGetBasicAuth(String url2, String userName, String password) throws IOException{ |
|||
OkHttpClient client = buildBasicAuthClient(userName,password); |
|||
// String traceId = MDC.get("traceId");
|
|||
// if(StringUtils.isEmpty(traceId)){
|
|||
// traceId = UUID.randomUUID().toString();
|
|||
// }
|
|||
Request request = new Request.Builder() |
|||
.url(url2) |
|||
.get() |
|||
.addHeader("Content-Type", "application/json") |
|||
// .addHeader("X-Trace-Id", traceId)
|
|||
.build(); |
|||
Response response ; |
|||
String content =""; |
|||
int code=200; |
|||
try { |
|||
response = client.newCall(request).execute(); |
|||
content = response.body().string(); |
|||
code = response.code(); |
|||
}catch (Exception e) { |
|||
System.out.println(e.getMessage()); |
|||
} |
|||
String[] arr = {content,String.valueOf(code)}; |
|||
return arr; |
|||
} |
|||
|
|||
|
|||
public String[] httpPostMan2(String url2, Map<String, String> params){ |
|||
|
|||
|
|||
OkHttpClient client = OKHttpClientBuilder.buildOKHttpClient() |
|||
.addInterceptor(okHttpMonitorInterceptor) |
|||
.connectTimeout(60, TimeUnit.SECONDS) |
|||
.readTimeout(100, TimeUnit.SECONDS) |
|||
.build(); |
|||
MediaType mediaType = MediaType.parse(params.get("Content-Type"));//application/x-www-form-urlencoded
|
|||
RequestBody body = RequestBody.create(mediaType, params.get("body")); |
|||
String traceId = MDC.get("traceId"); |
|||
if(StringUtils.isEmpty(traceId)){ |
|||
traceId = UUID.randomUUID().toString(); |
|||
} |
|||
Request request = new Request.Builder() |
|||
.url(url2) |
|||
.post(body) |
|||
.addHeader("Authorization", params.get("Authorization")) |
|||
.addHeader("Content-Type", params.get("Content-Type")) |
|||
.addHeader("cache-control", "no-cache") |
|||
// .addHeader("X-Trace-Id", traceId)
|
|||
// .addHeader("Postman-Token", "d0b912ca-ddda-4287-ad15-54d6ce95e181")
|
|||
.build(); |
|||
/*Response response = client.newCall(request).execute(); |
|||
String content = response.body().string();*/ |
|||
Response response ; |
|||
String content =""; |
|||
int code=200; |
|||
int count = 4; |
|||
try { |
|||
response = client.newCall(request).execute(); |
|||
content = response.body().string(); |
|||
code = response.code(); |
|||
}catch (Exception e){ |
|||
log.error(e.getMessage()); |
|||
while (getMesg(e.getMessage()).equals("error") && count>0){ |
|||
log.info("失败重试》》》》》》》httpPostMan2"+count); |
|||
try { |
|||
response = client.newCall(request).execute(); |
|||
content = response.body().string(); |
|||
code = response.code(); |
|||
}catch (Exception e2) { |
|||
log.error(e2.getMessage()); |
|||
} |
|||
if(!getMesg(content).equals("error")){ |
|||
break; |
|||
} |
|||
count--; |
|||
} |
|||
} |
|||
|
|||
if(getMesg(content).equals("error")){ |
|||
log.error(content+url2+params.toString()); |
|||
} |
|||
String[] arr = {content,String.valueOf(code)}; |
|||
return arr; |
|||
} |
|||
|
|||
public String getMesg(String result){ |
|||
String returnMsg="success"; |
|||
Map<String,String> errorsMsg = new HashMap<>(); |
|||
errorsMsg.put("401","401 Authorization Required"); |
|||
errorsMsg.put("timeOut","timed out"); |
|||
errorsMsg.put("timeOut2","timeout"); |
|||
errorsMsg.put("toekn","token is expired"); |
|||
errorsMsg.put("Service_unavailable","Service Unavailable"); |
|||
for (String msg :errorsMsg.values()){ |
|||
if(msg.length()<3)continue; |
|||
if(result.indexOf(msg) !=-1){ |
|||
returnMsg="error"; |
|||
break; |
|||
} |
|||
} |
|||
return returnMsg; |
|||
} |
|||
|
|||
/** |
|||
* 获取AiToken |
|||
* @param sysConfigMapper |
|||
* @return |
|||
*/ |
|||
public String getAiToken(SysConfigMapper sysConfigMapper, HttpHeaders headers,RestTemplate client ){ |
|||
String token=""; |
|||
|
|||
SysConfig proxyConfig = sysConfigMapper.selectByCode("PF_PROXY"); |
|||
if(null==proxyConfig){ |
|||
|
|||
}else{ |
|||
SysConfig proxyIP = sysConfigMapper.selectByCode("PF_PROXY_IP"); |
|||
SysConfig proxyPort = sysConfigMapper.selectByCode("PF_PROXY_PORT"); |
|||
if(null!=proxyIP&&null!=proxyPort){ |
|||
SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory(); |
|||
requestFactory.setProxy( |
|||
new Proxy( |
|||
Proxy.Type.HTTP, |
|||
new InetSocketAddress(proxyIP.getValue(), Integer.parseInt(proxyPort.getValue())) //设置代理服务
|
|||
) |
|||
); |
|||
client.setRequestFactory(requestFactory); |
|||
} |
|||
} |
|||
// 获取token
|
|||
// 设置请求头,请求类型为json
|
|||
// 判断token是否有效
|
|||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|||
Object tokenObj = StorageCache.read("AITOKEN"); |
|||
if(tokenObj!=null) { |
|||
return tokenObj.toString(); |
|||
}else { |
|||
// url
|
|||
SysConfig aiTokenURl = sysConfigMapper.selectByCode("AI_TOKEN_URL"); |
|||
if(aiTokenURl==null){ |
|||
return null; |
|||
} |
|||
SysConfig aiUserName = sysConfigMapper.selectByCode("AI_USER_NAME"); |
|||
SysConfig aiPassowrd = sysConfigMapper.selectByCode("AI_PASSWORD"); |
|||
// 设置请求参数
|
|||
Map body = new HashMap(); |
|||
Map loginParms = new HashMap(); |
|||
loginParms.put("username", aiUserName.getValue()); |
|||
loginParms.put("password", aiPassowrd.getValue()); |
|||
body.put("jsonrpc", "2.0"); |
|||
body.put("method", "/account/login"); |
|||
body.put("params", loginParms); |
|||
|
|||
// 将map转为json串,放入restTemplate的参数对象中
|
|||
String bodyJsonData = JSON.toJSONString(body); |
|||
|
|||
//用HttpEntity封装整个请求报文
|
|||
HttpEntity<String> request = new HttpEntity<>(bodyJsonData, headers); |
|||
|
|||
// 开始调用
|
|||
// 参数1:目标请求地址
|
|||
// 参数2:请求体
|
|||
// 参数3:目标请求接口的返回值类型(execute接口的返回值类型)
|
|||
JSONObject forObject = client.postForObject(aiTokenURl.getValue(), request, JSONObject.class); |
|||
log.info("token获取:{}",forObject); |
|||
token = forObject.getJSONObject("result").get("token").toString(); |
|||
StorageCache.write("AITOKEN", token, 1000 * 60 * 30); |
|||
return token; |
|||
} |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取 供应商税号 AI方式 |
|||
* @param sysConfigMapper |
|||
* @return |
|||
*/ |
|||
public String getSellerNoFromAI(SysConfigMapper sysConfigMapper,String sellerName ){ |
|||
String token = ""; |
|||
SysConfig config = null; |
|||
config =sysConfigMapper.selectByCode("OCR_INTERFACE_GET_SELLER_NO_URL"); |
|||
SysConfig isToken =sysConfigMapper.selectByCode("OCR_INTERFACE_TOKEN"); |
|||
if(config==null){ |
|||
log.error("OCR_INTERFACE_GET_SELLER_NO_URL为空"); |
|||
return null; |
|||
} |
|||
HttpHeaders headers = new HttpHeaders(); |
|||
headers.setContentType(org.springframework.http.MediaType.APPLICATION_JSON); |
|||
RestTemplate client = restTemplateConfig.restTemplate(); |
|||
if(isToken!=null && isToken.getValue().equals("true")){ |
|||
token = getAiToken(sysConfigMapper,headers,client); |
|||
log.info("AI-token{}",token); |
|||
} |
|||
HashMap<String, Object> params = new HashMap<>(); |
|||
params.put("query", sellerName+"统一社会信用代码"); |
|||
String field = "[{\"title\":\"taxNo\",\"type\":\"str\"}]"; |
|||
JSONArray jsonArray = JSONArray.parseArray(field); |
|||
params.put("fields", jsonArray); |
|||
// ClientHttpResponse response = ClientHttps.post(
|
|||
// new ClientHttpRequest()
|
|||
// .setTimeOut(60000)
|
|||
// .setUrl(config.getValue())
|
|||
// .setHeaders("Content-Type", ContentEnctype.JSON)
|
|||
// .setHeaders("session", token)
|
|||
// .setParams(JsonUtil.toString(params))
|
|||
// );
|
|||
headers.setContentType(org.springframework.http.MediaType.APPLICATION_JSON); |
|||
headers.set("session", token); |
|||
HttpEntity<String> entity = new HttpEntity<>(JsonUtil.toString(params), headers); |
|||
try { |
|||
ResponseEntity<String> responseEntity = client.exchange( |
|||
config.getValue(), |
|||
HttpMethod.POST, |
|||
entity, |
|||
String.class |
|||
); |
|||
|
|||
// 封装返回对象
|
|||
ClientHttpResponse response = new ClientHttpResponse(); |
|||
response.setStatus(responseEntity.getStatusCodeValue()); |
|||
if(null!=responseEntity.getBody()){ |
|||
response.setBody(new StringBuilder(responseEntity.getBody())); |
|||
} |
|||
log.error("FH-AI SELLER_NO 参数 =>{}",JsonUtil.toString(params)); |
|||
|
|||
if(null==response.getBody()){ |
|||
log.error("FH-AI SELLER_NO MESSAGE status>>{}",response.getStatus()); |
|||
log.error("FH-AI SELLER_NO MESSAGE body>>{}",response.getBody()); |
|||
log.error("FH-AI SELLER_NO MESSAGE message>>{}",response.getMessage()); |
|||
} |
|||
log.info("FH-AI-GET_SELLER_NO Result>>" + response); |
|||
|
|||
JSONObject res = JSONObject.parseObject(response.toString()); |
|||
if(null!=res.get("json_data")){ |
|||
JSONObject json_data = res.getJSONObject("json_data"); |
|||
if(null==json_data){ |
|||
log.error("AI SELLER_NO JSON_DATA is uncomfortable "); |
|||
} |
|||
return json_data.getString("taxNo"); |
|||
} |
|||
}catch (Exception e){ |
|||
log.error("AI SELLER_NO Response ParseJson 异常:{}",e.getMessage()); |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
/** |
|||
* 获取CDKToken |
|||
* @param appKey |
|||
* @param appSecret |
|||
* @return |
|||
*/ |
|||
public String getCDKToken(String url,String appKey,String appSecret,String cdkType){ |
|||
String token=""; |
|||
// 获取token
|
|||
Object tokenObj = StorageCache.read("CDKTOKEN"); |
|||
if(tokenObj!=null) { |
|||
return tokenObj.toString(); |
|||
}else { |
|||
// url
|
|||
// 设置请求参数
|
|||
Map body = new HashMap(); |
|||
body.put("akString", appKey); |
|||
String keySecret = appKey+appSecret; |
|||
String keySecretMd5 = DigestUtils.md5DigestAsHex(keySecret.getBytes()); |
|||
body.put("secretString",keySecretMd5); |
|||
body.put("forceUpdate", 1); |
|||
body.put("type", cdkType); |
|||
|
|||
// ClientHttpResponse response = ClientHttps.post(
|
|||
// new ClientHttpRequest()
|
|||
// .setUrl(url)
|
|||
// .setHeaders("Content-Type", ContentEnctype.JSON)
|
|||
// .setHeaders("session", token)
|
|||
// .setParams(JsonUtil.toString(body))
|
|||
// );
|
|||
HttpHeaders headers = new HttpHeaders(); |
|||
headers.setContentType(org.springframework.http.MediaType.APPLICATION_JSON); |
|||
headers.set("session", token); |
|||
HttpEntity<String> entity = new HttpEntity<>(JsonUtil.toString(body), headers); |
|||
RestTemplate client = restTemplateConfig.restTemplate(); |
|||
try { |
|||
ResponseEntity<String> responseEntity = client.exchange( |
|||
url, |
|||
HttpMethod.POST, |
|||
entity, |
|||
String.class |
|||
); |
|||
|
|||
// 封装返回对象
|
|||
ClientHttpResponse response = new ClientHttpResponse(); |
|||
response.setStatus(responseEntity.getStatusCodeValue()); |
|||
if(null!=responseEntity.getBody()){ |
|||
response.setBody(new StringBuilder(responseEntity.getBody())); |
|||
} |
|||
|
|||
log.info("CDK-token获取{}",response); |
|||
JSONObject forObject = JSONObject.parseObject(response.toString()); |
|||
token = forObject.get("data").toString(); |
|||
StorageCache.write("CDKTOKEN", token, 1000 * 60 * 100); |
|||
return token; |
|||
}catch (Exception e){ |
|||
e.printStackTrace(); |
|||
} |
|||
return null; |
|||
} |
|||
} |
|||
public void main(String[] args){ |
|||
//String token = getCDKToken("https://huisuiyun.com/api/v2/agent/common/cdk/getToken","bafe201d2fc77e71","c35e9b7cabf695c2","2");
|
|||
String token = getCDKToken("https://huisuiyun.com/api/v2/agent/common/cdk/getToken","9cc03ce2c8ecabb4","b6bf5723d68e3d7e","1"); |
|||
System.out.println(token); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,428 @@ |
|||
package com.cmsen.ticket.bestsign.util; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.alibaba.fastjson2.JSONArray; |
|||
import com.cmsen.common.http.ClientHttpRequest; |
|||
import com.cmsen.common.http.ClientHttpResponse; |
|||
import com.cmsen.common.http.ClientHttps; |
|||
import com.cmsen.common.http.ContentEnctype; |
|||
import com.cmsen.common.util.JsonUtil; |
|||
import com.cmsen.common.util.StorageCache; |
|||
import com.cmsen.ticket.domain.entity.manager.SysConfig; |
|||
import com.cmsen.ticket.domain.mapper.manager.SysConfigMapper; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import okhttp3.*; |
|||
import org.springframework.http.HttpEntity; |
|||
import org.springframework.http.HttpHeaders; |
|||
import org.springframework.http.client.SimpleClientHttpRequestFactory; |
|||
import org.springframework.util.DigestUtils; |
|||
import org.springframework.web.client.RestTemplate; |
|||
|
|||
import java.io.IOException; |
|||
import java.net.InetSocketAddress; |
|||
import java.net.Proxy; |
|||
import java.text.SimpleDateFormat; |
|||
import java.util.HashMap; |
|||
import java.util.Map; |
|||
import java.util.concurrent.TimeUnit; |
|||
|
|||
/** |
|||
* 接口类 |
|||
* @author xp |
|||
* @date 2018年8月23日 14:57:10 |
|||
*/ |
|||
@Slf4j |
|||
public class InterfaceUtils { |
|||
|
|||
public static OkHttpClient buildBasicAuthClient(final String name, final String password) { |
|||
return new OkHttpClient.Builder().authenticator(new Authenticator() { |
|||
@Override |
|||
public Request authenticate(Route route, Response response) throws IOException { |
|||
String credential = Credentials.basic(name, password); |
|||
return response.request().newBuilder().header("Authorization", credential).build(); |
|||
} |
|||
}).build(); |
|||
} |
|||
|
|||
/** |
|||
* 获取列表数据 |
|||
* @param url2 |
|||
* @param params |
|||
* @return |
|||
* @throws IOException |
|||
*/ |
|||
public static String[] httpMainGetBasicAuth(String url2, String userName, String password) throws IOException{ |
|||
OkHttpClient client = buildBasicAuthClient(userName,password); |
|||
|
|||
Request request = new Request.Builder() |
|||
.url(url2) |
|||
.get() |
|||
.addHeader("Content-Type", "application/json") |
|||
.build(); |
|||
Response response ; |
|||
String content =""; |
|||
int code=200; |
|||
try { |
|||
response = client.newCall(request).execute(); |
|||
content = response.body().string(); |
|||
code = response.code(); |
|||
}catch (Exception e) { |
|||
System.out.println(e.getMessage()); |
|||
} |
|||
String[] arr = {content,String.valueOf(code)}; |
|||
return arr; |
|||
} |
|||
|
|||
|
|||
public static String[] httpPostMan2(String url2, Map<String, String> params){ |
|||
|
|||
|
|||
OkHttpClient client = OKHttpClientBuilder.buildOKHttpClient() |
|||
.connectTimeout(60, TimeUnit.SECONDS) |
|||
.readTimeout(100, TimeUnit.SECONDS) |
|||
.build(); |
|||
MediaType mediaType = MediaType.parse(params.get("Content-Type"));//application/x-www-form-urlencoded
|
|||
RequestBody body = RequestBody.create(mediaType, params.get("body")); |
|||
Request request = new Request.Builder() |
|||
.url(url2) |
|||
.post(body) |
|||
.addHeader("Authorization", params.get("Authorization")) |
|||
.addHeader("Content-Type", params.get("Content-Type")) |
|||
.addHeader("cache-control", "no-cache") |
|||
// .addHeader("Postman-Token", "d0b912ca-ddda-4287-ad15-54d6ce95e181")
|
|||
.build(); |
|||
/*Response response = client.newCall(request).execute(); |
|||
String content = response.body().string();*/ |
|||
Response response ; |
|||
String content =""; |
|||
int code=200; |
|||
int count = 4; |
|||
try { |
|||
response = client.newCall(request).execute(); |
|||
content = response.body().string(); |
|||
code = response.code(); |
|||
}catch (Exception e){ |
|||
log.error(e.getMessage()); |
|||
while (getMesg(e.getMessage()).equals("error") && count>0){ |
|||
log.info("失败重试》》》》》》》httpPostMan2"+count); |
|||
try { |
|||
response = client.newCall(request).execute(); |
|||
content = response.body().string(); |
|||
code = response.code(); |
|||
}catch (Exception e2) { |
|||
log.error(e2.getMessage()); |
|||
} |
|||
if(!getMesg(content).equals("error")){ |
|||
break; |
|||
} |
|||
count--; |
|||
} |
|||
} |
|||
|
|||
if(getMesg(content).equals("error")){ |
|||
log.error(content+url2+params.toString()); |
|||
} |
|||
String[] arr = {content,String.valueOf(code)}; |
|||
return arr; |
|||
} |
|||
|
|||
public static String getMesg(String result){ |
|||
String returnMsg="success"; |
|||
Map<String,String> errorsMsg = new HashMap<>(); |
|||
errorsMsg.put("401","401 Authorization Required"); |
|||
errorsMsg.put("timeOut","timed out"); |
|||
errorsMsg.put("timeOut2","timeout"); |
|||
errorsMsg.put("toekn","token is expired"); |
|||
errorsMsg.put("Service_unavailable","Service Unavailable"); |
|||
for (String msg :errorsMsg.values()){ |
|||
if(msg.length()<3)continue; |
|||
if(result.indexOf(msg) !=-1){ |
|||
returnMsg="error"; |
|||
break; |
|||
} |
|||
} |
|||
return returnMsg; |
|||
} |
|||
|
|||
/** |
|||
* 获取AiToken |
|||
* @param sysConfigMapper |
|||
* @return |
|||
*/ |
|||
public static String getAiToken(SysConfigMapper sysConfigMapper, HttpHeaders headers,RestTemplate client ){ |
|||
String token=""; |
|||
|
|||
SysConfig proxyConfig = sysConfigMapper.selectByCode("PF_PROXY"); |
|||
if(null==proxyConfig){ |
|||
|
|||
}else{ |
|||
SysConfig proxyIP = sysConfigMapper.selectByCode("PF_PROXY_IP"); |
|||
SysConfig proxyPort = sysConfigMapper.selectByCode("PF_PROXY_PORT"); |
|||
if(null!=proxyIP&&null!=proxyPort){ |
|||
SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory(); |
|||
requestFactory.setProxy( |
|||
new Proxy( |
|||
Proxy.Type.HTTP, |
|||
new InetSocketAddress(proxyIP.getValue(), Integer.parseInt(proxyPort.getValue())) //设置代理服务
|
|||
) |
|||
); |
|||
client.setRequestFactory(requestFactory); |
|||
} |
|||
} |
|||
// 获取token
|
|||
// 设置请求头,请求类型为json
|
|||
// 判断token是否有效
|
|||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|||
Object tokenObj = StorageCache.read("AITOKEN"); |
|||
if(tokenObj!=null) { |
|||
return tokenObj.toString(); |
|||
}else { |
|||
// url
|
|||
SysConfig aiTokenURl = sysConfigMapper.selectByCode("AI_TOKEN_URL"); |
|||
if(aiTokenURl==null){ |
|||
return null; |
|||
} |
|||
SysConfig aiUserName = sysConfigMapper.selectByCode("AI_USER_NAME"); |
|||
SysConfig aiPassowrd = sysConfigMapper.selectByCode("AI_PASSWORD"); |
|||
// 设置请求参数
|
|||
Map body = new HashMap(); |
|||
Map loginParms = new HashMap(); |
|||
loginParms.put("username", aiUserName.getValue()); |
|||
loginParms.put("password", aiPassowrd.getValue()); |
|||
body.put("jsonrpc", "2.0"); |
|||
body.put("method", "/account/login"); |
|||
body.put("params", loginParms); |
|||
|
|||
// 将map转为json串,放入restTemplate的参数对象中
|
|||
String bodyJsonData = JSON.toJSONString(body); |
|||
|
|||
//用HttpEntity封装整个请求报文
|
|||
HttpEntity<String> request = new HttpEntity<>(bodyJsonData, headers); |
|||
|
|||
// 开始调用
|
|||
// 参数1:目标请求地址
|
|||
// 参数2:请求体
|
|||
// 参数3:目标请求接口的返回值类型(execute接口的返回值类型)
|
|||
JSONObject forObject = client.postForObject(aiTokenURl.getValue(), request, JSONObject.class); |
|||
log.info("token获取{}",forObject); |
|||
token = forObject.getJSONObject("result").get("token").toString(); |
|||
StorageCache.write("AITOKEN", token, 1000 * 60 * 30); |
|||
return token; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 获取 备注中 PO号 |
|||
* @param sysConfigMapper |
|||
* @return |
|||
*/ |
|||
public static String getPOFromRemark(SysConfigMapper sysConfigMapper,String remark ){ |
|||
String token = ""; |
|||
SysConfig config = null; |
|||
config =sysConfigMapper.selectByCode("OCR_INTERFACE_GETPO_URL"); |
|||
SysConfig isToken =sysConfigMapper.selectByCode("OCR_INTERFACE_TOKEN"); |
|||
if(config==null){ |
|||
log.error("OCR_INTERFACE_GETPO_URL为空"); |
|||
return null; |
|||
} |
|||
HttpHeaders headers = new HttpHeaders(); |
|||
headers.setContentType(org.springframework.http.MediaType.APPLICATION_JSON); |
|||
RestTemplate client = new RestTemplate(); |
|||
if(isToken!=null && isToken.getValue().equals("true")){ |
|||
token = getAiToken(sysConfigMapper,headers,client); |
|||
log.info("AI-token{}",token); |
|||
} |
|||
HashMap<String, String> params = new HashMap<>(); |
|||
params.put("data", remark); |
|||
// 添加配置项
|
|||
ClientHttpResponse response = ClientHttps.post( |
|||
new ClientHttpRequest() |
|||
.setTimeOut(60000) |
|||
.setUrl(config.getValue()) |
|||
.setHeaders("Content-Type", ContentEnctype.JSON) |
|||
.setHeaders("session", token) |
|||
.setParams(JsonUtil.toString(params)) |
|||
); |
|||
if(null==response.getBody()){ |
|||
log.info("FH-OCR MESSAGE status>>{}",response.getStatus()); |
|||
log.info("FH-OCR MESSAGE body>>{}",response.getBody()); |
|||
log.info("FH-OCR MESSAGE message>>{}",response.getMessage()); |
|||
} |
|||
log.info("FH-OCR-GET_PO Result>>" + response); |
|||
try { |
|||
JSONObject res = JSONObject.parseObject(response.toString()); |
|||
if(null!=res.getString("PO_code")){ |
|||
return res.getString("PO_code"); |
|||
} |
|||
}catch (Exception e){ |
|||
log.info("PO Response ParseJson 异常:{}",e.getMessage()); |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取 供应商税号 AI方式 |
|||
* @param sysConfigMapper |
|||
* @return |
|||
*/ |
|||
public static String getSellerNoFromAI(SysConfigMapper sysConfigMapper,String sellerName ){ |
|||
String token = ""; |
|||
SysConfig config = null; |
|||
config =sysConfigMapper.selectByCode("OCR_INTERFACE_GET_SELLER_NO_URL"); |
|||
SysConfig isToken =sysConfigMapper.selectByCode("OCR_INTERFACE_TOKEN"); |
|||
if(config==null){ |
|||
log.error("OCR_INTERFACE_GET_SELLER_NO_URL为空"); |
|||
return null; |
|||
} |
|||
HttpHeaders headers = new HttpHeaders(); |
|||
headers.setContentType(org.springframework.http.MediaType.APPLICATION_JSON); |
|||
RestTemplate client = new RestTemplate(); |
|||
if(isToken!=null && isToken.getValue().equals("true")){ |
|||
token = getAiToken(sysConfigMapper,headers,client); |
|||
log.info("AI-token{}",token); |
|||
} |
|||
HashMap<String, Object> params = new HashMap<>(); |
|||
params.put("query", sellerName+"统一社会信用代码"); |
|||
String field = "[{\"title\":\"taxNo\",\"type\":\"str\"}]"; |
|||
JSONArray jsonArray = JSONArray.parseArray(field); |
|||
params.put("fields", jsonArray); |
|||
ClientHttpResponse response = ClientHttps.post( |
|||
new ClientHttpRequest() |
|||
.setTimeOut(60000) |
|||
.setUrl(config.getValue()) |
|||
.setHeaders("Content-Type", ContentEnctype.JSON) |
|||
.setHeaders("session", token) |
|||
.setParams(JsonUtil.toString(params)) |
|||
); |
|||
|
|||
|
|||
log.error("FH-AI SELLER_NO 参数 =>{}",JsonUtil.toString(params)); |
|||
|
|||
if(null==response.getBody()){ |
|||
log.error("FH-AI SELLER_NO MESSAGE status>>{}",response.getStatus()); |
|||
log.error("FH-AI SELLER_NO MESSAGE body>>{}",response.getBody()); |
|||
log.error("FH-AI SELLER_NO MESSAGE message>>{}",response.getMessage()); |
|||
} |
|||
log.info("FH-AI-GET_SELLER_NO Result>>" + response); |
|||
try { |
|||
JSONObject res = JSONObject.parseObject(response.toString()); |
|||
if(null!=res.get("json_data")){ |
|||
JSONObject json_data = res.getJSONObject("json_data"); |
|||
if(null==json_data){ |
|||
log.error("AI SELLER_NO JSON_DATA is uncomfortable "); |
|||
} |
|||
return json_data.getString("taxNo"); |
|||
} |
|||
}catch (Exception e){ |
|||
log.error("AI SELLER_NO Response ParseJson 异常:{}",e.getMessage()); |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
/** |
|||
* 获取CDKToken |
|||
* @param appKey |
|||
* @param appSecret |
|||
* @return |
|||
*/ |
|||
public static String getCDKToken(String url,String appKey,String appSecret,String cdkType){ |
|||
String token=""; |
|||
// 获取token
|
|||
Object tokenObj = StorageCache.read("CDKTOKEN"); |
|||
if(tokenObj!=null) { |
|||
return tokenObj.toString(); |
|||
}else { |
|||
// url
|
|||
// 设置请求参数
|
|||
Map body = new HashMap(); |
|||
body.put("akString", appKey); |
|||
String keySecret = appKey+appSecret; |
|||
String keySecretMd5 = DigestUtils.md5DigestAsHex(keySecret.getBytes()); |
|||
body.put("secretString",keySecretMd5); |
|||
body.put("forceUpdate", 1); |
|||
body.put("type", cdkType); |
|||
|
|||
ClientHttpResponse response = ClientHttps.post( |
|||
new ClientHttpRequest() |
|||
.setUrl(url) |
|||
.setHeaders("Content-Type", ContentEnctype.JSON) |
|||
.setHeaders("session", token) |
|||
.setParams(JsonUtil.toString(body)) |
|||
); |
|||
log.info("CDK-token获取{}",response); |
|||
JSONObject forObject = JSONObject.parseObject(response.toString()); |
|||
token = forObject.get("data").toString(); |
|||
StorageCache.write("CDKTOKEN", token, 1000 * 60 * 100); |
|||
return token; |
|||
} |
|||
} |
|||
public static String[] httpPostMan3(String url2, Map<String, String> params, SysConfigMapper sysConfigMapper) { |
|||
SysConfig proxyConfig = sysConfigMapper.selectByCode("PF_PROXY"); |
|||
OkHttpClient client = null; |
|||
if(null==proxyConfig){ |
|||
client = OKHttpClientBuilder.buildOKHttpClient() |
|||
.connectTimeout(30, TimeUnit.SECONDS) |
|||
.readTimeout(100, TimeUnit.SECONDS) |
|||
.build(); |
|||
}else{ |
|||
SysConfig proxyIP = sysConfigMapper.selectByCode("PF_PROXY_IP"); |
|||
SysConfig proxyPort = sysConfigMapper.selectByCode("PF_PROXY_PORT"); |
|||
if(null!=proxyIP&&null!=proxyPort){ |
|||
Proxy proxy = new Proxy(Proxy.Type.HTTP,new InetSocketAddress(proxyIP.getValue(),Integer.parseInt(proxyPort.getValue()))); |
|||
client = OKHttpClientBuilder.buildOKHttpClient() |
|||
.connectTimeout(30, TimeUnit.SECONDS) |
|||
.readTimeout(100, TimeUnit.SECONDS) |
|||
.proxy(proxy) |
|||
.build(); |
|||
} |
|||
} |
|||
|
|||
MediaType mediaType = MediaType.parse(params.get("Content-Type"));//application/x-www-form-urlencoded
|
|||
RequestBody body = RequestBody.create(mediaType, params.get("body")); |
|||
Request request = new Request.Builder() |
|||
.url(url2) |
|||
.post(body) |
|||
.addHeader("Authorization", params.get("Authorization")) |
|||
.addHeader("Content-Type", params.get("Content-Type")) |
|||
.addHeader("cache-control", "no-cache") |
|||
.addHeader("Postman-Token", "d0b912ca-ddda-4287-ad15-54d6ce95e181") |
|||
.build(); |
|||
/*Response response = client.newCall(request).execute(); |
|||
String content = response.body().string();*/ |
|||
Response response ; |
|||
String content =""; |
|||
int code=200; |
|||
int count = 4; |
|||
try { |
|||
response = client.newCall(request).execute(); |
|||
content = response.body().string(); |
|||
code = response.code(); |
|||
}catch (Exception e){ |
|||
log.error(e.getMessage()); |
|||
while (getMesg(e.getMessage()).equals("error") && count>0){ |
|||
log.info("失败重试》》》》》》》httpPostMan3"+count); |
|||
try { |
|||
response = client.newCall(request).execute(); |
|||
content = response.body().string(); |
|||
code = response.code(); |
|||
}catch (Exception e2) { |
|||
log.error(e2.getMessage()); |
|||
} |
|||
if(!getMesg(content).equals("error")){ |
|||
break; |
|||
} |
|||
count--; |
|||
} |
|||
} |
|||
|
|||
if(getMesg(content).equals("error")){ |
|||
log.error(content+url2+params.toString()); |
|||
} |
|||
String[] arr = {content,String.valueOf(code)}; |
|||
return arr; |
|||
|
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,51 @@ |
|||
package com.cmsen.ticket.bestsign.util; |
|||
|
|||
import okhttp3.OkHttpClient; |
|||
|
|||
import javax.net.ssl.SSLContext; |
|||
import javax.net.ssl.SSLSocketFactory; |
|||
import javax.net.ssl.TrustManager; |
|||
import javax.net.ssl.X509TrustManager; |
|||
import java.security.KeyManagementException; |
|||
import java.security.NoSuchAlgorithmException; |
|||
|
|||
/** |
|||
* 忽略SSL |
|||
*/ |
|||
public class OKHttpClientBuilder { |
|||
public static OkHttpClient.Builder buildOKHttpClient() { |
|||
try { |
|||
TrustManager[] trustAllCerts = buildTrustManagers(); |
|||
final SSLContext sslContext = SSLContext.getInstance("SSL"); |
|||
sslContext.init(null, trustAllCerts, new java.security.SecureRandom()); |
|||
|
|||
final SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory(); |
|||
OkHttpClient.Builder builder = new OkHttpClient.Builder(); |
|||
builder.sslSocketFactory(sslSocketFactory, (X509TrustManager) trustAllCerts[0]); |
|||
builder.hostnameVerifier((hostname, session) -> true); |
|||
return builder; |
|||
} catch (NoSuchAlgorithmException | KeyManagementException e) { |
|||
e.printStackTrace(); |
|||
return new OkHttpClient.Builder(); |
|||
} |
|||
} |
|||
|
|||
private static TrustManager[] buildTrustManagers() { |
|||
return new TrustManager[]{ |
|||
new X509TrustManager() { |
|||
@Override |
|||
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) { |
|||
} |
|||
|
|||
@Override |
|||
public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) { |
|||
} |
|||
|
|||
@Override |
|||
public java.security.cert.X509Certificate[] getAcceptedIssuers() { |
|||
return new java.security.cert.X509Certificate[]{}; |
|||
} |
|||
} |
|||
}; |
|||
} |
|||
} |
|||
@ -0,0 +1,90 @@ |
|||
/** |
|||
* Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved. |
|||
*/ |
|||
package com.cmsen.ticket.common; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import org.springframework.http.HttpStatus; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.HashMap; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* $.ajax后需要接受的JSON |
|||
* |
|||
* @author |
|||
* |
|||
*/ |
|||
public class AjaxJson extends HashMap<String,Object> implements Serializable { |
|||
|
|||
|
|||
public AjaxJson(){ |
|||
this.put("success", true); |
|||
this.put("code", HttpStatus.OK.value()); |
|||
this.put("msg", "操作成功"); |
|||
} |
|||
|
|||
public String getMsg() { |
|||
return (String)this.get("msg"); |
|||
} |
|||
|
|||
public void setMsg(String msg) {//向json中添加属性,在js中访问,请调用data.msg
|
|||
this.put("msg", msg); |
|||
} |
|||
|
|||
|
|||
public boolean isSuccess() { |
|||
return (boolean)this.get("success"); |
|||
} |
|||
|
|||
public void setSuccess(boolean success) { |
|||
this.put("success", success); |
|||
} |
|||
|
|||
@JsonIgnore//返回对象时忽略此属性
|
|||
public static AjaxJson success(String msg) { |
|||
AjaxJson j = new AjaxJson(); |
|||
j.setMsg(msg); |
|||
return j; |
|||
} |
|||
@JsonIgnore//返回对象时忽略此属性
|
|||
public static AjaxJson error(String msg) { |
|||
AjaxJson j = new AjaxJson(); |
|||
j.setSuccess(false); |
|||
j.setMsg(msg); |
|||
return j; |
|||
} |
|||
|
|||
public static AjaxJson success(Map<String, Object> map) { |
|||
AjaxJson restResponse = new AjaxJson(); |
|||
restResponse.putAll(map); |
|||
return restResponse; |
|||
} |
|||
|
|||
public static AjaxJson success() { |
|||
return new AjaxJson(); |
|||
} |
|||
|
|||
|
|||
@Override |
|||
public AjaxJson put(String key, Object value) { |
|||
super.put(key, value); |
|||
return this; |
|||
} |
|||
|
|||
public AjaxJson putMap(Map m) { |
|||
super.putAll(m); |
|||
return this; |
|||
} |
|||
|
|||
public int getCode() { |
|||
return (int)this.get("code"); |
|||
} |
|||
|
|||
public void setCode(int code) { |
|||
this.put("code", code); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,89 @@ |
|||
/** |
|||
* Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved. |
|||
*/ |
|||
package com.cmsen.ticket.common; |
|||
|
|||
import org.apache.commons.lang3.Validate; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.beans.factory.DisposableBean; |
|||
import org.springframework.context.ApplicationContext; |
|||
import org.springframework.context.ApplicationContextAware; |
|||
import org.springframework.context.annotation.Lazy; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* 以静态变量保存Spring ApplicationContext, 可在任何代码任何地方任何时候取出ApplicaitonContext. |
|||
* |
|||
* @author Zaric |
|||
* @date 2016-5-29 下午1:25:40 |
|||
*/ |
|||
@Service |
|||
@Lazy(false) |
|||
public class SpringContextHolder implements ApplicationContextAware, DisposableBean { |
|||
|
|||
private static ApplicationContext applicationContext = null; |
|||
|
|||
private static Logger logger = LoggerFactory.getLogger(SpringContextHolder.class); |
|||
|
|||
/** |
|||
* 取得存储在静态变量中的ApplicationContext. |
|||
*/ |
|||
public static ApplicationContext getApplicationContext() { |
|||
assertContextInjected(); |
|||
return applicationContext; |
|||
} |
|||
|
|||
/** |
|||
* 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型. |
|||
*/ |
|||
@SuppressWarnings("unchecked") |
|||
public static <T> T getBean(String name) { |
|||
assertContextInjected(); |
|||
return (T) applicationContext.getBean(name); |
|||
} |
|||
|
|||
/** |
|||
* 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型. |
|||
*/ |
|||
public static <T> T getBean(Class<T> requiredType) { |
|||
assertContextInjected(); |
|||
return applicationContext.getBean(requiredType); |
|||
} |
|||
|
|||
/** |
|||
* 清除SpringContextHolder中的ApplicationContext为Null. |
|||
*/ |
|||
public static void clearHolder() { |
|||
if (logger.isDebugEnabled()){ |
|||
logger.debug("清除SpringContextHolder中的ApplicationContext:" + applicationContext); |
|||
} |
|||
applicationContext = null; |
|||
} |
|||
|
|||
/** |
|||
* 实现ApplicationContextAware接口, 注入Context到静态变量中. |
|||
*/ |
|||
@Override |
|||
public void setApplicationContext(ApplicationContext applicationContext) { |
|||
SpringContextHolder.applicationContext = applicationContext; |
|||
} |
|||
|
|||
public static String getStatic(){ |
|||
return SpringContextHolder.getApplicationContext().getApplicationName()+ "/static"; |
|||
} |
|||
/** |
|||
* 实现DisposableBean接口, 在Context关闭时清理静态变量. |
|||
*/ |
|||
@Override |
|||
public void destroy() throws Exception { |
|||
SpringContextHolder.clearHolder(); |
|||
} |
|||
|
|||
/** |
|||
* 检查ApplicationContext不为空. |
|||
*/ |
|||
private static void assertContextInjected() { |
|||
Validate.validState(applicationContext != null, "applicaitonContext属性未注入, 请勿启动成功之前调用SpringContextHolder."); |
|||
} |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
package com.cmsen.ticket.domain.dto; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
public class CorporateInvoiceItemsDto { |
|||
|
|||
@ExcelProperty(value = "发票号", index = 0) |
|||
private String invoiceNumber; |
|||
@ExcelProperty(value = "产品名称", index = 1) |
|||
private String name; |
|||
|
|||
@ExcelProperty(value = "规格型号", index = 2) |
|||
private String specification; |
|||
@ExcelProperty(value = "单位", index = 3) |
|||
private String unit; |
|||
@ExcelProperty(value = "数量", index = 4) |
|||
private String quantity; |
|||
@ExcelProperty(value = "单价", index = 5) |
|||
private String price; |
|||
@ExcelProperty(value = "发票金额", index = 6) |
|||
private String total; |
|||
@ExcelProperty(value = "税额", index = 7) |
|||
private String tax; |
|||
@ExcelProperty(value = "PO号码", index = 8) |
|||
private String po; |
|||
} |
|||
|
|||
@ -0,0 +1,35 @@ |
|||
package com.cmsen.ticket.domain.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @author OWTS |
|||
*/ |
|||
@Data |
|||
public class InvoiceItemListDto { |
|||
private String id; |
|||
private String supplier; |
|||
private String number; |
|||
private String invoiceMoney; |
|||
private BigDecimal usedMoney; |
|||
private BigDecimal unUsedMoney; |
|||
private String imgUrl; |
|||
|
|||
private BigDecimal matchedAmount; |
|||
|
|||
|
|||
public BigDecimal getUnUsedMoney() { |
|||
if (usedMoney == null) return new BigDecimal(invoiceMoney); |
|||
return new BigDecimal(invoiceMoney).subtract(usedMoney); |
|||
} |
|||
|
|||
public BigDecimal getMatchedAmount() { |
|||
return matchedAmount == null ? getUnUsedMoney() : matchedAmount; |
|||
} |
|||
|
|||
public BigDecimal getUsedMoney() { |
|||
return usedMoney == null ? BigDecimal.ZERO : usedMoney; |
|||
} |
|||
} |
|||
@ -0,0 +1,43 @@ |
|||
package com.cmsen.ticket.domain.dto; |
|||
|
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotEmpty; |
|||
import java.math.BigDecimal; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author OWTS |
|||
* @version 1.0.0 |
|||
* @date 2021/10/26 16:02 |
|||
**/ |
|||
@Data |
|||
public class LineMatchListDto { |
|||
@NotEmpty(message = "发票ID 不为空") |
|||
@ApiModelProperty("发票ID") |
|||
private String invoiceId; |
|||
@NotEmpty(message = "发票行ID 不为空") |
|||
@ApiModelProperty("发票行ID") |
|||
private String itemId; |
|||
// @ApiModelProperty("筛选级别 0 默认 1 订单下所有")
|
|||
@ApiModelProperty("筛选级别 1 物料 2 金额 3 金额+物料 4 所有") |
|||
private Integer level = 0; |
|||
|
|||
@ApiModelProperty(value = "订单号", hidden = true) |
|||
private List<String> orders = new ArrayList<>(); |
|||
|
|||
@ApiModelProperty(value = "供应商代码", hidden = true) |
|||
private String supplierCode; |
|||
|
|||
@ApiModelProperty("发票未匹配金额") |
|||
private BigDecimal unUsedAmount; |
|||
|
|||
@ApiModelProperty("发票未匹配数量") |
|||
private String unUsedQuantity; |
|||
|
|||
private String uom; |
|||
private String prdMateName; |
|||
private String qtyAmount; |
|||
} |
|||
@ -0,0 +1,75 @@ |
|||
package com.cmsen.ticket.domain.dto; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotEmpty; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author OWTS |
|||
* @version 1.0.0 |
|||
* @date 2021/10/27 9:27 |
|||
**/ |
|||
@Data |
|||
public class SubmitLineMatchDto { |
|||
@NotEmpty(message = "发票 ID 不为空") |
|||
@ApiModelProperty("发票 ID") |
|||
private String invoiceId; |
|||
@NotEmpty(message = "发票行 ID 不为空") |
|||
@ApiModelProperty("发票行 ID") |
|||
private String itemId; |
|||
@NotBlank(message = "订单列表不为空") |
|||
@ApiModelProperty("已选订单列表") |
|||
private List<SupplierOrderDto> orders; |
|||
|
|||
@Data |
|||
public static class SupplierOrderDto { |
|||
private Integer id; |
|||
private String receiveNo; |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
|||
private Date receiveTime; |
|||
private String supplierCode; |
|||
private String orderNo; |
|||
private String lineNum; |
|||
private String goods; |
|||
private String uom; |
|||
private String goodsNum; |
|||
private String receivedNum; |
|||
private String currency; |
|||
private BigDecimal unitPrice; |
|||
private BigDecimal amount; |
|||
private String companyName; |
|||
private String source; |
|||
private Boolean status; |
|||
private String vStatusName; |
|||
private String companyCode; |
|||
private String costCenter; |
|||
private String orgCode; |
|||
private String itemNo; |
|||
private String taxRate; |
|||
private String owner; |
|||
private String description; |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date creationTime; |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date updateTime; |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
|||
private Date orderDate; |
|||
|
|||
private BigDecimal usedAmount; |
|||
private BigDecimal unUsedAmount; |
|||
|
|||
private String usedQuantity; |
|||
private String unUsedQuantity; |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
package com.cmsen.ticket.domain.dto; |
|||
|
|||
import com.cmsen.ticket.domain.entity.CorporateInvoice; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotEmpty; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @version 1.0.0 |
|||
* @date 2023/01/30 17:27 |
|||
**/ |
|||
@Data |
|||
public class SubmitOrderMatchDto { |
|||
@NotEmpty(message = "付款单ID 不为空") |
|||
@ApiModelProperty("付款单ID") |
|||
private String orderNo; |
|||
@NotEmpty(message = "付款行 ID 不为空") |
|||
@ApiModelProperty("付款行 ID") |
|||
private Integer id; |
|||
@NotBlank(message = "发票列表不为空") |
|||
@ApiModelProperty("已选发票列表") |
|||
//private List<CorporateInvoiceItems> items;
|
|||
private List<CorporateInvoice> invoices; |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
package com.cmsen.ticket.domain.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
@Data |
|||
public class SupplierPODto { |
|||
|
|||
private String po; |
|||
private String versionNo; |
|||
private String orderDate; |
|||
private String contractNo; |
|||
private String supplierCode; |
|||
private String poType; |
|||
private String process; |
|||
private String contacts; |
|||
private String eMail; |
|||
private String path; |
|||
private String uri; |
|||
private Integer isDel; |
|||
private String createBy; |
|||
private Date createDate; |
|||
private String updateBy; |
|||
private Date updateDate; |
|||
|
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package com.cmsen.ticket.domain.dto; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
@Data |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
public class SupplierUomMappingDTO { |
|||
private int id; |
|||
private String supplierCode; |
|||
private String unit; |
|||
private String versUnit; |
|||
private BigDecimal versNum; |
|||
private String remark; |
|||
private String ext01; |
|||
private String ext02; |
|||
private String ext03; |
|||
private String ext04; |
|||
private String ext05; |
|||
|
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
package com.cmsen.ticket.domain.entity; |
|||
|
|||
import com.cmsen.ticket.domain.util.StringUtils; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* (Company)实体类 |
|||
* |
|||
* @author ran hao yu |
|||
* @since 2020-09-18 11:13:27 |
|||
*/ |
|||
@Data |
|||
public class Company implements Serializable { |
|||
private static final long serialVersionUID = 635970988319484350L; |
|||
/** |
|||
* 公司表主键id |
|||
*/ |
|||
private Integer id; |
|||
/** |
|||
* 公司名称 |
|||
*/ |
|||
private String name; |
|||
/** |
|||
* 税号 |
|||
*/ |
|||
private String dutyParagraph; |
|||
/** |
|||
* 公司code(每个公司的代码) |
|||
*/ |
|||
private String companyCode; |
|||
/** |
|||
* 客户ID,每家公司所对应的客户ID |
|||
*/ |
|||
private Integer customerId; |
|||
/** |
|||
* 0为未删除,1为已删除,默认为0 |
|||
*/ |
|||
private String isDel; |
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private String createTime; |
|||
private Integer validMode; |
|||
|
|||
private String fullName; |
|||
private String ext01; |
|||
private String ext02; |
|||
private String ext03; |
|||
private String ext04; |
|||
private String ext05; |
|||
|
|||
public String getName() { |
|||
return StringUtils.getStringWithOutSpecialCode2(name); |
|||
} |
|||
|
|||
public void setName(String name) { |
|||
this.name = StringUtils.getStringWithOutSpecialCode2(name); |
|||
} |
|||
} |
|||
@ -0,0 +1,420 @@ |
|||
package com.cmsen.ticket.domain.entity; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelIgnore; |
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.cmsen.common.http.response.Validation; |
|||
import com.cmsen.common.util.StringUtil; |
|||
import com.cmsen.ticket.domain.util.StringUtils; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.Serializable; |
|||
import java.util.ArrayList; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @TableName corporate_invoice |
|||
*/ |
|||
@Data |
|||
public class CorporateInvoice implements Serializable { |
|||
|
|||
@ExcelProperty(value = "ID", index = 0) |
|||
@NotNull(message = "required", groups = {Validation.Update.class}) |
|||
private String id; |
|||
|
|||
@ExcelIgnore |
|||
private Integer orgId; |
|||
|
|||
// @ExcelProperty(value = "销售方", index = 3)
|
|||
@ExcelIgnore |
|||
private String title; |
|||
|
|||
@ExcelIgnore |
|||
private Integer invoiceType; |
|||
|
|||
@ExcelProperty(value = "发票代码", index = 4) |
|||
private String code; |
|||
|
|||
//供应商代码
|
|||
@ExcelIgnore |
|||
private String supplierCode; |
|||
|
|||
@ExcelProperty(value = "发票号码", index = 5) |
|||
private String number; |
|||
|
|||
@ExcelProperty(value = "发票日期", index = 6) |
|||
private String date; |
|||
|
|||
@ExcelProperty(value = "总金额", index = 9) |
|||
private String total; |
|||
|
|||
@ExcelIgnore |
|||
private String imgPath; |
|||
|
|||
@ExcelIgnore |
|||
private String extraFields; |
|||
|
|||
@ExcelProperty(value = "备注", index = 15) |
|||
private String remark; |
|||
|
|||
@ExcelIgnore |
|||
private String loginId; |
|||
|
|||
@ExcelProperty(value = "发送状态", index = 21) |
|||
private String isSendName; |
|||
@ExcelIgnore |
|||
private Integer isSend; |
|||
|
|||
@ExcelIgnore |
|||
private String entryId; |
|||
|
|||
@ExcelProperty(value = "更新日期", index = 12) |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
|||
private Date updateDate; |
|||
|
|||
@ExcelIgnore |
|||
private List<CorporateInvoiceItems> items = new ArrayList<>(); |
|||
|
|||
@ExcelProperty(value = "销售方", index = 3) |
|||
private String seller; |
|||
private String vendor; |
|||
|
|||
@ExcelIgnore |
|||
private String sellerNo; |
|||
|
|||
@ExcelProperty(value = "购买方", index = 1) |
|||
private String buyer; |
|||
|
|||
// @ExcelProperty(value = "购买方", index = 1)
|
|||
@ExcelIgnore |
|||
private String fullBuyer; |
|||
|
|||
@ExcelIgnore |
|||
private String buyerNo; |
|||
|
|||
@ExcelIgnore |
|||
private String originalFilePath; |
|||
|
|||
@ExcelProperty(value = "NPO", index = 13) |
|||
private String po; |
|||
|
|||
@ExcelIgnore |
|||
private String ticketCode; |
|||
|
|||
@ExcelProperty(value = "发票类型", index = 2) |
|||
private String ticketCodeStr; |
|||
|
|||
@ExcelIgnore |
|||
private String kind; |
|||
|
|||
/* 0 未处理 1 已处理 2 异常 3 pending */ |
|||
@ExcelIgnore |
|||
private Integer status; |
|||
|
|||
/** |
|||
* 0 待处理 1 待审核 2 未发送 3 已发送 |
|||
*/ |
|||
@ExcelIgnore |
|||
private Integer matchStatus; |
|||
|
|||
@ExcelIgnore |
|||
private String verifiedCode; |
|||
|
|||
@ExcelIgnore |
|||
private String fileName; |
|||
|
|||
@ExcelProperty(value = "金额", index = 7) |
|||
private String pretaxAmount; |
|||
|
|||
@ExcelProperty(value = "税额", index = 8) |
|||
private String tax; |
|||
|
|||
@ExcelProperty(value = "发票内容", index = 14) |
|||
private String details; |
|||
|
|||
@ExcelProperty(value = "操作人", index = 10) |
|||
private String operator; |
|||
|
|||
@ExcelIgnore |
|||
private Integer operatorId; |
|||
|
|||
@ExcelProperty(value = "创建日期", index = 11) |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
|||
private Date createDate; |
|||
|
|||
@ExcelIgnore |
|||
private String currency; |
|||
|
|||
@ExcelIgnore |
|||
private Integer checked; |
|||
|
|||
@ExcelIgnore |
|||
private String desc; |
|||
|
|||
@ExcelProperty(value = "异常信息", index = 20) |
|||
private String message; |
|||
|
|||
@ExcelIgnore |
|||
private String showTitle; |
|||
|
|||
@ExcelIgnore |
|||
private String payDate; |
|||
|
|||
@ExcelIgnore |
|||
private List<String> base64 = new ArrayList<>(); |
|||
|
|||
@ExcelIgnore |
|||
private List<File> files = new ArrayList<>(); |
|||
// New filed added
|
|||
|
|||
@ExcelProperty(value = "入账日期", index = 17) |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
|||
private Date postingDate; |
|||
|
|||
@ExcelProperty(value = "抵扣日期", index = 19) |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
|||
private Date deductTime; |
|||
|
|||
@ExcelProperty(value = "抵扣状态", index = 18) |
|||
private String deductStatus; |
|||
|
|||
@ExcelIgnore |
|||
private String downloadUri; |
|||
|
|||
/** |
|||
* 0 未验真 1已验真 |
|||
*/ |
|||
@ExcelIgnore |
|||
private Byte validStatus; |
|||
|
|||
/** |
|||
* 总验真次数 |
|||
*/ |
|||
@ExcelIgnore |
|||
private Integer validCount; |
|||
|
|||
/** |
|||
* 当日验真次数 |
|||
*/ |
|||
@ExcelIgnore |
|||
private Integer validDayCount; |
|||
|
|||
@ExcelProperty(value = "状态", index = 16) |
|||
private String statusStr; |
|||
|
|||
@ExcelIgnore |
|||
private Integer owner; |
|||
|
|||
@ExcelIgnore |
|||
private String ownerName; |
|||
@ExcelIgnore |
|||
private String invoiceTypeName; |
|||
@ExcelIgnore |
|||
private String orgName; |
|||
|
|||
/** |
|||
* 使用状态 0 未使用 1 已使用 2 后票 |
|||
*/ |
|||
@ExcelIgnore |
|||
private Integer useStatus; |
|||
|
|||
@ExcelIgnore |
|||
private int percent; |
|||
|
|||
@ExcelIgnore |
|||
private Integer subject; |
|||
|
|||
// 0 金额 1 数量
|
|||
@ExcelIgnore |
|||
private Integer matchType; |
|||
|
|||
// 0 折后 1 折前
|
|||
@ExcelIgnore |
|||
private Integer priceType; |
|||
|
|||
@ExcelIgnore |
|||
private String period; //增加字段
|
|||
@ExcelIgnore |
|||
private String received; |
|||
|
|||
@ExcelIgnore |
|||
private String numberBackup; |
|||
@ExcelIgnore |
|||
private String numberConfirm; |
|||
@ExcelIgnore |
|||
private String companySeal; |
|||
@ExcelIgnore |
|||
private String deductionAmount;//抵扣金额
|
|||
@ExcelIgnore |
|||
private String ext01; |
|||
@ExcelIgnore |
|||
private String ext02; |
|||
@ExcelIgnore |
|||
private String ext03; |
|||
@ExcelIgnore |
|||
private String ext04; |
|||
@ExcelIgnore |
|||
private String ext05; |
|||
|
|||
@ExcelIgnore |
|||
private String ext06; |
|||
@ExcelIgnore |
|||
private String ext07; |
|||
@ExcelIgnore |
|||
private String ext08; |
|||
@ExcelIgnore |
|||
private String ext09; |
|||
@ExcelIgnore |
|||
private String ext10; |
|||
|
|||
private String different;//差异金额 total - deductionAmount
|
|||
private String taxRate;//税率
|
|||
@ExcelIgnore |
|||
private String ticketType; |
|||
@ExcelIgnore |
|||
private String docName; |
|||
|
|||
@ExcelIgnore |
|||
private String citName; |
|||
|
|||
@ExcelIgnore |
|||
private String costCenter; |
|||
|
|||
@ExcelIgnore |
|||
private String refund; |
|||
|
|||
@ExcelIgnore |
|||
private String dataJson; |
|||
|
|||
@ExcelIgnore |
|||
private String invoiceTypeStr; |
|||
|
|||
public static Integer statusStrToNumber(String str) { |
|||
if (str == null) return null; |
|||
switch (str.toLowerCase()) { |
|||
case "已处理": |
|||
return 1; |
|||
case "异常": |
|||
return 2; |
|||
case "pending": |
|||
return 3; |
|||
case "未处理": |
|||
return 0; |
|||
case "退票": |
|||
return 4; |
|||
case "暂挂": |
|||
return 5; |
|||
default: |
|||
return null; |
|||
} |
|||
} |
|||
|
|||
public String getDownloadUri() { |
|||
if (StringUtil.isNotEmpty(this.originalFilePath)) { |
|||
return this.originalFilePath; |
|||
} |
|||
return this.imgPath; |
|||
} |
|||
|
|||
public String getFileName() { |
|||
if (StringUtil.isNotEmpty(this.originalFilePath)) { |
|||
return this.number + this.originalFilePath.substring(this.originalFilePath.lastIndexOf(".")); |
|||
} |
|||
if (StringUtil.isNotEmpty(this.imgPath)) { |
|||
return this.number + this.imgPath.substring(this.imgPath.lastIndexOf(".")); |
|||
} |
|||
return "null"; |
|||
} |
|||
|
|||
public String getShowTitle() { |
|||
return this.message; |
|||
} |
|||
|
|||
public String getDeductStatus() { |
|||
return StringUtil.isEmpty(deductStatus) ? "未抵扣" : deductStatus; |
|||
} |
|||
|
|||
// public String getTicketCodeStr() {
|
|||
// if (ticketCode == null) return "";
|
|||
// switch (ticketCode) {
|
|||
// case "10101":s
|
|||
// return "增值税普通发票";
|
|||
// case "10100":
|
|||
// return "增值税专用发票";
|
|||
// case "10107":
|
|||
// return "增值税电子专用发票";
|
|||
// case "10102":
|
|||
// return "增值税电子普通发票";
|
|||
// case "30100":
|
|||
// return "形式发票";
|
|||
// case "30101":
|
|||
// return "收据";
|
|||
// default:
|
|||
// return "";
|
|||
// }
|
|||
// }
|
|||
|
|||
public String getStatusStr() { |
|||
if (status == null) return ""; |
|||
switch (status) { |
|||
case 1: |
|||
return "已处理"; |
|||
case 2: |
|||
return "异常"; |
|||
case 3: |
|||
return "Pending"; |
|||
case 0: |
|||
return "未处理"; |
|||
case 4: |
|||
return "退票"; |
|||
case 5: |
|||
return "暂挂"; |
|||
default: |
|||
return ""; |
|||
} |
|||
} |
|||
|
|||
public String getImgPath() { |
|||
return imgPath == null ? null : StringUtils.formatUrl(imgPath, "/"); |
|||
} |
|||
|
|||
public void setImgPath(String imgPath) { |
|||
this.imgPath = imgPath == null ? null : StringUtils.formatUrl(imgPath, "/"); |
|||
} |
|||
|
|||
public String getOriginalFilePath() { |
|||
return originalFilePath == null ? null : StringUtils.formatUrl(originalFilePath, "/"); |
|||
} |
|||
|
|||
public void setOriginalFilePath(String originalFilePath) { |
|||
this.originalFilePath = originalFilePath == null ? null : StringUtils.formatUrl(originalFilePath, "/"); |
|||
} |
|||
|
|||
public String getSeller() { |
|||
return null==seller ? null:seller.replace("(","(").replace(")",")"); |
|||
// return StringUtils.getStringWithOutSpecialCode2(seller);
|
|||
} |
|||
|
|||
public void setSeller(String seller) { |
|||
this.seller = seller; |
|||
// this.seller = StringUtils.getStringWithOutSpecialCode2(seller);
|
|||
} |
|||
|
|||
public String getBuyer() { |
|||
return null==buyer? null:buyer.replace("(","(").replace(")",")"); |
|||
// return StringUtils.getStringWithOutSpecialCode2(buyer);
|
|||
} |
|||
|
|||
public void setBuyer(String buyer) { |
|||
this.buyer = buyer; |
|||
// this.buyer = StringUtils.getStringWithOutSpecialCode2(buyer);
|
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,102 @@ |
|||
package com.cmsen.ticket.domain.entity; |
|||
|
|||
import com.cmsen.ticket.domain.entity.manager.SupplierOrderItemMatching; |
|||
import lombok.Data; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* corporate_invoice_items |
|||
*/ |
|||
@Data |
|||
@Slf4j |
|||
public class CorporateInvoiceItems implements Serializable { |
|||
|
|||
private String id; |
|||
|
|||
private String pid; |
|||
|
|||
private String name; |
|||
|
|||
private String unit; |
|||
|
|||
private String quantity; |
|||
|
|||
private String price; |
|||
|
|||
private String total; |
|||
|
|||
private String extraFields; |
|||
|
|||
private String specification; |
|||
|
|||
private String tax; |
|||
|
|||
private String taxRate; |
|||
|
|||
private String deductionAmount; |
|||
|
|||
private String deductionTaxRate; |
|||
|
|||
private String deductionTax; |
|||
|
|||
private BigDecimal usedAmount; |
|||
|
|||
private BigDecimal unUsedAmount; |
|||
|
|||
private BigDecimal usedQuantity; |
|||
|
|||
private BigDecimal unUsedQuantity; |
|||
|
|||
private String difference; |
|||
|
|||
private String originUnit; |
|||
private String invoiceNumber; |
|||
|
|||
private String originQuantity; |
|||
private String originPrice; |
|||
private List<SupplierOrderItemMatching> itemMatchingList; |
|||
private int priceType; |
|||
|
|||
|
|||
private String itemNo; |
|||
private String ext01; |
|||
private String ext02; |
|||
private String ext03; |
|||
private String ext04; |
|||
private String ext05; |
|||
|
|||
|
|||
public BigDecimal getUnUsedAmount() { |
|||
if(priceType==0) { |
|||
total = total.replace("¥",""); |
|||
if (usedAmount == null) return new BigDecimal(total==null?"0":total); |
|||
// log.info("total=>{}",total);
|
|||
// log.info("deductionAmount=>{}",deductionAmount);
|
|||
// log.info("usedAmount=>{}",usedAmount);
|
|||
return new BigDecimal(total).add(new BigDecimal(deductionAmount == null ? "0" : deductionAmount)).subtract(usedAmount).setScale(2, BigDecimal.ROUND_HALF_UP); |
|||
}else{ |
|||
total = total.replace("¥",""); |
|||
if (usedAmount == null) usedAmount=BigDecimal.ZERO; |
|||
return new BigDecimal(total).add(new BigDecimal(deductionAmount == null ? "0" : deductionAmount)).add(new BigDecimal(tax == null ? "0" : tax)) |
|||
.add(new BigDecimal(deductionTax == null ? "0" : deductionTax)).subtract(usedAmount).setScale(2, BigDecimal.ROUND_HALF_UP); |
|||
} |
|||
} |
|||
|
|||
public BigDecimal getUnUsedQuantity() { |
|||
// log.info("quantity ====={} usedQuantity ======{}",quantity,usedQuantity);
|
|||
if(StringUtils.isEmpty(quantity)) quantity = "0"; |
|||
if (usedQuantity == null) return new BigDecimal(quantity).setScale(2, BigDecimal.ROUND_HALF_UP); |
|||
return new BigDecimal(quantity).setScale(2, BigDecimal.ROUND_HALF_UP).subtract(usedQuantity); |
|||
} |
|||
|
|||
public String getDifference() { |
|||
if (difference == null) return total; |
|||
if (difference.equals("")) return "0"; |
|||
return difference; |
|||
} |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
package com.cmsen.ticket.domain.entity; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* corporate_invoice_type |
|||
* |
|||
* @author |
|||
*/ |
|||
@Data |
|||
public class CorporateInvoiceType implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
private Integer id; |
|||
private String name; |
|||
private String code; |
|||
private String desc; |
|||
private Boolean active; |
|||
private Integer review; |
|||
private Integer sendType; |
|||
private Integer matchType; |
|||
} |
|||
@ -0,0 +1,72 @@ |
|||
package com.cmsen.ticket.domain.entity; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* (Customer)实体类 |
|||
* |
|||
* @author ran hao yu |
|||
* @since 2020-09-18 11:13:28 |
|||
*/ |
|||
@Data |
|||
public class Customer implements Serializable { |
|||
private static final long serialVersionUID = -87372310697814000L; |
|||
/** |
|||
* 客户表主键ID |
|||
*/ |
|||
private Integer id; |
|||
/** |
|||
* 客户(客户名称) |
|||
*/ |
|||
private String customer; |
|||
/** |
|||
* 0为未删除,1为已删除,默认为0 |
|||
*/ |
|||
private String isDel; |
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private String createTime; |
|||
|
|||
|
|||
private String orgUnitWord; |
|||
|
|||
private String companyWord; |
|||
|
|||
private Integer sendType; |
|||
|
|||
private Boolean multiInv; |
|||
|
|||
/** |
|||
* 手工发票可编辑 0、是 1、否 |
|||
*/ |
|||
private Byte manualFieldConfig; |
|||
|
|||
/** |
|||
* 供应商发票最大验真次数 |
|||
*/ |
|||
private Integer corMaxValid; |
|||
|
|||
/** |
|||
* 是否开启智能附件 0 关闭 1 开启 |
|||
*/ |
|||
private Boolean smartAttachment; |
|||
|
|||
/** |
|||
* 是否开启强制验真 0 关闭 1 开启 |
|||
*/ |
|||
private Byte forceValid; |
|||
|
|||
/** |
|||
* 是否开启未验真发送 0 关闭 1 开启 |
|||
*/ |
|||
private Boolean unValidSend; |
|||
|
|||
/** |
|||
* 费用类型能否修改 0 不可以 1 可以 |
|||
*/ |
|||
private Boolean expenseTypeActive; |
|||
|
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
package com.cmsen.ticket.domain.entity; |
|||
|
|||
import com.cmsen.ticket.domain.util.StringUtils; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* file |
|||
* |
|||
* @author |
|||
*/ |
|||
@Data |
|||
public class File implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
private Integer id; |
|||
private String path; |
|||
private String uri; |
|||
private String type; |
|||
private String pid; |
|||
private String description; |
|||
private Integer uploadUser; |
|||
private String uploadUserName; |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date uploadTime; |
|||
|
|||
public String getUri() { |
|||
return uri == null ? null : StringUtils.formatUrl(uri, "/"); |
|||
} |
|||
} |
|||
@ -0,0 +1,47 @@ |
|||
package com.cmsen.ticket.domain.entity; |
|||
|
|||
import com.cmsen.common.http.response.Validation; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* supplier |
|||
* |
|||
* @author |
|||
*/ |
|||
@Data |
|||
public class Supplier implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
@NotNull(message = "required", groups = {Validation.Update.class}) |
|||
private Integer id; |
|||
@NotBlank(message = "required", groups = {Validation.Create.class}) |
|||
private String code; |
|||
@NotBlank(message = "required", groups = {Validation.Create.class}) |
|||
private String name; |
|||
@NotBlank(message = "required", groups = {Validation.Create.class}) |
|||
private String taxNo; |
|||
private String orgCode; |
|||
private Integer status; |
|||
private String supplierCode; |
|||
private Boolean supplierSpecial; |
|||
|
|||
/** |
|||
* 开户行分行 |
|||
*/ |
|||
private String branchBank; |
|||
|
|||
/** |
|||
* 账户信息 |
|||
*/ |
|||
private String accountInfo; |
|||
|
|||
private String isDigital; |
|||
private String ext01; |
|||
private String ext02; |
|||
private String ext03; |
|||
private String ext04; |
|||
private String ext05; |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
package com.cmsen.ticket.domain.entity; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @author jared.Yan (yanhuaiwen@163.com) |
|||
*/ |
|||
@Data |
|||
public class SupplierMatching implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
private String invoiceId; |
|||
private String supplierCode; |
|||
private String orderNo; |
|||
|
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date operationTime; |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
package com.cmsen.ticket.domain.entity; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* supplier_matching_log |
|||
* |
|||
* @author |
|||
*/ |
|||
@Data |
|||
public class SupplierMatchingLog implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
private String id; |
|||
private String pid; |
|||
private String invoiceNo; |
|||
private String module; |
|||
private String methods; |
|||
private String operatorUser; |
|||
private String operatorUserName; |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date createTime; |
|||
|
|||
private String preValue; |
|||
private String afterValue; |
|||
|
|||
private String reason; |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
package com.cmsen.ticket.domain.entity; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author jared.Yan (yanhuaiwen@163.com) |
|||
*/ |
|||
@Data |
|||
public class SupplierMaterial implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
private Integer id; |
|||
private String supplierNo; |
|||
private String materialNo; |
|||
private String material; |
|||
private String uom; |
|||
private String supplierMaterial; |
|||
private String specification; |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
package com.cmsen.ticket.domain.entity; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
@Data |
|||
public class SupplierMaterialDefine implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
/** |
|||
* 主键ID |
|||
*/ |
|||
private Integer id; |
|||
|
|||
private String itemNo; |
|||
|
|||
private String similarItemNo; |
|||
|
|||
private String itemType; |
|||
private String remark; |
|||
private String ext01; |
|||
private String ext02; |
|||
private String ext03; |
|||
private String ext04; |
|||
private String ext05; |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
package com.cmsen.ticket.domain.entity; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author jared.Yan (yanhuaiwen@163.com) |
|||
*/ |
|||
@Data |
|||
public class SupplierMaterialFilter implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
private Integer id; |
|||
private String name; |
|||
private String remark; |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
package com.cmsen.ticket.domain.entity; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author jared.Yan (yanhuaiwen@163.com) |
|||
*/ |
|||
@Data |
|||
public class SupplierMaterialUom implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
private Integer id; |
|||
private String materialNo; |
|||
private String unit; |
|||
private String versUnit; |
|||
private String versNum; |
|||
private Boolean status; |
|||
private String remark; |
|||
private String vStatusName; |
|||
} |
|||
@ -0,0 +1,198 @@ |
|||
package com.cmsen.ticket.domain.entity; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelIgnore; |
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.cmsen.ticket.domain.entity.manager.SupplierOrderItemMatching; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import lombok.Data; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author jared.Yan (yanhuaiwen@163.com) |
|||
*/ |
|||
@Data |
|||
public class SupplierOrder implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
@ExcelProperty(value = "ID", index = 1) |
|||
private Integer id; |
|||
@ExcelIgnore |
|||
private String receiveNo; |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
@ExcelIgnore |
|||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
|||
private Date receiveTime; |
|||
@ExcelProperty(value = "供应商代码", index = 0) |
|||
private String supplierCode; |
|||
@ExcelProperty(value = "订单编号", index = 2) |
|||
private String orderNo; |
|||
@ExcelProperty(value = "行", index = 3) |
|||
private String lineNum; |
|||
@ExcelProperty(value = "货物", index = 5) |
|||
private String goods; |
|||
@ExcelIgnore |
|||
private String uom; |
|||
@ExcelProperty(value = "数量", index = 7) |
|||
private String goodsNum; |
|||
@ExcelProperty(value = "收货", index = 8) |
|||
private String receivedNum; |
|||
@ExcelIgnore |
|||
private String currency; |
|||
@ExcelProperty(value = "单价", index = 10) |
|||
private BigDecimal unitPrice; |
|||
@ExcelProperty(value = "金额", index = 11) |
|||
private BigDecimal amount; |
|||
@ExcelProperty(value = "匹配金额", index = 6) |
|||
private BigDecimal matchAmount; |
|||
@ExcelIgnore |
|||
private String companyName; |
|||
@ExcelProperty(value = "来源", index = 12) |
|||
private String source; |
|||
@ExcelProperty(value = "状态", index = 13) |
|||
private Boolean status; |
|||
@ExcelIgnore |
|||
private String vStatusName; |
|||
@ExcelIgnore |
|||
private String companyCode; |
|||
@ExcelIgnore |
|||
private String costCenter; |
|||
@ExcelIgnore |
|||
private String orgCode; |
|||
@ExcelProperty(value = "ITEM", index = 4) |
|||
private String itemNo; |
|||
@ExcelIgnore |
|||
private String taxRate; |
|||
@ExcelIgnore |
|||
private String owner; |
|||
@ExcelIgnore |
|||
private String description; |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
@ExcelIgnore |
|||
private Date creationTime; |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
@ExcelIgnore |
|||
private Date updateTime; |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
|||
@ExcelIgnore |
|||
private Date orderDate; |
|||
@ExcelIgnore |
|||
private BigDecimal usedAmount; |
|||
@ExcelIgnore |
|||
private BigDecimal unUsedAmount; |
|||
|
|||
@ExcelIgnore |
|||
private String ext01; |
|||
@ExcelIgnore |
|||
private String ext02; |
|||
@ExcelIgnore |
|||
private String ext03; |
|||
@ExcelIgnore |
|||
private String ext04; |
|||
@ExcelIgnore |
|||
private String ext05;//剩余匹配金额
|
|||
@ExcelIgnore |
|||
private String supplierName; |
|||
@ExcelProperty(value = "可匹配", index = 9) |
|||
private String matchNum; |
|||
@ExcelIgnore |
|||
private String usedQuantity; |
|||
@ExcelIgnore |
|||
private String unUsedQuantity; |
|||
|
|||
// 冻结数量
|
|||
@ExcelIgnore |
|||
private String refundNum; |
|||
|
|||
public String getUnUsedQuantity() { |
|||
if (usedQuantity == null) return receivedNum; |
|||
return new BigDecimal(receivedNum).subtract(new BigDecimal(usedQuantity)).setScale(4, BigDecimal.ROUND_HALF_UP).toEngineeringString(); |
|||
} |
|||
|
|||
public String getvStatusName() { |
|||
return status == null || status ? "关闭" : "正常"; |
|||
} |
|||
|
|||
public BigDecimal getUnUsedAmount() { |
|||
if (usedAmount == null) return amount; |
|||
return amount == null ? null : amount.subtract(usedAmount); |
|||
} |
|||
|
|||
@ExcelIgnore |
|||
List<SupplierOrderItemMatching> matchList; |
|||
|
|||
/** |
|||
* 是否为劳务费:0-是 1-否 |
|||
*/ |
|||
@ExcelIgnore |
|||
private String isServiceFee; |
|||
|
|||
/** |
|||
* CODE id |
|||
*/ |
|||
@ExcelIgnore |
|||
private String codeId; |
|||
|
|||
/** |
|||
* CODE name |
|||
*/ |
|||
@ExcelIgnore |
|||
private String codeName; |
|||
|
|||
/** |
|||
* GS项目批号(原项目批号A,限TIC/EIC) |
|||
*/ |
|||
@ExcelIgnore |
|||
private String gsNum; |
|||
|
|||
/** |
|||
* OA通用项目批号(原项目批号B) |
|||
*/ |
|||
@ExcelIgnore |
|||
private String oaNum; |
|||
|
|||
/** |
|||
* 向品牌收取的金额(没有填0) |
|||
*/ |
|||
@ExcelIgnore |
|||
private BigDecimal collectAmount; |
|||
|
|||
/** |
|||
* 平台类型 |
|||
*/ |
|||
@ExcelIgnore |
|||
private String platForm; |
|||
|
|||
/** |
|||
* 充值渠道 |
|||
*/ |
|||
@ExcelIgnore |
|||
private String chargeChannel; |
|||
|
|||
/** |
|||
* 渠道备注 |
|||
*/ |
|||
@ExcelIgnore |
|||
private String channelRemark; |
|||
@ExcelIgnore |
|||
private String ext06; |
|||
@ExcelIgnore |
|||
private String ext07; |
|||
@ExcelIgnore |
|||
private String ext08; |
|||
@ExcelIgnore |
|||
private String ext09; |
|||
@ExcelIgnore |
|||
private String ext10; |
|||
@ExcelIgnore |
|||
private String goodsStr;//费用类型str
|
|||
@ExcelIgnore |
|||
private String costCenterStr;//成本中心str
|
|||
} |
|||
@ -0,0 +1,70 @@ |
|||
package com.cmsen.ticket.domain.entity; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 对账单表 |
|||
*/ |
|||
@Data |
|||
public class SupplierState implements Serializable { |
|||
|
|||
private long id; |
|||
|
|||
private String po; |
|||
|
|||
private String lineNo; |
|||
|
|||
private String itemNo; |
|||
|
|||
private String desc; |
|||
|
|||
private String quantity; |
|||
|
|||
private String uom; |
|||
|
|||
private String unitPrice; |
|||
|
|||
private String amount; |
|||
|
|||
private String code; |
|||
|
|||
private String number; |
|||
|
|||
private String ext01; |
|||
|
|||
private String ext02; |
|||
|
|||
private String ext03; |
|||
|
|||
private String ext04; |
|||
|
|||
private String ext05; |
|||
|
|||
private String ext06; |
|||
|
|||
private String ext07; |
|||
|
|||
private String ext08; |
|||
|
|||
private String ext09; |
|||
|
|||
private String ext10; |
|||
|
|||
private String status; |
|||
|
|||
private Date createDate; |
|||
|
|||
private Date updateDate; |
|||
|
|||
private String createBy; |
|||
|
|||
private String updateBy; |
|||
|
|||
private String isDel; |
|||
|
|||
private String currency; |
|||
|
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue