Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
38a8c7de
Commit
38a8c7de
authored
Jun 30, 2025
by
韩桐桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
企业人员导入+设备注销后续业务放开
parent
23503f7a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
86 additions
and
19 deletions
+86
-19
JgChangeRegistrationNameController.java
...jg/biz/controller/JgChangeRegistrationNameController.java
+2
-1
JgChangeRegistrationReformController.java
.../biz/controller/JgChangeRegistrationReformController.java
+4
-1
TzsUserInfoController.java
...boot/module/tcm/biz/controller/TzsUserInfoController.java
+1
-1
TzsUserInfoServiceImpl.java
...t/module/tcm/biz/service/impl/TzsUserInfoServiceImpl.java
+79
-16
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgChangeRegistrationNameController.java
View file @
38a8c7de
...
...
@@ -162,7 +162,8 @@ public class JgChangeRegistrationNameController extends BaseController {
dto
.
setUseUnitCreditCode
(
getSelectedOrgInfo
().
getCompany
().
getCompanyCode
());
}
}
dto
.
setCertificateStatus
(
"已登记"
);
// 错误注使用销业务导出后续业务无法做,故放开限制 @2025-06-27
// dto.setCertificateStatus("已登记");
dto
.
setIsDoBusiness
(
"1"
);
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationNameService
.
getTableData
(
dto
));
}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgChangeRegistrationReformController.java
View file @
38a8c7de
...
...
@@ -203,8 +203,11 @@ public class JgChangeRegistrationReformController extends BaseController {
if
(!
ObjectUtils
.
isEmpty
(
transferType
))
{
dto
.
setIsScrap
(
"0"
);
}
// 错误注使用销业务导出后续业务无法做,故放开限制 @2025-06-27
if
(!
ValidationUtil
.
isEmpty
(
transferType
)
&&
"1"
.
equals
(
transferType
))
{
//区外移装查询已注销状态的证
dto
.
setCertificateStatus
(
"1"
.
equals
(
transferType
)
?
"已注销"
:
"已登记"
);
dto
.
setCertificateStatus
(
"已注销"
);
}
dto
.
setIsDoBusiness
(
"1"
);
//默认可以做业务
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationReformServiceImpl
.
getUseRegistrationCodeData
(
page
,
dto
));
}
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/controller/TzsUserInfoController.java
View file @
38a8c7de
...
...
@@ -382,7 +382,7 @@ public class TzsUserInfoController extends BaseController {
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/company/import"
)
@PostMapping
(
value
=
"/company/import"
,
produces
=
"application/json;charset=UTF-8"
)
@ApiOperation
(
value
=
"企业人员导入"
,
httpMethod
=
"POST"
,
notes
=
"企业人员导入"
)
public
ResponseModel
<?>
importCompanyUser
(
@RequestBody
MultipartFile
file
)
{
return
tzsUserInfoService
.
importCompanyUser
(
file
,
getSelectedOrgInfo
());
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/service/impl/TzsUserInfoServiceImpl.java
View file @
38a8c7de
...
...
@@ -51,6 +51,7 @@ import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import
com.yeejoin.amos.feign.privilege.model.GroupModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.feign.privilege.util.DesUtil
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.ehcache.impl.internal.concurrent.ConcurrentHashMap
;
...
...
@@ -58,11 +59,13 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.core.io.Resource
;
import
org.springframework.mock.web.MockMultipartFile
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
...
...
@@ -76,6 +79,8 @@ import javax.servlet.http.HttpServletResponse;
import
javax.validation.ConstraintViolation
;
import
javax.validation.Validator
;
import
java.io.*
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.file.Files
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
...
...
@@ -116,6 +121,8 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
private
TzsUserQualificationsServiceImpl
tzsUserQualificationsService
;
@Autowired
private
TzsUserPermissionServiceImpl
tzsUserPermissionServiceImpl
;
@Autowired
private
EmqKeeper
emqKeeper
;
@Autowired
private
RegUnitInfoServiceImpl
regUnitInfoService
;
...
...
@@ -1345,6 +1352,56 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
return
errors
;
}
private
final
String
DOWN_LOAD_START_TEMP
=
"{\"id\":\"%s\",\"status\":\"starting\",\"fileName\":\"%s\",\"time\":\"%s\"}"
;
private
final
String
DOWNLOAD_TOPIC
=
"/topic/download/excel/%s"
;
private
final
String
BUCKET_NAME
=
"upload"
;
private
final
String
UPLOAD_PATH
=
"/tzs/excelTempFile"
;
/**
* 开始下载 发送消息
*/
public
void
startDownLoadMsg
(
String
fileName
,
String
uuid
)
{
try
{
emqKeeper
.
getMqttClient
().
publish
(
String
.
format
(
DOWNLOAD_TOPIC
,
RequestContext
.
getToken
()),
String
.
format
(
DOWN_LOAD_START_TEMP
,
uuid
,
fileName
,
new
Date
().
getTime
()).
getBytes
(
StandardCharsets
.
UTF_8
),
2
,
false
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
}
}
/**
* 发送主题消息,给企业推送excel 结束下载提醒
*
* @param topic 主体格式为: /download/excel/${token}
* @param jsonObject 文件名称 + excel文件路径(minio)
*/
public
void
sendDownLoadExcelMsg
(
String
topic
,
JSONObject
jsonObject
)
{
try
{
emqKeeper
.
getMqttClient
().
publish
(
topic
,
JSONObject
.
toJSONString
(
jsonObject
).
getBytes
(
StandardCharsets
.
UTF_8
),
2
,
false
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
}
}
/**
* 上传excel文件到minio服务器
*
* @param templateExcelFile 文件
* @return minio文件路径
*/
private
String
uploadExcelFile
(
MultipartFile
templateExcelFile
)
{
FeignClientResult
<
Map
<
String
,
String
>>
uploadResult
=
Systemctl
.
fileStorageClient
.
updateBucketFile
(
templateExcelFile
,
BUCKET_NAME
,
UPLOAD_PATH
);
String
urlString
=
""
;
if
(
uploadResult
!=
null
&&
uploadResult
.
getResult
()
!=
null
)
{
for
(
String
s
:
uploadResult
.
getResult
().
keySet
())
{
urlString
=
s
;
}
}
return
urlString
;
}
/**
* 企业人员导入
*
...
...
@@ -1356,7 +1413,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
public
ResponseModel
<?>
importCompanyUser
(
MultipartFile
multipartFile
,
ReginParams
reginParams
)
{
CompanyBo
company
=
reginParams
.
getCompany
();
List
<
CompanyUserImportDto
>
dataList
=
new
ArrayList
<>();
JSONArray
resultError
=
new
JSONArray
();
ArrayList
<
String
>
sheetError
=
new
ArrayList
();
// 用于手机号唯一判断 key:姓名-身份证号 value :手机号
// key保证数据唯一性
Map
<
String
,
String
>
phoneOnly
=
new
HashMap
<>();
...
...
@@ -1372,7 +1429,6 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
if
(
sheetName
.
contains
(
"企业人员录入限制"
))
{
continue
;
}
ArrayList
<
String
>
sheetError
=
new
ArrayList
<>();
// 人员信息 sheet页
if
(
sheetName
.
contains
(
"人员信息"
))
{
EasyExcel
.
read
(
multipartFile
.
getInputStream
(),
CompanyUserImportDto
.
class
,
new
AnalysisEventListener
<
CompanyUserImportDto
>()
{
...
...
@@ -1383,9 +1439,6 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
@Override
public
void
doAfterAllAnalysed
(
AnalysisContext
context
)
{
if
(!
ValidationUtil
.
isEmpty
(
sheetError
))
{
resultError
.
add
(
sheetError
);
}
}
}).
headRowNumber
(
2
).
sheet
(
sheetNo
,
sheetName
).
doRead
();
}
...
...
@@ -1400,9 +1453,6 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
@Override
public
void
doAfterAllAnalysed
(
AnalysisContext
context
)
{
if
(!
ValidationUtil
.
isEmpty
(
sheetError
))
{
resultError
.
add
(
sheetError
);
}
}
}).
headRowNumber
(
2
).
sheet
(
sheetNo
,
sheetName
).
doRead
();
}
...
...
@@ -1417,9 +1467,6 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
@Override
public
void
doAfterAllAnalysed
(
AnalysisContext
context
)
{
if
(!
ValidationUtil
.
isEmpty
(
sheetError
))
{
resultError
.
add
(
sheetError
);
}
}
}).
headRowNumber
(
2
).
sheet
(
sheetNo
,
sheetName
).
doRead
();
}
...
...
@@ -1434,16 +1481,32 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
@Override
public
void
doAfterAllAnalysed
(
AnalysisContext
context
)
{
if
(!
ValidationUtil
.
isEmpty
(
sheetError
))
{
resultError
.
add
(
sheetError
);
}
}
}).
headRowNumber
(
2
).
sheet
(
sheetNo
,
sheetName
).
doRead
();
}
}
// 存在检验不通过的数据则返回错误信息,不在向下写入库
if
(!
resultError
.
isEmpty
())
{
return
ResponseHelper
.
buildResponse
(
resultError
);
if
(!
sheetError
.
isEmpty
())
{
// 发送错误文件
String
uuid
=
UUID
.
randomUUID
().
toString
();
startDownLoadMsg
(
"人员导入错误文件"
,
uuid
);
File
tempFile
=
File
.
createTempFile
(
"errors"
,
".txt"
);
try
(
FileWriter
writer
=
new
FileWriter
(
tempFile
))
{
for
(
String
error
:
sheetError
)
{
writer
.
write
(
error
+
System
.
lineSeparator
());
}
}
byte
[]
fileContent
=
Files
.
readAllBytes
(
tempFile
.
toPath
());
MultipartFile
mockMultipartFile
=
new
MockMultipartFile
(
"errors.txt"
,
"errors.txt"
,
"text/plain"
,
fileContent
);
String
urlString
=
this
.
uploadExcelFile
(
mockMultipartFile
);
sendDownLoadExcelMsg
(
String
.
format
(
DOWNLOAD_TOPIC
,
RequestContext
.
getToken
()),
new
JSONObject
()
.
fluentPut
(
"id"
,
uuid
)
.
fluentPut
(
"status"
,
"done"
)
.
fluentPut
(
"fileName"
,
"人员导入错误文件"
)
.
fluentPut
(
"url"
,
urlString
)
.
fluentPut
(
"time"
,
new
Date
().
getTime
()));
tempFile
.
delete
();
throw
new
BadRequest
(
"校验出错,请查看错误文件!"
);
}
// 3.数据入库
dataList
.
forEach
(
data
->
{
...
...
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