|
|
|
@ -262,15 +262,43 @@ public class EquipmentLedgerController extends DafController { |
|
|
|
|
@ApiOperationSupport(order = 2) |
|
|
|
|
@ApiOperation(value = "远程搜索", notes = "传入") |
|
|
|
|
public R<List<EquipmentLedger>> listByCoding(String coding) { |
|
|
|
|
// boolean isNumId = false;
|
|
|
|
|
QueryWrapper<EquipmentLedger> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
if (StringUtils.isNotEmpty(coding)) { |
|
|
|
|
queryWrapper.lambda().like(EquipmentLedger::getKksEncoding, coding); |
|
|
|
|
if (coding.matches("\\d+")) { |
|
|
|
|
// isNumId = true;
|
|
|
|
|
queryWrapper.nested(wrapper -> wrapper.eq("id", Long.parseLong(coding)) |
|
|
|
|
.or().lambda().like(EquipmentLedger::getKksEncoding, coding)); |
|
|
|
|
} else { |
|
|
|
|
queryWrapper.lambda().like(EquipmentLedger::getKksEncoding, coding); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
queryWrapper.lambda().eq(EquipmentLedger::getCheckStatus, 2); |
|
|
|
|
queryWrapper.lambda().eq(EquipmentLedger::getIsDeleted, DafConstant.DB_NOT_DELETED); |
|
|
|
|
queryWrapper.lambda().orderByDesc(EquipmentLedger::getKksEncoding); |
|
|
|
|
queryWrapper.lambda().orderByAsc(EquipmentLedger::getKksEncoding); |
|
|
|
|
queryWrapper.lambda().last(" LIMIT 50"); |
|
|
|
|
List<EquipmentLedger> list = equipmentLedgerService.list(queryWrapper); |
|
|
|
|
|
|
|
|
|
// int listSize = list.size();
|
|
|
|
|
|
|
|
|
|
// if (isNumId && listSize < 50) {
|
|
|
|
|
// int lastLen = 50 - listSize;
|
|
|
|
|
// List<Long> notQueryIds = new ArrayList<>();
|
|
|
|
|
// for (EquipmentLedger ledger: list) {
|
|
|
|
|
// notQueryIds.add(ledger.getId());
|
|
|
|
|
// }
|
|
|
|
|
// QueryWrapper<EquipmentLedger> queryWrapperExt = new QueryWrapper<>();
|
|
|
|
|
// if (notQueryIds.size() > 0) {
|
|
|
|
|
// queryWrapperExt.lambda().notIn(EquipmentLedger::getId, notQueryIds);
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// queryWrapperExt.lambda().eq(EquipmentLedger::getCheckStatus, 2);
|
|
|
|
|
// queryWrapperExt.lambda().eq(EquipmentLedger::getIsDeleted, DafConstant.DB_NOT_DELETED);
|
|
|
|
|
// queryWrapperExt.lambda().orderByAsc(EquipmentLedger::getKksEncoding);
|
|
|
|
|
// queryWrapperExt.lambda().last(" LIMIT " + lastLen);
|
|
|
|
|
// List<EquipmentLedger> listExt = equipmentLedgerService.list(queryWrapperExt);
|
|
|
|
|
// list.addAll(listExt);
|
|
|
|
|
// }
|
|
|
|
|
return R.data(list); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|