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
5c1fe114
Commit
5c1fe114
authored
Aug 03, 2023
by
lisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化地图上气瓶加载接口
parent
8a3c0c23
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
19 deletions
+47
-19
CylinderUnitMapper.java
...ot/module/cylinder/flc/api/mapper/CylinderUnitMapper.java
+5
-0
CylinderUnitMapper.xml
...nder-api/src/main/resources/mapper/CylinderUnitMapper.xml
+16
-0
CylinderUnitController.java
...e/cylinder/flc/biz/controller/CylinderUnitController.java
+20
-19
CylinderUnitServiceImpl.java
...ylinder/flc/biz/service/impl/CylinderUnitServiceImpl.java
+6
-0
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/mapper/CylinderUnitMapper.java
View file @
5c1fe114
package
com
.
yeejoin
.
amos
.
boot
.
module
.
cylinder
.
flc
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitDto
;
import
com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderUnit
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 气瓶企业信息 Mapper 接口
*
...
...
@@ -43,4 +46,6 @@ public interface CylinderUnitMapper extends BaseMapper<CylinderUnit> {
Integer
getLicenseOutOfDate
(
String
creditCode
);
Integer
getThisMonthUnitTotalByRegionCode
(
String
regionCode
);
List
<
CylinderUnitDto
>
getMessage
(
@Param
(
"regionCode"
)
String
regionCode
);
}
amos-boot-system-tzs/amos-boot-module-cylinder/amos-boot-module-cylinder-api/src/main/resources/mapper/CylinderUnitMapper.xml
View file @
5c1fe114
...
...
@@ -31,4 +31,20 @@
<select
id=
"getThisMonthUnitTotalByRegionCode"
resultType=
"java.lang.Integer"
>
select count(sequence_nbr) from tz_cylinder_unit where date_format(sync_date ,'yyyy-mm') LIKE date_format ( NOW( ) ,'yyyy-mm') and region_code like CONCAT('%',#{regionCode},'%')
</select>
<select
id=
"getMessage"
resultType=
"com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitDto"
>
SELECT tcu.*,
CASE
WHEN (SELECT COUNT(1)
FROM tz_cylinder_inspection ins
WHERE ins.app_id = tcu.app_id
and TO_DAYS(ins.next_inspection_date) - TO_DAYS(NOW())
<
= 30) > 0 THEN
1
WHEN (SELECT COUNT(1) FROM view_unit_outofdate v WHERE v.credit_code = tcu.credit_code) > 0 THEN
1
ELSE 0
END AS outOfDate
FROM tz_cylinder_unit tcu
WHERE tcu.region_code like concat('%', #{regionCode}, '%')
</select>
</mapper>
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/CylinderUnitController.java
View file @
5c1fe114
...
...
@@ -53,25 +53,26 @@ public class CylinderUnitController extends BaseController {
@RequestMapping
(
value
=
"/queryCylinderUnitList"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"通过regionCode查询气瓶企业"
,
notes
=
"通过regionCode查询气瓶企业"
)
public
ResponseModel
<
List
<
CylinderUnitDto
>>
querySpecialEquipmentList
(
@RequestParam
String
regionCode
)
{
List
<
CylinderUnit
>
unitList
=
cylinderUnitServiceImpl
.
list
(
new
LambdaQueryWrapper
<
CylinderUnit
>().
like
(
CylinderUnit:
:
getRegionCode
,
regionCode
));
List
<
CylinderUnitDto
>
result
=
new
ArrayList
<>();
unitList
.
stream
().
forEach
(
t
->
{
CylinderUnitDto
temp
=
new
CylinderUnitDto
();
BeanUtils
.
copyProperties
(
t
,
temp
);
temp
.
setOutOfDate
(
false
);
int
num
=
cylinderUnitServiceImpl
.
getWarnNumByAppId
(
t
.
getAppId
());
if
(
num
>
0
)
{
temp
.
setOutOfDate
(
true
);
}
num
=
cylinderUnitServiceImpl
.
getLicenseOutOfDate
(
temp
.
getCreditCode
());
if
(
num
>
0
){
temp
.
setOutOfDate
(
true
);
}
result
.
add
(
temp
);
});
return
ResponseHelper
.
buildResponse
(
result
);
return
ResponseHelper
.
buildResponse
(
cylinderUnitServiceImpl
.
getMessage
(
regionCode
));
// List<CylinderUnit> unitList = cylinderUnitServiceImpl
// .list(new LambdaQueryWrapper<CylinderUnit>().like(CylinderUnit::getRegionCode, regionCode));
//
// List<CylinderUnitDto> result = new ArrayList<>();
// unitList.stream().forEach(t -> {
// CylinderUnitDto temp = new CylinderUnitDto();
// BeanUtils.copyProperties(t, temp);
// temp.setOutOfDate(false);
// int num = cylinderUnitServiceImpl.getWarnNumByAppId(t.getAppId());
// if (num > 0) {
// temp.setOutOfDate(true);
// }
// num = cylinderUnitServiceImpl.getLicenseOutOfDate(temp.getCreditCode());
// if(num > 0){
// temp.setOutOfDate(true);
// }
// result.add(temp);
// });
// return ResponseHelper.buildResponse(result);
}
/**
...
...
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/CylinderUnitServiceImpl.java
View file @
5c1fe114
...
...
@@ -149,4 +149,9 @@ public class CylinderUnitServiceImpl extends BaseService<CylinderUnitDto, Cylind
public
Integer
getLicenseOutOfDate
(
String
creditCode
){
return
baseMapper
.
getLicenseOutOfDate
(
creditCode
);
}
public
List
<
CylinderUnitDto
>
getMessage
(
String
regionCode
){
return
baseMapper
.
getMessage
(
regionCode
);
}
}
\ 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