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
61d035e8
Commit
61d035e8
authored
Jul 05, 2024
by
hezhuozhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去除重复的农户编号
parent
a438487a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
PeasantHouseholdServiceImpl.java
...le/hygf/biz/service/impl/PeasantHouseholdServiceImpl.java
+7
-1
No files found.
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 @
61d035e8
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.RandomUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
...
@@ -763,7 +764,12 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
if
(
da
.
getRegionalAddress
()==
null
||
da
.
getRegionalAddress
().
isEmpty
()){
throw
new
BadRequest
(
"区域公司省市区为空, 请设置省市区"
);
}
String
code
=
NumberUtil
.
getCode
(
CodeEnum
.
农户
.
getCode
(),
da
.
getCompanyCode
(),
da
.
getRegionalAddress
());
//为了去重,暂时这样处理加两位随机数,同时在查询一次
String
code
=
NumberUtil
.
getCode
(
CodeEnum
.
农户
.
getCode
(),
da
.
getCompanyCode
(),
da
.
getRegionalAddress
())+
RandomUtil
.
randomNumbers
(
2
);
Integer
count
=
peasantHouseholdMapper
.
selectCount
(
new
LambdaQueryWrapper
<
PeasantHousehold
>().
eq
(
PeasantHousehold:
:
getPeasantHouseholdNo
,
code
));
if
(
count
>
0
){
code
=
NumberUtil
.
getCode
(
CodeEnum
.
农户
.
getCode
(),
da
.
getCompanyCode
(),
da
.
getRegionalAddress
())+
RandomUtil
.
randomNumbers
(
2
);
}
return
code
;
}
...
...
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