Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
9fcb4874
Commit
9fcb4874
authored
Oct 23, 2025
by
hongguangwu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/MVP1.7.16' into MVP1.7.16
parents
6f52fdf4
14205bc9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
39 deletions
+70
-39
TAutoMainRelServiceImpl.java
...1/yifu/archives/service/impl/TAutoMainRelServiceImpl.java
+2
-2
QwExcelApiServiceImpl.java
...lus/v1/ekp/service/impl/QwExce/QwExcelApiServiceImpl.java
+47
-19
WeComSmartSheetDebugger.java
.../yifu/cloud/plus/v1/ekp/util/WeComSmartSheetDebugger.java
+21
-18
No files found.
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TAutoMainRelServiceImpl.java
View file @
9fcb4874
...
...
@@ -1330,8 +1330,8 @@ private R<Boolean> checkItemRepeat(List<SysAutoDictItem> autoDictItems, Map<Stri
try
{
// 添加了异常处理,避免 recordBase 不是合法数字格式时程序崩溃
if
(
CommonConstants
.
ZERO_STRING
.
equals
(
rel
.
getPaymentType
())){
if
(
BigDecimal
.
valueOf
(
Double
.
valueOf
(
rel
.
getRecordBase
())).
compareTo
(
setInfo
.
getLowerLimit
())
!=
0
)
{
return
R
.
failed
(
"备案基数不
等
于配置名称("
+
rel
.
getConfigName
()+
")最低基数:"
+
setInfo
.
getLowerLimit
());
if
(
BigDecimal
.
valueOf
(
Double
.
valueOf
(
rel
.
getRecordBase
())).
compareTo
(
setInfo
.
getLowerLimit
())
>
0
)
{
return
R
.
failed
(
"备案基数不
大
于配置名称("
+
rel
.
getConfigName
()+
")最低基数:"
+
setInfo
.
getLowerLimit
());
}
}
}
catch
(
NumberFormatException
e
)
{
...
...
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/service/impl/QwExce/QwExcelApiServiceImpl.java
View file @
9fcb4874
...
...
@@ -42,17 +42,23 @@ public class QwExcelApiServiceImpl extends ServiceImpl<QwExcelApiMapper, EkpInvo
String
corpSecret
=
"16kqEL_eU-ARwYyqLgEBWHgxm8gXVnkzv_eJMLy9NpU"
;
String
docId
=
"dcTSMCj4lWV9MEP7lquZacOY8WS4g-iHxP_jVYA02tdYwb2YYc3BpDR8NrFWkEngHUg8abET4eTIpo9Zv-571NEA"
;
//智能表格发票数据表ID
String
sheetId
=
"q979lj"
;
String
[]
sheetIds
=
new
String
[]{
"q979lj"
,
"JdsXE8"
,
"nyaxYZ"
,
"lbzy8S"
};
String
sheetId
;
String
accessToken
=
weComSmartSheetManager
.
getAccessToken
(
corpId
,
corpSecret
);
if
(
accessToken
==
null
||
accessToken
.
isEmpty
())
{
log
.
error
(
"获取access_token失败"
);
return
;
}
int
batchSize
=
1000
;
int
batchCount
=
0
;
String
[]
monthRange
=
null
;
List
<
Map
<
String
,
Object
>>
records
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
tempRecords
=
null
;
int
totalInserted
=
0
;
// 记录已插入的总数据量
int
sheetIndex
=
0
;
// 当前使用的sheetId索引
sheetId
=
sheetIds
[
sheetIndex
];
// 初始化使用第一个sheetId
//List<String> strings = new ArrayList<>();
//strings.add("FeiTaiLang_Fang");
//strings.add("ZhangQianQian");
...
...
@@ -62,8 +68,8 @@ public class QwExcelApiServiceImpl extends ServiceImpl<QwExcelApiMapper, EkpInvo
log
.
info
(
"微信智能表格发票数据删除完成"
);
log
.
info
(
"微信智能表格发票数据插入开始..."
);
//获取最近24个月的发票信息,按月去插入到智能表格中
monthRange
=
MonthCalculationUtils
.
calculateMonthRange
(
0
);
for
(
int
i
=
0
;
i
<
24
;
i
++){
monthRange
=
MonthCalculationUtils
.
calculateMonthRange
(
i
);
if
(
null
!=
monthRange
&&
monthRange
.
length
==
CommonConstants
.
dingleDigitIntArray
[
2
]){
records
=
baseMapper
.
selectInvoiceList
(
monthRange
[
0
],
monthRange
[
1
]);
}
...
...
@@ -77,11 +83,33 @@ public class QwExcelApiServiceImpl extends ServiceImpl<QwExcelApiMapper, EkpInvo
for
(
int
j
=
0
;
j
<
batchCount
;
j
++)
{
tempRecords
=
records
.
subList
(
j
*
batchSize
,
Math
.
min
((
j
+
1
)
*
batchSize
,
records
.
size
()));
// 检查是否需要切换到下一个sheetId
if
(
totalInserted
+
tempRecords
.
size
()
>
100000
)
{
// 如果当前数据加上已插入数据超过100000,则切换到下一个sheetId
sheetIndex
++;
if
(
sheetIndex
<
sheetIds
.
length
)
{
sheetId
=
sheetIds
[
sheetIndex
];
totalInserted
=
0
;
// 重置计数器
log
.
info
(
"切换到下一个表格,使用sheetId: "
+
sheetId
);
// 删除新表格中的所有数据
log
.
info
(
"清空新表格数据开始..."
);
weComSmartSheetManager
.
deleteAllRows
(
accessToken
,
docId
,
sheetId
);
log
.
info
(
"清空新表格数据完成"
);
}
else
{
log
.
warn
(
"sheetIds已用完,无法继续插入数据"
);
return
;
}
}
debugService
.
debugInsertIssueAsso
(
accessToken
,
tempRecords
,
docId
,
sheetId
);
break
;
totalInserted
+=
tempRecords
.
size
()
;
}
}
log
.
info
(
"微信智能表格发票数据插入完成"
);
}
log
.
info
(
"微信智能表格发票数据插入完成,总共插入记录数: "
+
totalInserted
);
//智能表格合同数据表ID
/*sheetId = "EuVt8X";
log.info("微信智能表格合同数据删除开始...");
...
...
yifu-ekp/yifu-ekp-biz/src/main/java/com/yifu/cloud/plus/v1/ekp/util/WeComSmartSheetDebugger.java
View file @
9fcb4874
...
...
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.yifu.cloud.plus.v1.ekp.config.WxConfig
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil
;
import
lombok.extern.log4j.Log4j2
;
import
org.jasypt.commons.CommonUtils
;
import
org.springframework.http.*
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.client.RestTemplate
;
...
...
@@ -295,31 +296,33 @@ public class WeComSmartSheetDebugger {
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
fieldData
.
entrySet
())
{
String
fieldName
=
entry
.
getKey
();
String
fieldValue
=
entry
.
getValue
().
toString
();
// 构造字段值格式[{"type": "text", "text": "文本内容"}]
JSONArray
fieldValueArray
=
new
JSONArray
();
JSONObject
textObject
=
new
JSONObject
();
//根据fieldMap 对应的字段类型 初始化对应的企业微信的字段
if
(
fieldMap
.
containsKey
(
fieldName
)){
/* if (fieldMap.get(fieldName).equals("FIELD_TYPE_DATE_TIME")){
textObject.put("type", "Date");
textObject.put("text", fieldValue);
}else if (fieldMap.get(fieldName).equals("FIELD_TYPE_NUMBER")){
textObject.put("type", "double");
textObject.put("text", 11111.00);
if
(
fieldMap
.
containsKey
(
fieldName
))
{
if
(
fieldMap
.
get
(
fieldName
).
equals
(
"FIELD_TYPE_DATE_TIME"
))
{
//时间格式转换,如果空则返回空,如果非空则转换为日期,然后返回时间戳字符串
if
(
fieldValue
.
isEmpty
()){
fieldValue
=
""
;
}
else
{
fieldValue
=
""
+
DateUtil
.
stringToDate
(
fieldValue
,
DateUtil
.
ISO_EXPANDED_DATE_FORMAT
).
getTime
();
}
values
.
put
(
fieldName
,
fieldValue
);
}
else
if
(
fieldMap
.
get
(
fieldName
).
equals
(
"FIELD_TYPE_NUMBER"
))
{
//如果是数字 字节转款,如果空或非数字 则返回0
if
(
fieldValue
.
isEmpty
()
||
!
fieldValue
.
matches
(
"^[0-9]+(\\.[0-9]+)?$"
))
{
values
.
put
(
fieldName
,
0
);
}
else
{
values
.
put
(
fieldName
,
Double
.
valueOf
(
fieldValue
));
}
}
else
{
textObject
.
put
(
"type"
,
"text"
);
textObject
.
put
(
"text"
,
fieldValue
);
}*/
textObject
.
put
(
"type"
,
"text"
);
textObject
.
put
(
"text"
,
fieldValue
);
}
fieldValueArray
.
add
(
textObject
);
values
.
put
(
fieldName
,
fieldValueArray
);
}
}
}
recordObj
.
put
(
"values"
,
values
);
recordsArray
.
add
(
recordObj
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment