Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
f5571fe2
Commit
f5571fe2
authored
Sep 19, 2024
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
质押关系
parent
e952c5db
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
249 additions
and
31 deletions
+249
-31
DropDown.java
...a/com/yeejoin/amos/boot/module/hygf/api/dto/DropDown.java
+3
-0
FinancingInfoDto.java
...ejoin/amos/boot/module/hygf/api/dto/FinancingInfoDto.java
+3
-0
FinancingRegionalDto.java
...n/amos/boot/module/hygf/api/dto/FinancingRegionalDto.java
+3
-0
FinancingInfo.java
...ejoin/amos/boot/module/hygf/api/entity/FinancingInfo.java
+3
-0
FinancingRegional.java
...n/amos/boot/module/hygf/api/entity/FinancingRegional.java
+6
-0
FinancingInfoMapper.java
...amos/boot/module/hygf/api/mapper/FinancingInfoMapper.java
+4
-0
FinancingRegionalMapper.java
.../boot/module/hygf/api/mapper/FinancingRegionalMapper.java
+6
-0
JpStationMapper.java
...oin/amos/boot/module/hygf/api/mapper/JpStationMapper.java
+4
-1
FinancingInfoMapper.xml
...i/src/main/resources/mapper/mysql/FinancingInfoMapper.xml
+30
-0
FinancingRegionalMapper.xml
...c/main/resources/mapper/mysql/FinancingRegionalMapper.xml
+4
-0
JpStationMapper.xml
...f-api/src/main/resources/mapper/mysql/JpStationMapper.xml
+13
-4
FinancingInfoController.java
...t/module/hygf/biz/controller/FinancingInfoController.java
+7
-0
FinancingRegionalController.java
...dule/hygf/biz/controller/FinancingRegionalController.java
+19
-10
JpStationController.java
.../boot/module/hygf/biz/controller/JpStationController.java
+23
-4
FinancingInfoServiceImpl.java
...odule/hygf/biz/service/impl/FinancingInfoServiceImpl.java
+26
-1
FinancingRegionalServiceImpl.java
...e/hygf/biz/service/impl/FinancingRegionalServiceImpl.java
+95
-11
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/dto/DropDown.java
View file @
f5571fe2
...
...
@@ -19,4 +19,7 @@ public class DropDown {
@ApiModelProperty
(
value
=
"单位名称+单位id"
)
private
String
text
;
@ApiModelProperty
(
value
=
"单位名称+单位id"
)
private
String
id
;
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/dto/FinancingInfoDto.java
View file @
f5571fe2
...
...
@@ -39,6 +39,9 @@ public class FinancingInfoDto extends BaseDto {
@ApiModelProperty
(
value
=
"农户id"
)
private
Long
peasantHouseholdId
;
@ApiModelProperty
(
value
=
"区域公司Id"
)
private
Long
regionalCompaniesSeq
;
@ApiModelProperty
(
value
=
"放款时间"
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd"
)
private
Date
disbursementTime
;
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/dto/FinancingRegionalDto.java
View file @
f5571fe2
...
...
@@ -28,6 +28,9 @@ public class FinancingRegionalDto extends BaseDto {
@ApiModelProperty
(
value
=
"区域公司名称"
)
private
String
regionalCompaniesSeq
;
@ApiModelProperty
(
value
=
"区域公司名称"
)
private
String
regionalCompaniesCode
;
@ApiModelProperty
(
value
=
"融资机构id"
)
private
String
financingId
;
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/entity/FinancingInfo.java
View file @
f5571fe2
...
...
@@ -46,6 +46,9 @@ public class FinancingInfo extends BaseEntity {
@TableField
(
"peasant_household_id"
)
private
Long
peasantHouseholdId
;
@TableField
(
"regional_companies_seq"
)
private
Long
regionalCompaniesSeq
;
/**
* 放款时间
*/
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/entity/FinancingRegional.java
View file @
f5571fe2
...
...
@@ -35,6 +35,12 @@ public class FinancingRegional extends BaseEntity {
private
String
regionalCompaniesSeq
;
/**
* 区域公司code
*/
@TableField
(
"regional_companies_code"
)
private
String
regionalCompaniesCode
;
/**
* 融资机构id
*/
@TableField
(
"financing_id"
)
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/mapper/FinancingInfoMapper.java
View file @
f5571fe2
...
...
@@ -24,8 +24,12 @@ public interface FinancingInfoMapper extends BaseMapper<FinancingInfo> {
List
<
Map
<
String
,
Object
>>
selectOrgList
();
List
<
Map
<
String
,
Object
>>
orgListByqyid
(
@Param
(
"ids"
)
List
<
String
>
ids
);
Map
<
String
,
Object
>
selectRZOrgInfo
(
Long
id
);
List
<
Map
<
String
,
Object
>>
selectCompany
(
@Param
(
"ids"
)
List
<
String
>
ids
);
List
<
Map
<
String
,
Object
>>
selectRegion
();
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/mapper/FinancingRegionalMapper.java
View file @
f5571fe2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.FinancingRegional
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
java.util.List
;
/**
* 融资机构区域公司绑定表 Mapper 接口
*
...
...
@@ -11,4 +14,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public
interface
FinancingRegionalMapper
extends
BaseMapper
<
FinancingRegional
>
{
@UserEmpower
(
field
={
"regional_companies_code"
}
,
dealerField
={
"regional_companies_code"
},
fieldConditions
={
"in"
,
"in"
}
,
relationship
=
"and"
,
specific
=
false
)
List
<
FinancingRegional
>
queryDataForPage
();
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/mapper/JpStationMapper.java
View file @
f5571fe2
...
...
@@ -37,7 +37,10 @@ public interface JpStationMapper extends BaseMapper<JpStation> {
List
<
JpStation
>
getJpStationList
(
@Param
(
"dto"
)
JpStationDto
reviewDto
);
@UserEmpower
(
field
={
"ORG_CODE"
}
,
dealerField
={
"ORG_CODE"
},
fieldConditions
={
"in"
,
"in"
}
,
relationship
=
"and"
,
specific
=
false
)
List
<
DropDown
>
getRegion
(
String
regionName
,
String
province
);
List
<
DropDown
>
getRegion
(
String
regionName
);
@UserEmpower
(
field
={
"ORG_CODE"
}
,
dealerField
={
"ORG_CODE"
},
fieldConditions
={
"in"
,
"in"
}
,
relationship
=
"and"
,
specific
=
false
)
List
<
DropDown
>
getRegionByProvince
(
String
province
);
List
<
DropDown
>
getRegionAll
();
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/FinancingInfoMapper.xml
View file @
f5571fe2
...
...
@@ -67,6 +67,23 @@
</select>
<select
id=
"orgListByqyid"
resultType=
"java.util.Map"
>
select
*
from
privilege_company
where
PARENT_ID = (select SEQUENCE_NBR from privilege_company where COMPANY_NAME = '融资机构')
<if
test=
"ids != null and ids.size()>0"
>
and SEQUENCE_NBR in
<foreach
collection=
"ids"
separator=
","
open=
"("
close=
")"
item=
"item"
>
#{item}
</foreach>
</if>
</select>
<select
id=
"selectRZOrgInfo"
resultType=
"java.util.Map"
>
select
*
...
...
@@ -76,6 +93,19 @@
SEQUENCE_NBR=#{id}
</select>
<select
id=
"selectCompany"
resultType=
"java.util.Map"
>
select
*
from
privilege_company
<where>
SEQUENCE_NBR in
<foreach
collection=
"ids"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</where>
</select>
<select
id=
"selectRegion"
resultType=
"java.util.Map"
>
select
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/FinancingRegionalMapper.xml
View file @
f5571fe2
...
...
@@ -2,4 +2,8 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.hygf.api.mapper.FinancingRegionalMapper"
>
<select
id=
"queryDataForPage"
resultType=
"com.yeejoin.amos.boot.module.hygf.api.entity.FinancingRegional"
>
select * from hygf_financing_regional
</select>
</mapper>
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/JpStationMapper.xml
View file @
f5571fe2
...
...
@@ -242,17 +242,26 @@
<select
id=
"getRegion"
resultType=
"com.yeejoin.amos.boot.module.hygf.api.dto.DropDown"
>
SELECT privilege_company.ORG_CODE orgCode,
privilege_company.COMPANY_NAME name,
CONCAT_WS('_',privilege_company.COMPANY_NAME,privilege_company.SEQUENCE_NBR) as text
privilege_company.COMPANY_NAME name
FROM privilege_company
WHERE IS_DELETED = 0
and privilege_company.COMPANY_TYPE = 'region'
<if
test=
"regionName!=null and regionName!=''"
>
and privilege_company.COMPANY_NAME like concat('%',#{regionName}, '%')
</if>
</select>
<select
id=
"getRegionByProvince"
resultType=
"com.yeejoin.amos.boot.module.hygf.api.dto.DropDown"
>
SELECT privilege_company.ORG_CODE orgCode,
privilege_company.COMPANY_NAME name,
CONCAT_WS('_',privilege_company.COMPANY_NAME,privilege_company.SEQUENCE_NBR,privilege_company.ORG_CODE) as text,
privilege_company.SEQUENCE_NBR as id
FROM privilege_company
WHERE IS_DELETED = 0
and privilege_company.COMPANY_TYPE = 'region'
<if
test=
"province!=null and province!=''"
>
and privilege_company.ADDRESS like concat('%',#{province}, '%')
</if>
and privilege_company.ADDRESS like concat('%',#{province}, '%')
</if>
</select>
<select
id=
"getRegionAll"
resultType=
"com.yeejoin.amos.boot.module.hygf.api.dto.DropDown"
>
SELECT privilege_company.ORG_CODE orgCode,
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/FinancingInfoController.java
View file @
f5571fe2
...
...
@@ -211,4 +211,11 @@ public class FinancingInfoController extends BaseController {
return
CommonResponseNewUtil
.
success
(
financingInfoServiceImpl
.
selectOrgList
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"融资机构列表根据区域公司Id过滤"
,
notes
=
"orgListByqyid"
)
@GetMapping
(
value
=
"/orgListByqyid"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
orgListByqyid
(
@RequestParam
(
value
=
"code"
)
String
code
)
{
return
CommonResponseNewUtil
.
success
(
financingInfoServiceImpl
.
orgListByqyid
(
code
));
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/FinancingRegionalController.java
View file @
f5571fe2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
controller
;
import
com.yeejoin.amos.boot.module.hygf.api.config.UserLimits
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.FinancingRegional
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.Arrays
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.FinancingRegionalServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
...
...
@@ -55,9 +59,9 @@ public class FinancingRegionalController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新融资机构区域公司绑定表"
,
notes
=
"根据sequenceNbr更新融资机构区域公司绑定表"
)
public
ResponseModel
<
FinancingRegionalDto
>
updateBySequenceNbrFinancingRegional
(
@RequestBody
FinancingRegionalDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
financingRegionalServiceImpl
.
updateWithModel
(
model
)
);
public
ResponseModel
<
FinancingRegionalDto
>
updateBySequenceNbrFinancingRegional
(
@RequestBody
FinancingRegionalDto
model
)
{
financingRegionalServiceImpl
.
updateModel
(
model
);
return
ResponseHelper
.
buildResponse
(
null
);
}
/**
...
...
@@ -70,7 +74,10 @@ public class FinancingRegionalController extends BaseController {
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除融资机构区域公司绑定表"
,
notes
=
"根据sequenceNbr删除融资机构区域公司绑定表"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
){
return
ResponseHelper
.
buildResponse
(
financingRegionalServiceImpl
.
removeById
(
sequenceNbr
));
financingRegionalServiceImpl
.
removeModel
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
null
);
}
/**
...
...
@@ -83,7 +90,10 @@ public class FinancingRegionalController extends BaseController {
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个融资机构区域公司绑定表"
,
notes
=
"根据sequenceNbr查询单个融资机构区域公司绑定表"
)
public
ResponseModel
<
FinancingRegionalDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
financingRegionalServiceImpl
.
queryBySeq
(
sequenceNbr
));
FinancingRegionalDto
financingRegionalDto
=
financingRegionalServiceImpl
.
queryBySeq
(
sequenceNbr
);
financingRegionalDto
.
setFinancing
(
Arrays
.
asList
(
financingRegionalDto
.
getFinancingId
().
split
(
","
)));
financingRegionalDto
.
setRegionalCompanies
(
Arrays
.
asList
(
financingRegionalDto
.
getRegionalCompaniesSeq
().
split
(
","
)));
return
ResponseHelper
.
buildResponse
(
financingRegionalDto
);
}
/**
...
...
@@ -96,12 +106,11 @@ public class FinancingRegionalController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"融资机构区域公司绑定表分页查询"
,
notes
=
"融资机构区域公司绑定表分页查询"
)
public
ResponseModel
<
Page
<
FinancingRegionalDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
@UserLimits
public
ResponseModel
<
Page
<
FinancingRegional
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
FinancingRegionalDto
>
page
=
new
Page
<
FinancingRegionalDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
financingRegionalServiceImpl
.
queryForFinancingRegionalPage
(
page
));
return
ResponseHelper
.
buildResponse
(
financingRegionalServiceImpl
.
queryForFinancingRegionalPage
(
current
,
size
));
}
/**
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/JpStationController.java
View file @
f5571fe2
...
...
@@ -423,15 +423,34 @@ public class JpStationController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询当前登录人权限区域公司"
,
notes
=
"查询当前登录人权限区域公司"
)
@GetMapping
(
value
=
"/getRegion"
)
@UserLimits
public
ResponseModel
<
List
<
Map
<
String
,
String
>>>
getRegion
(
@RequestParam
(
required
=
false
)
String
regionName
,
String
province
)
{
public
ResponseModel
<
List
<
Map
<
String
,
String
>>>
getRegion
(
@RequestParam
(
required
=
false
)
String
regionName
)
{
List
<
DropDown
>
list
=
jpStationMapper
.
getRegion
(
regionName
,
province
);
List
<
DropDown
>
list
=
jpStationMapper
.
getRegion
(
regionName
);
List
<
Map
<
String
,
String
>>
result
=
new
ArrayList
<>();
list
.
forEach
(
dropDown
->
{
Map
<
String
,
String
>
item
=
new
HashMap
<>();
item
.
put
(
"text"
,
dropDown
.
getName
());
item
.
put
(
"value"
,
dropDown
.
getOrgCode
());
result
.
add
(
item
);
});
return
ResponseHelper
.
buildResponse
(
result
);
}
//查询当前登录人权限区域公司
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询当前登录人权限区域公司"
,
notes
=
"查询当前登录人权限区域公司"
)
@GetMapping
(
value
=
"/getRegionByProvince"
)
@UserLimits
public
ResponseModel
<
List
<
Map
<
String
,
String
>>>
getRegionByProvince
(
String
province
)
{
List
<
DropDown
>
list
=
jpStationMapper
.
getRegionByProvince
(
province
);
List
<
Map
<
String
,
String
>>
result
=
new
ArrayList
<>();
list
.
forEach
(
dropDown
->
{
Map
<
String
,
String
>
item
=
new
HashMap
<>();
item
.
put
(
"text"
,
dropDown
.
getName
());
item
.
put
(
"value"
,
dropDown
.
getOrgCode
());
item
.
put
(
"values"
,
dropDown
.
getText
());
item
.
put
(
"id"
,
dropDown
.
getId
());
result
.
add
(
item
);
});
...
...
@@ -850,9 +869,9 @@ public class JpStationController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询当前登录人权限区域公司统计数据"
,
notes
=
"查询当前登录人权限区域公司统计数据"
)
@GetMapping
(
value
=
"/getRegionStatistics"
)
@UserLimits
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getRegionStatistics
(
@RequestParam
(
required
=
false
)
String
regionName
,
@RequestParam
(
required
=
false
)
String
province
)
{
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
getRegionStatistics
(
@RequestParam
(
required
=
false
)
String
regionName
)
{
// 获取区域公司列表
List
<
DropDown
>
regionlist
=
jpStationMapper
.
getRegion
(
regionName
,
province
);
List
<
DropDown
>
regionlist
=
jpStationMapper
.
getRegion
(
regionName
);
List
<
Map
<
String
,
Object
>>
result
=
new
ArrayList
<>();
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/FinancingInfoServiceImpl.java
View file @
f5571fe2
...
...
@@ -63,6 +63,8 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
@Autowired
private
WorkFlowService
workFlowService
;
@Autowired
private
PeasantHouseholdServiceImpl
peasantHouseholdService
;
@Autowired
private
WorkflowImpl
workflow
;
@Autowired
private
FinancingAuditingServiceImpl
financingAuditingService
;
...
...
@@ -78,7 +80,8 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
private
AcceptanceCheckServiceImpl
acceptanceCheckService
;
@Autowired
private
AcceptanceCheckAuditingServiceImpl
acceptanceCheckAuditingService
;
@Autowired
private
FinancingRegionalServiceImpl
financingRegionalService
;
@Resource
(
type
=
RedisLockUtil
.
class
)
private
RedisLockUtil
redisLockUtil
;
...
...
@@ -163,12 +166,18 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
queryWrapper
.
eq
(
FinancingInfo:
:
getPeasantHouseholdId
,
Long
.
valueOf
(
e
));
FinancingInfo
financingInfos
=
this
.
getBaseMapper
().
selectOne
(
queryWrapper
);
if
(
ObjectUtils
.
isEmpty
(
financingInfos
))
{
LambdaQueryWrapper
<
PeasantHousehold
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
BaseEntity:
:
getSequenceNbr
,
e
);
PeasantHousehold
peasantHousehold
=
peasantHouseholdService
.
getBaseMapper
().
selectOne
(
query
);
model
.
setStatus
(
FinancingAuditEnum
.
待融资审核
.
getName
());
model
.
setPeasantHouseholdId
(
Long
.
valueOf
(
e
));
FinancingInfoDto
financingInfoDto
=
new
FinancingInfoDto
();
BeanUtils
.
copyProperties
(
model
,
financingInfoDto
);
financingInfoDto
.
setSequenceNbr
(
null
);
financingInfoDto
.
setBatchNo
(
batcvNo
);
financingInfoDto
.
setRegionalCompaniesSeq
(
peasantHousehold
.
getRegionalCompaniesSeq
());
this
.
createWithModel
(
financingInfoDto
);
//开启工作流 并执行一步
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
...
...
@@ -459,4 +468,19 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
});
}
public
Object
orgListByqyid
(
String
peasantHouseholdId
)
{
LambdaQueryWrapper
<
PeasantHousehold
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
BaseEntity:
:
getSequenceNbr
,
peasantHouseholdId
);
PeasantHousehold
peasantHousehold
=
peasantHouseholdService
.
getBaseMapper
().
selectOne
(
query
);
LambdaQueryWrapper
<
FinancingRegional
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
FinancingRegional:
:
getRegionalCompaniesSeq
,
peasantHousehold
.
getRegionalCompaniesSeq
());
FinancingRegional
financingRegional
=
financingRegionalService
.
getBaseMapper
().
selectOne
(
wrapper
);
List
<
String
>
ids
=
Arrays
.
asList
(
financingRegional
.
getFinancingId
().
split
(
","
));
return
this
.
getBaseMapper
().
orgListByqyid
(
ids
);
}
}
\ No newline at end of file
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/FinancingRegionalServiceImpl.java
View file @
f5571fe2
...
...
@@ -3,18 +3,26 @@ package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.ObjectUtils
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.FinancingInfo
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.FinancingRegional
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.FinancingRegionalMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.service.IFinancingRegionalService
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.FinancingRegionalDto
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* 融资机构区域公司绑定表服务实现类
...
...
@@ -24,11 +32,23 @@ import java.util.List;
*/
@Service
public
class
FinancingRegionalServiceImpl
extends
BaseService
<
FinancingRegionalDto
,
FinancingRegional
,
FinancingRegionalMapper
>
implements
IFinancingRegionalService
{
@Autowired
private
FinancingInfoServiceImpl
financingInfoService
;
/**
* 分页查询
*/
public
Page
<
FinancingRegionalDto
>
queryForFinancingRegionalPage
(
Page
<
FinancingRegionalDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
public
Page
<
FinancingRegional
>
queryForFinancingRegionalPage
(
int
current
,
int
size
)
{
Page
<
FinancingRegional
>
page
=
new
Page
<>();
PageHelper
.
startPage
(
current
,
size
);
List
<
FinancingRegional
>
list
=
this
.
getBaseMapper
().
queryDataForPage
();
PageInfo
<
FinancingRegional
>
pageInfo
=
new
PageInfo
<>(
list
);
page
.
setSize
(
pageInfo
.
getSize
());
page
.
setCurrent
(
pageInfo
.
getPageNum
());
page
.
setTotal
(
pageInfo
.
getTotal
());
page
.
setRecords
(
list
);
return
page
;
}
/**
...
...
@@ -39,29 +59,44 @@ public class FinancingRegionalServiceImpl extends BaseService<FinancingRegionalD
}
public
void
saveModel
(
FinancingRegionalDto
model
)
{
List
<
String
>
ids
=
new
ArrayList
<>();
List
<
String
>
exitNames
=
new
ArrayList
<>();
List
<
String
>
names
=
new
ArrayList
<>();
List
<
String
>
exitNames
=
new
ArrayList
<>();
ids
.
addAll
(
model
.
getFinancing
());
ids
.
addAll
(
model
.
getRegionalCompanies
());
List
<
FinancingRegional
>
models
=
new
ArrayList
<>();
model
.
getFinancing
().
forEach
(
e
->{
ids
.
add
(
e
.
split
(
"_"
)[
1
]);
names
.
add
(
e
.
split
(
"_"
)[
0
]);
List
<
Map
<
String
,
Object
>>
orgInfo
=
financingInfoService
.
getBaseMapper
().
selectCompany
(
ids
);
model
.
getFinancing
().
forEach
(
f
->{
List
<
Map
<
String
,
Object
>>
map
=
orgInfo
.
stream
().
filter
(
b
->
String
.
valueOf
(
b
.
get
(
"SEQUENCE_NBR"
))
.
equals
(
f
)).
collect
(
Collectors
.
toList
());
map
.
forEach
(
a
->{
names
.
add
(
a
.
get
(
"COMPANY_NAME"
).
toString
());
});
});
model
.
getRegionalCompanies
().
forEach
(
e
->{
FinancingRegional
financingRegional
=
new
FinancingRegional
();
financingRegional
.
setFinancingId
(
String
.
join
(
","
,
ids
));
financingRegional
.
setFinancingId
(
String
.
join
(
","
,
String
.
join
(
","
,
model
.
getFinancing
())
));
financingRegional
.
setFinancingName
(
String
.
join
(
","
,
names
));
orgInfo
.
stream
().
filter
(
b
->
String
.
valueOf
(
b
.
get
(
"SEQUENCE_NBR"
)).
equals
(
e
)).
forEach
(
a
->{
financingRegional
.
setRegionalCompaniesSeq
(
String
.
valueOf
(
a
.
get
(
"SEQUENCE_NBR"
)));
financingRegional
.
setRegionalCompaniesName
(
a
.
get
(
"COMPANY_NAME"
).
toString
());
financingRegional
.
setRegionalCompaniesCode
(
a
.
get
(
"ORG_CODE"
).
toString
());
});
LambdaQueryWrapper
<
FinancingRegional
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
FinancingRegional:
:
getRegionalCompaniesSeq
,
e
.
split
(
"_"
)[
1
]
);
wrapper
.
eq
(
FinancingRegional:
:
getRegionalCompaniesSeq
,
e
);
wrapper
.
eq
(
BaseEntity:
:
getIsDelete
,
0
);
List
<
FinancingRegional
>
financingRegionals
=
this
.
getBaseMapper
().
selectList
(
wrapper
);
if
(
CollectionUtil
.
isNotEmpty
(
financingRegionals
)){
exitNames
.
add
(
e
.
split
(
"_"
)[
0
]
);
exitNames
.
add
(
financingRegional
.
getRegionalCompaniesName
()
);
}
financingRegional
.
set
RegionalCompaniesSeq
(
e
.
split
(
"_"
)[
1
]
);
financingRegional
.
setRegionalCompaniesName
(
e
.
split
(
"_"
)[
0
]);
financingRegional
.
set
Province
(
model
.
getProvince
()
);
models
.
add
(
financingRegional
);
});
if
(
CollectionUtil
.
isNotEmpty
(
exitNames
))
{
...
...
@@ -69,4 +104,52 @@ public class FinancingRegionalServiceImpl extends BaseService<FinancingRegionalD
}
this
.
saveBatch
(
models
);
}
public
void
removeModel
(
Long
sequenceNbr
)
{
FinancingRegionalDto
financingRegionalDto
=
this
.
queryBySeq
(
sequenceNbr
);
LambdaQueryWrapper
<
FinancingInfo
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
FinancingInfo:
:
getRegionalCompaniesSeq
,
financingRegionalDto
.
getRegionalCompaniesSeq
());
wrapper
.
ne
(
FinancingInfo:
:
getStatus
,
"放款完成"
);
List
<
FinancingInfo
>
financingInfos
=
financingInfoService
.
getBaseMapper
().
selectList
(
wrapper
);
if
(
CollectionUtil
.
isNotEmpty
(
financingInfos
)){
throw
new
BadRequest
(
"该区域公司存在正在进行中的投融业务,不可删除"
);
}
this
.
removeById
(
sequenceNbr
);
}
public
void
updateModel
(
FinancingRegionalDto
model
)
{
FinancingRegionalDto
financingRegionalDto
=
this
.
queryBySeq
(
model
.
getSequenceNbr
());
List
<
String
>
ids
=
new
ArrayList
<>();
List
<
String
>
names
=
new
ArrayList
<>();
ids
.
addAll
(
model
.
getFinancing
());
List
<
Map
<
String
,
Object
>>
orgInfo
=
financingInfoService
.
getBaseMapper
().
selectCompany
(
ids
);
model
.
getFinancing
().
forEach
(
f
->{
orgInfo
.
stream
().
filter
(
b
->
String
.
valueOf
(
b
.
get
(
"SEQUENCE_NBR"
)).
equals
(
f
)).
forEach
(
a
->{
names
.
add
(
a
.
get
(
"COMPANY_NAME"
).
toString
());
});
});
List
<
String
>
oldIds
=
new
ArrayList
<>(
Arrays
.
asList
(
financingRegionalDto
.
getFinancingId
().
split
(
","
)));
oldIds
.
removeAll
(
ids
);
if
(
CollectionUtil
.
isNotEmpty
(
oldIds
)){
oldIds
.
forEach
(
e
->{
LambdaQueryWrapper
<
FinancingInfo
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
FinancingInfo:
:
getRegionalCompaniesSeq
,
financingRegionalDto
.
getRegionalCompaniesSeq
());
wrapper
.
eq
(
FinancingInfo:
:
getFinancingCompaniesSeq
,
e
);
wrapper
.
ne
(
FinancingInfo:
:
getStatus
,
"放款完成"
);
List
<
FinancingInfo
>
financingInfos
=
financingInfoService
.
getBaseMapper
().
selectList
(
wrapper
);
if
(
CollectionUtil
.
isNotEmpty
(
financingInfos
)){
throw
new
BadRequest
(
"无法解绑投融业务进行中的融资机构"
);
}
});
}
model
.
setFinancingId
(
String
.
join
(
","
,
model
.
getFinancing
()));
model
.
setFinancingName
(
String
.
join
(
","
,
names
));
this
.
updateWithModel
(
model
);
}
}
\ 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