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
bb4a0a6d
Commit
bb4a0a6d
authored
Jun 05, 2024
by
韩桐桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(cyl):删除多余方法
parent
f1d62639
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
66 deletions
+25
-66
CylinderTagsDataUnitDto.java
.../module/cylinder/flc/api/dto/CylinderTagsDataUnitDto.java
+4
-1
CylinderTagsDataUnit.java
.../module/cylinder/flc/api/entity/CylinderTagsDataUnit.java
+7
-1
CylinderInfoMapper.java
...ot/module/cylinder/flc/api/mapper/CylinderInfoMapper.java
+0
-3
CylinderInfoMapper.xml
...nder-api/src/main/resources/mapper/CylinderInfoMapper.xml
+0
-16
CylinderInfoController.java
...e/cylinder/flc/biz/controller/CylinderInfoController.java
+0
-10
CylinderInfoServiceImpl.java
...ylinder/flc/biz/service/impl/CylinderInfoServiceImpl.java
+14
-35
No files found.
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-api/src/main/java/com/yeejoin/amos/boot/module/cylinder/flc/api/dto/CylinderTagsDataUnitDto.java
View file @
bb4a0a6d
...
...
@@ -21,9 +21,12 @@ public class CylinderTagsDataUnitDto extends BaseDto {
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"气瓶标签比"
)
@ApiModelProperty
(
value
=
"气瓶标签比
(气瓶数量/标签数量)
"
)
private
String
tagPercent
;
@ApiModelProperty
(
value
=
"标签气瓶比(标签数量/气瓶数量,当一个气瓶含有电子标签,二维码标签等多个标签时,标签/气瓶最大比为100%)"
)
private
String
cylinderPercent
;
@ApiModelProperty
(
value
=
"气瓶数量"
)
private
Long
cylinderSum
;
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-api/src/main/java/com/yeejoin/amos/boot/module/cylinder/flc/api/entity/CylinderTagsDataUnit.java
View file @
bb4a0a6d
...
...
@@ -23,12 +23,18 @@ public class CylinderTagsDataUnit extends BaseEntity {
private
static
final
long
serialVersionUID
=
1L
;
/**
* 气瓶标签比
* 气瓶标签比
(气瓶数量/标签数量)
*/
@TableField
(
"tag_percent"
)
private
String
tagPercent
;
/**
* 标签气瓶比(标签数量/气瓶数量,当一个气瓶含有电子标签,二维码标签等多个标签时,标签/气瓶最大比为100%)
*/
@TableField
(
"cylinder_percent"
)
private
String
cylinderPercent
;
/**
* 气瓶数量
*/
@TableField
(
"cylinder_sum"
)
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-api/src/main/java/com/yeejoin/amos/boot/module/cylinder/flc/api/mapper/CylinderInfoMapper.java
View file @
bb4a0a6d
...
...
@@ -112,9 +112,6 @@ public interface CylinderInfoMapper extends BaseMapper<CylinderInfo> {
int
countNumber
(
@Param
(
"status"
)
String
status
,
@Param
(
"companyId"
)
String
companyId
,
@Param
(
"regionCode"
)
String
regionCode
);
Map
<
String
,
Object
>
countFillingTimesAndQuantityByCompany
(
@Param
(
"companyId"
)
String
companyId
,
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"endTime"
)
String
endTime
);
List
<
CylinderInfoDto
>
queryCylinderOfInspectionOverdue
(
@Param
(
"questionType"
)
String
questionType
);
List
<
CylinderInfoDto
>
queryCylinderOfUnqualifiedQuestion
(
@Param
(
"questionType"
)
String
questionType
);
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-api/src/main/resources/mapper/CylinderInfoMapper.xml
View file @
bb4a0a6d
...
...
@@ -392,22 +392,6 @@
</where>
</select>
<select
id=
"countFillingTimesAndQuantityByCompany"
resultType=
"java.util.Map"
>
SELECT COUNT(1) AS fillingTimes, ifnull(SUM(filling_quantity),0) AS fillingQuantity
FROM tz_cylinder_filling_record AS tcfr
<where>
tcfr."filling_endtime"
<![CDATA[>=]]>
(CURRENT_DATE - INTERVAL '31 days')
<if
test=
"companyId != null and companyId != ''"
>
AND tcfr."app_id" = #{companyId}
</if>
<if
test=
"startTime != null"
>
AND DATE_FORMAT(tcfr."filling_starttime",'%Y-%m-%d')
<![CDATA[>=]]>
#{startTime}
</if>
<if
test=
"endTime != null"
>
AND DATE_FORMAT(tcfr."filling_endtime",'%Y-%m-%d')
<![CDATA[<=]]>
#{endTime}
</if>
</where>
</select>
<select
id=
"countFillingTimesAndQuantityByCity"
resultType=
"java.util.Map"
>
SELECT regionCode AS regionCode,
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-biz/src/main/java/com/yeejoin/amos/boot/module/cylinder/flc/biz/controller/CylinderInfoController.java
View file @
bb4a0a6d
...
...
@@ -1350,16 +1350,6 @@ public class CylinderInfoController extends BaseController {
return
ResponseHelper
.
buildResponse
(
result
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"某个企业充装次数及累计充装量统计"
)
@GetMapping
(
value
=
"/countFillingTimesAndQuantityByCompany"
)
public
ResponseModel
<
JSONObject
>
countFillingTimesAndQuantityByCompany
(
@RequestParam
(
value
=
"companyId"
)
String
companyId
,
@RequestParam
(
value
=
"startTime"
,
required
=
false
)
String
startTime
,
@RequestParam
(
value
=
"endTime"
,
required
=
false
)
String
endTime
)
{
return
ResponseHelper
.
buildResponse
(
cylinderInfoServiceImpl
.
countFillingTimesAndQuantityByCompany
(
companyId
,
startTime
,
endTime
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"市级为维度,各市的充装次数和累计充装量,当前日期向前推31天的数据总和"
)
@GetMapping
(
value
=
"/countFillingTimesAndQuantityByCity"
)
...
...
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-biz/src/main/java/com/yeejoin/amos/boot/module/cylinder/flc/biz/service/impl/CylinderInfoServiceImpl.java
View file @
bb4a0a6d
...
...
@@ -603,19 +603,27 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
.
count
(
new
LambdaQueryWrapper
<
CylinderInfo
>().
eq
(
CylinderInfo:
:
getAppId
,
cylinderUnit
.
getAppId
()));
int
tags
=
cylinderTagsServiceImpl
.
count
(
new
LambdaQueryWrapper
<
CylinderTags
>().
eq
(
CylinderTags:
:
getAppId
,
cylinderUnit
.
getAppId
()));
String
percent
=
""
;
String
tagPercent
=
""
;
String
cylinderPercent
=
""
;
if
(
tags
!=
0
)
{
double
zz
=
(
double
)
cylinder
/
(
double
)
tags
;
double
tagPercentDouble
=
(
double
)
cylinder
/
(
double
)
tags
;
DecimalFormat
df
=
new
DecimalFormat
(
"##.00%"
);
if
(
Math
.
abs
(
zz
)
<
0.0000000000001
)
{
p
ercent
=
"0.00%"
;
if
(
Math
.
abs
(
tagPercentDouble
)
<
0.0000000000001
)
{
tagP
ercent
=
"0.00%"
;
}
else
{
percent
=
df
.
format
(
zz
);
tagPercent
=
df
.
format
(
tagPercentDouble
);
}
double
cylinderPercentDouble
=
(
double
)
tags
/
(
double
)
cylinder
;
if
(
Math
.
abs
(
cylinderPercentDouble
)
<
0.0000000000001
)
{
cylinderPercent
=
"0.00%"
;
}
else
{
cylinderPercent
=
Math
.
abs
(
cylinderPercentDouble
)
>
1
?
"100%"
:
df
.
format
(
cylinderPercentDouble
);
}
}
temp
.
setCylinderSum
((
long
)
cylinder
);
temp
.
setTagsSum
((
long
)
tags
);
temp
.
setTagPercent
(
percent
);
temp
.
setTagPercent
(
tagPercent
);
temp
.
setCylinderPercent
(
cylinderPercent
);
cylinderTagsDataUnitServiceImpl
.
createWithModel
(
temp
);
});
}
...
...
@@ -1283,35 +1291,6 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
return
cylinderInfoMapper
.
cyinderOutInfoList
(
page
,
cylinderInfoDto
,
sort
,
appids
);
}
public
JSONObject
countFillingTimesAndQuantityByCompany
(
String
companyId
,
String
startTime
,
String
endTime
)
{
Map
<
String
,
Object
>
stringObjectMap
=
cylinderInfoMapper
.
countFillingTimesAndQuantityByCompany
(
companyId
,
startTime
,
endTime
);
// 组装成柱状图能渲染的格式
//{
// "seriesData": [
// {
// "data": [
// 3
// ],
// "name": "充装次数(次)"
// },
// {
// "data": [
// 1
// ],
// "name": "累计充装量(kg)"
// }
// ],
// "axisData": [
// "总数"
// ]
// }
String
template
=
"{\"seriesData\": [{\"data\": [%s],\"name\": \"充装次数(次)\"},{\"data\": [%s],\"name\": \"累计充装量(kg)\"}],\"axisData\": [\"总数\"]}"
;
String
format
=
String
.
format
(
template
,
ObjectUtils
.
isEmpty
(
stringObjectMap
.
get
(
"fillingTimes"
))
?
0
:
stringObjectMap
.
get
(
"fillingTimes"
),
ObjectUtils
.
isEmpty
(
stringObjectMap
.
get
(
FILLING_QUANTITY
))
?
0
:
stringObjectMap
.
get
(
FILLING_QUANTITY
));
return
JSON
.
parseObject
(
format
);
}
public
Map
<
String
,
Object
>
countFillingTimesAndQuantityByCity
()
{
// 查询所有的市级城市
List
<
RegionModel
>
regionModelList
=
Systemctl
.
regionClient
.
queryByLevel
(
"2"
).
getResult
();
...
...
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