Commit 03809c42 authored by kongfm's avatar kongfm

更新告知书相关接口

parent 91cdcdfd
...@@ -98,4 +98,42 @@ public class CylinderFillingRecordDto extends BaseDto { ...@@ -98,4 +98,42 @@ public class CylinderFillingRecordDto extends BaseDto {
@ApiModelProperty(value = "对接公司编码") @ApiModelProperty(value = "对接公司编码")
private String appId; private String appId;
@ApiModelProperty(value = "是否在检验有效期以内")
private String isValid;
@ApiModelProperty(value = "警示标签上印有的瓶装气体的名称及化学分子式应与气瓶钢印标志是否一致")
private Integer same;
@ApiModelProperty(value = "气瓶外表面的颜色标志是否符合规定")
private Integer isRegulations;
@ApiModelProperty(value = "气瓶瓶阀的出气口螺纹型式是否符合GB/T15383")
private Integer isComplianceWithgbt;
@ApiModelProperty(value = "气瓶内有无剩余压力")
private Integer haveStillPressure;
@ApiModelProperty(value = "气瓶外表面有无裂纹、严重腐蚀、明显变形及其他严重外部损伤缺陷")
private Integer isComplete;
@ApiModelProperty(value = "气瓶的安全附件齐全并符合安全要求")
private Integer haveSecurityDocuments;
@ApiModelProperty(value = "充装量在规定范围内")
private Integer withinScope;
@ApiModelProperty(value = "瓶阀及其与瓶口连接的密封良好")
private Integer sealedState;
@ApiModelProperty(value = "瓶体未出现鼓包变形或泄露等严重缺陷")
private Integer defective;
@ApiModelProperty(value = "瓶体温度没有异常升高的迹象")
private Integer abnormalTemperature;
@ApiModelProperty(value = "气瓶粘贴警示标签和充装标签")
private Integer warningSign;
} }
...@@ -103,4 +103,7 @@ public class CylinderInfoDto extends BaseDto { ...@@ -103,4 +103,7 @@ public class CylinderInfoDto extends BaseDto {
@ApiModelProperty(value = "查询单位appid") @ApiModelProperty(value = "查询单位appid")
private List<String> appIds; private List<String> appIds;
@ApiModelProperty(value = "检验状态 0 已超期 1 正常 2 即将超期")
private int inspectionStatas;
} }
...@@ -117,4 +117,7 @@ public class CylinderUnitDto extends BaseDto { ...@@ -117,4 +117,7 @@ public class CylinderUnitDto extends BaseDto {
@ApiModelProperty(value = "充装许可证有效期结束") @ApiModelProperty(value = "充装许可证有效期结束")
private String fillingPermitDateEnd; private String fillingPermitDateEnd;
@ApiModelProperty(value = "行政许可有效期 0 已超期 1 正常 2 即将超期")
private Integer licenseStatus;
} }
...@@ -54,6 +54,13 @@ ...@@ -54,6 +54,13 @@
END AS abnormalStr, END AS abnormalStr,
b.inspection_date as inspectionDate, b.inspection_date as inspectionDate,
b.inspector_user as inspector_user, b.inspector_user as inspector_user,
b.is_valid,
b.same,
b.is_regulations,
b.is_complete,
b.have_still_pressure,
b.is_complete,
b.have_security_documents,
(b.is_valid+b.same+b.is_regulations+b.is_complete+b.have_still_pressure+b.is_complete+b.have_security_documents) as count, (b.is_valid+b.same+b.is_regulations+b.is_complete+b.have_still_pressure+b.is_complete+b.have_security_documents) as count,
case b.is_valid+b.same+b.is_regulations+b.is_complete+b.have_still_pressure+b.is_complete+b.have_security_documents case b.is_valid+b.same+b.is_regulations+b.is_complete+b.have_still_pressure+b.is_complete+b.have_security_documents
when 7 then '合格' when 7 then '合格'
...@@ -62,6 +69,11 @@ ...@@ -62,6 +69,11 @@
end as fillingResult, end as fillingResult,
af.inspector as inspector, af.inspector as inspector,
af.inspection_date as inspectionDateAfter, af.inspection_date as inspectionDateAfter,
af.within_scope,
af.sealed_state,
af.defective,
af.abnormal_temperature,
af.warning_sign,
case af.within_scope+af.sealed_state+af.defective+af.abnormal_temperature+af.warning_sign case af.within_scope+af.sealed_state+af.defective+af.abnormal_temperature+af.warning_sign
when 5 then '合格' when 5 then '合格'
else else
...@@ -75,7 +87,11 @@ ...@@ -75,7 +87,11 @@
date_format(`b`.`inspection_date`,'%Y-%m-%d') = date_format(`r`.`filling_startTime`,'%Y-%m-%d') date_format(`b`.`inspection_date`,'%Y-%m-%d') = date_format(`r`.`filling_startTime`,'%Y-%m-%d')
inner join tz_cylinder_filling_check af on af.sequence_code = r.sequence_code AND inner join tz_cylinder_filling_check af on af.sequence_code = r.sequence_code AND
date_format(`af`.`inspection_date`,'%Y-%m-%d') = date_format(`r`.`filling_startTime`,'%Y-%m-%d') date_format(`af`.`inspection_date`,'%Y-%m-%d') = date_format(`r`.`filling_startTime`,'%Y-%m-%d')
WHERE r.app_id = #{appId} AND date_format(`r`.`filling_startTime`,'%Y-%m-%d') >= '2022-03-01' WHERE
1= 1
<if test="appId != null and appId != ''">
AND r.app_id = #{appId}
</if>
<if test="fillingUnitName != null and fillingUnitName != ''"> <if test="fillingUnitName != null and fillingUnitName != ''">
AND r.filling_unit_name like AND r.filling_unit_name like
CONCAT(CONCAT('%',#{fillingUnitName}),'%') CONCAT(CONCAT('%',#{fillingUnitName}),'%')
......
...@@ -442,7 +442,9 @@ public class CylinderInfoController extends BaseController { ...@@ -442,7 +442,9 @@ public class CylinderInfoController extends BaseController {
sortParam = "r.sync_date"; sortParam = "r.sync_date";
sortRule = "desc"; sortRule = "desc";
} }
cylinderFillingRecordDto.setAppId("9B150BB7D0C21A7A62BD6837E14A44BF"); if(StringUtils.isEmpty(cylinderFillingRecordDto.getSequenceCode())) {
cylinderFillingRecordDto.setAppId("9B150BB7D0C21A7A62BD6837E14A44BF");
}
Page<CylinderFillingRecordDto> pageBean = cylinderFillingRecordServiceImpl.queryListByQueryDto(page,cylinderFillingRecordDto, sortParam, sortRule); Page<CylinderFillingRecordDto> pageBean = cylinderFillingRecordServiceImpl.queryListByQueryDto(page,cylinderFillingRecordDto, sortParam, sortRule);
Page<CylinderFillingRecordDto> result = new Page<CylinderFillingRecordDto>(pageNum,pageSize); Page<CylinderFillingRecordDto> result = new Page<CylinderFillingRecordDto>(pageNum,pageSize);
long totle = pageBean.getTotal(); long totle = pageBean.getTotal();
...@@ -453,7 +455,7 @@ public class CylinderInfoController extends BaseController { ...@@ -453,7 +455,7 @@ public class CylinderInfoController extends BaseController {
/** /**
* 列表分页查询 * 气瓶基本信息
* *
* @param pageNum 当前页 * @param pageNum 当前页
* @param pageSize 每页大小 * @param pageSize 每页大小
...@@ -475,6 +477,9 @@ public class CylinderInfoController extends BaseController { ...@@ -475,6 +477,9 @@ public class CylinderInfoController extends BaseController {
unitList.stream().forEach(u -> { unitList.stream().forEach(u -> {
appids.add(u.getAppId()); appids.add(u.getAppId());
}); });
if (appids.size() == 0) {
appids.add("-1");
}
cylinderInfoDto.setAppIds(appids); cylinderInfoDto.setAppIds(appids);
} }
setQueryWrapper(cylinderInfoQueryWrapper, cylinderInfoDto, sort); setQueryWrapper(cylinderInfoQueryWrapper, cylinderInfoDto, sort);
...@@ -509,6 +514,9 @@ public class CylinderInfoController extends BaseController { ...@@ -509,6 +514,9 @@ public class CylinderInfoController extends BaseController {
if(!ValidationUtil.isEmpty(cylinderInfo.getInspectionDateStart())) { if(!ValidationUtil.isEmpty(cylinderInfo.getInspectionDateStart())) {
queryWrapper.ge("inspection_date",cylinderInfo.getInspectionDateStart()); queryWrapper.ge("inspection_date",cylinderInfo.getInspectionDateStart());
} }
if(!ValidationUtil.isEmpty(cylinderInfo.getAppId())) {
queryWrapper.eq("app_id",cylinderInfo.getAppId());
}
if(!ValidationUtil.isEmpty(cylinderInfo.getInspectionDateEnd())) { if(!ValidationUtil.isEmpty(cylinderInfo.getInspectionDateEnd())) {
queryWrapper.le("inspection_date",cylinderInfo.getInspectionDateEnd()); queryWrapper.le("inspection_date",cylinderInfo.getInspectionDateEnd());
...@@ -547,8 +555,63 @@ public class CylinderInfoController extends BaseController { ...@@ -547,8 +555,63 @@ public class CylinderInfoController extends BaseController {
return queryWrapper; return queryWrapper;
} }
/** /**
* 列表分页查询 * 获取气瓶详细信息
* @param sequenceNbr
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/cyinderInfo/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "获取气瓶详细信息", notes = "获取气瓶详细信息")
public ResponseModel<CylinderInfoDto> cyinderInfoList(@PathVariable Long sequenceNbr) {
CylinderInfo cylinderInfo = cylinderInfoServiceImpl.getById(sequenceNbr);
CylinderInfoDto target = new CylinderInfoDto();
// 把原对象数据拷贝到新对象
BeanUtils.copyProperties(cylinderInfo, target);
if(0 == cylinderInfo.getCylinderStatus()) {
target.setCylinderStatusStr("在用");
} else if(1 == cylinderInfo.getCylinderStatus()) {
target.setCylinderStatusStr("停用");
} else if(2 == cylinderInfo.getCylinderStatus()) {
target.setCylinderStatusStr("注销");
} else if(3 == cylinderInfo.getCylinderStatus()) {
target.setCylinderStatusStr("报废");
} else {
target.setCylinderStatusStr("");
}
if(1 == cylinderInfo.getCylinderVariety()) {
target.setCylinderVarietyStr("无缝气瓶");
} else if(2 == cylinderInfo.getCylinderVariety()) {
target.setCylinderVarietyStr("焊接气瓶");
} else if(3 == cylinderInfo.getCylinderVariety()) {
target.setCylinderVarietyStr("缠绕气瓶");
} else if(4 == cylinderInfo.getCylinderVariety()) {
target.setCylinderVarietyStr("绝热气瓶");
} else if(5 ==cylinderInfo.getCylinderVariety()) {
target.setCylinderVarietyStr("内装填料气瓶");
} else {
target.setCylinderVarietyStr("");
}
Date nextDate = target.getNextInspectionDate();
long dates = nextDate.getTime() - System.currentTimeMillis();
if(dates >= 1000 * 60 * 60 * 24 * 30 ) {
target.setInspectionStatas(1);
} else if(0< dates && dates < 1000 * 60 * 60 * 24 * 30) {
target.setInspectionStatas(2);
} else {
target.setInspectionStatas(0);
}
return ResponseHelper.buildResponse(target);
}
/**
* 获取登陆人所在气瓶充装单位信息
* *
* @param pageNum 当前页 * @param pageNum 当前页
* @param pageSize 每页大小 * @param pageSize 每页大小
...@@ -575,6 +638,61 @@ public class CylinderInfoController extends BaseController { ...@@ -575,6 +638,61 @@ public class CylinderInfoController extends BaseController {
return ResponseHelper.buildResponse(result); return ResponseHelper.buildResponse(result);
} }
/**
* 获取气瓶充装单位详情
* @param sequenceNbr
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/cylinderUnit/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "获取气瓶充装单位详情", notes = "获取气瓶充装单位详情")
public ResponseModel<CylinderUnitDto> cyinderUnitList(@PathVariable Long sequenceNbr) {
CylinderUnit cylinderUnit = cylinderUnitServiceImpl.getById(sequenceNbr);
if(this.regionMap == null) {
this.regionMap = new HashMap<>();
Collection<RegionModel> regions = Systemctl.regionClient.queryForTree(null).getResult();
regions.stream().forEach(t -> {
this.addRegionsMap(regionMap,t);
});
}
CylinderUnitDto target = new CylinderUnitDto();
// 把原对象数据拷贝到新对象
BeanUtils.copyProperties(cylinderUnit, target);
String regionCode = cylinderUnit.getRegionCode();
String[] regionCodes = regionCode.split("#");
regionCode = "";
for(int i =0 ; i < regionCodes.length ; i ++) {
regionCode += this.regionMap.get(Integer.parseInt(regionCodes[i]));
}
target.setRegionCode(regionCode);
if(1 == cylinderUnit.getUnitType()) {
target.setUnitTypeStr("液化石油气瓶充装单位");
} else if(2 == cylinderUnit.getUnitType()) {
target.setUnitTypeStr("液化石油气瓶检验单位");
} else if(3 == cylinderUnit.getUnitType()) {
target.setUnitTypeStr("液化石油气瓶生产单位");
} else {
target.setUnitTypeStr("");
}
target.setCylinderNumber((long) cylinderInfoServiceImpl.count(new LambdaQueryWrapper<CylinderInfo>().eq(CylinderInfo::getAppId,target.getAppId())));
target.setCylinderOutOfDate((long) cylinderInfoServiceImpl.count(new LambdaQueryWrapper<CylinderInfo>().eq(CylinderInfo::getAppId,target.getAppId()).le(CylinderInfo::getNextInspectionDate,new Date())));
Date nextDate = target.getFillingPermitDate();
long dates = nextDate.getTime() - System.currentTimeMillis();
if(dates >= 1000 * 60 * 60 * 24 * 200 ) {
target.setLicenseStatus(1);
} else if(0< dates && dates < 1000 * 60 * 60 * 24 * 200) {
target.setLicenseStatus(2);
} else {
target.setLicenseStatus(0);
}
return ResponseHelper.buildResponse(target);
}
private QueryWrapper<CylinderUnit> setQueryWrapper(QueryWrapper<CylinderUnit> queryWrapper, CylinderUnitDto cylinderUnitDto, String sort) { private QueryWrapper<CylinderUnit> setQueryWrapper(QueryWrapper<CylinderUnit> queryWrapper, CylinderUnitDto cylinderUnitDto, String sort) {
if(sort!=null) { // 排序失效 if(sort!=null) { // 排序失效
String[] date= sort.split(","); String[] date= sort.split(",");
......
...@@ -1434,7 +1434,7 @@ ...@@ -1434,7 +1434,7 @@
</preConditions> </preConditions>
<comment>add view view_checkout_boil_table</comment> <comment>add view view_checkout_boil_table</comment>
<sql> <sql>
create view view_checkout_boil_table as select `a`.`sequence_nbr` AS `sequence_nbr`,`a`.`cylinder_id` AS `cylinder_id`,`a`.`unit_name` AS `unit_name`,`a`.`factory_num` AS `factory_num`,`a`.`cylinder_status` AS `cylinder_status`,`a`.`cylinder_variety` AS `cylinder_variety`,`a`.`qrCode` AS `qrCode`,`a`.`electronic_label_code` AS `electronic_label_code`,`a`.`filling_medium` AS `filling_medium`,`a`.`pressure` AS `pressure`,`a`.`volume` AS `volume`,`a`.`manufacturing_date` AS `manufacturing_date`,`a`.`manufacturing_unit` AS `manufacturing_unit`,`a`.`license` AS `license`,`a`.`cylinder_weight` AS `cylinder_weight`,`a`.`unit_inner_code` AS `unit_inner_code`,`a`.`inspection_date` AS `inspection_date`,`a`.`next_inspection_date` AS `next_inspection_date`,`a`.`sequence_code` AS `sequence_code`,`a`.`rec_date` AS `rec_date`,`a`.`rec_user_id` AS `rec_user_id`,`a`.`sync_date` AS `sync_date`,`a`.`sync_state` AS `sync_state`,`a`.`app_id` AS `app_id`,`u`.`region_code` AS `region_code`,(case when (now() > `a`.`next_inspection_date`) then '已超期' when ((to_days(`a`.`next_inspection_date`) - to_days(now())) &lt;= 30) then '即将超期' end) AS `status` from (((select `t`.`sequence_nbr` AS `sequence_nbr`,`t`.`cylinder_id` AS `cylinder_id`,`t`.`unit_name` AS `unit_name`,`t`.`factory_num` AS `factory_num`,`t`.`cylinder_status` AS `cylinder_status`,`t`.`cylinder_variety` AS `cylinder_variety`,`t`.`qrCode` AS `qrCode`,`t`.`electronic_label_code` AS `electronic_label_code`,`t`.`filling_medium` AS `filling_medium`,`t`.`pressure` AS `pressure`,`t`.`volume` AS `volume`,`t`.`manufacturing_date` AS `manufacturing_date`,`t`.`manufacturing_unit` AS `manufacturing_unit`,`t`.`license` AS `license`,`t`.`cylinder_weight` AS `cylinder_weight`,`t`.`unit_inner_code` AS `unit_inner_code`,`t`.`inspection_date` AS `inspection_date`,`t`.`next_inspection_date` AS `next_inspection_date`,`t`.`sequence_code` AS `sequence_code`,`t`.`rec_date` AS `rec_date`,`t`.`rec_user_id` AS `rec_user_id`,`t`.`sync_date` AS `sync_date`,`t`.`sync_state` AS `sync_state`,`t`.`app_id` AS `app_id` from `xiy_amos_tzs_biz`.`tz_cylinder_info` `t` where (`t`.`sequence_nbr` in (select max(`tt`.`sequence_nbr`) AS `sequence_nbr` from `xiy_amos_tzs_biz`.`tz_cylinder_info` `tt` group by `tt`.`sequence_code`) and ((`t`.`next_inspection_date` &lt; now()) or ((to_days(`t`.`next_inspection_date`) - to_days(now())) &lt;= 30))))) `a` left join `xiy_amos_tzs_biz`.`tz_cylinder_unit` `u` on((`u`.`app_id` = `a`.`app_id`))) create view view_checkout_boil_table as select `a`.`sequence_nbr` AS `sequence_nbr`,`a`.`cylinder_id` AS `cylinder_id`,`a`.`unit_name` AS `unit_name`,`a`.`factory_num` AS `factory_num`,`a`.`cylinder_status` AS `cylinder_status`,`a`.`cylinder_variety` AS `cylinder_variety`,`a`.`qrCode` AS `qrCode`,`a`.`electronic_label_code` AS `electronic_label_code`,`a`.`filling_medium` AS `filling_medium`,`a`.`pressure` AS `pressure`,`a`.`volume` AS `volume`,`a`.`manufacturing_date` AS `manufacturing_date`,`a`.`manufacturing_unit` AS `manufacturing_unit`,`a`.`license` AS `license`,`a`.`cylinder_weight` AS `cylinder_weight`,`a`.`unit_inner_code` AS `unit_inner_code`,`a`.`inspection_date` AS `inspection_date`,`a`.`next_inspection_date` AS `next_inspection_date`,`a`.`sequence_code` AS `sequence_code`,`a`.`rec_date` AS `rec_date`,`a`.`rec_user_id` AS `rec_user_id`,`a`.`sync_date` AS `sync_date`,`a`.`sync_state` AS `sync_state`,`a`.`app_id` AS `app_id`,`u`.`region_code` AS `region_code`,(case when (now() > `a`.`next_inspection_date`) then '已超期' when ((to_days(`a`.`next_inspection_date`) - to_days(now())) &lt;= 30) then '即将超期' end) AS `status` from (((select `t`.`sequence_nbr` AS `sequence_nbr`,`t`.`cylinder_id` AS `cylinder_id`,`t`.`unit_name` AS `unit_name`,`t`.`factory_num` AS `factory_num`,`t`.`cylinder_status` AS `cylinder_status`,`t`.`cylinder_variety` AS `cylinder_variety`,`t`.`qrCode` AS `qrCode`,`t`.`electronic_label_code` AS `electronic_label_code`,`t`.`filling_medium` AS `filling_medium`,`t`.`pressure` AS `pressure`,`t`.`volume` AS `volume`,`t`.`manufacturing_date` AS `manufacturing_date`,`t`.`manufacturing_unit` AS `manufacturing_unit`,`t`.`license` AS `license`,`t`.`cylinder_weight` AS `cylinder_weight`,`t`.`unit_inner_code` AS `unit_inner_code`,`t`.`inspection_date` AS `inspection_date`,`t`.`next_inspection_date` AS `next_inspection_date`,`t`.`sequence_code` AS `sequence_code`,`t`.`rec_date` AS `rec_date`,`t`.`rec_user_id` AS `rec_user_id`,`t`.`sync_date` AS `sync_date`,`t`.`sync_state` AS `sync_state`,`t`.`app_id` AS `app_id` from `tz_cylinder_info` `t` where (`t`.`sequence_nbr` in (select max(`tt`.`sequence_nbr`) AS `sequence_nbr` from `tz_cylinder_info` `tt` group by `tt`.`sequence_code`) and ((`t`.`next_inspection_date` &lt; now()) or ((to_days(`t`.`next_inspection_date`) - to_days(now())) &lt;= 30))))) `a` left join `tz_cylinder_unit` `u` on((`u`.`app_id` = `a`.`app_id`)))
</sql> </sql>
</changeSet> </changeSet>
......
...@@ -274,12 +274,12 @@ ...@@ -274,12 +274,12 @@
<repository> <repository>
<id>Releases</id> <id>Releases</id>
<name>Releases</name> <name>Releases</name>
<url>http://172.16.1.6:8081/nexus/content/repositories/releases/</url> <url>http://4v059425e3.zicp.vip:13535/nexus/content/repositories/releases/</url>
</repository> </repository>
<repository> <repository>
<id>Snapshots</id> <id>Snapshots</id>
<name>Snapshots</name> <name>Snapshots</name>
<url>http://172.16.1.6:8081/nexus/content/repositories/snapshots/</url> <url>http://4v059425e3.zicp.vip:13535/nexus/content/repositories/snapshots/</url>
</repository> </repository>
<repository> <repository>
<id>com.e-iceblue</id> <id>com.e-iceblue</id>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment