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
432e521b
Commit
432e521b
authored
Mar 21, 2023
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新接口
parent
e9d81d5d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
139 additions
and
14 deletions
+139
-14
HouseholdPvExport.java
...oin/amos/boot/module/jxiop/api/dto/HouseholdPvExport.java
+54
-0
HouseholdPvMapper.java
.../amos/boot/module/jxiop/api/mapper/HouseholdPvMapper.java
+5
-1
IHouseholdPvService.java
...os/boot/module/jxiop/api/service/IHouseholdPvService.java
+2
-1
HouseholdPvMapper.xml
...jxiop-api/src/main/resources/mapper/HouseholdPvMapper.xml
+37
-2
HouseholdPvController.java
...ot/module/jxiop/biz/controller/HouseholdPvController.java
+0
-0
HouseholdPvServiceImpl.java
...module/jxiop/biz/service/impl/HouseholdPvServiceImpl.java
+41
-10
householdExport.xls
...jxiop-biz/src/main/resource/templates/householdExport.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/dto/HouseholdPvExport.java
0 → 100644
View file @
432e521b
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
api
.
dto
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.excel.annotation.write.style.ColumnWidth
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
HouseholdPvExport
{
private
Long
id
;
/**
* 基础信息
*/
private
String
platformCompanyId
;
private
String
number
;
private
String
name
;
private
String
sex
;
private
String
idNumber
;
private
String
expiryTime
;
private
String
issuingAuthority
;
private
String
residenceAddress
;
private
String
phone
;
private
String
address
;
private
String
postcode
;
private
String
serviceAddress
;
/**
* 合同信息
*/
private
String
contactNumber
;
private
String
period
;
private
String
description
;
/**
* 设备信息
*/
private
String
equipmentMessage
;
/**
* 租赁物信息
*/
private
String
installAddress
;
private
String
installDate
;
private
String
estimatedPower
;
private
String
monolithicPower
;
private
String
installCount
;
private
String
actualCapacity
;
private
String
stationType
;
private
String
moduleType
;
/**
* 安装信息
*/
private
String
installDescription
;
private
String
installStation
;
}
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/mapper/HouseholdPvMapper.java
View file @
432e521b
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.HouseholdPvDeviceDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.HouseholdPvDto
;
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.baomidou.mybatisplus.core.mapper.BaseMapper
;
...
...
@@ -16,5 +18,7 @@ import java.util.List;
*/
public
interface
HouseholdPvMapper
extends
BaseMapper
<
HouseholdPv
>
{
List
<
HouseholdPvImport
>
selectExportList
(
@Param
(
"dto"
)
HouseholdPvDto
dto
);
List
<
HouseholdPvExport
>
selectExportList
(
@Param
(
"dto"
)
HouseholdPvDto
dto
);
List
<
HouseholdPvDeviceDto
>
selectEquipList
(
@Param
(
"id"
)
Long
id
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/service/IHouseholdPvService.java
View file @
432e521b
...
...
@@ -5,6 +5,7 @@ import java.util.List;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.HouseholdPvDto
;
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
;
...
...
@@ -18,7 +19,7 @@ public interface IHouseholdPvService extends IService<HouseholdPv>{
void
importData
(
List
<
HouseholdPvImport
>
list
);
List
<
HouseholdPv
Im
port
>
selectExportList
(
HouseholdPvDto
dto
);
List
<
HouseholdPv
Ex
port
>
selectExportList
(
HouseholdPvDto
dto
);
void
deleteBatch
(
List
<
Long
>
ids
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/resources/mapper/HouseholdPvMapper.xml
View file @
432e521b
...
...
@@ -2,8 +2,40 @@
<!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.jxiop.api.mapper.HouseholdPvMapper"
>
<select
id=
"selectExportList"
resultType=
"com.yeejoin.amos.boot.module.jxiop.api.dto.HouseholdPvImport"
>
SELECT * FROM `household_pv` hp
<select
id=
"selectExportList"
resultType=
"com.yeejoin.amos.boot.module.jxiop.api.dto.HouseholdPvExport"
>
SELECT
hp.sequence_nbr as id,
hp.platform_company_id AS platformCompanyId,
hp.number,
hp.`name`,
hp.sex,
hp.ID_number AS idNumber,
hp.expiry_time AS expiryTime,
hp.issuing_authority AS issuingAuthority,
hp.residence_address AS residenceAddress,
hp.phone,
hp.address,
hp.postcode,
hp.service_address AS serviceAddress,
hpc.number AS contactNumber,
hpc.period,
hpc.description ,
hpl.install_address as installAddress,
hpl.install_date as installDate,
hpl.estimated_power as estimatedPower,
hpl.monolithic_power as monolithicPower,
hpl.actual_capacity as actualCapacity,
hpl.station_type as stationType,
hpl.module_type as moduleType,
hpl.install_count as installCount,
hpi.description as installDescription,
hpi.platform_company_id AS installStation
FROM
household_pv hp
LEFT JOIN household_pv_contact hpc on hp.sequence_nbr = hpc.household_pv_id
LEFT JOIN household_pv_lease hpl on hp.sequence_nbr = hpl.household_pv_id
LEFT JOIN household_pv_install hpi on hp.sequence_nbr = hpi.household_pv_id
<where>
<if
test=
"dto.name != null and dto.name != ''"
>
and hp.name like concat('%',#{dto.name},'%')
...
...
@@ -19,4 +51,7 @@
</if>
</where>
</select>
<select
id=
"selectEquipList"
resultType=
"com.yeejoin.amos.boot.module.jxiop.api.dto.HouseholdPvDeviceDto"
>
SELECT * from household_pv_device hpd WHERE hpd.household_pv_id = #{id}
</select>
</mapper>
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/HouseholdPvController.java
View file @
432e521b
This diff is collapsed.
Click to expand it.
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 @
432e521b
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.*
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.*
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.joda.time.LocalDateTime
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -17,11 +18,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.HouseholdPvContactDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.HouseholdPvDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.HouseholdPvImport
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.HouseholdPvInstallDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.HouseholdPvLeaseDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.HouseholdPv
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.HouseholdPvContact
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.HouseholdPvInstall
;
...
...
@@ -103,8 +99,43 @@ public class HouseholdPvServiceImpl extends BaseService<HouseholdPvDto, Househol
}
@Override
public
List
<
HouseholdPvImport
>
selectExportList
(
HouseholdPvDto
dto
)
{
return
householdPvMapper
.
selectExportList
(
dto
);
public
List
<
HouseholdPvExport
>
selectExportList
(
HouseholdPvDto
dto
)
{
List
<
HouseholdPvExport
>
householdPvExports
=
householdPvMapper
.
selectExportList
(
dto
);
householdPvExports
.
forEach
(
item
->
{
if
(!
ObjectUtils
.
isEmpty
(
item
.
getPeriod
()))
{
JSONArray
objects
=
JSON
.
parseArray
(
item
.
getPeriod
());
if
(!
ObjectUtils
.
isEmpty
(
objects
)
&&
objects
.
size
()
>=
2
)
{
item
.
setPeriod
(
objects
.
get
(
0
)
+
"-"
+
objects
.
get
(
1
));
}
}
List
<
HouseholdPvDeviceDto
>
equipList
=
householdPvMapper
.
selectEquipList
(
item
.
getId
());
if
(!
ObjectUtils
.
isEmpty
(
equipList
))
{
StringBuilder
stringBuilder
=
equipMessage
(
equipList
);
item
.
setEquipmentMessage
(
stringBuilder
.
toString
());
}
});
return
householdPvExports
;
}
private
StringBuilder
equipMessage
(
List
<
HouseholdPvDeviceDto
>
list
)
{
StringBuilder
stringBuilder
=
new
StringBuilder
();
list
.
forEach
(
item
->
{
stringBuilder
.
append
(
"类型:"
).
append
(
ObjectUtils
.
isEmpty
(
item
.
getType
())
?
""
:
item
.
getType
());
stringBuilder
.
append
(
" 名称:"
).
append
(
ObjectUtils
.
isEmpty
(
item
.
getName
())
?
""
:
item
.
getName
());
stringBuilder
.
append
(
" 品牌:"
).
append
(
ObjectUtils
.
isEmpty
(
item
.
getBrand
())
?
""
:
item
.
getBrand
());
stringBuilder
.
append
(
" SN编码:"
).
append
(
ObjectUtils
.
isEmpty
(
item
.
getSnCode
())
?
""
:
item
.
getSnCode
());
if
(!
ObjectUtils
.
isEmpty
(
item
.
getType
())
&&
item
.
getType
().
equals
(
"逆变器"
))
{
stringBuilder
.
append
(
" 序列号:"
).
append
(
ObjectUtils
.
isEmpty
(
item
.
getSerialNumber
())
?
""
:
item
.
getSerialNumber
());
stringBuilder
.
append
(
" 功率:"
).
append
(
ObjectUtils
.
isEmpty
(
item
.
getPower
())
?
""
:
item
.
getPower
());
}
if
(!
ObjectUtils
.
isEmpty
(
item
.
getType
())
&&
item
.
getType
().
equals
(
"其他"
))
{
stringBuilder
.
append
(
" 描述:"
).
append
(
ObjectUtils
.
isEmpty
(
item
.
getDescription
())
?
""
:
item
.
getDescription
());
}
stringBuilder
.
append
(
"\r\n"
);
});
return
stringBuilder
;
}
@Override
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-biz/src/main/resource/templates/householdExport.xls
0 → 100644
View file @
432e521b
File added
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