Commit 14a8ed88 authored by suhuiguang's avatar suhuiguang

1.设备列表增加按钮控制显示隐藏删除、编辑按钮,A050需求

parent aff6e4ef
......@@ -12,8 +12,6 @@ import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNoticeEq;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationEq;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.ConstructionEnum;
import com.yeejoin.amos.boot.module.jg.biz.config.LocalBadRequest;
......@@ -222,6 +220,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
}
private Boolean checkEquipIsCanEdit(String record) {
Integer inUseTime = commonService.countEquipInUseTimesForEdit(record);
return inUseTime <= 0;
}
/**
* 删除设备注册信息(批量删除)
*
......@@ -268,6 +271,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
private Boolean checkEquipIsCanDelete(String record) {
Integer useTime = commonService.countEquipInUseTimesForDel(record);
return useTime <= 0;
}
private String getTipMsgString(String record) {
IdxBizJgRegisterInfo registerInfo = this.getOne(new QueryWrapper<IdxBizJgRegisterInfo>().eq("RECORD", record));
return String.format("存在被引用的设备,设备代码:%s", registerInfo.getEquCode());
......@@ -1245,6 +1253,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
for(JSONObject item : list){
String fullAddress = equAddressMap.get(item.getString("SEQUENCE_NBR"));
item.put("ADDRESS", !ValidationUtil.isEmpty(fullAddress) ? fullAddress : "");
item.put("CAN_EDIT", this.checkEquipIsCanEdit(item.getString("SEQUENCE_NBR")));
item.put("CAN_DELETE", this.checkEquipIsCanDelete(item.getString("SEQUENCE_NBR")));
}
}
totle = response.getInternalResponse().hits().getTotalHits().value;
......
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