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
23f61eb6
Commit
23f61eb6
authored
Mar 23, 2023
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
a240e2a2
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
46 additions
and
55 deletions
+46
-55
IHouseholdPvDistrictService.java
...module/jxiop/api/service/IHouseholdPvDistrictService.java
+2
-0
HouseholdPvMapper.xml
...jxiop-api/src/main/resources/mapper/HouseholdPvMapper.xml
+1
-1
HouseholdPvController.java
...ot/module/jxiop/biz/controller/HouseholdPvController.java
+3
-40
HouseholdPvDeviceController.java
...ule/jxiop/biz/controller/HouseholdPvDeviceController.java
+12
-11
HouseholdPvDistrictController.java
...e/jxiop/biz/controller/HouseholdPvDistrictController.java
+8
-0
HouseholdPvDeviceServiceImpl.java
.../jxiop/biz/service/impl/HouseholdPvDeviceServiceImpl.java
+13
-2
HouseholdPvDistrictServiceImpl.java
...xiop/biz/service/impl/HouseholdPvDistrictServiceImpl.java
+6
-0
HouseholdPvServiceImpl.java
...module/jxiop/biz/service/impl/HouseholdPvServiceImpl.java
+1
-1
householdTemplates.xls
...p-biz/src/main/resources/templates/householdTemplates.xls
+0
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/service/IHouseholdPvDistrictService.java
View file @
23f61eb6
...
...
@@ -17,6 +17,8 @@ public interface IHouseholdPvDistrictService extends IService<HouseholdPvDistric
List
<
CompanyTreeDto
>
getTree
();
List
<
CompanyTreeDto
>
getBusinessTree
();
HouseholdPvDistrict
treeAdd
(
Long
parentId
,
String
name
);
HouseholdPvDistrict
treeUpdate
(
Long
id
,
String
name
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/resources/mapper/HouseholdPvMapper.xml
View file @
23f61eb6
...
...
@@ -67,7 +67,7 @@
and hp.name like concat('%',#{dto.name},'%')
</if>
<if
test=
"dto.residenceAddress != null and dto.residenceAddress != ''"
>
and hp.residence_address like concat('%',#{residenceAddress},'%')
and hp.residence_address like concat('%',#{
dto.
residenceAddress},'%')
</if>
<if
test=
"dto.number != null and dto.number != ''"
>
and hp.number like concat('%',#{dto.number},'%')
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/HouseholdPvController.java
View file @
23f61eb6
...
...
@@ -10,6 +10,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.dto.HouseholdPvExport;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.HouseholdPvImport
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.HouseholdPv
;
import
com.yeejoin.amos.boot.module.jxiop.api.service.IHouseholdPvService
;
import
com.yeejoin.amos.boot.module.jxiop.api.util.FileUtil
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.HouseholdPvServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -140,43 +141,7 @@ public class HouseholdPvController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"模板下载"
,
notes
=
"模板下载"
)
public
void
exportTemplates
(
HttpServletResponse
response
)
{
DataInputStream
in
=
null
;
OutputStream
out
=
null
;
try
{
response
.
reset
();
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setHeader
(
"content-Type"
,
"application/vnd.ms-excel"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
URLEncoder
.
encode
(
"模板.xlsx"
,
"UTF-8"
));
response
.
setHeader
(
"Access-Control-Expose-Headers"
,
"Content-Disposition"
);
FileInputStream
fileInputStream
=
new
FileInputStream
(
new
File
(
"amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/resource/templates/householdTemplates.xls"
));
in
=
new
DataInputStream
(
fileInputStream
);
out
=
response
.
getOutputStream
();
int
bytes
=
0
;
byte
[]
bufferOut
=
new
byte
[
1024
];
while
((
bytes
=
in
.
read
(
bufferOut
))
!=
-
1
)
{
out
.
write
(
bufferOut
,
0
,
bytes
);
}
out
.
close
();
in
.
close
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
response
.
reset
();
}
finally
{
try
{
if
(
out
!=
null
)
{
out
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
try
{
if
(
in
!=
null
)
{
in
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
FileUtil
.
downloadResource
(
"户用光伏导入模板.xlsx"
,
"templates/householdTemplates.xls"
,
response
);
}
...
...
@@ -204,11 +169,9 @@ public class HouseholdPvController extends BaseController {
InputStream
is
=
cpr
.
getInputStream
();
Workbook
workbook
=
new
XSSFWorkbook
(
is
);
Sheet
sheet
=
workbook
.
getSheetAt
(
0
);
//这里作为演示,造几个演示数据,模拟数据库里查数据
List
<
HouseholdPvExport
>
list
=
iHouseholdPvService
.
selectExportList
(
dto
,
dto
.
getIds
());
//基础信息
list
.
forEach
(
item
->
{
//
当前获取最后一行
//
获取当前插入数据行号
int
lastRowNum
=
sheet
.
getLastRowNum
()
+
1
;
Row
row
=
sheet
.
createRow
((
short
)
(
lastRowNum
));
row
.
createCell
(
0
).
setCellValue
(
ObjectUtils
.
isEmpty
(
item
.
getPlatformCompanyId
())
?
""
:
item
.
getPlatformCompanyId
());
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/HouseholdPvDeviceController.java
View file @
23f61eb6
...
...
@@ -5,6 +5,8 @@ import java.util.List;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.HouseholdPvDevice
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -81,10 +83,9 @@ public class HouseholdPvDeviceController extends BaseController {
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/
{sequenceNbr}
"
)
@DeleteMapping
(
value
=
"/
removeMessage
"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除户用光伏设备表"
,
notes
=
"根据sequenceNbr删除户用光伏设备表"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
@RequestParam
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
householdPvDeviceServiceImpl
.
removeById
(
sequenceNbr
));
}
...
...
@@ -111,12 +112,12 @@ public class HouseholdPvDeviceController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"户用光伏设备表分页查询"
,
notes
=
"户用光伏设备表分页查询"
)
public
ResponseModel
<
Page
<
HouseholdPvDeviceDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
HouseholdPvDevice
Dto
>
page
=
new
Page
<
HouseholdPvDeviceDto
>();
public
ResponseModel
<
IPage
<
HouseholdPvDevice
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
"objId"
)
Long
objId
)
{
Page
<
HouseholdPvDevice
>
page
=
new
Page
<
HouseholdPvDevice
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
householdPvDeviceServiceImpl
.
queryForHouseholdPvDevicePage
(
page
));
return
ResponseHelper
.
buildResponse
(
householdPvDeviceServiceImpl
.
queryForHouseholdPvDevicePage
(
page
,
objId
));
}
/**
...
...
@@ -138,15 +139,15 @@ public class HouseholdPvDeviceController extends BaseController {
householdPvDeviceServiceImpl
.
exportTemplates
(
response
);
}
@
Ge
tMapping
(
value
=
"/import"
)
@
Pos
tMapping
(
value
=
"/import"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"
GE
T"
,
value
=
"导入"
,
notes
=
"导入"
)
@ApiOperation
(
httpMethod
=
"
POS
T"
,
value
=
"导入"
,
notes
=
"导入"
)
public
ResponseModel
<
Object
>
importData
(
@RequestPart
(
"file"
)
MultipartFile
multipartFile
,
@RequestParam
(
value
=
"householdPvId"
,
required
=
true
)
lo
ng
householdPvId
)
{
@RequestParam
(
value
=
"householdPvId"
,
required
=
true
)
Stri
ng
householdPvId
)
{
List
<
HouseholdPvDeviceImport
>
list
;
try
{
list
=
ExcelUtil
.
readFirstSheetExcel
(
multipartFile
,
HouseholdPvDeviceImport
.
class
,
2
);
householdPvDeviceServiceImpl
.
importData
(
list
,
householdPvId
);
householdPvDeviceServiceImpl
.
importData
(
list
,
Long
.
parseLong
(
householdPvId
)
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/HouseholdPvDistrictController.java
View file @
23f61eb6
...
...
@@ -127,6 +127,14 @@ public class HouseholdPvDistrictController extends BaseController {
return
ResponseHelper
.
buildResponse
(
householdPvDistrictService
.
getTree
());
}
@GetMapping
(
value
=
"/getBusinessTree"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"厂站树"
,
notes
=
"厂站树"
)
public
ResponseModel
<
Object
>
getBusinessTree
()
{
return
ResponseHelper
.
buildResponse
(
householdPvDistrictService
.
getBusinessTree
());
}
/**
* 树节点新增
*
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/HouseholdPvDeviceServiceImpl.java
View file @
23f61eb6
...
...
@@ -5,7 +5,11 @@ import java.util.List;
import
javax.servlet.http.HttpServletResponse
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
...
...
@@ -27,11 +31,18 @@ import com.yeejoin.amos.boot.module.jxiop.api.service.IHouseholdPvDeviceService;
public
class
HouseholdPvDeviceServiceImpl
extends
BaseService
<
HouseholdPvDeviceDto
,
HouseholdPvDevice
,
HouseholdPvDeviceMapper
>
implements
IHouseholdPvDeviceService
{
@Autowired
HouseholdPvDeviceMapper
householdPvDeviceMapper
;
/**
* 分页查询
*/
public
Page
<
HouseholdPvDeviceDto
>
queryForHouseholdPvDevicePage
(
Page
<
HouseholdPvDeviceDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
public
IPage
<
HouseholdPvDevice
>
queryForHouseholdPvDevicePage
(
Page
<
HouseholdPvDevice
>
page
,
Long
objId
)
{
LambdaQueryWrapper
<
HouseholdPvDevice
>
lambda
=
new
QueryWrapper
<
HouseholdPvDevice
>().
lambda
();
lambda
.
eq
(
HouseholdPvDevice
::
getHouseholdPvId
,
objId
);
lambda
.
orderByDesc
(
HouseholdPvDevice:
:
getRecDate
);
return
householdPvDeviceMapper
.
selectPage
(
page
,
lambda
);
}
/**
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/HouseholdPvDistrictServiceImpl.java
View file @
23f61eb6
...
...
@@ -120,6 +120,12 @@ public class HouseholdPvDistrictServiceImpl extends BaseService<HouseholdPvDistr
return
list
.
stream
().
filter
(
a
->
list
.
stream
().
noneMatch
(
c
->
c
.
getId
().
equals
(
a
.
getParentId
()))).
peek
(
b
->
b
.
setChildren
(
getCompanyBuildingChildrenTree
(
b
.
getId
(),
list
))).
collect
(
Collectors
.
toList
());
}
@Override
public
List
<
CompanyTreeDto
>
getBusinessTree
()
{
List
<
CompanyTreeDto
>
list
=
householdPvDistrictMapper
.
getList
();
return
list
.
stream
().
filter
(
a
->
list
.
stream
().
noneMatch
(
c
->
c
.
getId
().
equals
(
a
.
getParentId
()))).
peek
(
b
->
b
.
setChildren
(
getCompanyBuildingChildrenTree
(
b
.
getId
(),
list
))).
collect
(
Collectors
.
toList
());
}
private
void
change
(
Collection
<
UserOrgTreeModel
>
data
,
List
<
CompanyTreeDto
>
result
)
{
data
.
forEach
(
item
->
{
CompanyTreeDto
dto
=
new
CompanyTreeDto
();
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/HouseholdPvServiceImpl.java
View file @
23f61eb6
...
...
@@ -251,7 +251,7 @@ public class HouseholdPvServiceImpl extends BaseService<HouseholdPvDto, Househol
HouseholdPvLease
householdPvLease
=
new
HouseholdPvLease
();
BeanUtils
.
copyProperties
(
householdPvDto
.
getLeaseInfo
(),
householdPvLease
);
householdPv
Contact
.
setHouseholdPvId
(
householdPv
.
getSequenceNbr
());
householdPv
Lease
.
setHouseholdPvId
(
householdPv
.
getSequenceNbr
());
iHouseholdPvLeaseService
.
save
(
householdPvLease
);
HouseholdPvInstall
householdPvInstall
=
new
HouseholdPvInstall
();
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/resources/templates/householdTemplates.xls
View file @
23f61eb6
No preview for this file type
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