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
1166d133
Commit
1166d133
authored
Jul 01, 2024
by
chenzhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
3e416f24
365ecc03
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
101 additions
and
1 deletion
+101
-1
PeasantHousehold.java
...in/amos/boot/module/hygf/api/entity/PeasantHousehold.java
+6
-0
PeasantHouseholdMapper.java
...s/boot/module/hygf/api/mapper/PeasantHouseholdMapper.java
+9
-0
IPeasantHouseholdService.java
...oot/module/hygf/api/service/IPeasantHouseholdService.java
+2
-0
PeasantHouseholdMapper.xml
...rc/main/resources/mapper/mysql/PeasantHouseholdMapper.xml
+31
-0
PeasantHouseholdController.java
...odule/hygf/biz/controller/PeasantHouseholdController.java
+12
-1
PeasantHouseholdServiceImpl.java
...le/hygf/biz/service/impl/PeasantHouseholdServiceImpl.java
+41
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/entity/PeasantHousehold.java
View file @
1166d133
...
...
@@ -203,4 +203,10 @@ public class PeasantHousehold extends BaseEntity {
@TableField
(
exist
=
false
,
typeHandler
=
FastjsonTypeHandler
.
class
)
private
List
<
String
>
projectAddressText
;
/**
* 当前农户下所有的合同是否已废弃, 1(全部已废弃), 0(未全部废弃)
*/
@TableField
(
exist
=
false
)
private
Integer
isAllRevoke
;
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/mapper/PeasantHouseholdMapper.java
View file @
1166d133
...
...
@@ -35,4 +35,13 @@ public interface PeasantHouseholdMapper extends BaseMapper<PeasantHousehold> {
List
<
Map
<
String
,
Object
>>
selectUserIsHouse
(
String
telephone
);
Integer
selectIsAllRevoke
(
String
amosUserId
);
void
deleteHphByUserId
(
String
userId
);
void
deletePauByUserId
(
String
userId
);
void
deleteAliByUserId
(
String
userId
);
void
deleteHhcByUserId
(
String
userId
);
Integer
selectSurveyOrNot
(
String
sequenceNbr
);
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/service/IPeasantHouseholdService.java
View file @
1166d133
...
...
@@ -16,4 +16,6 @@ public interface IPeasantHouseholdService {
List
<
PeasantHousehold
>
getInfoByIds
(
String
ids
);
Boolean
deleteUser
(
String
sequenceNbr
,
String
userId
);
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/PeasantHouseholdMapper.xml
View file @
1166d133
...
...
@@ -77,4 +77,35 @@ and hygf_document_station.station_id is not null
`user`.MOBILE = #{telephone}
</select>
<select
id=
"selectSurveyOrNot"
resultType=
"Integer"
>
select survey_or_not from hygf_peasant_household where sequence_nbr = #{sequenceNbr}
</select>
<select
id=
"selectIsAllRevoke"
resultType=
"Integer"
>
SELECT
count(*) = ( SELECT count(*) FROM hygf_household_contract WHERE project_user_id = #{amosUserId} and initiate_status = '已发起' AND STATUS = '已作废' )
FROM
hygf_household_contract
WHERE
project_user_id = #{amosUserId} and initiate_status = '已发起'
</select>
<select
id=
"deleteHphByUserId"
>
DELETE FROM hygf_peasant_household WHERE amos_user_id=#{userId}
</select>
<select
id=
"deletePauByUserId"
>
DELETE FROM privilege_agency_user WHERE USER_ID=#{userId}
</select>
<select
id=
"deleteAliByUserId"
>
DELETE FROM auth_login_info WHERE USER_ID=#{userId}
</select>
<select
id=
"deleteHhcByUserId"
>
DELETE FROM hygf_household_contract WHERE project_user_id=#{userId}
</select>
</mapper>
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/PeasantHouseholdController.java
View file @
1166d133
...
...
@@ -279,5 +279,16 @@ public class PeasantHouseholdController extends BaseController {
}
/**
* 根据sequenceNbr和userId删除用户信息
* sequenceNbr 唯一标识
* @param userId 用户id
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/{sequenceNbr}/{userId}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据userId删除用户信息和合同"
,
notes
=
"根据userId删除用户信息和合同"
)
public
ResponseModel
<
Boolean
>
deleteUser
(
@PathVariable
String
sequenceNbr
,
@PathVariable
String
userId
)
{
return
ResponseHelper
.
buildResponse
(
peasantHouseholdServiceImpl
.
deleteUser
(
sequenceNbr
,
userId
));
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/PeasantHouseholdServiceImpl.java
View file @
1166d133
...
...
@@ -244,6 +244,10 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
List
<
PeasantHousehold
>
newRecords
=
records
.
stream
().
map
(
item
->
{
// 查询该条数据能否被删除, 0不能删除, 1可以删除
item
.
setIsAllRevoke
(
peasantHouseholdMapper
.
selectIsAllRevoke
(
item
.
getAmosUserId
()));
if
(
item
.
getSurveyOrNot
()
!=
null
){
if
(
item
.
getSurveyOrNot
()
==
0
)
{
item
.
setSurveyOrNotText
(
"待勘察"
);
...
...
@@ -790,4 +794,40 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
return
peasantHouseholds
;
}
@Override
public
Boolean
deleteUser
(
String
sequenceNbr
,
String
userId
)
{
try
{
// 根据sequenceNbr获取农户勘察状态
Integer
surveyOrNot
=
peasantHouseholdMapper
.
selectSurveyOrNot
(
sequenceNbr
);
if
(
surveyOrNot
!=
0
)
{
throw
new
BadRequest
(
"该用户已勘察, 不允许删除!"
);
}
// 查询该条数据能否被删除, 0不能删除, 1可以删除
Integer
isAllRevok
=
peasantHouseholdMapper
.
selectIsAllRevoke
(
userId
);
if
(
isAllRevok
!=
1
)
{
throw
new
BadRequest
(
"该用户有未完成的任务, 不允许删除!"
);
}
// 删除hygf_peasant_household表中数据
peasantHouseholdMapper
.
deleteHphByUserId
(
userId
);
// 删除privilege_agency_user表中数据
peasantHouseholdMapper
.
deletePauByUserId
(
userId
);
// 删除auth_login_info表中数据
peasantHouseholdMapper
.
deleteAliByUserId
(
userId
);
// 删除hygf_household_contract表中数据
peasantHouseholdMapper
.
deleteHhcByUserId
(
userId
);
return
true
;
}
catch
(
Exception
e
)
{
throw
new
BadRequest
(
"删除失败!"
);
}
}
}
\ 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