Commit ce6858a7 authored by 韩桐桐's avatar 韩桐桐

fix(jg):启用停用

parent faf4f685
......@@ -66,9 +66,6 @@ public class JgEnableDisableDto extends BaseDto {
@ApiModelProperty(value = "设备代码")
private String equCode;
@ApiModelProperty(value = "使用登记证编号")
private String useRegistrationCode;
@ApiModelProperty(value = "96333识别码")
private String code96333;
......@@ -112,4 +109,16 @@ public class JgEnableDisableDto extends BaseDto {
@ApiModelProperty(value = "其他附件")
private String otherAccessories;
@ApiModelProperty(value = "设备种类code")
private String equListCode;
@ApiModelProperty(value = "设备种类name")
private String equListName;
@ApiModelProperty(value = "使用登记证id,多个逗号分割")
private String registrationManageId;
@ApiModelProperty(value = "使用登记证编号,多个逗号分割(冗余前端检索使用)")
private String useRegistrationCode;
}
......@@ -167,4 +167,30 @@ public class JgEnableDisable extends BaseEntity {
*/
@TableField(value = "other_accessories")
private String otherAccessories;
/**
* 设备种类code
*/
@TableField(value = "equ_list_code")
private String equListCode;
/**
* 设备种类名称
*/
@TableField(value = "equ_list_name")
private String equListName;
/**
* 使用登记证id,多个逗号分割
*/
@TableField("registration_manage_id")
private String registrationManageId;
/**
* 使用登记证编号,多个逗号分割(冗余前端检索使用)
*/
@TableField(value = "use_registration_code")
private String useRegistrationCode;
}
......@@ -9,17 +9,12 @@
else '设备启用' end as applyType,
jed.sequence_nbr as sequenceNbr,
jed.apply_no as applyNo,
jed.equ_list_code as equListCode,
jed.equ_list_name as equListName,
date_format(jed.apply_date, '%Y-%m-%d') as applyDate,
date_format(jed.audit_pass_date, '%Y-%m-%d') as auditPassDate,
jri.USE_ORG_CODE as useOrgCode,
jri.PRODUCT_NAME as productName,
jri.EQU_CODE AS equCode,
jri.USE_ORG_CODE AS useRegistrationCode,
use.USE_UNIT_NAME as useUnitName,
jed.receive_org_name as receiveOrgName,
concat(use."PROVINCE_NAME", '', use."CITY_NAME", '', use."COUNTY_NAME", '', use."STREET_NAME") as address,
use."ADDRESS" as detailedAddress,
use."USE_INNER_CODE" as useInnerCode,
jed.use_registration_code as useRegistrationCode,
jed.audit_status as auditStatus,
jed.instance_id as instanceId,
jed.execute_sequence as executeSequence,
......@@ -27,17 +22,8 @@
jed.promoter,
jed.next_execute_user_ids as nextExecuteUserIds,
jed.create_user_id as createUserId,
jed.next_task_id as nextTaskId,
oi.SUPERVISORY_CODE AS supervisoryCode,
oi.CODE96333 as code96333,
(SELECT name from tz_equipment_category WHERE code = jri.EQU_LIST) AS equList,
(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as equCategory,
(SELECT name from tz_equipment_category where code = jri.EQU_DEFINE) as equDefine
jed.next_task_id as nextTaskId
FROM tzs_jg_enable_disable jed
LEFT JOIN tzs_jg_enable_disable_eq jede on jed.sequence_nbr = jede.enable_disable_apply_id
LEFT JOIN idx_biz_jg_register_info jri on jede.equ_id = jri.RECORD
LEFT JOIN idx_biz_jg_use_info use on jri.RECORD = use.RECORD
LEFT JOIN idx_biz_jg_other_info oi ON oi.RECORD = jede.equ_id
<where>
jed.is_delete = 0
<if test="dto.applyNo != null and dto.applyNo != '' ">
......@@ -63,33 +49,10 @@
and jed.apply_date like concat('%',DATE_FORMAT(#{dto.applicationDate},'%Y-%m-%d'),'%')
</if>
<if test="dto.equList != null and dto.equList != ''">
AND jri."EQU_LIST" = #{dto.equList}
</if>
<if test="dto.equCategory != null and dto.equCategory != ''">
AND jri."equ_category" = #{dto.equCategory}
</if>
<if test="dto.equDefine != null and dto.equDefine != ''">
AND jri."EQU_DEFINE" = #{dto.equDefine}
</if>
<if test="dto.equCode != null and dto.equCode != ''">
AND jri."EQU_CODE" like concat('%',#{dto.equCode},'%')
AND jed.equ_list_code = #{dto.equList}
</if>
<if test="dto.useRegistrationCode != null and dto.useRegistrationCode != ''">
AND jri."USE_ORG_CODE" like concat('%',#{dto.useRegistrationCode},'%')
</if>
<if test="dto.code96333 != null and dto.code96333 != ''">
AND oi.CODE96333 like concat('%',#{dto.code96333},'%')
</if>
<if test="dto.supervisoryCode != null and dto.supervisoryCode != ''">
AND oi.SUPERVISORY_CODE like concat('%',#{dto.supervisoryCode},'%')
</if>
<if test="dto.address != null and dto.address != ''">
AND (
use."PROVINCE_NAME" LIKE CONCAT('%', #{dto.address}, '%')
OR use."CITY_NAME" LIKE CONCAT('%', #{dto.address}, '%')
OR use."COUNTY_NAME" LIKE CONCAT('%', #{dto.address}, '%')
OR use."STREET_NAME" LIKE CONCAT('%', #{dto.address}, '%')
)
AND jed."use_registration_code" like concat('%',#{dto.useRegistrationCode},'%')
</if>
</where>
order by
......
......@@ -224,11 +224,12 @@ public class JgUseRegistrationManageController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "根据证的sequenceNbr 批量查询证下面的所有设备", notes = "根据证的sequenceNbr 批量查询证下面的所有设备")
public ResponseModel<Page<JSONObject>> queryEquByCertificateSeqList(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@RequestParam(value = "enableType") String enableType,
@RequestParam(value = "sequenceNbrs") String sequenceNbrs) {
List<Long> collect = Arrays.stream(sequenceNbrs.split(","))
.map(Long::parseLong)
.collect(Collectors.toList());
return ResponseHelper.buildResponse(jgUseRegistrationManageServiceImpl.queryEquForPageByCertificateSeqList(collect, current, size));
return ResponseHelper.buildResponse(jgUseRegistrationManageServiceImpl.queryEquForPageByCertificateSeqList(enableType,collect, current, size));
}
/**
......
......@@ -17,6 +17,7 @@ import com.yeejoin.amos.boot.module.jg.api.service.IJgUseRegistrationManageServi
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.RequestOptions;
......@@ -253,7 +254,7 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
* @return
*/
public Page<JSONObject> certificateEquList(int current, int size, String sequenceNbr) {
return queryEquForPageByCertificateSeqList(Collections.singletonList(Long.parseLong(sequenceNbr)), current, size);
return queryEquForPageByCertificateSeqList("",Collections.singletonList(Long.parseLong(sequenceNbr)), current, size);
}
/**
......@@ -311,12 +312,13 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
/**
* 根据证的sequenceNbr集合,批量查询证下面的所有设备
*
* @param enableType 启用停用业务使用 - 过滤设备状态 (1:在用 2:停用) 对应枚举:EquimentEnum
* @param sequenceNbrList 证的sequenceNbr集合
* @param current 分页-当前页
* @param size 分页-分页数
* @return 查询结果
*/
public Page<JSONObject> queryEquForPageByCertificateSeqList(List<Long> sequenceNbrList, int current, int size) {
public Page<JSONObject> queryEquForPageByCertificateSeqList(String enableType,List<Long> sequenceNbrList, int current, int size) {
List<JgUseRegistrationManage> jgUseRegistrationManageList = this.baseMapper.selectList(new LambdaQueryWrapper<JgUseRegistrationManage>()
.in(JgUseRegistrationManage::getSequenceNbr, sequenceNbrList)
.eq(JgUseRegistrationManage::getIsDelete, 0));
......@@ -338,6 +340,14 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery();
TermsQueryBuilder termsQuery = QueryBuilders.termsQuery("USE_ORG_CODE", useOrgCodes);
boolQuery.must(termsQuery);
// 设备状态 对应枚举EquimentEnum
if (!ObjectUtils.isEmpty(enableType)) {
BoolQueryBuilder elcBuilder = QueryBuilders.boolQuery();
elcBuilder.must(QueryBuilders.matchPhraseQuery("EQU_STATE", QueryParser.escape(enableType)));
boolQuery.must(elcBuilder);
}
builder.query(boolQuery);
builder.from((current - 1) * size);
builder.size(size);
......
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