Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
one-certificate-system
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
one-certificate-system
Commits
96883dac
Commit
96883dac
authored
Jul 30, 2024
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修改
parent
d5b27230
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
254 additions
and
86 deletions
+254
-86
one-certificate-manager/src/main/java/com/mortals/xhx/module/certificate/model/vo/CertificateDocumentPdu.java
...x/module/certificate/model/vo/CertificateDocumentPdu.java
+32
-0
one-certificate-manager/src/main/java/com/mortals/xhx/module/certificate/service/CertificateDocumentService.java
...odule/certificate/service/CertificateDocumentService.java
+5
-0
one-certificate-manager/src/main/java/com/mortals/xhx/module/certificate/service/impl/CertificateDocumentServiceImpl.java
...tificate/service/impl/CertificateDocumentServiceImpl.java
+21
-1
one-certificate-manager/src/main/java/com/mortals/xhx/module/child/service/ChildLicenseService.java
...mortals/xhx/module/child/service/ChildLicenseService.java
+1
-1
one-certificate-manager/src/main/java/com/mortals/xhx/module/child/service/impl/ChildLicenseServiceImpl.java
...hx/module/child/service/impl/ChildLicenseServiceImpl.java
+67
-36
one-certificate-manager/src/main/java/com/mortals/xhx/module/record/model/vo/ApplyLogVo.java
...va/com/mortals/xhx/module/record/model/vo/ApplyLogVo.java
+5
-0
one-certificate-manager/src/main/java/com/mortals/xhx/module/record/service/impl/ApplyLogServiceImpl.java
...s/xhx/module/record/service/impl/ApplyLogServiceImpl.java
+71
-44
one-certificate-manager/src/main/java/com/mortals/xhx/module/record/web/ApplyLogController.java
...com/mortals/xhx/module/record/web/ApplyLogController.java
+52
-4
No files found.
one-certificate-manager/src/main/java/com/mortals/xhx/module/certificate/model/vo/CertificateDocumentPdu.java
0 → 100644
View file @
96883dac
package
com.mortals.xhx.module.certificate.model.vo
;
import
lombok.Data
;
@Data
public
class
CertificateDocumentPdu
{
Long
id
;
/**
* 站点id
*/
private
Long
siteId
;
/**
* 部门id
*/
private
Long
deptId
;
/**
* 部门名称
*/
private
String
deptName
;
/**
* 子证名称
*/
private
String
documentName
;
/**
* 简称
*/
private
String
shortName
;
/**
* 状态,0:禁用1:启用
*/
private
Integer
status
;
}
one-certificate-manager/src/main/java/com/mortals/xhx/module/certificate/service/CertificateDocumentService.java
View file @
96883dac
...
@@ -2,6 +2,9 @@ package com.mortals.xhx.module.certificate.service;
...
@@ -2,6 +2,9 @@ package com.mortals.xhx.module.certificate.service;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.certificate.model.CertificateDocumentEntity
;
import
com.mortals.xhx.module.certificate.model.CertificateDocumentEntity
;
import
com.mortals.xhx.module.certificate.dao.CertificateDocumentDao
;
import
com.mortals.xhx.module.certificate.dao.CertificateDocumentDao
;
import
java.util.List
;
/**
/**
* CertificateDocumentService
* CertificateDocumentService
*
*
...
@@ -13,4 +16,6 @@ import com.mortals.xhx.module.certificate.dao.CertificateDocumentDao;
...
@@ -13,4 +16,6 @@ import com.mortals.xhx.module.certificate.dao.CertificateDocumentDao;
public
interface
CertificateDocumentService
extends
ICRUDService
<
CertificateDocumentEntity
,
Long
>{
public
interface
CertificateDocumentService
extends
ICRUDService
<
CertificateDocumentEntity
,
Long
>{
CertificateDocumentDao
getDao
();
CertificateDocumentDao
getDao
();
List
<
CertificateDocumentEntity
>
getListByCatalogId
(
Long
catalogId
);
}
}
\ No newline at end of file
one-certificate-manager/src/main/java/com/mortals/xhx/module/certificate/service/impl/CertificateDocumentServiceImpl.java
View file @
96883dac
package
com.mortals.xhx.module.certificate.service.impl
;
package
com.mortals.xhx.module.certificate.service.impl
;
import
com.mortals.xhx.common.code.StatusEnum
;
import
com.mortals.xhx.module.certificate.model.CertificateChildEntity
;
import
com.mortals.xhx.module.certificate.model.CertificateChildQuery
;
import
com.mortals.xhx.module.certificate.model.CertificateDocumentQuery
;
import
com.mortals.xhx.module.certificate.service.CertificateChildService
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
java.util.List
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.exception.AppException
;
...
@@ -19,5 +29,15 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -19,5 +29,15 @@ import lombok.extern.slf4j.Slf4j;
@Service
(
"certificateDocumentService"
)
@Service
(
"certificateDocumentService"
)
@Slf4j
@Slf4j
public
class
CertificateDocumentServiceImpl
extends
AbstractCRUDServiceImpl
<
CertificateDocumentDao
,
CertificateDocumentEntity
,
Long
>
implements
CertificateDocumentService
{
public
class
CertificateDocumentServiceImpl
extends
AbstractCRUDServiceImpl
<
CertificateDocumentDao
,
CertificateDocumentEntity
,
Long
>
implements
CertificateDocumentService
{
@Autowired
private
CertificateChildService
certificateChildService
;
@Override
public
List
<
CertificateDocumentEntity
>
getListByCatalogId
(
Long
catalogId
)
{
List
<
CertificateChildEntity
>
childEntityList
=
certificateChildService
.
find
(
new
CertificateChildQuery
().
catalogId
(
catalogId
));
List
<
Long
>
documentIdList
=
childEntityList
.
stream
().
map
(
CertificateChildEntity:
:
getDocumentId
).
collect
(
Collectors
.
toList
());
List
<
CertificateDocumentEntity
>
documentEntityList
=
this
.
find
(
new
CertificateDocumentQuery
().
idList
(
documentIdList
).
status
(
StatusEnum
.
ENABLE
.
getValue
()));
return
documentEntityList
;
}
}
}
\ No newline at end of file
one-certificate-manager/src/main/java/com/mortals/xhx/module/child/service/ChildLicenseService.java
View file @
96883dac
...
@@ -18,5 +18,5 @@ public interface ChildLicenseService extends ICRUDService<ChildLicenseEntity,Lon
...
@@ -18,5 +18,5 @@ public interface ChildLicenseService extends ICRUDService<ChildLicenseEntity,Lon
ChildLicenseDao
getDao
();
ChildLicenseDao
getDao
();
int
createChildLicense
(
ApplyLogEntity
applyLogEntity
,
Context
context
)
throws
AppException
;
int
createChildLicense
(
ApplyLogEntity
applyLogEntity
,
Long
oldApplyId
,
Context
context
)
throws
AppException
;
}
}
\ No newline at end of file
one-certificate-manager/src/main/java/com/mortals/xhx/module/child/service/impl/ChildLicenseServiceImpl.java
View file @
96883dac
package
com.mortals.xhx.module.child.service.impl
;
package
com.mortals.xhx.module.child.service.impl
;
import
com.mortals.xhx.common.code.ProcessStatusEnum
;
import
com.mortals.xhx.common.code.ProcessStatusEnum
;
import
com.mortals.xhx.common.code.StatusEnum
;
import
com.mortals.xhx.module.certificate.model.CertificateChildEntity
;
import
com.mortals.xhx.module.certificate.model.CertificateChildEntity
;
import
com.mortals.xhx.module.certificate.model.CertificateChildQuery
;
import
com.mortals.xhx.module.certificate.model.CertificateChildQuery
;
import
com.mortals.xhx.module.certificate.model.CertificateDocumentEntity
;
import
com.mortals.xhx.module.certificate.model.CertificateDocumentEntity
;
import
com.mortals.xhx.module.certificate.model.CertificateDocumentQuery
;
import
com.mortals.xhx.module.certificate.model.CertificateDocumentQuery
;
import
com.mortals.xhx.module.certificate.service.CertificateChildService
;
import
com.mortals.xhx.module.certificate.service.CertificateChildService
;
import
com.mortals.xhx.module.certificate.service.CertificateDocumentService
;
import
com.mortals.xhx.module.certificate.service.CertificateDocumentService
;
import
com.mortals.xhx.module.child.model.ChildLicenseQuery
;
import
com.mortals.xhx.module.record.model.ApplyLogEntity
;
import
com.mortals.xhx.module.record.model.ApplyLogEntity
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -41,42 +41,73 @@ public class ChildLicenseServiceImpl extends AbstractCRUDServiceImpl<ChildLicens
...
@@ -41,42 +41,73 @@ public class ChildLicenseServiceImpl extends AbstractCRUDServiceImpl<ChildLicens
@Autowired
@Autowired
private
CertificateDocumentService
certificateDocumentService
;
private
CertificateDocumentService
certificateDocumentService
;
@Override
@Override
public
int
createChildLicense
(
ApplyLogEntity
applyLogEntity
,
Context
context
)
throws
AppException
{
public
int
createChildLicense
(
ApplyLogEntity
applyLogEntity
,
Long
oldId
,
Context
context
)
throws
AppException
{
int
result
=
0
;
int
result
=
0
;
if
(
applyLogEntity
.
getCatalogId
()!=
null
)
{
if
(
applyLogEntity
.
getCatalogId
()!=
null
)
{
List
<
CertificateChildEntity
>
childEntityList
=
certificateChildService
.
find
(
new
CertificateChildQuery
().
catalogId
(
applyLogEntity
.
getCatalogId
()));
Map
<
Long
,
Long
>
documentIdMap
=
new
HashMap
<>();
List
<
Long
>
documentIdList
=
childEntityList
.
stream
().
map
(
CertificateChildEntity:
:
getDocumentId
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
applyLogEntity
.
getChildCertificate
())){
List
<
CertificateDocumentEntity
>
documentEntityList
=
certificateDocumentService
.
find
(
new
CertificateDocumentQuery
().
idList
(
documentIdList
));
applyLogEntity
.
getChildCertificate
().
forEach
(
i
->{
if
(
CollectionUtils
.
isNotEmpty
(
documentEntityList
))
{
if
(
i
.
getStatus
()==
1
){
List
<
ChildLicenseEntity
>
childLicense
=
new
ArrayList
<>();
documentIdMap
.
put
(
i
.
getId
(),
i
.
getId
());
for
(
CertificateDocumentEntity
item
:
documentEntityList
)
{
}
ChildLicenseEntity
entity
=
new
ChildLicenseEntity
();
});
entity
.
initAttrValue
();
}
entity
.
setSiteId
(
applyLogEntity
.
getSiteId
());
boolean
isAdd
=
true
;
entity
.
setCatalogId
(
applyLogEntity
.
getCatalogId
());
if
(
oldId
!=
null
){
entity
.
setCatalogName
(
applyLogEntity
.
getCatalogName
());
List
<
ChildLicenseEntity
>
oldChildList
=
this
.
find
(
new
ChildLicenseQuery
().
applyId
(
oldId
));
entity
.
setApplyId
(
applyLogEntity
.
getId
());
if
(
CollectionUtils
.
isNotEmpty
(
oldChildList
)){
entity
.
setDocumentId
(
item
.
getId
());
isAdd
=
false
;
entity
.
setDocumentName
(
item
.
getDocumentName
());
}
entity
.
setDeptId
(
item
.
getDeptId
());
for
(
ChildLicenseEntity
child:
oldChildList
){
entity
.
setDeptName
(
item
.
getDeptName
());
child
.
setApplyId
(
applyLogEntity
.
getId
());
entity
.
setMarketEntityName
(
applyLogEntity
.
getEnterpriseName
());
if
(
documentIdMap
.
size
()
>
0
&&
documentIdMap
.
containsKey
(
child
.
getDocumentId
()))
{
entity
.
setLicenseCode
(
applyLogEntity
.
getCertificateCode
());
child
.
setChildStatus
(
StatusEnum
.
ENABLE
.
getValue
());
entity
.
setLegalPersonName
(
applyLogEntity
.
getLegalPerson
());
}
else
{
entity
.
setCreditCode
(
applyLogEntity
.
getSocialCode
());
child
.
setChildStatus
(
StatusEnum
.
DISABLE
.
getValue
());
entity
.
setProductLicenseTime
(
applyLogEntity
.
getIssueTime
());
}
entity
.
setCertQRCode
(
applyLogEntity
.
getQRCode
());
}
entity
.
setCertAuthority
(
applyLogEntity
.
getAuthority
());
this
.
update
(
oldChildList
);
entity
.
setBusinessPlace
(
applyLogEntity
.
getBusinessPlace
());
}
entity
.
setLicensedItems
(
applyLogEntity
.
getLicenseProject
());
if
(
isAdd
)
{
entity
.
setFormStyleContent
(
item
.
getTemplateContent
());
List
<
CertificateChildEntity
>
childEntityList
=
certificateChildService
.
find
(
new
CertificateChildQuery
().
catalogId
(
applyLogEntity
.
getCatalogId
()));
entity
.
setFormContent
(
item
.
getFormContent
());
List
<
Long
>
documentIdList
=
childEntityList
.
stream
().
map
(
CertificateChildEntity:
:
getDocumentId
).
collect
(
Collectors
.
toList
());
entity
.
setProcessStatus
(
ProcessStatusEnum
.
未处理
.
getValue
());
List
<
CertificateDocumentEntity
>
documentEntityList
=
certificateDocumentService
.
find
(
new
CertificateDocumentQuery
().
idList
(
documentIdList
).
status
(
StatusEnum
.
ENABLE
.
getValue
()));
entity
.
setCreateTime
(
applyLogEntity
.
getCreateTime
());
if
(
CollectionUtils
.
isNotEmpty
(
documentEntityList
))
{
entity
.
setCreateUserId
(
applyLogEntity
.
getCreateUserId
());
List
<
ChildLicenseEntity
>
childLicense
=
new
ArrayList
<>();
childLicense
.
add
(
entity
);
for
(
CertificateDocumentEntity
item
:
documentEntityList
)
{
ChildLicenseEntity
entity
=
new
ChildLicenseEntity
();
entity
.
initAttrValue
();
entity
.
setSiteId
(
applyLogEntity
.
getSiteId
());
entity
.
setCatalogId
(
applyLogEntity
.
getCatalogId
());
entity
.
setCatalogName
(
applyLogEntity
.
getCatalogName
());
entity
.
setApplyId
(
applyLogEntity
.
getId
());
entity
.
setDocumentId
(
item
.
getId
());
entity
.
setDocumentName
(
item
.
getDocumentName
());
entity
.
setDeptId
(
item
.
getDeptId
());
entity
.
setDeptName
(
item
.
getDeptName
());
entity
.
setMarketEntityName
(
applyLogEntity
.
getEnterpriseName
());
entity
.
setLicenseCode
(
applyLogEntity
.
getCertificateCode
());
entity
.
setLegalPersonName
(
applyLogEntity
.
getLegalPerson
());
entity
.
setCreditCode
(
applyLogEntity
.
getSocialCode
());
entity
.
setProductLicenseTime
(
applyLogEntity
.
getIssueTime
());
entity
.
setCertQRCode
(
applyLogEntity
.
getQRCode
());
entity
.
setCertAuthority
(
applyLogEntity
.
getAuthority
());
entity
.
setBusinessPlace
(
applyLogEntity
.
getBusinessPlace
());
entity
.
setLicensedItems
(
applyLogEntity
.
getLicenseProject
());
entity
.
setFormStyleContent
(
item
.
getTemplateContent
());
entity
.
setFormContent
(
item
.
getFormContent
());
entity
.
setProcessStatus
(
ProcessStatusEnum
.
未处理
.
getValue
());
entity
.
setCreateTime
(
applyLogEntity
.
getCreateTime
());
entity
.
setCreateUserId
(
applyLogEntity
.
getCreateUserId
());
if
(
documentIdMap
.
size
()
>
0
&&
documentIdMap
.
containsKey
(
item
.
getId
()))
{
entity
.
setChildStatus
(
StatusEnum
.
ENABLE
.
getValue
());
}
else
{
entity
.
setChildStatus
(
StatusEnum
.
DISABLE
.
getValue
());
}
childLicense
.
add
(
entity
);
}
this
.
dao
.
insertBatch
(
childLicense
);
}
}
this
.
dao
.
insertBatch
(
childLicense
);
}
}
}
}
return
result
;
return
result
;
...
...
one-certificate-manager/src/main/java/com/mortals/xhx/module/record/model/vo/ApplyLogVo.java
View file @
96883dac
package
com.mortals.xhx.module.record.model.vo
;
package
com.mortals.xhx.module.record.model.vo
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.xhx.module.certificate.model.CertificateDocumentEntity
;
import
com.mortals.xhx.module.certificate.model.vo.CertificateDocumentPdu
;
import
com.mortals.xhx.module.child.model.ChildLicenseEntity
;
import
com.mortals.xhx.module.child.model.ChildLicenseEntity
;
import
com.mortals.xhx.module.record.model.ApplyLogEntity
;
import
com.mortals.xhx.module.record.model.ApplyLogEntity
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -25,6 +27,9 @@ public class ApplyLogVo extends BaseEntityLong {
...
@@ -25,6 +27,9 @@ public class ApplyLogVo extends BaseEntityLong {
/** 子证信息 */
/** 子证信息 */
List
<
ChildLicenseEntity
>
childLicense
;
List
<
ChildLicenseEntity
>
childLicense
;
/** 子证联报状态 已联报数/子证总数 */
private
String
processStatus
;
private
String
processStatus
;
private
List
<
CertificateDocumentPdu
>
childCertificate
;
}
}
\ No newline at end of file
one-certificate-manager/src/main/java/com/mortals/xhx/module/record/service/impl/ApplyLogServiceImpl.java
View file @
96883dac
...
@@ -24,9 +24,11 @@ import com.mortals.xhx.base.system.user.service.UserService;
...
@@ -24,9 +24,11 @@ import com.mortals.xhx.base.system.user.service.UserService;
import
com.mortals.xhx.common.code.*
;
import
com.mortals.xhx.common.code.*
;
import
com.mortals.xhx.common.utils.*
;
import
com.mortals.xhx.common.utils.*
;
import
com.mortals.xhx.module.certificate.model.*
;
import
com.mortals.xhx.module.certificate.model.*
;
import
com.mortals.xhx.module.certificate.model.vo.CertificateDocumentPdu
;
import
com.mortals.xhx.module.certificate.pdu.ApplyLogPdu
;
import
com.mortals.xhx.module.certificate.pdu.ApplyLogPdu
;
import
com.mortals.xhx.module.certificate.service.CertificateCatalogService
;
import
com.mortals.xhx.module.certificate.service.CertificateCatalogService
;
import
com.mortals.xhx.module.certificate.service.CertificateClassifyService
;
import
com.mortals.xhx.module.certificate.service.CertificateClassifyService
;
import
com.mortals.xhx.module.certificate.service.CertificateDocumentService
;
import
com.mortals.xhx.module.child.model.ChildLicenseEntity
;
import
com.mortals.xhx.module.child.model.ChildLicenseEntity
;
import
com.mortals.xhx.module.child.model.ChildLicenseQuery
;
import
com.mortals.xhx.module.child.model.ChildLicenseQuery
;
import
com.mortals.xhx.module.child.service.ChildLicenseService
;
import
com.mortals.xhx.module.child.service.ChildLicenseService
;
...
@@ -86,8 +88,6 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
...
@@ -86,8 +88,6 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
@Autowired
@Autowired
private
UserService
userService
;
private
UserService
userService
;
@Autowired
@Autowired
private
CertificateClassifyService
certificateClassifyService
;
@Autowired
private
ChildLicenseService
childLicenseService
;
private
ChildLicenseService
childLicenseService
;
@Override
@Override
...
@@ -103,7 +103,7 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
...
@@ -103,7 +103,7 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
public
ApplyLogEntity
get
(
Long
key
,
Context
context
)
throws
AppException
{
public
ApplyLogEntity
get
(
Long
key
,
Context
context
)
throws
AppException
{
ApplyLogEntity
entity
=
this
.
dao
.
get
(
key
);
ApplyLogEntity
entity
=
this
.
dao
.
get
(
key
);
if
(
entity
!=
null
){
if
(
entity
!=
null
){
List
<
ChildLicenseEntity
>
childs
=
childLicenseService
.
find
(
new
ChildLicenseQuery
().
applyId
(
key
).
processStatus
(
ProcessStatusEnum
.
已处理
.
getValue
()));
List
<
ChildLicenseEntity
>
childs
=
childLicenseService
.
find
(
new
ChildLicenseQuery
().
applyId
(
key
).
processStatus
(
ProcessStatusEnum
.
已处理
.
getValue
())
.
childStatus
(
StatusEnum
.
ENABLE
.
getValue
())
);
entity
.
setChildLicense
(
childs
);
entity
.
setChildLicense
(
childs
);
}
}
return
entity
;
return
entity
;
...
@@ -134,46 +134,67 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
...
@@ -134,46 +134,67 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
for
(
ApplyLogEntity
entity:
list
){
for
(
ApplyLogEntity
entity:
list
){
List
<
ChildLicenseEntity
>
childLicenseList
=
childLicenseService
.
find
(
new
ChildLicenseQuery
().
applyId
(
entity
.
getId
()));
List
<
ChildLicenseEntity
>
childLicenseList
=
childLicenseService
.
find
(
new
ChildLicenseQuery
().
applyId
(
entity
.
getId
()));
if
(
CollectionUtils
.
isEmpty
(
childLicenseList
)){
// if(CollectionUtils.isEmpty(childLicenseList)){
entity
.
setProcessStatus
(
"0/0"
);
// entity.setProcessStatus("0/0");
}
else
{
// }else {
Map
<
Integer
,
List
<
ChildLicenseEntity
>>
group
=
childLicenseList
.
stream
().
collect
(
Collectors
.
groupingBy
(
x
->
x
.
getProcessStatus
()));
// Map<Integer, List<ChildLicenseEntity>> group = childLicenseList.stream().collect(Collectors.groupingBy(x -> x.getProcessStatus()));
int
pCount
=
CollectionUtils
.
isEmpty
(
group
.
get
(
1
))
?
0
:
group
.
get
(
1
).
size
();
// int pCount = CollectionUtils.isEmpty(group.get(1)) ? 0 : group.get(1).size();
entity
.
setProcessStatus
(
pCount
+
"/"
+
childLicenseList
.
size
());
// entity.setProcessStatus(pCount + "/" + childLicenseList.size());
// }
int
childSum
=
0
;
int
pCount
=
0
;
List
<
CertificateDocumentPdu
>
documentEntityList
=
new
ArrayList
<>();
for
(
ChildLicenseEntity
item:
childLicenseList
){
CertificateDocumentEntity
documentEntity
=
new
CertificateDocumentEntity
();
BeanUtils
.
copyProperties
(
item
,
documentEntity
);
documentEntity
.
setId
(
item
.
getDocumentId
());
documentEntity
.
setStatus
(
StatusEnum
.
DISABLE
.
getValue
());
if
(
item
.
getChildStatus
()==
StatusEnum
.
ENABLE
.
getValue
()){
documentEntity
.
setStatus
(
StatusEnum
.
ENABLE
.
getValue
());
childSum
++;
if
(
item
.
getProcessStatus
()==
ProcessStatusEnum
.
已处理
.
getValue
().
intValue
()){
pCount
++;
}
}
CertificateDocumentPdu
pdu
=
new
CertificateDocumentPdu
();
BeanUtils
.
copyProperties
(
documentEntity
,
pdu
);
documentEntityList
.
add
(
pdu
);
}
}
entity
.
setProcessStatus
(
pCount
+
"/"
+
childSum
);
entity
.
setChildCertificate
(
documentEntityList
);
}
}
}
}
}
}
@Override
@Override
protected
void
validData
(
ApplyLogEntity
entity
,
Context
context
)
throws
AppException
{
protected
void
validData
(
ApplyLogEntity
entity
,
Context
context
)
throws
AppException
{
if
(
StringUtils
.
isEmpty
(
entity
.
getCertificateCode
())){
//
if(StringUtils.isEmpty(entity.getCertificateCode())){
throw
new
AppException
(
"许可证编号不能为空"
);
//
throw new AppException("许可证编号不能为空");
}
//
}
if
(
entity
.
getIssueTime
()==
null
){
//
if(entity.getIssueTime()==null){
throw
new
AppException
(
"制证时间不能为空"
);
//
throw new AppException("制证时间不能为空");
}
//
}
if
(
StringUtils
.
isEmpty
(
entity
.
getLegalPerson
())){
//
if(StringUtils.isEmpty(entity.getLegalPerson())){
throw
new
AppException
(
"法定代表人不能为空"
);
//
throw new AppException("法定代表人不能为空");
}
//
}
if
(
StringUtils
.
isEmpty
(
entity
.
getBusinessPlace
())){
//
if(StringUtils.isEmpty(entity.getBusinessPlace())){
throw
new
AppException
(
"经营场所不能为空"
);
//
throw new AppException("经营场所不能为空");
}
//
}
if
(
StringUtils
.
isEmpty
(
entity
.
getAuthority
())){
//
if(StringUtils.isEmpty(entity.getAuthority())){
throw
new
AppException
(
"制证机关不能为空"
);
//
throw new AppException("制证机关不能为空");
}
//
}
if
(
StringUtils
.
isEmpty
(
entity
.
getSocialCode
())){
//
if(StringUtils.isEmpty(entity.getSocialCode())){
throw
new
AppException
(
"统一社会信用代码不能为空"
);
//
throw new AppException("统一社会信用代码不能为空");
}
//
}
if
(
StringUtils
.
isEmpty
(
entity
.
getLicenseProject
())){
//
if(StringUtils.isEmpty(entity.getLicenseProject())){
throw
new
AppException
(
"许可项目不能为空"
);
//
throw new AppException("许可项目不能为空");
}
//
}
if
(
StringUtils
.
isEmpty
(
entity
.
getEnterpriseName
())){
if
(
StringUtils
.
isEmpty
(
entity
.
getEnterpriseName
())){
throw
new
AppException
(
"市场主体名称不能为空"
);
throw
new
AppException
(
"市场主体名称不能为空"
);
}
}
if
(
StringUtils
.
isEmpty
(
entity
.
getIndustryName
())){
//
if(StringUtils.isEmpty(entity.getIndustryName())){
throw
new
AppException
(
"行业名称不能为空"
);
//
throw new AppException("行业名称不能为空");
}
//
}
if
(
entity
.
getCatalogId
()==
null
){
if
(
entity
.
getCatalogId
()==
null
){
throw
new
AppException
(
"目录ID不能为空"
);
throw
new
AppException
(
"目录ID不能为空"
);
}
}
...
@@ -183,15 +204,21 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
...
@@ -183,15 +204,21 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
private
void
createFormContent
(
ApplyLogEntity
applyLogEntity
){
private
void
createFormContent
(
ApplyLogEntity
applyLogEntity
){
JSONObject
formContentJson
=
new
JSONObject
();
JSONObject
formContentJson
=
new
JSONObject
();
formContentJson
.
put
(
"i_1_市场主体名称"
,
applyLogEntity
.
getEnterpriseName
());
formContentJson
.
put
(
"i_1_市场主体名称"
,
applyLogEntity
.
getEnterpriseName
());
formContentJson
.
put
(
"i_2_许可证编号"
,
applyLogEntity
.
getCertificateCode
());
//
formContentJson.put("i_2_许可证编号",applyLogEntity.getCertificateCode());
formContentJson
.
put
(
"i_3_统一社会信用代码"
,
applyLogEntity
.
getSocialCode
());
//
formContentJson.put("i_3_统一社会信用代码",applyLogEntity.getSocialCode());
formContentJson
.
put
(
" i_5_法定代表人(负责人)"
,
applyLogEntity
.
getLegalPerson
());
//
formContentJson.put(" i_5_法定代表人(负责人)",applyLogEntity.getLegalPerson());
formContentJson
.
put
(
"i_8_经营场所"
,
applyLogEntity
.
getBusinessPlace
());
//
formContentJson.put("i_8_经营场所",applyLogEntity.getBusinessPlace());
formContentJson
.
put
(
"i_9_行业类别"
,
applyLogEntity
.
getIndustryName
());
//
formContentJson.put("i_9_行业类别",applyLogEntity.getIndustryName());
formContentJson
.
put
(
"i_10_许可项目"
,
applyLogEntity
.
getLicenseProject
());
//
formContentJson.put("i_10_许可项目",applyLogEntity.getLicenseProject());
formContentJson
.
put
(
"i_11_制证日期"
,
DateUtils
.
getStrDate
(
applyLogEntity
.
getIssueTime
()));
//
formContentJson.put("i_11_制证日期", DateUtils.getStrDate(applyLogEntity.getIssueTime()));
formContentJson
.
put
(
"i_14_制证机关"
,
applyLogEntity
.
getAuthority
());
//
formContentJson.put("i_14_制证机关",applyLogEntity.getAuthority());
formContentJson
.
put
(
"@qrcode_1_二维码"
,
applyLogEntity
.
getSocialCode
());
formContentJson
.
put
(
"@qrcode_1_二维码"
,
applyLogEntity
.
getSocialCode
());
if
(
CollectionUtils
.
isNotEmpty
(
applyLogEntity
.
getChildCertificate
())){
for
(
int
i
=
0
;
i
<
applyLogEntity
.
getChildCertificate
().
size
();
i
++){
int
index
=
i
+
1
;
formContentJson
.
put
(
"i_"
+
index
+
"_子证"
,
applyLogEntity
.
getChildCertificate
().
get
(
i
).
getShortName
());
}
}
applyLogEntity
.
setFormContent
(
formContentJson
.
toJSONString
());
applyLogEntity
.
setFormContent
(
formContentJson
.
toJSONString
());
}
}
...
@@ -280,7 +307,7 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
...
@@ -280,7 +307,7 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
printWaitQueueService
.
remove
(
condition
,
context
);
printWaitQueueService
.
remove
(
condition
,
context
);
}
}
//插入子证联报
//插入子证联报
childLicenseService
.
createChildLicense
(
applyLogEntity
,
context
);
childLicenseService
.
createChildLicense
(
applyLogEntity
,
oldId
,
context
);
printWaitQueueService
.
creatWaitQueueByApply
(
applyLogEntity
,
GenerateStatus
.
ORIGINAL
.
getValue
(),
context
);
printWaitQueueService
.
creatWaitQueueByApply
(
applyLogEntity
,
GenerateStatus
.
ORIGINAL
.
getValue
(),
context
);
applyLogEntity
.
setFormContent
(
null
);
applyLogEntity
.
setFormContent
(
null
);
applyLogEntity
.
setFormTemplate
(
null
);
applyLogEntity
.
setFormTemplate
(
null
);
...
@@ -379,7 +406,7 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
...
@@ -379,7 +406,7 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
printWaitQueueService
.
remove
(
condition
,
context
);
printWaitQueueService
.
remove
(
condition
,
context
);
}
}
//插入子证联报
//插入子证联报
childLicenseService
.
createChildLicense
(
applyLogEntity
,
context
);
childLicenseService
.
createChildLicense
(
applyLogEntity
,
oldId
,
context
);
printWaitQueueService
.
creatWaitQueueByApply
(
applyLogEntity
,
GenerateStatus
.
ORIGINAL
.
getValue
(),
context
);
printWaitQueueService
.
creatWaitQueueByApply
(
applyLogEntity
,
GenerateStatus
.
ORIGINAL
.
getValue
(),
context
);
}
}
...
@@ -639,7 +666,7 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
...
@@ -639,7 +666,7 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
public
ApplyLogEntity
getBySocialCode
(
String
socialCode
)
throws
AppException
{
public
ApplyLogEntity
getBySocialCode
(
String
socialCode
)
throws
AppException
{
ApplyLogEntity
entity
=
this
.
selectOne
(
new
ApplyLogQuery
().
socialCode
(
socialCode
));
ApplyLogEntity
entity
=
this
.
selectOne
(
new
ApplyLogQuery
().
socialCode
(
socialCode
));
if
(
entity
!=
null
){
if
(
entity
!=
null
){
List
<
ChildLicenseEntity
>
childs
=
childLicenseService
.
find
(
new
ChildLicenseQuery
().
applyId
(
entity
.
getId
()).
processStatus
(
ProcessStatusEnum
.
已处理
.
getValue
()));
List
<
ChildLicenseEntity
>
childs
=
childLicenseService
.
find
(
new
ChildLicenseQuery
().
applyId
(
entity
.
getId
()).
processStatus
(
ProcessStatusEnum
.
已处理
.
getValue
())
.
childStatus
(
StatusEnum
.
ENABLE
.
getValue
())
);
entity
.
setChildLicense
(
childs
);
entity
.
setChildLicense
(
childs
);
}
}
return
entity
;
return
entity
;
...
...
one-certificate-manager/src/main/java/com/mortals/xhx/module/record/web/ApplyLogController.java
View file @
96883dac
...
@@ -2,6 +2,8 @@ package com.mortals.xhx.module.record.web;
...
@@ -2,6 +2,8 @@ package com.mortals.xhx.module.record.web;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.common.IBaseEnum
;
import
com.mortals.framework.common.IBaseEnum
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.BaseEntity
;
import
com.mortals.framework.utils.ReflectUtils
;
import
com.mortals.framework.utils.ReflectUtils
;
import
com.mortals.framework.utils.poi.ExcelUtil
;
import
com.mortals.framework.utils.poi.ExcelUtil
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
...
@@ -10,7 +12,12 @@ import com.mortals.xhx.base.system.upload.service.UploadService;
...
@@ -10,7 +12,12 @@ import com.mortals.xhx.base.system.upload.service.UploadService;
import
com.mortals.xhx.common.code.*
;
import
com.mortals.xhx.common.code.*
;
import
com.mortals.xhx.common.utils.ImportExcelUtil
;
import
com.mortals.xhx.common.utils.ImportExcelUtil
;
import
com.mortals.xhx.common.utils.ReadExcelPictureUtil
;
import
com.mortals.xhx.common.utils.ReadExcelPictureUtil
;
import
com.mortals.xhx.module.certificate.model.CertificateDocumentEntity
;
import
com.mortals.xhx.module.certificate.model.CertificateDocumentQuery
;
import
com.mortals.xhx.module.certificate.model.vo.CertificateDocumentPdu
;
import
com.mortals.xhx.module.certificate.service.CertificateDocumentService
;
import
org.apache.poi.ss.usermodel.PictureData
;
import
org.apache.poi.ss.usermodel.PictureData
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
...
@@ -25,12 +32,10 @@ import com.mortals.xhx.module.record.model.ApplyLogEntity;
...
@@ -25,12 +32,10 @@ import com.mortals.xhx.module.record.model.ApplyLogEntity;
import
com.mortals.xhx.module.record.service.ApplyLogService
;
import
com.mortals.xhx.module.record.service.ApplyLogService
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.framework.util.StringUtils
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.*
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
java.util.Arrays
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
static
com
.
mortals
.
framework
.
ap
.
SysConstains
.*;
import
static
com
.
mortals
.
framework
.
ap
.
SysConstains
.*;
...
@@ -48,6 +53,9 @@ public class ApplyLogController extends BaseCRUDJsonBodyMappingController<ApplyL
...
@@ -48,6 +53,9 @@ public class ApplyLogController extends BaseCRUDJsonBodyMappingController<ApplyL
@Value
(
"${upload.path}"
)
@Value
(
"${upload.path}"
)
private
String
filePath
;
private
String
filePath
;
@Autowired
private
CertificateDocumentService
certificateDocumentService
;
public
ApplyLogController
(){
public
ApplyLogController
(){
super
.
setModuleDesc
(
"证照申请"
);
super
.
setModuleDesc
(
"证照申请"
);
}
}
...
@@ -196,4 +204,44 @@ public class ApplyLogController extends BaseCRUDJsonBodyMappingController<ApplyL
...
@@ -196,4 +204,44 @@ public class ApplyLogController extends BaseCRUDJsonBodyMappingController<ApplyL
return
ret
.
toJSONString
();
return
ret
.
toJSONString
();
}
}
}
}
@PostMapping
(
value
=
"addInit"
)
@UnAuth
public
String
add
(
@RequestBody
ApplyLogEntity
params
)
{
Map
<
String
,
Object
>
model
=
new
HashMap
();
int
code
=
1
;
Context
context
=
this
.
getContext
();
String
busiDesc
=
"打开新增"
+
this
.
getModuleDesc
()
+
"页面"
;
try
{
this
.
addBefore
(
model
);
ApplyLogEntity
entity
=
new
ApplyLogEntity
();
entity
.
initAttrValue
();
List
<
CertificateDocumentEntity
>
certificateDocumentEntityList
=
certificateDocumentService
.
getListByCatalogId
(
params
.
getCatalogId
());
List
<
CertificateDocumentPdu
>
documentEntityList
=
new
ArrayList
<>();
for
(
CertificateDocumentEntity
item:
certificateDocumentEntityList
){
CertificateDocumentPdu
pdu
=
new
CertificateDocumentPdu
();
BeanUtils
.
copyProperties
(
item
,
pdu
);
documentEntityList
.
add
(
pdu
);
}
entity
.
setChildCertificate
(
documentEntityList
);
model
.
put
(
"entity"
,
entity
);
this
.
addAfter
(
model
);
if
(!
ObjectUtils
.
isEmpty
(
context
)
&&
!
ObjectUtils
.
isEmpty
(
context
.
getUser
()))
{
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】"
);
}
}
catch
(
Exception
var7
)
{
code
=
-
1
;
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
var7
);
}
this
.
init
(
model
,
context
);
JSONObject
ret
=
new
JSONObject
();
ret
.
put
(
"code"
,
Integer
.
valueOf
(
code
));
ret
.
put
(
"msg"
,
model
.
remove
(
"message_info"
));
ret
.
put
(
"data"
,
model
);
return
ret
.
toJSONString
();
}
}
}
\ No newline at end of file
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